示例#1
0
        public Motion(SerializationInfo info, StreamingContext context)
        {
            ChartPoints_WheelDef_X = (double[])info.GetValue("ChartPoints_WheelDef_X", typeof(double[]));
            ChartPoints_WheelDef_Y = (double[])info.GetValue("ChartPoints_WheelDef_Y", typeof(double[]));
            ChartPoints_Steering_X = (double[])info.GetValue("ChartPoints_Steering_X", typeof(double[]));
            ChartPoints_Steering_Y = (double[])info.GetValue("ChartPoints_Steering_Y", typeof(double[]));

            Final_WheelDeflectionsX = (List <double>)info.GetValue("Final_WheelDeflectionsX", typeof(List <double>));
            Final_WheelDeflectionsY = (List <double>)info.GetValue("Final_WheelDeflectionsY", typeof(List <double>));
            Final_WheelSteerX       = (List <double>)info.GetValue("Final_WheelSteerX", typeof(List <double>));
            Final_WheelSteerY       = (List <double>)info.GetValue("Final_WheelSteerY", typeof(List <double>));

            NoOfDeflections = (int)info.GetValue("NoOfDeflections", typeof(int));
            NoOfSteers      = (int)info.GetValue("NoOfSteers", typeof(int));

            MotionName       = (string)info.GetValue("MotionName", typeof(string));
            MotionID         = (int)info.GetValue("MotionID", typeof(int));
            MotionCounter    = (int)info.GetValue("MotionCounter", typeof(int));
            List_Motion      = (List <Motion>)info.GetValue("List_Motion", typeof(List <Motion>));
            Motion_MotionGUI = (MotionGUI)info.GetValue("Motion_MotionGUI", typeof(MotionGUI));
            Motion_DataTable = (DataTable)info.GetValue("Motion_DataTable", typeof(DataTable));

            WheelDeflectionExists = (bool)info.GetValue("WheelDeflectionExists", typeof(bool));
            SteeringExists        = (bool)info.GetValue("SteeringExists", typeof(bool));
        }
        public MotionChart(MotionGUI _motionGUI)
        {
            InitializeComponent();
            motionChart_MotionGUI = _motionGUI;

            /////<summary>Creating 2 points in the chart right at the start. This is done so that if user creates a motion item but doesn't create any points on the chart, then the software won't fail</summary>
            //AddPointToChart(chartControl1, 0, 0, 0);
            //AddPointToChart(chartControl1, 100, 0, 0);
            //motionChart_MotionGUI.MotionCreateOrEdit(false, DeflectionExists, SteeringExist);
        }
示例#3
0
        public void GetWheelDeflectionAndSteer(MotionGUI motion_MotionGUI, bool IsControlInitialized, bool _deflectionExists, bool _steeringExists)
        {
            Motion_MotionGUI       = motion_MotionGUI;
            NoOfDeflections        = Motion_MotionGUI.motionGUI_MotionChart.chartControl1.Series[0].Points.Count;
            ChartPoints_WheelDef_Y = new double[NoOfDeflections];
            ChartPoints_WheelDef_X = new double[NoOfDeflections];

            for (int i_Motion_Heave = 0; i_Motion_Heave < NoOfDeflections; i_Motion_Heave++)
            {
                ChartPoints_WheelDef_Y[i_Motion_Heave] = Convert.ToDouble(Motion_MotionGUI.motionGUI_MotionChart.chartControl1.Series[0].Points[i_Motion_Heave].GetNumericValue(DevExpress.XtraCharts.ValueLevel.Value));
                ChartPoints_WheelDef_X[i_Motion_Heave] = Convert.ToDouble(Motion_MotionGUI.motionGUI_MotionChart.chartControl1.Series[0].Points[i_Motion_Heave].Argument);
            }

            Array.Sort(ChartPoints_WheelDef_X, ChartPoints_WheelDef_Y);

            NoOfSteers             = Motion_MotionGUI.motionGUI_MotionChart.chartControl2.Series[0].Points.Count;
            ChartPoints_Steering_Y = new double[NoOfSteers];
            ChartPoints_Steering_X = new double[NoOfSteers];

            for (int i_Motion_Steer = 0; i_Motion_Steer < NoOfSteers; i_Motion_Steer++)
            {
                ChartPoints_Steering_Y[i_Motion_Steer] = Convert.ToDouble(Motion_MotionGUI.motionGUI_MotionChart.chartControl2.Series[0].Points[i_Motion_Steer].GetNumericValue(DevExpress.XtraCharts.ValueLevel.Value));
                ChartPoints_Steering_X[i_Motion_Steer] = Convert.ToDouble(Motion_MotionGUI.motionGUI_MotionChart.chartControl2.Series[0].Points[i_Motion_Steer].Argument);
            }

            Array.Sort(ChartPoints_Steering_X, ChartPoints_Steering_Y);

            if (_deflectionExists)
            {
                WheelDeflectionExists = _deflectionExists;
            }
            if (_steeringExists)
            {
                SteeringExists = _steeringExists;
            }

            if (!IsControlInitialized)
            {
                GetMotion();
            }
        }