Пример #1
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();
        }
Пример #2
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"));
        }