public static void LoadDataTest(IFlightSimulatorsModel model, string file, string test) { System.Diagnostics.Debug.WriteLine(test); var data = model.LoadData(file, new[] { "Lon", "Lat" }); System.Diagnostics.Debug.WriteLine(new JavaScriptSerializer().Serialize(data)); }
public static void SaveDataTest(IFlightSimulatorsModel model, string ip, int port, int freq , int duration, string file, string[] vals, string test) { System.Diagnostics.Debug.WriteLine(test); //model.SaveData(ip, port,freq,duration, file, vals); System.Diagnostics.Debug.WriteLine("saved."); }
public static void GetDataTests(IFlightSimulatorsModel model) { TestConnectionAndValues(model); TestConnectionAndValues(model); TestSimulatorFewThreads(model); TestTwoSimulators(model); TestTwoSimulatorsThreads(model); }
public static void GetDataTest(IFlightSimulatorsModel model, string ip, int port, string[] vals, string test) { var res = model.GetData(ip, port, vals); System.Diagnostics.Debug.WriteLine(test); foreach (var pair in res) { System.Diagnostics.Debug.WriteLine($"{pair.Key} = {pair.Value}"); } }
public DisplayDataContainerViewModel(string p1, string p2, int p3, string file, double dur, Parameter pc, IFlightSimulatorsModel m) { Param1 = p1; Param2 = p2; Freq = p3; Duration = dur; FileName = file; paramCheck = pc; model = m; }
public static void TestTwoSimulatorsThreads(IFlightSimulatorsModel model) { new Thread(() => { GetDataTest(model, "127.0.0.1", 5401, new[] { "Lon", "Lat" }, "Test Two simulators thread1:"); }).Start(); new Thread(() => { GetDataTest(model, "127.0.0.1", 5402, new[] { "Lon", "Lat" }, "Test two simulators thread2:"); }).Start(); }
// GET: /diaplay/ public ActionResult Display(string param1, string param2, int freq = -1, double duration = -1, string fileName = "") { IFlightSimulatorsModel model = FlightSimulatorsModel.Instance; //remember to create the first instance (there is no settings this time) var vm = new DisplayDataContainerViewModel(param1, param2, freq, fileName, duration, new Parameter(), model); //if (Parameter.isIP(param1) && Parameter.isInt(param2)) return(View(vm)); //if (Parameter.isFile(param1) && Parameter.isNum(param2)) // return Content("file"); //return Content("Wrong url buddy."); }
public static void SaveDataTests(IFlightSimulatorsModel model) { SaveDataTest(model, "127.0.0.1", 5402, 4, 10, "saveTest1.txt", new[] { "Lon", "Lat" }, "simple save test:"); }
public static void TestTwoSimulators(IFlightSimulatorsModel model) { GetDataTest(model, "127.0.0.1", 5401, new[] { "Lon", "Lat" }, "Test two clients at once 1/2:"); GetDataTest(model, "127.0.0.1", 5402, new[] { "Lon", "Lat" }, "Test two clients at once 2/2:"); }
public static void TestConnectionAndValues(IFlightSimulatorsModel model) { GetDataTest(model, "127.0.0.1", 5402, new[] { "Lon", "Lat" }, "Test Connection and Values Sampling results:"); }
public static void LoadDataTests(IFlightSimulatorsModel model) { LoadDataTest(model, "saveTest1.txt", "simple load test:"); }