コード例 #1
0
    public static void UpdateChartHandler()
    {
        frame_count++;

        for (int index = 0; index < device.Count - 1; index++)
        {
            device[index].Update(frame_count);
        }


        if (device[0].graph.Count > 0)
        {
            int[] tmp     = new int[7];
            int   y_index = device[0].graph[0].y.Length - 1;
            for (int i = 0; i < device[0].graph.Count; i++)
            {
                tmp[i] = device[0].graph[i].y[y_index];
            }
            DumpDataToExcel.DumpDataToSave(frame_count, tmp[0], tmp[1], tmp[2], tmp[3], tmp[4], tmp[5]);
        }
    }
コード例 #2
0
        private void UpdateChartHandler()
        {
            update_count++;
            _form1.UpdateDataToChart1((double)SerialPortControl.Register[CURRENT_COMMAND]);
            _form1.UpdateDataToChart3((double)SerialPortControl.Register[MOTOR_DEGREE_1], SerialPortControl.Register[MOTOR_DEGREE_2]);

            //if( (Math.Abs(SerialPortControl.Register[MOTOR_SPEED_INC])<10000 )
            //        && ( Math.Abs(SerialPortControl.Register[MOTOR_SPEED_ABS]) < 10000) )
            _form1.UpdateDataToChart4((double)SerialPortControl.Register[MOTOR_SPEED_1], SerialPortControl.Register[MOTOR_SPEED_2]);

            //_form1.AddDataToChart2(Register[CURRENT_COMMAND], Register[MOTOR_SPEED_INC]);
            //_form1.AddDataToChart2(myPort.Register[CURRENT_COMMAND], (double)myPort.Register[MOTOR_SPEED]);

            if (update_count == 5)
            {
                update_count = 0;
                DumpDataToExcel.DumpDataToSave(SerialPortControl.Register[CURRENT_TIME],
                                               SerialPortControl.Register[MOTOR_DEGREE_1], SerialPortControl.Register[MOTOR_DEGREE_2],
                                               SerialPortControl.Register[MOTOR_SPEED_1], SerialPortControl.Register[MOTOR_SPEED_2]);
                DumpDataToExcel.SaveData();
            }
        }