public void GetPosition(object p)
        {
            switch (p.ToString())
            {
            case "1":
                Position1 = (double)ActPos1.Value;
                Inifile.INIWriteValue(iniPosition, "Axis1", "Position1", Position1.ToString());
                break;

            case "2":
                Position2 = (double)ActPos1.Value;
                Inifile.INIWriteValue(iniPosition, "Axis1", "Position2", Position2.ToString());
                break;

            case "3":
                Position3 = (double)ActPos1.Value;
                Inifile.INIWriteValue(iniPosition, "Axis1", "Position3", Position3.ToString());
                break;

            case "4":
                Position4 = (double)ActPos1.Value;
                Inifile.INIWriteValue(iniPosition, "Axis1", "Position4", Position4.ToString());
                break;

            case "5":
                Position5 = (double)ActPos1.Value;
                Inifile.INIWriteValue(iniPosition, "Axis1", "Position5", Position5.ToString());
                break;
            }
        }
Exemplo n.º 2
0
 private void AppLoadedEventCommandExecute()
 {
     AddMessage("软件加载完成");
     try
     {
         Mysql mysql = new Mysql();
         if (mysql.Connect())
         {
             string  stm = $"SELECT NOW()";
             DataSet ds  = mysql.Select(stm);
             AddMessage($"数据库连接成功{ ds.Tables["table0"].Rows[0][0]}");
             StatusDataBase = true;
         }
         else
         {
             AddMessage("数据库未连接");
             StatusDataBase = false;
         }
         mysql.DisConnect();
     }
     catch (Exception ex)
     {
         AddMessage($"数据库连接失败{ex.Message}");
         StatusDataBase = false;
     }
     tcpServer = new DXH.Net.DXHTCPServer();
     tcpServer.LocalIPAddress       = Inifile.INIGetStringValue(iniParameterPath, "Server", "IP", "127.0.0.1");
     tcpServer.LocalIPPort          = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "Server", "PORT", "11001"));
     tcpServer.SocketListChanged   += TcpServer_SocketListChanged;
     tcpServer.ConnectStateChanged += TcpServer_ConnectStateChanged;
     tcpServer.Received            += TcpServer_Received;
     tcpServer.StartTCPListen();
     Run();
 }
Exemplo n.º 3
0
        private void Init()
        {
            HomePageVisibility   = "Visible";
            InsertPageVisibility = "Collapsed";
            MessageStr           = "";
            MNOContent           = "Edit";
            MNOIsReadOnly        = true;
            MNO = Inifile.INIGetStringValue(iniParameterPath, "System", "MNO", "NA");
            //PARTNUM = Inifile.INIGetStringValue(iniParameterPath, "System", "PARTNUM", "NA");
            RESULT = true;
            DATA0  = ""; OPERATORID = ""; BARCODE = "";

            try
            {
                using (StreamReader reader = new StreamReader(Path.Combine(System.Environment.CurrentDirectory, "Partnum.json")))
                {
                    string json = reader.ReadToEnd();
                    PARTNUMItems = JsonConvert.DeserializeObject <ObservableCollection <string> >(json);
                }
            }
            catch (Exception ex)
            {
                PARTNUMItems = new ObservableCollection <string>();
                AddMessage(ex.Message);
            }
            AddMessage("软件加载完成");
        }
        public MainDataContext()
        {
            ActPos1  = new TwinCATCoil1(new TwinCATCoil("MAIN.ActPos1", typeof(double), TwinCATCoil.Mode.Notice), _TwinCATAds);
            PowerOn1 = new TwinCATCoil1(new TwinCATCoil("MAIN.PowerOn", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            Error1   = new TwinCATCoil1(new TwinCATCoil("MAIN.Error1", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            M2       = new TwinCATCoil1(new TwinCATCoil("MAIN.M2", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            M4       = new TwinCATCoil1(new TwinCATCoil("MAIN.M4", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            M0       = new TwinCATCoil1(new TwinCATCoil("MAIN.M0", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            Mode1    = new TwinCATCoil1(new TwinCATCoil("MAIN.Mode1", typeof(ushort), TwinCATCoil.Mode.Notice), _TwinCATAds);
            M16      = new TwinCATCoil1(new TwinCATCoil("MAIN.M16", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            M17      = new TwinCATCoil1(new TwinCATCoil("MAIN.M17", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            M20      = new TwinCATCoil1(new TwinCATCoil("MAIN.M20", typeof(bool), TwinCATCoil.Mode.Notice), _TwinCATAds);
            P1       = new TwinCATCoil1(new TwinCATCoil("MAIN.P1", typeof(double), TwinCATCoil.Mode.Notice), _TwinCATAds);
            V1       = new TwinCATCoil1(new TwinCATCoil("MAIN.V1", typeof(double), TwinCATCoil.Mode.Notice), _TwinCATAds);
            _TwinCATAds.StartNotice();
            UIUpdate();


            Position1 = double.Parse(Inifile.INIGetStringValue(iniPosition, "Axis1", "Position1", "0"));
            Position2 = double.Parse(Inifile.INIGetStringValue(iniPosition, "Axis1", "Position2", "0"));
            Position3 = double.Parse(Inifile.INIGetStringValue(iniPosition, "Axis1", "Position3", "0"));
            Position4 = double.Parse(Inifile.INIGetStringValue(iniPosition, "Axis1", "Position4", "0"));
            Position5 = double.Parse(Inifile.INIGetStringValue(iniPosition, "Axis1", "Position5", "0"));
            //WaitNet();
            //CommandFromRemote();
        }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            string iniSamplePath = System.Environment.CurrentDirectory + "\\Sample.ini";

            Inifile.INIWriteValue(iniSamplePath, "Sample", "IsSample", IsSampleCheck.IsChecked.ToString());
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemCount", NGItemCount.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem1", NGItem1.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem2", NGItem2.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem3", NGItem3.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem4", NGItem4.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem5", NGItem5.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem6", NGItem6.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem7", NGItem7.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem8", NGItem8.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem9", NGItem9.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItem10", NGItem10.Text);

            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify1", NGItemClassify1.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify2", NGItemClassify2.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify3", NGItemClassify3.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify4", NGItemClassify4.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify5", NGItemClassify5.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify6", NGItemClassify6.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify7", NGItemClassify7.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify8", NGItemClassify8.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify9", NGItemClassify9.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "NGItemClassify10", NGItemClassify10.Text);


            Inifile.INIWriteValue(iniSamplePath, "Sample", "SamMode", SamMode.Text);

            Inifile.INIWriteValue(iniSamplePath, "Sample", "ZPMID", ZPMID.Text);
            Inifile.INIWriteValue(iniSamplePath, "Sample", "FCTMID", FCTMID.Text);
        }
Exemplo n.º 6
0
        public async void Start(StartProcessedDelegate callback)
        {
            Stopwatch   sw        = new Stopwatch();
            Func <Task> startTask = () =>
            {
                return(Task.Run(() =>
                {
                    idleswflag = false;
                    idlesw.Stop();
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestIdle", TestIdle.ToString());
                    TestCycle = TestSpan + TestIdle;
                    Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCycle", TestCycle.ToString());
                    sw.Start();
                    TestStatus = TestStatus.Testing;
                    TestResult = TestResult.Unknow;
                    while (TestStatus == TestStatus.Testing)
                    {
                        TestSpan = Math.Round(sw.Elapsed.TotalSeconds, 2);
                        System.Threading.Thread.Sleep(100);
                    }
                }));
            };

            await startTask();

            callback(Index);
            if (!IsInSampleMode && !IsInGRRMode)
            {
                UpdateNormal();
            }

            idleswflag = true;
            idlesw.Restart();
        }
Exemplo n.º 7
0
 public EpsonRC90()
 {
     for (int i = 0; i < 4; i++)
     {
         YanmadeTester[i]                     = new Tester(i + 1);
         uploadSoftwareStatus[i]              = new UploadSoftwareStatus(i + 1);
         uploadSoftwareStatus[i].ModelPrint  += uploadprint;
         uploadSoftwareStatus[i].RecordPrint += RecordPrintOperate;
     }
     Ip = Inifile.INIGetStringValue(iniParameterPath, "EpsonRC90", "Ip", "192.168.1.2");
     for (int i = 0; i < 2; i++)
     {
         for (int j = 0; j < 15; j++)
         {
             BarInfo[i][j]             = new ProducInfo();
             BarInfo[i][j].Barcode     = "FAIL";
             BarInfo[i][j].BordBarcode = "Null";
             BarInfo[i][j].Status      = 0;
             BarInfo[i][j].TDate       = DateTime.Now.ToString("yyyyMMdd");
             BarInfo[i][j].TTime       = DateTime.Now.ToString("HHmmss");
         }
     }
     SamStart = DateTime.Now;
     Run();
 }
        private void DispatcherTimerTickUpdateUi(Object sender, EventArgs e)
        {
            string banci = GlobalVar.GetBanci();

            if (banci != LastBanci)
            {
                LastBanci = banci;
                Inifile.INIWriteValue(iniParameterPath, "System", "Banci", LastBanci);
                //GlobalVar.AlarmRecordQueue.Clear();
                GlobalVar.AlarmRecord.Clear();
                GlobalVar.MESDataRecord.Clear();
                GlobalVar.AddMessage("换班数据清空" + LastBanci);
            }
            if (GlobalVar.AlarmRecordQueue.Count > 0)
            {
                foreach (AlarmTableItem item in GlobalVar.AlarmRecordQueue)
                {
                    GlobalVar.AlarmRecord.Add(item);
                }
                GlobalVar.AlarmRecordQueue.Clear();
            }
            if (GlobalVar.MESDataRecordQueue.Count > 0)
            {
                foreach (MESDataItem item in GlobalVar.MESDataRecordQueue)
                {
                    GlobalVar.MESDataRecord.Add(item);
                }
                GlobalVar.MESDataRecordQueue.Clear();
            }
        }
        private void IDSaveButton_Click(object sender, RoutedEventArgs e)
        {
            GlobalVar.MachineID         = MachineID_Text.Text;
            GlobalVar.UserID            = UserID_Text.Text;
            GlobalVar.ProductName       = ProductName_Text.Text;
            GlobalVar.MachineName       = MachineName_Text.Text;
            GlobalVar.FactoryArea       = FactoryArea_Text.Text;
            GlobalVar.FactorySeparation = FactorySeparation_Text.Text;
            GlobalVar.ZhijuClass        = ZhijuClass_Text.Text;
            GlobalVar.Barcodeproofing   = Barcodeproofing_Text.Text;
            GlobalVar.scancodetype      = scancodetype_Text.Text;
            GlobalVar.MAC  = MAC_Text.Text;
            GlobalVar.CCD  = CCD_Text.Text;
            GlobalVar.NNNN = NNNN_Text.Text;

            Inifile.INIWriteValue(iniParameterPath, "System", "MachineID", MachineID_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "UserID", UserID_Text.Text);

            Inifile.INIWriteValue(iniParameterPath, "System", "ProductName", ProductName_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "MachineName", MachineName_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "FactoryArea", FactoryArea_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "FactorySeparation", FactorySeparation_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "ZhijuClass", ZhijuClass_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "Barcodeproofing", Barcodeproofing_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "scancodetype", scancodetype_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "MAC", MAC_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "CCD", CCD_Text.Text);
            Inifile.INIWriteValue(iniParameterPath, "System", "NNNN", NNNN_Text.Text);
        }
Exemplo n.º 10
0
 private void ParameterSaveCommandExecute()
 {
     Inifile.INIWriteValue(iniParameterPath, "System", "WorkPath", WorkPath);
     Inifile.INIWriteValue(iniParameterPath, "System", "ImageSavePath", ImageSavePath);
     Inifile.INIWriteValue(iniParameterPath, "Server", "IP", ServerIP);
     Inifile.INIWriteValue(iniParameterPath, "Server", "PORT", ServerPort.ToString());
     AddMessage("保存参数");
 }
Exemplo n.º 11
0
        private void TesterStatusInit()
        {
            for (int i = 0; i < 2; i++)
            {
                TestSpan[i]        = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "TestSpan", "0"));
                TestIdle[i]        = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "TestIdle", "0"));
                TestCycle[i]       = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "TestCycle", "0"));
                PassCount[i]       = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "PassCount", "0"));
                PassCount_Nomal[i] = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "PassCount_Nomal", "0"));
                FailCount[i]       = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "FailCount", "0"));
                FailCount_Nomal[i] = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "FailCount_Nomal", "0"));
                TestCount[i]       = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "TestCount", "0"));
                TestCount_Nomal[i] = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "TestCount_Nomal", "0"));
                Yield[i]           = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "Yield", "0"));
                Yield_Nomal[i]     = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 2 + i).ToString(), "Yield_Nomal", "0"));
                string str = "";
                switch (Index)
                {
                case 0:
                    switch (i)
                    {
                    case 0:
                        str = "TesterBracodeAL";
                        break;

                    case 1:
                        str = "TesterBracodeAR";
                        break;

                    default:
                        str = "";
                        break;
                    }
                    break;

                case 1:
                    switch (i)
                    {
                    case 0:
                        str = "TesterBracodeBL";
                        break;

                    case 1:
                        str = "TesterBracodeBR";
                        break;

                    default:
                        str = "";
                        break;
                    }
                    break;

                default:
                    break;
                }
                TesterBracode[i] = Inifile.INIGetStringValue(iniParameterPath, "Barcode", str, "Null");
            }
        }
Exemplo n.º 12
0
        public MainWindow()
        {
            InitializeComponent();
            LastBanci = Inifile.INIGetStringValue(iniParameterPath, "System", "Banci", "0");

            dispatcherTimer.Tick    += new EventHandler(DispatcherTimerTickUpdateUi);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
        }
 private void ParameterSaveCommandExecute()
 {
     Inifile.INIWriteValue(iniParameterPath, "System", "RemotePath", RemotePath);
     Inifile.INIWriteValue(iniParameterPath, "System", "MachineID", MachineID);
     Inifile.INIWriteValue(iniParameterPath, "Remote", "IP", RemoteIP);
     Inifile.INIWriteValue(iniParameterPath, "Remote", "PORT", RemotePort.ToString());
     Inifile.INIWriteValue(iniParameterPath, "Local", "IP", LocalIP);
     Inifile.INIWriteValue(iniParameterPath, "Local", "PORT", LocalPort.ToString());
     AddMessage("保存参数");
 }
        private async void ReUpLoad()
        {
            DataTable dt = new DataTable();
            DataTable dt1;

            dt.Columns.Add("BLDATE", typeof(string));
            dt.Columns.Add("BLID", typeof(string));
            dt.Columns.Add("BLNAME", typeof(string));
            dt.Columns.Add("BLUID", typeof(string));
            dt.Columns.Add("BLMID", typeof(string));
            dt.Columns.Add("Bar", typeof(string));
            string filename = @"D:\NotUpdate.csv";

            UpdateCount = 0;
            if (File.Exists(filename))
            {
                dt1 = Csvfile.GetFromCsv(filename, 1, dt);
                if (dt1.Rows.Count > 0)
                {
                    File.Delete(filename);
                    foreach (DataRow item in dt1.Rows)
                    {
                        DP6SQLROW dP6SQLROW = new DP6SQLROW();
                        dP6SQLROW.BLDATE = item[0].ToString();
                        dP6SQLROW.BLID   = item[1].ToString();
                        dP6SQLROW.BLMID  = item[4].ToString();
                        dP6SQLROW.BLNAME = item[2].ToString();
                        dP6SQLROW.BLUID  = item[3].ToString();
                        dP6SQLROW.Bar    = item[5].ToString();
                        bool r;
                        using (var releaser = await m_lock.LockAsync())
                        {
                            r = await Update_A_Row(dP6SQLROW);
                        }
                        if (r)//更具是否上传成功,写入不同的记录文档
                        {
                            lock (DisEq)
                            {
                                _BarcodeRecord.Enqueue(dP6SQLROW);
                            }
                            WriteRecordtoExcel(dP6SQLROW, true);
                            UpdateCount++;
                            //上传成功
                        }
                        else
                        {
                            WriteRecordtoExcel(dP6SQLROW, false);
                            //上传失败
                        }
                    }
                }
            }
            LastReUpdateStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            Inifile.INIWriteValue(iniParameterPath, "ReUpLoad", "LastReUpdateStr", LastReUpdateStr);
        }
Exemplo n.º 15
0
        private void run()
        {
            bool WriteFileFlag = false;

            try
            {
                numStr = Inifile.INIGetStringValue(iniFilepath, sectionName, "upload", "0");
            }
            catch (Exception ex)
            {
                Log.Default.Error("UploadSoftwareStatus.ReadIniFail1", ex.Message);
            }
            status = true;
            timed  = 2000;
            while (true)
            {
                if (start)
                {
                    try
                    {
                        numStrNew = Inifile.INIGetStringValue(iniFilepath, sectionName, "upload", "0");
                    }
                    catch (Exception ex)
                    {
                        Log.Default.Error("UploadSoftwareStatus.ReadIniFail2", ex.Message);
                    }
                    if (numStr != numStrNew)
                    {
                        status        = true;
                        numStr        = numStrNew;
                        timed         = 2000;
                        start         = false;
                        WriteFileFlag = false;
                    }
                    else
                    {
                        //if (!WriteFileFlag)
                        //{
                        //    Inifile.INIWriteValue(iniFilepath, sectionName, "upload", "0");
                        //    numStr = "0";
                        //    WriteFileFlag = true;
                        //}
                        status = false;
                        timed  = 1000;
                    }
                }
                else
                {
                    timed = 2000;
                }

                System.Threading.Thread.Sleep(timed);
            }
        }
Exemplo n.º 16
0
        public MainDataContext()
        {
            ScanCom              = Inifile.INIGetStringValue(iniParameterPath, "Com", "ScanCom", "COM1");
            SerialPortCom        = Inifile.INIGetStringValue(iniParameterPath, "Com", "SerialPortCom", "COM1");
            MACString            = Inifile.INIGetStringValue(iniParameterPath, "MES", "MAC", "14-B3-1F-02-2D-83");
            LiaoHaoSelectedIndex = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "LiaoHao", "SelectIndex", "0"));
            Scan.ini(ScanCom);
            //ImportDatefromExcel();

            //Console.WriteLine(Convert.ToString(16, 16));
        }
Exemplo n.º 17
0
 private void TextBox4_LostFocus(object sender, RoutedEventArgs e)
 {
     this.TextBox4.IsReadOnly = true;
     try
     {
         Inifile.INIWriteValue(iniParameterPath, "SQLMSG", "BLNAME", TextBox4.Text);
     }
     catch
     {
     }
 }
 private void WriteIni()
 {
     try
     {
         Inifile.INIWriteValue(iniParameterPath, "AS300", "AS300IP", AS300IP);
         MsgText = AddMessage("参数写入完成");
     }
     catch (Exception ex)
     {
         MsgText = AddMessage("参数写入失败: " + ex.Message);
     }
 }
 private void Axis_TechCommandExecute(object obj)
 {
     if (System.Windows.Forms.MessageBox.Show($"是否示教点{int.Parse(obj.ToString()) + 1}?", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         PrefilePos[int.Parse(obj.ToString())].X = CPos.X;
         PrefilePos[int.Parse(obj.ToString())].Y = CPos.Y;
         PrefilePos[int.Parse(obj.ToString())].Z = CPos.Z;
         Inifile.INIWriteValue(iniParameterPath, "Position", "X" + obj.ToString(), PrefilePos[int.Parse(obj.ToString())].X.ToString());
         Inifile.INIWriteValue(iniParameterPath, "Position", "Y" + obj.ToString(), PrefilePos[int.Parse(obj.ToString())].Y.ToString());
         Inifile.INIWriteValue(iniParameterPath, "Position", "Z" + obj.ToString(), PrefilePos[int.Parse(obj.ToString())].Z.ToString());
     }
 }
Exemplo n.º 20
0
 private void ReadParameter()
 {
     JiTaiHao            = Inifile.INIGetStringValue(ParameterIniPath, "Text", "JiTaiHao", "01");
     BarcocdeA           = Inifile.INIGetStringValue(ParameterIniPath, "Text", "BarcocdeA", "ABC");
     BarcocdeB           = Inifile.INIGetStringValue(ParameterIniPath, "Text", "BarcocdeB", "DEF");
     PLCPortCom          = Inifile.INIGetStringValue(ParameterIniPath, "Text", "PLCPortCom", "COM1");
     ScanAPortCom        = Inifile.INIGetStringValue(ParameterIniPath, "Text", "ScanAPortCom", "COM1");
     ScanBPortCom        = Inifile.INIGetStringValue(ParameterIniPath, "Text", "ScanBPortCom", "COM1");
     LastCleanRecordFlag = Inifile.INIGetStringValue(ParameterIniPath, "Record", "LastCleanRecordFlag", "123");
     TrigerTimes         = int.Parse(Inifile.INIGetStringValue(ParameterIniPath, "Times", "TrigerTimes", "0"));
     ScanTimes           = int.Parse(Inifile.INIGetStringValue(ParameterIniPath, "Times", "ScanTimes", "0"));
     UpdateTimes         = int.Parse(Inifile.INIGetStringValue(ParameterIniPath, "Times", "UpdateTimes", "0"));
 }
Exemplo n.º 21
0
 private void TesterStatusInit()
 {
     for (int i = 0; i < 4; i++)
     {
         TesterBracode[i] = Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 4 + i).ToString(), "TesterBracode", "Null");
         TestSpan[i]      = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 4 + i).ToString(), "TestSpan", "0"));
         PassCount[i]     = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 4 + i).ToString(), "PassCount", "0"));
         FailCount[i]     = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 4 + i).ToString(), "FailCount", "0"));
         TestCount[i]     = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 4 + i).ToString(), "TestCount", "0"));
         Yield[i]         = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index * 4 + i).ToString(), "Yield", "0"));
         double timeout = double.Parse(Inifile.INIGetStringValue(iniParameterPath, "FlexTest", "FlexTestTimeout", "100"));
         TestTimeout = (int)(timeout * 1000);
     }
 }
Exemplo n.º 22
0
 private void MNOButtonCommandExecute()
 {
     if (MNOIsReadOnly)
     {
         MNOIsReadOnly = false;
         MNOContent    = "Save";
     }
     else
     {
         MNOIsReadOnly = true;
         MNOContent    = "Edit";
         Inifile.INIWriteValue(iniParameterPath, "System", "MNO", MNO);
     }
 }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            string iniSamplePath = System.Environment.CurrentDirectory + "\\Sample.ini";

            try
            {
                IsSampleCheck.IsChecked = bool.Parse(Inifile.INIGetStringValue(iniSamplePath, "Sample", "IsSample", "True"));
            }
            catch
            {
                IsSampleCheck.IsChecked = true;
            }
            try
            {
                int count = int.Parse(Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemCount", "9"));
                NGItemCount.Text = count.ToString();
            }
            catch
            {
                NGItemCount.Text = "9";
            }
            NGItem1.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem1", "Null");
            NGItem2.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem2", "Null");
            NGItem3.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem3", "Null");
            NGItem4.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem4", "Null");
            NGItem5.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem5", "Null");
            NGItem6.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem6", "Null");
            NGItem7.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem7", "Null");
            NGItem8.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem8", "Null");
            NGItem9.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem9", "Null");
            NGItem10.Text = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItem10", "Null");

            NGItemClassify1.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify1", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify2.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify2", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify3.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify3", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify4.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify4", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify5.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify5", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify6.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify6", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify7.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify7", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify8.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify8", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify9.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify9", "Null") == "ZP" ? "ZP" : "FCT";
            NGItemClassify10.Text = Inifile.INIGetStringValue(iniSamplePath, "Sample", "NGItemClassify10", "Null") == "ZP" ? "ZP" : "FCT";

            SamMode.Text = Inifile.INIGetStringValue(iniSamplePath, "Sample", "SamMode", "Null") == "2h" ? "2h" : "6h";

            ZPMID.Text  = Inifile.INIGetStringValue(iniSamplePath, "Sample", "ZPMID", "ATKC4-012");
            FCTMID.Text = Inifile.INIGetStringValue(iniSamplePath, "Sample", "FCTMID", "ATKC4-016");
        }
Exemplo n.º 24
0
 private void BigDataParamClicked(object sender, RoutedEventArgs e)
 {
     _PM          = PM.Text;
     _GROUP1      = GROUP1.Text;
     _TRACK       = TRACK.Text;
     _MACID       = MACID.Text;
     _WORKSTATION = WORKSTATION.Text;
     _LIGHT_ID    = LIGHT_ID.Text;
     Inifile.INIWriteValue(iniParameterPath, "BigData", "PM", PM.Text);
     Inifile.INIWriteValue(iniParameterPath, "BigData", "GROUP1", GROUP1.Text);
     Inifile.INIWriteValue(iniParameterPath, "BigData", "TRACK", TRACK.Text);
     Inifile.INIWriteValue(iniParameterPath, "BigData", "MACID", MACID.Text);
     Inifile.INIWriteValue(iniParameterPath, "BigData", "WORKSTATION", WORKSTATION.Text);
     Inifile.INIWriteValue(iniParameterPath, "BigData", "LIGHT_ID", LIGHT_ID.Text);
     AddMessage("参数保存完成");
 }
Exemplo n.º 25
0
        public DeltaPLC()
        {
            COM   = Inifile.INIGetStringValue(iniParameterPath, "System", "COM", "COM1");
            STATE = Inifile.INIGetStringValue(iniParameterPath, "System", "STATE", "01");
            plc   = new Delta_ModbusASCII(COM, 9600, System.IO.Ports.Parity.Even, 7, System.IO.Ports.StopBits.One);
            ScanC = new Scan();
            string ScanCom = Inifile.INIGetStringValue(iniParameterPath, "System", "扫码枪串口", "COM1");

            ReUpdateHour = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "System", "ReUpdateHour", "0"));
            //ScanC.ini(ScanCom);
            //ScanC.Connect();
            PlcRun();
            vision = new Vision();

            //plc.PLCWriteBit(STATE, "M3111", "0006", "3E");
            // GlobalVar.AddMessage("蚀刻信息已写入PLC");
        }
Exemplo n.º 26
0
        /// <数据更新保存AAB>
        ///
        /// </summary>
        /// <param name="rst"></param>
        /// <param name="index_i"></param>
        public void UpdateTester1(int rst, int index_i)
        {
            /*result = 0 -> Ng
             * result = 1 -> Pass
             * result = 2 -> Timeout
             */
            switch (rst)
            {
            case 0:

                FailCount[index_i]++;

                break;

            case 1:

                PassCount[index_i]++;

                break;

            default:

                break;
            }

            TestCount[index_i]++;
            if (PassCount[index_i] + FailCount[index_i] != 0)
            {
                Yield[index_i] = Math.Round((double)PassCount[index_i] / (PassCount[index_i] + FailCount[index_i]) * 100, 2);
            }
            else
            {
                Yield[index_i] = 0;
            }
            try
            {
                //Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestSpan", TestSpan.ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "PassCount", PassCount[index_i].ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "FailCount", FailCount[index_i].ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "TestCount", TestCount[index_i].ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index * 2 + index_i).ToString(), "Yield", Yield[index_i].ToString());
            }
            catch
            {
            }
        }
 private void ReadIni()
 {
     try
     {
         AS300IP         = Inifile.INIGetStringValue(iniParameterPath, "AS300", "AS300IP", "192.168.1.5");
         HScriptFileName = Inifile.INIGetStringValue(iniParameterPath, "Camera", "HScriptFileName", @"D:\test.hdev");
         BLID            = Inifile.INIGetStringValue(iniParameterPath, "SQLMSG", "BLID", "Null");
         BLUID           = Inifile.INIGetStringValue(iniParameterPath, "SQLMSG", "BLUID", "Null");
         BLMID           = Inifile.INIGetStringValue(iniParameterPath, "SQLMSG", "BLMID", "Null");
         BLNAME          = Inifile.INIGetStringValue(iniParameterPath, "SQLMSG", "BLNAME", "Null");
         LastReUpdateStr = Inifile.INIGetStringValue(iniParameterPath, "ReUpLoad", "LastReUpdateStr", "2017-10-16 11:22:33");
         MsgText         = AddMessage("参数读取完成");
     }
     catch (Exception ex)
     {
         MsgText = AddMessage("参数读取失败: " + ex.Message);
     }
 }
Exemplo n.º 28
0
 public Tester(int index)
 {
     Index           = index;
     idleswflag      = false;
     idlesw          = new Stopwatch();
     TestSpan        = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestSpan", "0"));
     TestIdle        = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestIdle", "0"));
     TestCycle       = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCycle", "0"));
     PassCount       = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount", "0"));
     PassCount_Nomal = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount_Nomal", "0"));
     FailCount       = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount", "0"));
     FailCount_Nomal = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount_Nomal", "0"));
     TestCount       = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount", "0"));
     TestCount_Nomal = int.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount_Nomal", "0"));
     Yield           = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield", "0"));
     Yield_Nomal     = double.Parse(Inifile.INIGetStringValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield_Nomal", "0"));
     Task.Run(() => { RunLoop(); });
 }
Exemplo n.º 29
0
        private void UpdateTester(int rst)
        {
            /*result = 0 -> Ng
             * result = 1 -> Pass
             * result = 2 -> Timeout
             */
            switch (rst)
            {
            case 0:
                testStatus = TestStatus.Tested;
                testResult = TestResult.Ng;
                FailCount_Nomal++;
                break;

            case 1:
                testStatus = TestStatus.Tested;
                testResult = TestResult.Pass;
                PassCount_Nomal++;
                break;

            case 2:
                testStatus = TestStatus.Tested;
                testResult = TestResult.TimeOut;
                break;

            default:
                testStatus = TestStatus.Err;
                testResult = TestResult.TimeOut;
                break;
            }
            TestCount_Nomal++;
            Yield_Nomal = Math.Round((double)PassCount_Nomal / (PassCount_Nomal + FailCount_Nomal) * 100, 2);
            try
            {
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestSpan", TestSpan.ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "PassCount_Nomal", PassCount_Nomal.ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "FailCount_Nomal", FailCount_Nomal.ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "TestCount_Nomal", TestCount_Nomal.ToString());
                Inifile.INIWriteValue(iniTesterResutPath, "Tester" + Index.ToString(), "Yield_Nomal", Yield_Nomal.ToString());
            }
            catch
            {
            }
        }
Exemplo n.º 30
0
 public void Clean()
 {
     TestCount       = 0;
     PassCount       = 0;
     FailCount       = 0;
     Yield           = 0;
     TestCount_Nomal = 0;
     PassCount_Nomal = 0;
     FailCount_Nomal = 0;
     Yield_Nomal     = 0;
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount_Nomal", PassCount_Nomal.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount_Nomal", FailCount_Nomal.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount_Nomal", TestCount_Nomal.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield_Nomal", Yield_Nomal.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "PassCount", PassCount.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "FailCount", FailCount.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "TestCount", TestCount.ToString());
     Inifile.INIWriteValue(iniTesterResutPath, "Tester" + (Index - 1).ToString(), "Yield", Yield.ToString());
 }