Exemplo n.º 1
0
        private void ReRegister(string processName, string mcNo)
        {
            string key = GetMachineUniqueKey(processName, mcNo);

            //1.) keep registere  info
            if (!m_MachineRegisterInfoDictionary.ContainsKey(key))
            {
                return;
            }
            //add new register data
            EmsMachineRegisterInfo regInfo = m_MachineRegisterInfoDictionary[key];

            PrivateRegister(key, regInfo);
        }
Exemplo n.º 2
0
        public void Register(EmsMachineRegisterInfo regInfo)
        {
            string key = GetMachineUniqueKey(regInfo.ProcessName, regInfo.MCNo);

            //1.) keep registere  info
            //remove old register data if exists
            if (m_MachineRegisterInfoDictionary.ContainsKey(key))
            {
                m_MachineRegisterInfoDictionary.Remove(key);
            }
            //add new register data
            m_MachineRegisterInfoDictionary.Add(key, regInfo);

            PrivateRegister(key, regInfo);
        }
Exemplo n.º 3
0
 private void PrivateRegister(string key, EmsMachineRegisterInfo regInfo)
 {
     try
     {
         //2.) register
         EmsMachineOutputInfo registeredMC = m_ReporterClient.RegisterMachine(regInfo);
         //3.) check exists
         if (m_MachineDictionary.ContainsKey(key))
         {
             m_MachineDictionary.Remove(key);
         }
         m_MachineDictionary.Add(key, registeredMC);
     }
     catch (Exception ex)
     {
         m_Log.Log("PrivateRegister", "RegisterMachine", ex.Message, "");
     }
 }
Exemplo n.º 4
0
        //ใช้ในการสอบถามข้อมูล OutputInfo ล่าสุดที่ทำการบันทึกไว้ในฐานข้อมูล
        public EmsMachineOutputInfo RegisterMachine(EmsMachineRegisterInfo regInfo)
        {
            EmsMachineOutputInfo ret = null;
            EmsMachineRow        mc  = null;
            string key = GetMachineUniqueKey(regInfo.ProcessName, regInfo.MCNo);

            mc = GetMachine(regInfo.ProcessName, regInfo.MCNo);

            if (mc != null)
            {
                mc.AreaName = regInfo.AreaName;

                if (mc.CurrentLotNo != regInfo.CurrentLotNo)
                {
                    mc.CurrentLotNo       = regInfo.CurrentLotNo;
                    mc.CurrentStandardRPM = regInfo.CurrentStandardRPM;
                    mc.CutTotalGood       = regInfo.CutTotalGood; //always 0
                    mc.CutTotalNG         = regInfo.CutTotalNG;   //always 0
                }
                else
                {
                    mc.CurrentTotalGood = regInfo.CurrentTotalGood;
                    mc.CurrentTotalNG   = regInfo.CurrentTotalNG;
                }
            }
            else
            {
                try
                {
                    mc = new EmsMachineRow();
                    //add to data base
                    mc.ID                          = -1;
                    mc.MCNo                        = regInfo.MCNo;
                    mc.RegisteredDate              = DateTime.Now;
                    mc.CurrentActivityName         = "";
                    mc.CurrentActivityCategoryName = "";
                    mc.AreaName                    = regInfo.AreaName;
                    mc.ProcessName                 = regInfo.ProcessName;
                    mc.MachineTypeName             = regInfo.MachineTypeName;
                    mc.CurrentLotNo                = regInfo.CurrentLotNo;
                    mc.CurrentTotalGood            = regInfo.CurrentTotalGood;
                    mc.CurrentTotalNG              = regInfo.CurrentTotalNG;
                    mc.CurrentStandardRPM          = regInfo.CurrentStandardRPM;
                    mc.LastUpdateDate              = DateTime.Now;
                    mc.CutTotalGood                = regInfo.CutTotalGood;
                    mc.CutTotalNG                  = regInfo.CutTotalNG;
                    mc.ActivityChangeTime          = DateTime.Now;
                    mc.AlarmCount                  = 0;
                    mc.BMCount                     = 0;
                    m_MachineList.Add(key, mc);
                }
                catch (Exception ex)
                {
                    RaiseErrorCatchedEvent("RegisterMachine-001", ex, "");
                }
            }

            int aff = m_DB.SaveEmsMachineRow(mc);

            ret = new EmsMachineOutputInfo(mc);

            return(ret);
        }
Exemplo n.º 5
0
 public EmsMachineOutputInfo RegisterMachine(EmsMachineRegisterInfo regInfo)
 {
     return(base.Channel.RegisterMachine(regInfo));
 }