Beispiel #1
0
        static public void Initialize()
        {
/*
 *          System.Diagnostics.Process[] pses = System.Diagnostics.Process..GetProcessesByName("TSioex");
 *          if (pses.Length > 0)
 *          {
 *              System.Diagnostics.Process.GetCurrentProcess().Kill();
 *            return;
 *          }
 */
            Thread.Sleep(3000);
            try
            {
                StringResource.SetLanguage();
                msgwnd  = new MsgDlg();
                app_cfg = new SqlConfig("app");
                app_cfg.LoadConfigFromFile();

                curr_cfg = app_cfg.Current;

                packers = new List <UIPacker>();
                for (int i = 0; i < Int32.Parse(curr_cfg.Element("machine_number").Value); i++)
                {
                    UIPacker p = new UIPacker(i); line++;
                    p.InitConfig();
                    packers.Add(p);
                }
                line = 999;
                NodeMaster.Dummy(); line++;

                singlewnd = new SingleModeWnd(); line++;
                runwnd    = new RunModeWnd(); line++;


                histwnd = new ProdHistory(); line++;

                kbdwnd    = new kbdWnd(); line++;
                bottomwnd = new BottomWnd(); line++;
                alertwnd  = new AlertWnd(); line++;
                alertwnd.UpdateUI(); //load alert configuration which is in app_config.xml too

                pwdwnd    = new PwdWnd(); line++;
                engwnd    = new EngWnd(); line++;
                configwnd = new ConfigMenuWnd(); line++;
                prodwnd   = new ProdWnd(); line++;
                prodnum   = new ProdNum(); line++;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }
        }
Beispiel #2
0
        static public void SwitchTo(string mode)
        {
            if (mode == "history")
            {
                topwnd = mode;
                histwnd.BringToFront();
                histwnd.Show();
                histwnd.UpdateDisplay();
                histwnd.UpdateList();

                return;
            }
            if (mode == "alert")
            {
                topwnd = mode;
                alertwnd.BringToFront();
                alertwnd.Show();
                alertwnd.UpdateUI();
                return;
            }
            if (mode == "bottom")
            {
                topwnd = mode;
                bottomwnd.BringToFront();
                bottomwnd.UpdateDisplay();
                bottomwnd.Show();
                return;
            }
            if (mode == "password")
            {
                topwnd = mode;
                pwdwnd.UpdateDisplay();
                pwdwnd.Show();
                pwdwnd.BringToFront();
                return;
            }
            if (mode == "engineer")
            {
                topwnd = mode;
                engwnd.InitDisplay();
                engwnd.Show();
                engwnd.BringToFront();
                return;
            }

            /*
             * singlewnd.Hide();
             * histwnd.Hide();
             * runwnd.Hide();
             * alertwnd.Hide();
             * bottomwnd.Hide();
             * pwdwnd.Hide();
             * engwnd.Hide();
             * kbdwnd.Hide();
             * configwnd.Hide();
             */
            if (mode == "configmenu")
            {
                topwnd = mode;
                configwnd.BringToFront();
                configwnd.Show();
                configwnd.UpdateDisplay();
                return;
            }
            if (mode == "product")
            {
                mode = "singlemode";
            }
            if (mode == "runmode")
            {
                topwnd = mode;
                runwnd.BringToFront();
                runwnd.Show();
                if (runwnd.btn_allstart.Visible == false)
                {
                    Program.MsgShow(StringResource.str("license"));
                }
                runwnd.UpdateSysConfigUI();

                return;
            }
            if (mode == "singlemode")
            {
                topwnd = mode;
                singlewnd.BringToFront();
                singlewnd.Show();
                singlewnd.UpdateUI();
                return;
            }
        }
Beispiel #3
0
        static public void Initialize()
        {
/*
            System.Diagnostics.Process[] pses = System.Diagnostics.Process..GetProcessesByName("TSioex");
            if (pses.Length > 0) 
            {
                System.Diagnostics.Process.GetCurrentProcess().Kill();
              return;
            }
 */
            Thread.Sleep(3000);
            try
            {
                StringResource.SetLanguage();
                msgwnd = new MsgDlg();
                app_cfg = new SqlConfig("app");
                app_cfg.LoadConfigFromFile(); 

                curr_cfg = app_cfg.Current;

                packers = new List<UIPacker>();
                for (int i = 0; i < Int32.Parse(curr_cfg.Element("machine_number").Value); i++)
                {
                    UIPacker p = new UIPacker(i); line++;
                    p.InitConfig();
                    packers.Add(p);
                }
                line = 999;
                NodeMaster.Dummy(); line++;

                singlewnd = new SingleModeWnd(); line++;
                runwnd = new RunModeWnd(); line++;


                histwnd = new ProdHistory(); line++;

                kbdwnd = new kbdWnd(); line++;
                bottomwnd = new BottomWnd(); line++;
                alertwnd = new AlertWnd(); line++;
                alertwnd.UpdateUI(); //load alert configuration which is in app_config.xml too

                pwdwnd = new PwdWnd(); line++;
                engwnd = new EngWnd(); line++;
                configwnd = new ConfigMenuWnd(); line++;
                prodwnd = new ProdWnd(); line++;
                prodnum = new ProdNum(); line++;
                
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }
        }