public double AdjuvantAmount(AreaTreatedByTank atbt) { // result = adjuvant rate * area treated by tank // if %v/v adjuvant rate / 100 * area treated by tank var result = 0.0; var waterAdded_L = 0.0; if (HistoryManager.SharedInstance.GetCurrentTankData ().adjuvantrate_value.unit == AdjuvantRateUnit.V_v) { //result = HistoryManager.SharedInstance.GetCurrentTankData ().adjuvantrate_value.value / 100 * // water add object; switch (HistoryManager.SharedInstance.GetCurrentTankData().tankcapacity_value.unit) { case TankCapacityUnit.L: waterAdded_L = WaterAdded (); break; case TankCapacityUnit.Imp0gal: var waterAdded_Imp_gal = WaterAdded (); waterAdded_L = Imp_galToL (waterAdded_Imp_gal); break; case TankCapacityUnit.Us0gal: var waterAdded_Us_gal = WaterAdded (); waterAdded_L = Us_galToL (waterAdded_Us_gal); break; } result = HistoryManager.SharedInstance.GetCurrentTankData ().adjuvantrate_value.value / 100 * waterAdded_L; } else { result = HistoryManager.SharedInstance.GetCurrentTankData ().adjuvantrate_value.value * atbt.Acres; } return result; }
public double ProductAmount(AreaTreatedByTank atbt) { // result = product rate * Area Treated by Tank var result = 0.0; switch(HistoryManager.SharedInstance.GetCurrentTankData().productrate_value.unit) { case ProductRateUnit.Acres_case: result = atbt.Acres / HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Acres_case ; break; case ProductRateUnit.G_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.G_acre * atbt.Acres; break; case ProductRateUnit.G_ha: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.G_ha * atbt.Ha; break; case ProductRateUnit.L_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.L_acre * atbt.Acres; break; case ProductRateUnit.L_ha: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.L_ha * atbt.Ha; break; case ProductRateUnit.Ml_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Ml_acre * atbt.Acres; break; case ProductRateUnit.Ml_ha: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Ml_ha * atbt.Ha; break; case ProductRateUnit.Oz_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Oz_acre * atbt.Acres; break; case ProductRateUnit.Us0fl_oz_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Us_fl_oz_acre * atbt.Acres; break; case ProductRateUnit.Us0pint_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Us_pint_acre * atbt.Acres; break; case ProductRateUnit.Us0quart_acre: result = HistoryManager.SharedInstance.GetCurrentTankData ().productrate_value.Us_quart_acre * atbt.Acres; break; } return result; }