Example #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);
            }
        }
Example #2
0
 public void StartRun()
 {
     rStart = DateTime.Now;
     ProdHistory.InitNewRun(this);
     nc.Start();
     NodeMaster.Action(this.wn_addrs, "start");
     NodeMaster.Action(new byte[] { this.bot_addr }, "start");
     status = PackerStatus.RUNNING;
 }
Example #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();
            }
        }
Example #4
0
        public void StopRun()
        {
            NodeMaster.Action(new byte[] { this.bot_addr }, "stop");
            NodeMaster.Action(this.wn_addrs, "stop");
            Thread.Sleep(300);
            nc.Stop(100);
            status = PackerStatus.IDLE;

            if (!bSimulate)
            {
                ProdHistory.UpdateRecord(this);
                ResetHistory();
            }
            else
            {
                total_sim_packs   = 0;
                total_sim_weights = 0;
            }
        }
Example #5
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();
            }
        }