| | |
| | | using HMI.Core.Util; |
| | | using HMI.Util; |
| | | using NationalInstruments.TestStand.Interop.API; |
| | | using System; |
| | | using System.ComponentModel; |
| | |
| | | #endregion |
| | | private bool isLoadOK = false; |
| | | private int index; |
| | | private string counterFilePath; |
| | | private string CountIniPath; |
| | | |
| | | private string status = "Ready"; |
| | | |
| | |
| | | get => this.lang("Ts.TestInfo", Barcode, ElapseTime); |
| | | } |
| | | |
| | | private string currentStep; |
| | | public string CurrentStep |
| | | { |
| | | get { return currentStep; } |
| | | set { Set(ref currentStep, value); } |
| | | } |
| | | |
| | | private string barcode = string.Empty; |
| | | public string Barcode |
| | | { |
| | |
| | | |
| | | private DataTable dt; |
| | | |
| | | public SingleControl(int Index, int passNum, int failNum) |
| | | private string currentStep = "等待扫码"; |
| | | public string CurrentStep |
| | | { |
| | | get => currentStep; |
| | | set |
| | | { |
| | | Set(ref currentStep, value); |
| | | } |
| | | } |
| | | |
| | | public SingleControl(int Index, string CountIniPath) |
| | | { |
| | | this.CountIniPath = CountIniPath; |
| | | DataContext = this; |
| | | this.index = Index; |
| | | PassNum = passNum; |
| | |
| | | /// <param name="ProcessVal"></param> |
| | | public void SetTestProcess(int ProcessVal) |
| | | { |
| | | //this.TestProcess.Value = ProcessVal; |
| | | //this.TestProcessLabel.Text = ProcessVal.ToString() + "%"; |
| | | //this.TestProcessLabel.BackColor = Color.Transparent; |
| | | this.testProcess.Value = ProcessVal; |
| | | this.testProcessLabel.Content = ProcessVal.ToString() + "%"; |
| | | } |
| | | |
| | | private void UserControl_Loaded(object sender, RoutedEventArgs e) |
| | | { |
| | | ReadCounter(); |
| | | this.UpdateTestCounter(null); |
| | | } |
| | | |
| | |
| | | TotalNum = PassNum + FailNum; |
| | | if (TotalNum != 0) |
| | | { |
| | | PassRate = (PassNum / TotalNum) * 100; |
| | | PassRate = (PassNum / TotalNum); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | private void WriteCounter() |
| | | { |
| | | IniFileHelper.WriteIniData("Socket" + this.index.ToString(), "Pass", |
| | | this.passNum.ToString(), this.CountIniPath); |
| | | IniFileHelper.WriteIniData("Socket" + this.index.ToString(), "Fail", this.failNum.ToString(), |
| | | this.CountIniPath); |
| | | } |
| | | |
| | | private void ReadCounter() |
| | | { |
| | | try |
| | | { |
| | | this.passNum = Convert.ToInt32(IniFileHelper.ReadIniData("Socket" + this.index.ToString(), "Pass", "", CountIniPath)); |
| | | this.failNum = Convert.ToInt32(IniFileHelper.ReadIniData("Socket" + this.index.ToString(), "Fail", "", CountIniPath)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //do nothing |
| | | } |
| | | } |
| | | |
| | | public void ResetCounter() |
| | | { |
| | | PassNum = 0; |
| | | FailNum = 0; |
| | | this.passNum = 0; |
| | | this.failNum = 0; |
| | | this.UpdateTestCounter(null); |
| | | } |
| | | |
| | | } |
| | | } |