2020-05-10 01:38:08 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FertilizerHolder
|
|
|
|
|
{
|
|
|
|
|
private Fertilizer[] FertilizerType = new Fertilizer[8];
|
|
|
|
|
|
|
|
|
|
public void init()
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
FertilizerType[0] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 999,
|
|
|
|
|
Name = "None",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 0.0f / 2,
|
|
|
|
|
Phosphorus = 0 * 0.436f / 2,
|
|
|
|
|
Potassium = 0 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[1] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 0,
|
|
|
|
|
Name = "10-26-26",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 10.0f / 2,
|
|
|
|
|
Phosphorus = 26 * 0.436f / 2,
|
|
|
|
|
Potassium = 26 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[2] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 1,
|
|
|
|
|
Name = "14-35-14",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 14.0f / 2,
|
|
|
|
|
Phosphorus = 35 * 0.436f / 2,
|
|
|
|
|
Potassium = 14 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[3] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 2,
|
|
|
|
|
Name = "17-17-17",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 17.0f / 2,
|
|
|
|
|
Phosphorus = 17 * 0.436f / 2,
|
|
|
|
|
Potassium = 17 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[4] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 3,
|
|
|
|
|
Name = "20-20",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 20.0f / 2,
|
|
|
|
|
Phosphorus = 20 * 0.436f / 2,
|
|
|
|
|
Potassium = 0 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[5] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 4,
|
|
|
|
|
Name = "28-28",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 28.0f / 2,
|
|
|
|
|
Phosphorus = 28 * 0.436f / 2,
|
|
|
|
|
Potassium = 0 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[6] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 5,
|
|
|
|
|
Name = "DAP",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 18.0f / 2,
|
|
|
|
|
Phosphorus = 46 * 0.436f / 2,
|
|
|
|
|
Potassium = 0 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[7] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 6,
|
|
|
|
|
Name = "Urea",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 46.0f / 2,
|
|
|
|
|
Phosphorus = 0 * 0.436f / 2,
|
|
|
|
|
Potassium = 0 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
FertilizerType[0] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 999,
|
|
|
|
|
Name = "None",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 0.0f / 2,
|
|
|
|
|
Phosphorus = 0 * 0.436f / 2,
|
|
|
|
|
Potassium = 0 * 0.83f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[1] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 0,
|
|
|
|
|
Name = "10-26-26",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 17.21f / 2,
|
|
|
|
|
Phosphorus = 12.14f / 2,
|
|
|
|
|
Potassium = 0.64f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[2] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 1,
|
|
|
|
|
Name = "14-35-14",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 16.89f / 2,
|
|
|
|
|
Phosphorus = 6.21f / 2,
|
|
|
|
|
Potassium = 5.21f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[3] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 2,
|
|
|
|
|
Name = "17-17-17",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 14.92f / 2,
|
|
|
|
|
Phosphorus = 14.42f / 2,
|
|
|
|
|
Potassium = 3.0f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[4] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 3,
|
|
|
|
|
Name = "20-20",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 15.39f / 2,
|
|
|
|
|
Phosphorus = 15.21f / 2,
|
|
|
|
|
Potassium = 9.5f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[5] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 4,
|
|
|
|
|
Name = "28-28",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 9.67f / 2,
|
|
|
|
|
Phosphorus = 10.47f / 2,
|
|
|
|
|
Potassium = 9.5f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[6] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 5,
|
|
|
|
|
Name = "DAP",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 14.52f / 2,
|
|
|
|
|
Phosphorus = 1.77f / 2,
|
|
|
|
|
Potassium = 9.5f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FertilizerType[7] = new Fertilizer
|
|
|
|
|
{
|
|
|
|
|
ID = 6,
|
|
|
|
|
Name = "Urea",
|
2020-05-24 01:57:27 +02:00
|
|
|
|
Nitrogen = 1.81f / 2,
|
|
|
|
|
Phosphorus = 21.0f / 2,
|
|
|
|
|
Potassium = 9.5f / 2
|
2020-05-10 01:38:08 +02:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int GetFertilizerID(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Fertilizer fertilizer in FertilizerType)
|
|
|
|
|
{
|
|
|
|
|
if (fertilizer.Name == name)
|
|
|
|
|
return fertilizer.ID;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Fertilizer GetFertilizer(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Fertilizer fertilizer in FertilizerType)
|
|
|
|
|
{
|
|
|
|
|
if (fertilizer.Name == name)
|
|
|
|
|
return fertilizer;
|
|
|
|
|
}
|
|
|
|
|
return FertilizerType[0];
|
|
|
|
|
}
|
|
|
|
|
}
|