private void tbDischargeCoefficient_TextChanged(object sender, EventArgs e) { var cD = double.NaN; if (Parsing.TryParseDouble(tbDischargeCoefficient.Text, out cD)) { //ndConvertibleValue ValueNode = new ndConvertibleValue(StockConverters.UnitlessConverter, UnitlessUnit.Unitless, new double[] { C_D }); QraStateContainer.SetNdValue("DischargeCoefficient", UnitlessUnit.Unitless, cD); } }
private void dgSystemParameters_Vehicles_CellEndEdit(object sender, DataGridViewCellEventArgs e) { GridValueChanged(sender, e); // Update annual demands var row = e.RowIndex; Debug.WriteLine("Changed row:" + row + ", col: " + e.ColumnIndex); if (row != 3) { var numVehicles = QraStateContainer.GetNdValue("nVehicles"); var numDays = QraStateContainer.GetNdValue("nVehicleOperatingDays"); var numFuelings = QraStateContainer.GetNdValue("nFuelingsPerVehicleDay"); var demands = numVehicles * numDays * numFuelings; QraStateContainer.SetNdValue("nDemands", UnitlessUnit.Unitless, demands); dgSystemParameters_Vehicles.Rows[3].Cells[1].Value = demands; // TODO: binding } }