| | |
| | | } |
| | | } |
| | | |
| | | private string tsModelPath; |
| | | private string dataLogPath; |
| | | private SqliteHelper sqliteHelper; |
| | | |
| | |
| | | base.SetBaseFolder(folder); |
| | | } |
| | | |
| | | public override void InitFinish() |
| | | private void CheckSqlHelper() |
| | | { |
| | | this.ReadCount(out int pass, out int fail); |
| | | this.DisplayCount(pass, fail); |
| | | InitProducts(); |
| | | ReadConfig(); |
| | | if (!File.Exists(dataLogPath)) |
| | | string today = DateTime.Now.ToString("yyyyMMdd"); |
| | | string dbPath = Path.Combine(dataLogPath, $"Data_{today}.db"); |
| | | if (!File.Exists(dbPath)) |
| | | { |
| | | SqliteHelper.CreateDatabase(dataLogPath); |
| | | SqliteHelper.CreateDatabase(dbPath); |
| | | } |
| | | sqliteHelper = new SqliteHelper(dataLogPath); |
| | | if (sqliteHelper == null || sqliteHelper.DataBaseFile != dbPath) |
| | | { |
| | | sqliteHelper?.Dispose(); |
| | | sqliteHelper = new SqliteHelper(dbPath); |
| | | sqliteHelper.ExecuteSql(@"CREATE TABLE IF NOT EXISTS serialData ( |
| | | id INTEGER PRIMARY KEY AUTOINCREMENT, |
| | | sn TEXT NOT NULL, |
| | | model TEXT, |
| | | station TEXT NOT NULL, |
| | | step TEXT NOT NULL, |
| | | position TEXT, |
| | | limitDown TEXT, |
| | | limitUp TEXT, |
| | | unit TEXT, |
| | |
| | | sn TEXT NOT NULL, |
| | | model TEXT, |
| | | station TEXT NOT NULL, |
| | | position TEXT, |
| | | status TEXT, |
| | | result TEXT NOT NULL, |
| | | time DATETIME NOT NULL);"); |
| | | try |
| | | { |
| | | sqliteHelper.ExecuteSql("alter table serialData add column 'model' TEXT default NULL;"); |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | |
| | | try |
| | | public override void InitFinish() |
| | | { |
| | | sqliteHelper.ExecuteSql("alter table serialData add column 'position' TEXT default NULL;"); |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | try |
| | | { |
| | | sqliteHelper.ExecuteSql("alter table testResult add column 'position' TEXT default NULL;"); |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | |
| | | try |
| | | { |
| | | sqliteHelper.ExecuteSql("alter table testResult add column 'status' TEXT default NULL;"); |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | |
| | | this.ReadCount(out int pass, out int fail); |
| | | this.DisplayCount(pass, fail); |
| | | InitProducts(); |
| | | ReadConfig(); |
| | | CheckSqlHelper(); |
| | | base.InitFinish(); |
| | | } |
| | | |
| | |
| | | } |
| | | catch |
| | | { |
| | | dataLogPath = Path.Combine(PathHelper.ConfigFolder, "DataBoard", "DataLog.db"); |
| | | dataLogPath = Path.Combine(PathHelper.ConfigFolder, "DataBoard"); |
| | | } |
| | | |
| | | try |
| | | { |
| | | |
| | | value = ParameterManager.GetCommonParameterByName("TsModelPath"); |
| | | tsModelPath = value.Value; |
| | | } |
| | | catch |
| | | { |
| | | //@"C:\Program Files\National Instruments\TestStand 2020\Components\Models\TestStandModels\ParallelModel.seq" |
| | | tsModelPath = @"C:\Users\Public\Documents\National Instruments\TestStand 2020 (64-bit)\Components\Models\ParallelModel.seq"; |
| | | } |
| | | |
| | | |
| | | //Convert.ToBoolean(IniFileHelper.ReadIniData("Config", "EnableMes", "true", CountIniPath)); |
| | | //EnableCanLog = Convert.ToBoolean(IniFileHelper.ReadIniData("Config", "EnableCanLog", "true", CountIniPath)); |
| | |
| | | { |
| | | engine?.Globals.SetValString("StationState.ProductModel", 1, SelectedProduct?.Name); |
| | | engine?.CommitGlobalsToDisk(promptOnSaveConflicts: false); |
| | | //this.modeSeq = this.engine.GetSequenceFileEx(@"C:\Program Files\National Instruments\TestStand 2020\Components\Models\TestStandModels\ParallelModel.seq"); |
| | | this.modeSeq = this.engine.GetSequenceFileEx(@"C:\Users\Public\Documents\National Instruments\TestStand 2020 (64-bit)\Components\Models\ParallelModel.seq"); |
| | | this.modeSeq = this.engine.GetSequenceFileEx(tsModelPath); |
| | | this.testSeq = this.engine.GetSequenceFileEx(this.testSeqFile, 2, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType); |
| | | this.execution = this.engine.NewExecution(this.testSeq, "Test UUTs", this.modeSeq, false, 0, null, null, null); |
| | | IsTesting = true; |
| | |
| | | |
| | | public void SavePositionDB(int index, string status) |
| | | { |
| | | CheckSqlHelper(); |
| | | var socket = this.tsSockets[index]; |
| | | var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | string snr = socket.Barcode; |