Beispiel #1
0
        /// <summary>
        /// 检查电芯状态
        /// </summary>
        /// <param name="sfc">电芯号</param>
        /// <returns></returns>
        public static miCheckSFCstatusResponse ElectricCoreState(string sfc)
        {
            miCheckSFCstatusResponse miCheckSFCstatusResponseAddress = new miCheckSFCstatusResponse();

            try
            {
                MiCheckSFCStatusServiceService ElectricCoreStateAddress = new MiCheckSFCStatusServiceService();
                ElectricCoreStateAddress.Url             = "http://172.26.11.3:50000/atlmeswebservice/MiCheckSFCStatusServiceService?wsdl";
                ElectricCoreStateAddress.Timeout         = 300000;
                ElectricCoreStateAddress.Credentials     = new System.Net.NetworkCredential("SUP_TEST01", "test12345", null); //Baiduhai7     //验证信息
                ElectricCoreStateAddress.PreAuthenticate = true;
                miCheckSFCstatus       ms = new miCheckSFCstatus();
                changeSFCStatusRequest ct = new changeSFCStatusRequest();
                ct.site              = "2001";
                ct.operation         = "HSTDY1";
                ct.operationRevision = "#";
                ct.sfc = "PL0205005";

                ms.ChangeSFCStatusRequest       = ct;
                miCheckSFCstatusResponseAddress = ElectricCoreStateAddress.miCheckSFCstatus(ms);
            }
            catch
            {
                ////写CSV文件
                //ConfigureHelp.SaveInfoToCSVFileAtLog(beginTime.ToString("yyyy-MM-dd hh:mm:ss"), endTime.ToString("yyyy-MM-dd hh:mm:ss"), timeS.TotalMilliseconds.ToString(),
                //string.Format("开始时间代码Error [BeginTime]({0}、{1})", BarCode1.Text, resource),
            }
            return(miCheckSFCstatusResponseAddress);
        }
Beispiel #2
0
        public MESRes()
        {
            strErrMsg = string.Empty;
            bSuccess  = false;

            miCheckResponse     = new miCheckSFCstatusResponse();
            dataCollectResponse = new dataCollectForSfcExResponse();
        }
Beispiel #3
0
        public MESClass()
        {
            miCheckSFCStatusService = new MiCheckSFCStatusServiceService();
            miCheckSFCsta           = new miCheckSFCstatus();
            changeStatusRequest     = new changeSFCStatusRequest();
            miCheckSFCstatusRes     = new miCheckSFCstatusResponse();
            miCommon = new miCommonResponse();

            machineIntegrationService = new MachineIntegrationServiceService();
            dataCollect           = new dataCollectForSfcEx();
            sfcDataCollectRequest = new sfcDcExRequest();
            sfcRes = new sfcDcExResponse();
            dataCollectForSfcExRes = new dataCollectForSfcExResponse();
        }
Beispiel #4
0
        /// <summary>
        /// 电芯进站校验
        /// </summary>
        /// <param name="strSFC">Barcode</param>
        /// <returns>OK - MES return =0 </returns>
        /// <returns>NG - MEW return >0 </returns>
        public MESRes CheckSfcStatus(string strSFC)
        {
            MESRes      mesRes       = new MESRes();
            string      strStartTime = "";
            string      strEndTime   = "";
            HiPerfTimer hTimer       = new HiPerfTimer();

            mesRes.bSuccess  = false;
            mesRes.strErrMsg = "调用失败";
            try
            {
                hTimer.Start();
                strStartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ssfff");
                string strUser     = DataManage.StrValue(DataGroups.DataGroupMESCheckSfcParam, DataItemMESCheckSfcParam.User);
                string strPassword = DataManage.StrValue(DataGroups.DataGroupMESCheckSfcParam, DataItemMESCheckSfcParam.Password);
                int    iTimeout    = DataManage.IntValue(DataGroups.DataGroupMESCheckSfcParam, DataItemMESCheckSfcParam.TimeOut);
                miCheckSFCStatusService.Credentials = new NetworkCredential(strUser, strPassword);
                iTimeout = (iTimeout < 10 || iTimeout > 60000) ? 10000 : iTimeout;
                miCheckSFCStatusService.Timeout = iTimeout;

                changeStatusRequest.site              = DataManage.StrValue(DataGroups.DataGroupMESCheckSfcParam, DataItemMESCheckSfcParam.site);              //设备所在站点
                changeStatusRequest.operation         = DataManage.StrValue(DataGroups.DataGroupMESCheckSfcParam, DataItemMESCheckSfcParam.operation);         //工位
                changeStatusRequest.operationRevision = DataManage.StrValue(DataGroups.DataGroupMESCheckSfcParam, DataItemMESCheckSfcParam.operationRevision); //工位版本
                changeStatusRequest.sfc = strSFC;                                                                                                              //电芯号

                miCheckSFCsta.ChangeSFCStatusRequest = changeStatusRequest;
                miCheckSFCstatusRes    = miCheckSFCStatusService.miCheckSFCstatus(miCheckSFCsta);
                mesRes.miCheckResponse = miCheckSFCstatusRes;
                mesRes.bSuccess        = true;
            }
            catch (Exception ex)
            {
                mesRes.bSuccess  = false;
                mesRes.strErrMsg = ex.ToString();
            }
            strEndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ssfff");
            int iTime = (int)(hTimer.Duration * 1000);

            MESLog.WriteMiCheckSfcStatusLog(miCheckSFCsta, mesRes, strStartTime, strEndTime, iTime);
            return(mesRes);
        }