Beispiel #1
0
        private Task DoSaveResponseFunction(object o)
        {
            return(Task.Factory.StartNew(() =>
            {
                Parent.SyncContext.Post(c =>
                {
                    System.Windows.Forms.SaveFileDialog saveFileDialog = null;
                    bool save = false;
                    saveFileDialog = new System.Windows.Forms.SaveFileDialog();
                    saveFileDialog.Filter = "Matlab (*.mat) | *.mat";
                    save = saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK;

                    if (save)
                    {
                        GenericToMatlabWritter genericToMatlabWritter = new GenericToMatlabWritter(saveFileDialog.FileName);
                        Dictionary <string, List <List <double> > > data = new Dictionary <string, List <List <double> > >();

                        data.Add("response", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.PhotometricCalibrationSettings.ResponseValues
                        });

                        genericToMatlabWritter.Write(data, "photometric");
                        genericToMatlabWritter.Save();
                    }
                }, null);
            }));
        }
Beispiel #2
0
        private Task DoSaveResponseFunction(object o)
        {
            return(Task.Factory.StartNew(() =>
            {
                Parent.SyncContext.Post(c =>
                {
                    SaveFileDialog saveFileDialog = null;
                    bool save = false;
                    saveFileDialog = new System.Windows.Forms.SaveFileDialog();
                    saveFileDialog.Filter = "Matlab (*.mat) | *.mat";
                    save = saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK;

                    if (save)
                    {
                        GenericToMatlabWritter genericToMatlabWritter = new GenericToMatlabWritter(saveFileDialog.FileName);
                        Dictionary <string, List <List <double> > > data = new Dictionary <string, List <List <double> > >();

                        (List <double> timesGyroWN, List <double> sigmasGyroWN) = CalculateSlope(Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationTime, Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.GyroscopeNoiseDensity, -0.5, 1 / Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.SampleTime, 1, 1);

                        (List <double> timesGyroRW, List <double> sigmasGyroRW) = CalculateSlope(Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationTime, Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.GyroscopeRandomWalk, +0.5, 1000, 6000, 3);

                        (List <double> timesAccWN, List <double> sigmasAccWN) = CalculateSlope(Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationTime, Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AccelerometerNoiseDensity, -0.5, 1 / Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.SampleTime, 1, 1);

                        (List <double> timesAccRW, List <double> sigmasAccRW) = CalculateSlope(Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationTime, Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AccelerometerRandomWalk, +0.5, 1000, 6000, 3);

                        data.Add("sigma_w_acc", new List <List <double> >()
                        {
                            new List <double> {
                                Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AccelerometerNoiseDensity
                            }
                        });
                        data.Add("sigma_b_acc", new List <List <double> >()
                        {
                            new List <double> {
                                Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AccelerometerRandomWalk
                            }
                        });
                        data.Add("sigma_w_gyro", new List <List <double> >()
                        {
                            new List <double> {
                                Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.GyroscopeNoiseDensity
                            }
                        });
                        data.Add("sigma_b_gyro", new List <List <double> >()
                        {
                            new List <double> {
                                Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.GyroscopeRandomWalk
                            }
                        });
                        data.Add("sample_time", new List <List <double> >()
                        {
                            new List <double> {
                                Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.SampleTime
                            }
                        });


                        data.Add("time", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationTime
                        });
                        data.Add("accX", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationAccelerometerX
                        });
                        data.Add("accY", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationAccelerometerY
                        });
                        data.Add("accZ", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationAccelerometerZ
                        });
                        data.Add("gyroX", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationGyroscopeX
                        });
                        data.Add("gyroY", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationGyroscopeY
                        });
                        data.Add("gyroZ", new List <List <double> >()
                        {
                            Parent.SettingContainer.Settings.CalibrationSettings.ImuCalibration.AllanDeviationGyroscopeZ
                        });

                        genericToMatlabWritter.Write(data, "imu");
                        genericToMatlabWritter.Save();
                    }
                }, null);
            }));
        }