示例#1
0
        // register from Tester
        public void RegisterFromRemoting(string PcName, string DeviceType)
        {
            RegisterData regdata = new RegisterData() { Callback = null, info = new RegisterDeviceInfo() { PcName = PcName.ToUpper(), DeviceType = DeviceType.ToUpper(), ConnectedTime = System.DateTime.Now, Status = "Idle",StatusBeginTime=DateTime.Now } };
                 AmidaEntities db = new AmidaEntities();
                 tblEQ q = (from n in db.tblEQ where n.eqi_id == PcName select n).FirstOrDefault<tblEQ>();
                 Console.WriteLine(PcName + "," + DeviceType);
                 if (q == null)
                 {

                     tblEQHistory eqhist = new tblEQHistory();
                     eqhist.eq_id = PcName;
                     eqhist.start_time = DateTime.Now;
                     eqhist.status = "Idle";
                     eqhist.total_num_wafer = 0;
                     db.tblEQHistory.AddObject(eqhist);
                     db.SaveChanges();
                     db.AcceptAllChanges();

                     db.tblEQ.AddObject(new tblEQ()
                     {
                         eqi_id = PcName,
                         eq_release_time = DateTime.Now,
                         start_time = DateTime.Now,
                         status = "Idle",
                         tested_num_chip = 0,
                         tested_num_wafer = 0,

                         IsWarnig = "N",
                         total_num_chip = 0,
                         total_num_wafer = 0,
                         current_identify = eqhist.identify

                     }
                    );
                 }

                 db.SaveChanges();
                 db.AcceptAllChanges();

            if (!dictClientCallBacks.ContainsKey(regdata.Key))
            {
                if (q != null)
                {

                    regdata.info.eq_area = q.eq_area;
                    regdata.info.CurrentWaferId = q.current_test_wafer_id;
                    regdata.info.lot_id = q.lot_id;
                    regdata.info.eq_comment = q.eq_comment;
                    regdata.info.ProbeCardId = q.probe_card_id;
                    regdata.info.Status = q.status;
                    regdata.info.StatusBeginTime = (DateTime)q.start_time;
                    regdata.info.total_num_chip = q.total_num_chip;
                    regdata.info.eq_prober = q.eq_prober;
                    regdata.info.total_num_wafer = q.total_num_wafer;
                    regdata.info.tested_num_chip = q.tested_num_chip;
                    regdata.info.tested_num_wafer = q.tested_num_wafer;

                  //  regdata.info.ststart_time = (DateTime)q.start_time;

                    //    = new RegisterDeviceInfo()
                    //{
                    //    eq_area = q.eq_area,
                    //    CurrentWaferId = q.current_test_wafer_id,
                    //    lot_id = q.lot_id,
                    //    eq_comment = q.eq_comment,
                    //    ProbeCardId = q.probe_card_id,
                    //    Status = q.status,
                    //    StatusBeginTime = (DateTime)q.start_time,
                    //    total_num_chip = q.total_num_chip,
                    //    eq_prober = q.eq_prober,
                    //    total_num_wafer = q.total_num_wafer,
                    //    tested_num_chip = q.tested_num_chip,
                    //    tested_num_wafer = q.tested_num_wafer,
                    //     PcName=q.eqi_id

                    //};

                    if(q.IsWarnig=="Y")
                    {
                        tblAlarm alarm=(from n in db.tblAlarm where n.identify== q.current_warning_identify   select n).FirstOrDefault();
                         if(alarm!=null)
                         {
                        regdata.info.WarningMessage= alarm.warning_message;
                        regdata.info.WarningType=(int)alarm.warning_type;
                        regdata.info.WarningBeginTime=(DateTime)alarm.start_time;

                         }

                    }
                }

                Console.WriteLine("client:" + regdata.Key + ",Registered!,total connection:" + dictClientCallBacks.Count);
                dictClientCallBacks.Add(regdata.Key, regdata);

            }
            //else
            //    dictClientCallBacks[regdata.Key] = regdata;

            if (DeviceType != "CONSOLE")
                 NotifyAllConnetedChange();
        }
示例#2
0
        public void Register(string PcName,string DeviceType)
        {
            try
            {
                RegisterData regdata = new RegisterData() { Callback = OperationContext.Current.GetCallbackChannel<ICallBack>(), info = new RegisterDeviceInfo() { PcName = PcName, DeviceType = DeviceType, ConnectedTime = System.DateTime.Now } };

                if (!dictClientCallBacks.ContainsKey(regdata.Key))

                    dictClientCallBacks.Add(regdata.Key, regdata);
                else
                    dictClientCallBacks[regdata.Key] = regdata;

                if (DeviceType != "CONSOLE")
                    NotifyAllConnetedChange();
                Console.WriteLine("client:" + regdata.Key + ",Registered!,total connection:" + dictClientCallBacks.Count);
                // throw new NotImplementedException();
            }
            catch (Exception ex)
            {
                throw new FaultException<string>(ex.Message + "," + ex.StackTrace);
            }
        }