private void UpdateTimer_Page1_CreateCommand()
        {
            label_TargetSection.Text = localData.MoveControlData.LocateControlData.TargetSection;

            MoveCommandData temp = localData.MoveControlData.MoveCommand;

            if (temp == null)
            {
                moveControlCommandStauts.SetValueAndColor("");
            }
            else
            {
                moveControlCommandStauts.SetValueAndColor(temp.CommandStatus.ToString(), (int)temp.CommandStatus);
            }

            button_AutoCycleRun.BackColor = (loopThread != null && loopThread.IsAlive ? Color.Green : Color.Transparent);

            if (localData.LoginLevel == EnumLoginLevel.MirleAdmin)
            {
                panel_CreateCommand_Hide.Visible = true;
                panel_AdminAdressIDAdd.Visible   = true;
            }
            else
            {
                panel_CreateCommand_Hide.Visible = false;
                panel_AdminAdressIDAdd.Visible   = false;
            }

            moveControlReady.SetReady(localData.MoveControlData.Ready);
            moveControlError.SetError(localData.MoveControlData.ErrorBit);
            motionControlStatus.SetValueAndColor(moveControl.MotionControl.Status.ToString(), (int)moveControl.MotionControl.Status);
            locateControlStatus.SetValueAndColor(moveControl.LocateControl.Status.ToString(), (int)moveControl.LocateControl.Status);
        }
Exemple #2
0
        private void SetSectionColor()
        {
            MoveCommandData temp = localData.MoveControlData.MoveCommand;

            if (lastMoveCommand != temp)
            {
                if (temp != null)
                {
                    InitialMoveCommandSectionColor(temp);
                }
                else
                {
                    ClearMoveCommandSectionColor();
                }

                lastMoveCommand = temp;
            }
            else
            {
                if (temp != null)
                {
                    RefreshMoveCommandSectionColor();
                }
            }
        }
Exemple #3
0
 private void InitialMoveCommandSectionColor(MoveCommandData temp)
 {
     for (int i = 0; i < temp.ReserveList.Count; i++)
     {
         DrawSection(temp.ReserveList[i].SectionID, EnumSectionAction.NotGetReserve);
     }
 }
Exemple #4
0
        private void UpdateMoveControlSensorData()
        {
            VehicleLocation location = localData.Location;

            if (localData != null)
            {
                sensorData_Address.SetValueAndColor(location.LastAddress, (location.InAddress ? 100 : 0));
                sensorData_Section.SetValueAndColor(location.NowSection);
                sensorData_Distance.SetValueAndColor(location.DistanceFormSectionHead.ToString("0"));
            }
            else
            {
                sensorData_Address.SetValueAndColor("");
                sensorData_Section.SetValueAndColor("");
                sensorData_Distance.SetValueAndColor("");
            }

            sensorData_Real.SetValueAndColor(computeFunction.GetMapAGVPositionStringWithAngle(localData.Real));
            sensorData_LocationAGVPosition.SetValueAndColor(computeFunction.GetLocateAGVPositionStringWithAngle(localData.MoveControlData.LocateControlData.LocateAGVPosition));
            sensorData_MIPCAGVPosition.SetValueAndColor(computeFunction.GetLocateAGVPositionStringWithAngle(localData.MoveControlData.MotionControlData.EncoderAGVPosition));

            MoveCommandData command = localData.MoveControlData.MoveCommand;

            if (command != null)
            {
                sensorData_CommandID.SetValueAndColor(command.CommandID);
                sensorData_CommandStartTime.SetValueAndColor(command.StartTime.ToString("HH:mm:ss"));
                sensorData_CommandStstus.SetValueAndColor(command.CommandStatus.ToString());
                sensorData_MoveStatus.SetValueAndColor(command.MoveStatus.ToString(), (int)command.MoveStatus);
                sensorData_CommandEncoder.SetValueAndColor(command.CommandEncoder.ToString("0"));
                SetLabelTextAndColor(label_MoveControlSensorData_SensorSstatusValue, command.SensorStatus);
                SetLabelTextAndColor(label_MoveControlSensorData_ReserveValue, (command.WaitReserveIndex == -1 ? EnumVehicleSafetyAction.Normal : EnumVehicleSafetyAction.SlowStop));
                SetLabelTextAndColor(label_MoveControlSensorData_PauseValue, command.AGVPause);
            }
            else
            {
                sensorData_CommandID.SetValueAndColor("");
                sensorData_CommandStartTime.SetValueAndColor("");
                sensorData_CommandStstus.SetValueAndColor("");
                sensorData_MoveStatus.SetValueAndColor("");
                sensorData_CommandEncoder.SetValueAndColor("");
                label_MoveControlSensorData_SensorSstatusValue.Text = "";
                label_MoveControlSensorData_ReserveValue.Text       = "";
                label_MoveControlSensorData_PauseValue.Text         = "";
            }

            SetLabelTextAndColor(label_MoveControlSensorData_SafetySensorValue, localData.MIPCData.SafetySensorStatus);
            SetLabelTextAndColor(label_MoveControlSensorData_LocalPauseValue, localData.MoveControlData.SensorStatus.LocalPause);

            sensorData_Velocity.SetValueAndColor(String.Concat(localData.MoveControlData.MotionControlData.LineVelocity.ToString("0"), "/",
                                                               localData.MoveControlData.MotionControlData.SimulateLineVelocity.ToString("0")));
        }
        private void InitialCommandAndReserveList(MoveCommandData temp)
        {
            ClearCommandAndReserveList();
            commandStringList = moveControl.CreateMoveCommandList.GetCommandList(temp);
            reserveStringList = moveControl.CreateMoveCommandList.GetReserveListAndSectionID(temp);

            for (int i = 0; i < reserveStringList.Count; i++)
            {
                ReserveList.Items.Add(String.Concat("▷ ", reserveStringList[i]));
            }

            for (int i = 0; i < commandStringList.Count; i++)
            {
                CommandList.Items.Add(String.Concat("▷ ", commandStringList[i]));
            }
        }
        private void button_SendList_Click(object sender, EventArgs e)
        {
            MoveCommandData temp = localData.MoveControlData.MoveCommand;

            if (temp != null)
            {
                moveControl.StartCommand();

                if (cB_GetAllReserve.Checked)
                {
                    for (int i = 0; i < temp.ReserveList.Count; i++)
                    {
                        moveControl.AddReservedIndexForDebugModeTest(i);
                    }
                }
            }
        }
        private void RefreshCommandAndReserveList(MoveCommandData temp)
        {
            if (indexOfreserveList < temp.IndexOfReserveList)
            {
                for (; indexOfreserveList < temp.IndexOfReserveList; indexOfreserveList++)
                {
                    ReserveList.Items[indexOfreserveList] = String.Concat("▶ ", reserveStringList[indexOfreserveList]);
                }
            }

            if (indexOfCommandList < temp.IndexOfCommandList)
            {
                for (; indexOfCommandList < temp.IndexOfCommandList; indexOfCommandList++)
                {
                    CommandList.Items[indexOfCommandList] = String.Concat("▶ ", commandStringList[indexOfCommandList]);
                }
            }
        }
        private void UpdateTimer_Page2_MoveCommand()
        {
            agvVelocity.SetValueAndColor(String.Concat(localData.MoveControlData.MotionControlData.LineVelocity.ToString("0"), "/",
                                                       localData.MoveControlData.MotionControlData.SimulateLineVelocity.ToString("0")));

            MoveCommandData temp = localData.MoveControlData.MoveCommand;

            if (temp != null)
            {
                commandStatus.SetValueAndColor(temp.CommandStatus.ToString());
                moveStatus.SetValueAndColor(temp.MoveStatus.ToString());
                commandEncoder.SetValueAndColor(temp.CommandEncoder.ToString("0"));
                sensorStatus.SetValueAndColor(temp.SensorStatus.ToString());
            }
            else
            {
                commandStatus.SetValueAndColor("");
                moveStatus.SetValueAndColor("");
                commandEncoder.SetValueAndColor("");
                sensorStatus.SetValueAndColor("");
            }

            sensorStatus.SetValueAndColor(localData.MoveControlData.MotionControlData.AllServoStatus.ToString());

            double sleepTime = moveControl.LoopTime;

            if (sleepTime > localData.MoveControlData.MoveControlConfig.TimeValueConfig.IntervalTimeList[EnumIntervalTimeType.ThreadSleepTime] * 2)
            {
                label_LoopTime.ForeColor = Color.Red;
            }
            else
            {
                label_LoopTime.ForeColor = Color.Green;
            }

            label_LoopTime.Text = sleepTime.ToString("0");

            UpdateMoveCommandInfo(temp);

            MapAGVPosition agvPosition = localData.Real;

            real.SetValueAndColor(computeFunction.GetMapAGVPositionString(agvPosition, "0"));
        }
        private void UpdateMoveCommandInfo(MoveCommandData temp)
        {
            if (temp != lastMoveCommand)
            {
                if (temp == null)
                {
                    ClearCommandAndReserveList();
                }
                else
                {
                    InitialCommandAndReserveList(temp);
                }
            }
            else
            {
                RefreshCommandAndReserveList(temp);
            }

            lastMoveCommand = temp;
        }
Exemple #10
0
 public void SetParametrs(MoveCommandData commandData)
 {
     CommandData = commandData.Clone();
 }