Ejemplo n.º 1
0
        public void AddNewPack(onepack o)
        {
            if (!bSimulate)
            {
                total_packs++;
                total_weights += o.weight;
            }
            else
            {
                total_sim_weights += o.weight;
                total_sim_packs++;
            }
            last_one_pack = o;

            packhist.Add(o);
            lastmin = DateTime.Now.AddMinutes(-1);
            packhist.RemoveAll(new Predicate <onepack>(screen));
            speed = (UInt32)packhist.Count;
            if (bSimulate)
            {
                return;
            }
            if (total_packs % 100 == 1) //update record for every 100 packs
            {
                ProdHistory.UpdateRecord(this);
                EngWnd.DecreasePacker(100);
            }
        }
Ejemplo n.º 2
0
 static public void SetLanguage()
 {
     if (EngWnd.GetRegistData("locale") == "0")
     {
         SetLanguage("en-US");
     }
     else
     {
         SetLanguage(EngWnd.GetRegistData("locale"));
     }
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 4
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();
            }
        }