Пример #1
0
        private void RunForm_Load(object sender, EventArgs e)
        {
            MultiLanguage.LoadLanguage(this, typeof(RunForm));

            OriginalSalver.InitEveryGridColor(Salver.GridFullColor);
            AfterSortingSalver.InitEveryGridColor(Salver.GridEmptyColor);
        }
Пример #2
0
        //监控所有状态
        private void TimerCheckAllStatus_Tick(object sender, EventArgs e)
        {
            //运行指示灯

            PicLedReady.Image = DataStruct.SysStat.StationReady ? Properties.Resources.LightBlue : Properties.Resources.DarkBlue;
            PicLedRun.Image   = DataStruct.SysStat.StationRun ? Properties.Resources.LightGreen : Properties.Resources.DarkGreen;
            PicLedAlarm.Image = DataStruct.SysStat.StationPause ? Properties.Resources.LightYellow : Properties.Resources.DarkYellow;
            PicLedStop.Image  = DataStruct.SysStat.StationStop ? Properties.Resources.LightRed : Properties.Resources.DarkRed;

            //设置报警灯的状态
            if (DataStruct.SysStat.StationRun)
            {
                VisualSortingStation.SetSysAlarmTowerLed(AlarmLed.AlarmLed_Green);
            }
            else if (DataStruct.SysStat.StationPause && !DataStruct.SysStat.StationStop)
            {
                VisualSortingStation.SetSysAlarmTowerLed(AlarmLed.AlarmLed_Oriange);
            }
            else if (!DataStruct.SysStat.StationPause && DataStruct.SysStat.StationStop)
            {
                VisualSortingStation.SetSysAlarmTowerLed(AlarmLed.AlarmLed_Red);
            }
            else if (DataStruct.SysStat.StationPause && DataStruct.SysStat.StationStop)
            {
                VisualSortingStation.SetSysAlarmTowerLed(AlarmLed.AlarmLed_OriangeAndRed);
            }

            //运行状态更新
            Bitmap bmpGreen = Properties.Resources.SmallGreen;
            Bitmap bmpRed   = Properties.Resources.SmallRed;

            PicRobot.Image          = DataStruct.SysStat.RobotOk ? bmpGreen : bmpRed;
            PicCamera.Image         = DataStruct.SysStat.CameraOk? bmpGreen : bmpRed;
            PicQRCodeScanner.Image  = DataStruct.SysStat.QRCodeOk ? bmpGreen : bmpRed;
            PicRfid.Image           = DataStruct.SysStat.RfidOk ? bmpGreen : bmpRed;
            PicArm.Image            = DataStruct.SysStat.ArmControlerOk ? bmpGreen : bmpRed;
            PicOverturnSalver.Image = DataStruct.SysStat.OverturnSalverOk ? bmpGreen : bmpRed;

            //添加报警信息
            for (int i = 0; i < (int)SysAlarm.Type.Max; i++)
            {
                SysAlarm.StructAlarm data = m_SysAlarm.GetAlarm((SysAlarm.Type)i);
                if (data.IsAlarm)
                {
                    if (!m_SysAlarmState[i])
                    {
                        DgvSysAlarm.Rows.Add(data.ID.ToString(), data.Level.ToString(), data.Informat, data.Solution);
                    }
                }
                m_SysAlarmState[i] = data.IsAlarm;
            }

            //刷新模拟物料盘的状态
            if (DataStruct.SysStat.GrapAndPutOneSuccessed)
            {
                DataStruct.SysStat.GrapAndPutOneSuccessed = false;
                SetOriginalSalverGridColor(m_GrapAndPutCount, Salver.GridEmptyColor);
                SetAfterSortingSalverGridColor(m_GrapAndPutCount, Salver.GridFullColor);

                if (m_GrapAndPutCount == VisualSortingStation.m_OnePanelDevicesMax)
                {
                    lock (this)
                    {
                        m_GrapAndPutCount = 0;
                    }

                    OriginalSalver.InitEveryGridColor(Salver.GridFullColor);
                    AfterSortingSalver.InitEveryGridColor(Salver.GridEmptyColor);
                }
            }

            CLabelCurDevices.Text    = (m_GrapAndPutCount + 1).ToString();
            CLabelTotalDeveices.Text = m_GrapAndPutTotal.ToString();
            CLabelTotalTrays.Text    = (m_GrapAndPutTotal / VisualSortingStation.m_OnePanelDevicesMax).ToString();
        }