private bool LoadTMNeeds(ref String errorMessage) { double[] tmNeedValues; double[] RPM; if (!dataFile.GetDataByName("RPM", out RPM, ref errorMessage)) return false; tmNeed = new DataContainer2D[this.gearTranslations.Length]; for (int currentGear=0; currentGear < this.gearTranslations.Length; currentGear++) { if (!dataFile.GetDataByName("TM"+currentGear.ToString(), out tmNeedValues, ref errorMessage)) return false; tmNeed[currentGear] = new DataContainer2D(); for (int i=0; i < tmNeedValues.Length; i++) { tmNeed[currentGear].Add(RPM[i], tmNeedValues[i]); } } return true; }
private bool LoadFLC(ref String errorMessage) { double currentRPM, stepSize; double[] FLCValues; fullLoadCurve = new DataContainer2D(); if (!dataFile.GetDataByName("FLC-BeginRPM", out currentRPM, ref errorMessage)) return false; if (!dataFile.GetDataByName("FLC-RPMStep", out stepSize, ref errorMessage)) return false; if (dataFile.GetDataByName("FLC-TurningMoments", out FLCValues, ref errorMessage)) { foreach (Double d in FLCValues) { fullLoadCurve.Add(currentRPM, d); currentRPM += stepSize; } } else { return false; } return true; }