public override void Update() { double tss = _timestepSEC; if (_infCalculation == false) { for (int i = 0; i < _amountOfCounts; i++) { _bike.update(_timestepSEC); _datlist.Add(new DataVector(i * (int)(tss * 1000), _bike.Veclocity, _bike.DistanceTraveled, _bike.Acceleration)); //get _bike status } } else { _bike.update(_timestepSEC); _datlist.Add(new DataVector(run * (int)(tss * 1000), _bike.Veclocity, _bike.DistanceTraveled, _bike.Acceleration)); run++; //get _bike status } }
public override void Update() { double rt = 0; if (_watch.IsRunning) { _watch.Stop(); rt = _watch.Elapsed.TotalSeconds; _watch.Restart(); runtime += rt; _bike.update(rt, Convert.ToInt16(_scene.PWM)); _datlist.Add(new DataVector(runtime, _bike.Veclocity, _bike.DistanceTraveled, _bike.Acceleration)); _scene.Update((float)rt, (float)_bike.Veclocity); } else { _bike.update(0, Convert.ToInt16(_scene.PWM)); _datlist.Add(new DataVector(0, _bike.Veclocity, _bike.DistanceTraveled, _bike.Acceleration)); _scene.Update(0, 0); _watch.Start(); } //throw new NotImplementedException(); }
public CSVExport() { SimProvider.Bike sim = new SimProvider.Bike(); SimProvider.Bike sim1 = new SimProvider.Bike(); string chart = "Time;Velocity;Acceleration\n"; chart += "0;" + sim.Veclocity + ";" + sim.Acceleration + "\n"; for (int i = 1; i < 50; i++) { sim.update(1, 255); chart += i + ";" + sim.Veclocity + ";" + sim.Acceleration + "\n"; } chart += ";;\n;;\n;;\n"; chart += "0;" + sim1.Veclocity + ";" + sim1.Acceleration + "\n"; for(int i = 1; i < 100; i++) { sim1.update(1, 128); chart += i + ";" + sim1.Veclocity + ";" + sim1.Acceleration + "\n"; } System.IO.File.WriteAllText("chart.csv", chart); }
public CSVExport() { SimProvider.Bike sim = new SimProvider.Bike(); SimProvider.Bike sim1 = new SimProvider.Bike(); string chart = "Time;Velocity;Acceleration\n"; chart += "0;" + sim.Veclocity + ";" + sim.Acceleration + "\n"; for (int i = 1; i < 50; i++) { sim.update(1, 255); chart += i + ";" + sim.Veclocity + ";" + sim.Acceleration + "\n"; } chart += ";;\n;;\n;;\n"; chart += "0;" + sim1.Veclocity + ";" + sim1.Acceleration + "\n"; for (int i = 1; i < 100; i++) { sim1.update(1, 128); chart += i + ";" + sim1.Veclocity + ";" + sim1.Acceleration + "\n"; } System.IO.File.WriteAllText("chart.csv", chart); }