Пример #1
0
        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);
        }
Пример #2
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")));
        }
Пример #3
0
        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"));
        }
Пример #4
0
        private void timer_Tick(object sender, EventArgs e)
        {
            LoginLevelAction();
            AutoManaulAction();
            agv.UpdateLocate(localData.Real);
            button_SetPosition.Enabled = (localData.AutoManual == EnumAutoState.Manual && localData.MoveControlData.MoveCommand == null);


            #region label更新.
            loginLevelMessage.SetValueAndColor(localData.LoginLevel.ToString());
            soc.SetValueAndColor(String.Concat(localData.BatteryInfo.SOC.ToString("0.0"), " / ", localData.BatteryInfo.V.ToString("0.0"), "V"));
            charge.SetValueAndColor("");
            loading.SetValueAndColor("");
            cstID.SetValueAndColor("");

            lastAddress.SetValueAndColor(localData.Location.LastAddress);
            sectionID.SetValueAndColor(localData.Location.NowSection);
            sectionDistance.SetValueAndColor(localData.Location.DistanceFormSectionHead.ToString("0.0"));
            real.SetValueAndColor(String.Concat("( ", computeFunction.GetMapAGVPositionString(localData.Real, "0"), " )"));

            moveControlCommand.SetValueAndColor(localData.MoveControlData.CommnadID);

            bool moveControlReadyAndNotErrorBit = localData.MoveControlData.Ready && !localData.MoveControlData.ErrorBit;

            moveControlStatus.SetValueAndColor((moveControlReadyAndNotErrorBit ? "Ready" : "NotReady"), (moveControlReadyAndNotErrorBit ? 100 : 300));
            loadUnloadCommand.SetValueAndColor(localData.LoadUnloadData.CommnadID);
            loadUnloadStatus.SetValueAndColor(localData.LoadUnloadData.CommandStatus.ToString(), (int)localData.LoadUnloadData.CommandStatus);

            stopSingal.SetValueAndColor("");
            lowSpeedSingal.SetValueAndColor("");
            #endregion

            if (mainFlow.MoveControl.LocateControl.Status == EnumControlStatus.Ready)
            {
                label_LocateStatus.Text      = "定位OK";
                label_LocateStatus.ForeColor = Color.Green;
            }
            else
            {
                label_LocateStatus.Text      = "定位NG";
                label_LocateStatus.ForeColor = Color.Red;
            }

            tbxNowAlarm.Text        = mainFlow.AlarmHandler.NowAlarm;
            tbxNowAlarmHistory.Text = mainFlow.AlarmHandler.AlarmHistory;

            pB_Alarm.BackColor = (mainFlow.AlarmHandler.HasAlarm ? Color.Red : Color.Transparent);
            pB_Warn.BackColor  = (mainFlow.AlarmHandler.HasWarn ? Color.Yellow : Color.Transparent);

            SetSectionColor();
        }