コード例 #1
0
        private void RefreshTimer_Tick(object sender, EventArgs e)
        {
            Bitmap bmpGreen     = Properties.Resources.SmallGreen;
            Bitmap bmpDarkGreen = Properties.Resources.SmallDarkGreen;
            Bitmap bmpRed       = Properties.Resources.SmallRed;
            Bitmap bmpDarkRed   = Properties.Resources.SmallDarkRed;

            pictureBoxRobotAlarm.Image  = m_ManualRobot.HasAlarm() ? bmpRed : bmpDarkRed;
            pictureBoxRobotAlarm.Image  = m_ManualRobot.HasWarning() ? bmpRed : bmpDarkRed;
            pictureBoxTemperature.Image = (m_ManualRobot.GetTemperatureStateString() == "过载") ? bmpRed : bmpDarkGreen;
            pictureBoxRobotMove.Image   = m_ManualRobot.GetMovingState() ? bmpGreen : bmpDarkGreen;
            DisplayRobotState(m_ManualRobot.GetExecutorStateString(), pictureBoxRobotExecut);
            RefreshRobotServoPic(m_ManualRobot, pictureBoxServo);

            UpdateRobotCurentMeas();

            //读取全局点位信息,只读一次
            if (m_ManualRobot.IsConnected() && m_ManualRobot.m_PointList == null)
            {
                m_ManualRobot.m_PointList = m_ManualRobot.GetGlobalPointData();
            }
        }
コード例 #2
0
ファイル: ManualDebug.cs プロジェクト: liushuiruobing/my_code
        private void RefreshTimer_Tick(object sender, EventArgs e)
        {
            InitUIControlEnableState();

            Bitmap bmpGreen     = Properties.Resources.SmallGreen;
            Bitmap bmpDarkGreen = Properties.Resources.SmallDarkGreen;
            Bitmap bmpRed       = Properties.Resources.SmallRed;
            Bitmap bmpDarkRed   = Properties.Resources.SmallDarkRed;

            //Robot
            pictureBoxRobotAlarm.Image  = (m_ManualRobot.HasAlarm() || m_ManualRobot.HasWarning()) ? bmpRed : bmpDarkRed;
            pictureBoxTemperature.Image = (m_ManualRobot.GetTemperatureStateString() == "过载") ? bmpRed : bmpDarkGreen;
            pictureBoxRobotMove.Image   = m_ManualRobot.GetMovingState() ? bmpGreen : bmpDarkGreen;
            DisplayRobotState(m_ManualRobot.GetExecutorStateString(), pictureBoxRobotExecut);
            RefreshRobotServoPic(m_ManualRobot, pictureBoxServo);
            UpdateRobotCurentMeas();

            if (m_ManualRobot.IsConnected() && m_ManualRobot.m_PointList == null)  //读取全局点位信息,只读一次
            {
                m_ManualRobot.m_PointList = m_ManualRobot.GetGlobalPointData();
            }

            //抓手
            PicBoxRobotGrapGoArrive.Image    = DataStruct.SysStat.RobotCylGoArrive ? bmpGreen : bmpDarkGreen;
            PicBoxRobotGrapBackArrive.Image  = DataStruct.SysStat.RobotCylBackArrive ? bmpGreen : bmpDarkGreen;
            PicBoxRobotGrapVacuumCheck.Image = DataStruct.SysStat.RobotVacuoCheck ? bmpGreen : bmpDarkGreen;

            //二维码
            if (m_QRCode != null && m_QRCode.m_IsConnect)
            {
                lock (this)
                {
                    if (m_QRCode.m_ReadQueue.Count > 0)
                    {
                        ComBoxQRCodeReadShow.Text += m_QRCode.m_ReadQueue.Dequeue();
                    }
                }
            }

            //RFID
            if (m_RFID.IsConnected)
            {
                if (DataStruct.SysStat.ManualDebugReceiveSalverArrive)
                {
                    PicTrayDeviceInRFID.Image     = bmpGreen;
                    CTextBoxTrayDeviceRfidSn.Text = VisualSortingStation.m_RfidRead;
                }
                else
                {
                    PicTrayDeviceInRFID.Image     = bmpDarkGreen;
                    CTextBoxTrayDeviceRfidSn.Text = "";
                }
            }

            //Arm Controler
            //气缸
            PicBoxEmptySalverObstructUpArrive.Image   = DataStruct.SysStat.EmptySalverObstructAirCylUpArrive ? bmpGreen : bmpDarkGreen;
            PicBoxEmptySalverObstructDownArrive.Image = DataStruct.SysStat.EmptySalverObstructAirCylDownArrive ? bmpGreen : bmpDarkGreen;
            PicBoxEmptySalverUpArrive.Image           = DataStruct.SysStat.ReceiveSalverLiftingAirCylUpArrive ? bmpGreen : bmpDarkGreen;
            PicBoxEmptySalverDownArrive.Image         = DataStruct.SysStat.ReceiveSalverLiftingAirCylDownArrive ? bmpGreen : bmpDarkGreen;
            PicBoxConveyorUpArrive.Image   = DataStruct.SysStat.ConveyorLiftingAirCylUpArrive ? bmpGreen : bmpDarkGreen;
            PicBoxConveyorDownArrive.Image = DataStruct.SysStat.ConveyorLiftingAirCylDownArrive ? bmpGreen : bmpDarkGreen;

            //按键
            PicKeyRun.Image   = DataStruct.SysStat.KeyRun ? bmpGreen : bmpDarkGreen;
            PicKeyPause.Image = DataStruct.SysStat.KeyPause ? bmpGreen : bmpDarkGreen;
            PicKeyStop.Image  = DataStruct.SysStat.KeyStop ? bmpGreen : bmpDarkGreen;
            PicKeyReset.Image = DataStruct.SysStat.KeyReset ? bmpGreen : bmpDarkGreen;

            //传感器
            PicBoxEmptySalverObstructSensor.Image = DataStruct.SysStat.EmptySalverObstructSensor ? bmpGreen : bmpDarkGreen;
            PicBoxSalverRunOutStationSensor.Image = DataStruct.SysStat.SalverRunOutStationSensor ? bmpGreen : bmpDarkGreen;

            //翻转机构
            PicOverturn.Image          = DataStruct.SysStat.OverturnSalverTurnArrive ? bmpGreen : bmpDarkGreen;
            PicOverturnCylLock.Image   = DataStruct.SysStat.OverturnSalverLockAirCylGoArrive ? bmpGreen : bmpDarkGreen;
            PicOverturnCylUnLock.Image = DataStruct.SysStat.OverturnSalverLockAirCylBackArrive ? bmpGreen : bmpDarkGreen;

            if (m_ArmControler.IsBoardConnected(Board.Controler))
            {
                CTxtAxisConveyorCurPos.Text = Convert.ToString(VisualSortingStation.m_ConveyorAxisCurPos);

                TextBox[] txtState = new TextBox[(int)Axis.Max] {
                    CTxtAxisConveyorrState, CTxtAxisTurnOverState
                };
                for (int i = 0; i < (int)Axis.Max; i++)
                {
                    txtState[i].Text = m_ArmControler.ReadAxisStateString((Axis)i);
                }
            }
        }