Exemplo n.º 1
0
 private void LoadIniFile()
 {
     _ip             = CIniFile.ReadFromIni("ToolDebug", "Telnet_IP", iniFile, "192.168.0.233");
     _port           = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Telnet_Port", iniFile, "10001"));
     txtSerPort.Text = _ip;
     txtSerPort.Text = _port.ToString();
 }
Exemplo n.º 2
0
        private void SaveTestData()
        {
            try
            {
                string fileFolder = CIniFile.ReadFromIni("Parameter", "fileFolder", iniFile);

                string fileName = string.Empty;

                string iRet = string.Empty;

                if (orderName != string.Empty)
                {
                    iRet = mesService.SaveTestData2(orderName, serialNo, result, details, fileName);
                }
                else
                {
                    iRet = mesService.SaveTestData(serialNo, result, details, fileName);
                }

                if (iRet != "OK")
                {
                    errCode = "调用上传接口错误";
                    bFlag   = false;
                    return;
                }
                errCode = string.Empty;
                bFlag   = true;
            }
            catch (Exception ex)
            {
                errCode = ex.ToString();
                bFlag   = false;
            }
        }
Exemplo n.º 3
0
 private void LoadIniPara()
 {
     clientIP   = CIniFile.ReadFromIni("ToolDebug", "Socket_SerIP", iniFile, "127.0.0.1");
     tcpPort    = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Socket_SerPort", iniFile, "8000"));
     clientIP   = CIniFile.ReadFromIni("ToolDebug", "Socket_clientIP", iniFile, "127.0.0.1");
     clientPort = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Socket_clientPort", iniFile, "8000"));
 }
Exemplo n.º 4
0
        private void refreshTotalYield()
        {
            int ttNum   = System.Convert.ToInt32(CIniFile.ReadFromIni("DailyYield", "yieldTTNum", CGlobalPara.IniFile, "0"));
            int failNum = System.Convert.ToInt32(CIniFile.ReadFromIni("DailyYield", "yieldFailNum", CGlobalPara.IniFile, "0"));

            labTTNum.Text   = ttNum.ToString();
            labFailNum.Text = failNum.ToString();
        }
Exemplo n.º 5
0
        private void FrmReport_Load(object sender, EventArgs e)
        {
            txtFolder.Text = CIniFile.ReadFromIni("FrmReport", "FolderPath", iniFile, dataFolder);

            dataFolder = txtFolder.Text;

            RefreshView();
        }
Exemplo n.º 6
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            int height = System.Convert.ToInt16(CIniFile.ReadFromIni("Parameter", "Height", CGlobalPara.IniFile, "400"));

            panel1.RowStyles[0].Height = height;

            InitalMainWork();
        }
Exemplo n.º 7
0
        /// <summary>
        /// 初始化控件
        /// </summary>
        private void InitialControl()
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Action(InitialControl));
            }
            else
            {
                //加载标题及母治具控件

                int mSLot = 0;

                for (int rom = 0; rom < CGlobalPara.C_ROOM_MAX; rom++)
                {
                    for (int i = 0; i < CGlobalPara.C_ROW_MAX; i++)
                    {
                        for (int j = 0; j < CGlobalPara.C_COL_MAX; j++)
                        {
                            if (CYOHOOApp.ColPos == 0)
                            {
                                panelMain[rom].Controls.Add(labFixSlot[mSLot], j, i * 2);
                                panelMain[rom].Controls.Add(panelFix[mSLot], j, i * 2 + 1);
                            }
                            else
                            {
                                panelMain[rom].Controls.Add(labFixSlot[mSLot], j, i * 2);
                                panelMain[rom].Controls.Add(panelFix[mSLot], CGlobalPara.C_COL_MAX - j - 1, i * 2 + 1);
                            }
                            mSLot += 1;
                        }
                    }
                }

                ////加载子治具控件

                for (int i = 0; i < CGlobalPara.C_UUT_MAX / 2; i++)
                {
                    int idNo = i * 2;

                    if (CYOHOOApp.ColPos == 0)
                    {
                        panelFix[i].Controls.Add(uiUUT[idNo], 0, 0);
                        panelFix[i].Controls.Add(uiUUT[idNo + 1], 1, 0);
                    }
                    else
                    {
                        panelFix[i].Controls.Add(uiUUT[idNo], 1, 0);
                        panelFix[i].Controls.Add(uiUUT[idNo + 1], 0, 0);
                    }
                }


                int bSel = System.Convert.ToInt32(CIniFile.ReadFromIni("OutModel", "CurSelOut", CGlobalPara.IniFile, "0"));

                chkSelOut.Checked = (bSel == 1 ? true : false);
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// 加载INI文件
 /// </summary>
 private void LoadIniFile()
 {
     para.DllFile  = CIniFile.ReadFromIni("PsoC", "DllFile", IniFile);
     para.Protocol = (CPSoC4.EProtocol)System.Convert.ToInt32(CIniFile.ReadFromIni("PsoC", "Protocol", IniFile, "8"));
     para.Voltage  = System.Convert.ToDouble(CIniFile.ReadFromIni("PsoC", "Voltage", IniFile, "3.3"));
     para.Freq     = (CPSoC4.EFrequencies)System.Convert.ToInt32(CIniFile.ReadFromIni("PsoC", "Freq", IniFile, "224"));
     para.Pin      = (CPSoC4.EPIN)System.Convert.ToInt32(CIniFile.ReadFromIni("PsoC", "Pin", IniFile, "0"));
     para.HexFile  = CIniFile.ReadFromIni("PsoC", "HexFile", IniFile, @"C:\Program Files (x86)\Cypress\Programmer\PP_COM_Wrapper.dll");
 }
Exemplo n.º 9
0
        private void LoadIniPara()
        {
            tcpPort = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "Socket_SerTcpPort", iniFile, "8000"));

            xmlFile = CIniFile.ReadFromIni("ToolDebug", "Socket_Xml", iniFile, Application.StartupPath + "\\XML\\Socket.xml");

            clientIP = CIniFile.ReadFromIni("ToolDebug", "Socket_clientIP", iniFile, "127.0.0.1");

            clientPort = CIniFile.ReadFromIni("ToolDebug", "Socket_clientPort", iniFile, "8000");
        }
Exemplo n.º 10
0
 private void LoadIniFile()
 {
     _ip             = CIniFile.ReadFromIni("ToolDebug", "MQTT_IP", iniFile, "127.0.0.1");
     _port           = System.Convert.ToInt32(CIniFile.ReadFromIni("ToolDebug", "MQTT_Port", iniFile, "61613"));
     _topic          = CIniFile.ReadFromIni("ToolDebug", "MQTT_Topic", iniFile, "GJDG/PRD/KLK/CORE/NODE/SYSTEM/STATUS/RPT");
     _message        = CIniFile.ReadFromIni("ToolDebug", "MQTT_Message", iniFile, "Hello World");
     txtSerIP.Text   = _ip;
     txtSerPort.Text = _port.ToString();
     txtTopic.Text   = _topic;
     txtMessage.Text = _message;
 }
Exemplo n.º 11
0
        /// <summary>
        /// 测试与服务端连接
        /// </summary>
        /// <param name="er"></param>
        /// <returns></returns>
        public bool Start(out EMesState status, out string er)
        {
            er = string.Empty;

            status = EMesState.正常;

            try
            {
                string url = CIniFile.ReadFromIni("Parameter", "url", iniFile, "http://192.168.50.250:8080/biz/api/") + "TestConnect";

                CTestConnectReponse reponse = null;

                string requestData = string.Empty;

                string reponseData = string.Empty;

                if (!CNet.HttpGet(url, requestData, out reponseData, out er))
                {
                    status = EMesState.网络异常;
                    return(false);
                }

                reponse = CJSon.Deserialize <CTestConnectReponse>(reponseData);

                if (reponse.status != "200")
                {
                    status = EMesState.网络异常;
                    er     = reponseData;
                    return(false);
                }

                if (reponse.result.ToUpper() != "SUCCESS")
                {
                    status = EMesState.异常错误;
                    er     = reponse.msg;
                    return(false);
                }

                er = requestData;

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
        }
Exemplo n.º 12
0
        private void FrmYeild_Load(object sender, EventArgs e)
        {
            refreshTotalYield();

            refreshModelList();

            refreshYieldRecord();

            refreshChmrStatus();

            timer1.Start();

            string curOutModel = CIniFile.ReadFromIni("Parameter", "curOutModel", CGlobalPara.IniFile);

            labOutModel.Text = curOutModel;
        }
Exemplo n.º 13
0
        private void FrmSample_Load(object sender, EventArgs e)
        {
            cmbResult.SelectedIndex = 0;

            cmbPartType.Items.Clear();
            cmbPartType.Items.Add(CLanguage.Lan("治具"));
            cmbPartType.Items.Add(CLanguage.Lan("库位"));
            cmbPartType.SelectedIndex = 0;

            txtUrl.Text = CIniFile.ReadFromIni("FrmSample", "url", iniFile, url);

            url = txtUrl.Text;

            check_web_status_handler check_web = new check_web_status_handler(check_web_status);

            check_web.BeginInvoke(null, null);
        }
Exemplo n.º 14
0
        private void FrmYield_Load(object sender, EventArgs e)
        {
            dpStartDate.Value = DateTime.Now.Date;

            dpEndDate.Value = DateTime.Now.Date;

            txtUrl.Text = CIniFile.ReadFromIni("FrmSnQuery", "url", iniFile, url);

            labSysDB.Text = CIniFile.ReadFromIni("FrmSnQuery", "sysDB", iniFile, sysDB);

            url = txtUrl.Text;

            sysDB = labSysDB.Text;

            check_web_status_handler check_web = new check_web_status_handler(check_web_status);

            check_web.BeginInvoke(null, null);
        }
Exemplo n.º 15
0
        private void FrmYield_Load(object sender, EventArgs e)
        {
            txtUrl.Text = CIniFile.ReadFromIni("FrmYield", "url", iniFile, url);

            url = txtUrl.Text;

            List <string> keyName = new List <string>();

            List <string> keyValue = new List <string>();

            CIniFile.GetIniKeySection("PLCAlarm", out keyName, out keyValue, iniFile);

            cmbStatName.Items.Clear();

            cmbStatName.Items.Add(CLanguage.Lan("所有工位"));

            for (int i = 0; i < keyValue.Count; i++)
            {
                cmbStatName.Items.Add(keyValue[i]);
            }
            cmbStatName.SelectedIndex = 0;

            cmbbAlarm.Items.Clear();
            cmbbAlarm.Items.Add(CLanguage.Lan("全部"));
            cmbbAlarm.Items.Add(CLanguage.Lan("解除"));
            cmbbAlarm.Items.Add(CLanguage.Lan("报警"));
            cmbbAlarm.SelectedIndex = 0;

            cmbFixNumSlotNo.SelectedIndex = 0;

            check_web_status_handler check_web = new check_web_status_handler(check_web_status);

            check_web.BeginInvoke(null, null);

            txtAccess.Text = CIniFile.ReadFromIni("FrmYield", "AccessFile", iniFile, Application.StartupPath + "\\BURNIN\\PLC_BURNIN.accdb");

            txtCSV.Text = CIniFile.ReadFromIni("FrmYield", "CSVFile", iniFile);

            if (LoadPLCAccessDB(txtAccess.Text))
            {
                LoadPLCCSV(txtCSV.Text);
            }
        }
Exemplo n.º 16
0
        private void FrmGJWeb_Load(object sender, EventArgs e)
        {
            cmbStatNum.SelectedIndex = 0;

            InitialFlowPanel(cmbStatNum.SelectedIndex + 1);

            cmbSlotMax.SelectedIndex = 19;

            cmbUseStatus.SelectedIndex = 1;

            cmbMes.SelectedIndex = 0;

            cmbChkSn.SelectedIndex = 0;

            txtUlrWeb.Text = CIniFile.ReadFromIni("ToolDebug", "ulrWeb", iniFile, "http://100.100.20.175:8080/Service.asmx");

            InitialSnPanel(cmbSlotMax.SelectedIndex + 1);

            dtYieldStartTime.Value = DateTime.Now;

            dtYieldEndTime.Value = DateTime.Now;
        }
Exemplo n.º 17
0
 private void loadIniFile()
 {
     devXmlFile = CIniFile.ReadFromIni("Device", "config", devIniFile, "Device.xml");
 }
Exemplo n.º 18
0
        /// <summary>
        /// 上传数据
        /// </summary>
        /// <param name="data"></param>
        /// <param name="status"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        public bool TranSn(CSFCS.CSnData data, out EMesState status, out string er)
        {
            er = string.Empty;

            status = EMesState.正常;

            try
            {
                string url = CIniFile.ReadFromIni("Parameter", "url", iniFile, "http://192.168.50.250:8080/biz/api/") + "tongda/WriteATEProcess02?";

                string processCode = CIniFile.ReadFromIni(data.StatName, "ProcessCode", iniFile);

                string clientCode = CIniFile.ReadFromIni(data.StatName, "ClientCode", iniFile);

                string createBy = CIniFile.ReadFromIni(data.StatName, "CreateBy", iniFile);

                CSnResultRequest request = new CSnResultRequest()
                {
                    ClientCode   = clientCode,
                    ProcessCode  = processCode,
                    CreateBy     = createBy,
                    BarCode      = data.SerialNo,
                    DeviceId     = data.DeviceId,
                    Flag         = (data.Result == 0?1:0),
                    SoftwareVer  = "V1.0.0",
                    HardwareVer  = "V1.0.0",
                    Ext1         = string.Empty,
                    Ext2         = string.Empty,
                    Ext3         = string.Empty,
                    SIM          = string.Empty,
                    ResultDetail = string.Empty
                };

                //测试内容_测试项_值范围_测试值_测试结果(测试结果为PASS或者NG)
                for (int i = 0; i < data.Item.Count; i++)
                {
                    if (i > 0)
                    {
                        request.ResultDetail += ",";
                    }
                    request.ResultDetail += data.Item[i].Name + "_";
                    request.ResultDetail += data.Item[i].Desc + "_";
                    request.ResultDetail += data.Item[i].LowLimit + data.Item[i].Unit + "~" + data.Item[i].UpLimit + data.Item[i].Unit + "_";
                    request.ResultDetail += data.Item[i].Value + "_";
                    request.ResultDetail += data.Item[i].Result == 0 ? "PASS" : "NG";
                }

                CSnResultReponse reponse = null;

                url += string.Format("ProcessCode={0}" +
                                     "&BarCode={1}" +
                                     "&HardwareVer={2}" +
                                     "&SoftwareVer={3}" +
                                     "&DeviceId={4}" +
                                     "&SIM={5}" +
                                     "&Ext1={6}" +
                                     "&Ext2={7}" +
                                     "&Ext3={8}" +
                                     "&Flag={9}" +
                                     "&ResultDetail={10}" +
                                     "&CreateBy={11}" +
                                     "&ClientCode={12}",
                                     request.ProcessCode,
                                     request.BarCode,
                                     request.HardwareVer,
                                     request.SoftwareVer,
                                     request.DeviceId,
                                     request.SIM,
                                     request.Ext1,
                                     request.Ext2,
                                     request.Ext3,
                                     request.Flag,
                                     request.ResultDetail,
                                     request.CreateBy,
                                     request.ClientCode);

                string requestData = string.Empty;

                string reponseData = string.Empty;

                if (!CNet.HttpPost(url, requestData, out reponseData, out er))
                {
                    status = EMesState.网络异常;
                    return(false);
                }

                reponse = CJSon.Deserialize <CSnResultReponse>(reponseData);

                if (reponse.status != "200")
                {
                    status = EMesState.异常错误;
                    er     = reponse.msg;
                    return(false);
                }

                if (reponse.msg != "SUCCESS")
                {
                    status = EMesState.异常错误;
                    er     = reponse.msg;
                    return(false);
                }

                er = requestData;

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 检查条码
        /// </summary>
        /// <param name="sn"></param>
        /// <param name="status"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        public bool CheckSn(CSFCS.CSnInfo sn, out EMesState status, out string er)
        {
            er = string.Empty;

            status = EMesState.正常;

            try
            {
                string url = CIniFile.ReadFromIni("Parameter", "url", iniFile, "http://192.168.50.250:8080/biz/api/") + "tongda/GetATEProcess?";

                string processCode = CIniFile.ReadFromIni(sn.StatName, "ProcessCode", iniFile);

                string clientCode = CIniFile.ReadFromIni(sn.StatName, "ClientCode", iniFile);

                string createBy = CIniFile.ReadFromIni(sn.StatName, "CreateBy", iniFile);

                CSnValidationRequest request = new CSnValidationRequest()
                {
                    ProcessCode = processCode,
                    BarCode     = sn.SerialNo,
                    ClientCode  = clientCode,
                    CreateBy    = createBy
                };

                CSnValidationReponse reponse = null;

                url += string.Format("ProcessCode={0}&BarCode={1}&CreateBy={2}&ClientCode={3}",
                                     request.ProcessCode, request.BarCode, request.CreateBy, request.ClientCode);

                string requestData = string.Empty;

                string reponseData = string.Empty;

                if (!CNet.HttpPost(url, requestData, out reponseData, out er))
                {
                    status = EMesState.网络异常;
                    return(false);
                }

                reponse = CJSon.Deserialize <CSnValidationReponse>(reponseData);

                if (reponse.status != "200")
                {
                    status = EMesState.异常错误;
                    er     = reponse.msg;
                    return(false);
                }

                if (reponse.msg != "SUCCESS")
                {
                    status = EMesState.异常错误;
                    er     = reponse.msg;
                    return(false);
                }

                er = requestData;

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
        }
Exemplo n.º 20
0
        private void FrmOrder_Load(object sender, EventArgs e)
        {
            txtOrder.Text = CIniFile.ReadFromIni("Parameter", "MES_Order", CGlobalPara.IniFile, "");

            LogOK = 0;
        }