public void UploadTrackOut()
        {
            new Task(new Action(() =>
            {
                postInfo.type = PostType.TrackOut;
                SetCimResult[(int)postInfo.type]("Trackout上报中...", false);
                CIM.LoadList(CIM.LotNum);
                ShowState("当前卡塞统计账料数:" + CIM.GetChipIDCnt().ToString());
                if (CIM.ChipIDCount != CIM.LotNum)
                {
                    ShowAlarm("统计账料数与LotNum不符,无法过账,请重新确认");
                    SendCIMResult(postInfo.type, NG);
                    return;
                }

                //string returnValue = PostHelper.PostTrackOut(CIM.GetList(), PostParams.P_I.StrModelNo, out string key);
                string returnValue = PostHelper.PostTrackOut(
                    CIM.GetList(), PostParams.P_I.StrModelNo, xmlCreater, out string key);
                if (returnValue == CIM.ReturnOK)
                {
                    SetCimResult[(int)postInfo.type]("Trackout上报成功", false);
                    postInfo.correlationID = key;
                    Task.Factory.StartNew(FindReception, postInfo);
                }
                else
                {
                    SetTrackOutResult(returnValue + "-Trackout上报失败", true);
                    //TODO 通知plc?
                    SendCIMResult(postInfo.type, NG);
                }
            })).Start();
        }
Beispiel #2
0
        /// <summary>
        /// 手动加账功能
        /// </summary>
        void AddAccount_event(string code)
        {
            try
            {
                if (code != string.Empty)
                {
                    RegeditMain.R_I.CodeArm = code;
                }

                if (RegeditMain.R_I.CodeArm == string.Empty || RegeditMain.R_I.CodeArm == "FAILED")
                {
                    ShowAlarm("当前Arm持有ChipID为空,加账失败");
                    return;
                }

                if (!CIM.AppendChipIDList(RegeditMain.R_I.CodeArm))
                {
                    ShowAlarm("重复二维码:" + RegeditMain.R_I.CodeArm);
                    return;
                }
                ShowState("加账成功:" + RegeditMain.R_I.CodeArm);
                ShowState("目前账料总数:" + CIM.GetChipIDCnt().ToString());
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
        }
 /// <summary>
 /// 在plc进行上卡塞的时候触发,重置cim相关数据,主要是上一卡塞的chipid数据
 /// </summary>
 public void TriggerResetCimData()
 {
     try
     {
         if (File.Exists(CIM.Path_ChipIDList))
         {
             File.Delete(CIM.Path_ChipIDList);
         }
         CIM.ClearChipID();
         ShowState(string.Format("重置数据,当前卡塞记录:{0}", CIM.GetChipIDCnt()));
     }
     catch (Exception ex)
     {
         Log.L_I.WriteError(NameClass, ex);
     }
 }