예제 #1
0
        public void Simulate()
        {
            Control.UseNativeMKL();

            var ini = new Initialization()
            {
                InitialPositionX     = Plane.Position[0],
                InitialPositionY     = Plane.Position[1],
                InitialPositionZ     = Plane.Position[2],
                InitialAttitudePhi   = Plane.Phi,
                InitialAttitudePsi   = Plane.Psi,
                InitialAttitudeTheta = Plane.Theta
            };
            var conf = new HistoryDemo.Entities.Configuration()
            {
                GuidanceConfig = (HistoryDemo.Entities.GuidanceConfig)Configuration.GuidanceController
            };

            DataSendTimer.Start();
            while ((Plane.Position[2] - Ship.Position[2]) < 0)
            {
                SingleStep();
                if (step_count % 50 == 0)
                {
                    DataQueue.Enqueue(Plane.Alpha);
                }
            }

            Console.WriteLine(step_count);
            //Record.SaveToDatabase(ini, conf);
        }
예제 #2
0
 async public void SaveToDatabase(Initialization ini, HistoryDemo.Entities.Configuration conf)
 {
     string fileName = $"datalog\\{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.mat";
     await Task.Run(() => {
         Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
         SaveToFile(fileName);
         DataManipulation.Create(ini, conf, fileName);
     });
 }