示例#1
0
        void Conveyors_OnConveyor(ConveyorEventArgs args)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new CraneEventHandler(Monitor_OnCrane), args);
            }
            else
            {
                Conveyor Convey = args.conveyor;
                try
                {

                    SetTextBoxText("txtTaskNo{0}", Convey.ID, Convey.TaskNo);
                    SetTextBoxText("txtPalletCode{0}", Convey.ID, Convey.PalletCode);
                    SetTextBoxText("txtAlarmDesc{0}1", Convey.ID, Convey.AlarmCode.ToString());


                }
                catch (Exception ex)
                {
                    MCP.Logger.Error("监控界面中Conveyors_OnConveyor出现异常" + Convey.ID + " 错误内容:" + ex.Message);
                }
            }
        }
示例#2
0
        void Monitor_OnConveyor(ConveyorEventArgs args)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new ConveyorEventHandler(Monitor_OnConveyor), args);
            }
            else
            {
                try
                {
                    Conveyor conveyor = args.conveyor;
                    Button   btn      = GetButton(conveyor.ID);

                    if (btn == null)
                    {
                        return;
                    }

                    if (conveyor.value == "0" && conveyor.ID.IndexOf("Conveyor") >= 0)
                    {
                        btn.Text = "";
                    }
                    else if (conveyor.value == "0" && conveyor.ID.IndexOf("UpDown") >= 0)
                    {
                        btn.Text = "◎";
                    }
                    else if (conveyor.value == "0" && conveyor.ID.IndexOf("Move") >= 0)
                    {
                        btn.Text = "";
                    }
                    else if (conveyor.value == "1" && conveyor.ID.IndexOf("Conveyor") >= 0) //有货未转
                    {
                        btn.Text = "■";
                    }
                    else if (conveyor.value == "1" && conveyor.ID.IndexOf("UpDown") >= 0) //有货未转
                    {
                        btn.Text = "●";
                    }
                    else if (conveyor.value == "1" && conveyor.ID.IndexOf("Move") >= 0)
                    {
                        btn.Text = btn.Tag.ToString();
                    }
                    else if (conveyor.value == "2") //无货未转
                    {
                        btn.Text = "";
                    }
                    else if (conveyor.value == "3") //转
                    {
                        btn.Text = btn.Tag.ToString();
                    }
                    else if (conveyor.value == "4")
                    {
                        btn.BackColor = Color.Red;
                    }
                    else
                    {
                        btn.Text = "";
                    }
                }
                catch (Exception ex)
                {
                    MCP.Logger.Error("监控界面中Monitor_OnConveyor出现异常" + ex.Message);
                }
            }
        }