예제 #1
0
 public ModelItem(ModelItem item)
     : base(item)
 {
     Index = item.Index;
     ModelNumber = item.ModelNumber;
     Date = item.Date;
     Time = item.Time;
     Leak = item.Leak;
     Result = item.Result;
     SerialNumber = item.SerialNumber;
     QRCode = item.QRCode;
     LR = item.LR;
 }
예제 #2
0
 public static string AssembleSerialNumber(ModelItem item, SerialNumber serialnumber)
 {
     var nt = item.Time;
     var dbt = SetupDirector.GetInstance().Package.TimeInfo.Day.BeginTime;
     var det = SetupDirector.GetInstance().Package.TimeInfo.Day.EndTime;
     var nbt = SetupDirector.GetInstance().Package.TimeInfo.Night.BeginTime;
     var net = SetupDirector.GetInstance().Package.TimeInfo.Night.EndTime;
     string ABN = "N";
     if (dbt <= nt && nt <= det) //주간 
         ABN = "A";
     else if (nbt <= nt || nt <= net) //야간
         ABN = "B";
     int serialn = item.LR == ModelItem.DIRECTION.L ? serialnumber.SerialNumber_L++ : serialnumber.SerialNumber_R++;
     string serials = serialn > 999 ? string.Format("{0}", serialn) : string.Format("{0:D4}", serialn);
     string serial_number = item.Date.ToString("yyMMdd") + ABN + serials;
     return serial_number;
 }
 public void AddItem(ModelItem model_item)
 {
     if (model_item == null)
         return;
     if (_CurrentDateTime.DayOfYear == model_item.Date.DayOfYear && _CurrentDateTime.Year == model_item.Date.Year)
         if (_CurrentDateTime.DayOfYear == model_item.Date.DayOfYear && _CurrentDateTime.Year == model_item.Date.Year)
         {
             _ModelItemList.Add(model_item);
             if (_ModelItemList.Count > STORAGE_LIMIT_COUNT)
                 SaveToFile(model_item.Date);
         }
         else //날짜가 바뀐 경우 
         {
             SaveToFile(_CurrentDateTime);
             _ModelItemList.Add(model_item);
             _CurrentDateTime = model_item.Date;
         }
 }
 private void ModelItemFactory(ModelItem item)
 {
     ModelItem modelItem = item;
     Model settedModel = null;
     SerialNumber settedSerialN = null;
     WorkModelItemControl control = null;
     switch (modelItem.LR)
     {
         case ModelItem.DIRECTION.L:
             settedModel = _WorkModelItemControl_L.SelectedModel;
             settedSerialN = _WorkModelItemControl_L.SelectedSerialNumber;
             control = _WorkModelItemControl_L;
             break;
         case ModelItem.DIRECTION.R:
             settedModel = _WorkModelItemControl_R.SelectedModel;
             settedSerialN = _WorkModelItemControl_R.SelectedSerialNumber;
             control = _WorkModelItemControl_R;
             break;
         default:
             return;
     }
     if (settedModel == null)
         return;
     modelItem.Paste(settedModel);
     int idx = _ListViewItem.Count + 1;
     string model_number = (modelItem.LR == ModelItem.DIRECTION.L ? _WorkModelItemControl_L.NModelNum.SelectedValue : _WorkModelItemControl_R.NModelNum.SelectedValue) as string;
     string serial_number = "";
     string qr_code = "";
     if (modelItem.Result == ModelItem.RESULT.OK)
     {
         serial_number = ModelItem.AssembleSerialNumber(modelItem, settedSerialN);
         qr_code = ModelItem.AssembleQRCode(modelItem, serial_number);
     }
     modelItem.PullRestMember(idx, model_number, serial_number, qr_code);
     _ListViewItem.Add(new ModelItem(modelItem));
     ModelItemDirector.GetInstance().AddItem(new ModelItem(modelItem));
     control.SetModelItemInfo(modelItem);
     // 내리기
     var listview = NTabItem_Work.NListViewControl.NView;
     listview.ScrollIntoView(listview.Items[listview.Items.Count - 1]);
 }
예제 #5
0
 public static string AssembleQRCode(ModelItem item, string serial_number)
 {
     return item.ProductInfo + item.PartNumber + serial_number;
 }
 public LeakResultReceivedEventArgs(ModelItem item)
 {
     Item = new ModelItem(item);
 }