示例#1
0
        public void RefreshRunNodeUI() //node ui update at run time
        {
            lbl_status.Text = "";
            foreach (UIPacker pk in Program.packers)
            {
                foreach (byte naddr in pk.weight_nodes)
                {
                    string          param = "wei_node" + naddr.ToString();
                    byte            n     = (byte)(RunModeWnd.StringToId(param));
                    NodeCombination nc    = pk.nc;

                    double wt = NodeMaster.GetWeight(n);
                    if (wt > -1000 && wt <= WeighNode.MAX_VALID_WEIGHT)
                    {
                        runPan1.SetText(n, wt.ToString("F1"), false);
                    }

                    if (NodeMaster.GetStatus(n) == NodeStatus.ST_LOST || NodeMaster.GetStatus(n) == NodeStatus.ST_DISABLED)
                    {
                        runPan1.SetStatus("weightbar", n, PanStatus.ERROR, false);
                    }
                    string err = NodeMaster.GetErrors(n);
                    if (err != "" && AlertWnd.b_turnon_alert && AlertWnd.b_show_alert)
                    {
                        lbl_status.Text = n.ToString() + ":" + StringResource.str(err.Substring(0, err.IndexOf(';'))) + "\n";
                    }
                }
                if (pk.status == PackerStatus.RUNNING)
                {
                    lbl_speed.Text      = pk.speed.ToString();
                    lbl_lastweight.Text = pk.last_pack_weight.ToString("F1");
                    lbl_totalpack.Text  = pk.total_packs.ToString();

                    RefreshVibUI();
                }
            }
            if (lbl_status.Text.ToString() == "")
            {
                lbl_status.Text      = StringResource.str("normal");
                lbl_status.ForeColor = Color.Green;
            }
            else
            {
                lbl_status.ForeColor = Color.Red;
                if (AlertWnd.b_turnon_alert && AlertWnd.b_stop_onalert && (curr_packer.status == PackerStatus.RUNNING))
                {
                    btn_start_click(null, null);
                }
            }
            runPan1.ReDraw();
        }
示例#2
0
        public void UpdateNodeUI(byte n)
        {
            UIPacker pack = curr_packer;

            //display the variable based on current setting
            string err = NodeMaster.GetErrors(n);
            double wt  = -1000;
            string ct  = "";

            if (err == "")
            {
                wt = NodeMaster.GetWeight(n);
                ct = wt.ToString("F1");
                runPan1.SetStatus("passbar", n, PanStatus.IDLE, false);
            }
            else
            {
                if (AlertWnd.b_show_alert && AlertWnd.b_turnon_alert)
                {
                    runPan1.SetStatus("passbar", n, PanStatus.ERROR, false);
                    lbl_status.Text = StringResource.str(err.Substring(0, err.IndexOf(';'))) + "\n";
                    runPan1.SetText(n, StringResource.str(err.Substring(0, err.IndexOf(';'))), false);
                }
            }
            if (NodeMaster.GetStatus(n) == NodeStatus.ST_LOST || NodeMaster.GetStatus(n) == NodeStatus.ST_DISABLED)
            {
                runPan1.SetStatus("weightbar", n, PanStatus.DISBALED, false);
            }
            if (NodeMaster.GetStatus(n) == NodeStatus.ST_IDLE)
            {
                runPan1.SetStatus("weightbar", n, PanStatus.IDLE, false);
            }
            if (wt > -1000 && wt <= WeighNode.MAX_VALID_WEIGHT)
            {
                runPan1.SetText(n, ct, false);
            }
        }
示例#3
0
        public void UpdateDisplay(bool refresh)
        {
            RectButton btn;

            if (b_lockon)
            {
                btn_entersys.SetStyle(Color.Gray, MyButtonType.roundGradientButton);
                btn_locksys.Text = StringResource.str("lockon");
            }
            else
            {
                btn_locksys.SetStyle(Color.LightGreen, MyButtonType.roundGradientButton);
                btn_locksys.Text = StringResource.str("locksystem");
            }
            for (Byte i = 1; i < 18; i++)
            {
                if (i < 17)
                {
                    btn = IdToButton(i.ToString());
                }
                else
                {
                    btn = IdToButton("36");
                }

                if ((NodeMaster.GetErrors(i) != "") || (NodeMaster.GetStatus(i) == NodeStatus.ST_LOST))
                {
                    btn.SetStyle(Color.Gray, MyButtonType.roundButton);
                }
                else
                {
                    if (i == curr_sel || all_sel)
                    {
                        btn.SetStyle(Color.DarkGreen, MyButtonType.round2Button);
                    }
                    else
                    {
                        btn.SetStyle(Color.DarkGreen, MyButtonType.roundButton);
                    }
                }
                btn.Visible = true;
                continue;
            }

            btn_cali0.Text       = StringResource.str("cmd_cali0");
            btn_cali1.Text       = StringResource.str("cmd_cali1");
            btn_cali2.Text       = StringResource.str("cmd_cali2");
            btn_cali3.Text       = StringResource.str("cmd_cali3");
            btn_cali4.Text       = StringResource.str("cmd_cali4");
            btn_cali5.Text       = StringResource.str("cmd_cali5");
            btn_cali6.Text       = StringResource.str("cmd_cali6");
            btn_cali7.Text       = StringResource.str("cmd_cali7");
            btn_cali8.Text       = StringResource.str("cmd_cali8");
            btn_cali9.Text       = StringResource.str("cmd_cali9");
            btn_cali10.Text      = StringResource.str("cmd_cali10");
            btnSave.Text         = StringResource.str("cmd_save");
            btn_empty.Text       = StringResource.str("cmd_empty");
            btn_refreshaddr.Text = StringResource.str("refresh");
            btn_selectall.Text   = StringResource.str("cmd_selectall");
            lbl_title.Text       = StringResource.str("engineerpage");
            lbl_seladdr.Text     = StringResource.str("seladdr");
            lbl_reg.Text         = StringResource.str("setregs");
            btn_changeaddr.Text  = StringResource.str("changeaddr");
            btn_updatefw.Text    = StringResource.str("updatefw");
            btn_refreshaddr.Text = StringResource.str("refresh");
            btn_locksys.Text     = StringResource.str("locksystem");
            btn_entersys.Text    = StringResource.str("entersystem");
            btn_language.Text    = StringResource.str("language");
            btn_refreshreg.Text  = StringResource.str("refresh");
        }