From 797e6e5d858ece782ed4acafb6742127cf7004ce Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 5 Oct 2023 16:22:17 +0200 Subject: [PATCH 01/56] temperature calibration results implemented. note! the results are from laa production web requested. --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 151 +++++++++- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 149 ++++++++-- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 21 ++ .../GenesisToolBox/Infrastructure/Software.cs | 20 +- .../Infrastructure/TempMeterModels.cs | 263 +++++++++++++++++- .../API/Production/TempMeterController.cs | 57 ++-- .../App_Start/WebApiConfig.cs | 10 + 7 files changed, 612 insertions(+), 59 deletions(-) diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index 9334ab16..c111901d 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,6 +31,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -67,7 +68,17 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label2 = new System.Windows.Forms.Label(); this.GMHPort = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); - this.tabPage4 = new System.Windows.Forms.TabPage(); + this.resultsTab = new System.Windows.Forms.TabPage(); + this.aggregationsGridView = new System.Windows.Forms.DataGridView(); + this.PcbId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Avg_Nr = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Avg_T = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Avg_TOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Selected = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.resultsMenu = new System.Windows.Forms.MenuStrip(); + this.loadPcbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.updateViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); this.automaticCalibrationTabControl.SuspendLayout(); @@ -77,6 +88,9 @@ namespace Xylem.Common.Ui.GenesisToolBox ((System.ComponentModel.ISupportInitialize)(this.nudRef)).BeginInit(); this.AutomaticCalibrationTab.SuspendLayout(); this.automaticControlsPanel.SuspendLayout(); + this.resultsTab.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.aggregationsGridView)).BeginInit(); + this.resultsMenu.SuspendLayout(); this.SuspendLayout(); // // timer1 @@ -94,7 +108,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticCalibrationTabControl.Controls.Add(this.tabPage2); this.automaticCalibrationTabControl.Controls.Add(this.tabPage3); this.automaticCalibrationTabControl.Controls.Add(this.AutomaticCalibrationTab); - this.automaticCalibrationTabControl.Controls.Add(this.tabPage4); + this.automaticCalibrationTabControl.Controls.Add(this.resultsTab); this.automaticCalibrationTabControl.Dock = System.Windows.Forms.DockStyle.Fill; this.automaticCalibrationTabControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.automaticCalibrationTabControl.Location = new System.Drawing.Point(0, 24); @@ -498,15 +512,115 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label1.Text = "Messgerät (COM port)"; this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // - // tabPage4 + // resultsTab // - this.tabPage4.Location = new System.Drawing.Point(4, 25); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(1217, 647); - this.tabPage4.TabIndex = 4; - this.tabPage4.Text = "tabPage4"; - this.tabPage4.UseVisualStyleBackColor = true; + this.resultsTab.Controls.Add(this.aggregationsGridView); + this.resultsTab.Controls.Add(this.resultsMenu); + this.resultsTab.Location = new System.Drawing.Point(4, 25); + this.resultsTab.Margin = new System.Windows.Forms.Padding(0); + this.resultsTab.Name = "resultsTab"; + this.resultsTab.Size = new System.Drawing.Size(1217, 647); + this.resultsTab.TabIndex = 4; + this.resultsTab.Text = "Results"; + this.resultsTab.UseVisualStyleBackColor = true; + // + // aggregationsGridView + // + this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; + this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.PcbId, + this.Avg_Nr, + this.Avg_T, + this.Avg_TOF, + this.Selected}); + this.aggregationsGridView.Dock = System.Windows.Forms.DockStyle.Fill; + this.aggregationsGridView.Location = new System.Drawing.Point(0, 24); + this.aggregationsGridView.Margin = new System.Windows.Forms.Padding(0); + this.aggregationsGridView.Name = "aggregationsGridView"; + this.aggregationsGridView.Size = new System.Drawing.Size(1217, 623); + this.aggregationsGridView.TabIndex = 0; + // + // PcbId + // + this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PcbId.HeaderText = "PcbId"; + this.PcbId.Name = "PcbId"; + this.PcbId.ReadOnly = true; + // + // Avg_Nr + // + this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Avg_Nr.HeaderText = "Avg Nr"; + this.Avg_Nr.Name = "Avg_Nr"; + this.Avg_Nr.ReadOnly = true; + // + // Avg_T + // + this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Avg_T.HeaderText = "Avg °C"; + this.Avg_T.Name = "Avg_T"; + this.Avg_T.ReadOnly = true; + // + // Avg_TOF + // + this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Avg_TOF.HeaderText = "Avg TOF"; + this.Avg_TOF.Name = "Avg_TOF"; + this.Avg_TOF.ReadOnly = true; + // + // Selected + // + this.Selected.FalseValue = "false"; + this.Selected.HeaderText = "Selected"; + this.Selected.IndeterminateValue = "false"; + this.Selected.Name = "Selected"; + this.Selected.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.Selected.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.Selected.TrueValue = "true"; + // + // resultsMenu + // + this.resultsMenu.BackColor = System.Drawing.Color.WhiteSmoke; + this.resultsMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.loadPcbToolStripMenuItem, + this.updateViewToolStripMenuItem, + this.saveSelectedToolStripMenuItem}); + this.resultsMenu.Location = new System.Drawing.Point(0, 0); + this.resultsMenu.Name = "resultsMenu"; + this.resultsMenu.Size = new System.Drawing.Size(1217, 24); + this.resultsMenu.TabIndex = 1; + this.resultsMenu.Text = "menuStrip1"; + // + // loadPcbToolStripMenuItem + // + this.loadPcbToolStripMenuItem.Name = "loadPcbToolStripMenuItem"; + this.loadPcbToolStripMenuItem.Size = new System.Drawing.Size(68, 20); + this.loadPcbToolStripMenuItem.Text = "Load pcb"; + // + // updateViewToolStripMenuItem + // + this.updateViewToolStripMenuItem.Name = "updateViewToolStripMenuItem"; + this.updateViewToolStripMenuItem.Size = new System.Drawing.Size(84, 20); + this.updateViewToolStripMenuItem.Text = "Update view"; + this.updateViewToolStripMenuItem.Click += new System.EventHandler(this.UpdateViewToolStripMenuItem_Click); + // + // saveSelectedToolStripMenuItem + // + this.saveSelectedToolStripMenuItem.Name = "saveSelectedToolStripMenuItem"; + this.saveSelectedToolStripMenuItem.Size = new System.Drawing.Size(89, 20); + this.saveSelectedToolStripMenuItem.Text = "Save selected"; + this.saveSelectedToolStripMenuItem.Click += new System.EventHandler(this.SaveSelectedToolStripMenuItem_Click); // // timer3 // @@ -543,6 +657,11 @@ namespace Xylem.Common.Ui.GenesisToolBox this.AutomaticCalibrationTab.ResumeLayout(false); this.automaticControlsPanel.ResumeLayout(false); this.automaticControlsPanel.PerformLayout(); + this.resultsTab.ResumeLayout(false); + this.resultsTab.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.aggregationsGridView)).EndInit(); + this.resultsMenu.ResumeLayout(false); + this.resultsMenu.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -587,6 +706,16 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.TextBox messurementDauerMS; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button saveSettingsBtn; - private System.Windows.Forms.TabPage tabPage4; + private System.Windows.Forms.TabPage resultsTab; + private System.Windows.Forms.DataGridView aggregationsGridView; + private System.Windows.Forms.MenuStrip resultsMenu; + private System.Windows.Forms.ToolStripMenuItem updateViewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveSelectedToolStripMenuItem; + private System.Windows.Forms.DataGridViewTextBoxColumn PcbId; + private System.Windows.Forms.DataGridViewTextBoxColumn Avg_Nr; + private System.Windows.Forms.DataGridViewTextBoxColumn Avg_T; + private System.Windows.Forms.DataGridViewTextBoxColumn Avg_TOF; + private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; + private System.Windows.Forms.ToolStripMenuItem loadPcbToolStripMenuItem; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index 3e425c03..13f7f9de 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; + using System.Data; using System.Drawing; using System.IO; using System.IO.Pipes; @@ -39,6 +40,8 @@ private Boolean lutIsMissing; private List reftempRangeReq; private List cordonelTempLut; + private AutomaticTemperatureCalibration automaticCalibration; + private bool automatic = false; public FrmTempMeter() { @@ -554,6 +557,18 @@ private void InitializeContent() { + this.automaticCalibration = new AutomaticTemperatureCalibration(null, this); + + foreach (var pcbText in this.automaticCalibration.AvailablePcbs()) + { + var dropdownPcbId = new ToolStripMenuItem(pcbText); + dropdownPcbId.Click += DropdownPcbId_Click; + + this.loadPcbToolStripMenuItem.DropDownItems.Add(dropdownPcbId); + } + + this.aggregationsGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.WhiteSmoke; + this.mainMenuStrip.Padding = new Padding(5); var menuFont = this.mainMenuStrip.Font; @@ -721,9 +736,6 @@ this.stopAutomaticBtn.Enabled = false; } - private bool automatic = false; - private AutomaticTemperatureCalibration automaticCalibration; - private void StartAutomaticBtn_Clicked(object sender, EventArgs args) { if (this.currentGenesis is null) @@ -741,7 +753,7 @@ this.automatic = true; this.start = DateTimeOffset.Now; - var pcbid = this.currentGenesis?.PcbId ?? "*********"; + var pcbid = this.currentGenesis?.PcbId; this.automaticCalibration = new AutomaticTemperatureCalibration(pcbid, this); this.automaticCalibration.StartMessuring(); @@ -786,18 +798,6 @@ })); } - private void SaveMessurement(double currentT, double meterTOF, DateTime timestamp) - { - // var pcbid = this.currentGenesis?.PcbId ?? "000000000"; - // var temperature = currentT.ToString().Substring(0, 2); - - // TODO: LocalWebRequest.PostRequestAsync( - // $"http://10.49.40.25/MeterProcessState/api/TempFlange/AddLut?PcbId={pcbid}&RefTempC={temperature}&AvgTof={meterTOF}&dt={timestamp}"); - // File.AppendAllLines("_temp_luts.txt", new[] { $"{pcbid}\t{temperature:F2}\t{meterTOF}\t{timestamp}" }); - - // File.AppendAllText($"./messuremensts/{pcbid}.txt", $"{pcbid}\t{currentT:F2}\t{meterTOF:F16}\t{timestamp}{Environment.NewLine}"); - } - protected override void OnClosed(EventArgs e) { base.OnClosed(e); @@ -860,5 +860,122 @@ Appsettings.SaveSettings(); } + + private Messurement[] aggregations; + private string selectedPcb; + + private void DropdownPcbId_Click(Object sender, EventArgs e) + { + if (this.automaticCalibration is null) + { + this.automaticCalibration = new AutomaticTemperatureCalibration(null, this); + } + + var pcb = string.Empty; + + if (sender is ToolStripMenuItem menuItem) + { + this.selectedPcb = menuItem.Text; + } + + this.LoadAggregations(this.selectedPcb); + } + + private void UpdateViewToolStripMenuItem_Click(Object sender, EventArgs e) + => this.LoadAggregations(this.selectedPcb); + + private void LoadAggregations(string pcb) + => this.BeginInvoke(new Action(() => + { + this.aggregations = this.automaticCalibration + .AggregationsFor(pcb) + .ToArray(); + + var rowsCount = this.aggregations.Length; + + this.aggregationsGridView.Rows.Clear(); + + if (rowsCount <= 0) + { + return; + } + + this.aggregationsGridView.Rows.Add(rowsCount); + + for (int i = 0; i < rowsCount; i++) + { + var aggregation = this.aggregations[i]; + var currentRow = this.aggregationsGridView.Rows[i]; + + currentRow.Cells[0].Value = aggregation.PcbId; + currentRow.Cells[1].Value = aggregation.Id; + currentRow.Cells[2].Value = aggregation.AvgT; + currentRow.Cells[3].Value = aggregation.AvgTOF; + currentRow.Cells[4].Value = aggregation.Selected; + currentRow.Cells[4].Tag = aggregation.PcbId; + currentRow.Cells[4].ValueType = typeof(bool); + + if (aggregation.Selected) + { + currentRow.DefaultCellStyle.BackColor = Color.WhiteSmoke; + } + } + + this.aggregationsGridView.CellContentClick += AggregationsGridView_CurrentCellChanged; + })); + + private void AggregationsGridView_CurrentCellChanged(Object sender, EventArgs e) + { + this.BeginInvoke(new Action(() => + { + this.aggregationsGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); + + var rows = this.aggregationsGridView.Rows; + var rowsCount = this.aggregationsGridView.Rows.Count; + + for (int i = 0; i < rowsCount; i++) + { + var row = rows[i]; + var cell = row.Cells[4]; + + if (cell.Tag is null) + { + continue; + } + + row.DefaultCellStyle.BackColor = Color.White; + + if (bool.TryParse($"{cell.Value}", out bool value) && value) + { + row.DefaultCellStyle.BackColor = Color.WhiteSmoke; + } + } + })); + } + + private void SaveSelectedToolStripMenuItem_Click(Object sender, EventArgs e) + { + this.aggregationsGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); + + var rows = this.aggregationsGridView.Rows; + var rowsCount = this.aggregationsGridView.Rows.Count; + + for (int i = 0; i < rowsCount; i++) + { + var cell = rows[i].Cells[4]; + + if (cell.Tag is null) + { + continue; + } + + if (bool.TryParse($"{cell.Value}", out bool value)) + { + this.aggregations[i].Selected = value; + } + } + + this.automaticCalibration?.UpdateAggregations(this.aggregations.Where(x => x.Selected)); + } } } diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index 5eae84c8..57c30f37 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,6 +123,27 @@ 104, 17 + + 413, 17 + + + True + + + True + + + True + + + True + + + True + + + 413, 17 + 191, 17 diff --git a/Common/Ui/GenesisToolBox/Infrastructure/Software.cs b/Common/Ui/GenesisToolBox/Infrastructure/Software.cs index 0d00e312..06e6ff7d 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/Software.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/Software.cs @@ -8,18 +8,19 @@ using CommonCore.Configuration; using Logic.SoftwareAccessHelper; + using System.Net.Http.Headers; /// /// Holds information over current software and logged in user. /// internal static class Software { - private static String bearer; + private static String Bearer; private static IEnumerable softwareFunctions = Array.Empty(); public static String UserName; - private static Boolean HasUser => !string.IsNullOrWhiteSpace(bearer); + private static Boolean HasUser => !string.IsNullOrWhiteSpace(Bearer); public static void Initialize() { @@ -51,7 +52,7 @@ url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Login/AD", json: model); - bearer = authenticationResponse.Content; + Bearer = authenticationResponse.Content; softwareFunctions = GetFunctions(); UserName = "Options"; @@ -83,7 +84,7 @@ BuildV = SoftwareVersion.Current.BuildV, }); - bearer = authenticationResponse.Content; + Bearer = authenticationResponse.Content; softwareFunctions = GetFunctions(); UserName = "Options"; @@ -95,7 +96,7 @@ .GetRequest( timeoutMs: 1200, url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Personalization/Login", - header: new Dictionary { { "Authorization", $"Bearer {bearer}" } }) + header: new Dictionary { { "Authorization", $"Bearer {Bearer}" } }) .Trim('"'); } catch (Exception ) @@ -114,7 +115,7 @@ public static IEnumerable GetFunctions() { - if (string.IsNullOrWhiteSpace(bearer)) + if (string.IsNullOrWhiteSpace(Bearer)) { return Array.Empty(); } @@ -124,7 +125,7 @@ var functionsResponse = LocalWebRequest.GetRequest( timeoutMs: 1200, url: $"{ServiceUrls.LaaProductionAPI}/LaaProductionWeb/API/Personalization/Software/Access", - header: new Dictionary { { "Authorization", $"Bearer {bearer}" } }); + header: new Dictionary { { "Authorization", $"Bearer {Bearer}" } }); return JsonConvert .DeserializeObject>(functionsResponse) @@ -145,10 +146,13 @@ public static void Logout() { UserName = "Options"; - bearer = default(String); + Bearer = default(String); softwareFunctions = Array.Empty(); Initialize(); } + + public static AuthenticationHeaderValue AuthorizationHeader + => new AuthenticationHeaderValue(nameof(Bearer), Bearer); } } diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index 85ecb02f..55ef2121 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -1,12 +1,18 @@ namespace Xylem.Common.Ui.GenesisToolBox.Infrastructure { + using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; + using System.Net; + using System.Net.Http; + using System.Net.Http.Headers; using System.Runtime.InteropServices; using System.Timers; + using System.Windows; using SystemThreadingThread = System.Threading.Thread; @@ -97,8 +103,13 @@ { this.pcbId = pcbId; this.tempMeterForm = genesisMeter; - this.messurementsFile = this.GetOrCreateMessurementsFile(this.pcbId); - this.aggregationsFile = this.GetOrCreateAggregationsFile(this.pcbId); + + if (int.TryParse($"{this.pcbId}", out int pcb)) + { + this.messurementsFile = this.GetOrCreateMessurementsFile(this.pcbId); + this.aggregationsFile = this.GetOrCreateAggregationsFile(this.pcbId); + } + this.temperatureSource = new TemperatureSource(); this.en = new CultureInfo("en-US"); this.de = new CultureInfo("de-DE"); @@ -239,6 +250,11 @@ { var tParsed = double.TryParse(tString, ANY, this.en, out currentT) || double.TryParse(tString, ANY, this.de, out currentT); var tofParsed = double.TryParse(tofString, ANY, this.en, out currentTOF) || double.TryParse(tofString, ANY, this.de, out currentTOF); + + if (!tParsed || !tofParsed) + { + continue; + } } catch { @@ -250,6 +266,249 @@ File.AppendAllLines(this.aggregationsFile, new[] { messurements.ToString() }); } + + internal IEnumerable AggregationsFor(string pcb) + { + var aggregations = new List(); + var aggregationsFile = $"{WORKING_DIR}\\{pcb}{AGGREGATIONS_FILE}"; + + var existingAggregations = this.GetAggregations(pcb); + var aggregationsLines = new List(); + + if (File.Exists(aggregationsFile)) + { + aggregationsLines = File + .ReadAllLines(aggregationsFile) + .Skip(1) + .ToList(); + } + + if (aggregationsLines.Count <= 0) + { + aggregations = existingAggregations.ToList(); + aggregations.ForEach(x => x.Selected = true); + } + + foreach (var line in aggregationsLines) + { + if (string.IsNullOrWhiteSpace(line)) + { + continue; + } + + var tokens = line.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); + + if (tokens.Length != 10) + { + continue; + } + + var pcbString = tokens[0] ?? string.Empty; + var avgTString = tokens[3] ?? string.Empty; + var avgTOFString = tokens[4] ?? string.Empty; + + var pcbId = default(int); + var avgT = default(double); + var avgTOF = default(double); + + var pcbParsed = int.TryParse(pcbString, out pcbId); + var tParsed = double.TryParse(avgTString, ANY, this.en, out avgT) || double.TryParse(avgTString, ANY, this.de, out avgT); + var tofParsed = double.TryParse(avgTOFString, ANY, this.en, out avgTOF) || double.TryParse(avgTOFString, ANY, this.de, out avgTOF); + + if (!pcbParsed || !tParsed || !tofParsed) + { + continue; + } + + aggregations.Add(new Messurement + { + PcbId = pcbId, + AvgT = avgT, + AvgTOF = avgTOF, + Selected = existingAggregations.Any(x => x.AvgT == avgT) + }); + } + + return aggregations + .OrderBy(x => x.PcbId) + .ThenBy(x => x.AvgT) + .ThenBy(x => x.AvgTOF) + .Select((messurement, index) => + { + messurement.Id = index + 1; + + return messurement; + }) + .ToList(); + } + + internal IEnumerable GetAggregations(string pcb) + { + var aggregations = Array.Empty(); + + try + { + using (var httpClient = new HttpClient()) + { + using (var httpRequestMessage = new HttpRequestMessage()) + { + httpRequestMessage.Method = HttpMethod.Get; + httpRequestMessage.Headers.Authorization = Software.AuthorizationHeader; + httpRequestMessage.RequestUri = new Uri($"http://localhost:52822/LaaProductionWeb/API/Production/TempMeter/{pcb}"); + + using (var httpResponseMessage = httpClient.SendAsync(httpRequestMessage).Result) + { + if (httpResponseMessage.StatusCode == HttpStatusCode.OK) + { + var content = httpResponseMessage + .Content + .ReadAsStringAsync() + .Result; + + aggregations = JsonConvert.DeserializeObject($"{content}"); + } + else + { + MessageBox.Show($"HTTP! {(int)httpResponseMessage.StatusCode} - {httpResponseMessage.ReasonPhrase}."); + } + } + } + } + } + catch (Exception e) + { + MessageBox.Show($"Failed! {e.Message}"); + } + + return aggregations; + } + + internal async void UpdateAggregations(IEnumerable messurements) + { + var message = "Succeeded!"; + + try + { + using (var httpClient = new HttpClient()) + { + using (var httpRequestMessage = new HttpRequestMessage()) + { + httpRequestMessage.Method = HttpMethod.Post; + httpRequestMessage.Headers.Authorization = Software.AuthorizationHeader; + httpRequestMessage.RequestUri = new Uri("http://localhost:52822/LaaProductionWeb/API/Production/TempMeter/Update"); + httpRequestMessage.Content = new StringContent(JsonConvert.SerializeObject(messurements)); + httpRequestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + + using (var httpResponseMessage = await httpClient.SendAsync(httpRequestMessage)) + { + if (httpResponseMessage.StatusCode == HttpStatusCode.OK) + { + var added = await httpResponseMessage.Content.ReadAsStringAsync(); + + message = $"Succeeded! {added} records added."; + } + else if (httpResponseMessage.StatusCode == HttpStatusCode.NotModified) + { + message = $"Failed! No messurements to add."; + } + else if (httpResponseMessage.StatusCode == HttpStatusCode.Conflict) + { + message = $"Failed! More than 1 pcb's sent."; + } + else + { + message = $"HTTP! {(int)httpResponseMessage.StatusCode} - {httpResponseMessage.ReasonPhrase}."; + } + } + } + } + } + catch (Exception e) + { + message = $"Failed! {e.Message}"; + } + + MessageBox.Show(message); + } + + internal IEnumerable AvailablePcbs() + { + var existingPcbs = this.GetAllPcbs(); + var localPcbs = Directory + .CreateDirectory(WORKING_DIR) + .GetFiles("*_aggregations.txt") + .Select(x => x.Name + .Split(new[] { '_' }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault()); + + return existingPcbs + .Union(localPcbs) + .OrderBy(x => x) + .ToHashSet(); + } + + private IEnumerable GetAllPcbs() + { + var pcbs = Array.Empty(); + + try + { + using (var httpClient = new HttpClient()) + { + using (var httpRequestMessage = new HttpRequestMessage()) + { + httpRequestMessage.Method = HttpMethod.Get; + httpRequestMessage.Headers.Authorization = Software.AuthorizationHeader; + httpRequestMessage.RequestUri = new Uri($"http://localhost:52822/LaaProductionWeb/API/Production/TempMeter/Pcbs"); + + using (var httpResponseMessage = httpClient.SendAsync(httpRequestMessage) + .ConfigureAwait(true) + .GetAwaiter() + .GetResult()) + { + if (httpResponseMessage.StatusCode == HttpStatusCode.OK) + { + var content = httpResponseMessage + .Content + .ReadAsStringAsync() + .ConfigureAwait(true) + .GetAwaiter() + .GetResult(); + + pcbs = JsonConvert + .DeserializeObject($"{content}") + ?.Select(x => x.ToString()) + ?.ToArray() + ?? pcbs; + } + else + { + MessageBox.Show($"HTTP! {(int)httpResponseMessage.StatusCode} - {httpResponseMessage.ReasonPhrase}."); + } + } + } + } + } + catch (Exception e) + { + MessageBox.Show($"Failed! {e.Message}"); + } + + return pcbs; + } + } + + class Messurement + { + public int PcbId { get; set; } + + public int Id { get; set; } + + public double AvgT { get; set; } + + public double AvgTOF { get; set; } + + public bool Selected { get; set; } } class Messurements diff --git a/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs b/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs index 1605c1d0..28d06ab2 100644 --- a/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs +++ b/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs @@ -1,20 +1,20 @@ namespace LaaProductionWeb.API.Production { + using LaaProductionDI; using LaaProductionSQL.Interfaces; + using LaaProductionWeb.App_Infrastructure; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web.Http; - [Authorize] - [RoutePrefix("API/Production/TempMeter")] + [AuthorizeBearer] + [RoutePrefix("api/production/tempmeter")] public class TempMeterController : ApiController { - private readonly ISQLConnection sqlConnection; - - public TempMeterController(ISQLConnection sqlConnection) - => this.sqlConnection = sqlConnection; + private readonly ISQLConnection sqlConnection + = LaaServiceProvider.GetService(); [HttpGet] [Route(nameof(All))] @@ -40,8 +40,21 @@ } [HttpGet] - [Route("{pcbId}")] - public IHttpActionResult Get(int pcbId) + [Route(nameof(Pcbs))] + public IHttpActionResult Pcbs() + { + var pcbs = this.sqlConnection + .CreateCommand(@"SELECT DISTINCT + [PcbId] + FROM [CordonelTempLuts] + ORDER BY [PcbId]") + .ExecuteReader(x => x.GetInt()); + + return this.Json(pcbs); + } + + [HttpGet] + public IHttpActionResult Get(string id) { var messurement = this.sqlConnection .CreateCommand($@"SELECT [Id] @@ -50,10 +63,10 @@ , [AvgTof] FROM [CordonelTempLuts] WHERE [Active] = 1 - AND [PcbId] = @{nameof(pcbId)} + AND [PcbId] = @{nameof(id)} ORDER BY [PcbId], [RefTempC]") - .SetParameter(nameof(pcbId), pcbId) - .FirstOrDefault(x => new Messurement + .SetParameter(nameof(id), id) + .ExecuteReader(x => new Messurement { Id = x.GetInt(), PcbId = x.GetInt(), @@ -64,8 +77,9 @@ return this.Json(messurement); } - [HttpGet] - public IHttpActionResult Post([FromBody] Messurement[] messurements) + [HttpPost] + [Route(nameof(Update))] + public IHttpActionResult Update([FromBody] Messurement[] messurements) { if (messurements?.Length <= 0) { @@ -88,20 +102,19 @@ .ExecuteNonQuery(); var values = new List(); - var id = 1; foreach (var m in messurements.OrderBy(x => x.AvgT)) { - values.Add($"('{pcbId}', '{id++}', '{m.AvgT:0.00}', '{m.AvgTOF:0.0000000000}')"); + values.Add($"('{pcbId}', '{m.AvgT:0.00}', '{m.AvgTOF:0.0000000000}')"); } - + var recordsAdded = this.sqlConnection - .CreateCommand($@"INSERT INTO [CordonelTempLuts] - ( [PcbId] - , [Id] - , [RefTempC] - , [AvgTof]) - VALUES {string.Join(", ", values)}") + .CreateCommand($@" + INSERT INTO [CordonelTempLuts] + ( [PcbId] + , [RefTempC] + , [AvgTof]) + VALUES {string.Join(", ", values)}") .ExecuteNonQuery(); return this.Ok(recordsAdded); diff --git a/LaaProductionWeb/LaaProductionWeb/App_Start/WebApiConfig.cs b/LaaProductionWeb/LaaProductionWeb/App_Start/WebApiConfig.cs index cd55c1aa..d2edb706 100644 --- a/LaaProductionWeb/LaaProductionWeb/App_Start/WebApiConfig.cs +++ b/LaaProductionWeb/LaaProductionWeb/App_Start/WebApiConfig.cs @@ -8,6 +8,16 @@ { config.MapHttpAttributeRoutes(); + config.Routes.MapHttpRoute( + name: "ProductionAPI", + routeTemplate: "api/Production/{controller}/{id}", + defaults: new { id = RouteParameter.Optional }); + + config.Routes.MapHttpRoute( + name: "ProductionActionAPI", + routeTemplate: "api/Production/{controller}/{action}/{id}", + defaults: new { action = "Get", id = RouteParameter.Optional }); + config.Routes.MapHttpRoute( name: "PersonalizationAPI", routeTemplate: "api/Personalization/{controller}/{id}", From 96de0adb84b0676ec3e877ceb2db1b1386cf58cf Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 5 Oct 2023 16:27:16 +0200 Subject: [PATCH 02/56] base address for the temperature calibration --- Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index 55ef2121..da69a1bd 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -82,6 +82,7 @@ partial class AutomaticTemperatureCalibration { + private const string BASE_ADDRESS = "http://sla12iis01.emea.sensus.net/LaaProductionWeb"; // "http://localhost:52822/LaaProductionWeb"; private const string WORKING_DIR = @".\temperature_calibrations"; private const string MESSUREMENTS_FILE = @"_messurements.txt"; private const string AGGREGATIONS_FILE = @"_aggregations.txt"; @@ -354,7 +355,7 @@ { httpRequestMessage.Method = HttpMethod.Get; httpRequestMessage.Headers.Authorization = Software.AuthorizationHeader; - httpRequestMessage.RequestUri = new Uri($"http://localhost:52822/LaaProductionWeb/API/Production/TempMeter/{pcb}"); + httpRequestMessage.RequestUri = new Uri($"{BASE_ADDRESS}/API/Production/TempMeter/{pcb}"); using (var httpResponseMessage = httpClient.SendAsync(httpRequestMessage).Result) { @@ -395,7 +396,7 @@ { httpRequestMessage.Method = HttpMethod.Post; httpRequestMessage.Headers.Authorization = Software.AuthorizationHeader; - httpRequestMessage.RequestUri = new Uri("http://localhost:52822/LaaProductionWeb/API/Production/TempMeter/Update"); + httpRequestMessage.RequestUri = new Uri($"{BASE_ADDRESS}/API/Production/TempMeter/Update"); httpRequestMessage.Content = new StringContent(JsonConvert.SerializeObject(messurements)); httpRequestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); @@ -459,7 +460,7 @@ { httpRequestMessage.Method = HttpMethod.Get; httpRequestMessage.Headers.Authorization = Software.AuthorizationHeader; - httpRequestMessage.RequestUri = new Uri($"http://localhost:52822/LaaProductionWeb/API/Production/TempMeter/Pcbs"); + httpRequestMessage.RequestUri = new Uri($"{BASE_ADDRESS}/API/Production/TempMeter/Pcbs"); using (var httpResponseMessage = httpClient.SendAsync(httpRequestMessage) .ConfigureAwait(true) From 29657ec5f1b88bdd7ba429bc8d25ac92740b001b Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Mon, 9 Oct 2023 08:51:08 +0200 Subject: [PATCH 03/56] backwards calibration --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 54 +++++++++++++++---- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 21 +++++++- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 3 -- .../Infrastructure/TempMeterModels.cs | 27 ++++++++++ 4 files changed, 91 insertions(+), 14 deletions(-) diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index c111901d..bd80ac15 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,7 +31,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -59,6 +59,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticContentBox = new System.Windows.Forms.RichTextBox(); this.autometicControlsSplitter = new System.Windows.Forms.Splitter(); this.automaticControlsPanel = new System.Windows.Forms.Panel(); + this.startBackwardBtn = new System.Windows.Forms.Button(); this.saveSettingsBtn = new System.Windows.Forms.Button(); this.messurementDauerMS = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); @@ -81,6 +82,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); + this.stopBackwardsBtn = new System.Windows.Forms.Button(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -375,6 +377,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // automaticControlsPanel // this.automaticControlsPanel.BackColor = System.Drawing.SystemColors.Menu; + this.automaticControlsPanel.Controls.Add(this.stopBackwardsBtn); + this.automaticControlsPanel.Controls.Add(this.startBackwardBtn); this.automaticControlsPanel.Controls.Add(this.saveSettingsBtn); this.automaticControlsPanel.Controls.Add(this.messurementDauerMS); this.automaticControlsPanel.Controls.Add(this.label3); @@ -391,6 +395,21 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticControlsPanel.Size = new System.Drawing.Size(328, 647); this.automaticControlsPanel.TabIndex = 0; // + // startBackwardBtn + // + this.startBackwardBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.startBackwardBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.startBackwardBtn.Location = new System.Drawing.Point(5, 287); + this.startBackwardBtn.Margin = new System.Windows.Forms.Padding(5); + this.startBackwardBtn.Name = "startBackwardBtn"; + this.startBackwardBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); + this.startBackwardBtn.Size = new System.Drawing.Size(318, 36); + this.startBackwardBtn.TabIndex = 17; + this.startBackwardBtn.Text = "Start backwards"; + this.startBackwardBtn.UseVisualStyleBackColor = true; + this.startBackwardBtn.Click += new System.EventHandler(this.StartBackwardBtn_Click); + // // saveSettingsBtn // this.saveSettingsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -529,14 +548,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, @@ -636,6 +655,21 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // + // stopBackwardsBtn + // + this.stopBackwardsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.stopBackwardsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 333); + this.stopBackwardsBtn.Margin = new System.Windows.Forms.Padding(5); + this.stopBackwardsBtn.Name = "stopBackwardsBtn"; + this.stopBackwardsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); + this.stopBackwardsBtn.Size = new System.Drawing.Size(318, 36); + this.stopBackwardsBtn.TabIndex = 18; + this.stopBackwardsBtn.Text = "Stop backwards"; + this.stopBackwardsBtn.UseVisualStyleBackColor = true; + this.stopBackwardsBtn.Click += new System.EventHandler(this.stopBackwardsBtn_Click); + // // FrmTempMeter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -717,5 +751,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.DataGridViewTextBoxColumn Avg_TOF; private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; private System.Windows.Forms.ToolStripMenuItem loadPcbToolStripMenuItem; + private System.Windows.Forms.Button startBackwardBtn; + private System.Windows.Forms.Button stopBackwardsBtn; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index 13f7f9de..a3f2103d 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -832,10 +832,17 @@ return double.MinValue; } - return this.currentGenesis + var tofs = this.currentGenesis .CurrentRecords .Where(s => s.Channel == 2) - .Average(x => x.TotalTimeOfFlightS); + .Select(x => x.TotalTimeOfFlightS); + + if (tofs.Any()) + { + return tofs.Average(); + } + + return 0; } protected override void OnFormClosed(FormClosedEventArgs e) @@ -977,5 +984,15 @@ this.automaticCalibration?.UpdateAggregations(this.aggregations.Where(x => x.Selected)); } + + private void StartBackwardBtn_Click(Object sender, EventArgs e) + { + this.automaticCalibration = new AutomaticTemperatureCalibration(this.currentGenesis?.PcbId, this); + + this.automaticCalibration.StartBackward(); + } + + private void stopBackwardsBtn_Click(Object sender, EventArgs e) + => this.automaticCalibration.StopMessuring(); } } diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index 57c30f37..e31e8c38 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,9 +123,6 @@ 104, 17 - - 413, 17 - True diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index da69a1bd..30cd83f8 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -497,6 +497,33 @@ return pcbs; } + + internal void StartBackward() + { + this.temperatureSource = new TemperatureSource(); + this.shortTimer = new Timer(5000) + { + Enabled = true, + AutoReset = true + }; + this.shortTimer.Elapsed += this.BackwardsElapsed; + this.shortTimer.Start(); + } + + private void BackwardsElapsed(object sender, ElapsedEventArgs args) + { + this.tempMeterForm.BeginInvoke(new Action(() => + { + var currentTOF = this.tempMeterForm.AvgTOF(); + var currentT = this.temperatureSource.GetTemperature(); + var messurement = $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; + + this.tempMeterForm.AddMessage(messurement); + File.AppendAllLines(this.messurementsFile, new[] { messurement }); + + this.tempMeterForm.StartRecording(); + })); + } } class Messurement From 6370357f6f1d9175f6a1a92406ec7e88f80cc171 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Mon, 9 Oct 2023 15:13:10 +0200 Subject: [PATCH 04/56] backwards messurements | update aggregated results in API --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 330 ++++++++++++++---- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 106 +++++- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 36 ++ .../Infrastructure/Appsettings.cs | 6 + .../Infrastructure/TempMeterModels.cs | 212 +++++++++-- .../LaaProductionWeb/2023_10_09.debug | 0 .../API/Production/TempMeterController.cs | 23 +- .../App_Infrastructure/DebugTraceListener.cs | 27 ++ .../LaaProductionWeb/Global.asax.cs | 16 +- .../LaaProductionWeb/LaaProductionWeb.csproj | 1 + 10 files changed, 637 insertions(+), 120 deletions(-) create mode 100644 LaaProductionWeb/LaaProductionWeb/2023_10_09.debug create mode 100644 LaaProductionWeb/LaaProductionWeb/App_Infrastructure/DebugTraceListener.cs diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index bd80ac15..90820549 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,7 +31,9 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -55,10 +57,13 @@ namespace Xylem.Common.Ui.GenesisToolBox this.btnStopRecord = new System.Windows.Forms.Button(); this.btnStartRecord = new System.Windows.Forms.Button(); this.txtCurrentTofs = new System.Windows.Forms.TextBox(); - this.AutomaticCalibrationTab = new System.Windows.Forms.TabPage(); + this.calibrationTab = new System.Windows.Forms.TabPage(); this.automaticContentBox = new System.Windows.Forms.RichTextBox(); this.autometicControlsSplitter = new System.Windows.Forms.Splitter(); this.automaticControlsPanel = new System.Windows.Forms.Panel(); + this.backwardsStepMS = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.stopBackwardsBtn = new System.Windows.Forms.Button(); this.startBackwardBtn = new System.Windows.Forms.Button(); this.saveSettingsBtn = new System.Windows.Forms.Button(); this.messurementDauerMS = new System.Windows.Forms.TextBox(); @@ -69,7 +74,20 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label2 = new System.Windows.Forms.Label(); this.GMHPort = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); - this.resultsTab = new System.Windows.Forms.TabPage(); + this.temperatureChecksTab = new System.Windows.Forms.TabPage(); + this.temperatureChecksGridView = new System.Windows.Forms.DataGridView(); + this.TemperatureCheck_Pcb = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_PrevC = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_NextC = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_CurrentC = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_CalcC = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_DiffC = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_PrevTOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_CurrentTOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TemperatureCheck_NextTOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.backwardsPcbs = new System.Windows.Forms.ToolStripMenuItem(); + this.lutTab = new System.Windows.Forms.TabPage(); this.aggregationsGridView = new System.Windows.Forms.DataGridView(); this.PcbId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Avg_Nr = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -82,15 +100,17 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); - this.stopBackwardsBtn = new System.Windows.Forms.Button(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.tabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudRef)).BeginInit(); - this.AutomaticCalibrationTab.SuspendLayout(); + this.calibrationTab.SuspendLayout(); this.automaticControlsPanel.SuspendLayout(); - this.resultsTab.SuspendLayout(); + this.temperatureChecksTab.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.temperatureChecksGridView)).BeginInit(); + this.menuStrip1.SuspendLayout(); + this.lutTab.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.aggregationsGridView)).BeginInit(); this.resultsMenu.SuspendLayout(); this.SuspendLayout(); @@ -109,8 +129,9 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticCalibrationTabControl.Controls.Add(this.tabPage1); this.automaticCalibrationTabControl.Controls.Add(this.tabPage2); this.automaticCalibrationTabControl.Controls.Add(this.tabPage3); - this.automaticCalibrationTabControl.Controls.Add(this.AutomaticCalibrationTab); - this.automaticCalibrationTabControl.Controls.Add(this.resultsTab); + this.automaticCalibrationTabControl.Controls.Add(this.calibrationTab); + this.automaticCalibrationTabControl.Controls.Add(this.temperatureChecksTab); + this.automaticCalibrationTabControl.Controls.Add(this.lutTab); this.automaticCalibrationTabControl.Dock = System.Windows.Forms.DockStyle.Fill; this.automaticCalibrationTabControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.automaticCalibrationTabControl.Location = new System.Drawing.Point(0, 24); @@ -340,18 +361,18 @@ namespace Xylem.Common.Ui.GenesisToolBox this.txtCurrentTofs.Size = new System.Drawing.Size(380, 230); this.txtCurrentTofs.TabIndex = 49; // - // AutomaticCalibrationTab + // calibrationTab // - this.AutomaticCalibrationTab.BackColor = System.Drawing.SystemColors.Window; - this.AutomaticCalibrationTab.Controls.Add(this.automaticContentBox); - this.AutomaticCalibrationTab.Controls.Add(this.autometicControlsSplitter); - this.AutomaticCalibrationTab.Controls.Add(this.automaticControlsPanel); - this.AutomaticCalibrationTab.Location = new System.Drawing.Point(4, 25); - this.AutomaticCalibrationTab.Margin = new System.Windows.Forms.Padding(0); - this.AutomaticCalibrationTab.Name = "AutomaticCalibrationTab"; - this.AutomaticCalibrationTab.Size = new System.Drawing.Size(1217, 647); - this.AutomaticCalibrationTab.TabIndex = 3; - this.AutomaticCalibrationTab.Text = "Automatic Calibration"; + this.calibrationTab.BackColor = System.Drawing.SystemColors.Window; + this.calibrationTab.Controls.Add(this.automaticContentBox); + this.calibrationTab.Controls.Add(this.autometicControlsSplitter); + this.calibrationTab.Controls.Add(this.automaticControlsPanel); + this.calibrationTab.Location = new System.Drawing.Point(4, 25); + this.calibrationTab.Margin = new System.Windows.Forms.Padding(0); + this.calibrationTab.Name = "calibrationTab"; + this.calibrationTab.Size = new System.Drawing.Size(1217, 647); + this.calibrationTab.TabIndex = 3; + this.calibrationTab.Text = "Automatic Calibration"; // // automaticContentBox // @@ -377,6 +398,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // automaticControlsPanel // this.automaticControlsPanel.BackColor = System.Drawing.SystemColors.Menu; + this.automaticControlsPanel.Controls.Add(this.backwardsStepMS); + this.automaticControlsPanel.Controls.Add(this.label8); this.automaticControlsPanel.Controls.Add(this.stopBackwardsBtn); this.automaticControlsPanel.Controls.Add(this.startBackwardBtn); this.automaticControlsPanel.Controls.Add(this.saveSettingsBtn); @@ -395,12 +418,52 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticControlsPanel.Size = new System.Drawing.Size(328, 647); this.automaticControlsPanel.TabIndex = 0; // + // backwardsStepMS + // + this.backwardsStepMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.backwardsStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.backwardsStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.backwardsStepMS.Location = new System.Drawing.Point(5, 166); + this.backwardsStepMS.Margin = new System.Windows.Forms.Padding(0); + this.backwardsStepMS.Name = "backwardsStepMS"; + this.backwardsStepMS.Size = new System.Drawing.Size(318, 24); + this.backwardsStepMS.TabIndex = 20; + // + // label8 + // + this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label8.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label8.Location = new System.Drawing.Point(5, 149); + this.label8.Margin = new System.Windows.Forms.Padding(5); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(318, 18); + this.label8.TabIndex = 19; + this.label8.Text = "Backwards step (ms)"; + this.label8.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // + // stopBackwardsBtn + // + this.stopBackwardsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.stopBackwardsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 379); + this.stopBackwardsBtn.Margin = new System.Windows.Forms.Padding(5); + this.stopBackwardsBtn.Name = "stopBackwardsBtn"; + this.stopBackwardsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); + this.stopBackwardsBtn.Size = new System.Drawing.Size(318, 36); + this.stopBackwardsBtn.TabIndex = 18; + this.stopBackwardsBtn.Text = "Stop backwards"; + this.stopBackwardsBtn.UseVisualStyleBackColor = true; + this.stopBackwardsBtn.Click += new System.EventHandler(this.StopBackwardsBtn_Click); + // // startBackwardBtn // this.startBackwardBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startBackwardBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startBackwardBtn.Location = new System.Drawing.Point(5, 287); + this.startBackwardBtn.Location = new System.Drawing.Point(5, 333); this.startBackwardBtn.Margin = new System.Windows.Forms.Padding(5); this.startBackwardBtn.Name = "startBackwardBtn"; this.startBackwardBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -415,7 +478,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSettingsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.saveSettingsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.saveSettingsBtn.Location = new System.Drawing.Point(5, 149); + this.saveSettingsBtn.Location = new System.Drawing.Point(5, 195); this.saveSettingsBtn.Margin = new System.Windows.Forms.Padding(5); this.saveSettingsBtn.Name = "saveSettingsBtn"; this.saveSettingsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -431,7 +494,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.messurementDauerMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.messurementDauerMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementDauerMS.Location = new System.Drawing.Point(5, 114); + this.messurementDauerMS.Location = new System.Drawing.Point(5, 120); this.messurementDauerMS.Margin = new System.Windows.Forms.Padding(0); this.messurementDauerMS.Name = "messurementDauerMS"; this.messurementDauerMS.Size = new System.Drawing.Size(318, 24); @@ -442,7 +505,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label3.Location = new System.Drawing.Point(5, 97); + this.label3.Location = new System.Drawing.Point(5, 103); this.label3.Margin = new System.Windows.Forms.Padding(5); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(318, 18); @@ -455,7 +518,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.stopAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 241); + this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 287); this.stopAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.stopAutomaticBtn.Name = "stopAutomaticBtn"; this.stopAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -470,7 +533,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startAutomaticBtn.Location = new System.Drawing.Point(5, 195); + this.startAutomaticBtn.Location = new System.Drawing.Point(5, 241); this.startAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.startAutomaticBtn.Name = "startAutomaticBtn"; this.startAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -486,7 +549,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.messurementStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.messurementStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementStepMS.Location = new System.Drawing.Point(5, 68); + this.messurementStepMS.Location = new System.Drawing.Point(5, 74); this.messurementStepMS.Margin = new System.Windows.Forms.Padding(0); this.messurementStepMS.Name = "messurementStepMS"; this.messurementStepMS.Size = new System.Drawing.Size(318, 24); @@ -497,7 +560,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(5, 51); + this.label2.Location = new System.Drawing.Point(5, 57); this.label2.Margin = new System.Windows.Forms.Padding(5); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(318, 18); @@ -511,7 +574,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.GMHPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.GMHPort.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.GMHPort.Location = new System.Drawing.Point(5, 22); + this.GMHPort.Location = new System.Drawing.Point(5, 27); this.GMHPort.Margin = new System.Windows.Forms.Padding(0); this.GMHPort.MinimumSize = new System.Drawing.Size(2, 25); this.GMHPort.Name = "GMHPort"; @@ -523,7 +586,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label1.Location = new System.Drawing.Point(5, 5); + this.label1.Location = new System.Drawing.Point(5, 10); this.label1.Margin = new System.Windows.Forms.Padding(5); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(318, 18); @@ -531,31 +594,159 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label1.Text = "Messgerät (COM port)"; this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // - // resultsTab + // temperatureChecksTab // - this.resultsTab.Controls.Add(this.aggregationsGridView); - this.resultsTab.Controls.Add(this.resultsMenu); - this.resultsTab.Location = new System.Drawing.Point(4, 25); - this.resultsTab.Margin = new System.Windows.Forms.Padding(0); - this.resultsTab.Name = "resultsTab"; - this.resultsTab.Size = new System.Drawing.Size(1217, 647); - this.resultsTab.TabIndex = 4; - this.resultsTab.Text = "Results"; - this.resultsTab.UseVisualStyleBackColor = true; + this.temperatureChecksTab.Controls.Add(this.temperatureChecksGridView); + this.temperatureChecksTab.Controls.Add(this.menuStrip1); + this.temperatureChecksTab.Location = new System.Drawing.Point(4, 25); + this.temperatureChecksTab.Margin = new System.Windows.Forms.Padding(0); + this.temperatureChecksTab.Name = "temperatureChecksTab"; + this.temperatureChecksTab.Size = new System.Drawing.Size(1217, 647); + this.temperatureChecksTab.TabIndex = 5; + this.temperatureChecksTab.Text = "Temperature check"; + this.temperatureChecksTab.UseVisualStyleBackColor = true; + // + // temperatureChecksGridView + // + this.temperatureChecksGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; + this.temperatureChecksGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + this.temperatureChecksGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.TemperatureCheck_Pcb, + this.TemperatureCheck_PrevC, + this.TemperatureCheck_NextC, + this.TemperatureCheck_CurrentC, + this.TemperatureCheck_CalcC, + this.TemperatureCheck_DiffC, + this.TemperatureCheck_PrevTOF, + this.TemperatureCheck_CurrentTOF, + this.TemperatureCheck_NextTOF}); + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle5; + this.temperatureChecksGridView.Dock = System.Windows.Forms.DockStyle.Fill; + this.temperatureChecksGridView.Location = new System.Drawing.Point(0, 24); + this.temperatureChecksGridView.Name = "temperatureChecksGridView"; + this.temperatureChecksGridView.Size = new System.Drawing.Size(1217, 623); + this.temperatureChecksGridView.TabIndex = 1; + // + // TemperatureCheck_Pcb + // + this.TemperatureCheck_Pcb.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_Pcb.HeaderText = "Pcb Id"; + this.TemperatureCheck_Pcb.Name = "TemperatureCheck_Pcb"; + this.TemperatureCheck_Pcb.ReadOnly = true; + // + // TemperatureCheck_PrevC + // + this.TemperatureCheck_PrevC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_PrevC.HeaderText = "Prev °C"; + this.TemperatureCheck_PrevC.Name = "TemperatureCheck_PrevC"; + this.TemperatureCheck_PrevC.ReadOnly = true; + // + // TemperatureCheck_NextC + // + this.TemperatureCheck_NextC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_NextC.HeaderText = "Next °C"; + this.TemperatureCheck_NextC.Name = "TemperatureCheck_NextC"; + this.TemperatureCheck_NextC.ReadOnly = true; + // + // TemperatureCheck_CurrentC + // + this.TemperatureCheck_CurrentC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_CurrentC.HeaderText = "Actual °C"; + this.TemperatureCheck_CurrentC.Name = "TemperatureCheck_CurrentC"; + this.TemperatureCheck_CurrentC.ReadOnly = true; + // + // TemperatureCheck_CalcC + // + this.TemperatureCheck_CalcC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_CalcC.HeaderText = "Calc °C"; + this.TemperatureCheck_CalcC.Name = "TemperatureCheck_CalcC"; + this.TemperatureCheck_CalcC.ReadOnly = true; + // + // TemperatureCheck_DiffC + // + this.TemperatureCheck_DiffC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_DiffC.HeaderText = "°C diff."; + this.TemperatureCheck_DiffC.Name = "TemperatureCheck_DiffC"; + this.TemperatureCheck_DiffC.ReadOnly = true; + // + // TemperatureCheck_PrevTOF + // + this.TemperatureCheck_PrevTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_PrevTOF.HeaderText = "Prev TOF"; + this.TemperatureCheck_PrevTOF.Name = "TemperatureCheck_PrevTOF"; + this.TemperatureCheck_PrevTOF.ReadOnly = true; + // + // TemperatureCheck_CurrentTOF + // + this.TemperatureCheck_CurrentTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_CurrentTOF.HeaderText = "Current TOF"; + this.TemperatureCheck_CurrentTOF.Name = "TemperatureCheck_CurrentTOF"; + this.TemperatureCheck_CurrentTOF.ReadOnly = true; + // + // TemperatureCheck_NextTOF + // + this.TemperatureCheck_NextTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.TemperatureCheck_NextTOF.HeaderText = "Next TOF"; + this.TemperatureCheck_NextTOF.Name = "TemperatureCheck_NextTOF"; + this.TemperatureCheck_NextTOF.ReadOnly = true; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.backwardsPcbs}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(1217, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // backwardsPcbs + // + this.backwardsPcbs.Name = "backwardsPcbs"; + this.backwardsPcbs.Size = new System.Drawing.Size(73, 20); + this.backwardsPcbs.Text = "Select pcb"; + this.backwardsPcbs.Click += new System.EventHandler(this.BackwardsPcb_Click); + // + // lutTab + // + this.lutTab.Controls.Add(this.aggregationsGridView); + this.lutTab.Controls.Add(this.resultsMenu); + this.lutTab.Location = new System.Drawing.Point(4, 25); + this.lutTab.Margin = new System.Windows.Forms.Padding(0); + this.lutTab.Name = "lutTab"; + this.lutTab.Size = new System.Drawing.Size(1217, 647); + this.lutTab.TabIndex = 4; + this.lutTab.Text = "Temperature LUT"; + this.lutTab.UseVisualStyleBackColor = true; // // aggregationsGridView // this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, @@ -655,21 +846,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // - // stopBackwardsBtn - // - this.stopBackwardsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.stopBackwardsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 333); - this.stopBackwardsBtn.Margin = new System.Windows.Forms.Padding(5); - this.stopBackwardsBtn.Name = "stopBackwardsBtn"; - this.stopBackwardsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.stopBackwardsBtn.Size = new System.Drawing.Size(318, 36); - this.stopBackwardsBtn.TabIndex = 18; - this.stopBackwardsBtn.Text = "Stop backwards"; - this.stopBackwardsBtn.UseVisualStyleBackColor = true; - this.stopBackwardsBtn.Click += new System.EventHandler(this.stopBackwardsBtn_Click); - // // FrmTempMeter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -688,11 +864,16 @@ namespace Xylem.Common.Ui.GenesisToolBox this.tabPage3.ResumeLayout(false); this.tabPage3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudRef)).EndInit(); - this.AutomaticCalibrationTab.ResumeLayout(false); + this.calibrationTab.ResumeLayout(false); this.automaticControlsPanel.ResumeLayout(false); this.automaticControlsPanel.PerformLayout(); - this.resultsTab.ResumeLayout(false); - this.resultsTab.PerformLayout(); + this.temperatureChecksTab.ResumeLayout(false); + this.temperatureChecksTab.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.temperatureChecksGridView)).EndInit(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.lutTab.ResumeLayout(false); + this.lutTab.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.aggregationsGridView)).EndInit(); this.resultsMenu.ResumeLayout(false); this.resultsMenu.PerformLayout(); @@ -725,7 +906,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.Button btnStopRecord; private System.Windows.Forms.Button btnStartRecord; private System.Windows.Forms.TextBox txtCurrentTofs; - private System.Windows.Forms.TabPage AutomaticCalibrationTab; + private System.Windows.Forms.TabPage calibrationTab; private System.Windows.Forms.Timer timer3; private System.Windows.Forms.MenuStrip mainMenuStrip; private System.Windows.Forms.RichTextBox automaticContentBox; @@ -740,7 +921,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.TextBox messurementDauerMS; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button saveSettingsBtn; - private System.Windows.Forms.TabPage resultsTab; + private System.Windows.Forms.TabPage lutTab; private System.Windows.Forms.DataGridView aggregationsGridView; private System.Windows.Forms.MenuStrip resultsMenu; private System.Windows.Forms.ToolStripMenuItem updateViewToolStripMenuItem; @@ -753,5 +934,20 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.ToolStripMenuItem loadPcbToolStripMenuItem; private System.Windows.Forms.Button startBackwardBtn; private System.Windows.Forms.Button stopBackwardsBtn; + private System.Windows.Forms.TabPage temperatureChecksTab; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem backwardsPcbs; + private System.Windows.Forms.DataGridView temperatureChecksGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_Pcb; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_PrevC; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_NextC; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_CurrentC; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_CalcC; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_DiffC; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_PrevTOF; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_CurrentTOF; + private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_NextTOF; + private System.Windows.Forms.TextBox backwardsStepMS; + private System.Windows.Forms.Label label8; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index a3f2103d..60a9d0e3 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -559,7 +559,7 @@ { this.automaticCalibration = new AutomaticTemperatureCalibration(null, this); - foreach (var pcbText in this.automaticCalibration.AvailablePcbs()) + foreach (var pcbText in this.automaticCalibration.AvailableAggregationPcbs()) { var dropdownPcbId = new ToolStripMenuItem(pcbText); dropdownPcbId.Click += DropdownPcbId_Click; @@ -567,6 +567,14 @@ this.loadPcbToolStripMenuItem.DropDownItems.Add(dropdownPcbId); } + foreach (var pcbText in this.automaticCalibration.AvailableCheckPcbs()) + { + var dropdownPcbId = new ToolStripMenuItem(pcbText); + dropdownPcbId.Click += this.BackwardsPcb_Click; + + this.backwardsPcbs.DropDownItems.Add(dropdownPcbId); + } + this.aggregationsGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.WhiteSmoke; this.mainMenuStrip.Padding = new Padding(5); @@ -660,6 +668,7 @@ this.GMHPort.Text = Appsettings.GMHPort.ToString(); this.messurementStepMS.Text = Appsettings.MessurementStep.ToString(); this.messurementDauerMS.Text = Appsettings.MessurementDauer.ToString(); + this.backwardsStepMS.Text = Appsettings.BackwardsStepMS.ToString(); }; this.SetEnabled(ProgrammState.Start); @@ -734,6 +743,9 @@ this.startAutomaticBtn.Enabled = true; this.stopAutomaticBtn.Enabled = false; + + this.startBackwardBtn.Enabled = true; + this.stopBackwardsBtn.Enabled = false; } private void StartAutomaticBtn_Clicked(object sender, EventArgs args) @@ -759,6 +771,7 @@ this.automaticCalibration.StartMessuring(); this.SetEnabled(ProgrammState.RecordRuning); + this.startBackwardBtn.Enabled = false; this.startAutomaticBtn.Enabled = false; this.stopAutomaticBtn.Enabled = true; } @@ -773,6 +786,7 @@ this.SetEnabled(ProgrammState.RecordStoped); + this.startBackwardBtn.Enabled = true; this.startAutomaticBtn.Enabled = true; this.stopAutomaticBtn.Enabled = false; } @@ -842,7 +856,7 @@ return tofs.Average(); } - return 0; + return 1; } protected override void OnFormClosed(FormClosedEventArgs e) @@ -865,6 +879,11 @@ Appsettings.MessurementDauer = msDauer; } + if (int.TryParse($"{this.backwardsStepMS.Text}", out int bwStep)) + { + Appsettings.BackwardsStepMS = bwStep; + } + Appsettings.SaveSettings(); } @@ -987,12 +1006,91 @@ private void StartBackwardBtn_Click(Object sender, EventArgs e) { + if (this.currentGenesis is null) + { + MessageBox.Show(this, "Water meter not connected!", "Start aborted", MessageBoxButtons.OK); + + return; + } + this.automaticCalibration = new AutomaticTemperatureCalibration(this.currentGenesis?.PcbId, this); this.automaticCalibration.StartBackward(); + this.SetEnabled(ProgrammState.RecordRuning); + + this.startAutomaticBtn.Enabled = false; + this.startBackwardBtn.Enabled = false; + this.stopBackwardsBtn.Enabled = true; } - private void stopBackwardsBtn_Click(Object sender, EventArgs e) - => this.automaticCalibration.StopMessuring(); + private void StopBackwardsBtn_Click(Object sender, EventArgs e) + { + this.automaticCalibration.StopMessuring(); + this.SetEnabled(ProgrammState.RecordStoped); + + this.startAutomaticBtn.Enabled = true; + this.startBackwardBtn.Enabled = true; + this.stopBackwardsBtn.Enabled = false; + } + + private void BackwardsPcb_Click(Object sender, EventArgs e) + { + if (this.automaticCalibration is null) + { + this.automaticCalibration = new AutomaticTemperatureCalibration(null, this); + } + + var pcb = string.Empty; + + if (sender is ToolStripMenuItem menuItem) + { + pcb = menuItem.Text; + } + + if (int.TryParse($"{pcb}", out int pcbId)) + { + this.LoadTemperatureChecks(pcb); + } + } + + private void LoadTemperatureChecks(string pcb) + => this.BeginInvoke(new Action(() => + { + this.aggregationsGridView.Rows.Clear(); + + var temperatureChecks = this.automaticCalibration + .TemperatureChecksFor(pcb) + .ToArray(); + + var rowsCount = temperatureChecks.Length; + + if (rowsCount <= 0) + { + return; + } + + this.temperatureChecksGridView.Rows.Add(rowsCount); + + for (int i = 0; i < rowsCount; i++) + { + var temperatureCheck = temperatureChecks[i]; + var currentRow = this.temperatureChecksGridView.Rows[i]; + + // Pcb Id + currentRow.Cells[0].Value = temperatureCheck.PcbId; + // Temperatures + currentRow.Cells[1].Value = $"{temperatureCheck.PrevT:00.00}"; + currentRow.Cells[2].Value = $"{temperatureCheck.NextT:00.00}"; + currentRow.Cells[3].Value = $"{temperatureCheck.CurrentT:00.00}"; + currentRow.Cells[4].Value = $"{temperatureCheck.CalculatedT:00.00}"; + currentRow.Cells[5].Value = $"{temperatureCheck.DiffT:00.00}"; + // Times of flights + currentRow.Cells[6].Value = $"{temperatureCheck.PrevTOF:0.0000000000}"; + currentRow.Cells[7].Value = $"{temperatureCheck.CurrentTOF:0.0000000000}"; + currentRow.Cells[8].Value = $"{temperatureCheck.NextTOF:0.0000000000}"; + } + + this.aggregationsGridView.CellContentClick += AggregationsGridView_CurrentCellChanged; + })); } } diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index e31e8c38..e87cd74c 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,6 +123,42 @@ 104, 17 + + 531, 17 + + + 413, 17 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 531, 17 + True diff --git a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs index beb66fe0..7fb6192c 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs @@ -33,6 +33,12 @@ set => SetValue(value); } + public static int BackwardsStepMS + { + get => GetInt32(); + set => SetValue(value); + } + private static short GetInt16([CallerMemberName] string property = EMPTY) { var value = settings[property]?.Value?.ToString() ?? string.Empty; diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index 30cd83f8..bec171b9 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -66,7 +66,7 @@ { var result = default(short); var priority = default(short); - var temperature = default(double); + var temperature = double.MinValue; var value = default(int); unsafe @@ -82,15 +82,18 @@ partial class AutomaticTemperatureCalibration { - private const string BASE_ADDRESS = "http://sla12iis01.emea.sensus.net/LaaProductionWeb"; // "http://localhost:52822/LaaProductionWeb"; - private const string WORKING_DIR = @".\temperature_calibrations"; + private const string BASE_ADDRESS = "http://sla12iis01.emea.sensus.net/LaaProductionWeb"; + // private const string BASE_ADDRESS = "http://localhost:52822/LaaProductionWeb"; + private const string WORKING_DIR = @"temperature_calibrations"; private const string MESSUREMENTS_FILE = @"_messurements.txt"; private const string AGGREGATIONS_FILE = @"_aggregations.txt"; + private const string BACKWARDS_FILE = @"_backwards.txt"; private const NumberStyles ANY = NumberStyles.Any; private readonly string pcbId; private readonly string messurementsFile; private readonly string aggregationsFile; + private readonly string backwardsFile; private readonly ITempMeterForm tempMeterForm; private readonly CultureInfo en; private readonly CultureInfo de; @@ -107,8 +110,9 @@ if (int.TryParse($"{this.pcbId}", out int pcb)) { - this.messurementsFile = this.GetOrCreateMessurementsFile(this.pcbId); - this.aggregationsFile = this.GetOrCreateAggregationsFile(this.pcbId); + this.messurementsFile = this.GetOrCreateFile(this.pcbId, MESSUREMENTS_FILE); + this.aggregationsFile = this.GetOrCreateFile(this.pcbId, AGGREGATIONS_FILE); + this.backwardsFile = this.GetOrCreateFile(this.pcbId, BACKWARDS_FILE); } this.temperatureSource = new TemperatureSource(); @@ -179,9 +183,9 @@ { this.tempMeterForm.BeginInvoke(new Action(() => { - var currentTOF = this.tempMeterForm.AvgTOF(); - var currentT = this.temperatureSource.GetTemperature(); - var messurement = $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; + var messurement = !this.TryGetTOFandT(out double currentTOF, out double currentT) + ? $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t invalid record (TOF: {currentTOF} & T: {currentT})" + : $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; if (this.messuring) { @@ -192,26 +196,15 @@ } } - private String GetOrCreateMessurementsFile(string pcbId) + private String GetOrCreateFile(string pcbId, string fileBase) { Directory.CreateDirectory(WORKING_DIR); - var filePath = $@"{WORKING_DIR}\{this.pcbId}{MESSUREMENTS_FILE}"; - - File.AppendAllText(filePath, Environment.NewLine); - - return filePath; - } - - private String GetOrCreateAggregationsFile(string pcbId) - { - Directory.CreateDirectory(WORKING_DIR); - - var filePath = $@"{WORKING_DIR}\{this.pcbId}{AGGREGATIONS_FILE}"; + var filePath = Path.Combine(".", WORKING_DIR, $"{pcbId}{fileBase}"); if (!File.Exists(filePath)) { - File.WriteAllLines(filePath, new[] { Messurements.Header }); + File.WriteAllText(filePath, string.Empty); } return filePath; @@ -273,7 +266,7 @@ var aggregations = new List(); var aggregationsFile = $"{WORKING_DIR}\\{pcb}{AGGREGATIONS_FILE}"; - var existingAggregations = this.GetAggregations(pcb); + var existingAggregations = this.RequestAggregations(pcb); var aggregationsLines = new List(); if (File.Exists(aggregationsFile)) @@ -343,7 +336,7 @@ .ToList(); } - internal IEnumerable GetAggregations(string pcb) + internal IEnumerable RequestAggregations(string pcb) { var aggregations = Array.Empty(); @@ -432,12 +425,12 @@ MessageBox.Show(message); } - internal IEnumerable AvailablePcbs() + internal IEnumerable AvailableAggregationPcbs() { var existingPcbs = this.GetAllPcbs(); var localPcbs = Directory .CreateDirectory(WORKING_DIR) - .GetFiles("*_aggregations.txt") + .GetFiles($"*{AGGREGATIONS_FILE}") .Select(x => x.Name .Split(new[] { '_' }, StringSplitOptions.RemoveEmptyEntries) .FirstOrDefault()); @@ -501,7 +494,7 @@ internal void StartBackward() { this.temperatureSource = new TemperatureSource(); - this.shortTimer = new Timer(5000) + this.shortTimer = new Timer(Appsettings.BackwardsStepMS) { Enabled = true, AutoReset = true @@ -514,16 +507,173 @@ { this.tempMeterForm.BeginInvoke(new Action(() => { - var currentTOF = this.tempMeterForm.AvgTOF(); - var currentT = this.temperatureSource.GetTemperature(); - var messurement = $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; + var messurement = !this.TryGetTOFandT(out double currentTOF, out double currentT) + ? $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t invalid record (TOF: {currentTOF} & T: {currentT})" + : $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; this.tempMeterForm.AddMessage(messurement); - File.AppendAllLines(this.messurementsFile, new[] { messurement }); + File.AppendAllLines(this.backwardsFile, new[] { messurement }); this.tempMeterForm.StartRecording(); })); } + + private bool TryGetTOFandT(out double actualTOF, out double actualT) + { + actualTOF = this.tempMeterForm.AvgTOF(); + actualT = this.temperatureSource.GetTemperature(); + + if (actualTOF >= 1 || actualT <= double.MinValue) + { + return false; + } + + return true; + } + + internal IEnumerable AvailableCheckPcbs() + => Directory + .CreateDirectory(WORKING_DIR) + .GetFiles($"*{BACKWARDS_FILE}") + .Select(x => x.Name + .Split(new[] { '_' }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault()) + .OrderBy(x => x) + .ToHashSet(); + + internal IEnumerable TemperatureChecksFor(String pcb) + { + var backwardsFile = Path.Combine(".", WORKING_DIR, $"{pcb}{BACKWARDS_FILE}"); + + if (!File.Exists(backwardsFile)) + { + return Array.Empty(); + } + + var backwardsMessurements = new List(); + + foreach (var line in File.ReadAllLines(backwardsFile)) + { + if (string.IsNullOrWhiteSpace(line)) + { + continue; + } + + var tokens = line.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); + + if (tokens.Length != 4) + { + continue; + } + + var pcbString = tokens[1] ?? string.Empty; + var avgTString = tokens[2] ?? string.Empty; + var avgTOFString = tokens[3] ?? string.Empty; + + var pcbId = default(int); + var avgT = default(double); + var avgTOF = default(double); + + var pcbParsed = int.TryParse(pcbString, out pcbId); + var tParsed = double.TryParse(avgTString, ANY, this.en, out avgT) || double.TryParse(avgTString, ANY, this.de, out avgT); + var tofParsed = double.TryParse(avgTOFString, ANY, this.en, out avgTOF) || double.TryParse(avgTOFString, ANY, this.de, out avgTOF); + + if (!pcbParsed || !tParsed || !tofParsed) + { + continue; + } + + backwardsMessurements.Add(new Messurement + { + PcbId = pcbId, + AvgT = avgT, + AvgTOF = avgTOF + }); + } + + var localAggregations = this.AggregationsFor(pcb) ?? Array.Empty(); + var temperatureLUT = localAggregations.OrderBy(x => x.AvgTOF).ToArray(); + var temperatureChecks = new List(); + + foreach (var check in backwardsMessurements) + { + var interpolatedResult = this.InterpolateTOF2T(check.AvgTOF, temperatureLUT); + + interpolatedResult.PcbId = check.PcbId; + interpolatedResult.CurrentT = check.AvgT; + + temperatureChecks.Add(interpolatedResult); + } + + return temperatureChecks; + } + + private InterpolationResult InterpolateTOF2T(double currentTOF, params Messurement[] temperatureLUT) + { + var interpolationResult = new InterpolationResult + { + CalculatedT = 1, + CurrentTOF = currentTOF + }; + + var length = temperatureLUT?.Length ?? 0; + var last = length - 1; + + if (last <= 0 || temperatureLUT[0].AvgTOF > currentTOF || temperatureLUT[last].AvgTOF < currentTOF) + { + return interpolationResult; + } + + var prevTOF = default(double); + var prevT = default(double); + var nextTOF = default(double); + var nextT = default(double); + + + for (int i = 1; i < length; i++) + { + if (temperatureLUT[i].AvgTOF >= currentTOF) + { + prevTOF = temperatureLUT[i - 1].AvgTOF; + prevT = temperatureLUT[i - 1].AvgT; + nextTOF = temperatureLUT[i].AvgTOF; + nextT = temperatureLUT[i].AvgT; + + break; + } + } + + var currentT = (nextT - prevT) / (nextTOF - prevTOF) * (currentTOF - prevTOF) + prevT; + + interpolationResult.CalculatedT = currentT; + interpolationResult.PrevTOF = prevTOF; + interpolationResult.PrevT = prevT; + interpolationResult.NextTOF = nextTOF; + interpolationResult.NextT = nextT; + + return interpolationResult; + } + } + + class InterpolationResult + { + public int PcbId { get; set; } + + public double PrevT { get; set; } + + public double PrevTOF { get; set; } + + public double CurrentT { get; set; } + + public double CalculatedT { get; set; } + + public double CurrentTOF { get; set; } + + public double NextT { get; set; } + + public double NextTOF { get; set; } + + public double DiffT => Math.Abs(this.CurrentT - this.CalculatedT); } class Messurement diff --git a/LaaProductionWeb/LaaProductionWeb/2023_10_09.debug b/LaaProductionWeb/LaaProductionWeb/2023_10_09.debug new file mode 100644 index 00000000..e69de29b diff --git a/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs b/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs index 28d06ab2..5f5208ea 100644 --- a/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs +++ b/LaaProductionWeb/LaaProductionWeb/API/Production/TempMeterController.cs @@ -3,7 +3,7 @@ using LaaProductionDI; using LaaProductionSQL.Interfaces; using LaaProductionWeb.App_Infrastructure; - + using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -107,14 +107,21 @@ { values.Add($"('{pcbId}', '{m.AvgT:0.00}', '{m.AvgTOF:0.0000000000}')"); } - + + var joinString = $"{Environment.NewLine} , "; + var valuesString = string.Join(joinString, values); + var commandText = $@" +INSERT + INTO [CordonelTempLuts] + ( [PcbId] + , [RefTempC] + , [AvgTof]) +VALUES {valuesString}"; + + Logger.WriteLine(commandText); + var recordsAdded = this.sqlConnection - .CreateCommand($@" - INSERT INTO [CordonelTempLuts] - ( [PcbId] - , [RefTempC] - , [AvgTof]) - VALUES {string.Join(", ", values)}") + .CreateCommand(commandText) .ExecuteNonQuery(); return this.Ok(recordsAdded); diff --git a/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/DebugTraceListener.cs b/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/DebugTraceListener.cs new file mode 100644 index 00000000..663e9b94 --- /dev/null +++ b/LaaProductionWeb/LaaProductionWeb/App_Infrastructure/DebugTraceListener.cs @@ -0,0 +1,27 @@ +namespace LaaProductionWeb.App_Infrastructure +{ + using System; + using System.Globalization; + using System.IO; + using System.Web; + + public class Logger + { + private static string file; + + public static void Configure() + { + var cultureInfoUS = new CultureInfo("en-US"); + + CultureInfo.DefaultThreadCurrentCulture = cultureInfoUS; + CultureInfo.DefaultThreadCurrentUICulture = cultureInfoUS; + + file = HttpContext.Current.Server.MapPath($".\\{DateTime.Now:yyyy_MM_dd}.debug"); + + File.WriteAllText(file, string.Empty); + } + + public static void WriteLine(string message) + => File.AppendAllText(file, $"{message}{Environment.NewLine}"); + } +} \ No newline at end of file diff --git a/LaaProductionWeb/LaaProductionWeb/Global.asax.cs b/LaaProductionWeb/LaaProductionWeb/Global.asax.cs index 287536f5..84b91860 100644 --- a/LaaProductionWeb/LaaProductionWeb/Global.asax.cs +++ b/LaaProductionWeb/LaaProductionWeb/Global.asax.cs @@ -8,9 +8,8 @@ using LaaProductionHttp; using LaaProductionSMTP; using LaaProductionSQL; - using LaaProductionWeb; using LaaProductionWeb.App_Infrastructure; - + using System.Web; using System.Web.Http; using System.Web.Mvc; @@ -21,6 +20,7 @@ { protected void Application_Start() { + Logger.Configure(); LaaServiceProvider.Configure(ConfigureServices); LaaServiceProvider.BuildServiceProvider(); AreaRegistration.RegisterAllAreas(); @@ -43,14 +43,10 @@ .AddAdministration() .AddSearching(); - private void SQLErrorHandler(string error) - { - // TODO: error logging. - } + private void SQLErrorHandler(string error) + => Logger.WriteLine($"[SQL ERROR]\t{error}"); - private void SMTPErrorHandler(string error) - { - // TODO: error logging. - } + private void SMTPErrorHandler(string error) + => Logger.WriteLine($"[SMTP ERROR]\t{error}"); } } diff --git a/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj b/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj index 7f46e95d..cfdc92b4 100644 --- a/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj +++ b/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj @@ -186,6 +186,7 @@ + From e4816bc529df5d80ae4f859247cd16a43ff735af Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Wed, 11 Oct 2023 17:10:02 +0200 Subject: [PATCH 05/56] OMNI+ project created --- Common/Common.sln | 70 +++++++ Common/OmniPlus/App.config | 6 + Common/OmniPlus/Connection/BaudRate.cs | 20 ++ .../Connection/Contracts/IConnection.cs | 14 ++ Common/OmniPlus/Connection/Contracts/IData.cs | 7 + .../Connection/Contracts/IDataSettings.cs | 9 + .../Connection/Contracts/IPortSettings.cs | 19 ++ Common/OmniPlus/Connection/DataBits.cs | 10 + .../OmniPlus/Connection/ReadEventHandler.cs | 6 + Common/OmniPlus/Connection/SPConnection.cs | 182 ++++++++++++++++++ Common/OmniPlus/Connection/SPState.cs | 11 ++ .../OmniPlus/Connection/StateEventHandler.cs | 4 + Common/OmniPlus/Contracts/IOmniConnection.cs | 17 ++ .../Messages/AggregateSystemParameters.cs | 70 +++++++ Common/OmniPlus/Messages/FixedMessages.cs | 29 +++ Common/OmniPlus/Messages/SetInputVolume.cs | 36 ++++ Common/OmniPlus/OmniConnection.cs | 81 ++++++++ Common/OmniPlus/OmniDataSettings.cs | 91 +++++++++ Common/OmniPlus/OmniPlus.csproj | 76 ++++++++ Common/OmniPlus/OmniPortSettings.cs | 22 +++ Common/OmniPlus/OmniRegister.cs | 40 ++++ Common/OmniPlus/Program.cs | 36 ++++ Common/OmniPlus/Properties/AssemblyInfo.cs | 36 ++++ Common/OmniPlus/Types/ASCIIString.cs | 19 ++ Common/OmniPlus/Types/Battery.cs | 24 +++ Common/OmniPlus/Types/Bytes.cs | 21 ++ Common/OmniPlus/Types/Seconds.cs | 23 +++ Common/OmniPlus/Types/TypesExtensions.cs | 7 + .../Infrastructure/TempMeterModels.cs | 8 + 29 files changed, 994 insertions(+) create mode 100644 Common/OmniPlus/App.config create mode 100644 Common/OmniPlus/Connection/BaudRate.cs create mode 100644 Common/OmniPlus/Connection/Contracts/IConnection.cs create mode 100644 Common/OmniPlus/Connection/Contracts/IData.cs create mode 100644 Common/OmniPlus/Connection/Contracts/IDataSettings.cs create mode 100644 Common/OmniPlus/Connection/Contracts/IPortSettings.cs create mode 100644 Common/OmniPlus/Connection/DataBits.cs create mode 100644 Common/OmniPlus/Connection/ReadEventHandler.cs create mode 100644 Common/OmniPlus/Connection/SPConnection.cs create mode 100644 Common/OmniPlus/Connection/SPState.cs create mode 100644 Common/OmniPlus/Connection/StateEventHandler.cs create mode 100644 Common/OmniPlus/Contracts/IOmniConnection.cs create mode 100644 Common/OmniPlus/Messages/AggregateSystemParameters.cs create mode 100644 Common/OmniPlus/Messages/FixedMessages.cs create mode 100644 Common/OmniPlus/Messages/SetInputVolume.cs create mode 100644 Common/OmniPlus/OmniConnection.cs create mode 100644 Common/OmniPlus/OmniDataSettings.cs create mode 100644 Common/OmniPlus/OmniPlus.csproj create mode 100644 Common/OmniPlus/OmniPortSettings.cs create mode 100644 Common/OmniPlus/OmniRegister.cs create mode 100644 Common/OmniPlus/Program.cs create mode 100644 Common/OmniPlus/Properties/AssemblyInfo.cs create mode 100644 Common/OmniPlus/Types/ASCIIString.cs create mode 100644 Common/OmniPlus/Types/Battery.cs create mode 100644 Common/OmniPlus/Types/Bytes.cs create mode 100644 Common/OmniPlus/Types/Seconds.cs create mode 100644 Common/OmniPlus/Types/TypesExtensions.cs diff --git a/Common/Common.sln b/Common/Common.sln index 61d38cec..b0aee56c 100644 --- a/Common/Common.sln +++ b/Common/Common.sln @@ -187,6 +187,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonConsole", "CommonCons EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "modbus_master_csharp", "modbus_master_csharp\modbus_master_csharp.csproj", "{F14940F8-3C86-4BB7-A915-B021E4B3052D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OmniPlus", "OmniPlus", "{7BE8D4DD-4AA3-4CCC-AFEC-7FD01A44FB19}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniPlus", "OmniPlus\OmniPlus.csproj", "{920435CC-ABDF-497A-9C34-1A8511F0CB56}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4 @@ -4381,6 +4385,70 @@ Global {F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x64.Build.0 = Release|Any CPU {F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x86.ActiveCfg = Release|Any CPU {F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x64.ActiveCfg = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x64.Build.0 = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x86.ActiveCfg = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x86.Build.0 = Debug|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x86.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Any CPU.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x64.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x64.Build.0 = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x86.ActiveCfg = Release|Any CPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4466,6 +4534,8 @@ Global {FD30EB7A-7809-4E62-9374-791D31877D6D} = {696A94BE-7237-4AE2-9E36-6059DE519971} {AFC428F5-0141-4A3F-BEF2-470A89D972F6} = {C17363DF-A043-4F25-8EBA-2B3B078227DC} {F14940F8-3C86-4BB7-A915-B021E4B3052D} = {B4F8545B-F379-42A5-BDE9-763FD7B79598} + {7BE8D4DD-4AA3-4CCC-AFEC-7FD01A44FB19} = {5563DD3B-2287-4BED-97BF-F0389FF505AF} + {920435CC-ABDF-497A-9C34-1A8511F0CB56} = {7BE8D4DD-4AA3-4CCC-AFEC-7FD01A44FB19} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164} diff --git a/Common/OmniPlus/App.config b/Common/OmniPlus/App.config new file mode 100644 index 00000000..aee9adf4 --- /dev/null +++ b/Common/OmniPlus/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Common/OmniPlus/Connection/BaudRate.cs b/Common/OmniPlus/Connection/BaudRate.cs new file mode 100644 index 00000000..d086aa1b --- /dev/null +++ b/Common/OmniPlus/Connection/BaudRate.cs @@ -0,0 +1,20 @@ +namespace OmniPlus.Connection +{ + public enum BaudRate : int + { + Bps110 = 110, + Bps300 = 300, + Bps600 = 600, + Bps1200 = 1200, + Bps2400 = 2400, + Bps4800 = 4800, + Bps9600 = 9600, + Bps14400 = 14400, + Bps19200 = 19200, + Bps38400 = 38400, + Bps57600 = 57600, + Bps115200 = 115200, + Bps128000 = 128000, + Bps256000 = 256000 + } +} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Contracts/IConnection.cs b/Common/OmniPlus/Connection/Contracts/IConnection.cs new file mode 100644 index 00000000..fd28a644 --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/IConnection.cs @@ -0,0 +1,14 @@ +using System; + +namespace OmniPlus.Connection.Contracts +{ + internal interface IConnection : IDisposable + { + event ReadEventHandler DataReceived; + event StateEventHandler StateChanged; + + void OpenConnection(); + + void Write(byte[] data); + } +} diff --git a/Common/OmniPlus/Connection/Contracts/IData.cs b/Common/OmniPlus/Connection/Contracts/IData.cs new file mode 100644 index 00000000..fa0c7c60 --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/IData.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Connection.Contracts +{ + internal interface IData + { + byte[] Data { get; } + } +} diff --git a/Common/OmniPlus/Connection/Contracts/IDataSettings.cs b/Common/OmniPlus/Connection/Contracts/IDataSettings.cs new file mode 100644 index 00000000..93682370 --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/IDataSettings.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Connection.Contracts +{ + internal interface IDataSettings : IData + { + bool ReadByte(byte data); + + void StartReading(); + } +} diff --git a/Common/OmniPlus/Connection/Contracts/IPortSettings.cs b/Common/OmniPlus/Connection/Contracts/IPortSettings.cs new file mode 100644 index 00000000..04e58abc --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/IPortSettings.cs @@ -0,0 +1,19 @@ +using System.IO.Ports; + +namespace OmniPlus.Connection.Contracts +{ + internal interface IPortSettings + { + BaudRate BaudRate { get; } + + Parity Parity { get; } + + DataBits DataBits { get; } + + StopBits StopBits { get; } + + bool RtsEnbaled { get; } + + bool DtrEnabled { get; } + } +} diff --git a/Common/OmniPlus/Connection/DataBits.cs b/Common/OmniPlus/Connection/DataBits.cs new file mode 100644 index 00000000..c2a6c882 --- /dev/null +++ b/Common/OmniPlus/Connection/DataBits.cs @@ -0,0 +1,10 @@ +namespace OmniPlus.Connection +{ + public enum DataBits : int + { + B8 = 8, + B7 = 7, + B6 = 6, + B5 = 5 + } +} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/ReadEventHandler.cs b/Common/OmniPlus/Connection/ReadEventHandler.cs new file mode 100644 index 00000000..7b95a7bf --- /dev/null +++ b/Common/OmniPlus/Connection/ReadEventHandler.cs @@ -0,0 +1,6 @@ +using OmniPlus.Connection.Contracts; + +namespace OmniPlus.Connection +{ + internal delegate void ReadEventHandler(IData data); +} diff --git a/Common/OmniPlus/Connection/SPConnection.cs b/Common/OmniPlus/Connection/SPConnection.cs new file mode 100644 index 00000000..26563176 --- /dev/null +++ b/Common/OmniPlus/Connection/SPConnection.cs @@ -0,0 +1,182 @@ +using OmniPlus.Connection.Contracts; + +using System; +using System.Collections.Concurrent; +using System.IO.Ports; + +namespace OmniPlus.Connection +{ + internal class SPConnection : IConnection + { + private readonly string portName; + private readonly IPortSettings portSettings; + private readonly IDataSettings dataSettings; + + private event Action bytesReceived; + private ConcurrentQueue data; + private SerialPort serialPort; + private bool parsingData; + + public SPConnection(string portName, IPortSettings portSettings, IDataSettings dataSettings) + { + this.portName = portName; + this.portSettings = portSettings; + this.dataSettings = dataSettings; + this.bytesReceived += SPConnection_BytesReceived; + } + + public event ReadEventHandler DataReceived; + public event StateEventHandler StateChanged; + + public virtual void Dispose() + { + if (this.DataReceived != null) + { + foreach (var callback in this.DataReceived.GetInvocationList()) + { + if (callback is ReadEventHandler responseReceivedCallback) + { + this.DataReceived -= responseReceivedCallback; + } + } + } + + this.CloseConnection(); + } + + public void Write(byte[] data) + { + if (data?.Length > 0 && this.serialPort.IsOpen) + { + lock (this.serialPort) + { + this.serialPort.Write(data, 0, data.Length); + } + } + } + + public void OpenConnection() + { + this.CloseConnection(); + + try + { + this.serialPort = new SerialPort + { + PortName = this.portName, + BaudRate = (int)this.portSettings.BaudRate, + Parity = this.portSettings.Parity, + DataBits = (int)this.portSettings.DataBits, + StopBits = this.portSettings.StopBits, + RtsEnable = this.portSettings.RtsEnbaled, + DtrEnable = this.portSettings.DtrEnabled + }; + + this.serialPort.DataReceived += this.SerialPort_DataReceived; + this.serialPort.Disposed += this.SerialPort_Disposed; + this.serialPort.ErrorReceived += this.SerialPort_ErrorReceived; + this.serialPort.PinChanged += this.SerialPort_PinChanged; + + this.serialPort.Open(); + } + catch (Exception exception) + { + this.StateChanged?.Invoke(SPState.Error, exception.ToString()); + + this.CloseConnection(); + } + + if (this.serialPort?.IsOpen == true) + { + this.data = new ConcurrentQueue(); + + this.StateChanged?.Invoke(SPState.Opened, "Connected - " + + $", {this.serialPort.PortName}" + + $", {this.serialPort.BaudRate}" + + $", {this.serialPort.Parity}" + + $", {this.serialPort.DataBits}" + + $", {this.serialPort.StopBits}" + + $", RTS: {this.serialPort.RtsEnable}" + + $", DTR: {this.serialPort.DtrEnable}"); + } + } + + private void CloseConnection() + { + if (this.serialPort != null) + { + this.serialPort.DataReceived -= this.SerialPort_DataReceived; + this.serialPort.Disposed -= this.SerialPort_Disposed; + this.serialPort.ErrorReceived -= this.SerialPort_ErrorReceived; + this.serialPort.PinChanged -= this.SerialPort_PinChanged; + + this.serialPort.Dispose(); + + this.serialPort = null; + this.data = null; + + this.StateChanged?.Invoke(SPState.Closed, "Connection was closed."); + } + } + + private void SPConnection_BytesReceived() + { + this.parsingData = true; + + this.dataSettings.StartReading(); + + while (this.parsingData) + { + this.parsingData = this.data.TryDequeue(out byte current) && this.dataSettings.ReadByte(current); + } + + this.DataReceived?.Invoke(this.dataSettings); + } + + private void SerialPort_DataReceived(Object sender, SerialDataReceivedEventArgs args) + { + if (sender is SerialPort serialPort && serialPort.BytesToRead > 0) + { + var bytes = new byte[serialPort.BytesToRead]; + + lock (serialPort) + { + serialPort.Read(bytes, 0, bytes.Length); + } + + foreach (var x in bytes) + { + this.data.Enqueue(x); + } + + if (!this.parsingData) + { + this.bytesReceived?.Invoke(); + } + } + } + + private void SerialPort_Disposed(Object sender, EventArgs args) + { + this.Dispose(); + + this.StateChanged?.Invoke(SPState.Disposed, $"Connection was disposed!"); + } + + private void SerialPort_ErrorReceived(Object sender, SerialErrorReceivedEventArgs args) + { + this.Dispose(); + + this.StateChanged?.Invoke(SPState.Error, $"Error received - {nameof(args.EventType)}: {args.EventType}"); + } + + private void SerialPort_PinChanged(Object sender, SerialPinChangedEventArgs args) + { + this.Dispose(); + + this.StateChanged?.Invoke(SPState.PinChanged, $"Pin changed - {nameof(args.EventType)}: {args.EventType}"); + } + + ~SPConnection() => this.Dispose(); + } +} diff --git a/Common/OmniPlus/Connection/SPState.cs b/Common/OmniPlus/Connection/SPState.cs new file mode 100644 index 00000000..04230c11 --- /dev/null +++ b/Common/OmniPlus/Connection/SPState.cs @@ -0,0 +1,11 @@ +namespace OmniPlus.Connection +{ + internal enum SPState + { + Closed, + Disposed, + Error, + PinChanged, + Opened + } +} diff --git a/Common/OmniPlus/Connection/StateEventHandler.cs b/Common/OmniPlus/Connection/StateEventHandler.cs new file mode 100644 index 00000000..e0b80486 --- /dev/null +++ b/Common/OmniPlus/Connection/StateEventHandler.cs @@ -0,0 +1,4 @@ +namespace OmniPlus.Connection +{ + internal delegate void StateEventHandler(SPState state, string message); +} diff --git a/Common/OmniPlus/Contracts/IOmniConnection.cs b/Common/OmniPlus/Contracts/IOmniConnection.cs new file mode 100644 index 00000000..8810ca66 --- /dev/null +++ b/Common/OmniPlus/Contracts/IOmniConnection.cs @@ -0,0 +1,17 @@ +using OmniPlus.Connection; + +using System; + +namespace OmniPlus.Contracts +{ + internal interface IOmniConnection : IDisposable + { + event StateEventHandler StateChanged; + + void CloseConnection(); + + void OpenConnection(); + + byte[] Send(byte[] request); + } +} diff --git a/Common/OmniPlus/Messages/AggregateSystemParameters.cs b/Common/OmniPlus/Messages/AggregateSystemParameters.cs new file mode 100644 index 00000000..b0cf3366 --- /dev/null +++ b/Common/OmniPlus/Messages/AggregateSystemParameters.cs @@ -0,0 +1,70 @@ +namespace OmniPlus.Commands +{ + using OmniPlus.Types; + + using System; + + public class AggregateSystemParameters + { + private readonly ASCIIString factoryBuild; + private readonly Seconds manifacturingTime; + private readonly Seconds systemTime; + private readonly ASCIIString firmware; + private readonly Battery battery; + private readonly byte rebootCount; + private readonly byte sealStatus; + + private AggregateSystemParameters(byte[] data) + { + this.rebootCount = default(byte); + this.sealStatus = default(byte); + this.factoryBuild = new byte[16]; + this.manifacturingTime = new byte[4]; + this.systemTime = new byte[4]; + this.firmware = new byte[27]; + this.battery = new byte[6]; + + if (data?.Length > 0) + { + var exactData = new byte[59]; + + data.CopyTo(exactData, 0); + + this.rebootCount = data[24]; + this.sealStatus = data[58]; + + Array.Copy(exactData, 0, this.factoryBuild, 0, 16); + Array.Copy(exactData, 16, this.manifacturingTime, 0, 4); + Array.Copy(exactData, 20, this.systemTime, 0, 4); + Array.Copy(exactData, 25, this.firmware, 0, 27); + Array.Copy(exactData, 52, this.battery, 0, 6); + } + } + + public bool VerifyBatteryVoltage(double minV = 3.19, double maxV = 3.75) + => minV <= this.battery.Volts && this.battery.Volts <= maxV; + + public bool VerifySystemTimeDrift(uint max = 700) + { + var baseTimeUTC = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); + var presentUTC = DateTime.UtcNow - baseTimeUTC; + var totalSeconds = Math.Abs(presentUTC.TotalSeconds - this.systemTime); + + return 0 <= totalSeconds && totalSeconds <= max; + } + + public bool VerifyRegisterAge(uint max = 365) + { + var manifacturingTimeUTC = new DateTime(this.manifacturingTime.Ticks, DateTimeKind.Utc); + var totalManifacturingDays = new TimeSpan(manifacturingTimeUTC.Ticks).TotalDays; + + return 0 <= totalManifacturingDays && totalManifacturingDays <= max; + } + + public static implicit operator AggregateSystemParameters(byte[] data) + => new AggregateSystemParameters(data); + + public static implicit operator byte[] (AggregateSystemParameters _) + => new byte[] { 0xFD, 0xC6 }; + } +} diff --git a/Common/OmniPlus/Messages/FixedMessages.cs b/Common/OmniPlus/Messages/FixedMessages.cs new file mode 100644 index 00000000..882e88e9 --- /dev/null +++ b/Common/OmniPlus/Messages/FixedMessages.cs @@ -0,0 +1,29 @@ +namespace OmniPlus.Messages +{ + public class FixedMessages + { + /// + /// Each bytes array describes following state: + /// 0: pulse, 1: direction, 2-3: fractional portion ml/Pulse, 4: meter size, 5 meter range + /// + private static readonly byte[][] flowCalibrationSetup = new byte[][] + { + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 0: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 1: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 2: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 3: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 4: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 5: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x06, 0x00 }, // 6: Meters of size 2" + new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x07, 0x01 }, // 7: Meters of size 3" + new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x08, 0x01 }, // 8: Meters of size 4" + new byte[] { 0x06, 0x00, 0x72, 0x41, 0x09, 0x02 }, // 9: Meters of size 6" + new byte[] { 0x01, 0x80, 0xCE, 0x8F, 0x0A, 0x03 }, // 10: Meters of size 8" + new byte[] { 0x02, 0x80, 0xA3, 0x54, 0x0B, 0x04 }, // 11: Meters of size 10" + }; + + + public static byte[] FlowCalibrationSetup(byte meterSize) + => flowCalibrationSetup[meterSize % flowCalibrationSetup.Length - 1]; + } +} diff --git a/Common/OmniPlus/Messages/SetInputVolume.cs b/Common/OmniPlus/Messages/SetInputVolume.cs new file mode 100644 index 00000000..612f81d6 --- /dev/null +++ b/Common/OmniPlus/Messages/SetInputVolume.cs @@ -0,0 +1,36 @@ +using OmniPlus.Types; + +namespace OmniPlus.Messages +{ + public class SetInputVolume : Bytes + { + /// + /// 0: pulse, 1: direction, 2-3: fractional portion ml/Pulse, 4: meter size, 5 meter range + /// + private static readonly byte[][] defaults = new byte[][] + { + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 0: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 1: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 2: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 3: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 4: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 5: Meters of size 1 1/2" + new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x06, 0x00 }, // 6: Meters of size 2" + new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x07, 0x01 }, // 7: Meters of size 3" + new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x08, 0x01 }, // 8: Meters of size 4" + new byte[] { 0x06, 0x00, 0x72, 0x41, 0x09, 0x02 }, // 9: Meters of size 6" + new byte[] { 0x01, 0x80, 0xCE, 0x8F, 0x0A, 0x03 }, // 10: Meters of size 8" + new byte[] { 0x02, 0x80, 0xA3, 0x54, 0x0B, 0x04 }, // 11: Meters of size 10" + }; + + public SetInputVolume(byte[] data) : base(data) + { + } + + public static implicit operator SetInputVolume(byte size) + => defaults[size % (defaults.Length - 1)]; + + public static implicit operator SetInputVolume(byte[] bytes) + => new SetInputVolume(bytes); + } +} diff --git a/Common/OmniPlus/OmniConnection.cs b/Common/OmniPlus/OmniConnection.cs new file mode 100644 index 00000000..75e646fc --- /dev/null +++ b/Common/OmniPlus/OmniConnection.cs @@ -0,0 +1,81 @@ +using OmniPlus.Connection; +using OmniPlus.Connection.Contracts; +using OmniPlus.Contracts; + +using System; +using System.Threading; + +namespace OmniPlus +{ + internal class OmniConnection : IOmniConnection + { + private readonly IConnection connection; + private readonly int timeoutSeconds; + private readonly int sleeMilliseconds; + + private byte[] data; + private bool waiting; + + public OmniConnection(string portName, int timeoutSeconds = 3000, int sleeMilliseconds = 300) + { + this.connection = new SPConnection( + portName: portName, + portSettings: new OmniPortSettings(), + dataSettings: new OmniDataSettings(new byte[][] + { + // length, length index + new byte[] { 1, 0 }, // Start byte + new byte[] { 3, 0 }, // Control bytes + new byte[] { 1, 0 }, // Data length byte + new byte[] { 0, 4 }, // Data bytes + new byte[] { 1, 0 }, // Alignment byte + new byte[] { 2, 0 } // CRC 16 bytes + })); + this.timeoutSeconds = timeoutSeconds; + this.sleeMilliseconds = sleeMilliseconds; + } + + public event StateEventHandler StateChanged + { + add => this.connection.StateChanged += value; + remove => this.connection.StateChanged -= value; + } + + public void CloseConnection() + => this.connection.Dispose(); + + public void Dispose() + => this.connection.Dispose(); + + public void OpenConnection() + => this.connection.OpenConnection(); + + public byte[] Send(byte[] request) + { + this.waiting = true; + + this.connection.DataReceived += this.Connection_DataReceived; + + this.connection.Write(request); + + var timeoutSeconds = this.timeoutSeconds; + + while (this.waiting && timeoutSeconds > 0) + { + timeoutSeconds -= this.sleeMilliseconds; + + Thread.Sleep(this.sleeMilliseconds); + } + + this.connection.DataReceived -= this.Connection_DataReceived; + + return this.data ?? Array.Empty(); + } + + private void Connection_DataReceived(IData data) + { + this.waiting = false; + this.data = data.Data; + } + } +} diff --git a/Common/OmniPlus/OmniDataSettings.cs b/Common/OmniPlus/OmniDataSettings.cs new file mode 100644 index 00000000..c96a5ca0 --- /dev/null +++ b/Common/OmniPlus/OmniDataSettings.cs @@ -0,0 +1,91 @@ +using OmniPlus.Connection.Contracts; + +namespace OmniPlus +{ + class OmniDataSettings : IDataSettings + { + private readonly byte[][] template; + private byte[][] messageTemplate; + private byte[] messageContent; + private int rowLength; + private int row; + private int col; + private bool ok; + private bool reading; + + public OmniDataSettings(byte[][] template) + => this.template = template; + + public byte[] Data => this.messageContent; + + public bool ReadByte(byte data) + { + if (!this.reading) + { + this.reading = this.template[0][1] == data; + } + else + { + this.ok = this.PrepareReading(); + + if (this.ok) + { + this.messageContent[this.col] = data; + } + } + + return this.ok; + } + + public void StartReading() + { + this.template.CopyTo(this.messageTemplate, 0); + + this.messageContent = new byte[8]; + this.row = 0; + this.rowLength = this.messageTemplate[this.row][0]; + this.col = -1; + this.reading = false; + this.ok = this.rowLength > 0 && this.col < this.messageContent.Length; + } + + private bool PrepareReading() + { + this.col++; + + if (this.rowLength - this.col > 0) + { + return true; + } + + this.row++; + + if (this.row >= this.messageTemplate.Length) + { + return false; + } + + var nextLength = this.messageTemplate[this.row][0]; + + if (nextLength == 0) + { + nextLength = this.messageTemplate[this.row][1]; + + for (int i = this.row + 1; i < this.messageTemplate.Length; i++) + { + this.messageTemplate[i][1] += nextLength; + } + + var messageContent = new byte[this.messageContent.Length + nextLength]; + + this.messageContent.CopyTo(messageContent, 0); + + this.messageContent = messageContent; + } + + this.rowLength += nextLength; + + return this.row < this.messageTemplate.Length && this.col < this.messageContent.Length; + } + } +} diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj new file mode 100644 index 00000000..b2ccdff3 --- /dev/null +++ b/Common/OmniPlus/OmniPlus.csproj @@ -0,0 +1,76 @@ + + + + + Debug + AnyCPU + {920435CC-ABDF-497A-9C34-1A8511F0CB56} + Exe + OmniPlus + OmniPlus + v4.8.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Common/OmniPlus/OmniPortSettings.cs b/Common/OmniPlus/OmniPortSettings.cs new file mode 100644 index 00000000..5c0dadf6 --- /dev/null +++ b/Common/OmniPlus/OmniPortSettings.cs @@ -0,0 +1,22 @@ +using OmniPlus.Connection; +using OmniPlus.Connection.Contracts; + +using System.IO.Ports; + +namespace OmniPlus +{ + public class OmniPortSettings : IPortSettings + { + public BaudRate BaudRate => BaudRate.Bps4800; + + public Parity Parity => Parity.None; + + public DataBits DataBits => DataBits.B8; + + public StopBits StopBits => StopBits.One; + + public System.Boolean RtsEnbaled => true; + + public System.Boolean DtrEnabled => false; + } +} diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs new file mode 100644 index 00000000..aefe0b31 --- /dev/null +++ b/Common/OmniPlus/OmniRegister.cs @@ -0,0 +1,40 @@ +using OmniPlus.Connection; +using OmniPlus.Contracts; + +using System; + +namespace OmniPlus +{ + public class OmniRegister + { + private readonly IOmniConnection omniConnection; + + private bool connectionAvailable; + + public OmniRegister(string portName) + { + this.omniConnection = new OmniConnection(portName); + this.omniConnection.StateChanged += OmniConnection_StateChanged; + this.omniConnection.OpenConnection(); + } + + public bool EnsureRegisterInitialized() + { + return true; + } + + public bool EnsureRegisterSealed() + { + return true; + } + + private void OmniConnection_StateChanged(SPState state, string message) + { + // TODO: handle, log - changes + + Console.WriteLine($"[{state}] {message}"); + + this.connectionAvailable = state == SPState.Opened; + } + } +} diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs new file mode 100644 index 00000000..a2fbb215 --- /dev/null +++ b/Common/OmniPlus/Program.cs @@ -0,0 +1,36 @@ +using OmniPlus.Connection; + +using System; +using System.Collections.Concurrent; +using System.Text; + +namespace OmniPlus +{ + class Program + { + static void Main(string[] args) + { + //var queue = new ConcurrentQueue(); + //var dataSettings = new OmniIrdaSettings(); + //var parsingData = true; + + //dataSettings.StartReading(); + + //for (byte i = (byte)'a'; i < (byte)'a' + 26; i++) + //{ + // queue.Enqueue(i); + //} + + //while (parsingData) + //{ + // parsingData = queue.TryDequeue(out byte current) && dataSettings.ReadByte(current); + //} + + //parsingData = false; + + //Console.WriteLine(Encoding.ASCII.GetString(dataSettings.Data)); + + //var test = new SPConnection(null, null, null); + } + } +} diff --git a/Common/OmniPlus/Properties/AssemblyInfo.cs b/Common/OmniPlus/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..8c505827 --- /dev/null +++ b/Common/OmniPlus/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OmniPlus")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OmniPlus")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("920435cc-abdf-497a-9c34-1a8511f0cb56")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Common/OmniPlus/Types/ASCIIString.cs b/Common/OmniPlus/Types/ASCIIString.cs new file mode 100644 index 00000000..b48bce08 --- /dev/null +++ b/Common/OmniPlus/Types/ASCIIString.cs @@ -0,0 +1,19 @@ +namespace OmniPlus.Types +{ + using System; + using System.Text; + + public class ASCIIString : Bytes + { + private readonly string value; + + public ASCIIString(byte[] data) : base(data) + => this.value = Encoding.ASCII.GetString(this.data); + + public override string ToString() + => this.value; + + public static implicit operator ASCIIString(byte[] data) + => new ASCIIString(data ?? Array.Empty()); + } +} diff --git a/Common/OmniPlus/Types/Battery.cs b/Common/OmniPlus/Types/Battery.cs new file mode 100644 index 00000000..15c39673 --- /dev/null +++ b/Common/OmniPlus/Types/Battery.cs @@ -0,0 +1,24 @@ +namespace OmniPlus.Types +{ + using System; + + public class Battery : Bytes + { + private readonly ushort volts; + private readonly uint rawADC; + + public Battery(byte[] data) : base(data) + { + this.volts = BitConverter.ToUInt16(this.data, 0); + this.rawADC = BitConverter.ToUInt32(this.data, 2); + } + + public double Volts => this.volts / 1000.0; + + public override string ToString() + => $"{this.volts}mV, {this.rawADC} ADC"; + + public static implicit operator Battery(byte[] data) + => new Battery(data ?? Array.Empty()); + } +} diff --git a/Common/OmniPlus/Types/Bytes.cs b/Common/OmniPlus/Types/Bytes.cs new file mode 100644 index 00000000..dc0994fc --- /dev/null +++ b/Common/OmniPlus/Types/Bytes.cs @@ -0,0 +1,21 @@ +namespace OmniPlus.Types +{ + using System; + + public class Bytes + { + protected readonly byte[] data; + + public Bytes(byte[] data) + => this.data = data; + + public string ToHexString() + => BitConverter.ToString(this.data); + + public static implicit operator byte[] (Bytes bytes) + => bytes.data ?? Array.Empty(); + + public static implicit operator Bytes (byte[] bytes) + => new Bytes(bytes ?? Array.Empty()); + } +} diff --git a/Common/OmniPlus/Types/Seconds.cs b/Common/OmniPlus/Types/Seconds.cs new file mode 100644 index 00000000..4cd28ac4 --- /dev/null +++ b/Common/OmniPlus/Types/Seconds.cs @@ -0,0 +1,23 @@ +namespace OmniPlus.Types +{ + using System; + + public class Seconds : Bytes + { + private readonly uint seconds; + + public Seconds(byte[] data) : base(data) + => this.seconds = BitConverter.ToUInt32(data, 0); + + public long Ticks => this.seconds * 10_000_000; + + public override string ToString() + => this.seconds.ToString(); + + public static implicit operator Seconds(byte[] data) + => new Seconds(data ?? Array.Empty()); + + public static implicit operator uint(Seconds seconds) + => seconds?.seconds ?? default(uint); + } +} diff --git a/Common/OmniPlus/Types/TypesExtensions.cs b/Common/OmniPlus/Types/TypesExtensions.cs new file mode 100644 index 00000000..ff6901c0 --- /dev/null +++ b/Common/OmniPlus/Types/TypesExtensions.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Types +{ + public static class TypesExtensions + { + + } +} diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index 85ecb02f..1a3f1f91 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -209,6 +209,7 @@ { var messurementLines = File.ReadAllLines(this.messurementsFile); var messurements = new Messurements(this.pcbId); + var skipCount = 2; File.WriteAllText(this.messurementsFile, string.Empty); @@ -219,6 +220,13 @@ continue; } + if (skipCount > 0) + { + skipCount--; + + continue; + } + var tokens = messurementLine .Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); From 67434b537bac9b5bf53bfef6f9e1f29e31ddcfe2 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 12 Oct 2023 08:42:38 +0200 Subject: [PATCH 06/56] additional columns in the LUT view --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 194 +++++++++++------- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 17 +- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 15 +- .../Infrastructure/TempMeterModels.cs | 20 +- 4 files changed, 159 insertions(+), 87 deletions(-) diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index 90820549..93470814 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,9 +31,16 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -89,17 +96,20 @@ namespace Xylem.Common.Ui.GenesisToolBox this.backwardsPcbs = new System.Windows.Forms.ToolStripMenuItem(); this.lutTab = new System.Windows.Forms.TabPage(); this.aggregationsGridView = new System.Windows.Forms.DataGridView(); - this.PcbId = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Avg_Nr = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Avg_T = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Avg_TOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Selected = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.resultsMenu = new System.Windows.Forms.MenuStrip(); this.loadPcbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.updateViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); + this.PcbId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Avg_Nr = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Avg_T = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Avg_TOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.diffT = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.diffTOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.seconds = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Selected = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -610,14 +620,14 @@ namespace Xylem.Common.Ui.GenesisToolBox // this.temperatureChecksGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.temperatureChecksGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.ButtonFace; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.temperatureChecksGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.TemperatureCheck_Pcb, this.TemperatureCheck_PrevC, @@ -628,14 +638,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.TemperatureCheck_PrevTOF, this.TemperatureCheck_CurrentTOF, this.TemperatureCheck_NextTOF}); - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle2; this.temperatureChecksGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.temperatureChecksGridView.Location = new System.Drawing.Point(0, 24); this.temperatureChecksGridView.Name = "temperatureChecksGridView"; @@ -739,20 +749,23 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, this.Avg_Nr, this.Avg_T, this.Avg_TOF, + this.diffT, + this.diffTOF, + this.seconds, this.Selected}); this.aggregationsGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.aggregationsGridView.Location = new System.Drawing.Point(0, 24); @@ -761,44 +774,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.Size = new System.Drawing.Size(1217, 623); this.aggregationsGridView.TabIndex = 0; // - // PcbId - // - this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PcbId.HeaderText = "PcbId"; - this.PcbId.Name = "PcbId"; - this.PcbId.ReadOnly = true; - // - // Avg_Nr - // - this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Avg_Nr.HeaderText = "Avg Nr"; - this.Avg_Nr.Name = "Avg_Nr"; - this.Avg_Nr.ReadOnly = true; - // - // Avg_T - // - this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Avg_T.HeaderText = "Avg °C"; - this.Avg_T.Name = "Avg_T"; - this.Avg_T.ReadOnly = true; - // - // Avg_TOF - // - this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Avg_TOF.HeaderText = "Avg TOF"; - this.Avg_TOF.Name = "Avg_TOF"; - this.Avg_TOF.ReadOnly = true; - // - // Selected - // - this.Selected.FalseValue = "false"; - this.Selected.HeaderText = "Selected"; - this.Selected.IndeterminateValue = "false"; - this.Selected.Name = "Selected"; - this.Selected.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.Selected.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.Selected.TrueValue = "true"; - // // resultsMenu // this.resultsMenu.BackColor = System.Drawing.Color.WhiteSmoke; @@ -846,6 +821,78 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // + // PcbId + // + this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.PcbId.DefaultCellStyle = dataGridViewCellStyle4; + this.PcbId.HeaderText = "PcbId"; + this.PcbId.Name = "PcbId"; + this.PcbId.ReadOnly = true; + // + // Avg_Nr + // + this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle5; + this.Avg_Nr.HeaderText = "Nr"; + this.Avg_Nr.Name = "Avg_Nr"; + this.Avg_Nr.ReadOnly = true; + // + // Avg_T + // + this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_T.DefaultCellStyle = dataGridViewCellStyle6; + this.Avg_T.HeaderText = "Avg °C"; + this.Avg_T.Name = "Avg_T"; + this.Avg_T.ReadOnly = true; + // + // Avg_TOF + // + this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle7; + this.Avg_TOF.HeaderText = "Avg TOF"; + this.Avg_TOF.Name = "Avg_TOF"; + this.Avg_TOF.ReadOnly = true; + // + // diffT + // + this.diffT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffT.DefaultCellStyle = dataGridViewCellStyle8; + this.diffT.HeaderText = "°C max - min"; + this.diffT.Name = "diffT"; + // + // diffTOF + // + this.diffTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffTOF.DefaultCellStyle = dataGridViewCellStyle9; + this.diffTOF.HeaderText = "TOF max - min"; + this.diffTOF.Name = "diffTOF"; + this.diffTOF.ReadOnly = true; + // + // seconds + // + this.seconds.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.seconds.DefaultCellStyle = dataGridViewCellStyle10; + this.seconds.HeaderText = "Seconds"; + this.seconds.Name = "seconds"; + this.seconds.ReadOnly = true; + // + // Selected + // + this.Selected.FalseValue = "false"; + this.Selected.HeaderText = "Selected"; + this.Selected.IndeterminateValue = "false"; + this.Selected.Name = "Selected"; + this.Selected.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.Selected.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.Selected.TrueValue = "true"; + // // FrmTempMeter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -926,11 +973,6 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.MenuStrip resultsMenu; private System.Windows.Forms.ToolStripMenuItem updateViewToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem saveSelectedToolStripMenuItem; - private System.Windows.Forms.DataGridViewTextBoxColumn PcbId; - private System.Windows.Forms.DataGridViewTextBoxColumn Avg_Nr; - private System.Windows.Forms.DataGridViewTextBoxColumn Avg_T; - private System.Windows.Forms.DataGridViewTextBoxColumn Avg_TOF; - private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; private System.Windows.Forms.ToolStripMenuItem loadPcbToolStripMenuItem; private System.Windows.Forms.Button startBackwardBtn; private System.Windows.Forms.Button stopBackwardsBtn; @@ -949,5 +991,13 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_NextTOF; private System.Windows.Forms.TextBox backwardsStepMS; private System.Windows.Forms.Label label8; + private System.Windows.Forms.DataGridViewTextBoxColumn PcbId; + private System.Windows.Forms.DataGridViewTextBoxColumn Avg_Nr; + private System.Windows.Forms.DataGridViewTextBoxColumn Avg_T; + private System.Windows.Forms.DataGridViewTextBoxColumn Avg_TOF; + private System.Windows.Forms.DataGridViewTextBoxColumn diffT; + private System.Windows.Forms.DataGridViewTextBoxColumn diffTOF; + private System.Windows.Forms.DataGridViewTextBoxColumn seconds; + private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index 60a9d0e3..fb851ce3 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -935,11 +935,14 @@ currentRow.Cells[0].Value = aggregation.PcbId; currentRow.Cells[1].Value = aggregation.Id; - currentRow.Cells[2].Value = aggregation.AvgT; - currentRow.Cells[3].Value = aggregation.AvgTOF; - currentRow.Cells[4].Value = aggregation.Selected; - currentRow.Cells[4].Tag = aggregation.PcbId; - currentRow.Cells[4].ValueType = typeof(bool); + currentRow.Cells[2].Value = $"{aggregation.AvgT:0.00}"; + currentRow.Cells[3].Value = $"{aggregation.AvgTOF:0.0000000000}"; + currentRow.Cells[4].Value = $"{aggregation.DiffT:0.00}"; + currentRow.Cells[5].Value = $"{aggregation.DiffTOF:0.0000000000}"; + currentRow.Cells[6].Value = aggregation.Seconds; + currentRow.Cells[7].Value = aggregation.Selected; + currentRow.Cells[7].Tag = aggregation.PcbId; + currentRow.Cells[7].ValueType = typeof(bool); if (aggregation.Selected) { @@ -1056,7 +1059,7 @@ private void LoadTemperatureChecks(string pcb) => this.BeginInvoke(new Action(() => { - this.aggregationsGridView.Rows.Clear(); + this.temperatureChecksGridView.Rows.Clear(); var temperatureChecks = this.automaticCalibration .TemperatureChecksFor(pcb) @@ -1089,8 +1092,6 @@ currentRow.Cells[7].Value = $"{temperatureCheck.CurrentTOF:0.0000000000}"; currentRow.Cells[8].Value = $"{temperatureCheck.NextTOF:0.0000000000}"; } - - this.aggregationsGridView.CellContentClick += AggregationsGridView_CurrentCellChanged; })); } } diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index e87cd74c..15e6b68b 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,12 +123,6 @@ 104, 17 - - 531, 17 - - - 413, 17 - True @@ -171,6 +165,15 @@ True + + True + + + True + + + True + True diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index bec171b9..51eb647c 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -299,17 +299,26 @@ var pcbString = tokens[0] ?? string.Empty; var avgTString = tokens[3] ?? string.Empty; + var difTString = tokens[7] ?? string.Empty; var avgTOFString = tokens[4] ?? string.Empty; + var difTOFString = tokens[8] ?? string.Empty; + var secondsString = tokens[9] ?? string.Empty; var pcbId = default(int); var avgT = default(double); + var difT = default(double); var avgTOF = default(double); + var difTOF = default(double); + var seconds = default(int); var pcbParsed = int.TryParse(pcbString, out pcbId); var tParsed = double.TryParse(avgTString, ANY, this.en, out avgT) || double.TryParse(avgTString, ANY, this.de, out avgT); + var dtParsed = double.TryParse(difTString, ANY, this.en, out difT) || double.TryParse(difTString, ANY, this.de, out difT); + var secParsed = int.TryParse(secondsString, ANY, this.en, out seconds) || int.TryParse(secondsString, ANY, this.de, out seconds); var tofParsed = double.TryParse(avgTOFString, ANY, this.en, out avgTOF) || double.TryParse(avgTOFString, ANY, this.de, out avgTOF); + var dtofParsed = double.TryParse(difTOFString, ANY, this.en, out difTOF) || double.TryParse(difTOFString, ANY, this.de, out difTOF); - if (!pcbParsed || !tParsed || !tofParsed) + if (!pcbParsed || !tParsed || !tofParsed || !dtParsed || !dtofParsed) { continue; } @@ -318,7 +327,10 @@ { PcbId = pcbId, AvgT = avgT, + DiffT = difT, AvgTOF = avgTOF, + DiffTOF = difTOF, + Seconds = seconds, Selected = existingAggregations.Any(x => x.AvgT == avgT) }); } @@ -686,6 +698,12 @@ public double AvgTOF { get; set; } + public double DiffT { get; set; } + + public double DiffTOF { get; set; } + + public int Seconds { get; set; } + public bool Selected { get; set; } } From 882dbc10a9a1ca19068988ad63da8115b6f59e5f Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 12 Oct 2023 10:08:17 +0200 Subject: [PATCH 07/56] aouto load pcb in Genesis Toolbox --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 231 +++++++++--------- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 55 +++-- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 57 +++-- .../AccountManager.cs | 3 + 4 files changed, 186 insertions(+), 160 deletions(-) diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index 93470814..67fc5d1b 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,16 +31,16 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -96,12 +96,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.backwardsPcbs = new System.Windows.Forms.ToolStripMenuItem(); this.lutTab = new System.Windows.Forms.TabPage(); this.aggregationsGridView = new System.Windows.Forms.DataGridView(); - this.resultsMenu = new System.Windows.Forms.MenuStrip(); - this.loadPcbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.updateViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.timer3 = new System.Windows.Forms.Timer(this.components); - this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); this.PcbId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Avg_Nr = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Avg_T = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -110,6 +104,12 @@ namespace Xylem.Common.Ui.GenesisToolBox this.diffTOF = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.seconds = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Selected = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.resultsMenu = new System.Windows.Forms.MenuStrip(); + this.loadPcbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.updateViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.timer3 = new System.Windows.Forms.Timer(this.components); + this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -620,14 +620,14 @@ namespace Xylem.Common.Ui.GenesisToolBox // this.temperatureChecksGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.temperatureChecksGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.ButtonFace; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle39.BackColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle39.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle39.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle39.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle39.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle39; this.temperatureChecksGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.TemperatureCheck_Pcb, this.TemperatureCheck_PrevC, @@ -638,14 +638,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.TemperatureCheck_PrevTOF, this.TemperatureCheck_CurrentTOF, this.TemperatureCheck_NextTOF}); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle40.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle40.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle40.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle40.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle40.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle40.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle40; this.temperatureChecksGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.temperatureChecksGridView.Location = new System.Drawing.Point(0, 24); this.temperatureChecksGridView.Name = "temperatureChecksGridView"; @@ -730,7 +730,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.backwardsPcbs.Name = "backwardsPcbs"; this.backwardsPcbs.Size = new System.Drawing.Size(73, 20); this.backwardsPcbs.Text = "Select pcb"; - this.backwardsPcbs.Click += new System.EventHandler(this.BackwardsPcb_Click); + this.backwardsPcbs.DropDownOpening += new System.EventHandler(this.BackwardsPcbs_DropDownOpening); // // lutTab // @@ -749,14 +749,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle31.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle31.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle31.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle31.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle31; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, @@ -774,6 +774,78 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.Size = new System.Drawing.Size(1217, 623); this.aggregationsGridView.TabIndex = 0; // + // PcbId + // + this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.PcbId.DefaultCellStyle = dataGridViewCellStyle32; + this.PcbId.HeaderText = "PcbId"; + this.PcbId.Name = "PcbId"; + this.PcbId.ReadOnly = true; + // + // Avg_Nr + // + this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle33; + this.Avg_Nr.HeaderText = "Nr"; + this.Avg_Nr.Name = "Avg_Nr"; + this.Avg_Nr.ReadOnly = true; + // + // Avg_T + // + this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_T.DefaultCellStyle = dataGridViewCellStyle34; + this.Avg_T.HeaderText = "Avg °C"; + this.Avg_T.Name = "Avg_T"; + this.Avg_T.ReadOnly = true; + // + // Avg_TOF + // + this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle35; + this.Avg_TOF.HeaderText = "Avg TOF"; + this.Avg_TOF.Name = "Avg_TOF"; + this.Avg_TOF.ReadOnly = true; + // + // diffT + // + this.diffT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffT.DefaultCellStyle = dataGridViewCellStyle36; + this.diffT.HeaderText = "°C max - min"; + this.diffT.Name = "diffT"; + // + // diffTOF + // + this.diffTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffTOF.DefaultCellStyle = dataGridViewCellStyle37; + this.diffTOF.HeaderText = "TOF max - min"; + this.diffTOF.Name = "diffTOF"; + this.diffTOF.ReadOnly = true; + // + // seconds + // + this.seconds.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.seconds.DefaultCellStyle = dataGridViewCellStyle38; + this.seconds.HeaderText = "Seconds"; + this.seconds.Name = "seconds"; + this.seconds.ReadOnly = true; + // + // Selected + // + this.Selected.FalseValue = "false"; + this.Selected.HeaderText = "Selected"; + this.Selected.IndeterminateValue = "false"; + this.Selected.Name = "Selected"; + this.Selected.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.Selected.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.Selected.TrueValue = "true"; + // // resultsMenu // this.resultsMenu.BackColor = System.Drawing.Color.WhiteSmoke; @@ -790,8 +862,9 @@ namespace Xylem.Common.Ui.GenesisToolBox // loadPcbToolStripMenuItem // this.loadPcbToolStripMenuItem.Name = "loadPcbToolStripMenuItem"; - this.loadPcbToolStripMenuItem.Size = new System.Drawing.Size(68, 20); - this.loadPcbToolStripMenuItem.Text = "Load pcb"; + this.loadPcbToolStripMenuItem.Size = new System.Drawing.Size(73, 20); + this.loadPcbToolStripMenuItem.Text = "Select pcb"; + this.loadPcbToolStripMenuItem.DropDownOpening += new System.EventHandler(this.LoadPcbToolStripMenuItem_DropDownOpening); // // updateViewToolStripMenuItem // @@ -821,78 +894,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // - // PcbId - // - this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.PcbId.DefaultCellStyle = dataGridViewCellStyle4; - this.PcbId.HeaderText = "PcbId"; - this.PcbId.Name = "PcbId"; - this.PcbId.ReadOnly = true; - // - // Avg_Nr - // - this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle5; - this.Avg_Nr.HeaderText = "Nr"; - this.Avg_Nr.Name = "Avg_Nr"; - this.Avg_Nr.ReadOnly = true; - // - // Avg_T - // - this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_T.DefaultCellStyle = dataGridViewCellStyle6; - this.Avg_T.HeaderText = "Avg °C"; - this.Avg_T.Name = "Avg_T"; - this.Avg_T.ReadOnly = true; - // - // Avg_TOF - // - this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle7; - this.Avg_TOF.HeaderText = "Avg TOF"; - this.Avg_TOF.Name = "Avg_TOF"; - this.Avg_TOF.ReadOnly = true; - // - // diffT - // - this.diffT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffT.DefaultCellStyle = dataGridViewCellStyle8; - this.diffT.HeaderText = "°C max - min"; - this.diffT.Name = "diffT"; - // - // diffTOF - // - this.diffTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffTOF.DefaultCellStyle = dataGridViewCellStyle9; - this.diffTOF.HeaderText = "TOF max - min"; - this.diffTOF.Name = "diffTOF"; - this.diffTOF.ReadOnly = true; - // - // seconds - // - this.seconds.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.seconds.DefaultCellStyle = dataGridViewCellStyle10; - this.seconds.HeaderText = "Seconds"; - this.seconds.Name = "seconds"; - this.seconds.ReadOnly = true; - // - // Selected - // - this.Selected.FalseValue = "false"; - this.Selected.HeaderText = "Selected"; - this.Selected.IndeterminateValue = "false"; - this.Selected.Name = "Selected"; - this.Selected.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.Selected.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.Selected.TrueValue = "true"; - // // FrmTempMeter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index fb851ce3..dd0d112b 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -558,25 +558,7 @@ private void InitializeContent() { this.automaticCalibration = new AutomaticTemperatureCalibration(null, this); - - foreach (var pcbText in this.automaticCalibration.AvailableAggregationPcbs()) - { - var dropdownPcbId = new ToolStripMenuItem(pcbText); - dropdownPcbId.Click += DropdownPcbId_Click; - - this.loadPcbToolStripMenuItem.DropDownItems.Add(dropdownPcbId); - } - - foreach (var pcbText in this.automaticCalibration.AvailableCheckPcbs()) - { - var dropdownPcbId = new ToolStripMenuItem(pcbText); - dropdownPcbId.Click += this.BackwardsPcb_Click; - - this.backwardsPcbs.DropDownItems.Add(dropdownPcbId); - } - this.aggregationsGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.WhiteSmoke; - this.mainMenuStrip.Padding = new Padding(5); var menuFont = this.mainMenuStrip.Font; @@ -1093,5 +1075,42 @@ currentRow.Cells[8].Value = $"{temperatureCheck.NextTOF:0.0000000000}"; } })); + + private void BackwardsPcbs_DropDownOpening(Object sender, EventArgs e) + { + if (sender is ToolStripMenuItem menuItem) + { + menuItem.DropDownItems.Clear(); + + foreach (var pcbText in this.automaticCalibration.AvailableCheckPcbs()) + { + var dropdownPcbId = new ToolStripMenuItem(pcbText); + dropdownPcbId.Click += this.BackwardsPcb_Click; + + menuItem.DropDownItems.Add(dropdownPcbId); + } + + if (menuItem.DropDownItems.Count <= 0) + { + MessageBox.Show($"No temperature checks available.{Environment.NewLine}Start backwards messurement for any results."); + } + } + } + + private void LoadPcbToolStripMenuItem_DropDownOpening(Object sender, EventArgs e) + { + if (sender is ToolStripMenuItem menuItem) + { + menuItem.DropDownItems.Clear(); + + foreach (var pcbText in this.automaticCalibration.AvailableAggregationPcbs()) + { + var dropdownPcbId = new ToolStripMenuItem(pcbText); + dropdownPcbId.Click += DropdownPcbId_Click; + + menuItem.DropDownItems.Add(dropdownPcbId); + } + } + } } } diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index 15e6b68b..148b076c 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,33 +123,6 @@ 104, 17 - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - 531, 17 @@ -180,6 +153,36 @@ 413, 17 + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 531, 17 + 191, 17 diff --git a/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs b/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs index 50920478..aafcb66c 100644 --- a/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs +++ b/LaaProductionWeb/LaaProduction.Personalization/AccountManager.cs @@ -154,13 +154,16 @@ private short GetOrCreateSoftwareId(string assembly, int major, int minor, int build) { + /// Gets the app id for provided assembly name var softwareId = this.softwareRepository.SoftwareId(assembly); + /// In case that the software dose not exists wird hinzugefügt. if (softwareId <= 0) { softwareId = this.softwareRepository.Insert(assembly, major, minor, build); } + /// softwareId = [VersionSoftwareAccess].[AppID] return softwareId; } From eadd0f047529a06bd7c4d25835092a76f4f92b2a Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 12 Oct 2023 11:52:05 +0200 Subject: [PATCH 08/56] Automatical stop for the temperature calibration waiting cursor on cordonel connecting --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 149 +++++++++++------- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 24 ++- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 51 +++--- .../Infrastructure/Appsettings.cs | 12 +- .../Infrastructure/TempMeterModels.cs | 22 ++- 5 files changed, 161 insertions(+), 97 deletions(-) diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index 67fc5d1b..2c464185 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,8 +31,6 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); @@ -41,6 +39,8 @@ namespace Xylem.Common.Ui.GenesisToolBox System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -110,6 +110,8 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); + this.messurementStopMs = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -408,7 +410,11 @@ namespace Xylem.Common.Ui.GenesisToolBox // automaticControlsPanel // this.automaticControlsPanel.BackColor = System.Drawing.SystemColors.Menu; + this.automaticControlsPanel.Controls.Add(this.messurementStopMs); + this.automaticControlsPanel.Controls.Add(this.label10); this.automaticControlsPanel.Controls.Add(this.backwardsStepMS); + this.automaticControlsPanel.Controls.Add(this.label2); + this.automaticControlsPanel.Controls.Add(this.messurementStepMS); this.automaticControlsPanel.Controls.Add(this.label8); this.automaticControlsPanel.Controls.Add(this.stopBackwardsBtn); this.automaticControlsPanel.Controls.Add(this.startBackwardBtn); @@ -417,8 +423,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticControlsPanel.Controls.Add(this.label3); this.automaticControlsPanel.Controls.Add(this.stopAutomaticBtn); this.automaticControlsPanel.Controls.Add(this.startAutomaticBtn); - this.automaticControlsPanel.Controls.Add(this.messurementStepMS); - this.automaticControlsPanel.Controls.Add(this.label2); this.automaticControlsPanel.Controls.Add(this.GMHPort); this.automaticControlsPanel.Controls.Add(this.label1); this.automaticControlsPanel.Dock = System.Windows.Forms.DockStyle.Left; @@ -434,7 +438,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.backwardsStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.backwardsStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.backwardsStepMS.Location = new System.Drawing.Point(5, 166); + this.backwardsStepMS.Location = new System.Drawing.Point(5, 190); this.backwardsStepMS.Margin = new System.Windows.Forms.Padding(0); this.backwardsStepMS.Name = "backwardsStepMS"; this.backwardsStepMS.Size = new System.Drawing.Size(318, 24); @@ -445,12 +449,12 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label8.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label8.Location = new System.Drawing.Point(5, 149); + this.label8.Location = new System.Drawing.Point(5, 167); this.label8.Margin = new System.Windows.Forms.Padding(5); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(318, 18); this.label8.TabIndex = 19; - this.label8.Text = "Backwards step (ms)"; + this.label8.Text = "Rückwärtsmessschritt in Millisekunden"; this.label8.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // stopBackwardsBtn @@ -458,7 +462,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.stopBackwardsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopBackwardsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 379); + this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 464); this.stopBackwardsBtn.Margin = new System.Windows.Forms.Padding(5); this.stopBackwardsBtn.Name = "stopBackwardsBtn"; this.stopBackwardsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -473,7 +477,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startBackwardBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startBackwardBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startBackwardBtn.Location = new System.Drawing.Point(5, 333); + this.startBackwardBtn.Location = new System.Drawing.Point(5, 418); this.startBackwardBtn.Margin = new System.Windows.Forms.Padding(5); this.startBackwardBtn.Name = "startBackwardBtn"; this.startBackwardBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -488,7 +492,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSettingsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.saveSettingsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.saveSettingsBtn.Location = new System.Drawing.Point(5, 195); + this.saveSettingsBtn.Location = new System.Drawing.Point(5, 280); this.saveSettingsBtn.Margin = new System.Windows.Forms.Padding(5); this.saveSettingsBtn.Name = "saveSettingsBtn"; this.saveSettingsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -504,7 +508,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.messurementDauerMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.messurementDauerMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementDauerMS.Location = new System.Drawing.Point(5, 120); + this.messurementDauerMS.Location = new System.Drawing.Point(5, 86); this.messurementDauerMS.Margin = new System.Windows.Forms.Padding(0); this.messurementDauerMS.Name = "messurementDauerMS"; this.messurementDauerMS.Size = new System.Drawing.Size(318, 24); @@ -515,12 +519,12 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label3.Location = new System.Drawing.Point(5, 103); + this.label3.Location = new System.Drawing.Point(5, 63); this.label3.Margin = new System.Windows.Forms.Padding(5); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(318, 18); this.label3.TabIndex = 14; - this.label3.Text = "Messurement dauer (ms)"; + this.label3.Text = "Messdauer in Millisekunden"; this.label3.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // stopAutomaticBtn @@ -528,7 +532,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.stopAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 287); + this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 372); this.stopAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.stopAutomaticBtn.Name = "stopAutomaticBtn"; this.stopAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -543,7 +547,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startAutomaticBtn.Location = new System.Drawing.Point(5, 241); + this.startAutomaticBtn.Location = new System.Drawing.Point(5, 326); this.startAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.startAutomaticBtn.Name = "startAutomaticBtn"; this.startAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -559,7 +563,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.messurementStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.messurementStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementStepMS.Location = new System.Drawing.Point(5, 74); + this.messurementStepMS.Location = new System.Drawing.Point(5, 138); this.messurementStepMS.Margin = new System.Windows.Forms.Padding(0); this.messurementStepMS.Name = "messurementStepMS"; this.messurementStepMS.Size = new System.Drawing.Size(318, 24); @@ -570,12 +574,12 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(5, 57); + this.label2.Location = new System.Drawing.Point(5, 115); this.label2.Margin = new System.Windows.Forms.Padding(5); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(318, 18); this.label2.TabIndex = 2; - this.label2.Text = "Messurement step (ms)"; + this.label2.Text = "Messschritt in Millisekunden"; this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // GMHPort @@ -584,11 +588,11 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.GMHPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.GMHPort.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.GMHPort.Location = new System.Drawing.Point(5, 27); + this.GMHPort.Location = new System.Drawing.Point(5, 33); this.GMHPort.Margin = new System.Windows.Forms.Padding(0); this.GMHPort.MinimumSize = new System.Drawing.Size(2, 25); this.GMHPort.Name = "GMHPort"; - this.GMHPort.Size = new System.Drawing.Size(318, 24); + this.GMHPort.Size = new System.Drawing.Size(318, 25); this.GMHPort.TabIndex = 1; // // label1 @@ -601,7 +605,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(318, 18); this.label1.TabIndex = 0; - this.label1.Text = "Messgerät (COM port)"; + this.label1.Text = "COM-Port des Temperaturmessgeräts eingeben"; this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // temperatureChecksTab @@ -620,14 +624,14 @@ namespace Xylem.Common.Ui.GenesisToolBox // this.temperatureChecksGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.temperatureChecksGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle39.BackColor = System.Drawing.SystemColors.ButtonFace; - dataGridViewCellStyle39.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle39.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle39.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle39.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle39; + dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle31.BackColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle31.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle31.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle31.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle31; this.temperatureChecksGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.TemperatureCheck_Pcb, this.TemperatureCheck_PrevC, @@ -638,14 +642,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.TemperatureCheck_PrevTOF, this.TemperatureCheck_CurrentTOF, this.TemperatureCheck_NextTOF}); - dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle40.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle40.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle40.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle40.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle40.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle40.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle40; + dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle32; this.temperatureChecksGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.temperatureChecksGridView.Location = new System.Drawing.Point(0, 24); this.temperatureChecksGridView.Name = "temperatureChecksGridView"; @@ -749,14 +753,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle31.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle31.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle31.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle31.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle31; + dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle33.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle33.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle33.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle33.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle33.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle33; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, @@ -777,8 +781,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // PcbId // this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.PcbId.DefaultCellStyle = dataGridViewCellStyle32; + dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.PcbId.DefaultCellStyle = dataGridViewCellStyle34; this.PcbId.HeaderText = "PcbId"; this.PcbId.Name = "PcbId"; this.PcbId.ReadOnly = true; @@ -786,8 +790,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_Nr // this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle33; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle35; this.Avg_Nr.HeaderText = "Nr"; this.Avg_Nr.Name = "Avg_Nr"; this.Avg_Nr.ReadOnly = true; @@ -795,8 +799,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_T // this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_T.DefaultCellStyle = dataGridViewCellStyle34; + dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_T.DefaultCellStyle = dataGridViewCellStyle36; this.Avg_T.HeaderText = "Avg °C"; this.Avg_T.Name = "Avg_T"; this.Avg_T.ReadOnly = true; @@ -804,8 +808,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_TOF // this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle35; + dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle37; this.Avg_TOF.HeaderText = "Avg TOF"; this.Avg_TOF.Name = "Avg_TOF"; this.Avg_TOF.ReadOnly = true; @@ -813,16 +817,16 @@ namespace Xylem.Common.Ui.GenesisToolBox // diffT // this.diffT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffT.DefaultCellStyle = dataGridViewCellStyle36; + dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffT.DefaultCellStyle = dataGridViewCellStyle38; this.diffT.HeaderText = "°C max - min"; this.diffT.Name = "diffT"; // // diffTOF // this.diffTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffTOF.DefaultCellStyle = dataGridViewCellStyle37; + dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffTOF.DefaultCellStyle = dataGridViewCellStyle39; this.diffTOF.HeaderText = "TOF max - min"; this.diffTOF.Name = "diffTOF"; this.diffTOF.ReadOnly = true; @@ -830,8 +834,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // seconds // this.seconds.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.seconds.DefaultCellStyle = dataGridViewCellStyle38; + dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.seconds.DefaultCellStyle = dataGridViewCellStyle40; this.seconds.HeaderText = "Seconds"; this.seconds.Name = "seconds"; this.seconds.ReadOnly = true; @@ -894,6 +898,31 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // + // messurementStopMs + // + this.messurementStopMs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.messurementStopMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.messurementStopMs.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.messurementStopMs.Location = new System.Drawing.Point(5, 242); + this.messurementStopMs.Margin = new System.Windows.Forms.Padding(0); + this.messurementStopMs.Name = "messurementStopMs"; + this.messurementStopMs.Size = new System.Drawing.Size(318, 24); + this.messurementStopMs.TabIndex = 22; + // + // label10 + // + this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label10.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label10.Location = new System.Drawing.Point(5, 219); + this.label10.Margin = new System.Windows.Forms.Padding(5); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(318, 18); + this.label10.TabIndex = 21; + this.label10.Text = "Messungsende in Stunden"; + this.label10.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // // FrmTempMeter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1000,5 +1029,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.DataGridViewTextBoxColumn diffTOF; private System.Windows.Forms.DataGridViewTextBoxColumn seconds; private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; + private System.Windows.Forms.TextBox messurementStopMs; + private System.Windows.Forms.Label label10; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index dd0d112b..15546b80 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -69,6 +69,8 @@ private void Connect() { + this.BeginInvoke(new Action(() => Cursor.Current = Cursors.WaitCursor)); + try { if (!int.TryParse($"{this.slotsList.SelectedItem}", out var slotNr)) @@ -105,12 +107,10 @@ return; } - var a = GetLutsText(currentGenesis.PcbId); currentGenesis.InitMeasurement(); Invoke(new Action(() => { - txtLuts.Text = a; if (lutIsMissing) { @@ -124,6 +124,7 @@ this.pcbidTextBox.Text = currentGenesis.PcbId; this.SetEnabled(ProgrammState.Connected); + this.BeginInvoke(new Action(() => Cursor.Current = Cursors.Default)); })); }); } @@ -648,9 +649,10 @@ this.automaticCalibrationTabControl.GotFocus += (Object sender, EventArgs e) => { this.GMHPort.Text = Appsettings.GMHPort.ToString(); - this.messurementStepMS.Text = Appsettings.MessurementStep.ToString(); - this.messurementDauerMS.Text = Appsettings.MessurementDauer.ToString(); - this.backwardsStepMS.Text = Appsettings.BackwardsStepMS.ToString(); + this.messurementStepMS.Text = Appsettings.MessurementStepMs.ToString(); + this.messurementDauerMS.Text = Appsettings.MessurementDauerMs.ToString(); + this.backwardsStepMS.Text = Appsettings.BackwardsStepMs.ToString(); + this.messurementStopMs.Text = Appsettings.MessurementStopHours.ToString(); }; this.SetEnabled(ProgrammState.Start); @@ -853,20 +855,26 @@ if (int.TryParse($"{this.messurementStepMS.Text}", out int msStep)) { - Appsettings.MessurementStep = msStep; + Appsettings.MessurementStepMs = msStep; } if (int.TryParse($"{this.messurementDauerMS.Text}", out int msDauer)) { - Appsettings.MessurementDauer = msDauer; + Appsettings.MessurementDauerMs = msDauer; } if (int.TryParse($"{this.backwardsStepMS.Text}", out int bwStep)) { - Appsettings.BackwardsStepMS = bwStep; + Appsettings.BackwardsStepMs = bwStep; + } + + if (int.TryParse($"{this.messurementStopMs.Text}", out int msStop)) + { + Appsettings.MessurementStopHours = msStop; } Appsettings.SaveSettings(); + MessageBox.Show("Die Einstellungen wurden erfolgreich gespeichert."); } private Messurement[] aggregations; diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index 148b076c..d67f5424 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -126,30 +126,6 @@ 531, 17 - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - 413, 17 @@ -183,6 +159,33 @@ 531, 17 + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 413, 17 + 191, 17 diff --git a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs index 7fb6192c..56228faa 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs @@ -21,19 +21,25 @@ set => SetValue(value); } - public static int MessurementStep + public static int MessurementStepMs { get => GetInt32(); set => SetValue(value); } - public static int MessurementDauer + public static int MessurementDauerMs { get => GetInt32(); set => SetValue(value); } - public static int BackwardsStepMS + public static int BackwardsStepMs + { + get => GetInt32(); + set => SetValue(value); + } + + public static int MessurementStopHours { get => GetInt32(); set => SetValue(value); diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index fd433281..f31dfed7 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -101,6 +101,7 @@ private TemperatureSource temperatureSource; private Timer longTimer; private Timer shortTimer; + private Timer stopTimer; private bool messuring; public AutomaticTemperatureCalibration(string pcbId, ITempMeterForm genesisMeter) @@ -125,7 +126,7 @@ this.messuring = false; this.temperatureSource = new TemperatureSource(); - this.shortTimer = new Timer(Appsettings.MessurementStep) + this.shortTimer = new Timer(Appsettings.MessurementStepMs) { Enabled = true, AutoReset = true @@ -133,7 +134,7 @@ this.shortTimer.Elapsed += this.ShortTimerElapsed; this.shortTimer.Stop(); - this.longTimer = new Timer(Appsettings.MessurementDauer) + this.longTimer = new Timer(Appsettings.MessurementDauerMs) { Enabled = true, AutoReset = true @@ -142,6 +143,17 @@ this.LongTimerElapsed(null, null); this.longTimer.Start(); + if (Appsettings.MessurementStopHours > 0) + { + this.stopTimer = new Timer(Appsettings.MessurementStopHours * 24 * 60 * 60 * 1000) + { + Enabled = true, + AutoReset = true + }; + this.stopTimer.Elapsed += (sender, args) => this.StopMessuring(); + this.stopTimer.Start(); + } + File.AppendAllText(this.aggregationsFile, Environment.NewLine); } @@ -155,6 +167,10 @@ this.longTimer?.Dispose(); this.longTimer = null; + this.stopTimer?.Stop(); + this.stopTimer?.Dispose(); + this.stopTimer = null; + this.temperatureSource?.Dispose(); this.temperatureSource = null; } @@ -514,7 +530,7 @@ internal void StartBackward() { this.temperatureSource = new TemperatureSource(); - this.shortTimer = new Timer(Appsettings.BackwardsStepMS) + this.shortTimer = new Timer(Appsettings.BackwardsStepMs) { Enabled = true, AutoReset = true From 4cce4e6a0c9d4fa997b1e8a1f4afa760a1d926d8 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 12 Oct 2023 12:42:03 +0200 Subject: [PATCH 09/56] extension method for parsing doubles --- .../Ui/GenesisToolBox/GenesisToolBox.csproj | 1 + .../Infrastructure/ParseExtensions.cs | 27 +++++++++++++++++++ .../Infrastructure/TempMeterModels.cs | 23 +++++++--------- 3 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 Common/Ui/GenesisToolBox/Infrastructure/ParseExtensions.cs diff --git a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj index f8786c75..04b57624 100644 --- a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj +++ b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj @@ -430,6 +430,7 @@ + diff --git a/Common/Ui/GenesisToolBox/Infrastructure/ParseExtensions.cs b/Common/Ui/GenesisToolBox/Infrastructure/ParseExtensions.cs new file mode 100644 index 00000000..1ed6175c --- /dev/null +++ b/Common/Ui/GenesisToolBox/Infrastructure/ParseExtensions.cs @@ -0,0 +1,27 @@ +namespace Xylem.Common.Ui.GenesisToolBox.Infrastructure +{ + using System.Globalization; + using System.Threading; + + internal static class ParseExtensions + { + private static readonly NumberStyles any = NumberStyles.Any; + private static readonly CultureInfo de = new CultureInfo("de-DE"); + private static readonly CultureInfo us = new CultureInfo("en-US"); + private static bool IsDECulture => Thread.CurrentThread.CurrentCulture.Name.ToLower().Contains("de"); + + internal static bool TryParse(this string stringValue, out double value) + { + if (IsDECulture) + { + return double.TryParse(stringValue, any, de, out value) + || double.TryParse(stringValue, any, us, out value); + } + else + { + return double.TryParse(stringValue, any, us, out value) + || double.TryParse(stringValue, any, de, out value); + } + } + } +} diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index f31dfed7..43f31c0a 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -88,15 +88,12 @@ private const string MESSUREMENTS_FILE = @"_messurements.txt"; private const string AGGREGATIONS_FILE = @"_aggregations.txt"; private const string BACKWARDS_FILE = @"_backwards.txt"; - private const NumberStyles ANY = NumberStyles.Any; private readonly string pcbId; private readonly string messurementsFile; private readonly string aggregationsFile; private readonly string backwardsFile; private readonly ITempMeterForm tempMeterForm; - private readonly CultureInfo en; - private readonly CultureInfo de; private TemperatureSource temperatureSource; private Timer longTimer; @@ -117,8 +114,6 @@ } this.temperatureSource = new TemperatureSource(); - this.en = new CultureInfo("en-US"); - this.de = new CultureInfo("de-DE"); } public void StartMessuring() @@ -266,8 +261,8 @@ try { - var tParsed = double.TryParse(tString, ANY, this.en, out currentT) || double.TryParse(tString, ANY, this.de, out currentT); - var tofParsed = double.TryParse(tofString, ANY, this.en, out currentTOF) || double.TryParse(tofString, ANY, this.de, out currentTOF); + var tParsed = tString.TryParse(out currentT); + var tofParsed = tofString.TryParse(out currentTOF); if (!tParsed || !tofParsed) { @@ -336,11 +331,11 @@ var seconds = default(int); var pcbParsed = int.TryParse(pcbString, out pcbId); - var tParsed = double.TryParse(avgTString, ANY, this.en, out avgT) || double.TryParse(avgTString, ANY, this.de, out avgT); - var dtParsed = double.TryParse(difTString, ANY, this.en, out difT) || double.TryParse(difTString, ANY, this.de, out difT); - var secParsed = int.TryParse(secondsString, ANY, this.en, out seconds) || int.TryParse(secondsString, ANY, this.de, out seconds); - var tofParsed = double.TryParse(avgTOFString, ANY, this.en, out avgTOF) || double.TryParse(avgTOFString, ANY, this.de, out avgTOF); - var dtofParsed = double.TryParse(difTOFString, ANY, this.en, out difTOF) || double.TryParse(difTOFString, ANY, this.de, out difTOF); + var tParsed = avgTString.TryParse(out avgT); + var dtParsed = difTString.TryParse(out difT); + var secParsed = int.TryParse(secondsString, out seconds) || int.TryParse(secondsString, out seconds); + var tofParsed = avgTOFString.TryParse(out avgTOF); + var dtofParsed = difTOFString.TryParse(out difTOF); if (!pcbParsed || !tParsed || !tofParsed || !dtParsed || !dtofParsed) { @@ -611,8 +606,8 @@ var avgTOF = default(double); var pcbParsed = int.TryParse(pcbString, out pcbId); - var tParsed = double.TryParse(avgTString, ANY, this.en, out avgT) || double.TryParse(avgTString, ANY, this.de, out avgT); - var tofParsed = double.TryParse(avgTOFString, ANY, this.en, out avgTOF) || double.TryParse(avgTOFString, ANY, this.de, out avgTOF); + var tParsed = avgTString.TryParse(out avgT); + var tofParsed = avgTOFString.TryParse(out avgTOF); if (!pcbParsed || !tParsed || !tofParsed) { From f88124096b85cc27bf49f06e84b2e7f426340f18 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 12 Oct 2023 15:50:03 +0200 Subject: [PATCH 10/56] omni changes --- .../Connection/Contracts/IConnection.cs | 6 ++- Common/OmniPlus/Connection/Contracts/IData.cs | 7 --- .../Connection/Contracts/IPortSettings.cs | 4 +- .../OmniPlus/Connection/Contracts/IRequest.cs | 7 +++ .../{IDataSettings.cs => IResponse.cs} | 4 +- .../Connection/{ => Enums}/BaudRate.cs | 2 +- .../Connection/{ => Enums}/DataBits.cs | 2 +- .../Connection/{ => Enums}/SPState.cs | 2 +- .../EventHandlers/ReadEventHandler.cs | 6 +++ .../{ => EventHandlers}/StateEventHandler.cs | 4 +- .../OmniPlus/Connection/ReadEventHandler.cs | 6 --- Common/OmniPlus/Connection/SPConnection.cs | 38 +++++++++------- Common/OmniPlus/Connection/SPRequest.cs | 9 ++++ .../SPResponse.cs} | 31 +++++++------ Common/OmniPlus/Contracts/IOmniConnection.cs | 5 ++- Common/OmniPlus/Contracts/IOmniRegister.cs | 9 ++++ Common/OmniPlus/Contracts/IOmniRequest.cs | 8 ++++ Common/OmniPlus/Contracts/IOmniResponse.cs | 8 ++++ Common/OmniPlus/OmniConnection.cs | 25 ++++------- Common/OmniPlus/OmniPlus.csproj | 23 ++++++---- Common/OmniPlus/OmniPortSettings.cs | 4 +- Common/OmniPlus/OmniRegister.cs | 37 +++++++++++----- Common/OmniPlus/OmniRequest.cs | 13 ++++++ Common/OmniPlus/OmniResponse.cs | 12 +++++ Common/OmniPlus/OmniTemplates.cs | 15 +++++++ Common/OmniPlus/Program.cs | 44 +++++++++---------- 26 files changed, 215 insertions(+), 116 deletions(-) delete mode 100644 Common/OmniPlus/Connection/Contracts/IData.cs create mode 100644 Common/OmniPlus/Connection/Contracts/IRequest.cs rename Common/OmniPlus/Connection/Contracts/{IDataSettings.cs => IResponse.cs} (65%) rename Common/OmniPlus/Connection/{ => Enums}/BaudRate.cs (91%) rename Common/OmniPlus/Connection/{ => Enums}/DataBits.cs (73%) rename Common/OmniPlus/Connection/{ => Enums}/SPState.cs (76%) create mode 100644 Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs rename Common/OmniPlus/Connection/{ => EventHandlers}/StateEventHandler.cs (50%) delete mode 100644 Common/OmniPlus/Connection/ReadEventHandler.cs create mode 100644 Common/OmniPlus/Connection/SPRequest.cs rename Common/OmniPlus/{OmniDataSettings.cs => Connection/SPResponse.cs} (69%) create mode 100644 Common/OmniPlus/Contracts/IOmniRegister.cs create mode 100644 Common/OmniPlus/Contracts/IOmniRequest.cs create mode 100644 Common/OmniPlus/Contracts/IOmniResponse.cs create mode 100644 Common/OmniPlus/OmniRequest.cs create mode 100644 Common/OmniPlus/OmniResponse.cs create mode 100644 Common/OmniPlus/OmniTemplates.cs diff --git a/Common/OmniPlus/Connection/Contracts/IConnection.cs b/Common/OmniPlus/Connection/Contracts/IConnection.cs index fd28a644..67938c6a 100644 --- a/Common/OmniPlus/Connection/Contracts/IConnection.cs +++ b/Common/OmniPlus/Connection/Contracts/IConnection.cs @@ -1,4 +1,6 @@ -using System; +using OmniPlus.Connection.EventHandlers; + +using System; namespace OmniPlus.Connection.Contracts { @@ -9,6 +11,6 @@ namespace OmniPlus.Connection.Contracts void OpenConnection(); - void Write(byte[] data); + void Send(IRequest request); } } diff --git a/Common/OmniPlus/Connection/Contracts/IData.cs b/Common/OmniPlus/Connection/Contracts/IData.cs deleted file mode 100644 index fa0c7c60..00000000 --- a/Common/OmniPlus/Connection/Contracts/IData.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Connection.Contracts -{ - internal interface IData - { - byte[] Data { get; } - } -} diff --git a/Common/OmniPlus/Connection/Contracts/IPortSettings.cs b/Common/OmniPlus/Connection/Contracts/IPortSettings.cs index 04e58abc..77e5e597 100644 --- a/Common/OmniPlus/Connection/Contracts/IPortSettings.cs +++ b/Common/OmniPlus/Connection/Contracts/IPortSettings.cs @@ -1,4 +1,6 @@ -using System.IO.Ports; +using OmniPlus.Connection.Enums; + +using System.IO.Ports; namespace OmniPlus.Connection.Contracts { diff --git a/Common/OmniPlus/Connection/Contracts/IRequest.cs b/Common/OmniPlus/Connection/Contracts/IRequest.cs new file mode 100644 index 00000000..3f815634 --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/IRequest.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Connection.Contracts +{ + internal interface IRequest + { + byte[] ToByteArray(); + } +} diff --git a/Common/OmniPlus/Connection/Contracts/IDataSettings.cs b/Common/OmniPlus/Connection/Contracts/IResponse.cs similarity index 65% rename from Common/OmniPlus/Connection/Contracts/IDataSettings.cs rename to Common/OmniPlus/Connection/Contracts/IResponse.cs index 93682370..4675d2fb 100644 --- a/Common/OmniPlus/Connection/Contracts/IDataSettings.cs +++ b/Common/OmniPlus/Connection/Contracts/IResponse.cs @@ -1,7 +1,9 @@ namespace OmniPlus.Connection.Contracts { - internal interface IDataSettings : IData + internal interface IResponse { + byte[] Bytes { get; } + bool ReadByte(byte data); void StartReading(); diff --git a/Common/OmniPlus/Connection/BaudRate.cs b/Common/OmniPlus/Connection/Enums/BaudRate.cs similarity index 91% rename from Common/OmniPlus/Connection/BaudRate.cs rename to Common/OmniPlus/Connection/Enums/BaudRate.cs index d086aa1b..ba08b870 100644 --- a/Common/OmniPlus/Connection/BaudRate.cs +++ b/Common/OmniPlus/Connection/Enums/BaudRate.cs @@ -1,4 +1,4 @@ -namespace OmniPlus.Connection +namespace OmniPlus.Connection.Enums { public enum BaudRate : int { diff --git a/Common/OmniPlus/Connection/DataBits.cs b/Common/OmniPlus/Connection/Enums/DataBits.cs similarity index 73% rename from Common/OmniPlus/Connection/DataBits.cs rename to Common/OmniPlus/Connection/Enums/DataBits.cs index c2a6c882..87695750 100644 --- a/Common/OmniPlus/Connection/DataBits.cs +++ b/Common/OmniPlus/Connection/Enums/DataBits.cs @@ -1,4 +1,4 @@ -namespace OmniPlus.Connection +namespace OmniPlus.Connection.Enums { public enum DataBits : int { diff --git a/Common/OmniPlus/Connection/SPState.cs b/Common/OmniPlus/Connection/Enums/SPState.cs similarity index 76% rename from Common/OmniPlus/Connection/SPState.cs rename to Common/OmniPlus/Connection/Enums/SPState.cs index 04230c11..5d7be238 100644 --- a/Common/OmniPlus/Connection/SPState.cs +++ b/Common/OmniPlus/Connection/Enums/SPState.cs @@ -1,4 +1,4 @@ -namespace OmniPlus.Connection +namespace OmniPlus.Connection.Enums { internal enum SPState { diff --git a/Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs b/Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs new file mode 100644 index 00000000..f711b113 --- /dev/null +++ b/Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs @@ -0,0 +1,6 @@ +using OmniPlus.Connection.Contracts; + +namespace OmniPlus.Connection.EventHandlers +{ + internal delegate void ReadEventHandler(IResponse data); +} diff --git a/Common/OmniPlus/Connection/StateEventHandler.cs b/Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs similarity index 50% rename from Common/OmniPlus/Connection/StateEventHandler.cs rename to Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs index e0b80486..585a0cab 100644 --- a/Common/OmniPlus/Connection/StateEventHandler.cs +++ b/Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs @@ -1,4 +1,6 @@ -namespace OmniPlus.Connection +using OmniPlus.Connection.Enums; + +namespace OmniPlus.Connection.EventHandlers { internal delegate void StateEventHandler(SPState state, string message); } diff --git a/Common/OmniPlus/Connection/ReadEventHandler.cs b/Common/OmniPlus/Connection/ReadEventHandler.cs deleted file mode 100644 index 7b95a7bf..00000000 --- a/Common/OmniPlus/Connection/ReadEventHandler.cs +++ /dev/null @@ -1,6 +0,0 @@ -using OmniPlus.Connection.Contracts; - -namespace OmniPlus.Connection -{ - internal delegate void ReadEventHandler(IData data); -} diff --git a/Common/OmniPlus/Connection/SPConnection.cs b/Common/OmniPlus/Connection/SPConnection.cs index 26563176..281688c3 100644 --- a/Common/OmniPlus/Connection/SPConnection.cs +++ b/Common/OmniPlus/Connection/SPConnection.cs @@ -1,4 +1,6 @@ using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.Enums; +using OmniPlus.Connection.EventHandlers; using System; using System.Collections.Concurrent; @@ -10,18 +12,18 @@ namespace OmniPlus.Connection { private readonly string portName; private readonly IPortSettings portSettings; - private readonly IDataSettings dataSettings; + private readonly IResponse response; private event Action bytesReceived; private ConcurrentQueue data; private SerialPort serialPort; private bool parsingData; - public SPConnection(string portName, IPortSettings portSettings, IDataSettings dataSettings) + public SPConnection(string portName, IPortSettings portSettings, IResponse dataSettings) { this.portName = portName; this.portSettings = portSettings; - this.dataSettings = dataSettings; + this.response = dataSettings; this.bytesReceived += SPConnection_BytesReceived; } @@ -44,17 +46,6 @@ namespace OmniPlus.Connection this.CloseConnection(); } - public void Write(byte[] data) - { - if (data?.Length > 0 && this.serialPort.IsOpen) - { - lock (this.serialPort) - { - this.serialPort.Write(data, 0, data.Length); - } - } - } - public void OpenConnection() { this.CloseConnection(); @@ -101,6 +92,19 @@ namespace OmniPlus.Connection } } + public void Send(IRequest request) + { + var data = request.ToByteArray(); + + if (data?.Length > 0 && this.serialPort.IsOpen) + { + lock (this.serialPort) + { + this.serialPort.Write(data, 0, data.Length); + } + } + } + private void CloseConnection() { if (this.serialPort != null) @@ -123,14 +127,14 @@ namespace OmniPlus.Connection { this.parsingData = true; - this.dataSettings.StartReading(); + this.response.StartReading(); while (this.parsingData) { - this.parsingData = this.data.TryDequeue(out byte current) && this.dataSettings.ReadByte(current); + this.parsingData = this.data.TryDequeue(out byte current) && this.response.ReadByte(current); } - this.DataReceived?.Invoke(this.dataSettings); + this.DataReceived?.Invoke(this.response); } private void SerialPort_DataReceived(Object sender, SerialDataReceivedEventArgs args) diff --git a/Common/OmniPlus/Connection/SPRequest.cs b/Common/OmniPlus/Connection/SPRequest.cs new file mode 100644 index 00000000..8b7a88d0 --- /dev/null +++ b/Common/OmniPlus/Connection/SPRequest.cs @@ -0,0 +1,9 @@ +using OmniPlus.Connection.Contracts; + +namespace OmniPlus.Connection +{ + internal abstract class SPRequest : IRequest + { + public abstract byte[] ToByteArray(); + } +} diff --git a/Common/OmniPlus/OmniDataSettings.cs b/Common/OmniPlus/Connection/SPResponse.cs similarity index 69% rename from Common/OmniPlus/OmniDataSettings.cs rename to Common/OmniPlus/Connection/SPResponse.cs index c96a5ca0..48e9550b 100644 --- a/Common/OmniPlus/OmniDataSettings.cs +++ b/Common/OmniPlus/Connection/SPResponse.cs @@ -1,22 +1,24 @@ using OmniPlus.Connection.Contracts; -namespace OmniPlus +namespace OmniPlus.Connection { - class OmniDataSettings : IDataSettings + internal abstract class SPResponse : IResponse { private readonly byte[][] template; - private byte[][] messageTemplate; - private byte[] messageContent; + private readonly byte[][] messageTemplate; private int rowLength; private int row; private int col; private bool ok; private bool reading; - public OmniDataSettings(byte[][] template) - => this.template = template; + public SPResponse(byte[][] template) + { + this.template = template; + this.messageTemplate = template; + } - public byte[] Data => this.messageContent; + public byte[] Bytes { get; private set; } public bool ReadByte(byte data) { @@ -30,7 +32,7 @@ namespace OmniPlus if (this.ok) { - this.messageContent[this.col] = data; + this.Bytes[this.col] = data; } } @@ -41,12 +43,12 @@ namespace OmniPlus { this.template.CopyTo(this.messageTemplate, 0); - this.messageContent = new byte[8]; + this.Bytes = new byte[8]; this.row = 0; this.rowLength = this.messageTemplate[this.row][0]; this.col = -1; this.reading = false; - this.ok = this.rowLength > 0 && this.col < this.messageContent.Length; + this.ok = this.rowLength > 0 && this.col < this.Bytes.Length; } private bool PrepareReading() @@ -65,6 +67,7 @@ namespace OmniPlus return false; } + var bytesLength = this.Bytes.Length; var nextLength = this.messageTemplate[this.row][0]; if (nextLength == 0) @@ -76,16 +79,16 @@ namespace OmniPlus this.messageTemplate[i][1] += nextLength; } - var messageContent = new byte[this.messageContent.Length + nextLength]; + var messageContent = new byte[bytesLength + nextLength]; - this.messageContent.CopyTo(messageContent, 0); + this.Bytes.CopyTo(messageContent, 0); - this.messageContent = messageContent; + this.Bytes = messageContent; } this.rowLength += nextLength; - return this.row < this.messageTemplate.Length && this.col < this.messageContent.Length; + return this.row < this.messageTemplate.Length && this.col < bytesLength; } } } diff --git a/Common/OmniPlus/Contracts/IOmniConnection.cs b/Common/OmniPlus/Contracts/IOmniConnection.cs index 8810ca66..24b3aec2 100644 --- a/Common/OmniPlus/Contracts/IOmniConnection.cs +++ b/Common/OmniPlus/Contracts/IOmniConnection.cs @@ -1,4 +1,5 @@ -using OmniPlus.Connection; +using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.EventHandlers; using System; @@ -12,6 +13,6 @@ namespace OmniPlus.Contracts void OpenConnection(); - byte[] Send(byte[] request); + IResponse Send(IRequest request); } } diff --git a/Common/OmniPlus/Contracts/IOmniRegister.cs b/Common/OmniPlus/Contracts/IOmniRegister.cs new file mode 100644 index 00000000..860df87d --- /dev/null +++ b/Common/OmniPlus/Contracts/IOmniRegister.cs @@ -0,0 +1,9 @@ +using System; + +namespace OmniPlus.Contracts +{ + public interface IOmniRegister : IDisposable + { + + } +} diff --git a/Common/OmniPlus/Contracts/IOmniRequest.cs b/Common/OmniPlus/Contracts/IOmniRequest.cs new file mode 100644 index 00000000..ce8b4014 --- /dev/null +++ b/Common/OmniPlus/Contracts/IOmniRequest.cs @@ -0,0 +1,8 @@ +using OmniPlus.Connection.Contracts; + +namespace OmniPlus.Contracts +{ + internal interface IOmniRequest : IRequest + { + } +} diff --git a/Common/OmniPlus/Contracts/IOmniResponse.cs b/Common/OmniPlus/Contracts/IOmniResponse.cs new file mode 100644 index 00000000..5d65e1f4 --- /dev/null +++ b/Common/OmniPlus/Contracts/IOmniResponse.cs @@ -0,0 +1,8 @@ +using OmniPlus.Connection.Contracts; + +namespace OmniPlus.Contracts +{ + internal interface IOmniResponse : IResponse + { + } +} diff --git a/Common/OmniPlus/OmniConnection.cs b/Common/OmniPlus/OmniConnection.cs index 75e646fc..7405e68f 100644 --- a/Common/OmniPlus/OmniConnection.cs +++ b/Common/OmniPlus/OmniConnection.cs @@ -1,8 +1,8 @@ using OmniPlus.Connection; using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.EventHandlers; using OmniPlus.Contracts; -using System; using System.Threading; namespace OmniPlus @@ -13,7 +13,7 @@ namespace OmniPlus private readonly int timeoutSeconds; private readonly int sleeMilliseconds; - private byte[] data; + private IResponse response; private bool waiting; public OmniConnection(string portName, int timeoutSeconds = 3000, int sleeMilliseconds = 300) @@ -21,16 +21,7 @@ namespace OmniPlus this.connection = new SPConnection( portName: portName, portSettings: new OmniPortSettings(), - dataSettings: new OmniDataSettings(new byte[][] - { - // length, length index - new byte[] { 1, 0 }, // Start byte - new byte[] { 3, 0 }, // Control bytes - new byte[] { 1, 0 }, // Data length byte - new byte[] { 0, 4 }, // Data bytes - new byte[] { 1, 0 }, // Alignment byte - new byte[] { 2, 0 } // CRC 16 bytes - })); + dataSettings: new OmniResponse()); this.timeoutSeconds = timeoutSeconds; this.sleeMilliseconds = sleeMilliseconds; } @@ -50,13 +41,13 @@ namespace OmniPlus public void OpenConnection() => this.connection.OpenConnection(); - public byte[] Send(byte[] request) + public IResponse Send(IRequest request) { this.waiting = true; this.connection.DataReceived += this.Connection_DataReceived; - this.connection.Write(request); + this.connection.Send(request); var timeoutSeconds = this.timeoutSeconds; @@ -69,13 +60,13 @@ namespace OmniPlus this.connection.DataReceived -= this.Connection_DataReceived; - return this.data ?? Array.Empty(); + return this.response ?? default(IResponse); } - private void Connection_DataReceived(IData data) + private void Connection_DataReceived(IResponse response) { + this.response = response; this.waiting = false; - this.data = data.Data; } } } diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj index b2ccdff3..78b9d108 100644 --- a/Common/OmniPlus/OmniPlus.csproj +++ b/Common/OmniPlus/OmniPlus.csproj @@ -44,25 +44,32 @@ - - + + - + - + + + - - - + + + + + + + + - + diff --git a/Common/OmniPlus/OmniPortSettings.cs b/Common/OmniPlus/OmniPortSettings.cs index 5c0dadf6..ce542c6e 100644 --- a/Common/OmniPlus/OmniPortSettings.cs +++ b/Common/OmniPlus/OmniPortSettings.cs @@ -1,5 +1,5 @@ -using OmniPlus.Connection; -using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.Enums; using System.IO.Ports; diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs index aefe0b31..e13dff8b 100644 --- a/Common/OmniPlus/OmniRegister.cs +++ b/Common/OmniPlus/OmniRegister.cs @@ -1,38 +1,53 @@ -using OmniPlus.Connection; +using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.Enums; using OmniPlus.Contracts; using System; +using System.Collections.Generic; +using System.IO; namespace OmniPlus { - public class OmniRegister + public class OmniRegister : IOmniRegister { + private readonly string loggingFile; private readonly IOmniConnection omniConnection; + private readonly ICollection requests; private bool connectionAvailable; public OmniRegister(string portName) { + this.loggingFile = this.GetOrCreateLoggingFile(portName); + this.requests = new List(); this.omniConnection = new OmniConnection(portName); - this.omniConnection.StateChanged += OmniConnection_StateChanged; - this.omniConnection.OpenConnection(); + this.omniConnection.StateChanged += this.OmniConnection_StateChanged; } - public bool EnsureRegisterInitialized() + public void Dispose() { - return true; + this.omniConnection.StateChanged -= this.OmniConnection_StateChanged; + + this.omniConnection.Dispose(); } - public bool EnsureRegisterSealed() + private string GetOrCreateLoggingFile(string portName) { - return true; + var directory = Directory.CreateDirectory(portName); + var fileName = $"{DateTime.Now:yyyy_MM_dd}.log"; + var loggingFile = Path.Combine(directory.FullName, fileName); + + if (!File.Exists(loggingFile)) + { + File.WriteAllText(loggingFile, string.Empty); + } + + return loggingFile; } private void OmniConnection_StateChanged(SPState state, string message) { - // TODO: handle, log - changes - - Console.WriteLine($"[{state}] {message}"); + File.AppendAllText(this.loggingFile, $"[{DateTime.Now:hh:mm:ss}][{state}] {message}{Environment.NewLine}"); this.connectionAvailable = state == SPState.Opened; } diff --git a/Common/OmniPlus/OmniRequest.cs b/Common/OmniPlus/OmniRequest.cs new file mode 100644 index 00000000..543cf425 --- /dev/null +++ b/Common/OmniPlus/OmniRequest.cs @@ -0,0 +1,13 @@ +using OmniPlus.Connection; +using OmniPlus.Contracts; + +namespace OmniPlus +{ + internal class OmniRequest : SPRequest, IOmniRequest + { + public override System.Byte[] ToByteArray() + { + throw new System.NotImplementedException(); + } + } +} diff --git a/Common/OmniPlus/OmniResponse.cs b/Common/OmniPlus/OmniResponse.cs new file mode 100644 index 00000000..24455e85 --- /dev/null +++ b/Common/OmniPlus/OmniResponse.cs @@ -0,0 +1,12 @@ +using OmniPlus.Connection; +using OmniPlus.Contracts; + +namespace OmniPlus +{ + internal class OmniResponse : SPResponse, IOmniResponse + { + public OmniResponse() : base(OmniTemplates.IrdaResponse) + { + } + } +} diff --git a/Common/OmniPlus/OmniTemplates.cs b/Common/OmniPlus/OmniTemplates.cs new file mode 100644 index 00000000..3cb0a007 --- /dev/null +++ b/Common/OmniPlus/OmniTemplates.cs @@ -0,0 +1,15 @@ +namespace OmniPlus +{ + internal class OmniTemplates + { + public static byte[][] IrdaResponse => new byte[][] + { + new byte[] { 1, 0x9B }, // Start byte + new byte[] { 3, 0x00 }, // Control bytes + new byte[] { 1, 0x00 }, // Data length byte + new byte[] { 0, 0x04 }, // Data bytes + new byte[] { 1, 0x00 }, // Alignment byte + new byte[] { 2, 0x00 } // CRC 16 bytes + }; + } +} diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs index a2fbb215..c6eb8af0 100644 --- a/Common/OmniPlus/Program.cs +++ b/Common/OmniPlus/Program.cs @@ -1,36 +1,32 @@ -using OmniPlus.Connection; - +using OmniPlus.Contracts; using System; -using System.Collections.Concurrent; -using System.Text; +using System.Collections.Generic; namespace OmniPlus { class Program { + static IOmniRegister omniRegister = new OmniRegister("COM1"); + static void Main(string[] args) { - //var queue = new ConcurrentQueue(); - //var dataSettings = new OmniIrdaSettings(); - //var parsingData = true; - //dataSettings.StartReading(); - - //for (byte i = (byte)'a'; i < (byte)'a' + 26; i++) - //{ - // queue.Enqueue(i); - //} - - //while (parsingData) - //{ - // parsingData = queue.TryDequeue(out byte current) && dataSettings.ReadByte(current); - //} - - //parsingData = false; - - //Console.WriteLine(Encoding.ASCII.GetString(dataSettings.Data)); - - //var test = new SPConnection(null, null, null); } } + + public class Command + { + public Command(int index, int delay, params byte[] bytes) + { + this.Order = index; + this.Delay = delay; + this.Bytes = bytes; + } + + public int Order { get; } + + public int Delay { get; } + + public byte[] Bytes { get; } + } } From 70bf9bbb5f18966535deb8a4f4962f4ae79469d3 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Tue, 17 Oct 2023 15:01:33 +0200 Subject: [PATCH 11/56] Base comunication for OMNI+ register --- .../Connection/Contracts/IConnection.cs | 16 -- .../Connection/Contracts/IPortSettings.cs | 21 -- .../OmniPlus/Connection/Contracts/IRequest.cs | 7 - .../Connection/Contracts/IResponse.cs | 11 -- .../Contracts/ISerialPortConnection.cs | 15 ++ .../Connection/Contracts/ISerialPortReader.cs | 7 + Common/OmniPlus/Connection/Enums/BaudRate.cs | 29 ++- Common/OmniPlus/Connection/Enums/DataBits.cs | 10 +- .../Enums/{SPState.cs => SerialPortState.cs} | 6 +- .../EventHandlers/ReadEventHandler.cs | 6 - .../EventHandlers/StateEventHandler.cs | 6 - .../SerialPortStateChangedEventHandler.cs | 6 + Common/OmniPlus/Connection/SPConnection.cs | 186 ------------------ Common/OmniPlus/Connection/SPRequest.cs | 9 - Common/OmniPlus/Connection/SPResponse.cs | 94 --------- .../Connection/SerialPortConnection.cs | 181 +++++++++++++++++ .../OmniPlus/Connection/SerialPortMessage.cs | 35 ++++ .../OmniPlus/Connection/SerialPortOptions.cs | 40 ++++ Common/OmniPlus/Connections/Extensions.cs | 61 ++++++ Common/OmniPlus/Connections/IrdaConnection.cs | 121 ++++++++++++ .../Connections/Messages/IrdaMessage.cs | 80 ++++++++ .../Connections/Messages/MessageHandler.cs | 4 + .../Connections/Messages/UI1236Message.cs | 47 +++++ .../OmniPlus/Connections/UniProConnection.cs | 30 +++ Common/OmniPlus/Contracts/IOmniConnection.cs | 18 -- Common/OmniPlus/Contracts/IOmniRegister.cs | 9 - Common/OmniPlus/Contracts/IOmniRequest.cs | 8 - Common/OmniPlus/Contracts/IOmniResponse.cs | 8 - ...ystemParameters.cs => SystemParameters.cs} | 10 +- Common/OmniPlus/OmniConnection.cs | 72 ------- Common/OmniPlus/OmniPlus.csproj | 35 ++-- Common/OmniPlus/OmniPortSettings.cs | 22 --- Common/OmniPlus/OmniRegister.cs | 58 ++---- Common/OmniPlus/OmniRequest.cs | 13 -- Common/OmniPlus/OmniResponse.cs | 12 -- Common/OmniPlus/OmniTemplates.cs | 15 -- Common/OmniPlus/Program.cs | 27 +-- 37 files changed, 694 insertions(+), 641 deletions(-) delete mode 100644 Common/OmniPlus/Connection/Contracts/IConnection.cs delete mode 100644 Common/OmniPlus/Connection/Contracts/IPortSettings.cs delete mode 100644 Common/OmniPlus/Connection/Contracts/IRequest.cs delete mode 100644 Common/OmniPlus/Connection/Contracts/IResponse.cs create mode 100644 Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs create mode 100644 Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs rename Common/OmniPlus/Connection/Enums/{SPState.cs => SerialPortState.cs} (61%) delete mode 100644 Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs delete mode 100644 Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs create mode 100644 Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs delete mode 100644 Common/OmniPlus/Connection/SPConnection.cs delete mode 100644 Common/OmniPlus/Connection/SPRequest.cs delete mode 100644 Common/OmniPlus/Connection/SPResponse.cs create mode 100644 Common/OmniPlus/Connection/SerialPortConnection.cs create mode 100644 Common/OmniPlus/Connection/SerialPortMessage.cs create mode 100644 Common/OmniPlus/Connection/SerialPortOptions.cs create mode 100644 Common/OmniPlus/Connections/Extensions.cs create mode 100644 Common/OmniPlus/Connections/IrdaConnection.cs create mode 100644 Common/OmniPlus/Connections/Messages/IrdaMessage.cs create mode 100644 Common/OmniPlus/Connections/Messages/MessageHandler.cs create mode 100644 Common/OmniPlus/Connections/Messages/UI1236Message.cs create mode 100644 Common/OmniPlus/Connections/UniProConnection.cs delete mode 100644 Common/OmniPlus/Contracts/IOmniConnection.cs delete mode 100644 Common/OmniPlus/Contracts/IOmniRegister.cs delete mode 100644 Common/OmniPlus/Contracts/IOmniRequest.cs delete mode 100644 Common/OmniPlus/Contracts/IOmniResponse.cs rename Common/OmniPlus/Messages/{AggregateSystemParameters.cs => SystemParameters.cs} (88%) delete mode 100644 Common/OmniPlus/OmniConnection.cs delete mode 100644 Common/OmniPlus/OmniPortSettings.cs delete mode 100644 Common/OmniPlus/OmniRequest.cs delete mode 100644 Common/OmniPlus/OmniResponse.cs delete mode 100644 Common/OmniPlus/OmniTemplates.cs diff --git a/Common/OmniPlus/Connection/Contracts/IConnection.cs b/Common/OmniPlus/Connection/Contracts/IConnection.cs deleted file mode 100644 index 67938c6a..00000000 --- a/Common/OmniPlus/Connection/Contracts/IConnection.cs +++ /dev/null @@ -1,16 +0,0 @@ -using OmniPlus.Connection.EventHandlers; - -using System; - -namespace OmniPlus.Connection.Contracts -{ - internal interface IConnection : IDisposable - { - event ReadEventHandler DataReceived; - event StateEventHandler StateChanged; - - void OpenConnection(); - - void Send(IRequest request); - } -} diff --git a/Common/OmniPlus/Connection/Contracts/IPortSettings.cs b/Common/OmniPlus/Connection/Contracts/IPortSettings.cs deleted file mode 100644 index 77e5e597..00000000 --- a/Common/OmniPlus/Connection/Contracts/IPortSettings.cs +++ /dev/null @@ -1,21 +0,0 @@ -using OmniPlus.Connection.Enums; - -using System.IO.Ports; - -namespace OmniPlus.Connection.Contracts -{ - internal interface IPortSettings - { - BaudRate BaudRate { get; } - - Parity Parity { get; } - - DataBits DataBits { get; } - - StopBits StopBits { get; } - - bool RtsEnbaled { get; } - - bool DtrEnabled { get; } - } -} diff --git a/Common/OmniPlus/Connection/Contracts/IRequest.cs b/Common/OmniPlus/Connection/Contracts/IRequest.cs deleted file mode 100644 index 3f815634..00000000 --- a/Common/OmniPlus/Connection/Contracts/IRequest.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Connection.Contracts -{ - internal interface IRequest - { - byte[] ToByteArray(); - } -} diff --git a/Common/OmniPlus/Connection/Contracts/IResponse.cs b/Common/OmniPlus/Connection/Contracts/IResponse.cs deleted file mode 100644 index 4675d2fb..00000000 --- a/Common/OmniPlus/Connection/Contracts/IResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace OmniPlus.Connection.Contracts -{ - internal interface IResponse - { - byte[] Bytes { get; } - - bool ReadByte(byte data); - - void StartReading(); - } -} diff --git a/Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs b/Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs new file mode 100644 index 00000000..bee53ae8 --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs @@ -0,0 +1,15 @@ +using OmniPlus.Connection.Events; + +namespace OmniPlus.Connection.Contracts +{ + public interface ISerialPortConnection + { + event SerialPortStateChangedEventHandler StateChanged; + + void Write(SerialPortMessage message); + + void Close(); + + void Open(); + } +} diff --git a/Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs b/Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs new file mode 100644 index 00000000..1b1ae0a3 --- /dev/null +++ b/Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Connection.Contracts +{ + public interface ISerialPortReader + { + void Read(byte b); + } +} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/BaudRate.cs b/Common/OmniPlus/Connection/Enums/BaudRate.cs index ba08b870..716fddb4 100644 --- a/Common/OmniPlus/Connection/Enums/BaudRate.cs +++ b/Common/OmniPlus/Connection/Enums/BaudRate.cs @@ -1,20 +1,19 @@ namespace OmniPlus.Connection.Enums { - public enum BaudRate : int + public enum BaudRate { - Bps110 = 110, - Bps300 = 300, - Bps600 = 600, - Bps1200 = 1200, - Bps2400 = 2400, - Bps4800 = 4800, - Bps9600 = 9600, - Bps14400 = 14400, - Bps19200 = 19200, - Bps38400 = 38400, - Bps57600 = 57600, - Bps115200 = 115200, - Bps128000 = 128000, - Bps256000 = 256000 + X300 = 300, + X600 = 600, + X1200 = 1200, + X2400 = 2400, + X4800 = 4800, + X9600 = 9600, + X19200 = 19200, + X38400 = 38400, + X57600 = 57600, + X115200 = 115200, + X230400 = 230400, + X460800 = 460800, + X921600 = 921600 } } \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/DataBits.cs b/Common/OmniPlus/Connection/Enums/DataBits.cs index 87695750..c433f321 100644 --- a/Common/OmniPlus/Connection/Enums/DataBits.cs +++ b/Common/OmniPlus/Connection/Enums/DataBits.cs @@ -1,10 +1,10 @@ namespace OmniPlus.Connection.Enums { - public enum DataBits : int + public enum DataBits { - B8 = 8, - B7 = 7, - B6 = 6, - B5 = 5 + X5 = 5, + X6 = 6, + X7 = 7, + X8 = 8 } } \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/SPState.cs b/Common/OmniPlus/Connection/Enums/SerialPortState.cs similarity index 61% rename from Common/OmniPlus/Connection/Enums/SPState.cs rename to Common/OmniPlus/Connection/Enums/SerialPortState.cs index 5d7be238..2f16697d 100644 --- a/Common/OmniPlus/Connection/Enums/SPState.cs +++ b/Common/OmniPlus/Connection/Enums/SerialPortState.cs @@ -1,11 +1,11 @@ namespace OmniPlus.Connection.Enums { - internal enum SPState + public enum SerialPortState { Closed, Disposed, - Error, PinChanged, - Opened + ErrorReceived, + Open } } diff --git a/Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs b/Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs deleted file mode 100644 index f711b113..00000000 --- a/Common/OmniPlus/Connection/EventHandlers/ReadEventHandler.cs +++ /dev/null @@ -1,6 +0,0 @@ -using OmniPlus.Connection.Contracts; - -namespace OmniPlus.Connection.EventHandlers -{ - internal delegate void ReadEventHandler(IResponse data); -} diff --git a/Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs b/Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs deleted file mode 100644 index 585a0cab..00000000 --- a/Common/OmniPlus/Connection/EventHandlers/StateEventHandler.cs +++ /dev/null @@ -1,6 +0,0 @@ -using OmniPlus.Connection.Enums; - -namespace OmniPlus.Connection.EventHandlers -{ - internal delegate void StateEventHandler(SPState state, string message); -} diff --git a/Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs b/Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs new file mode 100644 index 00000000..45fae72f --- /dev/null +++ b/Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs @@ -0,0 +1,6 @@ +using OmniPlus.Connection.Enums; + +namespace OmniPlus.Connection.Events +{ + public delegate void SerialPortStateChangedEventHandler(SerialPortState state, string message); +} diff --git a/Common/OmniPlus/Connection/SPConnection.cs b/Common/OmniPlus/Connection/SPConnection.cs deleted file mode 100644 index 281688c3..00000000 --- a/Common/OmniPlus/Connection/SPConnection.cs +++ /dev/null @@ -1,186 +0,0 @@ -using OmniPlus.Connection.Contracts; -using OmniPlus.Connection.Enums; -using OmniPlus.Connection.EventHandlers; - -using System; -using System.Collections.Concurrent; -using System.IO.Ports; - -namespace OmniPlus.Connection -{ - internal class SPConnection : IConnection - { - private readonly string portName; - private readonly IPortSettings portSettings; - private readonly IResponse response; - - private event Action bytesReceived; - private ConcurrentQueue data; - private SerialPort serialPort; - private bool parsingData; - - public SPConnection(string portName, IPortSettings portSettings, IResponse dataSettings) - { - this.portName = portName; - this.portSettings = portSettings; - this.response = dataSettings; - this.bytesReceived += SPConnection_BytesReceived; - } - - public event ReadEventHandler DataReceived; - public event StateEventHandler StateChanged; - - public virtual void Dispose() - { - if (this.DataReceived != null) - { - foreach (var callback in this.DataReceived.GetInvocationList()) - { - if (callback is ReadEventHandler responseReceivedCallback) - { - this.DataReceived -= responseReceivedCallback; - } - } - } - - this.CloseConnection(); - } - - public void OpenConnection() - { - this.CloseConnection(); - - try - { - this.serialPort = new SerialPort - { - PortName = this.portName, - BaudRate = (int)this.portSettings.BaudRate, - Parity = this.portSettings.Parity, - DataBits = (int)this.portSettings.DataBits, - StopBits = this.portSettings.StopBits, - RtsEnable = this.portSettings.RtsEnbaled, - DtrEnable = this.portSettings.DtrEnabled - }; - - this.serialPort.DataReceived += this.SerialPort_DataReceived; - this.serialPort.Disposed += this.SerialPort_Disposed; - this.serialPort.ErrorReceived += this.SerialPort_ErrorReceived; - this.serialPort.PinChanged += this.SerialPort_PinChanged; - - this.serialPort.Open(); - } - catch (Exception exception) - { - this.StateChanged?.Invoke(SPState.Error, exception.ToString()); - - this.CloseConnection(); - } - - if (this.serialPort?.IsOpen == true) - { - this.data = new ConcurrentQueue(); - - this.StateChanged?.Invoke(SPState.Opened, "Connected - " - + $", {this.serialPort.PortName}" - + $", {this.serialPort.BaudRate}" - + $", {this.serialPort.Parity}" - + $", {this.serialPort.DataBits}" - + $", {this.serialPort.StopBits}" - + $", RTS: {this.serialPort.RtsEnable}" - + $", DTR: {this.serialPort.DtrEnable}"); - } - } - - public void Send(IRequest request) - { - var data = request.ToByteArray(); - - if (data?.Length > 0 && this.serialPort.IsOpen) - { - lock (this.serialPort) - { - this.serialPort.Write(data, 0, data.Length); - } - } - } - - private void CloseConnection() - { - if (this.serialPort != null) - { - this.serialPort.DataReceived -= this.SerialPort_DataReceived; - this.serialPort.Disposed -= this.SerialPort_Disposed; - this.serialPort.ErrorReceived -= this.SerialPort_ErrorReceived; - this.serialPort.PinChanged -= this.SerialPort_PinChanged; - - this.serialPort.Dispose(); - - this.serialPort = null; - this.data = null; - - this.StateChanged?.Invoke(SPState.Closed, "Connection was closed."); - } - } - - private void SPConnection_BytesReceived() - { - this.parsingData = true; - - this.response.StartReading(); - - while (this.parsingData) - { - this.parsingData = this.data.TryDequeue(out byte current) && this.response.ReadByte(current); - } - - this.DataReceived?.Invoke(this.response); - } - - private void SerialPort_DataReceived(Object sender, SerialDataReceivedEventArgs args) - { - if (sender is SerialPort serialPort && serialPort.BytesToRead > 0) - { - var bytes = new byte[serialPort.BytesToRead]; - - lock (serialPort) - { - serialPort.Read(bytes, 0, bytes.Length); - } - - foreach (var x in bytes) - { - this.data.Enqueue(x); - } - - if (!this.parsingData) - { - this.bytesReceived?.Invoke(); - } - } - } - - private void SerialPort_Disposed(Object sender, EventArgs args) - { - this.Dispose(); - - this.StateChanged?.Invoke(SPState.Disposed, $"Connection was disposed!"); - } - - private void SerialPort_ErrorReceived(Object sender, SerialErrorReceivedEventArgs args) - { - this.Dispose(); - - this.StateChanged?.Invoke(SPState.Error, $"Error received - {nameof(args.EventType)}: {args.EventType}"); - } - - private void SerialPort_PinChanged(Object sender, SerialPinChangedEventArgs args) - { - this.Dispose(); - - this.StateChanged?.Invoke(SPState.PinChanged, $"Pin changed - {nameof(args.EventType)}: {args.EventType}"); - } - - ~SPConnection() => this.Dispose(); - } -} diff --git a/Common/OmniPlus/Connection/SPRequest.cs b/Common/OmniPlus/Connection/SPRequest.cs deleted file mode 100644 index 8b7a88d0..00000000 --- a/Common/OmniPlus/Connection/SPRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using OmniPlus.Connection.Contracts; - -namespace OmniPlus.Connection -{ - internal abstract class SPRequest : IRequest - { - public abstract byte[] ToByteArray(); - } -} diff --git a/Common/OmniPlus/Connection/SPResponse.cs b/Common/OmniPlus/Connection/SPResponse.cs deleted file mode 100644 index 48e9550b..00000000 --- a/Common/OmniPlus/Connection/SPResponse.cs +++ /dev/null @@ -1,94 +0,0 @@ -using OmniPlus.Connection.Contracts; - -namespace OmniPlus.Connection -{ - internal abstract class SPResponse : IResponse - { - private readonly byte[][] template; - private readonly byte[][] messageTemplate; - private int rowLength; - private int row; - private int col; - private bool ok; - private bool reading; - - public SPResponse(byte[][] template) - { - this.template = template; - this.messageTemplate = template; - } - - public byte[] Bytes { get; private set; } - - public bool ReadByte(byte data) - { - if (!this.reading) - { - this.reading = this.template[0][1] == data; - } - else - { - this.ok = this.PrepareReading(); - - if (this.ok) - { - this.Bytes[this.col] = data; - } - } - - return this.ok; - } - - public void StartReading() - { - this.template.CopyTo(this.messageTemplate, 0); - - this.Bytes = new byte[8]; - this.row = 0; - this.rowLength = this.messageTemplate[this.row][0]; - this.col = -1; - this.reading = false; - this.ok = this.rowLength > 0 && this.col < this.Bytes.Length; - } - - private bool PrepareReading() - { - this.col++; - - if (this.rowLength - this.col > 0) - { - return true; - } - - this.row++; - - if (this.row >= this.messageTemplate.Length) - { - return false; - } - - var bytesLength = this.Bytes.Length; - var nextLength = this.messageTemplate[this.row][0]; - - if (nextLength == 0) - { - nextLength = this.messageTemplate[this.row][1]; - - for (int i = this.row + 1; i < this.messageTemplate.Length; i++) - { - this.messageTemplate[i][1] += nextLength; - } - - var messageContent = new byte[bytesLength + nextLength]; - - this.Bytes.CopyTo(messageContent, 0); - - this.Bytes = messageContent; - } - - this.rowLength += nextLength; - - return this.row < this.messageTemplate.Length && this.col < bytesLength; - } - } -} diff --git a/Common/OmniPlus/Connection/SerialPortConnection.cs b/Common/OmniPlus/Connection/SerialPortConnection.cs new file mode 100644 index 00000000..b11b8e95 --- /dev/null +++ b/Common/OmniPlus/Connection/SerialPortConnection.cs @@ -0,0 +1,181 @@ +using OmniPlus.Connection.Contracts; +using OmniPlus.Connection.Enums; +using OmniPlus.Connection.Events; + +using System; +using System.Collections.Concurrent; +using System.IO; +using System.IO.Ports; + +namespace OmniPlus.Connection +{ + public abstract class SerialPortConnection : ISerialPortConnection + { + private event Action Read; + private event Action Log; + + private SerialPort serialPort; + private SerialPortState state; + + protected bool reading; + protected SerialPortOptions options; + protected ConcurrentQueue stream; + + protected SerialPortConnection() + => this.options = new SerialPortOptions(); + + public event SerialPortStateChangedEventHandler StateChanged; + + protected bool open => this.state == SerialPortState.Open; + + public void Close() + { + if (this.serialPort != null) + { + this.serialPort.DataReceived -= this.Port_DataReceived; + this.serialPort.Disposed -= this.Port_Disposed; + this.serialPort.ErrorReceived -= this.Port_ErrorReceived; + this.serialPort.PinChanged -= this.Port_PinChanged; + } + + this.serialPort?.Close(); + + this.stream = null; + this.serialPort = null; + this.state = SerialPortState.Closed; + + this.StateChanged?.Invoke(this.state, $"{this.options.PortName} closed."); + + this.Read -= this.SerialPortConnection_Read; + this.Log -= this.SerialPortConnection_Log; + this.StateChanged -= this.SerialPortConnection_StateChanged; + } + + public void Open() + { + this.Close(); + + try + { + File.AppendAllText(this.options.LogFile, string.Empty); + + this.Log += this.SerialPortConnection_Log; + this.StateChanged += this.SerialPortConnection_StateChanged; + } + catch (Exception e) + { + this.state = SerialPortState.ErrorReceived; + + Console.WriteLine($"[{this.state}] {this.options.PortName}: {e}"); + } + + try + { + this.stream = new ConcurrentQueue(); + this.serialPort = new System.IO.Ports.SerialPort + { + PortName = options.PortName, + BaudRate = (int)options.BaudRate, + DataBits = (int)options.DataBits, + Parity = options.Parity, + StopBits = options.StopBits, + RtsEnable = options.RtsEnabled, + DtrEnable = options.DtrEnabled + }; + + this.serialPort.DataReceived += this.Port_DataReceived; + this.serialPort.Disposed += this.Port_Disposed; + this.serialPort.ErrorReceived += this.Port_ErrorReceived; + this.serialPort.PinChanged += this.Port_PinChanged; + + this.serialPort.Open(); + + this.state = SerialPortState.Open; + + this.Read += this.SerialPortConnection_Read; + + this.StateChanged?.Invoke(this.state, $"{this.options.PortName} opened."); + } + catch (Exception e) + { + this.state = SerialPortState.ErrorReceived; + + this.StateChanged?.Invoke(this.state, $"{this.options.PortName}: {e}"); + + this.Close(); + } + } + + public virtual void Write(SerialPortMessage message) + { + if (this.open && message.Length > 0) + { + this.serialPort.Write(message, 0, message.Length); + } + + this.Log?.Invoke($"RX: {BitConverter.ToString(message)}"); + } + + protected abstract void SerialPortConnection_Read(); + + private void Port_PinChanged(object sender, SerialPinChangedEventArgs args) + { + this.state = SerialPortState.PinChanged; + + this.StateChanged?.Invoke(SerialPortState.PinChanged, $"{this.options.PortName} {args.EventType}."); + + this.Close(); + } + + private void Port_ErrorReceived(object sender, SerialErrorReceivedEventArgs args) + { + this.state = SerialPortState.ErrorReceived; + + this.StateChanged?.Invoke(SerialPortState.ErrorReceived, $"{this.options.PortName} {args.EventType}."); + + this.Close(); + } + + private void Port_Disposed(object sender, EventArgs args) + { + this.state = SerialPortState.Disposed; + + this.StateChanged?.Invoke(SerialPortState.Disposed, $"{this.options.PortName} disposed."); + + this.Close(); + } + + private void Port_DataReceived(object sender, SerialDataReceivedEventArgs args) + { + if (this.open && sender is System.IO.Ports.SerialPort port && port.BytesToRead > 0) + { + var bytesLength = port.BytesToRead; + var bytes = new byte[bytesLength]; + var lock_object = new object(); + + lock (lock_object) + { + port.Read(bytes, 0, bytesLength); + } + + foreach (var item in bytes) + { + this.stream.Enqueue(item); + } + + if (!this.reading) + { + this.Read?.Invoke(); + } + + this.Log?.Invoke($"TX: {BitConverter.ToString(bytes)}"); + } + } + + private void SerialPortConnection_Log(string message) + => File.AppendAllText(this.options.LogFile, $"{message}{Environment.NewLine}"); + + private void SerialPortConnection_StateChanged(SerialPortState state, string message) + => File.AppendAllText(this.options.LogFile, $"[{state}] {message}{Environment.NewLine}"); + } +} diff --git a/Common/OmniPlus/Connection/SerialPortMessage.cs b/Common/OmniPlus/Connection/SerialPortMessage.cs new file mode 100644 index 00000000..a79b831b --- /dev/null +++ b/Common/OmniPlus/Connection/SerialPortMessage.cs @@ -0,0 +1,35 @@ +using System; + +namespace OmniPlus.Connection +{ + public abstract class SerialPortMessage + { + protected readonly byte[] bytes; + protected readonly byte[] payload; + + protected SerialPortMessage(byte[] bytes, bool full) + { + if (full) + { + this.bytes = bytes; + this.payload = this.ParseMessage(bytes); + } + else + { + this.payload = bytes; + this.bytes = this.CreateMessage(bytes); + } + } + + public int Length => this.bytes?.Length ?? 0; + + public byte[] Payload => this.payload; + + protected abstract byte[] CreateMessage(byte[] payload); + + protected abstract byte[] ParseMessage(byte[] message); + + public static implicit operator byte[](SerialPortMessage message) + => message?.bytes ?? Array.Empty(); + } +} diff --git a/Common/OmniPlus/Connection/SerialPortOptions.cs b/Common/OmniPlus/Connection/SerialPortOptions.cs new file mode 100644 index 00000000..3623bbae --- /dev/null +++ b/Common/OmniPlus/Connection/SerialPortOptions.cs @@ -0,0 +1,40 @@ +using OmniPlus.Connection.Enums; + +using System.IO.Ports; + +namespace OmniPlus.Connection +{ + public class SerialPortOptions + { + public SerialPortOptions() + { + foreach (var portName in System.IO.Ports.SerialPort.GetPortNames()) + { + this.PortName = portName; + + break; + } + + this.BaudRate = BaudRate.X4800; + this.DataBits = DataBits.X8; + this.Parity = Parity.None; + this.StopBits = StopBits.One; + } + + public string PortName { get; set; } + + public BaudRate BaudRate { get; set; } = BaudRate.X4800; + + public Parity Parity { get; set; } = Parity.None; + + public DataBits DataBits { get; set; } = DataBits.X8; + + public StopBits StopBits { get; set; } = StopBits.One; + + public bool RtsEnabled { get; set; } + + public bool DtrEnabled { get; set; } + + public string LogFile { get; set; } + } +} \ No newline at end of file diff --git a/Common/OmniPlus/Connections/Extensions.cs b/Common/OmniPlus/Connections/Extensions.cs new file mode 100644 index 00000000..db2dc570 --- /dev/null +++ b/Common/OmniPlus/Connections/Extensions.cs @@ -0,0 +1,61 @@ +using System; + +namespace OmniPlus.Connections +{ + public static class Extensions + { + /// + /// TODO: Test calculated crc + /// + /// The message for CRC16. + /// The start index. + /// The length from the start index. + /// Two bytes array from the calculated CRC16 in LSB0. + public static byte[] CalculateCRC(this byte[] message, int start, int length) + { + var test = default(byte); + var zeichen = default(byte); + var crcSum = ushort.MaxValue; + var messageLength = length - start; + + while (start < messageLength) + { + zeichen = message[start]; + start++; + + for (byte h = 0; h < 8; h++) + { + test = 0; + + if ((crcSum & 0x8000) != 0) + { + test = 0x80; + } + + crcSum <<= 1; + + if (((zeichen & 0x80) ^ test) != 0) + { + crcSum ^= 0x1021; + } + + zeichen <<= 1; + } + } + + return BitConverter.GetBytes(crcSum); + } + + public static byte[] CalculateCheckSum16(this byte[] bytes, int length) + { + short checksum = 0; + + for (int i = 0; i < length; i++) + { + checksum += bytes[i]; + } + + return BitConverter.GetBytes(checksum); + } + } +} diff --git a/Common/OmniPlus/Connections/IrdaConnection.cs b/Common/OmniPlus/Connections/IrdaConnection.cs new file mode 100644 index 00000000..3095e15f --- /dev/null +++ b/Common/OmniPlus/Connections/IrdaConnection.cs @@ -0,0 +1,121 @@ +namespace OmniPlus.Connections +{ + using OmniPlus.Connection; + using OmniPlus.Connection.Enums; + using OmniPlus.Connections.Messages; + + using System; + using System.IO.Ports; + using System.Threading; + + public class IrdaConnection : SerialPortConnection + { + internal const byte MSG_START = 0x9B; + internal const byte MSG_OMNI2PC = 0x43; + internal const byte MSG_PC2OMNI = 0x33; + + private event Action messageReceived; + + public IrdaConnection(string portName) + { + this.options.PortName = portName; + this.options.BaudRate = BaudRate.X4800; + this.options.DataBits = DataBits.X8; + this.options.Parity = Parity.None; + this.options.StopBits = StopBits.One; + this.options.RtsEnabled = true; + } + + public byte[] Write(byte[] command, int timeout, int delay) + { + var ui1236Request = new UI1236Message(command); + var irdaRequest = new IrdaMessage(ui1236Request); + var responseBytes = Array.Empty(); + var received = false; + + this.messageReceived += irdaResponse => + { + var ui1236Response = new UI1236Message(irdaResponse.Payload, true); + responseBytes = ui1236Response.Payload; + received = true; + }; + + this.Write(irdaRequest); + + #region Temporary + this.stream = new System.Collections.Concurrent.ConcurrentQueue( + new byte[] { 0xFF, 0x01, 0x25, 0x00, 0x80, 0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0x0C, 0xFF, 0x01, 0x25, 0x00, 0x80, 0x88 }); + this.SerialPortConnection_Read(); + #endregion + + while (!received && timeout >= 0) + { + timeout -= delay; + + Thread.Sleep(delay); + } + + return responseBytes; + } + + protected override void SerialPortConnection_Read() + { + this.reading = true; + + var message = default(IrdaMessage); + + while (this.reading) + { + if (!this.stream.TryDequeue(out byte start)) + { + break; + } + + if (start != MSG_START) + { + continue; + } + + _ = this.stream.TryDequeue(out byte type); + _ = this.stream.TryDequeue(out byte length); + + + var payloadLength = length * 2; + var payload = new byte[payloadLength]; + + for (int i = 0; i < payloadLength; i++) + { + if (this.stream.TryDequeue(out byte paybyte)) + { + payload[i] = paybyte; + } + else break; + } + + message = new IrdaMessage(payload); + message.Start = start; + message.Type = type; + message.DataLength = length; + + var crc16 = new byte[2]; + + for (int i = 0; i < IrdaMessage.CRC_LENGTH; i++) + { + if (this.stream.TryDequeue(out byte crcbyte)) + { + crc16[i] = crcbyte; + } + else break; + } + + message.CopyCRC16(crc16, 0); + + break; + } + + this.reading = false; + + this.messageReceived?.Invoke(message); + } + } +} diff --git a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs new file mode 100644 index 00000000..6826e7f6 --- /dev/null +++ b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs @@ -0,0 +1,80 @@ +using OmniPlus.Connection; + +using System; + +namespace OmniPlus.Connections.Messages +{ + public class IrdaMessage : SerialPortMessage + { + public const int MIN_LENGTH = 5; + public const int CRC_LENGTH = 2; + + public IrdaMessage(byte[] bytes, bool full = false) : base(bytes, full) + { + } + + public byte Start + { + get => this.bytes[0]; + set => this.bytes[0] = value; + } + + public byte Type + { + get => this.bytes[1]; + set => this.bytes[1] = value; + } + + public byte DataLength + { + get => this.bytes[2]; + set => this.bytes[2] = value; + } + + public void CopyCRC16(byte[] bytes, int sourceIndex) + { + var crcPosition = this.bytes.Length - CRC_LENGTH; + + Array.Copy(bytes, sourceIndex, this.bytes, crcPosition, CRC_LENGTH); + + var crc16 = this.bytes.CalculateCRC(0, crcPosition); + + if (crc16[0] == this.bytes[crcPosition] && crc16[0] == this.bytes[crcPosition + 1]) + { + // TODO: message validated. + } + } + + protected override byte[] CreateMessage(byte[] payload) + { + var messageLength = payload.Length; + messageLength += messageLength % 2; + + var index = 0; + var message = new byte[messageLength + 5]; + message[index++] = IrdaConnection.MSG_START; + message[index++] = IrdaConnection.MSG_PC2OMNI; + message[index++] = (byte)(messageLength / 2); + + payload.CopyTo(message, index); + + messageLength = message.Length; + + var crc16 = message.CalculateCRC(0, messageLength - CRC_LENGTH); + message[messageLength - 2] = crc16[1]; + message[messageLength - 1] = crc16[0]; + + return message; + } + + protected override byte[] ParseMessage(byte[] message) + { + var payloadLength = message.Length - MIN_LENGTH; + var payload = new byte[payloadLength]; + + Array.Copy(message, 3, payload, 0, payloadLength); + + return payload; + } + } +} diff --git a/Common/OmniPlus/Connections/Messages/MessageHandler.cs b/Common/OmniPlus/Connections/Messages/MessageHandler.cs new file mode 100644 index 00000000..22772862 --- /dev/null +++ b/Common/OmniPlus/Connections/Messages/MessageHandler.cs @@ -0,0 +1,4 @@ +namespace OmniPlus.Connections.Messages +{ + public delegate byte[] MessageHandler(byte[] command, int timeout, int delay); +} diff --git a/Common/OmniPlus/Connections/Messages/UI1236Message.cs b/Common/OmniPlus/Connections/Messages/UI1236Message.cs new file mode 100644 index 00000000..d3d4f2e1 --- /dev/null +++ b/Common/OmniPlus/Connections/Messages/UI1236Message.cs @@ -0,0 +1,47 @@ +using OmniPlus.Connection; + +using System; + +namespace OmniPlus.Connections.Messages +{ + public class UI1236Message : SerialPortMessage + { + public const int MIN_LENGTH = 5; + public const byte START_BYTE = 0x0D; + + public UI1236Message(byte[] bytes, bool full = false) : base(bytes, full) + { + } + + protected override byte[] CreateMessage(byte[] payload) + { + var length = payload.Length + MIN_LENGTH; + var evenOffset = length % 2; + length += evenOffset; + + var index = 0; + var message = new byte[length]; + message[index++] = START_BYTE; + message[index++] = (byte)(length - 3); + message[index++] = 0x08; // TODO: control byte + + payload.CopyTo(message, index); + + var checksum = message.CalculateCheckSum16(length); + message[length - evenOffset - 2] = checksum[1]; + message[length - evenOffset - 1] = checksum[0]; + + return message; + } + + protected override byte[] ParseMessage(byte[] message) + { + var payloadLength = message[1] - (message.Length - message[1]); + var payload = new byte[payloadLength]; + + Array.Copy(message, 3, payload, 0, payloadLength); + + return payload; + } + } +} diff --git a/Common/OmniPlus/Connections/UniProConnection.cs b/Common/OmniPlus/Connections/UniProConnection.cs new file mode 100644 index 00000000..8866155e --- /dev/null +++ b/Common/OmniPlus/Connections/UniProConnection.cs @@ -0,0 +1,30 @@ +using OmniPlus.Connection; +using OmniPlus.Connection.Enums; + +using System.IO.Ports; + +namespace OmniPlus.Connections +{ + public class UniProConnection : SerialPortConnection + { + public UniProConnection(string portName) + { + this.options.PortName = portName; + this.options.BaudRate = BaudRate.X2400; + this.options.DataBits = DataBits.X8; + this.options.Parity = Parity.None; + this.options.StopBits = StopBits.One; + this.options.RtsEnabled = true; + } + + public byte[] Write(byte[] command, int timeout, int delay) + { + throw new System.NotImplementedException(); + } + + protected override void SerialPortConnection_Read() + { + throw new System.NotImplementedException(); + } + } +} diff --git a/Common/OmniPlus/Contracts/IOmniConnection.cs b/Common/OmniPlus/Contracts/IOmniConnection.cs deleted file mode 100644 index 24b3aec2..00000000 --- a/Common/OmniPlus/Contracts/IOmniConnection.cs +++ /dev/null @@ -1,18 +0,0 @@ -using OmniPlus.Connection.Contracts; -using OmniPlus.Connection.EventHandlers; - -using System; - -namespace OmniPlus.Contracts -{ - internal interface IOmniConnection : IDisposable - { - event StateEventHandler StateChanged; - - void CloseConnection(); - - void OpenConnection(); - - IResponse Send(IRequest request); - } -} diff --git a/Common/OmniPlus/Contracts/IOmniRegister.cs b/Common/OmniPlus/Contracts/IOmniRegister.cs deleted file mode 100644 index 860df87d..00000000 --- a/Common/OmniPlus/Contracts/IOmniRegister.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace OmniPlus.Contracts -{ - public interface IOmniRegister : IDisposable - { - - } -} diff --git a/Common/OmniPlus/Contracts/IOmniRequest.cs b/Common/OmniPlus/Contracts/IOmniRequest.cs deleted file mode 100644 index ce8b4014..00000000 --- a/Common/OmniPlus/Contracts/IOmniRequest.cs +++ /dev/null @@ -1,8 +0,0 @@ -using OmniPlus.Connection.Contracts; - -namespace OmniPlus.Contracts -{ - internal interface IOmniRequest : IRequest - { - } -} diff --git a/Common/OmniPlus/Contracts/IOmniResponse.cs b/Common/OmniPlus/Contracts/IOmniResponse.cs deleted file mode 100644 index 5d65e1f4..00000000 --- a/Common/OmniPlus/Contracts/IOmniResponse.cs +++ /dev/null @@ -1,8 +0,0 @@ -using OmniPlus.Connection.Contracts; - -namespace OmniPlus.Contracts -{ - internal interface IOmniResponse : IResponse - { - } -} diff --git a/Common/OmniPlus/Messages/AggregateSystemParameters.cs b/Common/OmniPlus/Messages/SystemParameters.cs similarity index 88% rename from Common/OmniPlus/Messages/AggregateSystemParameters.cs rename to Common/OmniPlus/Messages/SystemParameters.cs index b0cf3366..49637b7a 100644 --- a/Common/OmniPlus/Messages/AggregateSystemParameters.cs +++ b/Common/OmniPlus/Messages/SystemParameters.cs @@ -4,7 +4,7 @@ using System; - public class AggregateSystemParameters + public class SystemParameters { private readonly ASCIIString factoryBuild; private readonly Seconds manifacturingTime; @@ -14,7 +14,7 @@ private readonly byte rebootCount; private readonly byte sealStatus; - private AggregateSystemParameters(byte[] data) + private SystemParameters(byte[] data) { this.rebootCount = default(byte); this.sealStatus = default(byte); @@ -61,10 +61,10 @@ return 0 <= totalManifacturingDays && totalManifacturingDays <= max; } - public static implicit operator AggregateSystemParameters(byte[] data) - => new AggregateSystemParameters(data); + public static implicit operator SystemParameters(byte[] data) + => new SystemParameters(data); - public static implicit operator byte[] (AggregateSystemParameters _) + public static implicit operator byte[] (SystemParameters _) => new byte[] { 0xFD, 0xC6 }; } } diff --git a/Common/OmniPlus/OmniConnection.cs b/Common/OmniPlus/OmniConnection.cs deleted file mode 100644 index 7405e68f..00000000 --- a/Common/OmniPlus/OmniConnection.cs +++ /dev/null @@ -1,72 +0,0 @@ -using OmniPlus.Connection; -using OmniPlus.Connection.Contracts; -using OmniPlus.Connection.EventHandlers; -using OmniPlus.Contracts; - -using System.Threading; - -namespace OmniPlus -{ - internal class OmniConnection : IOmniConnection - { - private readonly IConnection connection; - private readonly int timeoutSeconds; - private readonly int sleeMilliseconds; - - private IResponse response; - private bool waiting; - - public OmniConnection(string portName, int timeoutSeconds = 3000, int sleeMilliseconds = 300) - { - this.connection = new SPConnection( - portName: portName, - portSettings: new OmniPortSettings(), - dataSettings: new OmniResponse()); - this.timeoutSeconds = timeoutSeconds; - this.sleeMilliseconds = sleeMilliseconds; - } - - public event StateEventHandler StateChanged - { - add => this.connection.StateChanged += value; - remove => this.connection.StateChanged -= value; - } - - public void CloseConnection() - => this.connection.Dispose(); - - public void Dispose() - => this.connection.Dispose(); - - public void OpenConnection() - => this.connection.OpenConnection(); - - public IResponse Send(IRequest request) - { - this.waiting = true; - - this.connection.DataReceived += this.Connection_DataReceived; - - this.connection.Send(request); - - var timeoutSeconds = this.timeoutSeconds; - - while (this.waiting && timeoutSeconds > 0) - { - timeoutSeconds -= this.sleeMilliseconds; - - Thread.Sleep(this.sleeMilliseconds); - } - - this.connection.DataReceived -= this.Connection_DataReceived; - - return this.response ?? default(IResponse); - } - - private void Connection_DataReceived(IResponse response) - { - this.response = response; - this.waiting = false; - } - } -} diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj index 78b9d108..d5ebe558 100644 --- a/Common/OmniPlus/OmniPlus.csproj +++ b/Common/OmniPlus/OmniPlus.csproj @@ -43,33 +43,27 @@ - - - - - - + + + + - - - + + + + + - - - - - - - + - - + + + + - - @@ -79,5 +73,6 @@ + \ No newline at end of file diff --git a/Common/OmniPlus/OmniPortSettings.cs b/Common/OmniPlus/OmniPortSettings.cs deleted file mode 100644 index ce542c6e..00000000 --- a/Common/OmniPlus/OmniPortSettings.cs +++ /dev/null @@ -1,22 +0,0 @@ -using OmniPlus.Connection.Contracts; -using OmniPlus.Connection.Enums; - -using System.IO.Ports; - -namespace OmniPlus -{ - public class OmniPortSettings : IPortSettings - { - public BaudRate BaudRate => BaudRate.Bps4800; - - public Parity Parity => Parity.None; - - public DataBits DataBits => DataBits.B8; - - public StopBits StopBits => StopBits.One; - - public System.Boolean RtsEnbaled => true; - - public System.Boolean DtrEnabled => false; - } -} diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs index e13dff8b..e4c74120 100644 --- a/Common/OmniPlus/OmniRegister.cs +++ b/Common/OmniPlus/OmniRegister.cs @@ -1,55 +1,39 @@ -using OmniPlus.Connection.Contracts; -using OmniPlus.Connection.Enums; -using OmniPlus.Contracts; - -using System; -using System.Collections.Generic; -using System.IO; +using OmniPlus.Commands; +using OmniPlus.Connections; +using OmniPlus.Connections.Messages; namespace OmniPlus { - public class OmniRegister : IOmniRegister + public class OmniRegister { - private readonly string loggingFile; - private readonly IOmniConnection omniConnection; - private readonly ICollection requests; + private readonly string portName; + private readonly IrdaConnection irdaConnection; + private readonly UniProConnection uniProConnection; - private bool connectionAvailable; + private MessageHandler messageHandler; public OmniRegister(string portName) { - this.loggingFile = this.GetOrCreateLoggingFile(portName); - this.requests = new List(); - this.omniConnection = new OmniConnection(portName); - this.omniConnection.StateChanged += this.OmniConnection_StateChanged; + this.portName = portName; + this.irdaConnection = new IrdaConnection(portName); + this.uniProConnection = new UniProConnection(portName); } - public void Dispose() + public void ActivateIrda() { - this.omniConnection.StateChanged -= this.OmniConnection_StateChanged; - - this.omniConnection.Dispose(); + this.uniProConnection?.Close(); + this.irdaConnection?.Open(); + this.messageHandler = this.irdaConnection.Write; } - private string GetOrCreateLoggingFile(string portName) + public void ActivateUniPro() { - var directory = Directory.CreateDirectory(portName); - var fileName = $"{DateTime.Now:yyyy_MM_dd}.log"; - var loggingFile = Path.Combine(directory.FullName, fileName); - - if (!File.Exists(loggingFile)) - { - File.WriteAllText(loggingFile, string.Empty); - } - - return loggingFile; + this.irdaConnection?.Close(); + this.uniProConnection?.Open(); + this.messageHandler = this.uniProConnection.Write; } - private void OmniConnection_StateChanged(SPState state, string message) - { - File.AppendAllText(this.loggingFile, $"[{DateTime.Now:hh:mm:ss}][{state}] {message}{Environment.NewLine}"); - - this.connectionAvailable = state == SPState.Opened; - } + internal SystemParameters GetSystemParameters() + => this.messageHandler?.Invoke(new byte[] { 0xFD, 0xC6 }, 3000, 300); } } diff --git a/Common/OmniPlus/OmniRequest.cs b/Common/OmniPlus/OmniRequest.cs deleted file mode 100644 index 543cf425..00000000 --- a/Common/OmniPlus/OmniRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -using OmniPlus.Connection; -using OmniPlus.Contracts; - -namespace OmniPlus -{ - internal class OmniRequest : SPRequest, IOmniRequest - { - public override System.Byte[] ToByteArray() - { - throw new System.NotImplementedException(); - } - } -} diff --git a/Common/OmniPlus/OmniResponse.cs b/Common/OmniPlus/OmniResponse.cs deleted file mode 100644 index 24455e85..00000000 --- a/Common/OmniPlus/OmniResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using OmniPlus.Connection; -using OmniPlus.Contracts; - -namespace OmniPlus -{ - internal class OmniResponse : SPResponse, IOmniResponse - { - public OmniResponse() : base(OmniTemplates.IrdaResponse) - { - } - } -} diff --git a/Common/OmniPlus/OmniTemplates.cs b/Common/OmniPlus/OmniTemplates.cs deleted file mode 100644 index 3cb0a007..00000000 --- a/Common/OmniPlus/OmniTemplates.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace OmniPlus -{ - internal class OmniTemplates - { - public static byte[][] IrdaResponse => new byte[][] - { - new byte[] { 1, 0x9B }, // Start byte - new byte[] { 3, 0x00 }, // Control bytes - new byte[] { 1, 0x00 }, // Data length byte - new byte[] { 0, 0x04 }, // Data bytes - new byte[] { 1, 0x00 }, // Alignment byte - new byte[] { 2, 0x00 } // CRC 16 bytes - }; - } -} diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs index c6eb8af0..2fb0a826 100644 --- a/Common/OmniPlus/Program.cs +++ b/Common/OmniPlus/Program.cs @@ -1,32 +1,13 @@ -using OmniPlus.Contracts; -using System; -using System.Collections.Generic; - -namespace OmniPlus +namespace OmniPlus { class Program { - static IOmniRegister omniRegister = new OmniRegister("COM1"); - static void Main(string[] args) { + var omniRegister = new OmniRegister("COM1"); + omniRegister.ActivateIrda(); + var systemParameters = omniRegister.GetSystemParameters(); } } - - public class Command - { - public Command(int index, int delay, params byte[] bytes) - { - this.Order = index; - this.Delay = delay; - this.Bytes = bytes; - } - - public int Order { get; } - - public int Delay { get; } - - public byte[] Bytes { get; } - } } From fe1f529b5e75c55013d3f5613166c7c584a2ad83 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Tue, 17 Oct 2023 16:50:28 +0200 Subject: [PATCH 12/56] feature description in enums --- Common/OmniPlus/Connections/Extensions.cs | 67 ++++++--- Common/OmniPlus/Connections/IrdaConnection.cs | 1 + .../Features/Enums/PredefinedAlarms.cs | 139 ++++++++++++++++++ Common/OmniPlus/Features/Enums/StatusCodes.cs | 9 ++ .../OmniPlus/Features/Enums/UI1236Commands.cs | 127 ++++++++++++++++ Common/OmniPlus/OmniPlus.csproj | 3 + Common/OmniPlus/OmniRegister.cs | 2 + Common/OmniPlus/Program.cs | 2 - 8 files changed, 327 insertions(+), 23 deletions(-) create mode 100644 Common/OmniPlus/Features/Enums/PredefinedAlarms.cs create mode 100644 Common/OmniPlus/Features/Enums/StatusCodes.cs create mode 100644 Common/OmniPlus/Features/Enums/UI1236Commands.cs diff --git a/Common/OmniPlus/Connections/Extensions.cs b/Common/OmniPlus/Connections/Extensions.cs index db2dc570..1f8b4a5f 100644 --- a/Common/OmniPlus/Connections/Extensions.cs +++ b/Common/OmniPlus/Connections/Extensions.cs @@ -13,37 +13,62 @@ namespace OmniPlus.Connections /// Two bytes array from the calculated CRC16 in LSB0. public static byte[] CalculateCRC(this byte[] message, int start, int length) { - var test = default(byte); - var zeichen = default(byte); - var crcSum = ushort.MaxValue; - var messageLength = length - start; + var crc = 0xFFFF; - while (start < messageLength) + for (int i = 0; i < length; i++) { - zeichen = message[start]; - start++; + //copy data byte to lower word because of LSB will be XORed + var dataWord = (UInt16)(message[i] & 0x00FF); - for (byte h = 0; h < 8; h++) + for (var b = 0; b < 8; b++) { - test = 0; - - if ((crcSum & 0x8000) != 0) + //test if CRC lowest bit is XORed set to one + if (0x0001 == ((crc ^ dataWord) & 0x0001)) { - test = 0x80; + crc >>= 1; + //apply generator polynomial + crc ^= 0x8408; + } + else + { + crc >>= 1; } - crcSum <<= 1; - - if (((zeichen & 0x80) ^ test) != 0) - { - crcSum ^= 0x1021; - } - - zeichen <<= 1; + dataWord >>= 1; } } - return BitConverter.GetBytes(crcSum); + //var test = default(byte); + //var zeichen = default(byte); + //var crcSum = ushort.MaxValue; + //var messageLength = length - start; + + //while (start < messageLength) + //{ + // zeichen = message[start]; + // start++; + + // for (byte h = 0; h < 8; h++) + // { + // test = 0; + + // if ((crcSum & 0x8000) != 0) + // { + // test = 0x80; + // } + + // crcSum <<= 1; + + // if (((zeichen & 0x80) ^ test) != 0) + // { + // crcSum ^= 0x1021; + // } + + // zeichen <<= 1; + // } + //} + + return BitConverter.GetBytes(crc); } public static byte[] CalculateCheckSum16(this byte[] bytes, int length) diff --git a/Common/OmniPlus/Connections/IrdaConnection.cs b/Common/OmniPlus/Connections/IrdaConnection.cs index 3095e15f..1acee027 100644 --- a/Common/OmniPlus/Connections/IrdaConnection.cs +++ b/Common/OmniPlus/Connections/IrdaConnection.cs @@ -43,6 +43,7 @@ this.Write(irdaRequest); #region Temporary + // TODO: remove for real connections this.stream = new System.Collections.Concurrent.ConcurrentQueue( new byte[] { 0xFF, 0x01, 0x25, 0x00, 0x80, 0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0x0C, 0xFF, 0x01, 0x25, 0x00, 0x80, 0x88 }); this.SerialPortConnection_Read(); diff --git a/Common/OmniPlus/Features/Enums/PredefinedAlarms.cs b/Common/OmniPlus/Features/Enums/PredefinedAlarms.cs new file mode 100644 index 00000000..61aadc29 --- /dev/null +++ b/Common/OmniPlus/Features/Enums/PredefinedAlarms.cs @@ -0,0 +1,139 @@ +namespace OmniPlus.Features.Enums +{ + public enum PredefinedAlarms : byte + { + /// + /// Set when the unit is in a mode that is updating the firmware. + /// + /// Trigger Condition: Alarm is set when the device begins to receive firmware image blocks. + /// It is marked as no longer occurring before executing the flasher app as the last part of a firmware upgrade. + /// Upon booting into the upgraded image, the alarm is in persistent state with start time associated with the reception of Load Start command + /// and stop time associated with the reception of Flash Start command. + /// If after loading the new image, the CRC fails, the Alarm condition is maintained until a Reset Firmware Image is received + /// or a new image is attempted to be loaded. + /// + /// + UpgradeMode = 0x00, + + /// + /// Not supported by OMNI+ + /// + // SevereHardwareFailure = 0x01, + + /// + /// NV memory error alarm becomes active when an NV memory location fails a checksum check. + /// + /// Alarm is triggered whenever a checksum check of any of the above modules and log entries fails. + /// + /// + NVMemoryError = 0x02, + + /// + /// Not supported by OMNI+ + /// + // DeadBattery = 0x03, + /// + /// Not supported by OMNI+ + /// + // EmptyPipe = 0x04, + /// + /// Not supported by OMNI+ + /// + // MagneticTamper = 0x05, + + + /// + /// Omni+ presently does not have the hardware capability to detect a cut or broken wire, + /// however the Alarm should be supported through the system so that once hardware is capable that no changes in the system have to be made to support the alarm. + /// + /// Trigger Condition: Detection of a broken or cut wire going to the sensor. + /// + /// + MeterDisconnectTamper = 0x06, + /// + /// Register has reached the end of its operational life. + /// + /// Trigger Condition: For a 10 year battery device, Near End of Life alarm becomes active 10.5 years from date of manufacture or 9.5 years from Date of Activation whichever is less. + /// Alarm-specific additional data field indicates number of days remaining before meter reaches end-of-life. Alarm is updated once a day at midnight. + /// + /// + NearEndOfLife = 0x07, + /// + /// NV memory error alarm becomes active when an NV memory location fails a checksum check. + /// + /// Trigger Condition: For a 10 year battery device, End-of-life alarm becomes active 11 years from date of manufacture or 10 years from Date of Activation whichever is less. + /// Alarm-specific additional data field indicates number of days elapsed after meter reached end-of-life. Alarm is updated once a day at midnight. + /// + /// + BeyondEndOfLife = 0x08, + + /// + /// Not supported by OMNI+ + /// + // CommunicationsFailure = 0x09, + /// + /// Not supported by OMNI+ + /// + // CriticalHardwareWarning = 0x10, + + /// + /// This is a one-shot alarm. Its start and stop time are the same. For that reason, this alarm is never reported as active. It persists for the persistence period. + /// + /// Trigger Condition: Reboot alarm is triggered when the register has rebooted. + /// + /// + Reboot = 0x11, + + /// + /// Not supported by OMNI+ + /// + // EMFRange = 0x12, + /// + /// Not supported by OMNI+ + /// + // LowField = 0x13, + /// + /// Not supported by OMNI+ + /// + // HighCurrent = 0x14, + + /// + /// Update Interval: Battery voltage is measured every 15 minutes + /// + /// Trigger Condition: Battery low voltage alarm becomes active when the battery voltage is below 2.7 V for an 4 consecutive 15 sample periods. + /// + /// + LowPrimaryBattery = 0x15, + + /// + /// Not supported by OMNI+ + /// + // LowSecondaryBattery = 0x16, + /// + /// Not supported by OMNI+ + /// + // GlideSlope = 0x17, + /// + /// Not supported by OMNI+ + /// + // HighTemperature = 0x18, + + /// + /// Reason for this alarm: uint32LE bitmap indicating which calibration factors/factory required parameters are missing: + /// Factory seal not set: bit 15 of the additional data. + /// + /// Trigger Conditions: Configuration error alarm becomes active when factory seal is not set. Alarm is checked once an hour. + /// + /// + ConfigError = 0x19, + + /// + /// Not supported by OMNI+ + /// + // ActuatorFailure = 0x20, + /// + /// Not supported by OMNI+ + /// + // HumiditySensorRead = 0x21 + } +} diff --git a/Common/OmniPlus/Features/Enums/StatusCodes.cs b/Common/OmniPlus/Features/Enums/StatusCodes.cs new file mode 100644 index 00000000..a45c17ec --- /dev/null +++ b/Common/OmniPlus/Features/Enums/StatusCodes.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.Enums +{ + public enum StatusCodes : byte + { + CommandCompleted = 0x01, + UnableToExecute = 0x02, + Sealed = 0x05 + } +} diff --git a/Common/OmniPlus/Features/Enums/UI1236Commands.cs b/Common/OmniPlus/Features/Enums/UI1236Commands.cs new file mode 100644 index 00000000..e80563a5 --- /dev/null +++ b/Common/OmniPlus/Features/Enums/UI1236Commands.cs @@ -0,0 +1,127 @@ +namespace OmniPlus.Features.Enums +{ + public enum UI1236Commands : byte + { + /// + /// Available after seal: Yes + /// + GetFactoryID = 0x01, + /// + /// Available after seal: No + /// + SetFactoryID = 0x02, + /// + /// Available after seal: Yes + /// + GetProgrammableID = 0x03, + /// + /// Available after seal: Yes + /// + SetProgrammableID = 0x04, + /// + /// Available after seal: Yes + /// + GetVersionandType = 0x05, + /// + /// Available after seal: Yes + /// + GetCustomerText = 0x07, + /// + /// Available after seal: Yes + /// + SetCustomerText = 0x08, + /// + /// Available after seal: Yes + /// + GetNumberofReadingDigits = 0x09, + /// + /// Available after seal: Yes + /// + SetNumberofReadingDigits = 0x0A, + /// + /// Available after seal: Yes + /// + GetReadingUnits = 0x0B, + /// + /// Available after seal: Yes + /// + SetReadingUnits = 0x0C, + /// + /// Available after seal: Yes + /// + GetRateUnits = 0x0D, + /// + /// Available after seal: Yes + /// + SetRateUnits = 0x0E, + /// + /// Available after seal: Yes + /// + GetReadingResolution = 0x0F, + /// + /// Available after seal: Yes + /// + GetRateResolution = 0x11, + /// + /// Available after seal: Yes + /// + GetReading = 0x13, + /// + /// Note1: Conditional + /// + SetReadingPreset = 0x14, + /// + /// Available after seal: Yes + /// + GetReadingMode = 0x15, + /// + /// Available after seal: Yes + /// + SetReadingMode = 0x16, + /// + /// Available after seal: Yes + /// + GetBuildInformation = 0x17, + /// + /// Available after seal: No + /// + SetBuildInformation = 0x18, + /// + /// Available after seal: Yes + /// + GetMetrologyAlarmSettings1F = 0x1F, + /// + /// Available after seal: Yes + /// + SetMetrologyAlarmSettings = 0x20, + /// + /// Available after seal: Yes + /// + GetMetrologyAlarmSettings21 = 0x21, + /// + /// Available after seal: Yes + /// + ClearMetrologyAlarms = 0x22, + /// + /// Available after seal: Yes + /// + GetAlarmPersistencePeriod = 0x25, + /// + /// Available after seal: Yes + SetAlarmPersistencePeriod = 0x26, + /// + /// Available after seal: Yes + /// + GetOptionalUniDirectionalFields = 0x27, + /// + /// Available after seal: Yes + /// + SetOptionalUniDirectionalFields = 0x28, + /// + /// Available after seal: Yes + /// + GetUniDirectionalString = 0x29 + } +} + + diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj index d5ebe558..f576989c 100644 --- a/Common/OmniPlus/OmniPlus.csproj +++ b/Common/OmniPlus/OmniPlus.csproj @@ -54,6 +54,9 @@ + + + diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs index e4c74120..496c5d36 100644 --- a/Common/OmniPlus/OmniRegister.cs +++ b/Common/OmniPlus/OmniRegister.cs @@ -24,6 +24,8 @@ namespace OmniPlus this.uniProConnection?.Close(); this.irdaConnection?.Open(); this.messageHandler = this.irdaConnection.Write; + + var bytes = this.messageHandler?.Invoke(new byte[] { 0xFD, 0xC6 }, 3000, 300); } public void ActivateUniPro() diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs index 2fb0a826..edade75d 100644 --- a/Common/OmniPlus/Program.cs +++ b/Common/OmniPlus/Program.cs @@ -6,8 +6,6 @@ { var omniRegister = new OmniRegister("COM1"); omniRegister.ActivateIrda(); - - var systemParameters = omniRegister.GetSystemParameters(); } } } From 1b59ac55ce4ca6a1e3bb4540009ee3234995c4f5 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Wed, 18 Oct 2023 15:31:14 +0200 Subject: [PATCH 13/56] All omni commands implemented as enums. Structs added for all omni commands. Additional value types added. --- .../OmniPlus/Connection/SerialPortMessage.cs | 9 +- Common/OmniPlus/Connections/IrdaConnection.cs | 2 + .../Connections/Messages/IrdaMessage.cs | 2 +- .../Connections/Messages/UI1236Message.cs | 46 ++-- .../Features/DeviceSpecific/BatteryVoltage.cs | 8 + ...eryVoltageMeasurementCalibrationFactors.cs | 9 + .../Features/DeviceSpecific/DataLogData.cs | 8 + .../DeviceSpecific/DataLogInterval.cs | 9 + .../Features/DeviceSpecific/DisplayMode.cs | 9 + .../DeviceSpecific/EnabledLCDViews.cs | 9 + .../DeviceSpecific/EnabledPredefinedAlarms.cs | 9 + .../ExtendedResolutionSetting.cs | 9 + .../DeviceSpecific/FactoryCalibration.cs | 9 + .../FactoryMeterChamberCalibrationTest.cs | 8 + .../DeviceSpecific/FactoryPulseTestMode.cs | 8 + .../Features/DeviceSpecific/FactorySeal.cs | 9 + .../DeviceSpecific/FieldCalibration.cs | 9 + .../Features/DeviceSpecific/InputVolume.cs | 67 +++++ .../Features/DeviceSpecific/LCDSegmentTest.cs | 8 + .../Features/DeviceSpecific/LCDTimeout.cs | 9 + .../Features/DeviceSpecific/LidState.cs | 8 + .../LifeTimeMaxSensorPulsesperSecond.cs | 9 + .../ManufacturingTestCommand.cs | 8 + .../DeviceSpecific/ManufacturingTime.cs | 9 + .../Features/DeviceSpecific/OmniSize.cs | 9 + .../DeviceSpecific/OutputPulseSettings.cs | 9 + .../DeviceSpecific/PeriodicAlarmLogEntries.cs | 8 + .../Features/DeviceSpecific/RebootCount.cs | 9 + .../DeviceSpecific/RegisterDeviceIDString.cs | 9 + .../DeviceSpecific/RegisterSetting.cs | 9 + .../Features/DeviceSpecific/SecondsActive.cs | 8 + .../SendFlexNetSerialCommands.cs | 8 + .../SendMultipleFlexNetSerialCommands.cs | 8 + .../DeviceSpecific/SystemParameters.cs | 63 +++++ .../Features/DeviceSpecific/SystemTime.cs | 9 + .../Features/DeviceSpecific/TestPulse.cs | 8 + .../DeviceSpecific/TestTotalizerValue.cs | 9 + .../DeviceSpecific/TimeofFactorySeal.cs | 8 + .../DeviceSpecific/TimeofInstallation.cs | 9 + .../DeviceSpecific/TriggerWatchdogReset.cs | 8 + .../OmniPlus/Features/Enums/DeviceCommands.cs | 234 ++++++++++++++++++ Common/OmniPlus/Features/Enums/MeterRanges.cs | 11 + Common/OmniPlus/Features/Enums/MeterSizes.cs | 14 ++ Common/OmniPlus/Features/Enums/Status.cs | 47 ++++ Common/OmniPlus/Features/Enums/StatusCodes.cs | 9 - Common/OmniPlus/Features/Enums/UI1203Units.cs | 26 ++ .../OmniPlus/Features/Enums/UI1236Commands.cs | 12 +- Common/OmniPlus/Features/Types/ASCIIString.cs | 22 ++ Common/OmniPlus/Features/Types/Control.cs | 66 +++++ Common/OmniPlus/Features/Types/MeterRange.cs | 24 ++ Common/OmniPlus/Features/Types/MeterSize.cs | 24 ++ .../Features/Types/TimeSinse20000101.cs | 28 +++ .../Features/Types/TypesExtensions.cs | 30 +++ .../Features/UI1236/AlarmPersistencePeriod.cs | 8 + .../Features/UI1236/BuildInformation.cs | 8 + .../Features/UI1236/ClearMetrologyAlarms.cs | 7 + .../OmniPlus/Features/UI1236/CustomerText.cs | 8 + Common/OmniPlus/Features/UI1236/FactoryID.cs | 8 + .../UI1236/MetrologyAlarmSettings1F.cs | 8 + .../UI1236/MetrologyAlarmSettings21.cs | 8 + .../Features/UI1236/NumberOfReadingDigits.cs | 8 + .../UI1236/OptionalUniDirectionalFields.cs | 8 + .../Features/UI1236/ProgrammableID.cs | 8 + .../Features/UI1236/RateResolution.cs | 7 + Common/OmniPlus/Features/UI1236/RateUnits.cs | 8 + Common/OmniPlus/Features/UI1236/Reading.cs | 7 + .../OmniPlus/Features/UI1236/ReadingMode.cs | 8 + .../OmniPlus/Features/UI1236/ReadingPreset.cs | 7 + .../Features/UI1236/ReadingResolution.cs | 7 + .../OmniPlus/Features/UI1236/ReadingUnits.cs | 8 + .../Features/UI1236/UniDirectionalString.cs | 7 + .../Features/UI1236/VersionAndType.cs | 7 + Common/OmniPlus/Messages/FixedMessages.cs | 29 --- Common/OmniPlus/Messages/SetInputVolume.cs | 36 --- Common/OmniPlus/Messages/SystemParameters.cs | 70 ------ Common/OmniPlus/OmniPlus.csproj | 75 +++++- Common/OmniPlus/OmniRegister.cs | 17 +- Common/OmniPlus/Program.cs | 15 +- Common/OmniPlus/Types/ASCIIString.cs | 19 -- Common/OmniPlus/Types/Battery.cs | 24 -- Common/OmniPlus/Types/Bytes.cs | 21 -- Common/OmniPlus/Types/Seconds.cs | 23 -- Common/OmniPlus/Types/TypesExtensions.cs | 7 - 83 files changed, 1234 insertions(+), 275 deletions(-) create mode 100644 Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/LidState.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs create mode 100644 Common/OmniPlus/Features/Enums/DeviceCommands.cs create mode 100644 Common/OmniPlus/Features/Enums/MeterRanges.cs create mode 100644 Common/OmniPlus/Features/Enums/MeterSizes.cs create mode 100644 Common/OmniPlus/Features/Enums/Status.cs delete mode 100644 Common/OmniPlus/Features/Enums/StatusCodes.cs create mode 100644 Common/OmniPlus/Features/Enums/UI1203Units.cs create mode 100644 Common/OmniPlus/Features/Types/ASCIIString.cs create mode 100644 Common/OmniPlus/Features/Types/Control.cs create mode 100644 Common/OmniPlus/Features/Types/MeterRange.cs create mode 100644 Common/OmniPlus/Features/Types/MeterSize.cs create mode 100644 Common/OmniPlus/Features/Types/TimeSinse20000101.cs create mode 100644 Common/OmniPlus/Features/Types/TypesExtensions.cs create mode 100644 Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs create mode 100644 Common/OmniPlus/Features/UI1236/BuildInformation.cs create mode 100644 Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs create mode 100644 Common/OmniPlus/Features/UI1236/CustomerText.cs create mode 100644 Common/OmniPlus/Features/UI1236/FactoryID.cs create mode 100644 Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs create mode 100644 Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs create mode 100644 Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs create mode 100644 Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs create mode 100644 Common/OmniPlus/Features/UI1236/ProgrammableID.cs create mode 100644 Common/OmniPlus/Features/UI1236/RateResolution.cs create mode 100644 Common/OmniPlus/Features/UI1236/RateUnits.cs create mode 100644 Common/OmniPlus/Features/UI1236/Reading.cs create mode 100644 Common/OmniPlus/Features/UI1236/ReadingMode.cs create mode 100644 Common/OmniPlus/Features/UI1236/ReadingPreset.cs create mode 100644 Common/OmniPlus/Features/UI1236/ReadingResolution.cs create mode 100644 Common/OmniPlus/Features/UI1236/ReadingUnits.cs create mode 100644 Common/OmniPlus/Features/UI1236/UniDirectionalString.cs create mode 100644 Common/OmniPlus/Features/UI1236/VersionAndType.cs delete mode 100644 Common/OmniPlus/Messages/FixedMessages.cs delete mode 100644 Common/OmniPlus/Messages/SetInputVolume.cs delete mode 100644 Common/OmniPlus/Messages/SystemParameters.cs delete mode 100644 Common/OmniPlus/Types/ASCIIString.cs delete mode 100644 Common/OmniPlus/Types/Battery.cs delete mode 100644 Common/OmniPlus/Types/Bytes.cs delete mode 100644 Common/OmniPlus/Types/Seconds.cs delete mode 100644 Common/OmniPlus/Types/TypesExtensions.cs diff --git a/Common/OmniPlus/Connection/SerialPortMessage.cs b/Common/OmniPlus/Connection/SerialPortMessage.cs index a79b831b..472c204f 100644 --- a/Common/OmniPlus/Connection/SerialPortMessage.cs +++ b/Common/OmniPlus/Connection/SerialPortMessage.cs @@ -6,10 +6,13 @@ namespace OmniPlus.Connection { protected readonly byte[] bytes; protected readonly byte[] payload; + protected readonly bool isResponse; - protected SerialPortMessage(byte[] bytes, bool full) + protected SerialPortMessage(byte[] bytes, bool response) { - if (full) + this.isResponse = response; + + if (this.isResponse) { this.bytes = bytes; this.payload = this.ParseMessage(bytes); @@ -21,7 +24,7 @@ namespace OmniPlus.Connection } } - public int Length => this.bytes?.Length ?? 0; + public int Length => this.bytes.Length; public byte[] Payload => this.payload; diff --git a/Common/OmniPlus/Connections/IrdaConnection.cs b/Common/OmniPlus/Connections/IrdaConnection.cs index 1acee027..57619ce5 100644 --- a/Common/OmniPlus/Connections/IrdaConnection.cs +++ b/Common/OmniPlus/Connections/IrdaConnection.cs @@ -49,6 +49,8 @@ this.SerialPortConnection_Read(); #endregion + Thread.Sleep(1); + while (!received && timeout >= 0) { timeout -= delay; diff --git a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs index 6826e7f6..decc12cf 100644 --- a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs +++ b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs @@ -9,7 +9,7 @@ namespace OmniPlus.Connections.Messages public const int MIN_LENGTH = 5; public const int CRC_LENGTH = 2; - public IrdaMessage(byte[] bytes, bool full = false) : base(bytes, full) + public IrdaMessage(byte[] bytes, bool response = false) : base(bytes, response) { } diff --git a/Common/OmniPlus/Connections/Messages/UI1236Message.cs b/Common/OmniPlus/Connections/Messages/UI1236Message.cs index d3d4f2e1..755cccfb 100644 --- a/Common/OmniPlus/Connections/Messages/UI1236Message.cs +++ b/Common/OmniPlus/Connections/Messages/UI1236Message.cs @@ -1,4 +1,6 @@ using OmniPlus.Connection; +using OmniPlus.Features.Enums; +using OmniPlus.Features.Types; using System; @@ -6,40 +8,54 @@ namespace OmniPlus.Connections.Messages { public class UI1236Message : SerialPortMessage { - public const int MIN_LENGTH = 5; public const byte START_BYTE = 0x0D; + public const byte MIN_LENGTH = 0x05; - public UI1236Message(byte[] bytes, bool full = false) : base(bytes, full) + public UI1236Message(byte[] bytes, bool response = false) : base(bytes, response) { } + public byte Start => this.bytes[0]; + + public byte DataLength => this.bytes[1]; + + public Control Control => this.bytes[2]; + + public Status Status + => this.isResponse + ? (Status)this.bytes[3] + : Status.Completed; + protected override byte[] CreateMessage(byte[] payload) { - var length = payload.Length + MIN_LENGTH; - var evenOffset = length % 2; - length += evenOffset; - + var messageLength = payload.Length + MIN_LENGTH; + var even = messageLength % 2; + messageLength += even; + + var message = new byte[messageLength]; var index = 0; - var message = new byte[length]; + message[index++] = START_BYTE; - message[index++] = (byte)(length - 3); - message[index++] = 0x08; // TODO: control byte + message[index++] = (byte)payload.Length; + + Control control = 0; + control.ReturnResponse = true; + message[index++] = control; payload.CopyTo(message, index); - var checksum = message.CalculateCheckSum16(length); - message[length - evenOffset - 2] = checksum[1]; - message[length - evenOffset - 1] = checksum[0]; + var checksum = message.CalculateCheckSum16(messageLength); + message[messageLength - even - 2] = checksum[1]; + message[messageLength - even - 1] = checksum[0]; return message; } protected override byte[] ParseMessage(byte[] message) { - var payloadLength = message[1] - (message.Length - message[1]); - var payload = new byte[payloadLength]; + var payload = new byte[message.Length - MIN_LENGTH]; - Array.Copy(message, 3, payload, 0, payloadLength); + Array.Copy(message, 3, payload, 0, payload.Length); return payload; } diff --git a/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs b/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs new file mode 100644 index 00000000..8e350522 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct BatteryVoltage + { + public const byte BASE = 0xFD; + public const byte GET = 0xA9; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs b/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs new file mode 100644 index 00000000..2cc70396 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct BatteryVoltageMeasurementCalibrationFactors + { + public const byte BASE = 0xFD; + public const byte GET = 0xAA; + public const byte SET = 0xAB; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs b/Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs new file mode 100644 index 00000000..4d1ae41e --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct DataLogData + { + public const byte BASE = 0xFD; + public const byte GET = 0x80; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs b/Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs new file mode 100644 index 00000000..bc05b4e0 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct DataLogInterval + { + public const byte BASE = 0xFD; + public const byte SET = 0x7D; + public const byte GET = 0x7E; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs b/Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs new file mode 100644 index 00000000..e6970af0 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct DisplayMode + { + public const byte BASE = 0xFD; + public const byte GET = 0x14; + public const byte SET = 0x15; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs b/Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs new file mode 100644 index 00000000..255cbaac --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct EnabledLCDViews + { + public const byte BASE = 0xFD; + public const byte GET = 0x7B; + public const byte SET = 0x7C; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs b/Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs new file mode 100644 index 00000000..04ae1b83 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct EnabledPredefinedAlarms + { + public const byte BASE = 0xFD; + public const byte GET = 0x12; + public const byte SET = 0x13; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs b/Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs new file mode 100644 index 00000000..99e0394f --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct ExtendedResolutionSetting + { + public const byte BASE = 0xFD; + public const byte GET = 0x28; + public const byte SET = 0x29; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs new file mode 100644 index 00000000..15f2dadc --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct FactoryCalibration + { + public const byte BASE = 0xFD; + public const byte GET = 0x08; + public const byte SET = 0x09; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs new file mode 100644 index 00000000..4bc63a18 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct FactoryMeterChamberCalibrationTest + { + public const byte BASE = 0xFD; + public const byte SET = 0x67; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs new file mode 100644 index 00000000..a6f7fcb7 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct FactoryPulseTestMode + { + public const byte BASE = 0xFD; + public const byte SET = 0x1B; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs b/Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs new file mode 100644 index 00000000..a62052f7 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct FactorySeal + { + public const byte BASE = 0xFD; + public const byte GET = 0x63; + public const byte SET = 0x64; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs b/Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs new file mode 100644 index 00000000..9cf4a007 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct FieldCalibration + { + public const byte BASE = 0xFD; + public const byte GET = 0x0A; + public const byte SET = 0x0B; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs b/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs new file mode 100644 index 00000000..138198d3 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs @@ -0,0 +1,67 @@ +using OmniPlus.Features.Enums; +using OmniPlus.Features.Types; + +using System; + +namespace OmniPlus.Features.DeviceSpecific +{ + public struct InputVolume + { + public const byte BASE = 0xFD; + public const byte GET = 0x02; + public const byte SET = 0x03; + + private InputVolume(byte[] bytes) : this() + { + this.Status = Status.UnknownCommand; + this.MilliliterPerPulse = default(ushort); + this.FractionalPart = default(ushort); + this.MeterSize = default(byte); + this.MeterRange = default(byte); + + if (bytes?.Length == 6) + { + this.Status = (Status)bytes[0]; + this.MilliliterPerPulse = BitConverter.ToUInt16(bytes, 1); + this.MilliliterPerPulse = BitConverter.ToUInt16(bytes, 3); + this.MeterSize = bytes[5]; + this.MeterRange = bytes[6]; + } + } + + public Status Status { get; } + + public ushort MilliliterPerPulse { get; set; } + + public ushort FractionalPart { get; set; } + + public MeterSize MeterSize { get; set; } + + public MeterRange MeterRange { get; set; } + + public static byte[] GetCommand + => new byte[] { BASE, GET }; + + public static implicit operator InputVolume(byte[] bytes) + => new InputVolume(bytes); + + public static implicit operator byte[] (InputVolume inputVolume) + { + var bytes = new byte[8]; + + bytes[0] = BASE; + bytes[1] = SET; + + BitConverter.GetBytes(inputVolume.MilliliterPerPulse).CopyTo(bytes, 2); + BitConverter.GetBytes(inputVolume.FractionalPart).CopyTo(bytes, 4); + + bytes[6] = inputVolume.MeterSize; + bytes[7] = inputVolume.MeterRange; + + return bytes; + } + } +} + + + diff --git a/Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs b/Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs new file mode 100644 index 00000000..627eb38e --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct LCDSegmentTest + { + public const byte BASE = 0xFD; + public const byte SET = 0x62; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs b/Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs new file mode 100644 index 00000000..07d34aa2 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct LCDTimeout + { + public const byte BASE = 0xFD; + public const byte GET = 0x8B; + public const byte SET = 0x8C; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/LidState.cs b/Common/OmniPlus/Features/DeviceSpecific/LidState.cs new file mode 100644 index 00000000..2fa1b93f --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/LidState.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct LidState + { + public const byte BASE = 0xFD; + public const byte GET = 0xAC; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs b/Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs new file mode 100644 index 00000000..3b317656 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct LifeTimeMaxSensorPulsesperSecond + { + public const byte BASE = 0xFD; + public const byte GET = 0x22; + public const byte SET = 0x23; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs b/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs new file mode 100644 index 00000000..05090d3e --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct ManufacturingTestCommand + { + public const byte BASE = 0xFD; + public const byte SET = 0x65; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs b/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs new file mode 100644 index 00000000..9e60fddc --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct ManufacturingTime + { + public const byte BASE = 0xFD; + public const byte GET = 0x39; + public const byte SET = 0x3A; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs b/Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs new file mode 100644 index 00000000..fd338089 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct OmniSize + { + public const byte BASE = 0xFD; + public const byte GET = 0xB7; + public const byte SET = 0xB8; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs b/Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs new file mode 100644 index 00000000..f4a73e80 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct OutputPulseSettings + { + public const byte BASE = 0xFD; + public const byte GET = 0x0E; + public const byte SET = 0x0F; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs b/Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs new file mode 100644 index 00000000..6d468abb --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct PeriodicAlarmLogEntries + { + public const byte BASE = 0xFD; + public const byte GET = 0xC2; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs b/Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs new file mode 100644 index 00000000..4c3e814b --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct RebootCount + { + public const byte BASE = 0xFD; + public const byte GET = 0x55; + public const byte SET = 0x56; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs b/Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs new file mode 100644 index 00000000..a8b4b17d --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct RegisterDeviceIDString + { + public const byte BASE = 0xFD; + public const byte GET = 0x26; + public const byte SET = 0x27; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs b/Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs new file mode 100644 index 00000000..e2b211fd --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct RegisterSetting + { + public const byte BASE = 0xFD; + public const byte GET = 0x24; + public const byte SET = 0x25; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs b/Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs new file mode 100644 index 00000000..dfc697fd --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct SecondsActive + { + public const byte BASE = 0xFD; + public const byte GET = 0x3D; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs b/Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs new file mode 100644 index 00000000..b4d12083 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct SendFlexNetSerialCommands + { + public const byte BASE = 0xFD; + public const byte SET = 0x98; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs b/Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs new file mode 100644 index 00000000..97f9fcb9 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct SendMultipleFlexNetSerialCommands + { + public const byte BASE = 0xFD; + public const byte SET = 0xA2; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs b/Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs new file mode 100644 index 00000000..0d80d5c7 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs @@ -0,0 +1,63 @@ +using OmniPlus.Features.Enums; +using OmniPlus.Features.Types; + +using System; + +namespace OmniPlus.Features.DeviceSpecific +{ + public struct SystemParameters + { + public const byte BASE = 0xFD; + public const byte GET = 0xC6; + + private SystemParameters(byte[] bytes) + { + this.Status = Status.UnknownCommand; + this.BuildInfo = default(byte[]); + this.ManifacturingTime = default(uint); + this.SystemTime = default(uint); + this.RebootCount = default(byte); + this.VersionAndType = default(byte[]); + this.BytteryV = default(double); + this.BytteryADC = default(uint); + this.Sealed = default(bool); + + if (bytes?.Length >= 60) + { + this.Status = (Status)bytes[0]; + this.BuildInfo = bytes.Subarray(1, 16); + this.ManifacturingTime = BitConverter.ToUInt32(bytes, 17); + this.SystemTime = BitConverter.ToUInt32(bytes, 21); + this.RebootCount = bytes[25]; + this.VersionAndType = bytes.Subarray(26, 27); + this.BytteryV = BitConverter.ToUInt16(bytes, 53) / 1000.0; + this.BytteryADC = BitConverter.ToUInt32(bytes, 55); + this.Sealed = bytes[59] == 1; + } + } + + public Status Status { get; } + + public ASCIIString BuildInfo { get; } + + public TimeSinse20000101 ManifacturingTime { get; } + + public TimeSinse20000101 SystemTime { get; } + + public byte RebootCount { get; } + + public ASCIIString VersionAndType { get; } + + public double BytteryV { get; } + + public uint BytteryADC { get; } + + public bool Sealed { get; } + + public static byte[] GetCommand + => new byte[] { BASE, GET }; + + public static implicit operator SystemParameters(byte[] bytes) + => new SystemParameters(bytes); + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs b/Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs new file mode 100644 index 00000000..363966ab --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct SystemTime + { + public const byte BASE = 0xFD; + public const byte GET = 0x10; + public const byte SET = 0x11; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs b/Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs new file mode 100644 index 00000000..e2d3ec2f --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct TestPulse + { + public const byte BASE = 0xFD; + public const byte SET = 0x66; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs b/Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs new file mode 100644 index 00000000..a8a31bc7 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct TestTotalizerValue + { + public const byte BASE = 0xFD; + public const byte GET = 0x06; + public const byte SET = 0x07; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs b/Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs new file mode 100644 index 00000000..bf6874d6 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct TimeofFactorySeal + { + public const byte BASE = 0xFD; + public const byte GET = 0x05; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs b/Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs new file mode 100644 index 00000000..5254aeb1 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct TimeofInstallation + { + public const byte BASE = 0xFD; + public const byte GET = 0xBC; + public const byte SET = 0xBD; + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs b/Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs new file mode 100644 index 00000000..e7553b0b --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.DeviceSpecific +{ + public struct TriggerWatchdogReset + { + public const byte BASE = 0xFD; + public const byte SET = 0x8D; + } +} diff --git a/Common/OmniPlus/Features/Enums/DeviceCommands.cs b/Common/OmniPlus/Features/Enums/DeviceCommands.cs new file mode 100644 index 00000000..70f7424b --- /dev/null +++ b/Common/OmniPlus/Features/Enums/DeviceCommands.cs @@ -0,0 +1,234 @@ +namespace OmniPlus.Features.Enums +{ + public enum DeviceCommands : byte + { + /// + /// Device specific + /// + Specific = 0xFD, + /// + ///Available after seal: Yes + /// + GetInputVolumeValue = 0x02, + /// + ///Available after seal: No + /// + SetInputVolumeValue = 0x03, + /// + ///Available after seal: Yes + /// + GetTimeofFactorySeal = 0x05, + /// + ///Available after seal: Yes + /// + GetTestTotalizerValue = 0x06, + /// + ///Available after seal: Yes + /// + SetTestTotalizerValue = 0x07, + /// + ///Available after seal: Yes + /// + GetFactoryCalibration = 0x08, + /// + ///Available after seal: No + /// + SetFactoryCalibration = 0x09, + /// + ///Available after seal: Yes + /// + GetFieldCalibration = 0x0A, + /// + ///Available after seal: Yes + /// + SetFieldCalibration = 0x0B, + /// + ///Available after seal: Yes + /// + GetOutputPulseSettings = 0x0E, + /// + ///Available after seal: Yes + /// + SetOutputPulseSettings = 0x0F, + /// + ///Available after seal: Yes + /// + GetSystemTime = 0x10, + /// + ///Available after seal: Yes + /// + SetSystemTime = 0x11, + /// + ///Available after seal: Yes + /// + GetEnabledPredefinedAlarms = 0x12, + /// + ///Available after seal: Yes + /// + SetEnabledPredefinedAlarms = 0x13, + /// + ///Available after seal: Yes + /// + GetDisplayMode = 0x14, + /// + ///Available after seal: Yes + /// + SetDisplayMode = 0x15, + /// + ///Available after seal: No + /// + SetFactoryPulseTestMode = 0x1B, + /// + ///Available after seal: Yes + /// + GetLifeTimeMaxSensorPulsesperSecond = 0x22, + /// + ///Available after seal: No + /// + SetLifeTimeMaxSensorPulsesperSecond = 0x23, + /// + ///Available after seal: Yes + /// + GetRegisterSetting = 0x24, + /// + ///Available after seal: No + /// + SetRegisterSetting = 0x25, + /// + ///Available after seal: Yes + /// + GetRegisterDeviceIDString = 0x26, + /// + ///Available after seal: No + /// + SetRegisterDeviceIDString = 0x27, + /// + ///Available after seal: Yes + /// + GetExtendedResolutionSetting = 0x28, + /// + ///Available after seal: Yes + /// + SetExtendedResolutionSetting = 0x29, + /// + ///Available after seal: Yes + /// + GetManufacturingTime = 0x39, + /// + ///Available after seal: No + /// + SetManufacturingTime = 0x3A, + /// + ///Available after seal: Yes + /// + GetSecondsActive = 0x3D, + /// + ///Available after seal: Yes + /// + Getrebootcount = 0x55, + /// + ///Available after seal: No + /// + Setrebootcount = 0x56, + /// + ///Available after seal: No + /// + SetLCDSegmentTest = 0x62, + /// + ///Available after seal: Yes + /// + GetFactorySeal = 0x63, + /// + ///Available after seal: No + /// + SetFactorySeal = 0x64, + /// + ///Available after seal: Conditional + /// + ManufacturingTestCommand = 0x65, + /// + ///Available after seal: Yes + /// + SetTestPulse = 0x66, + /// + ///Available after seal: No + /// + FactoryMeterChamberCalibrationTest = 0x67, + /// + ///Available after seal: Yes + /// + GetEnabledLCDViews = 0x7B, + /// + ///Available after seal: Yes + /// + SetEnabledLCDViews = 0x7C, + /// + ///Available after seal: Yes + /// + SetDataLogInterval = 0x7D, + /// + ///Available after seal: Yes + /// + GetDataLogInterval = 0x7E, + /// + ///Available after seal: Yes + /// + GetDataLogData = 0x80, + /// + ///Available after seal: Yes + /// + GetLCDTimeout = 0x8B, + /// + ///Available after seal: Yes + /// + SetLCDTimeout = 0x8C, + /// + ///Available after seal: Yes + /// + TriggerWatchdogReset = 0x8D, + /// + ///Available after seal: Yes + /// + SendFlexNetSerialCommands = 0x98, + /// + ///Available after seal: Yes + /// + SendMultipleFlexNetSerialCommands = 0xA2, + /// + ///Available after seal: Yes + /// + GetBatteryVoltage = 0xA9, + /// + ///Available after seal: Yes + /// + GetBatteryVoltageMeasurementCalibrationFactors = 0xAA, + /// + ///Available after seal: No + /// + SetBatteryVoltageMeasurementCalibrationFactors = 0xAB, + /// + ///Available after seal: Yes + /// + GetLidState = 0xAC, + /// + ///Available after seal: Yes + /// + GetMeterSize = 0xB7, + /// + ///Available after seal: Yes + /// + SetMeterSize = 0xB8, + /// + ///Available after seal: Yes + /// + GetTimeofInstallation = 0xBC, + /// + ///Available after seal: No + /// + SetTimeofInstallation = 0xBD, + /// + ///Available after seal: Yes + /// + GetPeriodicAlarmLogEntries = 0xC2 + } +} diff --git a/Common/OmniPlus/Features/Enums/MeterRanges.cs b/Common/OmniPlus/Features/Enums/MeterRanges.cs new file mode 100644 index 00000000..cf5ec8ab --- /dev/null +++ b/Common/OmniPlus/Features/Enums/MeterRanges.cs @@ -0,0 +1,11 @@ +namespace OmniPlus.Features.Enums +{ + public enum MeterRanges : byte + { + From1To2 = 0x00, + From3To4 = 0x01, + SixInch = 0x02, + EightInch = 0x03, + TenInch = 0x04, + } +} diff --git a/Common/OmniPlus/Features/Enums/MeterSizes.cs b/Common/OmniPlus/Features/Enums/MeterSizes.cs new file mode 100644 index 00000000..48509d08 --- /dev/null +++ b/Common/OmniPlus/Features/Enums/MeterSizes.cs @@ -0,0 +1,14 @@ +namespace OmniPlus.Features.Enums +{ + public enum MeterSizes : byte + { + Unknown = 0x00, + OneHalfIn = 0x05, + TwoIn = 0x06, + ThreeIn = 0x07, + FourIn = 0x08, + SixIn = 0x09, + EightIn = 0x0A, + TenIn = 0x0B, + } +} diff --git a/Common/OmniPlus/Features/Enums/Status.cs b/Common/OmniPlus/Features/Enums/Status.cs new file mode 100644 index 00000000..370dd95b --- /dev/null +++ b/Common/OmniPlus/Features/Enums/Status.cs @@ -0,0 +1,47 @@ +namespace OmniPlus.Features.Enums +{ + public enum Status : byte + { + /// + /// Used by communication devices to indicate communication failure/timeout. Should not be used by a slave device implementing UI-1236. + /// + FailureOrTimeout = 0x00, + /// + /// Command complete, no errors + /// + Completed = 0x01, + /// + /// Error, unable to execute command + /// + UnableToExecute = 0x02, + /// + /// Error, unknown command + /// + UnknownCommand = 0x03, + /// + /// Error, unsupported control bit pattern + /// + UnsupportedControl = 0x04, + /// + /// Error, command blocked by factory seal. Added in version B1.23 + /// + BlockedBySeal = 0x05, + /// + /// Frame received, no error + /// + FrameReceived = 0xFC, + /// + /// Message corrupt + /// + MessageCorrupt = 0xFD, + /// + /// Wait status + /// + Waiting = 0xFE, + /// + /// Used by communication devices to indicate unrecognized communication device command. + /// + UnrecognizedDevice = 0xFF + + } +} diff --git a/Common/OmniPlus/Features/Enums/StatusCodes.cs b/Common/OmniPlus/Features/Enums/StatusCodes.cs deleted file mode 100644 index a45c17ec..00000000 --- a/Common/OmniPlus/Features/Enums/StatusCodes.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum StatusCodes : byte - { - CommandCompleted = 0x01, - UnableToExecute = 0x02, - Sealed = 0x05 - } -} diff --git a/Common/OmniPlus/Features/Enums/UI1203Units.cs b/Common/OmniPlus/Features/Enums/UI1203Units.cs new file mode 100644 index 00000000..fa0dee57 --- /dev/null +++ b/Common/OmniPlus/Features/Enums/UI1203Units.cs @@ -0,0 +1,26 @@ +namespace OmniPlus.Features.Enums +{ + public enum UI1203Units : byte + { + /// + /// Cubic meters + /// + M3 = 0x00, + /// + /// Cubic feets + /// + CF = 0x01, + /// + /// US gallons + /// + GAL = 0x04, + /// + /// Imperial gallons + /// + IGAL = 0x05, + /// + /// Acre feets + /// + AF = 0x06, + } +} diff --git a/Common/OmniPlus/Features/Enums/UI1236Commands.cs b/Common/OmniPlus/Features/Enums/UI1236Commands.cs index e80563a5..9ce08108 100644 --- a/Common/OmniPlus/Features/Enums/UI1236Commands.cs +++ b/Common/OmniPlus/Features/Enums/UI1236Commands.cs @@ -21,7 +21,7 @@ /// /// Available after seal: Yes /// - GetVersionandType = 0x05, + GetVersionAndType = 0x05, /// /// Available after seal: Yes /// @@ -33,11 +33,11 @@ /// /// Available after seal: Yes /// - GetNumberofReadingDigits = 0x09, + GetNumberOfReadingDigits = 0x09, /// /// Available after seal: Yes /// - SetNumberofReadingDigits = 0x0A, + SetNumberOfReadingDigits = 0x0A, /// /// Available after seal: Yes /// @@ -93,11 +93,15 @@ /// /// Available after seal: Yes /// - SetMetrologyAlarmSettings = 0x20, + SetMetrologyAlarmSettings1F = 0x20, /// /// Available after seal: Yes /// GetMetrologyAlarmSettings21 = 0x21, + /// + /// Available after seal: Yes + /// + SetMetrologyAlarmSettings21 = 0x20, /// /// Available after seal: Yes /// diff --git a/Common/OmniPlus/Features/Types/ASCIIString.cs b/Common/OmniPlus/Features/Types/ASCIIString.cs new file mode 100644 index 00000000..0f7c1d2e --- /dev/null +++ b/Common/OmniPlus/Features/Types/ASCIIString.cs @@ -0,0 +1,22 @@ +namespace OmniPlus.Features.Types +{ + using System; + using System.Text; + + public struct ASCIIString + { + private readonly string value; + + private ASCIIString(byte[] data) + => this.value = Encoding.ASCII.GetString(data); + + public override string ToString() + => this.value; + + public static implicit operator ASCIIString(byte[] data) + => new ASCIIString(data ?? Array.Empty()); + + public static implicit operator byte[](ASCIIString asciiString) + => Encoding.ASCII.GetBytes(asciiString.value ?? string.Empty); + } +} diff --git a/Common/OmniPlus/Features/Types/Control.cs b/Common/OmniPlus/Features/Types/Control.cs new file mode 100644 index 00000000..72c8161f --- /dev/null +++ b/Common/OmniPlus/Features/Types/Control.cs @@ -0,0 +1,66 @@ +namespace OmniPlus.Features.Types +{ + public class Control + { + private readonly byte[] bits; + + private Control(byte[] bits) + => this.bits = bits; + + public bool E0Encryption => this.bits[0] == 1; + + public bool E1Encryption => this.bits[1] == 1; + + public bool E2Encryption => this.bits[2] == 1; + + public bool ReturnResponse + { + get => this.bits[3] == 1; + set => this.bits[3] = (byte)(value ? 1 : 0); + } + + public bool NFNetwork => this.bits[4] == 1; + + public bool MultipleCommands + { + get => this.bits[5] == 1; + set => this.bits[5] = (byte)(value ? 1 : 0); + } + + public bool LongControl + { + get => this.bits[6] == 1; + set => this.bits[6] = (byte)(value ? 1 : 0); + } + + public bool MultipleFrames + { + get => this.bits[7] == 1; + set => this.bits[7] = (byte)(value ? 1 : 0); + } + + public static implicit operator Control(byte controlByte) + { + var bits = new byte[8]; + + for (int i = 0; i < 8; i++) + { + bits[i] = (byte)((controlByte >> i) & 1); + } + + return new Control(bits); + } + + public static implicit operator byte (Control control) + { + var @byte = default(byte); + + for (int i = 0; i < 8; i++) + { + @byte ^= (byte)(control.bits[i] << i); + } + + return @byte; + } + } +} diff --git a/Common/OmniPlus/Features/Types/MeterRange.cs b/Common/OmniPlus/Features/Types/MeterRange.cs new file mode 100644 index 00000000..89d082bc --- /dev/null +++ b/Common/OmniPlus/Features/Types/MeterRange.cs @@ -0,0 +1,24 @@ +using OmniPlus.Features.Enums; + +namespace OmniPlus.Features.Types +{ + public struct MeterRange + { + private MeterRanges rangeId; + + public MeterRange(MeterRanges rangeId) + => this.rangeId = rangeId; + + public static implicit operator MeterRange(byte rangeId) + => new MeterRange((MeterRanges)rangeId); + + public static implicit operator MeterRange(MeterRanges rangeId) + => new MeterRange(rangeId); + + public static implicit operator byte(MeterRange range) + => (byte)range.rangeId; + + public static implicit operator MeterRanges(MeterRange range) + => range.rangeId; + } +} diff --git a/Common/OmniPlus/Features/Types/MeterSize.cs b/Common/OmniPlus/Features/Types/MeterSize.cs new file mode 100644 index 00000000..d1453b25 --- /dev/null +++ b/Common/OmniPlus/Features/Types/MeterSize.cs @@ -0,0 +1,24 @@ +using OmniPlus.Features.Enums; + +namespace OmniPlus.Features.Types +{ + public struct MeterSize + { + private MeterSizes sizeId; + + public MeterSize(MeterSizes sizeId) + => this.sizeId = sizeId; + + public static implicit operator MeterSize(byte sizeId) + => new MeterSize((MeterSizes)sizeId); + + public static implicit operator MeterSize(MeterSizes sizeId) + => new MeterSize(sizeId); + + public static implicit operator byte(MeterSize size) + => (byte)size.sizeId; + + public static implicit operator MeterSizes(MeterSize size) + => size.sizeId; + } +} diff --git a/Common/OmniPlus/Features/Types/TimeSinse20000101.cs b/Common/OmniPlus/Features/Types/TimeSinse20000101.cs new file mode 100644 index 00000000..3eeca835 --- /dev/null +++ b/Common/OmniPlus/Features/Types/TimeSinse20000101.cs @@ -0,0 +1,28 @@ +using System; + +namespace OmniPlus.Features.Types +{ + public struct TimeSinse20000101 + { + private readonly uint seconds; + + public TimeSinse20000101(uint seconds) + => this.seconds = seconds; + + public override string ToString() + { + DateTime dateTime = this; + + return dateTime.ToString("yyyy-MM-dd HH:mm:ss"); + } + + public static implicit operator TimeSinse20000101(uint seconds) + => new TimeSinse20000101(seconds); + + public static implicit operator uint(TimeSinse20000101 time) + => time.seconds; + + public static implicit operator DateTime(TimeSinse20000101 time) + => new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc).AddSeconds(time); + } +} diff --git a/Common/OmniPlus/Features/Types/TypesExtensions.cs b/Common/OmniPlus/Features/Types/TypesExtensions.cs new file mode 100644 index 00000000..2be8f36d --- /dev/null +++ b/Common/OmniPlus/Features/Types/TypesExtensions.cs @@ -0,0 +1,30 @@ +using System; + +namespace OmniPlus.Features.Types +{ + public static class TypesExtensions + { + public static byte[] Subarray(this byte[] sourceArray, int start, int length) + { + if (sourceArray is null) + { + throw new ArgumentNullException(nameof(sourceArray)); + } + + if (length <= 0) + { + throw new ArgumentException($"Invalid subarray length."); + } + + var subarray = new byte[length]; + var sourceL = sourceArray.Length; + + if (sourceL >= length + start) + { + Array.Copy(sourceArray, start, subarray, 0, length); + } + + return subarray; + } + } +} diff --git a/Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs b/Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs new file mode 100644 index 00000000..22653cd9 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct AlarmPersistencePeriod + { + public const byte GET = 0x25; + public const byte SET = 0x26; + } +} diff --git a/Common/OmniPlus/Features/UI1236/BuildInformation.cs b/Common/OmniPlus/Features/UI1236/BuildInformation.cs new file mode 100644 index 00000000..9205ac8c --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/BuildInformation.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct BuildInformation + { + public const byte GET = 0x17; + public const byte SET = 0x18; + } +} diff --git a/Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs b/Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs new file mode 100644 index 00000000..de85a74f --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct ClearMetrologyAlarms + { + public const byte SET = 0x22; + } +} diff --git a/Common/OmniPlus/Features/UI1236/CustomerText.cs b/Common/OmniPlus/Features/UI1236/CustomerText.cs new file mode 100644 index 00000000..cdac60cc --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/CustomerText.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct CustomerText + { + public const byte GET = 0x07; + public const byte SET = 0x08; + } +} diff --git a/Common/OmniPlus/Features/UI1236/FactoryID.cs b/Common/OmniPlus/Features/UI1236/FactoryID.cs new file mode 100644 index 00000000..84a59cb6 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/FactoryID.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct FactoryID + { + public const byte GET = 0x01; + public const byte SET = 0x02; + } +} diff --git a/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs b/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs new file mode 100644 index 00000000..3efab82b --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct MetrologyAlarmSettings1F + { + public const byte SET = 0x20; + public const byte GET = 0x1F; + } +} diff --git a/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs b/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs new file mode 100644 index 00000000..72aaa976 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct MetrologyAlarmSettings21 + { + public const byte SET = 0x20; + public const byte GET = 0x21; + } +} diff --git a/Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs b/Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs new file mode 100644 index 00000000..98cc803e --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct NumberOfReadingDigits + { + public const byte GET = 0x09; + public const byte SET = 0x0A; + } +} diff --git a/Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs b/Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs new file mode 100644 index 00000000..cdc2cc59 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct OptionalUniDirectionalFields + { + public const byte GET = 0x27; + public const byte SET = 0x28; + } +} diff --git a/Common/OmniPlus/Features/UI1236/ProgrammableID.cs b/Common/OmniPlus/Features/UI1236/ProgrammableID.cs new file mode 100644 index 00000000..6376055d --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/ProgrammableID.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct ProgrammableID + { + public const byte GET = 0x03; + public const byte SET = 0x04; + } +} diff --git a/Common/OmniPlus/Features/UI1236/RateResolution.cs b/Common/OmniPlus/Features/UI1236/RateResolution.cs new file mode 100644 index 00000000..cc2922e5 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/RateResolution.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct RateResolution + { + public const byte GET = 0x11; + } +} diff --git a/Common/OmniPlus/Features/UI1236/RateUnits.cs b/Common/OmniPlus/Features/UI1236/RateUnits.cs new file mode 100644 index 00000000..687654b6 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/RateUnits.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct RateUnits + { + public const byte GET = 0x0D; + public const byte SET = 0x0E; + } +} diff --git a/Common/OmniPlus/Features/UI1236/Reading.cs b/Common/OmniPlus/Features/UI1236/Reading.cs new file mode 100644 index 00000000..af2c739a --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/Reading.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct Reading + { + public const byte GET = 0x13; + } +} diff --git a/Common/OmniPlus/Features/UI1236/ReadingMode.cs b/Common/OmniPlus/Features/UI1236/ReadingMode.cs new file mode 100644 index 00000000..a74bec63 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/ReadingMode.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct ReadingMode + { + public const byte GET = 0x15; + public const byte SET = 0x16; + } +} diff --git a/Common/OmniPlus/Features/UI1236/ReadingPreset.cs b/Common/OmniPlus/Features/UI1236/ReadingPreset.cs new file mode 100644 index 00000000..f672a92e --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/ReadingPreset.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct ReadingPreset + { + public const byte SET = 0x14; + } +} diff --git a/Common/OmniPlus/Features/UI1236/ReadingResolution.cs b/Common/OmniPlus/Features/UI1236/ReadingResolution.cs new file mode 100644 index 00000000..3814e5e3 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/ReadingResolution.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct ReadingResolution + { + public const byte GET = 0x0F; + } +} diff --git a/Common/OmniPlus/Features/UI1236/ReadingUnits.cs b/Common/OmniPlus/Features/UI1236/ReadingUnits.cs new file mode 100644 index 00000000..bfdba0ff --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/ReadingUnits.cs @@ -0,0 +1,8 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct ReadingUnits + { + public const byte GET = 0x0B; + public const byte SET = 0x0C; + } +} diff --git a/Common/OmniPlus/Features/UI1236/UniDirectionalString.cs b/Common/OmniPlus/Features/UI1236/UniDirectionalString.cs new file mode 100644 index 00000000..51a1dcc6 --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/UniDirectionalString.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct UniDirectionalString + { + public const byte GET = 0x29; + } +} diff --git a/Common/OmniPlus/Features/UI1236/VersionAndType.cs b/Common/OmniPlus/Features/UI1236/VersionAndType.cs new file mode 100644 index 00000000..4026ba1a --- /dev/null +++ b/Common/OmniPlus/Features/UI1236/VersionAndType.cs @@ -0,0 +1,7 @@ +namespace OmniPlus.Features.UI1236 +{ + public struct VersionAndType + { + public const byte GET = 0x05; + } +} diff --git a/Common/OmniPlus/Messages/FixedMessages.cs b/Common/OmniPlus/Messages/FixedMessages.cs deleted file mode 100644 index 882e88e9..00000000 --- a/Common/OmniPlus/Messages/FixedMessages.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace OmniPlus.Messages -{ - public class FixedMessages - { - /// - /// Each bytes array describes following state: - /// 0: pulse, 1: direction, 2-3: fractional portion ml/Pulse, 4: meter size, 5 meter range - /// - private static readonly byte[][] flowCalibrationSetup = new byte[][] - { - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 0: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 1: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 2: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 3: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 4: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 5: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x06, 0x00 }, // 6: Meters of size 2" - new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x07, 0x01 }, // 7: Meters of size 3" - new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x08, 0x01 }, // 8: Meters of size 4" - new byte[] { 0x06, 0x00, 0x72, 0x41, 0x09, 0x02 }, // 9: Meters of size 6" - new byte[] { 0x01, 0x80, 0xCE, 0x8F, 0x0A, 0x03 }, // 10: Meters of size 8" - new byte[] { 0x02, 0x80, 0xA3, 0x54, 0x0B, 0x04 }, // 11: Meters of size 10" - }; - - - public static byte[] FlowCalibrationSetup(byte meterSize) - => flowCalibrationSetup[meterSize % flowCalibrationSetup.Length - 1]; - } -} diff --git a/Common/OmniPlus/Messages/SetInputVolume.cs b/Common/OmniPlus/Messages/SetInputVolume.cs deleted file mode 100644 index 612f81d6..00000000 --- a/Common/OmniPlus/Messages/SetInputVolume.cs +++ /dev/null @@ -1,36 +0,0 @@ -using OmniPlus.Types; - -namespace OmniPlus.Messages -{ - public class SetInputVolume : Bytes - { - /// - /// 0: pulse, 1: direction, 2-3: fractional portion ml/Pulse, 4: meter size, 5 meter range - /// - private static readonly byte[][] defaults = new byte[][] - { - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 0: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 1: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 2: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 3: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 4: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x05, 0x00 }, // 5: Meters of size 1 1/2" - new byte[] { 0x00, 0x00, 0xE1, 0x84, 0x06, 0x00 }, // 6: Meters of size 2" - new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x07, 0x01 }, // 7: Meters of size 3" - new byte[] { 0x01, 0x00, 0x8B, 0xC6, 0x08, 0x01 }, // 8: Meters of size 4" - new byte[] { 0x06, 0x00, 0x72, 0x41, 0x09, 0x02 }, // 9: Meters of size 6" - new byte[] { 0x01, 0x80, 0xCE, 0x8F, 0x0A, 0x03 }, // 10: Meters of size 8" - new byte[] { 0x02, 0x80, 0xA3, 0x54, 0x0B, 0x04 }, // 11: Meters of size 10" - }; - - public SetInputVolume(byte[] data) : base(data) - { - } - - public static implicit operator SetInputVolume(byte size) - => defaults[size % (defaults.Length - 1)]; - - public static implicit operator SetInputVolume(byte[] bytes) - => new SetInputVolume(bytes); - } -} diff --git a/Common/OmniPlus/Messages/SystemParameters.cs b/Common/OmniPlus/Messages/SystemParameters.cs deleted file mode 100644 index 49637b7a..00000000 --- a/Common/OmniPlus/Messages/SystemParameters.cs +++ /dev/null @@ -1,70 +0,0 @@ -namespace OmniPlus.Commands -{ - using OmniPlus.Types; - - using System; - - public class SystemParameters - { - private readonly ASCIIString factoryBuild; - private readonly Seconds manifacturingTime; - private readonly Seconds systemTime; - private readonly ASCIIString firmware; - private readonly Battery battery; - private readonly byte rebootCount; - private readonly byte sealStatus; - - private SystemParameters(byte[] data) - { - this.rebootCount = default(byte); - this.sealStatus = default(byte); - this.factoryBuild = new byte[16]; - this.manifacturingTime = new byte[4]; - this.systemTime = new byte[4]; - this.firmware = new byte[27]; - this.battery = new byte[6]; - - if (data?.Length > 0) - { - var exactData = new byte[59]; - - data.CopyTo(exactData, 0); - - this.rebootCount = data[24]; - this.sealStatus = data[58]; - - Array.Copy(exactData, 0, this.factoryBuild, 0, 16); - Array.Copy(exactData, 16, this.manifacturingTime, 0, 4); - Array.Copy(exactData, 20, this.systemTime, 0, 4); - Array.Copy(exactData, 25, this.firmware, 0, 27); - Array.Copy(exactData, 52, this.battery, 0, 6); - } - } - - public bool VerifyBatteryVoltage(double minV = 3.19, double maxV = 3.75) - => minV <= this.battery.Volts && this.battery.Volts <= maxV; - - public bool VerifySystemTimeDrift(uint max = 700) - { - var baseTimeUTC = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); - var presentUTC = DateTime.UtcNow - baseTimeUTC; - var totalSeconds = Math.Abs(presentUTC.TotalSeconds - this.systemTime); - - return 0 <= totalSeconds && totalSeconds <= max; - } - - public bool VerifyRegisterAge(uint max = 365) - { - var manifacturingTimeUTC = new DateTime(this.manifacturingTime.Ticks, DateTimeKind.Utc); - var totalManifacturingDays = new TimeSpan(manifacturingTimeUTC.Ticks).TotalDays; - - return 0 <= totalManifacturingDays && totalManifacturingDays <= max; - } - - public static implicit operator SystemParameters(byte[] data) - => new SystemParameters(data); - - public static implicit operator byte[] (SystemParameters _) - => new byte[] { 0xFD, 0xC6 }; - } -} diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj index f576989c..ea3b6867 100644 --- a/Common/OmniPlus/OmniPlus.csproj +++ b/Common/OmniPlus/OmniPlus.csproj @@ -54,12 +54,71 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + @@ -67,11 +126,9 @@ - - - - - + + + diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs index 496c5d36..61faea8d 100644 --- a/Common/OmniPlus/OmniRegister.cs +++ b/Common/OmniPlus/OmniRegister.cs @@ -1,6 +1,7 @@ -using OmniPlus.Commands; -using OmniPlus.Connections; +using OmniPlus.Connections; using OmniPlus.Connections.Messages; +using OmniPlus.Features.DeviceSpecific; +using OmniPlus.Features.Enums; namespace OmniPlus { @@ -25,7 +26,7 @@ namespace OmniPlus this.irdaConnection?.Open(); this.messageHandler = this.irdaConnection.Write; - var bytes = this.messageHandler?.Invoke(new byte[] { 0xFD, 0xC6 }, 3000, 300); + var bytes = this.GetSystemParameters(); } public void ActivateUniPro() @@ -36,6 +37,14 @@ namespace OmniPlus } internal SystemParameters GetSystemParameters() - => this.messageHandler?.Invoke(new byte[] { 0xFD, 0xC6 }, 3000, 300); + => this.messageHandler?.Invoke(SystemParameters.GetCommand, 3000, 300); + + + internal bool SetInputVolume(InputVolume inputVolume) + { + inputVolume = this.messageHandler?.Invoke(inputVolume, 3000, 300); + + return inputVolume.Status == Status.Completed; + } } } diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs index edade75d..1711b0f7 100644 --- a/Common/OmniPlus/Program.cs +++ b/Common/OmniPlus/Program.cs @@ -1,4 +1,10 @@ -namespace OmniPlus +using OmniPlus.Features.DeviceSpecific; +using OmniPlus.Features.Enums; +using OmniPlus.Features.Types; + +using System; + +namespace OmniPlus { class Program { @@ -6,6 +12,13 @@ { var omniRegister = new OmniRegister("COM1"); omniRegister.ActivateIrda(); + var x = omniRegister.SetInputVolume(new InputVolume + { + MilliliterPerPulse = 1500, + FractionalPart = 500, + MeterSize = MeterSizes.OneHalfIn, + MeterRange = MeterRanges.From1To2, + }); } } } diff --git a/Common/OmniPlus/Types/ASCIIString.cs b/Common/OmniPlus/Types/ASCIIString.cs deleted file mode 100644 index b48bce08..00000000 --- a/Common/OmniPlus/Types/ASCIIString.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace OmniPlus.Types -{ - using System; - using System.Text; - - public class ASCIIString : Bytes - { - private readonly string value; - - public ASCIIString(byte[] data) : base(data) - => this.value = Encoding.ASCII.GetString(this.data); - - public override string ToString() - => this.value; - - public static implicit operator ASCIIString(byte[] data) - => new ASCIIString(data ?? Array.Empty()); - } -} diff --git a/Common/OmniPlus/Types/Battery.cs b/Common/OmniPlus/Types/Battery.cs deleted file mode 100644 index 15c39673..00000000 --- a/Common/OmniPlus/Types/Battery.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace OmniPlus.Types -{ - using System; - - public class Battery : Bytes - { - private readonly ushort volts; - private readonly uint rawADC; - - public Battery(byte[] data) : base(data) - { - this.volts = BitConverter.ToUInt16(this.data, 0); - this.rawADC = BitConverter.ToUInt32(this.data, 2); - } - - public double Volts => this.volts / 1000.0; - - public override string ToString() - => $"{this.volts}mV, {this.rawADC} ADC"; - - public static implicit operator Battery(byte[] data) - => new Battery(data ?? Array.Empty()); - } -} diff --git a/Common/OmniPlus/Types/Bytes.cs b/Common/OmniPlus/Types/Bytes.cs deleted file mode 100644 index dc0994fc..00000000 --- a/Common/OmniPlus/Types/Bytes.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace OmniPlus.Types -{ - using System; - - public class Bytes - { - protected readonly byte[] data; - - public Bytes(byte[] data) - => this.data = data; - - public string ToHexString() - => BitConverter.ToString(this.data); - - public static implicit operator byte[] (Bytes bytes) - => bytes.data ?? Array.Empty(); - - public static implicit operator Bytes (byte[] bytes) - => new Bytes(bytes ?? Array.Empty()); - } -} diff --git a/Common/OmniPlus/Types/Seconds.cs b/Common/OmniPlus/Types/Seconds.cs deleted file mode 100644 index 4cd28ac4..00000000 --- a/Common/OmniPlus/Types/Seconds.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace OmniPlus.Types -{ - using System; - - public class Seconds : Bytes - { - private readonly uint seconds; - - public Seconds(byte[] data) : base(data) - => this.seconds = BitConverter.ToUInt32(data, 0); - - public long Ticks => this.seconds * 10_000_000; - - public override string ToString() - => this.seconds.ToString(); - - public static implicit operator Seconds(byte[] data) - => new Seconds(data ?? Array.Empty()); - - public static implicit operator uint(Seconds seconds) - => seconds?.seconds ?? default(uint); - } -} diff --git a/Common/OmniPlus/Types/TypesExtensions.cs b/Common/OmniPlus/Types/TypesExtensions.cs deleted file mode 100644 index ff6901c0..00000000 --- a/Common/OmniPlus/Types/TypesExtensions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Types -{ - public static class TypesExtensions - { - - } -} From 35ba0a62eae2033a4efbfe70815f1a80f5338e74 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Wed, 18 Oct 2023 16:53:08 +0200 Subject: [PATCH 14/56] Serial port stream added --- .../Connection/SerialPortConnection.cs | 17 ++--- .../OmniPlus/Connection/SerialPortStream.cs | 66 +++++++++++++++++++ Common/OmniPlus/Connections/IrdaConnection.cs | 62 +++++------------ .../Connections/Messages/IrdaMessage.cs | 3 + Common/OmniPlus/OmniPlus.csproj | 1 + Common/OmniPlus/Program.cs | 3 - 6 files changed, 91 insertions(+), 61 deletions(-) create mode 100644 Common/OmniPlus/Connection/SerialPortStream.cs diff --git a/Common/OmniPlus/Connection/SerialPortConnection.cs b/Common/OmniPlus/Connection/SerialPortConnection.cs index b11b8e95..01a46c61 100644 --- a/Common/OmniPlus/Connection/SerialPortConnection.cs +++ b/Common/OmniPlus/Connection/SerialPortConnection.cs @@ -3,7 +3,6 @@ using OmniPlus.Connection.Enums; using OmniPlus.Connection.Events; using System; -using System.Collections.Concurrent; using System.IO; using System.IO.Ports; @@ -18,8 +17,8 @@ namespace OmniPlus.Connection private SerialPortState state; protected bool reading; + protected SerialPortStream stream; protected SerialPortOptions options; - protected ConcurrentQueue stream; protected SerialPortConnection() => this.options = new SerialPortOptions(); @@ -71,8 +70,8 @@ namespace OmniPlus.Connection try { - this.stream = new ConcurrentQueue(); - this.serialPort = new System.IO.Ports.SerialPort + this.stream = new SerialPortStream(); + this.serialPort = new SerialPort { PortName = options.PortName, BaudRate = (int)options.BaudRate, @@ -149,19 +148,15 @@ namespace OmniPlus.Connection { if (this.open && sender is System.IO.Ports.SerialPort port && port.BytesToRead > 0) { - var bytesLength = port.BytesToRead; - var bytes = new byte[bytesLength]; + var bytes = new byte[port.BytesToRead]; var lock_object = new object(); lock (lock_object) { - port.Read(bytes, 0, bytesLength); + port.Read(bytes, 0, port.BytesToRead); } - foreach (var item in bytes) - { - this.stream.Enqueue(item); - } + this.stream.Append(bytes); if (!this.reading) { diff --git a/Common/OmniPlus/Connection/SerialPortStream.cs b/Common/OmniPlus/Connection/SerialPortStream.cs new file mode 100644 index 00000000..8d416d1c --- /dev/null +++ b/Common/OmniPlus/Connection/SerialPortStream.cs @@ -0,0 +1,66 @@ +using System; + +namespace OmniPlus.Connection +{ + public class SerialPortStream + { + private readonly int minBufferLength; + + private byte[] buffer; + private int dataLength; + + public SerialPortStream(int minBufferLength = byte.MaxValue) + { + this.minBufferLength = minBufferLength; + this.buffer = new byte[this.minBufferLength]; + } + + public byte this[int index] => this.buffer[index]; + + public void Append(byte[] bytes) + { + var bytesLength = bytes?.Length ?? 0; + + if (bytesLength <= 0) + { + return; + } + + var lock_object = new object(); + + lock (lock_object) + { + if (this.dataLength + bytesLength > this.buffer.Length) + { + var buffer = new byte[this.buffer.Length * 2]; + + Array.Copy(this.buffer, 0, buffer, 0, this.dataLength); + } + + this.dataLength += bytesLength; + + Array.Copy(bytes, 0, this.buffer, this.dataLength, bytesLength); + } + } + + public void CopyTo(byte[] destinationArray, int destinationIndex, int sourceIndex, int length) + { + var requiredBufferLength = sourceIndex + length; + + if (destinationArray is null || destinationIndex < 0 || sourceIndex < 0 || requiredBufferLength > this.buffer.Length) + { + return; + } + + var lock_object = new object(); + + lock (lock_object) + { + this.dataLength = this.buffer.Length - requiredBufferLength; + + Array.Copy(this.buffer, sourceIndex, destinationArray, destinationIndex, length); + Array.Copy(this.buffer, requiredBufferLength, this.buffer, 0, this.dataLength); + } + } + } +} diff --git a/Common/OmniPlus/Connections/IrdaConnection.cs b/Common/OmniPlus/Connections/IrdaConnection.cs index 57619ce5..886420d5 100644 --- a/Common/OmniPlus/Connections/IrdaConnection.cs +++ b/Common/OmniPlus/Connections/IrdaConnection.cs @@ -44,8 +44,8 @@ #region Temporary // TODO: remove for real connections - this.stream = new System.Collections.Concurrent.ConcurrentQueue( - new byte[] { 0xFF, 0x01, 0x25, 0x00, 0x80, 0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0x0C, 0xFF, 0x01, 0x25, 0x00, 0x80, 0x88 }); + this.stream = new SerialPortStream(); + this.stream.Append(new byte[] { 0xFF, 0x01, 0x25, 0x00, 0x80, 0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0x0C, 0xFF, 0x01, 0x25, 0x00, 0x80, 0x88 }); this.SerialPortConnection_Read(); #endregion @@ -65,60 +65,28 @@ { this.reading = true; - var message = default(IrdaMessage); + var message = default(byte[]); + var length = 0; + var start = 0; - while (this.reading) + while (true) { - if (!this.stream.TryDequeue(out byte start)) + if (this.stream[start] == MSG_START) { + length = this.stream[start + 2] * 2 + 5; + message = new byte[length]; + + this.stream.CopyTo(message, 0, start, length); + break; } - if (start != MSG_START) - { - continue; - } - - _ = this.stream.TryDequeue(out byte type); - _ = this.stream.TryDequeue(out byte length); - - - var payloadLength = length * 2; - var payload = new byte[payloadLength]; - - for (int i = 0; i < payloadLength; i++) - { - if (this.stream.TryDequeue(out byte paybyte)) - { - payload[i] = paybyte; - } - else break; - } - - message = new IrdaMessage(payload); - message.Start = start; - message.Type = type; - message.DataLength = length; - - var crc16 = new byte[2]; - - for (int i = 0; i < IrdaMessage.CRC_LENGTH; i++) - { - if (this.stream.TryDequeue(out byte crcbyte)) - { - crc16[i] = crcbyte; - } - else break; - } - - message.CopyCRC16(crc16, 0); - - break; + start++; } - this.reading = false; - this.messageReceived?.Invoke(message); + + this.reading = false; } } } diff --git a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs index decc12cf..d88bcea3 100644 --- a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs +++ b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs @@ -76,5 +76,8 @@ namespace OmniPlus.Connections.Messages return payload; } + + public static implicit operator IrdaMessage(byte[] bytes) + => new IrdaMessage(bytes, true); } } diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj index ea3b6867..ab0b5a3c 100644 --- a/Common/OmniPlus/OmniPlus.csproj +++ b/Common/OmniPlus/OmniPlus.csproj @@ -54,6 +54,7 @@ + diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs index 1711b0f7..a514158e 100644 --- a/Common/OmniPlus/Program.cs +++ b/Common/OmniPlus/Program.cs @@ -1,8 +1,5 @@ using OmniPlus.Features.DeviceSpecific; using OmniPlus.Features.Enums; -using OmniPlus.Features.Types; - -using System; namespace OmniPlus { From ad62140430c968949b7190c5526d5d1e4cd2afa7 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Tue, 24 Oct 2023 08:43:18 +0200 Subject: [PATCH 15/56] omni changes --- Common/OmniPlus/Connection/Enums/BaudRate.cs | 26 +++++----- Common/OmniPlus/Connection/Enums/DataBits.cs | 8 ++-- .../Connection/SerialPortConnection.cs | 29 ++++++++--- .../OmniPlus/Connection/SerialPortOptions.cs | 10 ++-- .../OmniPlus/Connection/SerialPortStream.cs | 25 ++++++++-- Common/OmniPlus/Connections/Extensions.cs | 2 +- Common/OmniPlus/Connections/IrdaConnection.cs | 36 +++++++------- .../Connections/Messages/IrdaMessage.cs | 20 ++------ .../Connections/Messages/UI1236Message.cs | 12 ++--- .../OmniPlus/Connections/UniProConnection.cs | 4 +- .../DeviceSpecific/CalibrationResults.cs | 47 ++++++++++++++++++ .../DeviceSpecific/ConfigurationParameters.cs | 27 +++++++++++ .../FactoryMeterChamberCalibrationTest.cs | 48 ++++++++++++++++++- .../Features/DeviceSpecific/InputVolume.cs | 3 +- .../Features/Enums/CalibrationState.cs | 9 ++++ Common/OmniPlus/OmniPlus.csproj | 10 +++- Common/OmniPlus/OmniRegister.cs | 12 +++-- Common/OmniPlus/Program.cs | 33 ++++++++----- 18 files changed, 266 insertions(+), 95 deletions(-) create mode 100644 Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs create mode 100644 Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs create mode 100644 Common/OmniPlus/Features/Enums/CalibrationState.cs diff --git a/Common/OmniPlus/Connection/Enums/BaudRate.cs b/Common/OmniPlus/Connection/Enums/BaudRate.cs index 716fddb4..0418af62 100644 --- a/Common/OmniPlus/Connection/Enums/BaudRate.cs +++ b/Common/OmniPlus/Connection/Enums/BaudRate.cs @@ -2,18 +2,18 @@ { public enum BaudRate { - X300 = 300, - X600 = 600, - X1200 = 1200, - X2400 = 2400, - X4800 = 4800, - X9600 = 9600, - X19200 = 19200, - X38400 = 38400, - X57600 = 57600, - X115200 = 115200, - X230400 = 230400, - X460800 = 460800, - X921600 = 921600 + BaudRate300 = 300, + BaudRate600 = 600, + BaudRate1200 = 1200, + BaudRate2400 = 2400, + BaudRate4800 = 4800, + BaudRate9600 = 9600, + BaudRate19200 = 19200, + BaudRate38400 = 38400, + BaudRate57600 = 57600, + BaudRate115200 = 115200, + BaudRate230400 = 230400, + BaudRate460800 = 460800, + BaudRate921600 = 921600 } } \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/DataBits.cs b/Common/OmniPlus/Connection/Enums/DataBits.cs index c433f321..c4605d4e 100644 --- a/Common/OmniPlus/Connection/Enums/DataBits.cs +++ b/Common/OmniPlus/Connection/Enums/DataBits.cs @@ -2,9 +2,9 @@ { public enum DataBits { - X5 = 5, - X6 = 6, - X7 = 7, - X8 = 8 + DataBits5 = 5, + DataBits6 = 6, + DataBits7 = 7, + DataBits8 = 8 } } \ No newline at end of file diff --git a/Common/OmniPlus/Connection/SerialPortConnection.cs b/Common/OmniPlus/Connection/SerialPortConnection.cs index 01a46c61..d9767c60 100644 --- a/Common/OmniPlus/Connection/SerialPortConnection.cs +++ b/Common/OmniPlus/Connection/SerialPortConnection.cs @@ -25,7 +25,7 @@ namespace OmniPlus.Connection public event SerialPortStateChangedEventHandler StateChanged; - protected bool open => this.state == SerialPortState.Open; + protected bool connected => this.state == SerialPortState.Open; public void Close() { @@ -56,6 +56,9 @@ namespace OmniPlus.Connection try { + var fileInfo = new FileInfo(this.options.LogFile); + fileInfo.Directory.Create(); + File.AppendAllText(this.options.LogFile, string.Empty); this.Log += this.SerialPortConnection_Log; @@ -93,7 +96,11 @@ namespace OmniPlus.Connection this.Read += this.SerialPortConnection_Read; - this.StateChanged?.Invoke(this.state, $"{this.options.PortName} opened."); + this.StateChanged?.Invoke(this.state, $"{this.options.PortName} opened" + + $", {this.options.BaudRate}" + + $", {this.options.DataBits}" + + $", {this.options.Parity}" + + $", {this.options.StopBits}"); } catch (Exception e) { @@ -107,12 +114,22 @@ namespace OmniPlus.Connection public virtual void Write(SerialPortMessage message) { - if (this.open && message.Length > 0) + if (this.connected && message.Length > 0) { this.serialPort.Write(message, 0, message.Length); } - this.Log?.Invoke($"RX: {BitConverter.ToString(message)}"); + this.Log?.Invoke($"TX: {BitConverter.ToString(message)}"); + } + + public virtual void Write(params byte[] message) + { + if (this.connected && message.Length > 0) + { + this.serialPort.Write(message, 0, message.Length); + } + + this.Log?.Invoke($"TX: {BitConverter.ToString(message)}"); } protected abstract void SerialPortConnection_Read(); @@ -146,7 +163,7 @@ namespace OmniPlus.Connection private void Port_DataReceived(object sender, SerialDataReceivedEventArgs args) { - if (this.open && sender is System.IO.Ports.SerialPort port && port.BytesToRead > 0) + if (this.connected && sender is System.IO.Ports.SerialPort port && port.BytesToRead > 0) { var bytes = new byte[port.BytesToRead]; var lock_object = new object(); @@ -163,7 +180,7 @@ namespace OmniPlus.Connection this.Read?.Invoke(); } - this.Log?.Invoke($"TX: {BitConverter.ToString(bytes)}"); + this.Log?.Invoke($"RX: {BitConverter.ToString(bytes)}"); } } diff --git a/Common/OmniPlus/Connection/SerialPortOptions.cs b/Common/OmniPlus/Connection/SerialPortOptions.cs index 3623bbae..574e7b45 100644 --- a/Common/OmniPlus/Connection/SerialPortOptions.cs +++ b/Common/OmniPlus/Connection/SerialPortOptions.cs @@ -8,26 +8,26 @@ namespace OmniPlus.Connection { public SerialPortOptions() { - foreach (var portName in System.IO.Ports.SerialPort.GetPortNames()) + foreach (var portName in SerialPort.GetPortNames()) { this.PortName = portName; break; } - this.BaudRate = BaudRate.X4800; - this.DataBits = DataBits.X8; + this.BaudRate = BaudRate.BaudRate4800; + this.DataBits = DataBits.DataBits8; this.Parity = Parity.None; this.StopBits = StopBits.One; } public string PortName { get; set; } - public BaudRate BaudRate { get; set; } = BaudRate.X4800; + public BaudRate BaudRate { get; set; } = BaudRate.BaudRate4800; public Parity Parity { get; set; } = Parity.None; - public DataBits DataBits { get; set; } = DataBits.X8; + public DataBits DataBits { get; set; } = DataBits.DataBits8; public StopBits StopBits { get; set; } = StopBits.One; diff --git a/Common/OmniPlus/Connection/SerialPortStream.cs b/Common/OmniPlus/Connection/SerialPortStream.cs index 8d416d1c..275b4d4d 100644 --- a/Common/OmniPlus/Connection/SerialPortStream.cs +++ b/Common/OmniPlus/Connection/SerialPortStream.cs @@ -52,14 +52,33 @@ namespace OmniPlus.Connection return; } + Array.Copy(this.buffer, sourceIndex, destinationArray, destinationIndex, length); + } + + public void Flush(int length) + { var lock_object = new object(); lock (lock_object) { - this.dataLength = this.buffer.Length - requiredBufferLength; + if (length <= 0 || this.dataLength - length <= 0) + { + this.buffer = new byte[this.minBufferLength]; + } + else + { + var dataLength = this.dataLength - length; + var newBufferLength = this.minBufferLength; - Array.Copy(this.buffer, sourceIndex, destinationArray, destinationIndex, length); - Array.Copy(this.buffer, requiredBufferLength, this.buffer, 0, this.dataLength); + while (newBufferLength <= dataLength) + { + newBufferLength *= 2; + } + + var newBuffer = new byte[newBufferLength]; + + Array.Copy(this.buffer, dataLength, newBuffer, 0, dataLength); + } } } } diff --git a/Common/OmniPlus/Connections/Extensions.cs b/Common/OmniPlus/Connections/Extensions.cs index 1f8b4a5f..9763a140 100644 --- a/Common/OmniPlus/Connections/Extensions.cs +++ b/Common/OmniPlus/Connections/Extensions.cs @@ -73,7 +73,7 @@ namespace OmniPlus.Connections public static byte[] CalculateCheckSum16(this byte[] bytes, int length) { - short checksum = 0; + ushort checksum = 0; for (int i = 0; i < length; i++) { diff --git a/Common/OmniPlus/Connections/IrdaConnection.cs b/Common/OmniPlus/Connections/IrdaConnection.cs index 886420d5..da2d49ea 100644 --- a/Common/OmniPlus/Connections/IrdaConnection.cs +++ b/Common/OmniPlus/Connections/IrdaConnection.cs @@ -16,14 +16,14 @@ private event Action messageReceived; - public IrdaConnection(string portName) + public IrdaConnection(string portName, string logFile = null) { this.options.PortName = portName; - this.options.BaudRate = BaudRate.X4800; - this.options.DataBits = DataBits.X8; + this.options.BaudRate = BaudRate.BaudRate115200; + this.options.DataBits = DataBits.DataBits8; this.options.Parity = Parity.None; this.options.StopBits = StopBits.One; - this.options.RtsEnabled = true; + this.options.LogFile = logFile ?? ".\\IrdaConnection.txt"; } public byte[] Write(byte[] command, int timeout, int delay) @@ -31,6 +31,7 @@ var ui1236Request = new UI1236Message(command); var irdaRequest = new IrdaMessage(ui1236Request); var responseBytes = Array.Empty(); + var retriesCount = 3; var received = false; this.messageReceived += irdaResponse => @@ -40,22 +41,21 @@ received = true; }; - this.Write(irdaRequest); - - #region Temporary - // TODO: remove for real connections - this.stream = new SerialPortStream(); - this.stream.Append(new byte[] { 0xFF, 0x01, 0x25, 0x00, 0x80, 0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0x0C, 0xFF, 0x01, 0x25, 0x00, 0x80, 0x88 }); - this.SerialPortConnection_Read(); - #endregion - - Thread.Sleep(1); - - while (!received && timeout >= 0) + while (!received && retriesCount-- > 0) { - timeout -= delay; + this.Write(0x01, 0x01, 0x01, 0x01); + Thread.Sleep(1); + this.Write(irdaRequest); + // this.Write(0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0xFD, 0xC6, 0x01, 0xDD, 0x00, 0x3B, 0x1B); - Thread.Sleep(delay); + var sleep = timeout; + + while (!received && sleep >= 0) + { + sleep -= delay; + + Thread.Sleep(delay); + } } return responseBytes; diff --git a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs index d88bcea3..7403b822 100644 --- a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs +++ b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs @@ -1,6 +1,8 @@ using OmniPlus.Connection; using System; +using System.Linq; +using Xylem.Common.Utils.Crc16Ccitt; namespace OmniPlus.Connections.Messages { @@ -31,27 +33,13 @@ namespace OmniPlus.Connections.Messages set => this.bytes[2] = value; } - public void CopyCRC16(byte[] bytes, int sourceIndex) - { - var crcPosition = this.bytes.Length - CRC_LENGTH; - - Array.Copy(bytes, sourceIndex, this.bytes, crcPosition, CRC_LENGTH); - - var crc16 = this.bytes.CalculateCRC(0, crcPosition); - - if (crc16[0] == this.bytes[crcPosition] && crc16[0] == this.bytes[crcPosition + 1]) - { - // TODO: message validated. - } - } - protected override byte[] CreateMessage(byte[] payload) { var messageLength = payload.Length; messageLength += messageLength % 2; var index = 0; - var message = new byte[messageLength + 5]; + var message = new byte[messageLength + MIN_LENGTH]; message[index++] = IrdaConnection.MSG_START; message[index++] = IrdaConnection.MSG_PC2OMNI; message[index++] = (byte)(messageLength / 2); @@ -60,7 +48,7 @@ namespace OmniPlus.Connections.Messages messageLength = message.Length; - var crc16 = message.CalculateCRC(0, messageLength - CRC_LENGTH); + var crc16 = BitConverter.GetBytes(Crc16Ccitt.CalculateReversedLsb8408(message.Skip(1).Take(message.Length - 3).ToArray())); message[messageLength - 2] = crc16[1]; message[messageLength - 1] = crc16[0]; diff --git a/Common/OmniPlus/Connections/Messages/UI1236Message.cs b/Common/OmniPlus/Connections/Messages/UI1236Message.cs index 755cccfb..8784493c 100644 --- a/Common/OmniPlus/Connections/Messages/UI1236Message.cs +++ b/Common/OmniPlus/Connections/Messages/UI1236Message.cs @@ -10,6 +10,7 @@ namespace OmniPlus.Connections.Messages { public const byte START_BYTE = 0x0D; public const byte MIN_LENGTH = 0x05; + public const byte HEADER_BYTES = 0x03; public UI1236Message(byte[] bytes, bool response = false) : base(bytes, response) { @@ -29,14 +30,11 @@ namespace OmniPlus.Connections.Messages protected override byte[] CreateMessage(byte[] payload) { var messageLength = payload.Length + MIN_LENGTH; - var even = messageLength % 2; - messageLength += even; - var message = new byte[messageLength]; var index = 0; message[index++] = START_BYTE; - message[index++] = (byte)payload.Length; + message[index++] = (byte)(payload.Length + HEADER_BYTES); Control control = 0; control.ReturnResponse = true; @@ -44,9 +42,9 @@ namespace OmniPlus.Connections.Messages payload.CopyTo(message, index); - var checksum = message.CalculateCheckSum16(messageLength); - message[messageLength - even - 2] = checksum[1]; - message[messageLength - even - 1] = checksum[0]; + var checksum = message.CalculateCheckSum16(messageLength - 2); + message[messageLength - 2] = checksum[1]; + message[messageLength - 1] = checksum[0]; return message; } diff --git a/Common/OmniPlus/Connections/UniProConnection.cs b/Common/OmniPlus/Connections/UniProConnection.cs index 8866155e..694b3c12 100644 --- a/Common/OmniPlus/Connections/UniProConnection.cs +++ b/Common/OmniPlus/Connections/UniProConnection.cs @@ -10,8 +10,8 @@ namespace OmniPlus.Connections public UniProConnection(string portName) { this.options.PortName = portName; - this.options.BaudRate = BaudRate.X2400; - this.options.DataBits = DataBits.X8; + this.options.BaudRate = BaudRate.BaudRate2400; + this.options.DataBits = DataBits.DataBits8; this.options.Parity = Parity.None; this.options.StopBits = StopBits.One; this.options.RtsEnabled = true; diff --git a/Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs b/Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs new file mode 100644 index 00000000..931f8cd1 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs @@ -0,0 +1,47 @@ +using OmniPlus.Features.Enums; + +using System; + +namespace OmniPlus.Features.DeviceSpecific +{ + public struct CalibrationResults + { + private const byte FAILED = 0x01; + private const byte COMPLETED = 0x02; + + private CalibrationResults(byte[] bytes) + { + this.Status = Status.UnknownCommand; + this.Completed = default(bool); + this.Rotations = default(ushort); + this.Dauer = default(uint); + + if (bytes?.Length == 8) + { + this.Status = (Status)bytes[0]; + this.Completed = bytes[1] == COMPLETED; + this.Rotations = BitConverter.ToUInt16(bytes, 2); + this.Dauer = BitConverter.ToUInt16(bytes, 4); + } + } + + public Status Status { get; } + + public bool Completed { get; } + + public ushort Rotations { get; } + + public uint Dauer { get; } + + + public static byte[] RequestResults => new byte[] + { + FactoryMeterChamberCalibrationTest.BASE, + FactoryMeterChamberCalibrationTest.SET, + FactoryMeterChamberCalibrationTest.VIEW, + }; + + public static implicit operator CalibrationResults(byte[] bytes) + => new CalibrationResults(bytes); + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs b/Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs new file mode 100644 index 00000000..fbea3715 --- /dev/null +++ b/Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs @@ -0,0 +1,27 @@ +using OmniPlus.Features.UI1236; + +namespace OmniPlus.Features.DeviceSpecific +{ + public struct ConfigurationParameters + { + public const byte BASE = 0xFD; + public const byte GET = 0xC7; + public const byte ALL = 0x01; + + public ProgrammableID ProgrammableId { get; } + + public FactoryID FactoryId { get; } + + public NumberOfReadingDigits ReadingDigits { get; } + + public Reading Reading { get; } + + public OptionalUniDirectionalFields OptionalUniDirectionalFields { get; } + + public AlarmPersistencePeriod AlarmPersistensePeriaod { get; } + + public DataLogInterval DataLogInterval { get; } + + public RegisterDeviceIDString DeviceIDString { get; } + } +} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs index 4bc63a18..5a443386 100644 --- a/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs +++ b/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs @@ -1,8 +1,54 @@ -namespace OmniPlus.Features.DeviceSpecific +using OmniPlus.Features.Enums; + +using System; + +namespace OmniPlus.Features.DeviceSpecific { public struct FactoryMeterChamberCalibrationTest { public const byte BASE = 0xFD; public const byte SET = 0x67; + public const byte VIEW = 0x01; + + private FactoryMeterChamberCalibrationTest(byte[] bytes) : this() + { + this.Status = Status.UnknownCommand; + this.CalibrationState = default(CalibrationState); + this.Rotations = default(ushort); + this.Dauer = default(ushort); + + if (bytes?.Length == 6) + { + this.Status = (Status)bytes[0]; + this.CalibrationState = (CalibrationState)bytes[1]; + this.Rotations = BitConverter.ToUInt16(bytes, 2); + this.Dauer = BitConverter.ToUInt16(bytes, 4); + } + } + + public Status Status { get; set; } + + public CalibrationState CalibrationState { get; set; } + + public ushort Rotations { get; set; } + + public ushort Dauer { get; set; } + + public static implicit operator FactoryMeterChamberCalibrationTest(byte[] bytes) + => new FactoryMeterChamberCalibrationTest(bytes); + + public static implicit operator byte[] (FactoryMeterChamberCalibrationTest calibration) + { + var bytes = new byte[7]; + + bytes[0] = BASE; + bytes[1] = SET; + bytes[2] = (byte)(calibration.CalibrationState); + + BitConverter.GetBytes(calibration.Rotations).CopyTo(bytes, 3); + BitConverter.GetBytes(calibration.Dauer).CopyTo(bytes, 5); + + return bytes; + } } } diff --git a/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs b/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs index 138198d3..65b422d1 100644 --- a/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs +++ b/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs @@ -39,8 +39,7 @@ namespace OmniPlus.Features.DeviceSpecific public MeterRange MeterRange { get; set; } - public static byte[] GetCommand - => new byte[] { BASE, GET }; + public static byte[] GetCommand => new byte[] { BASE, GET }; public static implicit operator InputVolume(byte[] bytes) => new InputVolume(bytes); diff --git a/Common/OmniPlus/Features/Enums/CalibrationState.cs b/Common/OmniPlus/Features/Enums/CalibrationState.cs new file mode 100644 index 00000000..87f6ff02 --- /dev/null +++ b/Common/OmniPlus/Features/Enums/CalibrationState.cs @@ -0,0 +1,9 @@ +namespace OmniPlus.Features.Enums +{ + public enum CalibrationState : byte + { + OK = 0x00, + Failed = 0x01, + Completed = 0x02 + } +} diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj index ab0b5a3c..4cd03d5f 100644 --- a/Common/OmniPlus/OmniPlus.csproj +++ b/Common/OmniPlus/OmniPlus.csproj @@ -57,6 +57,8 @@ + + @@ -91,6 +93,7 @@ + @@ -134,6 +137,11 @@ - + + + {91DEF0C0-AA4F-40AE-8F18-CB717FDE7E7F} + Crc16Ccitt + + \ No newline at end of file diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs index 61faea8d..e9f1b9b6 100644 --- a/Common/OmniPlus/OmniRegister.cs +++ b/Common/OmniPlus/OmniRegister.cs @@ -25,8 +25,6 @@ namespace OmniPlus this.uniProConnection?.Close(); this.irdaConnection?.Open(); this.messageHandler = this.irdaConnection.Write; - - var bytes = this.GetSystemParameters(); } public void ActivateUniPro() @@ -36,15 +34,21 @@ namespace OmniPlus this.messageHandler = this.uniProConnection.Write; } - internal SystemParameters GetSystemParameters() + public SystemParameters GetSystemParameters() => this.messageHandler?.Invoke(SystemParameters.GetCommand, 3000, 300); - internal bool SetInputVolume(InputVolume inputVolume) + public bool SetInputVolume(InputVolume inputVolume) { inputVolume = this.messageHandler?.Invoke(inputVolume, 3000, 300); return inputVolume.Status == Status.Completed; } + + public FactoryMeterChamberCalibrationTest StartCalibration(FactoryMeterChamberCalibrationTest calibrationOptions) + => this.messageHandler?.Invoke(calibrationOptions, 3000, 300); + + public CalibrationResults GetCalibrationResults() + => this.messageHandler?.Invoke(CalibrationResults.RequestResults, 3000, 300); } } diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs index a514158e..fc5f960f 100644 --- a/Common/OmniPlus/Program.cs +++ b/Common/OmniPlus/Program.cs @@ -1,21 +1,30 @@ -using OmniPlus.Features.DeviceSpecific; -using OmniPlus.Features.Enums; - -namespace OmniPlus +namespace OmniPlus { class Program { static void Main(string[] args) { - var omniRegister = new OmniRegister("COM1"); + var omniRegister = new OmniRegister("COM4"); + omniRegister.ActivateIrda(); - var x = omniRegister.SetInputVolume(new InputVolume - { - MilliliterPerPulse = 1500, - FractionalPart = 500, - MeterSize = MeterSizes.OneHalfIn, - MeterRange = MeterRanges.From1To2, - }); + + var systemParameters = omniRegister.GetSystemParameters(); + + + //var inputVolumeSetted = omniRegister.SetInputVolume(new InputVolume + //{ + // MilliliterPerPulse = 1500, + // FractionalPart = 500, + // MeterSize = MeterSizes.OneHalfIn, + // MeterRange = MeterRanges.From1To2, + //}); + //var calibrationStart = omniRegister.StartCalibration(new FactoryMeterChamberCalibrationTest + //{ + // CalibrationState = CalibrationState.OK, + // Rotations = 1000, + // Dauer = 10000 + //}); + //var calibration = omniRegister.GetCalibrationResults(); } } } From c7f63c10938db5e9d61527552978f493f3614fbb Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 26 Oct 2023 13:48:23 +0200 Subject: [PATCH 16/56] temp meter changes --- Common/Common.sln | 67 ----- Common/CommonConsole/Program.cs | 7 - .../GenesisToolBox/FrmTempMeter.Designer.cs | 235 ++++++++++-------- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 15 +- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 6 - .../Ui/GenesisToolBox/GenesisToolBox.csproj | 6 + .../Infrastructure/Appsettings.cs | 6 + .../Infrastructure/TempMeterModels.cs | 32 ++- 8 files changed, 173 insertions(+), 201 deletions(-) diff --git a/Common/Common.sln b/Common/Common.sln index b0aee56c..21c1326f 100644 --- a/Common/Common.sln +++ b/Common/Common.sln @@ -171,8 +171,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataPackages", "Hardware\Wa EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolCore", "Hardware\Interfaces\Protocols\ProtocolCore\ProtocolCore.csproj", "{8BDD2789-96D4-43EA-AAD7-0F49D0347998}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIRTBroadcaster.UI", "SIRTBroadcaster.UI\SIRTBroadcaster.UI.csproj", "{2550B77D-D975-4A50-9C6A-526D4E07754D}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIRTBroadcaster.Abstraction", "SIRTBroadcaster.Abstraction\SIRTBroadcaster.Abstraction.csproj", "{C27BA66C-C3A7-48A2-A644-CBA77E28E531}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIRTBroadcaster.Client", "SIRTBroadcaster.Client\SIRTBroadcaster.Client.csproj", "{4221F992-599E-498C-A409-6D1E70E0A6F9}" @@ -3937,70 +3935,6 @@ Global {8BDD2789-96D4-43EA-AAD7-0F49D0347998}.XP32bit|x64.Build.0 = XP32bit|x64 {8BDD2789-96D4-43EA-AAD7-0F49D0347998}.XP32bit|x86.ActiveCfg = XP32bit|x86 {8BDD2789-96D4-43EA-AAD7-0F49D0347998}.XP32bit|x86.Build.0 = XP32bit|x86 - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.COM|x86.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|x64.ActiveCfg = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|x64.Build.0 = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|x86.ActiveCfg = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Debug|x86.Build.0 = Debug|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.PerformTest|x86.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.Release|x86.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.ReleaseTest|x86.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|Any CPU.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|x64.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|x64.Build.0 = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|x86.ActiveCfg = Release|Any CPU - {2550B77D-D975-4A50-9C6A-526D4E07754D}.XP32bit|x86.Build.0 = Release|Any CPU {C27BA66C-C3A7-48A2-A644-CBA77E28E531}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU {C27BA66C-C3A7-48A2-A644-CBA77E28E531}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU {C27BA66C-C3A7-48A2-A644-CBA77E28E531}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -4526,7 +4460,6 @@ Global {D6B81C60-2763-4C4D-989F-90822F53B01A} = {94579693-7AC6-4FF0-B540-1F3780E1BCFA} {BA17D20E-0CEB-4B27-9772-2392BD750ED5} = {C9393A97-C0BB-4D59-A879-B572BE04CE15} {8BDD2789-96D4-43EA-AAD7-0F49D0347998} = {EC10DAFE-88CF-42D5-99E7-D247938B6430} - {2550B77D-D975-4A50-9C6A-526D4E07754D} = {03D4F23E-7E4A-4091-BC96-036C996D351A} {C27BA66C-C3A7-48A2-A644-CBA77E28E531} = {AF973E0E-2B44-4F1A-B1E7-77C8B4F30579} {4221F992-599E-498C-A409-6D1E70E0A6F9} = {AF973E0E-2B44-4F1A-B1E7-77C8B4F30579} {AF973E0E-2B44-4F1A-B1E7-77C8B4F30579} = {99B23EE9-CE50-4924-A055-C39EFA038721} diff --git a/Common/CommonConsole/Program.cs b/Common/CommonConsole/Program.cs index 91a86a8a..afa16d37 100644 --- a/Common/CommonConsole/Program.cs +++ b/Common/CommonConsole/Program.cs @@ -1,13 +1,6 @@ namespace CommonConsole { using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.IO.Ports; - using System.Linq; - using System.Runtime.InteropServices; - using System.Threading; public class Program { diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index 2c464185..39c68bbe 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,16 +31,16 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -68,7 +68,11 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticContentBox = new System.Windows.Forms.RichTextBox(); this.autometicControlsSplitter = new System.Windows.Forms.Splitter(); this.automaticControlsPanel = new System.Windows.Forms.Panel(); + this.messurementStopMs = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); this.backwardsStepMS = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.messurementStepMS = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.stopBackwardsBtn = new System.Windows.Forms.Button(); this.startBackwardBtn = new System.Windows.Forms.Button(); @@ -77,8 +81,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label3 = new System.Windows.Forms.Label(); this.stopAutomaticBtn = new System.Windows.Forms.Button(); this.startAutomaticBtn = new System.Windows.Forms.Button(); - this.messurementStepMS = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); this.GMHPort = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.temperatureChecksTab = new System.Windows.Forms.TabPage(); @@ -110,8 +112,8 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); - this.messurementStopMs = new System.Windows.Forms.TextBox(); - this.label10 = new System.Windows.Forms.Label(); + this.tofRecordingDauerSeconds = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -410,6 +412,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // automaticControlsPanel // this.automaticControlsPanel.BackColor = System.Drawing.SystemColors.Menu; + this.automaticControlsPanel.Controls.Add(this.tofRecordingDauerSeconds); + this.automaticControlsPanel.Controls.Add(this.label11); this.automaticControlsPanel.Controls.Add(this.messurementStopMs); this.automaticControlsPanel.Controls.Add(this.label10); this.automaticControlsPanel.Controls.Add(this.backwardsStepMS); @@ -432,6 +436,31 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticControlsPanel.Size = new System.Drawing.Size(328, 647); this.automaticControlsPanel.TabIndex = 0; // + // messurementStopMs + // + this.messurementStopMs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.messurementStopMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.messurementStopMs.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.messurementStopMs.Location = new System.Drawing.Point(5, 242); + this.messurementStopMs.Margin = new System.Windows.Forms.Padding(0); + this.messurementStopMs.Name = "messurementStopMs"; + this.messurementStopMs.Size = new System.Drawing.Size(318, 24); + this.messurementStopMs.TabIndex = 22; + // + // label10 + // + this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label10.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label10.Location = new System.Drawing.Point(5, 219); + this.label10.Margin = new System.Windows.Forms.Padding(5); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(318, 18); + this.label10.TabIndex = 21; + this.label10.Text = "Messungsende in Stunden"; + this.label10.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // // backwardsStepMS // this.backwardsStepMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -444,6 +473,31 @@ namespace Xylem.Common.Ui.GenesisToolBox this.backwardsStepMS.Size = new System.Drawing.Size(318, 24); this.backwardsStepMS.TabIndex = 20; // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label2.Location = new System.Drawing.Point(5, 115); + this.label2.Margin = new System.Windows.Forms.Padding(5); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(318, 18); + this.label2.TabIndex = 2; + this.label2.Text = "Messschritt in Millisekunden"; + this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // + // messurementStepMS + // + this.messurementStepMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.messurementStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.messurementStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.messurementStepMS.Location = new System.Drawing.Point(5, 138); + this.messurementStepMS.Margin = new System.Windows.Forms.Padding(0); + this.messurementStepMS.Name = "messurementStepMS"; + this.messurementStepMS.Size = new System.Drawing.Size(318, 24); + this.messurementStepMS.TabIndex = 3; + // // label8 // this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -462,7 +516,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.stopBackwardsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopBackwardsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 464); + this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 511); this.stopBackwardsBtn.Margin = new System.Windows.Forms.Padding(5); this.stopBackwardsBtn.Name = "stopBackwardsBtn"; this.stopBackwardsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -477,7 +531,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startBackwardBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startBackwardBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startBackwardBtn.Location = new System.Drawing.Point(5, 418); + this.startBackwardBtn.Location = new System.Drawing.Point(5, 465); this.startBackwardBtn.Margin = new System.Windows.Forms.Padding(5); this.startBackwardBtn.Name = "startBackwardBtn"; this.startBackwardBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -492,7 +546,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSettingsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.saveSettingsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.saveSettingsBtn.Location = new System.Drawing.Point(5, 280); + this.saveSettingsBtn.Location = new System.Drawing.Point(5, 327); this.saveSettingsBtn.Margin = new System.Windows.Forms.Padding(5); this.saveSettingsBtn.Name = "saveSettingsBtn"; this.saveSettingsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -532,7 +586,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.stopAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 372); + this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 419); this.stopAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.stopAutomaticBtn.Name = "stopAutomaticBtn"; this.stopAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -547,7 +601,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startAutomaticBtn.Location = new System.Drawing.Point(5, 326); + this.startAutomaticBtn.Location = new System.Drawing.Point(5, 373); this.startAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.startAutomaticBtn.Name = "startAutomaticBtn"; this.startAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -557,31 +611,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startAutomaticBtn.UseVisualStyleBackColor = true; this.startAutomaticBtn.Click += new System.EventHandler(this.StartAutomaticBtn_Clicked); // - // messurementStepMS - // - this.messurementStepMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.messurementStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.messurementStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementStepMS.Location = new System.Drawing.Point(5, 138); - this.messurementStepMS.Margin = new System.Windows.Forms.Padding(0); - this.messurementStepMS.Name = "messurementStepMS"; - this.messurementStepMS.Size = new System.Drawing.Size(318, 24); - this.messurementStepMS.TabIndex = 3; - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(5, 115); - this.label2.Margin = new System.Windows.Forms.Padding(5); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(318, 18); - this.label2.TabIndex = 2; - this.label2.Text = "Messschritt in Millisekunden"; - this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // // GMHPort // this.GMHPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -592,7 +621,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.GMHPort.Margin = new System.Windows.Forms.Padding(0); this.GMHPort.MinimumSize = new System.Drawing.Size(2, 25); this.GMHPort.Name = "GMHPort"; - this.GMHPort.Size = new System.Drawing.Size(318, 25); + this.GMHPort.Size = new System.Drawing.Size(318, 24); this.GMHPort.TabIndex = 1; // // label1 @@ -624,14 +653,14 @@ namespace Xylem.Common.Ui.GenesisToolBox // this.temperatureChecksGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.temperatureChecksGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle31.BackColor = System.Drawing.SystemColors.ButtonFace; - dataGridViewCellStyle31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle31.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle31.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle31.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle31; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.temperatureChecksGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.TemperatureCheck_Pcb, this.TemperatureCheck_PrevC, @@ -642,14 +671,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.TemperatureCheck_PrevTOF, this.TemperatureCheck_CurrentTOF, this.TemperatureCheck_NextTOF}); - dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle32; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle2; this.temperatureChecksGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.temperatureChecksGridView.Location = new System.Drawing.Point(0, 24); this.temperatureChecksGridView.Name = "temperatureChecksGridView"; @@ -753,14 +782,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle33.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle33.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle33.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle33.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle33.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle33; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, @@ -781,8 +810,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // PcbId // this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.PcbId.DefaultCellStyle = dataGridViewCellStyle34; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.PcbId.DefaultCellStyle = dataGridViewCellStyle4; this.PcbId.HeaderText = "PcbId"; this.PcbId.Name = "PcbId"; this.PcbId.ReadOnly = true; @@ -790,8 +819,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_Nr // this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle35; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle5; this.Avg_Nr.HeaderText = "Nr"; this.Avg_Nr.Name = "Avg_Nr"; this.Avg_Nr.ReadOnly = true; @@ -799,8 +828,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_T // this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_T.DefaultCellStyle = dataGridViewCellStyle36; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_T.DefaultCellStyle = dataGridViewCellStyle6; this.Avg_T.HeaderText = "Avg °C"; this.Avg_T.Name = "Avg_T"; this.Avg_T.ReadOnly = true; @@ -808,8 +837,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_TOF // this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle37; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle7; this.Avg_TOF.HeaderText = "Avg TOF"; this.Avg_TOF.Name = "Avg_TOF"; this.Avg_TOF.ReadOnly = true; @@ -817,16 +846,16 @@ namespace Xylem.Common.Ui.GenesisToolBox // diffT // this.diffT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffT.DefaultCellStyle = dataGridViewCellStyle38; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffT.DefaultCellStyle = dataGridViewCellStyle8; this.diffT.HeaderText = "°C max - min"; this.diffT.Name = "diffT"; // // diffTOF // this.diffTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffTOF.DefaultCellStyle = dataGridViewCellStyle39; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffTOF.DefaultCellStyle = dataGridViewCellStyle9; this.diffTOF.HeaderText = "TOF max - min"; this.diffTOF.Name = "diffTOF"; this.diffTOF.ReadOnly = true; @@ -834,8 +863,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // seconds // this.seconds.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.seconds.DefaultCellStyle = dataGridViewCellStyle40; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.seconds.DefaultCellStyle = dataGridViewCellStyle10; this.seconds.HeaderText = "Seconds"; this.seconds.Name = "seconds"; this.seconds.ReadOnly = true; @@ -898,30 +927,30 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // - // messurementStopMs + // tofRecordingDauerSeconds // - this.messurementStopMs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tofRecordingDauerSeconds.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.messurementStopMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.messurementStopMs.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementStopMs.Location = new System.Drawing.Point(5, 242); - this.messurementStopMs.Margin = new System.Windows.Forms.Padding(0); - this.messurementStopMs.Name = "messurementStopMs"; - this.messurementStopMs.Size = new System.Drawing.Size(318, 24); - this.messurementStopMs.TabIndex = 22; + this.tofRecordingDauerSeconds.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.tofRecordingDauerSeconds.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tofRecordingDauerSeconds.Location = new System.Drawing.Point(5, 294); + this.tofRecordingDauerSeconds.Margin = new System.Windows.Forms.Padding(0); + this.tofRecordingDauerSeconds.Name = "tofRecordingDauerSeconds"; + this.tofRecordingDauerSeconds.Size = new System.Drawing.Size(318, 24); + this.tofRecordingDauerSeconds.TabIndex = 24; // - // label10 + // label11 // - this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.label10.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label10.Location = new System.Drawing.Point(5, 219); - this.label10.Margin = new System.Windows.Forms.Padding(5); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(318, 18); - this.label10.TabIndex = 21; - this.label10.Text = "Messungsende in Stunden"; - this.label10.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + this.label11.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label11.Location = new System.Drawing.Point(5, 271); + this.label11.Margin = new System.Windows.Forms.Padding(5); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(318, 18); + this.label11.TabIndex = 23; + this.label11.Text = "TOF aufnahme dauer in Sekunden"; + this.label11.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // FrmTempMeter // @@ -1031,5 +1060,7 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; private System.Windows.Forms.TextBox messurementStopMs; private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox tofRecordingDauerSeconds; + private System.Windows.Forms.Label label11; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index 15546b80..94885924 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -653,6 +653,7 @@ this.messurementDauerMS.Text = Appsettings.MessurementDauerMs.ToString(); this.backwardsStepMS.Text = Appsettings.BackwardsStepMs.ToString(); this.messurementStopMs.Text = Appsettings.MessurementStopHours.ToString(); + this.tofRecordingDauerSeconds.Text = Appsettings.TOFRecordingDauerSeconds.ToString(); }; this.SetEnabled(ProgrammState.Start); @@ -802,10 +803,7 @@ this.automatic = false; - if (this.automaticCalibration != null) - { - this.automaticCalibration.StopMessuring(); - } + this.automaticCalibration?.StopMessuring(); try { @@ -825,7 +823,7 @@ { if (this.currentGenesis is null) { - this.automaticCalibration.StopMessuring(); + this.automaticCalibration?.StopMessuring(); return double.MinValue; } @@ -873,6 +871,11 @@ Appsettings.MessurementStopHours = msStop; } + if (int.TryParse($"{this.tofRecordingDauerSeconds.Text}", out int tofRecording)) + { + Appsettings.TOFRecordingDauerSeconds = tofRecording; + } + Appsettings.SaveSettings(); MessageBox.Show("Die Einstellungen wurden erfolgreich gespeichert."); } @@ -1018,7 +1021,7 @@ private void StopBackwardsBtn_Click(Object sender, EventArgs e) { - this.automaticCalibration.StopMessuring(); + this.automaticCalibration?.StopMessuring(); this.SetEnabled(ProgrammState.RecordStoped); this.startAutomaticBtn.Enabled = true; diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index d67f5424..15e6b68b 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,12 +123,6 @@ 104, 17 - - 531, 17 - - - 413, 17 - True diff --git a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj index 04b57624..65db8bb5 100644 --- a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj +++ b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj @@ -748,6 +748,12 @@ PreserveNewest Designer + + + + + + PreserveNewest diff --git a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs index 56228faa..3ed25446 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs @@ -45,6 +45,12 @@ set => SetValue(value); } + public static int TOFRecordingDauerSeconds + { + get => GetInt32(); + set => SetValue(value); + } + private static short GetInt16([CallerMemberName] string property = EMPTY) { var value = settings[property]?.Value?.ToString() ?? string.Empty; diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index 43f31c0a..e6c3a500 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; - using System.Globalization; using System.IO; using System.Linq; using System.Net; @@ -99,6 +98,7 @@ private Timer longTimer; private Timer shortTimer; private Timer stopTimer; + private Timer resetTimer; private bool messuring; public AutomaticTemperatureCalibration(string pcbId, ITempMeterForm genesisMeter) @@ -138,6 +138,15 @@ this.LongTimerElapsed(null, null); this.longTimer.Start(); + this.resetTimer = new Timer(Appsettings.TOFRecordingDauerSeconds * 1000) + { + Enabled = true, + AutoReset = true, + }; + this.resetTimer.Elapsed += (_1, _2) + => this.tempMeterForm.StartRecording(); + this.resetTimer.Start(); + if (Appsettings.MessurementStopHours > 0) { this.stopTimer = new Timer(Appsettings.MessurementStopHours * 24 * 60 * 60 * 1000) @@ -145,7 +154,8 @@ Enabled = true, AutoReset = true }; - this.stopTimer.Elapsed += (sender, args) => this.StopMessuring(); + this.stopTimer.Elapsed += (sender, args) + => this.StopMessuring(); this.stopTimer.Start(); } @@ -166,11 +176,15 @@ this.stopTimer?.Dispose(); this.stopTimer = null; + this.resetTimer?.Stop(); + this.resetTimer?.Dispose(); + this.resetTimer = null; + this.temperatureSource?.Dispose(); this.temperatureSource = null; } - private void LongTimerElapsed(Object sender, ElapsedEventArgs _) + private void LongTimerElapsed(Object _1, ElapsedEventArgs _2) { this.messuring = !this.messuring; @@ -178,7 +192,6 @@ if (this.messuring) { - this.tempMeterForm.StartRecording(); this.shortTimer.Start(); } else @@ -544,8 +557,6 @@ this.tempMeterForm.AddMessage(messurement); File.AppendAllLines(this.backwardsFile, new[] { messurement }); - - this.tempMeterForm.StartRecording(); })); } @@ -647,14 +658,9 @@ CurrentTOF = currentTOF }; + // var last = length - 1; + var length = temperatureLUT?.Length ?? 0; - var last = length - 1; - - if (last <= 0 || temperatureLUT[0].AvgTOF > currentTOF || temperatureLUT[last].AvgTOF < currentTOF) - { - return interpolationResult; - } - var prevTOF = default(double); var prevT = default(double); var nextTOF = default(double); From 11c2d2922d182690c81fa4f4a48924f3df2186cc Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Wed, 1 Nov 2023 08:40:26 +0100 Subject: [PATCH 17/56] omni changes from last freiday --- Common/Common.sln | 135 +- Common/CommonConsole/CommonConsole.csproj | 10 +- Common/CommonConsole/Program.cs | 177 +- .../193400032_aggregations.txt | 151 ++ .../193400032_backwards.txt | 1961 +++++++++++++++++ .../193400032_messurements.txt | 0 .../193400261_aggregations.txt | 63 + .../193400261_backwards.txt | 1568 +++++++++++++ .../193400261_messurements.txt | 0 .../temp.txt | 48 + Common/OmniPlus/App.config | 6 - .../Contracts/ISerialPortConnection.cs | 15 - .../Connection/Contracts/ISerialPortReader.cs | 7 - Common/OmniPlus/Connection/Enums/BaudRate.cs | 19 - Common/OmniPlus/Connection/Enums/DataBits.cs | 10 - .../SerialPortStateChangedEventHandler.cs | 6 - .../Connection/SerialPortConnection.cs | 193 -- .../OmniPlus/Connection/SerialPortMessage.cs | 38 - .../OmniPlus/Connection/SerialPortOptions.cs | 40 - .../OmniPlus/Connection/SerialPortStream.cs | 85 - Common/OmniPlus/Connections/Extensions.cs | 86 - Common/OmniPlus/Connections/IrdaConnection.cs | 92 - .../Connections/Messages/IrdaMessage.cs | 71 - .../Connections/Messages/MessageHandler.cs | 4 - .../Connections/Messages/UI1236Message.cs | 61 - .../OmniPlus/Connections/UniProConnection.cs | 30 - .../Features/DeviceSpecific/BatteryVoltage.cs | 8 - ...eryVoltageMeasurementCalibrationFactors.cs | 9 - .../DeviceSpecific/CalibrationResults.cs | 47 - .../DeviceSpecific/ConfigurationParameters.cs | 27 - .../Features/DeviceSpecific/DataLogData.cs | 8 - .../DeviceSpecific/DataLogInterval.cs | 9 - .../Features/DeviceSpecific/DisplayMode.cs | 9 - .../DeviceSpecific/EnabledLCDViews.cs | 9 - .../DeviceSpecific/EnabledPredefinedAlarms.cs | 9 - .../ExtendedResolutionSetting.cs | 9 - .../DeviceSpecific/FactoryCalibration.cs | 9 - .../FactoryMeterChamberCalibrationTest.cs | 54 - .../DeviceSpecific/FactoryPulseTestMode.cs | 8 - .../Features/DeviceSpecific/FactorySeal.cs | 9 - .../DeviceSpecific/FieldCalibration.cs | 9 - .../Features/DeviceSpecific/InputVolume.cs | 66 - .../Features/DeviceSpecific/LCDSegmentTest.cs | 8 - .../Features/DeviceSpecific/LCDTimeout.cs | 9 - .../Features/DeviceSpecific/LidState.cs | 8 - .../LifeTimeMaxSensorPulsesperSecond.cs | 9 - .../ManufacturingTestCommand.cs | 8 - .../DeviceSpecific/ManufacturingTime.cs | 9 - .../Features/DeviceSpecific/OmniSize.cs | 9 - .../DeviceSpecific/OutputPulseSettings.cs | 9 - .../DeviceSpecific/PeriodicAlarmLogEntries.cs | 8 - .../Features/DeviceSpecific/RebootCount.cs | 9 - .../DeviceSpecific/RegisterDeviceIDString.cs | 9 - .../DeviceSpecific/RegisterSetting.cs | 9 - .../Features/DeviceSpecific/SecondsActive.cs | 8 - .../SendFlexNetSerialCommands.cs | 8 - .../SendMultipleFlexNetSerialCommands.cs | 8 - .../DeviceSpecific/SystemParameters.cs | 63 - .../Features/DeviceSpecific/SystemTime.cs | 9 - .../Features/DeviceSpecific/TestPulse.cs | 8 - .../DeviceSpecific/TestTotalizerValue.cs | 9 - .../DeviceSpecific/TimeofFactorySeal.cs | 8 - .../DeviceSpecific/TimeofInstallation.cs | 9 - .../DeviceSpecific/TriggerWatchdogReset.cs | 8 - .../Features/Enums/CalibrationState.cs | 9 - .../OmniPlus/Features/Enums/DeviceCommands.cs | 234 -- Common/OmniPlus/Features/Enums/MeterRanges.cs | 11 - Common/OmniPlus/Features/Enums/MeterSizes.cs | 14 - .../Features/Enums/PredefinedAlarms.cs | 139 -- Common/OmniPlus/Features/Enums/Status.cs | 47 - Common/OmniPlus/Features/Enums/UI1203Units.cs | 26 - .../OmniPlus/Features/Enums/UI1236Commands.cs | 131 -- Common/OmniPlus/Features/Types/ASCIIString.cs | 22 - Common/OmniPlus/Features/Types/MeterRange.cs | 24 - Common/OmniPlus/Features/Types/MeterSize.cs | 24 - .../Features/Types/TimeSinse20000101.cs | 28 - .../Features/Types/TypesExtensions.cs | 30 - .../Features/UI1236/AlarmPersistencePeriod.cs | 8 - .../Features/UI1236/BuildInformation.cs | 8 - .../Features/UI1236/ClearMetrologyAlarms.cs | 7 - .../OmniPlus/Features/UI1236/CustomerText.cs | 8 - Common/OmniPlus/Features/UI1236/FactoryID.cs | 8 - .../UI1236/MetrologyAlarmSettings1F.cs | 8 - .../UI1236/MetrologyAlarmSettings21.cs | 8 - .../Features/UI1236/NumberOfReadingDigits.cs | 8 - .../UI1236/OptionalUniDirectionalFields.cs | 8 - .../Features/UI1236/ProgrammableID.cs | 8 - .../Features/UI1236/RateResolution.cs | 7 - Common/OmniPlus/Features/UI1236/RateUnits.cs | 8 - Common/OmniPlus/Features/UI1236/Reading.cs | 7 - .../OmniPlus/Features/UI1236/ReadingMode.cs | 8 - .../OmniPlus/Features/UI1236/ReadingPreset.cs | 7 - .../Features/UI1236/ReadingResolution.cs | 7 - .../OmniPlus/Features/UI1236/ReadingUnits.cs | 8 - .../Features/UI1236/UniDirectionalString.cs | 7 - .../Features/UI1236/VersionAndType.cs | 7 - Common/OmniPlus/OmniPlus.csproj | 147 -- Common/OmniPlus/OmniRegister.cs | 54 - Common/OmniPlus/Program.cs | 30 - .../LogicalConnections/IrdaConnection.cs | 84 + .../LogicalConnections/LogicalConnection.cs | 19 + .../LogicalConnectionExtensions.cs | 272 +++ .../LogicalConnections/UI1236ControlByte.cs} | 14 +- .../LogicalConnections/UniProConnection.cs | 71 + .../PhysicalConnections/Enums/BaudRate.cs | 19 + .../PhysicalConnections/Enums/DataBits.cs | 10 + .../Enums/SerialPortState.cs | 2 +- .../SerialPortConnection.cs | 181 ++ .../PhysicalConnections/SerialPortOptions.cs | 51 + .../OmniPlusInspection/MainForm.Designer.cs | 40 + Common/OmniPlusInspection/MainForm.cs | 19 + .../OmniPlusInspection.csproj | 86 + Common/OmniPlusInspection/Program.cs | 16 + .../Properties/AssemblyInfo.cs | 6 +- .../Properties/Resources.Designer.cs | 71 + .../Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 30 + .../Properties/Settings.settings | 7 + .../Ui/GenesisToolBox/GenesisToolBox.csproj | 13 +- 119 files changed, 4985 insertions(+), 2675 deletions(-) create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_aggregations.txt create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_backwards.txt create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_messurements.txt create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_aggregations.txt create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_backwards.txt create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_messurements.txt create mode 100644 Common/CommonConsole/temperature_calibrations_26_10_2023/temp.txt delete mode 100644 Common/OmniPlus/App.config delete mode 100644 Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs delete mode 100644 Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs delete mode 100644 Common/OmniPlus/Connection/Enums/BaudRate.cs delete mode 100644 Common/OmniPlus/Connection/Enums/DataBits.cs delete mode 100644 Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs delete mode 100644 Common/OmniPlus/Connection/SerialPortConnection.cs delete mode 100644 Common/OmniPlus/Connection/SerialPortMessage.cs delete mode 100644 Common/OmniPlus/Connection/SerialPortOptions.cs delete mode 100644 Common/OmniPlus/Connection/SerialPortStream.cs delete mode 100644 Common/OmniPlus/Connections/Extensions.cs delete mode 100644 Common/OmniPlus/Connections/IrdaConnection.cs delete mode 100644 Common/OmniPlus/Connections/Messages/IrdaMessage.cs delete mode 100644 Common/OmniPlus/Connections/Messages/MessageHandler.cs delete mode 100644 Common/OmniPlus/Connections/Messages/UI1236Message.cs delete mode 100644 Common/OmniPlus/Connections/UniProConnection.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/LidState.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs delete mode 100644 Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs delete mode 100644 Common/OmniPlus/Features/Enums/CalibrationState.cs delete mode 100644 Common/OmniPlus/Features/Enums/DeviceCommands.cs delete mode 100644 Common/OmniPlus/Features/Enums/MeterRanges.cs delete mode 100644 Common/OmniPlus/Features/Enums/MeterSizes.cs delete mode 100644 Common/OmniPlus/Features/Enums/PredefinedAlarms.cs delete mode 100644 Common/OmniPlus/Features/Enums/Status.cs delete mode 100644 Common/OmniPlus/Features/Enums/UI1203Units.cs delete mode 100644 Common/OmniPlus/Features/Enums/UI1236Commands.cs delete mode 100644 Common/OmniPlus/Features/Types/ASCIIString.cs delete mode 100644 Common/OmniPlus/Features/Types/MeterRange.cs delete mode 100644 Common/OmniPlus/Features/Types/MeterSize.cs delete mode 100644 Common/OmniPlus/Features/Types/TimeSinse20000101.cs delete mode 100644 Common/OmniPlus/Features/Types/TypesExtensions.cs delete mode 100644 Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs delete mode 100644 Common/OmniPlus/Features/UI1236/BuildInformation.cs delete mode 100644 Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs delete mode 100644 Common/OmniPlus/Features/UI1236/CustomerText.cs delete mode 100644 Common/OmniPlus/Features/UI1236/FactoryID.cs delete mode 100644 Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs delete mode 100644 Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs delete mode 100644 Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs delete mode 100644 Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs delete mode 100644 Common/OmniPlus/Features/UI1236/ProgrammableID.cs delete mode 100644 Common/OmniPlus/Features/UI1236/RateResolution.cs delete mode 100644 Common/OmniPlus/Features/UI1236/RateUnits.cs delete mode 100644 Common/OmniPlus/Features/UI1236/Reading.cs delete mode 100644 Common/OmniPlus/Features/UI1236/ReadingMode.cs delete mode 100644 Common/OmniPlus/Features/UI1236/ReadingPreset.cs delete mode 100644 Common/OmniPlus/Features/UI1236/ReadingResolution.cs delete mode 100644 Common/OmniPlus/Features/UI1236/ReadingUnits.cs delete mode 100644 Common/OmniPlus/Features/UI1236/UniDirectionalString.cs delete mode 100644 Common/OmniPlus/Features/UI1236/VersionAndType.cs delete mode 100644 Common/OmniPlus/OmniPlus.csproj delete mode 100644 Common/OmniPlus/OmniRegister.cs delete mode 100644 Common/OmniPlus/Program.cs create mode 100644 Common/OmniPlusInspection/Domains/LogicalConnections/IrdaConnection.cs create mode 100644 Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnection.cs create mode 100644 Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnectionExtensions.cs rename Common/{OmniPlus/Features/Types/Control.cs => OmniPlusInspection/Domains/LogicalConnections/UI1236ControlByte.cs} (79%) create mode 100644 Common/OmniPlusInspection/Domains/LogicalConnections/UniProConnection.cs create mode 100644 Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/BaudRate.cs create mode 100644 Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/DataBits.cs rename Common/{OmniPlus/Connection => OmniPlusInspection/Domains/PhysicalConnections}/Enums/SerialPortState.cs (67%) create mode 100644 Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortConnection.cs create mode 100644 Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortOptions.cs create mode 100644 Common/OmniPlusInspection/MainForm.Designer.cs create mode 100644 Common/OmniPlusInspection/MainForm.cs create mode 100644 Common/OmniPlusInspection/OmniPlusInspection.csproj create mode 100644 Common/OmniPlusInspection/Program.cs rename Common/{OmniPlus => OmniPlusInspection}/Properties/AssemblyInfo.cs (88%) create mode 100644 Common/OmniPlusInspection/Properties/Resources.Designer.cs create mode 100644 Common/OmniPlusInspection/Properties/Resources.resx create mode 100644 Common/OmniPlusInspection/Properties/Settings.Designer.cs create mode 100644 Common/OmniPlusInspection/Properties/Settings.settings diff --git a/Common/Common.sln b/Common/Common.sln index 21c1326f..a68b8b4c 100644 --- a/Common/Common.sln +++ b/Common/Common.sln @@ -185,9 +185,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonConsole", "CommonCons EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "modbus_master_csharp", "modbus_master_csharp\modbus_master_csharp.csproj", "{F14940F8-3C86-4BB7-A915-B021E4B3052D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OmniPlus", "OmniPlus", "{7BE8D4DD-4AA3-4CCC-AFEC-7FD01A44FB19}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniPlus", "OmniPlus\OmniPlus.csproj", "{920435CC-ABDF-497A-9C34-1A8511F0CB56}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniPlusInspection", "OmniPlusInspection\OmniPlusInspection.csproj", "{E301450E-2E4F-4942-886B-F92903D6C5B1}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution @@ -4319,70 +4317,70 @@ Global {F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x64.Build.0 = Release|Any CPU {F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x86.ActiveCfg = Release|Any CPU {F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.COM|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Any CPU.Build.0 = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x64.ActiveCfg = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x64.Build.0 = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x86.ActiveCfg = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Debug|x86.Build.0 = Debug|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.PerformTest|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.Release|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.ReleaseTest|x86.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Any CPU.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x64.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x64.Build.0 = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x86.ActiveCfg = Release|Any CPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56}.XP32bit|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.COM|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|x64.Build.0 = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|x86.ActiveCfg = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Debug|x86.Build.0 = Debug|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.PerformTest|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.Release|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.ReleaseTest|x86.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|Any CPU.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x64.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x64.Build.0 = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x86.ActiveCfg = Release|Any CPU + {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4467,8 +4465,7 @@ Global {FD30EB7A-7809-4E62-9374-791D31877D6D} = {696A94BE-7237-4AE2-9E36-6059DE519971} {AFC428F5-0141-4A3F-BEF2-470A89D972F6} = {C17363DF-A043-4F25-8EBA-2B3B078227DC} {F14940F8-3C86-4BB7-A915-B021E4B3052D} = {B4F8545B-F379-42A5-BDE9-763FD7B79598} - {7BE8D4DD-4AA3-4CCC-AFEC-7FD01A44FB19} = {5563DD3B-2287-4BED-97BF-F0389FF505AF} - {920435CC-ABDF-497A-9C34-1A8511F0CB56} = {7BE8D4DD-4AA3-4CCC-AFEC-7FD01A44FB19} + {E301450E-2E4F-4942-886B-F92903D6C5B1} = {03D4F23E-7E4A-4091-BC96-036C996D351A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164} diff --git a/Common/CommonConsole/CommonConsole.csproj b/Common/CommonConsole/CommonConsole.csproj index d68d6e0d..732d1d4c 100644 --- a/Common/CommonConsole/CommonConsole.csproj +++ b/Common/CommonConsole/CommonConsole.csproj @@ -53,6 +53,14 @@ - + + + + + + + + + \ No newline at end of file diff --git a/Common/CommonConsole/Program.cs b/Common/CommonConsole/Program.cs index afa16d37..563f0c90 100644 --- a/Common/CommonConsole/Program.cs +++ b/Common/CommonConsole/Program.cs @@ -1,177 +1,16 @@ -namespace CommonConsole -{ - using System; +using System; +using System.IO; +namespace CommonConsole +{ public class Program { - //[DllImport("GMH3x32E.dll")] - //public static extern Int16 UniversalOpenCom(Int16 ini16COMPortNumber, UInt32 inui32BaudRate, Int16 inui16ConverterType, Int16 ini16Parity, Int16 ini16StoppBits); - //[DllImport("GMH3x32E.dll")] - //public static extern Int16 GMH_CloseCom(); - //[DllImport("GMH3x32E.dll")] - //unsafe public static extern Int16 GMH_Transmit(Int16 ini16DeviceAddress, Int16 ini16TransmitCode, Int16* refi16ptrPriority, double* refdblptrFloatValue, Int32* refi32ptrIntegerValue); - public static void Main() { - // UniversalOpenCom(12, 4800, 8, 0, 0); - - // Int16 i16Priority; - // Double dblFloatValue; - // Int32 i32IntergerValue; - - // unsafe - // { - // var i16ErrorCode = GMH_Transmit(1, 0, &i16Priority, &dblFloatValue, &i32IntergerValue); - // } - - - // Console.WriteLine(dblFloatValue); - - // GMH_CloseCom(); + foreach (var line in File.ReadAllLines(@"C:\Users\SZLATEV\source\repos\laa_production\Common\CommonConsole\temperature_calibrations_26_10_2023\193400261_backwards.txt")) + { + var tokens = line.Split(new [] { '\t' }, StringSplitOptions.RemoveEmptyEntries); + } } - - - //public static void Main(string[] args) - //{ - // var messurementLines = File.ReadLines(@".\messurements.txt"); - // var messurements = new List(); - - // var parsedData = new List(); - // var us = new CultureInfo("en-US"); - // var de = new CultureInfo("de-DE"); - // var any = NumberStyles.Any; - // var skipNext = true; - - // foreach (var line in messurementLines) - // { - // if (string.IsNullOrWhiteSpace(line)) - // { - // if (parsedData.Count > 0) - // { - // messurements.Add(new Messurement - // { - // PcbId = parsedData.First().PcbId, - // Start = parsedData.Min(x => x.Timestamp), - // MinT = parsedData.Min(x => x.CurrentT), - // MinTOF = parsedData.Min(x => x.CurrentTOF), - // AvgT = parsedData.Average(x => x.CurrentT), - // AvgTOF = parsedData.Average(x => x.CurrentTOF), - // MaxT = parsedData.Max(x => x.CurrentT), - // MaxTOF = parsedData.Max(x => x.CurrentTOF), - // End = parsedData.Max(x => x.Timestamp), - // }); - // } - - // parsedData = new List(); - // skipNext = true; - - // continue; - // } - - // if (skipNext) - // { - // skipNext = false; - - // continue; - // } - - // var lineTokens = line.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); - - // if (lineTokens.Length != 4) - // { - // continue; - // } - - // var dateString = lineTokens[0]; - // var pcbId = lineTokens[1]; - // var temperatureString = lineTokens[2]; - // var tofString = lineTokens[3]; - - // _ = DateTime.TryParse(dateString.Substring(1, dateString.Length - 2), out var timestamp); - // _ = double.TryParse(temperatureString, any, us, out var currentT) || double.TryParse(temperatureString, any, de, out currentT); - // _ = double.TryParse(tofString, any, us, out var currentTOF) || double.TryParse(tofString, any, de, out currentT); - - // parsedData.Add(new MessurementData - // { - // PcbId = pcbId, - // CurrentT = currentT, - // CurrentTOF = currentTOF, - // Timestamp = timestamp - // }); - // } - - // File.WriteAllLines(@".\messurements.csv", messurements.Select(x - // => $"{x.PcbId,10}\t" - // + $"{x.AvgT,5:0.00}\t" - // + $"{x.AvgTOF,12:0.0000000000}\t" - // + $"{x.DifferenceT,5:00.00}\t" - // + $"{x.DifferenceTOF,12:0.0000000000}")); - - // Console.WriteLine(Messurement.Header); - - // messurements.ForEach(Console.WriteLine); - //} - } - - public class MessurementData - { - public string PcbId { get; set; } - - public double CurrentT { get; set; } - - public double CurrentTOF { get; set; } - - public DateTime Timestamp { get; set; } - } - - public class Messurement - { - public string PcbId { get; set; } - - public DateTime Start { get; set; } - - public double MinTOF { get; set; } - - public double MinT { get; set; } - - public double AvgTOF { get; set; } - - public double AvgT { get; set; } - - public double MaxTOF { get; set; } - - public double MaxT { get; set; } - - public DateTime End { get; set; } - - public double DifferenceT => Math.Abs(this.MaxT - this.MinT); - - public double DifferenceTOF => Math.Abs(this.MaxTOF - this.MinTOF); - - public override String ToString() - => $"{this.PcbId,10}\t" - + $"{this.Start,21:yyyy-MM-dd hh:mm:ss}\t" - + $"{this.MinT,5:0.00}\t" - + $"{this.MinTOF,12:0.0000000000}\t" - + $"{this.AvgT,5:0.00}\t" - + $"{this.AvgTOF,12:0.0000000000}\t" - + $"{this.MaxT,5:0.00}\t" - + $"{this.MaxTOF,12:0.0000000000}\t" - + $"{this.End,21:yyyy-MM-dd hh:mm:ss}\t" - + $"{this.DifferenceT,5:00.00}\t" - + $"{this.DifferenceTOF,12:0.0000000000}"; - - public static string Header - => $"{"PcbId",10}\t" - + $"{"Start",21}\t" - + $"{"Min T",5}\t" - + $"{"Min TOF",12}\t" - + $"{"Avg T",5}\t" - + $"{"Avg TOF",12}\t" - + $"{"Max T",5}\t" - + $"{"Max TOF",12}\t" - + $"{"End",21}\t" - + $"{"Dif T",5}\t" - + $"{"Dif TOF",12}"; } } diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_aggregations.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_aggregations.txt new file mode 100644 index 00000000..ce686e5a --- /dev/null +++ b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_aggregations.txt @@ -0,0 +1,151 @@ +193400032 7.79 0.0009349163 7.87 0.0009350077 7.94 0.0009351075 0.15 0.0000001913 588 +193400032 7.52 0.0009356649 7.59 0.0009358139 7.65 0.0009359014 0.13 0.0000002365 588 +193400032 7.30 0.0009364027 7.35 0.0009364837 7.42 0.0009365601 0.12 0.0000001574 588 +193400032 7.12 0.0009369290 7.16 0.0009370587 7.20 0.0009371273 0.08 0.0000001983 588 +193400032 6.96 0.0009374927 6.99 0.0009375559 7.03 0.0009376381 0.07 0.0000001454 588 +193400032 6.82 0.0009378943 6.86 0.0009379740 6.90 0.0009380245 0.08 0.0000001302 588 +193400032 6.70 0.0009382241 6.73 0.0009383260 6.76 0.0009383711 0.06 0.0000001470 588 +193400032 6.61 0.0009386028 6.63 0.0009386467 6.65 0.0009386776 0.04 0.0000000748 588 +193400032 6.52 0.0009388800 6.54 0.0009389147 6.57 0.0009389955 0.05 0.0000001155 588 +193400032 6.45 0.0009390722 6.47 0.0009391250 6.48 0.0009391386 0.03 0.0000000664 588 +193400032 6.51 0.0009386210 6.54 0.0009386754 6.57 0.0009387576 0.06 0.0000001366 588 +193400032 6.63 0.0009382142 6.70 0.0009382579 6.74 0.0009383050 0.11 0.0000000908 588 +193400032 6.78 0.0009378723 6.82 0.0009379105 6.86 0.0009379686 0.08 0.0000000964 588 +193400032 6.92 0.0009375803 6.96 0.0009376147 6.99 0.0009377037 0.07 0.0000001234 586 +193400032 7.05 0.0009373287 7.08 0.0009373577 7.11 0.0009374157 0.06 0.0000000870 588 +193400032 7.16 0.0009371124 7.19 0.0009371349 7.22 0.0009371664 0.06 0.0000000541 588 +193400032 7.27 0.0009369012 7.30 0.0009369401 7.32 0.0009369628 0.05 0.0000000615 588 +193400032 7.35 0.0009367571 7.38 0.0009367746 7.41 0.0009368095 0.06 0.0000000524 588 +193400032 7.44 0.0009365113 7.48 0.0009366082 7.58 0.0009367125 0.14 0.0000002012 588 +193400032 7.59 0.0009356581 7.64 0.0009357495 7.71 0.0009358800 0.12 0.0000002219 588 +193400032 7.82 0.0009350038 7.90 0.0009350758 7.99 0.0009351510 0.17 0.0000001472 586 +193400032 8.06 0.0009344710 8.12 0.0009345301 8.18 0.0009345890 0.12 0.0000001180 588 +193400032 8.28 0.0009340253 8.34 0.0009340780 8.39 0.0009341763 0.11 0.0000001510 588 +193400032 8.48 0.0009336423 8.53 0.0009336883 8.58 0.0009338160 0.10 0.0000001736 588 +193400032 8.66 0.0009333056 8.70 0.0009333429 8.74 0.0009333830 0.08 0.0000000774 588 +193400032 8.82 0.0009330021 8.85 0.0009330479 8.89 0.0009330852 0.07 0.0000000832 583 +193400032 8.95 0.0009327554 8.99 0.0009327858 9.03 0.0009328262 0.08 0.0000000708 588 +193400032 9.09 0.0009324061 9.15 0.0009325165 9.22 0.0009326281 0.13 0.0000002220 588 +193400032 9.34 0.0009315012 9.42 0.0009316031 9.49 0.0009317885 0.15 0.0000002873 588 +193400032 9.61 0.0009307933 9.69 0.0009308692 9.79 0.0009309571 0.18 0.0000001638 588 +193400032 9.89 0.0009302263 9.96 0.0009302874 10.03 0.0009303414 0.14 0.0000001152 588 +193400032 10.14 0.0009297522 10.20 0.0009298073 10.26 0.0009298848 0.12 0.0000001326 588 +193400032 10.36 0.0009293589 10.41 0.0009294069 10.46 0.0009295412 0.10 0.0000001824 588 +193400032 10.55 0.0009290188 10.60 0.0009290568 10.64 0.0009291908 0.09 0.0000001720 588 +193400032 10.72 0.0009286811 10.76 0.0009287482 10.81 0.0009287849 0.09 0.0000001039 588 +193400032 10.87 0.0009283086 10.91 0.0009284861 10.95 0.0009285146 0.08 0.0000002060 588 +193400032 11.01 0.0009281019 11.07 0.0009282108 11.14 0.0009283080 0.13 0.0000002060 588 +193400032 11.28 0.0009271987 11.38 0.0009272952 11.46 0.0009274956 0.18 0.0000002969 586 +193400032 11.58 0.0009265027 11.67 0.0009265743 11.76 0.0009266599 0.18 0.0000001572 588 +193400032 11.86 0.0009259387 11.94 0.0009260042 12.01 0.0009260928 0.15 0.0000001541 588 +193400032 12.13 0.0009254881 12.18 0.0009255383 12.24 0.0009255912 0.11 0.0000001031 588 +193400032 12.35 0.0009251070 12.41 0.0009251553 12.48 0.0009252444 0.13 0.0000001374 588 +193400032 12.55 0.0009247705 12.59 0.0009248055 12.63 0.0009249234 0.08 0.0000001529 588 +193400032 12.72 0.0009244896 12.76 0.0009245231 12.79 0.0009245660 0.07 0.0000000764 588 +193400032 12.86 0.0009242402 12.90 0.0009242700 12.94 0.0009243430 0.08 0.0000001028 588 +193400032 13.00 0.0009238864 13.07 0.0009239841 13.14 0.0009240717 0.14 0.0000001852 588 +193400032 13.28 0.0009230217 13.38 0.0009231183 13.47 0.0009233080 0.19 0.0000002863 588 +193400032 13.60 0.0009223489 13.68 0.0009224275 13.76 0.0009225998 0.16 0.0000002509 588 +193400032 13.89 0.0009218076 13.96 0.0009218558 14.03 0.0009219329 0.14 0.0000001253 588 +193400032 14.14 0.0009213673 14.20 0.0009214119 14.26 0.0009215478 0.12 0.0000001805 585 +193400032 14.37 0.0009210025 14.42 0.0009210531 14.47 0.0009211478 0.10 0.0000001453 588 +193400032 14.56 0.0009207023 14.61 0.0009207381 14.65 0.0009208340 0.09 0.0000001317 588 +193400032 14.72 0.0009204160 14.77 0.0009204501 14.81 0.0009205388 0.09 0.0000001227 588 +193400032 14.88 0.0009201998 14.91 0.0009202363 14.95 0.0009203275 0.07 0.0000001277 588 +193400032 15.01 0.0009198856 15.07 0.0009199785 15.15 0.0009201416 0.14 0.0000002560 588 +193400032 15.31 0.0009190478 15.38 0.0009191390 15.45 0.0009193003 0.14 0.0000002525 588 +193400032 15.60 0.0009184094 15.68 0.0009184736 15.76 0.0009186136 0.16 0.0000002042 588 +193400032 15.89 0.0009178966 15.96 0.0009179494 16.03 0.0009180538 0.14 0.0000001572 588 +193400032 16.15 0.0009174893 16.22 0.0009175392 16.28 0.0009176070 0.13 0.0000001177 588 +193400032 16.38 0.0009171583 16.43 0.0009171930 16.49 0.0009172710 0.11 0.0000001127 588 +193400032 16.58 0.0009168484 16.62 0.0009168799 16.66 0.0009169244 0.08 0.0000000760 588 +193400032 16.74 0.0009165946 16.78 0.0009166348 16.83 0.0009166869 0.09 0.0000000923 586 +193400032 16.89 0.0009163918 16.93 0.0009164249 16.97 0.0009165767 0.08 0.0000001849 588 +193400032 17.03 0.0009161036 17.09 0.0009161932 17.18 0.0009162617 0.15 0.0000001581 588 +193400032 17.33 0.0009153065 17.40 0.0009153993 17.47 0.0009155825 0.14 0.0000002760 588 +193400032 17.64 0.0009147272 17.71 0.0009147880 17.82 0.0009149186 0.18 0.0000001914 588 +193400032 17.92 0.0009142437 17.98 0.0009143042 18.05 0.0009143692 0.13 0.0000001255 588 +193400032 18.18 0.0009138526 18.23 0.0009139063 18.29 0.0009139520 0.11 0.0000000994 588 +193400032 18.39 0.0009134828 18.45 0.0009135748 18.50 0.0009136381 0.11 0.0000001553 586 +193400032 18.59 0.0009132655 18.63 0.0009133065 18.68 0.0009133656 0.09 0.0000001001 588 +193400032 18.76 0.0009130305 18.80 0.0009130502 18.84 0.0009130861 0.08 0.0000000556 588 +193400032 18.90 0.0009128155 18.94 0.0009128511 18.98 0.0009129203 0.08 0.0000001048 588 +193400032 19.04 0.0009125494 19.10 0.0009126398 19.19 0.0009127790 0.15 0.0000002297 588 +193400032 19.33 0.0009118257 19.40 0.0009119027 19.50 0.0009120472 0.17 0.0000002215 586 +193400032 19.65 0.0009112872 19.71 0.0009113457 19.79 0.0009114711 0.14 0.0000001839 588 +193400032 19.92 0.0009108292 19.99 0.0009108767 20.06 0.0009110267 0.14 0.0000001975 588 +193400032 20.18 0.0009104835 20.24 0.0009105278 20.30 0.0009106393 0.12 0.0000001558 588 +193400032 20.41 0.0009101556 20.46 0.0009102033 20.51 0.0009102333 0.10 0.0000000777 588 +193400032 20.60 0.0009099114 20.64 0.0009099454 20.68 0.0009101014 0.08 0.0000001901 588 +193400032 20.77 0.0009096950 20.81 0.0009097416 20.85 0.0009097936 0.08 0.0000000987 588 +193400032 20.92 0.0009094771 20.96 0.0009095257 21.00 0.0009095827 0.08 0.0000001056 588 +193400032 21.06 0.0009092659 21.12 0.0009093396 21.20 0.0009095133 0.14 0.0000002474 588 +193400032 21.35 0.0009085983 21.42 0.0009086696 21.49 0.0009087657 0.14 0.0000001675 588 +193400032 21.66 0.0009080864 21.73 0.0009081467 21.83 0.0009082678 0.17 0.0000001815 588 +193400032 21.94 0.0009076667 22.01 0.0009077207 22.08 0.0009078068 0.14 0.0000001401 588 +193400032 22.20 0.0009073224 22.26 0.0009073526 22.32 0.0009074466 0.12 0.0000001242 587 +193400032 22.42 0.0009070449 22.48 0.0009070789 22.53 0.0009071967 0.11 0.0000001518 587 +193400032 22.62 0.0009068056 22.66 0.0009068392 22.71 0.0009069791 0.09 0.0000001735 588 +193400032 22.78 0.0009066013 22.83 0.0009066411 22.87 0.0009067711 0.09 0.0000001698 587 +193400032 22.94 0.0009063945 22.98 0.0009064282 23.01 0.0009065623 0.07 0.0000001678 587 +193400032 23.07 0.0009061788 23.14 0.0009062498 23.23 0.0009063542 0.16 0.0000001754 588 +193400032 23.36 0.0009055490 23.43 0.0009056136 23.51 0.0009057026 0.15 0.0000001536 588 +193400032 23.68 0.0009050370 23.76 0.0009050886 23.86 0.0009051576 0.18 0.0000001206 585 +193400032 23.98 0.0009046379 24.05 0.0009046829 24.12 0.0009048408 0.14 0.0000002029 588 +193400032 24.24 0.0009043106 24.30 0.0009043410 24.36 0.0009044145 0.12 0.0000001040 588 +193400032 24.47 0.0009040457 24.52 0.0009040785 24.58 0.0009041423 0.11 0.0000000966 588 +193400032 24.66 0.0009038151 24.70 0.0009038422 24.75 0.0009039223 0.09 0.0000001072 588 +193400032 24.82 0.0009036411 24.86 0.0009036648 24.90 0.0009037129 0.08 0.0000000718 585 +193400032 24.96 0.0009034793 25.00 0.0009034985 25.05 0.0009035630 0.09 0.0000000837 587 +193400032 25.08 0.0009032915 25.13 0.0009033586 25.20 0.0009034174 0.12 0.0000001259 588 +193400032 25.34 0.0009027183 25.43 0.0009027762 25.51 0.0009028513 0.17 0.0000001330 588 +193400032 25.65 0.0009022703 25.73 0.0009023214 25.80 0.0009023802 0.15 0.0000001099 587 +193400032 25.94 0.0009019029 26.01 0.0009019473 26.07 0.0009020457 0.13 0.0000001428 588 +193400032 26.20 0.0009015946 26.26 0.0009016322 26.32 0.0009017231 0.12 0.0000001285 588 +193400032 26.43 0.0009012783 26.48 0.0009013662 26.53 0.0009013948 0.10 0.0000001166 588 +193400032 26.62 0.0009010991 26.67 0.0009011434 26.72 0.0009011814 0.10 0.0000000823 588 +193400032 26.79 0.0009008210 26.83 0.0009009500 26.87 0.0009009772 0.08 0.0000001562 588 +193400032 26.93 0.0009007905 26.97 0.0009008063 27.00 0.0009008878 0.07 0.0000000972 588 +193400032 27.05 0.0009005920 27.11 0.0009006550 27.21 0.0009007498 0.16 0.0000001578 588 +193400032 27.32 0.0009000583 27.41 0.0009001155 27.49 0.0009001743 0.17 0.0000001161 585 +193400032 27.63 0.0008996459 27.71 0.0008996923 27.78 0.0008997393 0.15 0.0000000934 588 +193400032 27.92 0.0008993049 27.98 0.0008993438 28.04 0.0008994024 0.12 0.0000000974 588 +193400032 28.17 0.0008990187 28.24 0.0008990504 28.30 0.0008991146 0.13 0.0000000959 588 +193400032 28.40 0.0008987781 28.45 0.0008988043 28.50 0.0008988747 0.10 0.0000000965 587 +193400032 28.60 0.0008985610 28.64 0.0008985974 28.69 0.0008986229 0.09 0.0000000619 588 +193400032 28.76 0.0008984059 28.80 0.0008984270 28.84 0.0008984596 0.08 0.0000000536 588 +193400032 28.91 0.0008982606 28.94 0.0008982777 28.98 0.0008983158 0.07 0.0000000552 585 +193400032 29.03 0.0008980719 29.09 0.0008981342 29.16 0.0008982055 0.13 0.0000001336 588 +193400032 29.32 0.0008975729 29.39 0.0008976258 29.47 0.0008976888 0.15 0.0000001159 587 +193400032 29.62 0.0008971886 29.69 0.0008972309 29.76 0.0008972751 0.14 0.0000000864 588 +193400032 29.91 0.0008968716 29.98 0.0008969078 30.05 0.0008969614 0.14 0.0000000898 587 +193400032 30.17 0.0008966058 30.23 0.0008966373 30.29 0.0008967292 0.12 0.0000001235 585 +193400032 30.39 0.0008963822 30.45 0.0008964071 30.50 0.0008964331 0.11 0.0000000508 587 +193400032 30.59 0.0008961876 30.64 0.0008962144 30.68 0.0008962368 0.09 0.0000000492 588 +193400032 30.75 0.0008960080 30.80 0.0008960520 30.84 0.0008960712 0.09 0.0000000632 587 +193400032 30.90 0.0008958998 30.93 0.0008959145 30.97 0.0008959718 0.07 0.0000000720 587 +193400032 31.02 0.0008957159 31.08 0.0008957753 31.14 0.0008958742 0.12 0.0000001583 587 +193400032 31.30 0.0008952459 31.38 0.0008952952 31.46 0.0008953865 0.16 0.0000001406 588 +193400032 31.61 0.0008948823 31.68 0.0008949226 31.76 0.0008949645 0.15 0.0000000822 587 +193400032 31.90 0.0008945690 31.97 0.0008946172 32.04 0.0008946524 0.14 0.0000000834 588 +193400032 32.15 0.0008943366 32.22 0.0008943661 32.28 0.0008944434 0.13 0.0000001068 588 +193400032 32.38 0.0008941287 32.44 0.0008941544 32.49 0.0008942609 0.11 0.0000001322 588 +193400032 32.57 0.0008939540 32.62 0.0008939765 32.66 0.0008940059 0.09 0.0000000519 587 +193400032 32.74 0.0008937941 32.78 0.0008938249 32.82 0.0008938430 0.08 0.0000000489 586 +193400032 32.88 0.0008936732 32.91 0.0008937006 32.95 0.0008937342 0.07 0.0000000610 588 +193400032 32.99 0.0008935182 33.05 0.0008935736 33.12 0.0008936907 0.13 0.0000001725 588 +193400032 33.28 0.0008930874 33.36 0.0008931319 33.44 0.0008931785 0.16 0.0000000912 587 +193400032 33.59 0.0008927542 33.66 0.0008927907 33.74 0.0008928298 0.15 0.0000000757 587 +193400032 33.87 0.0008924810 33.94 0.0008925120 34.00 0.0008925587 0.13 0.0000000777 588 +193400032 34.13 0.0008922573 34.18 0.0008922832 34.24 0.0008923304 0.11 0.0000000731 587 +193400032 34.35 0.0008920682 34.40 0.0008920910 34.45 0.0008921539 0.10 0.0000000856 587 +193400032 34.53 0.0008919127 34.58 0.0008919303 34.63 0.0008919892 0.10 0.0000000764 587 +193400032 34.69 0.0008917797 34.73 0.0008917956 34.76 0.0008918235 0.07 0.0000000438 587 +193400032 34.83 0.0008916563 34.86 0.0008916831 34.90 0.0008917155 0.07 0.0000000593 587 +193400032 34.95 0.0008915962 34.96 0.0008915981 34.98 0.0008916580 0.03 0.0000000617 587 +193400032 34.89 0.0008915896 34.92 0.0008916067 34.96 0.0008916442 0.07 0.0000000546 585 +193400032 34.75 0.0008916466 34.79 0.0008916719 34.83 0.0008916955 0.08 0.0000000489 587 +193400032 34.59 0.0008917296 34.63 0.0008917712 34.68 0.0008917856 0.09 0.0000000560 587 +193400032 34.42 0.0008918384 34.46 0.0008918978 34.50 0.0008919153 0.08 0.0000000769 587 +193400032 34.24 0.0008920280 34.29 0.0008920454 34.33 0.0008920897 0.09 0.0000000617 587 +193400032 34.07 0.0008921767 34.11 0.0008922079 34.16 0.0008922253 0.09 0.0000000485 587 \ No newline at end of file diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_backwards.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_backwards.txt new file mode 100644 index 00000000..e825372e --- /dev/null +++ b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_backwards.txt @@ -0,0 +1,1961 @@ +[2023-10-17 11:58:03] invalid record (TOF: 1 & T: 33.28) +[2023-10-17 11:58:08] 193400032 33.29 0.000892609907 +[2023-10-17 11:58:13] 193400032 33.30 0.000892604618 +[2023-10-17 11:58:18] 193400032 33.29 0.000892602268 +[2023-10-17 11:58:23] 193400032 33.30 0.000892647470 +[2023-10-17 11:58:28] 193400032 33.31 0.000892569772 +[2023-10-17 11:58:33] 193400032 33.32 0.000892592866 +[2023-10-17 11:58:38] 193400032 33.34 0.000892590711 +[2023-10-17 11:58:43] 193400032 33.34 0.000892590123 +[2023-10-17 11:58:48] 193400032 33.35 0.000892563006 +[2023-10-17 11:58:53] 193400032 33.35 0.000892612112 +[2023-10-17 11:58:58] 193400032 33.35 0.000892564939 +[2023-10-17 11:59:03] 193400032 33.34 0.000892569772 +[2023-10-17 11:59:08] 193400032 33.35 0.000892623712 +[2023-10-17 11:59:14] 193400032 33.35 0.000892601092 +[2023-10-17 11:59:19] 193400032 33.34 0.000892606969 +[2023-10-17 11:59:24] 193400032 33.35 0.000892642079 +[2023-10-17 11:59:29] 193400032 33.35 0.000892576281 +[2023-10-17 11:59:34] 193400032 33.35 0.000892631257 +[2023-10-17 11:59:39] 193400032 33.35 0.000892639288 +[2023-10-17 11:59:44] 193400032 33.35 0.000892652216 +[2023-10-17 11:59:49] 193400032 33.35 0.000892687899 +[2023-10-17 11:59:54] 193400032 33.35 0.000892649619 +[2023-10-17 11:59:59] 193400032 33.35 0.000892659672 +[2023-10-17 12:00:04] 193400032 33.35 0.000892700598 +[2023-10-17 12:00:09] 193400032 33.36 0.000892713330 +[2023-10-17 12:00:14] 193400032 33.35 0.000892695632 +[2023-10-17 12:00:19] 193400032 33.36 0.000892731154 +[2023-10-17 12:00:24] 193400032 33.35 0.000892745845 +[2023-10-17 12:00:29] 193400032 33.35 0.000892737585 +[2023-10-17 12:00:34] 193400032 33.35 0.000892800418 +[2023-10-17 12:00:39] 193400032 33.35 0.000892788546 +[2023-10-17 12:00:44] 193400032 33.35 0.000892801082 +[2023-10-17 12:00:49] 193400032 33.35 0.000892813227 +[2023-10-17 12:00:54] 193400032 33.34 0.000892778968 +[2023-10-17 12:00:59] 193400032 33.33 0.000892872725 +[2023-10-17 12:01:04] 193400032 33.32 0.000892886065 +[2023-10-17 12:01:09] 193400032 33.31 0.000892876299 +[2023-10-17 12:01:14] 193400032 33.29 0.000892917384 +[2023-10-17 12:01:19] 193400032 33.27 0.000892904309 +[2023-10-17 12:01:24] 193400032 33.25 0.000892892058 +[2023-10-17 12:01:29] 193400032 33.23 0.000892959338 +[2023-10-17 12:01:34] 193400032 33.22 0.000892981571 +[2023-10-17 12:01:39] 193400032 33.20 0.000892925544 +[2023-10-17 12:01:44] 193400032 33.18 0.000892987752 +[2023-10-17 12:01:49] 193400032 33.16 0.000893004598 +[2023-10-17 12:01:54] 193400032 33.15 0.000893022031 +[2023-10-17 12:01:59] 193400032 33.13 0.000893085289 +[2023-10-17 12:02:04] 193400032 33.12 0.000893044752 +[2023-10-17 12:02:09] 193400032 33.10 0.000893056701 +[2023-10-17 12:02:14] 193400032 33.08 0.000893075897 +[2023-10-17 12:02:19] 193400032 33.05 0.000893074371 +[2023-10-17 12:02:24] 193400032 33.03 0.000893120361 +[2023-10-17 12:02:29] 193400032 33.00 0.000893136619 +[2023-10-17 12:02:34] 193400032 32.98 0.000893124637 +[2023-10-17 12:02:39] 193400032 32.96 0.000893163730 +[2023-10-17 12:02:44] 193400032 32.93 0.000893183825 +[2023-10-17 12:02:49] 193400032 32.92 0.000893208113 +[2023-10-17 12:02:54] 193400032 32.90 0.000893230443 +[2023-10-17 12:02:59] 193400032 32.87 0.000893275436 +[2023-10-17 12:03:04] 193400032 32.85 0.000893217551 +[2023-10-17 12:03:09] 193400032 32.82 0.000893282742 +[2023-10-17 12:03:14] 193400032 32.79 0.000893301155 +[2023-10-17 12:03:19] 193400032 32.77 0.000893319175 +[2023-10-17 12:03:24] 193400032 32.75 0.000893368623 +[2023-10-17 12:03:29] 193400032 32.74 0.000893342329 +[2023-10-17 12:03:34] 193400032 32.72 0.000893368623 +[2023-10-17 12:03:39] 193400032 32.68 0.000893441509 +[2023-10-17 12:03:44] 193400032 32.66 0.000893415989 +[2023-10-17 12:03:49] 193400032 32.64 0.000893459423 +[2023-10-17 12:03:54] 193400032 32.62 0.000893478227 +[2023-10-17 12:03:59] 193400032 32.59 0.000893496639 +[2023-10-17 12:04:04] 193400032 32.57 0.000893516237 +[2023-10-17 12:04:09] 193400032 32.54 0.000893560022 +[2023-10-17 12:04:14] 193400032 32.52 0.000893554031 +[2023-10-17 12:04:19] 193400032 32.49 0.000893552675 +[2023-10-17 12:04:24] 193400032 32.46 0.000893629042 +[2023-10-17 12:04:29] 193400032 32.39 0.000893609322 +[2023-10-17 12:04:34] 193400032 32.37 0.000893690328 +[2023-10-17 12:04:39] 193400032 32.36 0.000893708888 +[2023-10-17 12:04:44] 193400032 32.34 0.000893673122 +[2023-10-17 12:04:49] 193400032 32.33 0.000893743881 +[2023-10-17 12:04:54] 193400032 32.30 0.000893742464 +[2023-10-17 12:04:59] 193400032 32.27 0.000893790458 +[2023-10-17 12:05:04] 193400032 32.24 0.000893843569 +[2023-10-17 12:05:09] 193400032 32.24 0.000893825039 +[2023-10-17 12:05:14] 193400032 32.22 0.000893830494 +[2023-10-17 12:05:19] 193400032 32.19 0.000893950851 +[2023-10-17 12:05:24] 193400032 32.10 0.000893888784 +[2023-10-17 12:05:29] 193400032 32.02 0.000893893327 +[2023-10-17 12:05:34] 193400032 32.00 0.000894022377 +[2023-10-17 12:05:39] 193400032 32.00 0.000894046507 +[2023-10-17 12:05:44] 193400032 32.01 0.000893985547 +[2023-10-17 12:05:49] 193400032 32.02 0.000894072740 +[2023-10-17 12:05:54] 193400032 31.99 0.000894121451 +[2023-10-17 12:05:59] 193400032 31.90 0.000894077413 +[2023-10-17 12:06:04] 193400032 31.88 0.000894092691 +[2023-10-17 12:06:09] 193400032 31.87 0.000894100318 +[2023-10-17 12:06:14] 193400032 31.86 0.000894304529 +[2023-10-17 12:06:19] 193400032 31.85 0.000894256837 +[2023-10-17 12:06:24] 193400032 31.75 0.000894358307 +[2023-10-17 12:06:29] 193400032 31.67 0.000894215506 +[2023-10-17 12:06:34] 193400032 31.65 0.000894337282 +[2023-10-17 12:06:39] 193400032 31.64 0.000894265700 +[2023-10-17 12:06:44] 193400032 31.64 0.000894380838 +[2023-10-17 12:06:49] 193400032 31.65 0.000894425200 +[2023-10-17 12:06:54] 193400032 31.63 0.000894411975 +[2023-10-17 12:06:59] 193400032 31.59 0.000894478337 +[2023-10-17 12:07:04] 193400032 31.50 0.000894420980 +[2023-10-17 12:07:09] 193400032 31.49 0.000894422479 +[2023-10-17 12:07:14] 193400032 31.48 0.000894587527 +[2023-10-17 12:07:19] 193400032 31.45 0.000894508382 +[2023-10-17 12:07:24] 193400032 31.37 0.000894512487 +[2023-10-17 12:07:29] 193400032 31.35 0.000894520290 +[2023-10-17 12:07:34] 193400032 31.33 0.000894640203 +[2023-10-17 12:07:39] 193400032 31.34 0.000894606013 +[2023-10-17 12:07:44] 193400032 31.34 0.000894805319 +[2023-10-17 12:07:49] 193400032 31.32 0.000894791866 +[2023-10-17 12:07:54] 193400032 31.23 0.000894724735 +[2023-10-17 12:07:59] 193400032 31.14 0.000894813633 +[2023-10-17 12:08:04] 193400032 31.12 0.000894908231 +[2023-10-17 12:08:09] 193400032 31.11 0.000894791936 +[2023-10-17 12:08:14] 193400032 31.08 0.000895034778 +[2023-10-17 12:08:19] 193400032 31.04 0.000894986902 +[2023-10-17 12:08:24] 193400032 31.01 0.000894915138 +[2023-10-17 12:08:29] 193400032 30.99 0.000895023524 +[2023-10-17 12:08:34] 193400032 30.98 0.000894962347 +[2023-10-17 12:08:39] 193400032 30.97 0.000895103130 +[2023-10-17 12:08:44] 193400032 30.95 0.000895094451 +[2023-10-17 12:08:49] 193400032 30.93 0.000895055524 +[2023-10-17 12:08:54] 193400032 30.91 0.000895147362 +[2023-10-17 12:08:59] 193400032 30.87 0.000895085393 +[2023-10-17 12:09:04] 193400032 30.80 0.000895220100 +[2023-10-17 12:09:09] 193400032 30.75 0.000895170773 +[2023-10-17 12:09:14] 193400032 30.71 0.000895355662 +[2023-10-17 12:09:19] 193400032 30.66 0.000895206165 +[2023-10-17 12:09:24] 193400032 30.65 0.000895378295 +[2023-10-17 12:09:29] 193400032 30.62 0.000895386255 +[2023-10-17 12:09:34] 193400032 30.59 0.000895342091 +[2023-10-17 12:09:39] 193400032 30.56 0.000895403808 +[2023-10-17 12:09:44] 193400032 30.54 0.000895389411 +[2023-10-17 12:09:49] 193400032 30.52 0.000895406542 +[2023-10-17 12:09:54] 193400032 30.49 0.000895438243 +[2023-10-17 12:09:59] 193400032 30.47 0.000895472939 +[2023-10-17 12:10:04] 193400032 30.45 0.000895566736 +[2023-10-17 12:10:10] 193400032 30.44 0.000895569915 +[2023-10-17 12:10:15] 193400032 30.42 0.000895680123 +[2023-10-17 12:10:20] 193400032 30.33 0.000895735455 +[2023-10-17 12:10:25] 193400032 30.29 0.000895689900 +[2023-10-17 12:10:30] 193400032 30.21 0.000895644416 +[2023-10-17 12:10:35] 193400032 30.21 0.000895797186 +[2023-10-17 12:10:40] 193400032 30.20 0.000895638940 +[2023-10-17 12:10:45] 193400032 30.18 0.000895662969 +[2023-10-17 12:10:50] 193400032 30.15 0.000895826593 +[2023-10-17 12:10:55] 193400032 30.12 0.000895863714 +[2023-10-17 12:11:00] 193400032 30.09 0.000895903319 +[2023-10-17 12:11:05] 193400032 30.05 0.000895926639 +[2023-10-17 12:11:10] 193400032 30.00 0.000895994161 +[2023-10-17 12:11:15] 193400032 29.98 0.000896050292 +[2023-10-17 12:11:20] 193400032 29.97 0.000895936159 +[2023-10-17 12:11:25] 193400032 29.95 0.000896102474 +[2023-10-17 12:11:30] 193400032 29.94 0.000896004209 +[2023-10-17 12:11:35] 193400032 29.92 0.000896011301 +[2023-10-17 12:11:40] 193400032 29.82 0.000896038332 +[2023-10-17 12:11:45] 193400032 29.80 0.000896177028 +[2023-10-17 12:11:50] 193400032 29.77 0.000896184695 +[2023-10-17 12:11:55] 193400032 29.76 0.000896077497 +[2023-10-17 12:12:00] 193400032 29.76 0.000896177992 +[2023-10-17 12:12:05] 193400032 29.67 0.000896216384 +[2023-10-17 12:12:10] 193400032 29.59 0.000896234600 +[2023-10-17 12:12:15] 193400032 29.57 0.000896286011 +[2023-10-17 12:12:20] 193400032 29.54 0.000896279456 +[2023-10-17 12:12:25] 193400032 29.53 0.000896305538 +[2023-10-17 12:12:30] 193400032 29.53 0.000896456339 +[2023-10-17 12:12:35] 193400032 29.54 0.000896347491 +[2023-10-17 12:12:40] 193400032 29.53 0.000896467659 +[2023-10-17 12:12:45] 193400032 29.52 0.000896477580 +[2023-10-17 12:12:50] 193400032 29.49 0.000896482750 +[2023-10-17 12:12:55] 193400032 29.42 0.000896549005 +[2023-10-17 12:13:00] 193400032 29.33 0.000896522651 +[2023-10-17 12:13:05] 193400032 29.32 0.000896515879 +[2023-10-17 12:13:10] 193400032 29.30 0.000896563085 +[2023-10-17 12:13:15] 193400032 29.28 0.000896723742 +[2023-10-17 12:13:20] 193400032 29.25 0.000896720458 +[2023-10-17 12:13:25] 193400032 29.24 0.000896700786 +[2023-10-17 12:13:30] 193400032 29.21 0.000896776838 +[2023-10-17 12:13:35] 193400032 29.18 0.000896815125 +[2023-10-17 12:13:40] 193400032 29.17 0.000896808976 +[2023-10-17 12:13:45] 193400032 29.17 0.000896797353 +[2023-10-17 12:13:50] 193400032 29.15 0.000896812436 +[2023-10-17 12:13:55] 193400032 29.04 0.000896845539 +[2023-10-17 12:14:00] 193400032 28.96 0.000896865342 +[2023-10-17 12:14:05] 193400032 28.93 0.000896865816 +[2023-10-17 12:14:10] 193400032 28.95 0.000896941518 +[2023-10-17 12:14:15] 193400032 28.96 0.000896985786 +[2023-10-17 12:14:20] 193400032 28.97 0.000897006175 +[2023-10-17 12:14:25] 193400032 28.94 0.000897152398 +[2023-10-17 12:14:30] 193400032 28.84 0.000897125913 +[2023-10-17 12:14:35] 193400032 28.84 0.000897078868 +[2023-10-17 12:14:40] 193400032 28.83 0.000897168575 +[2023-10-17 12:14:45] 193400032 28.81 0.000897157168 +[2023-10-17 12:14:50] 193400032 28.79 0.000897198704 +[2023-10-17 12:14:55] 193400032 28.76 0.000897208694 +[2023-10-17 12:15:00] 193400032 28.68 0.000897212767 +[2023-10-17 12:15:05] 193400032 28.66 0.000897282254 +[2023-10-17 12:15:10] 193400032 28.65 0.000897346333 +[2023-10-17 12:15:15] 193400032 28.64 0.000897368738 +[2023-10-17 12:15:20] 193400032 28.64 0.000897367745 +[2023-10-17 12:15:25] 193400032 28.62 0.000897378167 +[2023-10-17 12:15:30] 193400032 28.59 0.000897398890 +[2023-10-17 12:15:35] 193400032 28.55 0.000897416910 +[2023-10-17 12:15:40] 193400032 28.51 0.000897447075 +[2023-10-17 12:15:45] 193400032 28.48 0.000897548669 +[2023-10-17 12:15:50] 193400032 28.45 0.000897550452 +[2023-10-17 12:15:55] 193400032 28.42 0.000897547120 +[2023-10-17 12:16:00] 193400032 28.39 0.000897549827 +[2023-10-17 12:16:05] 193400032 28.37 0.000897614786 +[2023-10-17 12:16:10] 193400032 28.37 0.000897600286 +[2023-10-17 12:16:15] 193400032 28.35 0.000897670766 +[2023-10-17 12:16:20] 193400032 28.31 0.000897691921 +[2023-10-17 12:16:25] 193400032 28.23 0.000897696566 +[2023-10-17 12:16:30] 193400032 28.22 0.000897749569 +[2023-10-17 12:16:35] 193400032 28.23 0.000897855836 +[2023-10-17 12:16:40] 193400032 28.24 0.000897829652 +[2023-10-17 12:16:45] 193400032 28.16 0.000897814540 +[2023-10-17 12:16:50] 193400032 28.12 0.000897870952 +[2023-10-17 12:16:55] 193400032 28.06 0.000897859739 +[2023-10-17 12:17:00] 193400032 28.07 0.000897952345 +[2023-10-17 12:17:05] 193400032 28.07 0.000897963797 +[2023-10-17 12:17:10] 193400032 28.06 0.000897975352 +[2023-10-17 12:17:15] 193400032 28.05 0.000898019230 +[2023-10-17 12:17:20] 193400032 28.02 0.000898030591 +[2023-10-17 12:17:25] 193400032 27.85 0.000898013825 +[2023-10-17 12:17:30] 193400032 27.85 0.000898105702 +[2023-10-17 12:17:35] 193400032 27.85 0.000898072405 +[2023-10-17 12:17:40] 193400032 27.87 0.000898151839 +[2023-10-17 12:17:45] 193400032 27.86 0.000898202963 +[2023-10-17 12:17:50] 193400032 27.84 0.000898316547 +[2023-10-17 12:17:55] 193400032 27.82 0.000898234224 +[2023-10-17 12:18:00] 193400032 27.80 0.000898295124 +[2023-10-17 12:18:05] 193400032 27.78 0.000898272695 +[2023-10-17 12:18:10] 193400032 27.75 0.000898365062 +[2023-10-17 12:18:15] 193400032 27.72 0.000898363563 +[2023-10-17 12:18:20] 193400032 27.69 0.000898361623 +[2023-10-17 12:18:25] 193400032 27.65 0.000898377097 +[2023-10-17 12:18:30] 193400032 27.61 0.000898430263 +[2023-10-17 12:18:35] 193400032 27.60 0.000898394083 +[2023-10-17 12:18:40] 193400032 27.59 0.000898477777 +[2023-10-17 12:18:45] 193400032 27.58 0.000898513818 +[2023-10-17 12:18:50] 193400032 27.56 0.000898529293 +[2023-10-17 12:18:55] 193400032 27.46 0.000898540654 +[2023-10-17 12:19:00] 193400032 27.46 0.000898544329 +[2023-10-17 12:19:05] 193400032 27.44 0.000898577689 +[2023-10-17 12:19:10] 193400032 27.42 0.000898650613 +[2023-10-17 12:19:15] 193400032 27.40 0.000898677467 +[2023-10-17 12:19:20] 193400032 27.38 0.000898664002 +[2023-10-17 12:19:25] 193400032 27.36 0.000898727520 +[2023-10-17 12:19:30] 193400032 27.33 0.000898745589 +[2023-10-17 12:19:35] 193400032 27.31 0.000898781355 +[2023-10-17 12:19:40] 193400032 27.31 0.000898962474 +[2023-10-17 12:19:45] 193400032 27.29 0.000898854056 +[2023-10-17 12:19:50] 193400032 27.19 0.000898875602 +[2023-10-17 12:19:55] 193400032 27.18 0.000898882850 +[2023-10-17 12:20:00] 193400032 27.15 0.000898872415 +[2023-10-17 12:20:05] 193400032 27.12 0.000898946986 +[2023-10-17 12:20:10] 193400032 27.10 0.000899004074 +[2023-10-17 12:20:15] 193400032 27.11 0.000899023097 +[2023-10-17 12:20:20] 193400032 27.14 0.000899079281 +[2023-10-17 12:20:25] 193400032 27.16 0.000899159674 +[2023-10-17 12:20:30] 193400032 27.08 0.000899100273 +[2023-10-17 12:20:35] 193400032 26.99 0.000899147914 +[2023-10-17 12:20:40] 193400032 26.97 0.000899133963 +[2023-10-17 12:20:45] 193400032 26.93 0.000899124714 +[2023-10-17 12:20:50] 193400032 26.91 0.000899179603 +[2023-10-17 12:20:56] 193400032 26.90 0.000899219561 +[2023-10-17 12:21:01] 193400032 26.88 0.000899265005 +[2023-10-17 12:21:06] 193400032 26.86 0.000899317080 +[2023-10-17 12:21:11] 193400032 26.83 0.000899285760 +[2023-10-17 12:21:16] 193400032 26.81 0.000899372262 +[2023-10-17 12:21:21] 193400032 26.80 0.000899439782 +[2023-10-17 12:21:26] 193400032 26.79 0.000899463888 +[2023-10-17 12:21:31] 193400032 26.78 0.000899493536 +[2023-10-17 12:21:36] 193400032 26.77 0.000899506724 +[2023-10-17 12:21:41] 193400032 26.74 0.000899434626 +[2023-10-17 12:21:46] 193400032 26.66 0.000899499392 +[2023-10-17 12:21:51] 193400032 26.64 0.000899508479 +[2023-10-17 12:21:56] 193400032 26.61 0.000899539623 +[2023-10-17 12:22:01] 193400032 26.60 0.000899663906 +[2023-10-17 12:22:06] 193400032 26.59 0.000899643232 +[2023-10-17 12:22:11] 193400032 26.57 0.000899597417 +[2023-10-17 12:22:16] 193400032 26.55 0.000899703526 +[2023-10-17 12:22:21] 193400032 26.53 0.000899703768 +[2023-10-17 12:22:26] 193400032 26.50 0.000899717283 +[2023-10-17 12:22:31] 193400032 26.47 0.000899835151 +[2023-10-17 12:22:36] 193400032 26.43 0.000899793691 +[2023-10-17 12:22:41] 193400032 26.41 0.000899804840 +[2023-10-17 12:22:46] 193400032 26.40 0.000899843624 +[2023-10-17 12:22:51] 193400032 26.38 0.000899855704 +[2023-10-17 12:22:56] 193400032 26.35 0.000899910222 +[2023-10-17 12:23:01] 193400032 26.33 0.000899938624 +[2023-10-17 12:23:06] 193400032 26.30 0.000899943325 +[2023-10-17 12:23:11] 193400032 26.28 0.000899950879 +[2023-10-17 12:23:16] 193400032 26.26 0.000900078554 +[2023-10-17 12:23:21] 193400032 26.24 0.000900015995 +[2023-10-17 12:23:26] 193400032 26.23 0.000900061634 +[2023-10-17 12:23:31] 193400032 26.21 0.000900105103 +[2023-10-17 12:23:36] 193400032 26.19 0.000900155898 +[2023-10-17 12:23:41] 193400032 26.16 0.000900151697 +[2023-10-17 12:23:46] 193400032 26.07 0.000900263589 +[2023-10-17 12:23:51] 193400032 26.06 0.000900158077 +[2023-10-17 12:23:56] 193400032 26.05 0.000900224583 +[2023-10-17 12:24:01] 193400032 26.04 0.000900232634 +[2023-10-17 12:24:06] 193400032 26.01 0.000900272397 +[2023-10-17 12:24:11] 193400032 25.99 0.000900297665 +[2023-10-17 12:24:16] 193400032 25.98 0.000900320372 +[2023-10-17 12:24:21] 193400032 25.99 0.000900345851 +[2023-10-17 12:24:26] 193400032 25.98 0.000900362892 +[2023-10-17 12:24:31] 193400032 25.91 0.000900456493 +[2023-10-17 12:24:36] 193400032 25.87 0.000900389689 +[2023-10-17 12:24:41] 193400032 25.81 0.000900447707 +[2023-10-17 12:24:46] 193400032 25.81 0.000900452715 +[2023-10-17 12:24:51] 193400032 25.81 0.000900528728 +[2023-10-17 12:24:56] 193400032 25.82 0.000900708187 +[2023-10-17 12:25:01] 193400032 25.80 0.000900545708 +[2023-10-17 12:25:06] 193400032 25.79 0.000900592263 +[2023-10-17 12:25:11] 193400032 25.77 0.000900607933 +[2023-10-17 12:25:16] 193400032 25.74 0.000900625562 +[2023-10-17 12:25:21] 193400032 25.64 0.000900694961 +[2023-10-17 12:25:26] 193400032 25.63 0.000900680800 +[2023-10-17 12:25:31] 193400032 25.61 0.000900699016 +[2023-10-17 12:25:36] 193400032 25.61 0.000900730160 +[2023-10-17 12:25:41] 193400032 25.60 0.000900859659 +[2023-10-17 12:25:46] 193400032 25.57 0.000900764346 +[2023-10-17 12:25:51] 193400032 25.51 0.000900834741 +[2023-10-17 12:25:56] 193400032 25.52 0.000900852191 +[2023-10-17 12:26:01] 193400032 25.55 0.000900862774 +[2023-10-17 12:26:06] 193400032 25.56 0.000900922707 +[2023-10-17 12:26:11] 193400032 25.46 0.000901028699 +[2023-10-17 12:26:16] 193400032 25.38 0.000900966975 +[2023-10-17 12:26:21] 193400032 25.35 0.000901030921 +[2023-10-17 12:26:26] 193400032 25.34 0.000901132721 +[2023-10-17 12:26:31] 193400032 25.36 0.000901030831 +[2023-10-17 12:26:36] 193400032 25.38 0.000901071769 +[2023-10-17 12:26:41] 193400032 25.37 0.000901113882 +[2023-10-17 12:26:46] 193400032 25.28 0.000901182815 +[2023-10-17 12:26:51] 193400032 25.26 0.000901208646 +[2023-10-17 12:26:56] 193400032 25.24 0.000901265928 +[2023-10-17 12:27:01] 193400032 25.22 0.000901206336 +[2023-10-17 12:27:06] 193400032 25.21 0.000901255432 +[2023-10-17 12:27:11] 193400032 25.21 0.000901245903 +[2023-10-17 12:27:16] 193400032 25.12 0.000901306085 +[2023-10-17 12:27:21] 193400032 25.12 0.000901346685 +[2023-10-17 12:27:26] 193400032 25.10 0.000901379861 +[2023-10-17 12:27:31] 193400032 25.10 0.000901360295 +[2023-10-17 12:27:36] 193400032 25.12 0.000901394573 +[2023-10-17 12:27:41] 193400032 25.13 0.000901431006 +[2023-10-17 12:27:46] 193400032 25.13 0.000901481825 +[2023-10-17 12:27:51] 193400032 25.09 0.000901469258 +[2023-10-17 12:27:56] 193400032 25.01 0.000901505831 +[2023-10-17 12:28:01] 193400032 24.99 0.000901532862 +[2023-10-17 12:28:06] 193400032 24.96 0.000901565182 +[2023-10-17 12:28:11] 193400032 24.88 0.000901558578 +[2023-10-17 12:28:16] 193400032 24.85 0.000901597305 +[2023-10-17 12:28:21] 193400032 24.83 0.000901697090 +[2023-10-17 12:28:26] 193400032 24.84 0.000901618124 +[2023-10-17 12:28:31] 193400032 24.86 0.000901690044 +[2023-10-17 12:28:36] 193400032 24.86 0.000901696223 +[2023-10-17 12:28:41] 193400032 24.86 0.000901737161 +[2023-10-17 12:28:46] 193400032 24.85 0.000901773790 +[2023-10-17 12:28:51] 193400032 24.81 0.000901770857 +[2023-10-17 12:28:56] 193400032 24.72 0.000901893572 +[2023-10-17 12:29:01] 193400032 24.71 0.000901854797 +[2023-10-17 12:29:06] 193400032 24.68 0.000901873490 +[2023-10-17 12:29:11] 193400032 24.66 0.000901972653 +[2023-10-17 12:29:16] 193400032 24.64 0.000901917563 +[2023-10-17 12:29:21] 193400032 24.63 0.000901951842 +[2023-10-17 12:29:26] 193400032 24.63 0.000901976522 +[2023-10-17 12:29:31] 193400032 24.61 0.000902025283 +[2023-10-17 12:29:36] 193400032 24.58 0.000902000923 +[2023-10-17 12:29:41] 193400032 24.55 0.000902053502 +[2023-10-17 12:29:46] 193400032 24.54 0.000902089739 +[2023-10-17 12:29:51] 193400032 24.53 0.000902209745 +[2023-10-17 12:29:56] 193400032 24.53 0.000902189229 +[2023-10-17 12:30:01] 193400032 24.52 0.000902251036 +[2023-10-17 12:30:06] 193400032 24.42 0.000902304950 +[2023-10-17 12:30:11] 193400032 24.42 0.000902231553 +[2023-10-17 12:30:16] 193400032 24.40 0.000902285943 +[2023-10-17 12:30:21] 193400032 24.39 0.000902265966 +[2023-10-17 12:30:26] 193400032 24.38 0.000902364697 +[2023-10-17 12:30:31] 193400032 24.35 0.000902363566 +[2023-10-17 12:30:36] 193400032 24.33 0.000902376375 +[2023-10-17 12:30:41] 193400032 24.31 0.000902390017 +[2023-10-17 12:30:46] 193400032 24.29 0.000902498688 +[2023-10-17 12:30:51] 193400032 24.26 0.000902525134 +[2023-10-17 12:30:56] 193400032 24.24 0.000902573346 +[2023-10-17 12:31:01] 193400032 24.22 0.000902521649 +[2023-10-17 12:31:06] 193400032 24.21 0.000902668489 +[2023-10-17 12:31:11] 193400032 24.18 0.000902554657 +[2023-10-17 12:31:16] 193400032 24.15 0.000902702520 +[2023-10-17 12:31:21] 193400032 24.14 0.000902610114 +[2023-10-17 12:31:26] 193400032 24.13 0.000902594840 +[2023-10-17 12:31:31] 193400032 24.13 0.000902690494 +[2023-10-17 12:31:36] 193400032 24.11 0.000902794901 +[2023-10-17 12:31:41] 193400032 24.09 0.000902705620 +[2023-10-17 12:31:46] 193400032 24.07 0.000902829162 +[2023-10-17 12:31:51] 193400032 24.03 0.000902884204 +[2023-10-17 12:31:57] 193400032 23.97 0.000902847272 +[2023-10-17 12:32:02] 193400032 23.96 0.000902944207 +[2023-10-17 12:32:07] 193400032 23.94 0.000902940902 +[2023-10-17 12:32:12] 193400032 23.91 0.000902955709 +[2023-10-17 12:32:17] 193400032 23.90 0.000902981764 +[2023-10-17 12:32:22] 193400032 23.90 0.000903108730 +[2023-10-17 12:32:27] 193400032 23.90 0.000902917706 +[2023-10-17 12:32:32] 193400032 23.89 0.000903064453 +[2023-10-17 12:32:37] 193400032 23.78 0.000903095196 +[2023-10-17 12:32:42] 193400032 23.77 0.000903006252 +[2023-10-17 12:32:47] 193400032 23.76 0.000903075465 +[2023-10-17 12:32:52] 193400032 23.77 0.000903122831 +[2023-10-17 12:32:57] 193400032 23.79 0.000903137503 +[2023-10-17 12:33:02] 193400032 23.79 0.000903217032 +[2023-10-17 12:33:07] 193400032 23.77 0.000903159706 +[2023-10-17 12:33:12] 193400032 23.67 0.000903244788 +[2023-10-17 12:33:17] 193400032 23.65 0.000903252750 +[2023-10-17 12:33:22] 193400032 23.62 0.000903334569 +[2023-10-17 12:33:27] 193400032 23.60 0.000903315675 +[2023-10-17 12:33:32] 193400032 23.59 0.000903303042 +[2023-10-17 12:33:37] 193400032 23.58 0.000903306254 +[2023-10-17 12:33:42] 193400032 23.56 0.000903405807 +[2023-10-17 12:33:47] 193400032 23.54 0.000903466259 +[2023-10-17 12:33:52] 193400032 23.54 0.000903352704 +[2023-10-17 12:33:57] 193400032 23.53 0.000903418369 +[2023-10-17 12:34:02] 193400032 23.51 0.000903619641 +[2023-10-17 12:34:07] 193400032 23.49 0.000903459192 +[2023-10-17 12:34:12] 193400032 23.46 0.000903583289 +[2023-10-17 12:34:17] 193400032 23.44 0.000903500049 +[2023-10-17 12:34:22] 193400032 23.43 0.000903527080 +[2023-10-17 12:34:27] 193400032 23.41 0.000903566647 +[2023-10-17 12:34:32] 193400032 23.40 0.000903623950 +[2023-10-17 12:34:37] 193400032 23.39 0.000903674670 +[2023-10-17 12:34:42] 193400032 23.35 0.000903800859 +[2023-10-17 12:34:47] 193400032 23.27 0.000903684656 +[2023-10-17 12:34:52] 193400032 23.26 0.000903651596 +[2023-10-17 12:34:57] 193400032 23.26 0.000903882357 +[2023-10-17 12:35:02] 193400032 23.26 0.000903774472 +[2023-10-17 12:35:07] 193400032 23.25 0.000903817007 +[2023-10-17 12:35:12] 193400032 23.24 0.000903918320 +[2023-10-17 12:35:17] 193400032 23.22 0.000903913457 +[2023-10-17 12:35:22] 193400032 23.19 0.000903980950 +[2023-10-17 12:35:27] 193400032 23.16 0.000903924074 +[2023-10-17 12:35:32] 193400032 23.13 0.000904032293 +[2023-10-17 12:35:37] 193400032 23.12 0.000904066522 +[2023-10-17 12:35:42] 193400032 23.11 0.000903998242 +[2023-10-17 12:35:47] 193400032 23.11 0.000903990915 +[2023-10-17 12:35:52] 193400032 23.09 0.000904016184 +[2023-10-17 12:35:57] 193400032 23.06 0.000904066875 +[2023-10-17 12:36:02] 193400032 23.02 0.000904113783 +[2023-10-17 12:36:07] 193400032 23.00 0.000904120483 +[2023-10-17 12:36:12] 193400032 22.98 0.000904146263 +[2023-10-17 12:36:17] 193400032 22.96 0.000904228640 +[2023-10-17 12:36:22] 193400032 22.95 0.000904296988 +[2023-10-17 12:36:27] 193400032 22.94 0.000904221412 +[2023-10-17 12:36:32] 193400032 22.95 0.000904239874 +[2023-10-17 12:36:37] 193400032 22.93 0.000904299067 +[2023-10-17 12:36:42] 193400032 22.83 0.000904264074 +[2023-10-17 12:36:47] 193400032 22.81 0.000904327250 +[2023-10-17 12:36:52] 193400032 22.79 0.000904539248 +[2023-10-17 12:36:57] 193400032 22.78 0.000904450186 +[2023-10-17 12:37:02] 193400032 22.80 0.000904368280 +[2023-10-17 12:37:07] 193400032 22.81 0.000904575494 +[2023-10-17 12:37:12] 193400032 22.79 0.000904531285 +[2023-10-17 12:37:17] 193400032 22.76 0.000904630271 +[2023-10-17 12:37:22] 193400032 22.74 0.000904595299 +[2023-10-17 12:37:27] 193400032 22.72 0.000904589466 +[2023-10-17 12:37:32] 193400032 22.70 0.000904563154 +[2023-10-17 12:37:37] 193400032 22.66 0.000904691223 +[2023-10-17 12:37:42] 193400032 22.63 0.000904566060 +[2023-10-17 12:37:47] 193400032 22.61 0.000904862195 +[2023-10-17 12:37:52] 193400032 22.59 0.000904830724 +[2023-10-17 12:37:57] 193400032 22.58 0.000904649691 +[2023-10-17 12:38:02] 193400032 22.57 0.000904787998 +[2023-10-17 12:38:07] 193400032 22.57 0.000904728390 +[2023-10-17 12:38:12] 193400032 22.58 0.000904972611 +[2023-10-17 12:38:17] 193400032 22.58 0.000904953093 +[2023-10-17 12:38:22] 193400032 22.54 0.000904855865 +[2023-10-17 12:38:27] 193400032 22.47 0.000904830152 +[2023-10-17 12:38:32] 193400032 22.44 0.000904939333 +[2023-10-17 12:38:37] 193400032 22.42 0.000904856689 +[2023-10-17 12:38:42] 193400032 22.41 0.000904878040 +[2023-10-17 12:38:47] 193400032 22.40 0.000904960223 +[2023-10-17 12:38:52] 193400032 22.39 0.000904991106 +[2023-10-17 12:38:57] 193400032 22.37 0.000905116737 +[2023-10-17 12:39:02] 193400032 22.35 0.000905120640 +[2023-10-17 12:39:07] 193400032 22.33 0.000905230537 +[2023-10-17 12:39:12] 193400032 22.32 0.000905195390 +[2023-10-17 12:39:17] 193400032 22.32 0.000905228342 +[2023-10-17 12:39:22] 193400032 22.30 0.000905308469 +[2023-10-17 12:39:27] 193400032 22.28 0.000905222414 +[2023-10-17 12:39:32] 193400032 22.26 0.000905213612 +[2023-10-17 12:39:37] 193400032 22.24 0.000905259431 +[2023-10-17 12:39:42] 193400032 22.22 0.000905279226 +[2023-10-17 12:39:47] 193400032 22.18 0.000905360107 +[2023-10-17 12:39:52] 193400032 22.15 0.000905179514 +[2023-10-17 12:39:57] 193400032 22.13 0.000905482731 +[2023-10-17 12:40:02] 193400032 22.12 0.000905429303 +[2023-10-17 12:40:07] 193400032 22.12 0.000905526322 +[2023-10-17 12:40:12] 193400032 22.11 0.000905429444 +[2023-10-17 12:40:17] 193400032 22.11 0.000905517265 +[2023-10-17 12:40:22] 193400032 22.12 0.000905434044 +[2023-10-17 12:40:27] 193400032 22.11 0.000905449999 +[2023-10-17 12:40:32] 193400032 22.08 0.000905459836 +[2023-10-17 12:40:37] 193400032 21.99 0.000905594403 +[2023-10-17 12:40:42] 193400032 21.98 0.000905728916 +[2023-10-17 12:40:47] 193400032 21.95 0.000905694168 +[2023-10-17 12:40:52] 193400032 21.93 0.000905720070 +[2023-10-17 12:40:57] 193400032 21.92 0.000905705012 +[2023-10-17 12:41:02] 193400032 21.91 0.000905781918 +[2023-10-17 12:41:07] 193400032 21.89 0.000905725260 +[2023-10-17 12:41:12] 193400032 21.87 0.000905683522 +[2023-10-17 12:41:17] 193400032 21.85 0.000905819162 +[2023-10-17 12:41:22] 193400032 21.84 0.000905922790 +[2023-10-17 12:41:27] 193400032 21.84 0.000905892448 +[2023-10-17 12:41:32] 193400032 21.84 0.000905838067 +[2023-10-17 12:41:37] 193400032 21.83 0.000905820015 +[2023-10-17 12:41:42] 193400032 21.81 0.000905823535 +[2023-10-17 12:41:47] 193400032 21.78 0.000905949126 +[2023-10-17 12:41:52] 193400032 21.76 0.000906015652 +[2023-10-17 12:41:57] 193400032 21.73 0.000906075426 +[2023-10-17 12:42:02] 193400032 21.70 0.000905950072 +[2023-10-17 12:42:07] 193400032 21.67 0.000906069357 +[2023-10-17 12:42:12] 193400032 21.66 0.000906098520 +[2023-10-17 12:42:17] 193400032 21.67 0.000906027673 +[2023-10-17 12:42:22] 193400032 21.68 0.000906083183 +[2023-10-17 12:42:27] 193400032 21.66 0.000906151477 +[2023-10-17 12:42:32] 193400032 21.64 0.000906176265 +[2023-10-17 12:42:37] 193400032 21.60 0.000906203665 +[2023-10-17 12:42:42] 193400032 21.57 0.000906182416 +[2023-10-17 12:42:47] 193400032 21.55 0.000906350289 +[2023-10-17 12:42:53] 193400032 21.53 0.000906296760 +[2023-10-17 12:42:58] 193400032 21.51 0.000906263787 +[2023-10-17 12:43:03] 193400032 21.49 0.000906390150 +[2023-10-17 12:43:08] 193400032 21.48 0.000906420296 +[2023-10-17 12:43:13] 193400032 21.47 0.000906353297 +[2023-10-17 12:43:18] 193400032 21.47 0.000906385620 +[2023-10-17 12:43:23] 193400032 21.47 0.000906358833 +[2023-10-17 12:43:28] 193400032 21.46 0.000906489421 +[2023-10-17 12:43:33] 193400032 21.36 0.000906521516 +[2023-10-17 12:43:38] 193400032 21.33 0.000906568504 +[2023-10-17 12:43:43] 193400032 21.29 0.000906400012 +[2023-10-17 12:43:48] 193400032 21.31 0.000906600060 +[2023-10-17 12:43:53] 193400032 21.35 0.000906630016 +[2023-10-17 12:43:58] 193400032 21.42 0.000906654308 +[2023-10-17 12:44:03] 193400032 21.33 0.000906805940 +[2023-10-17 12:44:08] 193400032 21.24 0.000906585127 +[2023-10-17 12:44:13] 193400032 21.17 0.000906749789 +[2023-10-17 12:44:18] 193400032 21.16 0.000906766008 +[2023-10-17 12:44:23] 193400032 21.17 0.000906724442 +[2023-10-17 12:44:28] 193400032 21.18 0.000906735444 +[2023-10-17 12:44:33] 193400032 21.19 0.000906880909 +[2023-10-17 12:44:38] 193400032 21.19 0.000906820183 +[2023-10-17 12:44:43] 193400032 21.17 0.000906951305 +[2023-10-17 12:44:48] 193400032 21.17 0.000906842212 +[2023-10-17 12:44:53] 193400032 21.16 0.000906899778 +[2023-10-17 12:44:58] 193400032 21.15 0.000906977546 +[2023-10-17 12:45:03] 193400032 21.13 0.000906927698 +[2023-10-17 12:45:08] 193400032 21.03 0.000906959632 +[2023-10-17 12:45:13] 193400032 21.03 0.000907036147 +[2023-10-17 12:45:18] 193400032 21.02 0.000907024252 +[2023-10-17 12:45:23] 193400032 21.01 0.000907029994 +[2023-10-17 12:45:28] 193400032 21.00 0.000907203785 +[2023-10-17 12:45:33] 193400032 20.98 0.000906992330 +[2023-10-17 12:45:38] 193400032 20.96 0.000907187109 +[2023-10-17 12:45:43] 193400032 20.91 0.000907254341 +[2023-10-17 12:45:48] 193400032 20.90 0.000907108250 +[2023-10-17 12:45:53] 193400032 20.91 0.000907182159 +[2023-10-17 12:45:58] 193400032 20.93 0.000907310963 +[2023-10-17 12:46:03] 193400032 20.92 0.000907324461 +[2023-10-17 12:46:08] 193400032 20.83 0.000907298752 +[2023-10-17 12:46:13] 193400032 20.83 0.000907277614 +[2023-10-17 12:46:18] 193400032 20.82 0.000907249740 +[2023-10-17 12:46:23] 193400032 20.82 0.000907441840 +[2023-10-17 12:46:28] 193400032 20.83 0.000907459936 +[2023-10-17 12:46:33] 193400032 20.84 0.000907401735 +[2023-10-17 12:46:38] 193400032 20.81 0.000907530455 +[2023-10-17 12:46:43] 193400032 20.73 0.000907419967 +[2023-10-17 12:46:48] 193400032 20.71 0.000907523658 +[2023-10-17 12:46:53] 193400032 20.69 0.000907474703 +[2023-10-17 12:46:58] 193400032 20.69 0.000907482399 +[2023-10-17 12:47:03] 193400032 20.68 0.000907666957 +[2023-10-17 12:47:08] 193400032 20.69 0.000907538328 +[2023-10-17 12:47:13] 193400032 20.69 0.000907603444 +[2023-10-17 12:47:18] 193400032 20.67 0.000907536639 +[2023-10-17 12:47:23] 193400032 20.64 0.000907716036 +[2023-10-17 12:47:28] 193400032 20.57 0.000907758258 +[2023-10-17 12:47:33] 193400032 20.57 0.000907632253 +[2023-10-17 12:47:38] 193400032 20.58 0.000907876540 +[2023-10-17 12:47:43] 193400032 20.58 0.000907782917 +[2023-10-17 12:47:48] 193400032 20.56 0.000907858958 +[2023-10-17 12:47:53] 193400032 20.54 0.000907914672 +[2023-10-17 12:47:58] 193400032 20.51 0.000907687608 +[2023-10-17 12:48:03] 193400032 20.49 0.000907935401 +[2023-10-17 12:48:08] 193400032 20.47 0.000907884602 +[2023-10-17 12:48:13] 193400032 20.45 0.000907816737 +[2023-10-17 12:48:18] 193400032 20.44 0.000908058523 +[2023-10-17 12:48:23] 193400032 20.44 0.000908001010 +[2023-10-17 12:48:28] 193400032 20.43 0.000908069321 +[2023-10-17 12:48:33] 193400032 20.43 0.000908029572 +[2023-10-17 12:48:38] 193400032 20.42 0.000908071437 +[2023-10-17 12:48:43] 193400032 20.40 0.000908065893 +[2023-10-17 12:48:48] 193400032 20.37 0.000908105185 +[2023-10-17 12:48:53] 193400032 20.34 0.000908176906 +[2023-10-17 12:48:58] 193400032 20.33 0.000908058554 +[2023-10-17 12:49:03] 193400032 20.31 0.000908158016 +[2023-10-17 12:49:08] 193400032 20.28 0.000908209972 +[2023-10-17 12:49:13] 193400032 20.26 0.000908177398 +[2023-10-17 12:49:18] 193400032 20.24 0.000908252445 +[2023-10-17 12:49:23] 193400032 20.23 0.000908257013 +[2023-10-17 12:49:28] 193400032 20.21 0.000908285451 +[2023-10-17 12:49:33] 193400032 20.20 0.000908368772 +[2023-10-17 12:49:38] 193400032 20.20 0.000908373635 +[2023-10-17 12:49:43] 193400032 20.20 0.000908374425 +[2023-10-17 12:49:48] 193400032 20.20 0.000908378541 +[2023-10-17 12:49:53] 193400032 20.18 0.000908405322 +[2023-10-17 12:49:58] 193400032 20.11 0.000908497602 +[2023-10-17 12:50:03] 193400032 20.10 0.000908490906 +[2023-10-17 12:50:08] 193400032 20.09 0.000908303372 +[2023-10-17 12:50:13] 193400032 20.10 0.000908437218 +[2023-10-17 12:50:18] 193400032 20.09 0.000908399845 +[2023-10-17 12:50:23] 193400032 20.08 0.000908451353 +[2023-10-17 12:50:28] 193400032 20.05 0.000908516577 +[2023-10-17 12:50:33] 193400032 20.03 0.000908654879 +[2023-10-17 12:50:38] 193400032 20.00 0.000908698695 +[2023-10-17 12:50:43] 193400032 19.98 0.000908643739 +[2023-10-17 12:50:48] 193400032 19.97 0.000908749690 +[2023-10-17 12:50:53] 193400032 19.95 0.000908688798 +[2023-10-17 12:50:58] 193400032 19.93 0.000908788820 +[2023-10-17 12:51:03] 193400032 19.91 0.000908723473 +[2023-10-17 12:51:08] 193400032 19.89 0.000908801682 +[2023-10-17 12:51:13] 193400032 19.89 0.000908797576 +[2023-10-17 12:51:18] 193400032 19.91 0.000908798174 +[2023-10-17 12:51:23] 193400032 19.91 0.000908765653 +[2023-10-17 12:51:28] 193400032 19.89 0.000908970116 +[2023-10-17 12:51:33] 193400032 19.86 0.000908884415 +[2023-10-17 12:51:38] 193400032 19.78 0.000908851337 +[2023-10-17 12:51:43] 193400032 19.78 0.000908872886 +[2023-10-17 12:51:48] 193400032 19.78 0.000908883126 +[2023-10-17 12:51:53] 193400032 19.79 0.000908871383 +[2023-10-17 12:51:58] 193400032 19.79 0.000909003881 +[2023-10-17 12:52:03] 193400032 19.78 0.000909052793 +[2023-10-17 12:52:08] 193400032 19.76 0.000909165582 +[2023-10-17 12:52:13] 193400032 19.72 0.000909130099 +[2023-10-17 12:52:18] 193400032 19.65 0.000909208098 +[2023-10-17 12:52:23] 193400032 19.65 0.000909130662 +[2023-10-17 12:52:28] 193400032 19.65 0.000909183534 +[2023-10-17 12:52:33] 193400032 19.65 0.000909103564 +[2023-10-17 12:52:38] 193400032 19.65 0.000909225191 +[2023-10-17 12:52:43] 193400032 19.65 0.000909307618 +[2023-10-17 12:52:48] 193400032 19.65 0.000909236384 +[2023-10-17 12:52:53] 193400032 19.62 0.000909398646 +[2023-10-17 12:52:58] 193400032 19.55 0.000909280724 +[2023-10-17 12:53:03] 193400032 19.53 0.000909402847 +[2023-10-17 12:53:08] 193400032 19.52 0.000909427337 +[2023-10-17 12:53:13] 193400032 19.52 0.000909454571 +[2023-10-17 12:53:18] 193400032 19.52 0.000909315669 +[2023-10-17 12:53:23] 193400032 19.51 0.000909410386 +[2023-10-17 12:53:28] 193400032 19.51 0.000909410028 +[2023-10-17 12:53:33] 193400032 19.50 0.000909505179 +[2023-10-17 12:53:38] 193400032 19.49 0.000909505802 +[2023-10-17 12:53:43] 193400032 19.47 0.000909575848 +[2023-10-17 12:53:49] 193400032 19.46 0.000909428752 +[2023-10-17 12:53:54] 193400032 19.43 0.000909621209 +[2023-10-17 12:53:59] 193400032 19.41 0.000909460579 +[2023-10-17 12:54:04] 193400032 19.38 0.000909701827 +[2023-10-17 12:54:09] 193400032 19.36 0.000909701019 +[2023-10-17 12:54:14] 193400032 19.36 0.000909627200 +[2023-10-17 12:54:19] 193400032 19.35 0.000909812092 +[2023-10-17 12:54:24] 193400032 19.35 0.000909819578 +[2023-10-17 12:54:29] 193400032 19.33 0.000909744214 +[2023-10-17 12:54:34] 193400032 19.30 0.000909853771 +[2023-10-17 12:54:39] 193400032 19.27 0.000909767534 +[2023-10-17 12:54:44] 193400032 19.25 0.000909756120 +[2023-10-17 12:54:49] 193400032 19.25 0.000909828253 +[2023-10-17 12:54:54] 193400032 19.25 0.000909942814 +[2023-10-17 12:54:59] 193400032 19.26 0.000909871834 +[2023-10-17 12:55:04] 193400032 19.25 0.000910040667 +[2023-10-17 12:55:09] 193400032 19.23 0.000909958077 +[2023-10-17 12:55:14] 193400032 19.20 0.000909981782 +[2023-10-17 12:55:19] 193400032 19.16 0.000910081770 +[2023-10-17 12:55:24] 193400032 19.13 0.000909938848 +[2023-10-17 12:55:29] 193400032 19.11 0.000910148717 +[2023-10-17 12:55:34] 193400032 19.11 0.000910145987 +[2023-10-17 12:55:39] 193400032 19.10 0.000910091490 +[2023-10-17 12:55:44] 193400032 19.10 0.000910228052 +[2023-10-17 12:55:49] 193400032 19.08 0.000910161328 +[2023-10-17 12:55:54] 193400032 19.06 0.000910142311 +[2023-10-17 12:55:59] 193400032 19.05 0.000910197867 +[2023-10-17 12:56:04] 193400032 19.03 0.000910218829 +[2023-10-17 12:56:09] 193400032 19.02 0.000910134352 +[2023-10-17 12:56:14] 193400032 19.01 0.000910346026 +[2023-10-17 12:56:19] 193400032 18.99 0.000910371105 +[2023-10-17 12:56:24] 193400032 19.00 0.000910383270 +[2023-10-17 12:56:29] 193400032 18.99 0.000910341677 +[2023-10-17 12:56:34] 193400032 18.97 0.000910393972 +[2023-10-17 12:56:39] 193400032 18.94 0.000910443205 +[2023-10-17 12:56:44] 193400032 18.92 0.000910388092 +[2023-10-17 12:56:49] 193400032 18.90 0.000910389243 +[2023-10-17 12:56:54] 193400032 18.90 0.000910410633 +[2023-10-17 12:56:59] 193400032 18.90 0.000910409955 +[2023-10-17 12:57:04] 193400032 18.90 0.000910301597 +[2023-10-17 12:57:09] 193400032 18.88 0.000910500847 +[2023-10-17 12:57:14] 193400032 18.85 0.000910501523 +[2023-10-17 12:57:19] 193400032 18.82 0.000910612287 +[2023-10-17 12:57:24] 193400032 18.79 0.000910622948 +[2023-10-17 12:57:29] 193400032 18.78 0.000910553278 +[2023-10-17 12:57:34] 193400032 18.78 0.000910648197 +[2023-10-17 12:57:39] 193400032 18.78 0.000910749744 +[2023-10-17 12:57:44] 193400032 18.76 0.000910746691 +[2023-10-17 12:57:49] 193400032 18.74 0.000910769419 +[2023-10-17 12:57:54] 193400032 18.72 0.000910752751 +[2023-10-17 12:57:59] 193400032 18.71 0.000910810606 +[2023-10-17 12:58:04] 193400032 18.71 0.000910797673 +[2023-10-17 12:58:09] 193400032 18.71 0.000910828567 +[2023-10-17 12:58:14] 193400032 18.71 0.000910805943 +[2023-10-17 12:58:19] 193400032 18.67 0.000910862496 +[2023-10-17 12:58:24] 193400032 18.57 0.000910909201 +[2023-10-17 12:58:29] 193400032 18.58 0.000910952216 +[2023-10-17 12:58:34] 193400032 18.59 0.000910946071 +[2023-10-17 12:58:39] 193400032 18.59 0.000910913123 +[2023-10-17 12:58:44] 193400032 18.58 0.000911023141 +[2023-10-17 12:58:49] 193400032 18.57 0.000910889496 +[2023-10-17 12:58:54] 193400032 18.54 0.000911025826 +[2023-10-17 12:58:59] 193400032 18.52 0.000911081050 +[2023-10-17 12:59:04] 193400032 18.51 0.000911132519 +[2023-10-17 12:59:09] 193400032 18.51 0.000910979018 +[2023-10-17 12:59:14] 193400032 18.51 0.000911171651 +[2023-10-17 12:59:19] 193400032 18.51 0.000911225312 +[2023-10-17 12:59:24] 193400032 18.49 0.000911093897 +[2023-10-17 12:59:29] 193400032 18.48 0.000911186731 +[2023-10-17 12:59:34] 193400032 18.47 0.000911123287 +[2023-10-17 12:59:39] 193400032 18.46 0.000911270840 +[2023-10-17 12:59:44] 193400032 18.44 0.000911309582 +[2023-10-17 12:59:49] 193400032 18.41 0.000911260074 +[2023-10-17 12:59:54] 193400032 18.37 0.000911289654 +[2023-10-17 12:59:59] 193400032 18.35 0.000911293436 +[2023-10-17 01:00:04] 193400032 18.35 0.000911342355 +[2023-10-17 01:00:09] 193400032 18.35 0.000911427569 +[2023-10-17 01:00:14] 193400032 18.36 0.000911439383 +[2023-10-17 01:00:19] 193400032 18.34 0.000911509387 +[2023-10-17 01:00:24] 193400032 18.32 0.000911346982 +[2023-10-17 01:00:29] 193400032 18.29 0.000911442303 +[2023-10-17 01:00:34] 193400032 18.27 0.000911488305 +[2023-10-17 01:00:39] 193400032 18.25 0.000911485638 +[2023-10-17 01:00:44] 193400032 18.24 0.000911553513 +[2023-10-17 01:00:49] 193400032 18.23 0.000911624040 +[2023-10-17 01:00:54] 193400032 18.21 0.000911643437 +[2023-10-17 01:00:59] 193400032 18.19 0.000911581583 +[2023-10-17 01:01:04] 193400032 18.18 0.000911650746 +[2023-10-17 01:01:09] 193400032 18.18 0.000911663614 +[2023-10-17 01:01:14] 193400032 18.18 0.000911706017 +[2023-10-17 01:01:19] 193400032 18.20 0.000911702762 +[2023-10-17 01:01:24] 193400032 18.19 0.000911607427 +[2023-10-17 01:01:29] 193400032 18.17 0.000911801156 +[2023-10-17 01:01:34] 193400032 18.14 0.000911705849 +[2023-10-17 01:01:39] 193400032 18.11 0.000911800479 +[2023-10-17 01:01:44] 193400032 18.08 0.000911892085 +[2023-10-17 01:01:49] 193400032 18.07 0.000911783030 +[2023-10-17 01:01:54] 193400032 18.05 0.000911909717 +[2023-10-17 01:01:59] 193400032 18.05 0.000911948099 +[2023-10-17 01:02:04] 193400032 18.03 0.000911978663 +[2023-10-17 01:02:09] 193400032 18.01 0.000911916422 +[2023-10-17 01:02:14] 193400032 18.00 0.000911992973 +[2023-10-17 01:02:19] 193400032 17.99 0.000912019485 +[2023-10-17 01:02:24] 193400032 17.97 0.000912063721 +[2023-10-17 01:02:29] 193400032 17.95 0.000912034187 +[2023-10-17 01:02:34] 193400032 17.95 0.000912025089 +[2023-10-17 01:02:39] 193400032 17.95 0.000912030258 +[2023-10-17 01:02:44] 193400032 17.95 0.000912055483 +[2023-10-17 01:02:49] 193400032 17.95 0.000912149087 +[2023-10-17 01:02:54] 193400032 17.93 0.000912141180 +[2023-10-17 01:02:59] 193400032 17.91 0.000912169815 +[2023-10-17 01:03:04] 193400032 17.90 0.000912215036 +[2023-10-17 01:03:09] 193400032 17.88 0.000912314620 +[2023-10-17 01:03:14] 193400032 17.86 0.000912220923 +[2023-10-17 01:03:19] 193400032 17.84 0.000912116387 +[2023-10-17 01:03:24] 193400032 17.81 0.000912331006 +[2023-10-17 01:03:29] 193400032 17.78 0.000912381092 +[2023-10-17 01:03:34] 193400032 17.77 0.000912288855 +[2023-10-17 01:03:39] 193400032 17.76 0.000912320712 +[2023-10-17 01:03:44] 193400032 17.76 0.000912380728 +[2023-10-17 01:03:49] 193400032 17.75 0.000912381781 +[2023-10-17 01:03:54] 193400032 17.74 0.000912494463 +[2023-10-17 01:03:59] 193400032 17.74 0.000912374876 +[2023-10-17 01:04:04] 193400032 17.74 0.000912344400 +[2023-10-17 01:04:09] 193400032 17.73 0.000912564085 +[2023-10-17 01:04:14] 193400032 17.72 0.000912560213 +[2023-10-17 01:04:19] 193400032 17.70 0.000912485520 +[2023-10-17 01:04:24] 193400032 17.68 0.000912514306 +[2023-10-17 01:04:29] 193400032 17.66 0.000912532516 +[2023-10-17 01:04:34] 193400032 17.64 0.000912532792 +[2023-10-17 01:04:39] 193400032 17.62 0.000912596744 +[2023-10-17 01:04:45] 193400032 17.60 0.000912682409 +[2023-10-17 01:04:50] 193400032 17.59 0.000912696585 +[2023-10-17 01:04:55] 193400032 17.57 0.000912749234 +[2023-10-17 01:05:00] 193400032 17.56 0.000912737155 +[2023-10-17 01:05:05] 193400032 17.55 0.000912780778 +[2023-10-17 01:05:10] 193400032 17.56 0.000912724279 +[2023-10-17 01:05:15] 193400032 17.55 0.000912757388 +[2023-10-17 01:05:20] 193400032 17.54 0.000912749169 +[2023-10-17 01:05:25] 193400032 17.52 0.000912846690 +[2023-10-17 01:05:30] 193400032 17.50 0.000912903846 +[2023-10-17 01:05:35] 193400032 17.50 0.000912862803 +[2023-10-17 01:05:40] 193400032 17.48 0.000912816832 +[2023-10-17 01:05:45] 193400032 17.46 0.000912938994 +[2023-10-17 01:05:50] 193400032 17.46 0.000912839613 +[2023-10-17 01:05:55] 193400032 17.45 0.000912958464 +[2023-10-17 01:06:00] 193400032 17.43 0.000913014142 +[2023-10-17 01:06:05] 193400032 17.40 0.000912986011 +[2023-10-17 01:06:10] 193400032 17.38 0.000913005993 +[2023-10-17 01:06:15] 193400032 17.36 0.000913097620 +[2023-10-17 01:06:20] 193400032 17.35 0.000913109089 +[2023-10-17 01:06:25] 193400032 17.34 0.000913111960 +[2023-10-17 01:06:30] 193400032 17.33 0.000912996324 +[2023-10-17 01:06:35] 193400032 17.33 0.000913169922 +[2023-10-17 01:06:40] 193400032 17.32 0.000913233960 +[2023-10-17 01:06:45] 193400032 17.31 0.000913134117 +[2023-10-17 01:06:50] 193400032 17.31 0.000913288026 +[2023-10-17 01:06:55] 193400032 17.30 0.000913196897 +[2023-10-17 01:07:00] 193400032 17.27 0.000913315063 +[2023-10-17 01:07:05] 193400032 17.26 0.000913304918 +[2023-10-17 01:07:10] 193400032 17.24 0.000913350525 +[2023-10-17 01:07:15] 193400032 17.25 0.000913300637 +[2023-10-17 01:07:20] 193400032 17.24 0.000913418903 +[2023-10-17 01:07:25] 193400032 17.23 0.000913372927 +[2023-10-17 01:07:30] 193400032 17.15 0.000913430484 +[2023-10-17 01:07:35] 193400032 17.16 0.000913426214 +[2023-10-17 01:07:40] 193400032 17.14 0.000913501020 +[2023-10-17 01:07:45] 193400032 17.14 0.000913414467 +[2023-10-17 01:07:50] 193400032 17.13 0.000913514929 +[2023-10-17 01:07:55] 193400032 17.13 0.000913472839 +[2023-10-17 01:08:00] 193400032 17.11 0.000913559592 +[2023-10-17 01:08:05] 193400032 17.10 0.000913398462 +[2023-10-17 01:08:10] 193400032 17.08 0.000913681429 +[2023-10-17 01:08:15] 193400032 17.08 0.000913608406 +[2023-10-17 01:08:20] 193400032 17.09 0.000913711222 +[2023-10-17 01:08:25] 193400032 17.09 0.000913722390 +[2023-10-17 01:08:30] 193400032 17.07 0.000913747242 +[2023-10-17 01:08:35] 193400032 17.04 0.000913584538 +[2023-10-17 01:08:40] 193400032 17.01 0.000913739652 +[2023-10-17 01:08:45] 193400032 16.99 0.000913741807 +[2023-10-17 01:08:50] 193400032 16.98 0.000913783533 +[2023-10-17 01:08:55] 193400032 16.97 0.000913748089 +[2023-10-17 01:09:00] 193400032 16.98 0.000913862280 +[2023-10-17 01:09:05] 193400032 16.98 0.000913877063 +[2023-10-17 01:09:10] 193400032 16.98 0.000913871350 +[2023-10-17 01:09:15] 193400032 16.97 0.000913926248 +[2023-10-17 01:09:20] 193400032 16.94 0.000913968863 +[2023-10-17 01:09:25] 193400032 16.92 0.000913981989 +[2023-10-17 01:09:30] 193400032 16.90 0.000913915784 +[2023-10-17 01:09:35] 193400032 16.88 0.000913792944 +[2023-10-17 01:09:40] 193400032 16.86 0.000914027250 +[2023-10-17 01:09:45] 193400032 16.85 0.000914058400 +[2023-10-17 01:09:50] 193400032 16.84 0.000914076242 +[2023-10-17 01:09:55] 193400032 16.83 0.000914059487 +[2023-10-17 01:10:00] 193400032 16.82 0.000913988800 +[2023-10-17 01:10:05] 193400032 16.81 0.000914069571 +[2023-10-17 01:10:10] 193400032 16.81 0.000914173212 +[2023-10-17 01:10:15] 193400032 16.79 0.000914167973 +[2023-10-17 01:10:20] 193400032 16.78 0.000914213572 +[2023-10-17 01:10:25] 193400032 16.76 0.000914205733 +[2023-10-17 01:10:30] 193400032 16.75 0.000914222575 +[2023-10-17 01:10:35] 193400032 16.74 0.000914184611 +[2023-10-17 01:10:40] 193400032 16.72 0.000914235265 +[2023-10-17 01:10:45] 193400032 16.72 0.000914319552 +[2023-10-17 01:10:50] 193400032 16.71 0.000914277036 +[2023-10-17 01:10:55] 193400032 16.70 0.000914367569 +[2023-10-17 01:11:00] 193400032 16.69 0.000914294247 +[2023-10-17 01:11:05] 193400032 16.68 0.000914304070 +[2023-10-17 01:11:10] 193400032 16.67 0.000914422216 +[2023-10-17 01:11:15] 193400032 16.66 0.000914479452 +[2023-10-17 01:11:20] 193400032 16.64 0.000914458978 +[2023-10-17 01:11:25] 193400032 16.62 0.000914521369 +[2023-10-17 01:11:30] 193400032 16.61 0.000914450609 +[2023-10-17 01:11:35] 193400032 16.60 0.000914439434 +[2023-10-17 01:11:40] 193400032 16.59 0.000914466531 +[2023-10-17 01:11:45] 193400032 16.57 0.000914495660 +[2023-10-17 01:11:50] 193400032 16.56 0.000914576407 +[2023-10-17 01:11:55] 193400032 16.55 0.000914510718 +[2023-10-17 01:12:00] 193400032 16.53 0.000914488081 +[2023-10-17 01:12:05] 193400032 16.52 0.000914625162 +[2023-10-17 01:12:10] 193400032 16.51 0.000914717685 +[2023-10-17 01:12:15] 193400032 16.49 0.000914643185 +[2023-10-17 01:12:20] 193400032 16.48 0.000914740021 +[2023-10-17 01:12:25] 193400032 16.47 0.000914649241 +[2023-10-17 01:12:30] 193400032 16.46 0.000914688049 +[2023-10-17 01:12:35] 193400032 16.45 0.000914794918 +[2023-10-17 01:12:40] 193400032 16.45 0.000914698768 +[2023-10-17 01:12:45] 193400032 16.43 0.000914885992 +[2023-10-17 01:12:50] 193400032 16.42 0.000914825608 +[2023-10-17 01:12:55] 193400032 16.41 0.000914869100 +[2023-10-17 01:13:00] 193400032 16.40 0.000914926149 +[2023-10-17 01:13:05] 193400032 16.41 0.000914928729 +[2023-10-17 01:13:10] 193400032 16.40 0.000914997106 +[2023-10-17 01:13:15] 193400032 16.38 0.000914994330 +[2023-10-17 01:13:20] 193400032 16.36 0.000915013923 +[2023-10-17 01:13:25] 193400032 16.33 0.000915063708 +[2023-10-17 01:13:30] 193400032 16.31 0.000915061532 +[2023-10-17 01:13:35] 193400032 16.29 0.000914963654 +[2023-10-17 01:13:40] 193400032 16.28 0.000915063634 +[2023-10-17 01:13:45] 193400032 16.27 0.000914985222 +[2023-10-17 01:13:50] 193400032 16.27 0.000915115920 +[2023-10-17 01:13:55] 193400032 16.25 0.000915160670 +[2023-10-17 01:14:00] 193400032 16.25 0.000915182614 +[2023-10-17 01:14:05] 193400032 16.25 0.000915125900 +[2023-10-17 01:14:10] 193400032 16.23 0.000915108215 +[2023-10-17 01:14:15] 193400032 16.22 0.000915165848 +[2023-10-17 01:14:20] 193400032 16.21 0.000915285278 +[2023-10-17 01:14:25] 193400032 16.20 0.000915224245 +[2023-10-17 01:14:30] 193400032 16.19 0.000915306400 +[2023-10-17 01:14:35] 193400032 16.18 0.000915119069 +[2023-10-17 01:14:40] 193400032 16.16 0.000915159637 +[2023-10-17 01:14:45] 193400032 16.15 0.000915371876 +[2023-10-17 01:14:50] 193400032 16.13 0.000915421847 +[2023-10-17 01:14:55] 193400032 16.12 0.000915360825 +[2023-10-17 01:15:00] 193400032 16.11 0.000915380808 +[2023-10-17 01:15:05] 193400032 16.10 0.000915413539 +[2023-10-17 01:15:10] 193400032 16.09 0.000915504034 +[2023-10-17 01:15:15] 193400032 16.08 0.000915482569 +[2023-10-17 01:15:20] 193400032 16.07 0.000915536649 +[2023-10-17 01:15:25] 193400032 16.05 0.000915567017 +[2023-10-17 01:15:30] 193400032 16.04 0.000915597189 +[2023-10-17 01:15:35] 193400032 16.03 0.000915647715 +[2023-10-17 01:15:41] 193400032 16.02 0.000915555131 +[2023-10-17 01:15:46] 193400032 16.01 0.000915538326 +[2023-10-17 01:15:51] 193400032 15.98 0.000915567277 +[2023-10-17 01:15:56] 193400032 15.97 0.000915643074 +[2023-10-17 01:16:01] 193400032 15.95 0.000915609985 +[2023-10-17 01:16:06] 193400032 15.96 0.000915722973 +[2023-10-17 01:16:11] 193400032 15.96 0.000915742153 +[2023-10-17 01:16:16] 193400032 15.95 0.000915612085 +[2023-10-17 01:16:21] 193400032 15.95 0.000915740383 +[2023-10-17 01:16:26] 193400032 15.95 0.000915733211 +[2023-10-17 01:16:31] 193400032 15.94 0.000915667034 +[2023-10-17 01:16:36] 193400032 15.91 0.000915792988 +[2023-10-17 01:16:41] 193400032 15.90 0.000915846316 +[2023-10-17 01:16:46] 193400032 15.88 0.000915735000 +[2023-10-17 01:16:51] 193400032 15.87 0.000915916742 +[2023-10-17 01:16:56] 193400032 15.85 0.000915945151 +[2023-10-17 01:17:01] 193400032 15.84 0.000915994832 +[2023-10-17 01:17:06] 193400032 15.83 0.000915904824 +[2023-10-17 01:17:11] 193400032 15.81 0.000915996287 +[2023-10-17 01:17:16] 193400032 15.79 0.000916009218 +[2023-10-17 01:17:21] 193400032 15.78 0.000916027776 +[2023-10-17 01:17:26] 193400032 15.77 0.000916050362 +[2023-10-17 01:17:31] 193400032 15.75 0.000915996704 +[2023-10-17 01:17:36] 193400032 15.74 0.000916020801 +[2023-10-17 01:17:41] 193400032 15.75 0.000916100224 +[2023-10-17 01:17:46] 193400032 15.75 0.000916146365 +[2023-10-17 01:17:51] 193400032 15.75 0.000916168897 +[2023-10-17 01:17:56] 193400032 15.73 0.000916188489 +[2023-10-17 01:18:01] 193400032 15.72 0.000916235010 +[2023-10-17 01:18:06] 193400032 15.71 0.000916144957 +[2023-10-17 01:18:11] 193400032 15.69 0.000916109801 +[2023-10-17 01:18:16] 193400032 15.67 0.000916149415 +[2023-10-17 01:18:21] 193400032 15.65 0.000916283980 +[2023-10-17 01:18:26] 193400032 15.63 0.000916328992 +[2023-10-17 01:18:31] 193400032 15.61 0.000916240608 +[2023-10-17 01:18:36] 193400032 15.60 0.000916264118 +[2023-10-17 01:18:41] 193400032 15.61 0.000916288995 +[2023-10-17 01:18:46] 193400032 15.62 0.000916364392 +[2023-10-17 01:18:51] 193400032 15.62 0.000916288016 +[2023-10-17 01:18:56] 193400032 15.61 0.000916347303 +[2023-10-17 01:19:01] 193400032 15.59 0.000916473755 +[2023-10-17 01:19:06] 193400032 15.57 0.000916309464 +[2023-10-17 01:19:11] 193400032 15.54 0.000916503522 +[2023-10-17 01:19:16] 193400032 15.53 0.000916520581 +[2023-10-17 01:19:21] 193400032 15.52 0.000916370667 +[2023-10-17 01:19:26] 193400032 15.52 0.000916525437 +[2023-10-17 01:19:31] 193400032 15.52 0.000916555440 +[2023-10-17 01:19:36] 193400032 15.52 0.000916479906 +[2023-10-17 01:19:41] 193400032 15.51 0.000916505167 +[2023-10-17 01:19:46] 193400032 15.50 0.000916483891 +[2023-10-17 01:19:51] 193400032 15.47 0.000916646909 +[2023-10-17 01:19:56] 193400032 15.45 0.000916673467 +[2023-10-17 01:20:01] 193400032 15.43 0.000916602546 +[2023-10-17 01:20:06] 193400032 15.41 0.000916654364 +[2023-10-17 01:20:11] 193400032 15.41 0.000916629080 +[2023-10-17 01:20:16] 193400032 15.40 0.000916680387 +[2023-10-17 01:20:21] 193400032 15.40 0.000916707846 +[2023-10-17 01:20:26] 193400032 15.39 0.000916729004 +[2023-10-17 01:20:31] 193400032 15.39 0.000916809734 +[2023-10-17 01:20:36] 193400032 15.38 0.000916856199 +[2023-10-17 01:20:41] 193400032 15.37 0.000916875987 +[2023-10-17 01:20:46] 193400032 15.36 0.000916893033 +[2023-10-17 01:20:51] 193400032 15.35 0.000916936978 +[2023-10-17 01:20:56] 193400032 15.33 0.000916929867 +[2023-10-17 01:21:01] 193400032 15.31 0.000916866335 +[2023-10-17 01:21:06] 193400032 15.28 0.000916949206 +[2023-10-17 01:21:11] 193400032 15.27 0.000916766760 +[2023-10-17 01:21:16] 193400032 15.26 0.000916987451 +[2023-10-17 01:21:21] 193400032 15.25 0.000916955473 +[2023-10-17 01:21:26] 193400032 15.24 0.000916982899 +[2023-10-17 01:21:31] 193400032 15.25 0.000917003266 +[2023-10-17 01:21:36] 193400032 15.25 0.000917066692 +[2023-10-17 01:21:41] 193400032 15.24 0.000917003897 +[2023-10-17 01:21:46] 193400032 15.24 0.000917126271 +[2023-10-17 01:21:51] 193400032 15.23 0.000917080241 +[2023-10-17 01:21:56] 193400032 15.21 0.000917010742 +[2023-10-17 01:22:01] 193400032 15.19 0.000917148848 +[2023-10-17 01:22:06] 193400032 15.18 0.000917232178 +[2023-10-17 01:22:11] 193400032 15.16 0.000917179394 +[2023-10-17 01:22:16] 193400032 15.14 0.000917235296 +[2023-10-17 01:22:21] 193400032 15.12 0.000917310156 +[2023-10-17 01:22:26] 193400032 15.11 0.000917249136 +[2023-10-17 01:22:31] 193400032 15.11 0.000917330483 +[2023-10-17 01:22:36] 193400032 15.10 0.000917248013 +[2023-10-17 01:22:41] 193400032 15.09 0.000917205019 +[2023-10-17 01:22:46] 193400032 15.08 0.000917415171 +[2023-10-17 01:22:51] 193400032 15.07 0.000917355121 +[2023-10-17 01:22:56] 193400032 15.07 0.000917378238 +[2023-10-17 01:23:01] 193400032 15.06 0.000917364720 +[2023-10-17 01:23:06] 193400032 15.06 0.000917264091 +[2023-10-17 01:23:11] 193400032 15.05 0.000917385561 +[2023-10-17 01:23:16] 193400032 15.03 0.000917339927 +[2023-10-17 01:23:21] 193400032 15.01 0.000917498940 +[2023-10-17 01:23:26] 193400032 15.00 0.000917397323 +[2023-10-17 01:23:31] 193400032 14.99 0.000917515569 +[2023-10-17 01:23:36] 193400032 14.98 0.000917602979 +[2023-10-17 01:23:41] 193400032 14.98 0.000917518259 +[2023-10-17 01:23:46] 193400032 14.97 0.000917668893 +[2023-10-17 01:23:51] 193400032 14.97 0.000917598046 +[2023-10-17 01:23:56] 193400032 14.97 0.000917691033 +[2023-10-17 01:24:01] 193400032 14.96 0.000917730416 +[2023-10-17 01:24:06] 193400032 14.94 0.000917693969 +[2023-10-17 01:24:11] 193400032 14.93 0.000917751769 +[2023-10-17 01:24:16] 193400032 14.90 0.000917756770 +[2023-10-17 01:24:21] 193400032 14.88 0.000917745267 +[2023-10-17 01:24:26] 193400032 14.86 0.000917767233 +[2023-10-17 01:24:31] 193400032 14.85 0.000917700509 +[2023-10-17 01:24:36] 193400032 14.84 0.000917837233 +[2023-10-17 01:24:41] 193400032 14.84 0.000917866385 +[2023-10-17 01:24:46] 193400032 14.84 0.000917867716 +[2023-10-17 01:24:51] 193400032 14.84 0.000917921439 +[2023-10-17 01:24:56] 193400032 14.83 0.000917918373 +[2023-10-17 01:25:01] 193400032 14.81 0.000917846844 +[2023-10-17 01:25:06] 193400032 14.79 0.000917908849 +[2023-10-17 01:25:11] 193400032 14.77 0.000918027042 +[2023-10-17 01:25:16] 193400032 14.75 0.000917925406 +[2023-10-17 01:25:21] 193400032 14.75 0.000917913980 +[2023-10-17 01:25:26] 193400032 14.75 0.000917912363 +[2023-10-17 01:25:31] 193400032 14.76 0.000917889164 +[2023-10-17 01:25:36] 193400032 14.76 0.000918071259 +[2023-10-17 01:25:41] 193400032 14.74 0.000918036680 +[2023-10-17 01:25:46] 193400032 14.72 0.000918064108 +[2023-10-17 01:25:51] 193400032 14.69 0.000918193174 +[2023-10-17 01:25:56] 193400032 14.68 0.000918098783 +[2023-10-17 01:26:01] 193400032 14.67 0.000918190639 +[2023-10-17 01:26:06] 193400032 14.66 0.000918191997 +[2023-10-17 01:26:11] 193400032 14.65 0.000918137861 +[2023-10-17 01:26:16] 193400032 14.66 0.000918145801 +[2023-10-17 01:26:21] 193400032 14.66 0.000918219302 +[2023-10-17 01:26:26] 193400032 14.66 0.000918230202 +[2023-10-17 01:26:31] 193400032 14.65 0.000918198223 +[2023-10-17 01:26:37] 193400032 14.64 0.000918332881 +[2023-10-17 01:26:42] 193400032 14.62 0.000918383795 +[2023-10-17 01:26:47] 193400032 14.60 0.000918357547 +[2023-10-17 01:26:52] 193400032 14.59 0.000918345956 +[2023-10-17 01:26:57] 193400032 14.57 0.000918397190 +[2023-10-17 01:27:02] 193400032 14.56 0.000918355030 +[2023-10-17 01:27:07] 193400032 14.54 0.000918349647 +[2023-10-17 01:27:12] 193400032 14.51 0.000918327872 +[2023-10-17 01:27:17] 193400032 14.50 0.000918434710 +[2023-10-17 01:27:22] 193400032 14.49 0.000918513915 +[2023-10-17 01:27:27] 193400032 14.48 0.000918428763 +[2023-10-17 01:27:32] 193400032 14.48 0.000918507576 +[2023-10-17 01:27:37] 193400032 14.49 0.000918539375 +[2023-10-17 01:27:42] 193400032 14.49 0.000918502786 +[2023-10-17 01:27:47] 193400032 14.49 0.000918459486 +[2023-10-17 01:27:52] 193400032 14.48 0.000918524450 +[2023-10-17 01:27:57] 193400032 14.48 0.000918572379 +[2023-10-17 01:28:02] 193400032 14.46 0.000918699063 +[2023-10-17 01:28:07] 193400032 14.45 0.000918717872 +[2023-10-17 01:28:12] 193400032 14.44 0.000918651044 +[2023-10-17 01:28:17] 193400032 14.42 0.000918686168 +[2023-10-17 01:28:22] 193400032 14.40 0.000918514039 +[2023-10-17 01:28:27] 193400032 14.38 0.000918760678 +[2023-10-17 01:28:32] 193400032 14.37 0.000918627701 +[2023-10-17 01:28:37] 193400032 14.36 0.000918727055 +[2023-10-17 01:28:42] 193400032 14.35 0.000918724952 +[2023-10-17 01:28:47] 193400032 14.35 0.000918846398 +[2023-10-17 01:28:52] 193400032 14.34 0.000918700572 +[2023-10-17 01:28:57] 193400032 14.33 0.000918886367 +[2023-10-17 01:29:02] 193400032 14.32 0.000918934399 +[2023-10-17 01:29:07] 193400032 14.31 0.000918930058 +[2023-10-17 01:29:12] 193400032 14.30 0.000918868304 +[2023-10-17 01:29:17] 193400032 14.29 0.000918887308 +[2023-10-17 01:29:22] 193400032 14.29 0.000918889343 +[2023-10-17 01:29:27] 193400032 14.28 0.000919007034 +[2023-10-17 01:29:32] 193400032 14.27 0.000918868449 +[2023-10-17 01:29:37] 193400032 14.26 0.000918976641 +[2023-10-17 01:29:42] 193400032 14.26 0.000919107667 +[2023-10-17 01:29:47] 193400032 14.25 0.000919018565 +[2023-10-17 01:29:52] 193400032 14.23 0.000919105612 +[2023-10-17 01:29:57] 193400032 14.21 0.000919158526 +[2023-10-17 01:30:02] 193400032 14.19 0.000919152432 +[2023-10-17 01:30:07] 193400032 14.17 0.000919068945 +[2023-10-17 01:30:12] 193400032 14.16 0.000919146711 +[2023-10-17 01:30:17] 193400032 14.15 0.000919033893 +[2023-10-17 01:30:22] 193400032 14.15 0.000919139027 +[2023-10-17 01:30:27] 193400032 14.15 0.000919129886 +[2023-10-17 01:30:32] 193400032 14.15 0.000919260331 +[2023-10-17 01:30:37] 193400032 14.14 0.000919291538 +[2023-10-17 01:30:42] 193400032 14.14 0.000919315833 +[2023-10-17 01:30:47] 193400032 14.13 0.000919315744 +[2023-10-17 01:30:52] 193400032 14.13 0.000919374120 +[2023-10-17 01:30:57] 193400032 14.12 0.000919386953 +[2023-10-17 01:31:02] 193400032 14.11 0.000919406938 +[2023-10-17 01:31:07] 193400032 14.10 0.000919370198 +[2023-10-17 01:31:12] 193400032 14.09 0.000919446906 +[2023-10-17 01:31:17] 193400032 14.06 0.000919462776 +[2023-10-17 01:31:22] 193400032 14.04 0.000919461511 +[2023-10-17 01:31:27] 193400032 14.01 0.000919436965 +[2023-10-17 01:31:32] 193400032 14.00 0.000919328732 +[2023-10-17 01:31:37] 193400032 13.99 0.000919531545 +[2023-10-17 01:31:42] 193400032 13.99 0.000919552509 +[2023-10-17 01:31:47] 193400032 14.00 0.000919572494 +[2023-10-17 01:31:52] 193400032 14.00 0.000919477615 +[2023-10-17 01:31:57] 193400032 14.00 0.000919626900 +[2023-10-17 01:32:02] 193400032 13.99 0.000919552019 +[2023-10-17 01:32:07] 193400032 13.97 0.000919568671 +[2023-10-17 01:32:12] 193400032 13.96 0.000919645263 +[2023-10-17 01:32:17] 193400032 13.94 0.000919687305 +[2023-10-17 01:32:22] 193400032 13.93 0.000919711208 +[2023-10-17 01:32:27] 193400032 13.93 0.000919710239 +[2023-10-17 01:32:32] 193400032 13.92 0.000919779855 +[2023-10-17 01:32:37] 193400032 13.90 0.000919609497 +[2023-10-17 01:32:42] 193400032 13.88 0.000919708941 +[2023-10-17 01:32:47] 193400032 13.87 0.000919815636 +[2023-10-17 01:32:52] 193400032 13.85 0.000919782834 +[2023-10-17 01:32:57] 193400032 13.84 0.000919837869 +[2023-10-17 01:33:02] 193400032 13.84 0.000919797294 +[2023-10-17 01:33:07] 193400032 13.84 0.000919892634 +[2023-10-17 01:33:12] 193400032 13.83 0.000919825700 +[2023-10-17 01:33:17] 193400032 13.83 0.000919955831 +[2023-10-17 01:33:22] 193400032 13.83 0.000919874286 +[2023-10-17 01:33:27] 193400032 13.83 0.000919989421 +[2023-10-17 01:33:32] 193400032 13.82 0.000920026058 +[2023-10-17 01:33:37] 193400032 13.81 0.000920035697 +[2023-10-17 01:33:42] 193400032 13.81 0.000919945457 +[2023-10-17 01:33:47] 193400032 13.80 0.000919984206 +[2023-10-17 01:33:52] 193400032 13.78 0.000920024546 +[2023-10-17 01:33:57] 193400032 13.77 0.000920122257 +[2023-10-17 01:34:02] 193400032 13.75 0.000920060374 +[2023-10-17 01:34:07] 193400032 13.73 0.000920061376 +[2023-10-17 01:34:12] 193400032 13.72 0.000920076853 +[2023-10-17 01:34:17] 193400032 13.71 0.000920118705 +[2023-10-17 01:34:22] 193400032 13.69 0.000920100085 +[2023-10-17 01:34:27] 193400032 13.68 0.000920170453 +[2023-10-17 01:34:32] 193400032 13.67 0.000920162486 +[2023-10-17 01:34:37] 193400032 13.66 0.000920239812 +[2023-10-17 01:34:42] 193400032 13.66 0.000920203591 +[2023-10-17 01:34:47] 193400032 13.66 0.000920201253 +[2023-10-17 01:34:52] 193400032 13.66 0.000920222608 +[2023-10-17 01:34:57] 193400032 13.66 0.000920315215 +[2023-10-17 01:35:02] 193400032 13.64 0.000920286984 +[2023-10-17 01:35:07] 193400032 13.63 0.000920243979 +[2023-10-17 01:35:12] 193400032 13.61 0.000920350128 +[2023-10-17 01:35:17] 193400032 13.60 0.000920305199 +[2023-10-17 01:35:22] 193400032 13.59 0.000920254413 +[2023-10-17 01:35:27] 193400032 13.58 0.000920357756 +[2023-10-17 01:35:32] 193400032 13.58 0.000920261363 +[2023-10-17 01:35:37] 193400032 13.57 0.000920438772 +[2023-10-17 01:35:42] 193400032 13.57 0.000920357133 +[2023-10-17 01:35:47] 193400032 13.56 0.000920424941 +[2023-10-17 01:35:52] 193400032 13.55 0.000920468244 +[2023-10-17 01:35:57] 193400032 13.54 0.000920425291 +[2023-10-17 01:36:02] 193400032 13.52 0.000920499683 +[2023-10-17 01:36:07] 193400032 13.51 0.000920610228 +[2023-10-17 01:36:12] 193400032 13.50 0.000920604623 +[2023-10-17 01:36:17] 193400032 13.49 0.000920542523 +[2023-10-17 01:36:22] 193400032 13.48 0.000920639272 +[2023-10-17 01:36:27] 193400032 13.47 0.000920546173 +[2023-10-17 01:36:32] 193400032 13.47 0.000920623993 +[2023-10-17 01:36:37] 193400032 13.47 0.000920673590 +[2023-10-17 01:36:42] 193400032 13.46 0.000920623151 +[2023-10-17 01:36:47] 193400032 13.45 0.000920562945 +[2023-10-17 01:36:52] 193400032 13.44 0.000920673585 +[2023-10-17 01:36:57] 193400032 13.42 0.000920775665 +[2023-10-17 01:37:02] 193400032 13.40 0.000920794082 +[2023-10-17 01:37:07] 193400032 13.39 0.000920838417 +[2023-10-17 01:37:12] 193400032 13.38 0.000920806702 +[2023-10-17 01:37:17] 193400032 13.38 0.000920723837 +[2023-10-17 01:37:22] 193400032 13.37 0.000920742648 +[2023-10-17 01:37:27] 193400032 13.36 0.000920798965 +[2023-10-17 01:37:33] 193400032 13.35 0.000920798000 +[2023-10-17 01:37:38] 193400032 13.34 0.000920833309 +[2023-10-17 01:37:43] 193400032 13.34 0.000920945531 +[2023-10-17 01:37:48] 193400032 13.33 0.000920877100 +[2023-10-17 01:37:53] 193400032 13.33 0.000920786277 +[2023-10-17 01:37:58] 193400032 13.33 0.000920912126 +[2023-10-17 01:38:03] 193400032 13.32 0.000921020178 +[2023-10-17 01:38:08] 193400032 13.31 0.000921025296 +[2023-10-17 01:38:13] 193400032 13.29 0.000920949056 +[2023-10-17 01:38:18] 193400032 13.28 0.000921062078 +[2023-10-17 01:38:23] 193400032 13.26 0.000921045970 +[2023-10-17 01:38:28] 193400032 13.25 0.000921055105 +[2023-10-17 01:38:33] 193400032 13.24 0.000921145310 +[2023-10-17 01:38:38] 193400032 13.24 0.000921057758 +[2023-10-17 01:38:43] 193400032 13.24 0.000921014248 +[2023-10-17 01:38:48] 193400032 13.23 0.000921167227 +[2023-10-17 01:38:53] 193400032 13.22 0.000921039095 +[2023-10-17 01:38:58] 193400032 13.21 0.000921119352 +[2023-10-17 01:39:03] 193400032 13.19 0.000921245099 +[2023-10-17 01:39:08] 193400032 13.18 0.000921236884 +[2023-10-17 01:39:13] 193400032 13.17 0.000921215255 +[2023-10-17 01:39:18] 193400032 13.16 0.000921240658 +[2023-10-17 01:39:23] 193400032 13.15 0.000921087480 +[2023-10-17 01:39:28] 193400032 13.14 0.000921292859 +[2023-10-17 01:39:33] 193400032 13.14 0.000921341690 +[2023-10-17 01:39:38] 193400032 13.13 0.000921265029 +[2023-10-17 01:39:43] 193400032 13.14 0.000921355263 +[2023-10-17 01:39:48] 193400032 13.13 0.000921322035 +[2023-10-17 01:39:53] 193400032 13.12 0.000921343781 +[2023-10-17 01:39:58] 193400032 13.12 0.000921470188 +[2023-10-17 01:40:03] 193400032 13.11 0.000921381199 +[2023-10-17 01:40:08] 193400032 13.09 0.000921356801 +[2023-10-17 01:40:13] 193400032 13.08 0.000921274340 +[2023-10-17 01:40:18] 193400032 13.05 0.000921505679 +[2023-10-17 01:40:23] 193400032 13.04 0.000921497455 +[2023-10-17 01:40:28] 193400032 13.02 0.000921541533 +[2023-10-17 01:40:33] 193400032 13.01 0.000921560538 +[2023-10-17 01:40:38] 193400032 13.00 0.000921492849 +[2023-10-17 01:40:43] 193400032 13.00 0.000921472539 +[2023-10-17 01:40:48] 193400032 13.00 0.000921617943 +[2023-10-17 01:40:53] 193400032 12.99 0.000921557123 +[2023-10-17 01:40:58] 193400032 13.00 0.000921577302 +[2023-10-17 01:41:03] 193400032 12.99 0.000921582920 +[2023-10-17 01:41:08] 193400032 12.99 0.000921558203 +[2023-10-17 01:41:13] 193400032 12.98 0.000921659191 +[2023-10-17 01:41:18] 193400032 12.97 0.000921662820 +[2023-10-17 01:41:23] 193400032 12.96 0.000921694031 +[2023-10-17 01:41:28] 193400032 12.95 0.000921707777 +[2023-10-17 01:41:33] 193400032 12.93 0.000921762554 +[2023-10-17 01:41:38] 193400032 12.92 0.000921800153 +[2023-10-17 01:41:43] 193400032 12.92 0.000921761321 +[2023-10-17 01:41:48] 193400032 12.91 0.000921751878 +[2023-10-17 01:41:53] 193400032 12.89 0.000921852661 +[2023-10-17 01:41:58] 193400032 12.88 0.000921791429 +[2023-10-17 01:42:03] 193400032 12.87 0.000921897331 +[2023-10-17 01:42:08] 193400032 12.85 0.000921949190 +[2023-10-17 01:42:13] 193400032 12.84 0.000921949839 +[2023-10-17 01:42:18] 193400032 12.83 0.000921932561 +[2023-10-17 01:42:23] 193400032 12.83 0.000921853094 +[2023-10-17 01:42:28] 193400032 12.83 0.000921975683 +[2023-10-17 01:42:33] 193400032 12.83 0.000922013906 +[2023-10-17 01:42:38] 193400032 12.82 0.000921994043 +[2023-10-17 01:42:43] 193400032 12.82 0.000921899255 +[2023-10-17 01:42:48] 193400032 12.80 0.000921936515 +[2023-10-17 01:42:53] 193400032 12.79 0.000921900588 +[2023-10-17 01:42:58] 193400032 12.78 0.000922015350 +[2023-10-17 01:43:03] 193400032 12.77 0.000922118138 +[2023-10-17 01:43:08] 193400032 12.76 0.000922163262 +[2023-10-17 01:43:13] 193400032 12.75 0.000921969240 +[2023-10-17 01:43:18] 193400032 12.75 0.000922178483 +[2023-10-17 01:43:23] 193400032 12.74 0.000922092524 +[2023-10-17 01:43:28] 193400032 12.73 0.000922163488 +[2023-10-17 01:43:33] 193400032 12.72 0.000922199035 +[2023-10-17 01:43:38] 193400032 12.71 0.000922164525 +[2023-10-17 01:43:43] 193400032 12.70 0.000922108061 +[2023-10-17 01:43:48] 193400032 12.70 0.000922196506 +[2023-10-17 01:43:53] 193400032 12.70 0.000922300740 +[2023-10-17 01:43:58] 193400032 12.70 0.000922317981 +[2023-10-17 01:44:03] 193400032 12.70 0.000922252789 +[2023-10-17 01:44:08] 193400032 12.70 0.000922274533 +[2023-10-17 01:44:13] 193400032 12.69 0.000922355481 +[2023-10-17 01:44:18] 193400032 12.66 0.000922348441 +[2023-10-17 01:44:23] 193400032 12.64 0.000922234390 +[2023-10-17 01:44:28] 193400032 12.61 0.000922334249 +[2023-10-17 01:44:33] 193400032 12.59 0.000922313789 +[2023-10-17 01:44:38] 193400032 12.58 0.000922439602 +[2023-10-17 01:44:43] 193400032 12.58 0.000922351748 +[2023-10-17 01:44:48] 193400032 12.58 0.000922369192 +[2023-10-17 01:44:53] 193400032 12.59 0.000922419818 +[2023-10-17 01:44:58] 193400032 12.59 0.000922482316 +[2023-10-17 01:45:03] 193400032 12.59 0.000922367114 +[2023-10-17 01:45:08] 193400032 12.57 0.000922539531 +[2023-10-17 01:45:13] 193400032 12.55 0.000922452502 +[2023-10-17 01:45:18] 193400032 12.54 0.000922553721 +[2023-10-17 01:45:23] 193400032 12.53 0.000922548999 +[2023-10-17 01:45:28] 193400032 12.53 0.000922674945 +[2023-10-17 01:45:33] 193400032 12.52 0.000922574945 +[2023-10-17 01:45:38] 193400032 12.51 0.000922436951 +[2023-10-17 01:45:43] 193400032 12.50 0.000922618120 +[2023-10-17 01:45:48] 193400032 12.49 0.000922601953 +[2023-10-17 01:45:53] 193400032 12.49 0.000922679499 +[2023-10-17 01:45:58] 193400032 12.47 0.000922532579 +[2023-10-17 01:46:03] 193400032 12.46 0.000922686029 +[2023-10-17 01:46:08] 193400032 12.46 0.000922709643 +[2023-10-17 01:46:13] 193400032 12.45 0.000922707493 +[2023-10-17 01:46:18] 193400032 12.44 0.000922684790 +[2023-10-17 01:46:23] 193400032 12.43 0.000922740527 +[2023-10-17 01:46:28] 193400032 12.42 0.000922758516 +[2023-10-17 01:46:33] 193400032 12.42 0.000922795645 +[2023-10-17 01:46:38] 193400032 12.42 0.000922893019 +[2023-10-17 01:46:43] 193400032 12.42 0.000922930786 +[2023-10-17 01:46:48] 193400032 12.42 0.000922918097 +[2023-10-17 01:46:53] 193400032 12.42 0.000922850891 +[2023-10-17 01:46:58] 193400032 12.41 0.000922936942 +[2023-10-17 01:47:03] 193400032 12.41 0.000922897464 +[2023-10-17 01:47:08] 193400032 12.39 0.000922913190 +[2023-10-17 01:47:13] 193400032 12.37 0.000922900112 +[2023-10-17 01:47:18] 193400032 12.35 0.000922912361 +[2023-10-17 01:47:23] 193400032 12.34 0.000923083750 +[2023-10-17 01:47:28] 193400032 12.32 0.000922968672 +[2023-10-17 01:47:33] 193400032 12.30 0.000923090706 +[2023-10-17 01:47:38] 193400032 12.30 0.000923000759 +[2023-10-17 01:47:43] 193400032 12.29 0.000922977847 +[2023-10-17 01:47:48] 193400032 12.29 0.000923111596 +[2023-10-17 01:47:53] 193400032 12.29 0.000923146425 +[2023-10-17 01:47:58] 193400032 12.29 0.000923174758 +[2023-10-17 01:48:03] 193400032 12.28 0.000923196114 +[2023-10-17 01:48:08] 193400032 12.27 0.000923244255 +[2023-10-17 01:48:13] 193400032 12.26 0.000923109191 +[2023-10-17 01:48:18] 193400032 12.25 0.000923233623 +[2023-10-17 01:48:24] 193400032 12.24 0.000923196275 +[2023-10-17 01:48:29] 193400032 12.23 0.000923114688 +[2023-10-17 01:48:34] 193400032 12.23 0.000923176484 +[2023-10-17 01:48:39] 193400032 12.22 0.000923282124 +[2023-10-17 01:48:44] 193400032 12.21 0.000923219972 +[2023-10-17 01:48:49] 193400032 12.20 0.000923338938 +[2023-10-17 01:48:54] 193400032 12.18 0.000923249943 +[2023-10-17 01:48:59] 193400032 12.17 0.000923276294 +[2023-10-17 01:49:04] 193400032 12.17 0.000923254796 +[2023-10-17 01:49:09] 193400032 12.16 0.000923442978 +[2023-10-17 01:49:14] 193400032 12.15 0.000923379178 +[2023-10-17 01:49:19] 193400032 12.14 0.000923470840 +[2023-10-17 01:49:24] 193400032 12.14 0.000923334524 +[2023-10-17 01:49:29] 193400032 12.14 0.000923421127 +[2023-10-17 01:49:34] 193400032 12.14 0.000923476566 +[2023-10-17 01:49:39] 193400032 12.13 0.000923533007 +[2023-10-17 01:49:44] 193400032 12.13 0.000923483474 +[2023-10-17 01:49:49] 193400032 12.13 0.000923591881 +[2023-10-17 01:49:54] 193400032 12.12 0.000923514631 +[2023-10-17 01:49:59] 193400032 12.11 0.000923589275 +[2023-10-17 01:50:04] 193400032 12.10 0.000923524601 +[2023-10-17 01:50:09] 193400032 12.08 0.000923661630 +[2023-10-17 01:50:14] 193400032 12.07 0.000923546017 +[2023-10-17 01:50:19] 193400032 12.06 0.000923699051 +[2023-10-17 01:50:24] 193400032 12.04 0.000923713550 +[2023-10-17 01:50:29] 193400032 12.03 0.000923602080 +[2023-10-17 01:50:34] 193400032 12.01 0.000923696569 +[2023-10-17 01:50:39] 193400032 12.00 0.000923661491 +[2023-10-17 01:50:44] 193400032 11.99 0.000923659917 +[2023-10-17 01:50:49] 193400032 11.98 0.000923747610 +[2023-10-17 01:50:54] 193400032 11.97 0.000923766051 +[2023-10-17 01:50:59] 193400032 11.97 0.000923861717 +[2023-10-17 01:51:04] 193400032 11.97 0.000923799120 +[2023-10-17 01:51:09] 193400032 11.97 0.000923642611 +[2023-10-17 01:51:14] 193400032 11.98 0.000923752109 +[2023-10-17 01:51:19] 193400032 11.97 0.000923744566 +[2023-10-17 01:51:24] 193400032 11.97 0.000923919623 +[2023-10-17 01:51:29] 193400032 11.97 0.000923930060 +[2023-10-17 01:51:34] 193400032 11.96 0.000923946221 +[2023-10-17 01:51:39] 193400032 11.95 0.000923955020 +[2023-10-17 01:51:44] 193400032 11.94 0.000924026245 +[2023-10-17 01:51:49] 193400032 11.92 0.000923910534 +[2023-10-17 01:51:54] 193400032 11.91 0.000923963918 +[2023-10-17 01:51:59] 193400032 11.90 0.000923990662 +[2023-10-17 01:52:04] 193400032 11.89 0.000923861731 +[2023-10-17 01:52:09] 193400032 11.89 0.000923934956 +[2023-10-17 01:52:14] 193400032 11.88 0.000923941842 +[2023-10-17 01:52:19] 193400032 11.87 0.000924051665 +[2023-10-17 01:52:24] 193400032 11.86 0.000924087139 +[2023-10-17 01:52:29] 193400032 11.84 0.000924067428 +[2023-10-17 01:52:34] 193400032 11.82 0.000924064418 +[2023-10-17 01:52:39] 193400032 11.81 0.000924139328 +[2023-10-17 01:52:44] 193400032 11.80 0.000924098979 +[2023-10-17 01:52:49] 193400032 11.79 0.000924200345 +[2023-10-17 01:52:54] 193400032 11.79 0.000924184399 +[2023-10-17 01:52:59] 193400032 11.80 0.000924210227 +[2023-10-17 01:53:04] 193400032 11.80 0.000924200784 +[2023-10-17 01:53:09] 193400032 11.80 0.000924281926 +[2023-10-17 01:53:14] 193400032 11.80 0.000924184988 +[2023-10-17 01:53:19] 193400032 11.80 0.000924103508 +[2023-10-17 01:53:24] 193400032 11.79 0.000924311222 +[2023-10-17 01:53:29] 193400032 11.78 0.000924337238 +[2023-10-17 01:53:34] 193400032 11.77 0.000924328463 +[2023-10-17 01:53:39] 193400032 11.75 0.000924265529 +[2023-10-17 01:53:44] 193400032 11.74 0.000924313922 +[2023-10-17 01:53:49] 193400032 11.73 0.000924439342 +[2023-10-17 01:53:54] 193400032 11.71 0.000924221952 +[2023-10-17 01:53:59] 193400032 11.71 0.000924342544 +[2023-10-17 01:54:04] 193400032 11.70 0.000924318277 +[2023-10-17 01:54:09] 193400032 11.70 0.000924485367 +[2023-10-17 01:54:14] 193400032 11.69 0.000924393653 +[2023-10-17 01:54:19] 193400032 11.68 0.000924403956 +[2023-10-17 01:54:24] 193400032 11.67 0.000924513367 +[2023-10-17 01:54:29] 193400032 11.66 0.000924557453 +[2023-10-17 01:54:34] 193400032 11.65 0.000924569797 +[2023-10-17 01:54:39] 193400032 11.64 0.000924474917 +[2023-10-17 01:54:44] 193400032 11.63 0.000924573568 +[2023-10-17 01:54:49] 193400032 11.62 0.000924661923 +[2023-10-17 01:54:54] 193400032 11.61 0.000924548639 +[2023-10-17 01:54:59] 193400032 11.61 0.000924621150 +[2023-10-17 01:55:04] 193400032 11.62 0.000924569009 +[2023-10-17 01:55:09] 193400032 11.61 0.000924493284 +[2023-10-17 01:55:14] 193400032 11.61 0.000924669744 +[2023-10-17 01:55:19] 193400032 11.60 0.000924737842 +[2023-10-17 01:55:24] 193400032 11.59 0.000924727550 +[2023-10-17 01:55:29] 193400032 11.58 0.000924717037 +[2023-10-17 01:55:34] 193400032 11.57 0.000924787411 +[2023-10-17 01:55:39] 193400032 11.56 0.000924735806 +[2023-10-17 01:55:44] 193400032 11.55 0.000924783318 +[2023-10-17 01:55:49] 193400032 11.55 0.000924782357 +[2023-10-17 01:55:54] 193400032 11.55 0.000924762157 +[2023-10-17 01:55:59] 193400032 11.54 0.000924779397 +[2023-10-17 01:56:04] 193400032 11.53 0.000924884197 +[2023-10-17 01:56:09] 193400032 11.52 0.000924884395 +[2023-10-17 01:56:14] 193400032 11.51 0.000924779681 +[2023-10-17 01:56:19] 193400032 11.49 0.000924749934 +[2023-10-17 01:56:24] 193400032 11.48 0.000924784298 +[2023-10-17 01:56:29] 193400032 11.48 0.000924854541 +[2023-10-17 01:56:34] 193400032 11.47 0.000924827283 +[2023-10-17 01:56:39] 193400032 11.46 0.000924930785 +[2023-10-17 01:56:44] 193400032 11.45 0.000924912809 +[2023-10-17 01:56:49] 193400032 11.45 0.000925010961 +[2023-10-17 01:56:54] 193400032 11.44 0.000925015369 +[2023-10-17 01:56:59] 193400032 11.44 0.000924935944 +[2023-10-17 01:57:04] 193400032 11.43 0.000924975499 +[2023-10-17 01:57:09] 193400032 11.42 0.000925075811 +[2023-10-17 01:57:14] 193400032 11.41 0.000925079590 +[2023-10-17 01:57:19] 193400032 11.41 0.000924939084 +[2023-10-17 01:57:24] 193400032 11.40 0.000924983538 +[2023-10-17 01:57:29] 193400032 11.39 0.000925120622 +[2023-10-17 01:57:34] 193400032 11.38 0.000924994682 +[2023-10-17 01:57:39] 193400032 11.38 0.000925123897 +[2023-10-17 01:57:44] 193400032 11.38 0.000925174186 +[2023-10-17 01:57:49] 193400032 11.38 0.000925091772 +[2023-10-17 01:57:54] 193400032 11.37 0.000925173847 +[2023-10-17 01:57:59] 193400032 11.37 0.000925110380 +[2023-10-17 01:58:04] 193400032 11.36 0.000925209557 +[2023-10-17 01:58:09] 193400032 11.34 0.000925153395 +[2023-10-17 01:58:14] 193400032 11.33 0.000925157365 +[2023-10-17 01:58:19] 193400032 11.31 0.000925257698 +[2023-10-17 01:58:24] 193400032 11.29 0.000925265586 +[2023-10-17 01:58:29] 193400032 11.28 0.000925271514 +[2023-10-17 01:58:34] 193400032 11.28 0.000925259171 +[2023-10-17 01:58:39] 193400032 11.28 0.000925263294 +[2023-10-17 01:58:44] 193400032 11.28 0.000925309604 +[2023-10-17 01:58:50] 193400032 11.28 0.000925341018 +[2023-10-17 01:58:55] 193400032 11.28 0.000925467383 +[2023-10-17 01:59:00] 193400032 11.27 0.000925450579 +[2023-10-17 01:59:05] 193400032 11.26 0.000925333459 +[2023-10-17 01:59:10] 193400032 11.25 0.000925247620 +[2023-10-17 01:59:15] 193400032 11.24 0.000925508769 +[2023-10-17 01:59:20] 193400032 11.22 0.000925442877 +[2023-10-17 01:59:25] 193400032 11.22 0.000925410910 +[2023-10-17 01:59:30] 193400032 11.21 0.000925365166 +[2023-10-17 01:59:35] 193400032 11.20 0.000925483142 +[2023-10-17 01:59:40] 193400032 11.19 0.000925509541 +[2023-10-17 01:59:45] 193400032 11.19 0.000925604942 +[2023-10-17 01:59:50] 193400032 11.19 0.000925498294 +[2023-10-17 01:59:55] 193400032 11.18 0.000925563807 +[2023-10-17 02:00:00] 193400032 11.18 0.000925664172 +[2023-10-17 02:00:05] 193400032 11.17 0.000925595739 +[2023-10-17 02:00:10] 193400032 11.17 0.000925585836 +[2023-10-17 02:00:15] 193400032 11.16 0.000925649564 +[2023-10-17 02:00:20] 193400032 11.16 0.000925658533 +[2023-10-17 02:00:25] 193400032 11.14 0.000925531824 +[2023-10-17 02:00:30] 193400032 11.12 0.000925685422 +[2023-10-17 02:00:35] 193400032 11.12 0.000925669440 +[2023-10-17 02:00:40] 193400032 11.12 0.000925626335 +[2023-10-17 02:00:45] 193400032 11.11 0.000925744990 +[2023-10-17 02:00:50] 193400032 11.10 0.000925803278 +[2023-10-17 02:00:55] 193400032 11.09 0.000925690902 +[2023-10-17 02:01:00] 193400032 11.08 0.000925830754 +[2023-10-17 02:01:05] 193400032 11.08 0.000925756833 +[2023-10-17 02:01:10] 193400032 11.08 0.000925827605 +[2023-10-17 02:01:15] 193400032 11.07 0.000925856848 +[2023-10-17 02:01:20] 193400032 11.07 0.000925919462 +[2023-10-17 02:01:25] 193400032 11.06 0.000925738228 +[2023-10-17 02:01:30] 193400032 11.05 0.000925931926 +[2023-10-17 02:01:35] 193400032 11.05 0.000925782002 +[2023-10-17 02:01:40] 193400032 11.03 0.000925971577 +[2023-10-17 02:01:45] 193400032 11.01 0.000925985684 +[2023-10-17 02:01:50] 193400032 11.01 0.000925917418 +[2023-10-17 02:01:55] 193400032 11.00 0.000925859795 +[2023-10-17 02:02:00] 193400032 10.99 0.000925945374 +[2023-10-17 02:02:05] 193400032 10.99 0.000926029134 +[2023-10-17 02:02:10] 193400032 10.98 0.000926063270 +[2023-10-17 02:02:15] 193400032 10.98 0.000926079140 +[2023-10-17 02:02:20] 193400032 10.96 0.000925929035 +[2023-10-17 02:02:25] 193400032 10.95 0.000926099020 +[2023-10-17 02:02:30] 193400032 10.94 0.000926055039 +[2023-10-17 02:02:35] 193400032 10.93 0.000926015577 +[2023-10-17 02:02:40] 193400032 10.93 0.000926128912 +[2023-10-17 02:02:45] 193400032 10.93 0.000926112541 +[2023-10-17 02:02:50] 193400032 10.92 0.000926097079 +[2023-10-17 02:02:55] 193400032 10.93 0.000926078262 +[2023-10-17 02:03:00] 193400032 10.93 0.000926131853 +[2023-10-17 02:03:05] 193400032 10.92 0.000926158383 +[2023-10-17 02:03:10] 193400032 10.93 0.000926256451 +[2023-10-17 02:03:15] 193400032 10.92 0.000926271146 +[2023-10-17 02:03:20] 193400032 10.91 0.000926235197 +[2023-10-17 02:03:25] 193400032 10.90 0.000926308567 +[2023-10-17 02:03:30] 193400032 10.89 0.000926325809 +[2023-10-17 02:03:35] 193400032 10.87 0.000926343246 +[2023-10-17 02:03:40] 193400032 10.86 0.000926274948 +[2023-10-17 02:03:45] 193400032 10.85 0.000926270567 +[2023-10-17 02:03:50] 193400032 10.83 0.000926345602 +[2023-10-17 02:03:55] 193400032 10.82 0.000926346183 +[2023-10-17 02:04:00] 193400032 10.82 0.000926195664 +[2023-10-17 02:04:05] 193400032 10.81 0.000926391800 +[2023-10-17 02:04:10] 193400032 10.80 0.000926380151 +[2023-10-17 02:04:15] 193400032 10.81 0.000926399741 +[2023-10-17 02:04:20] 193400032 10.81 0.000926417568 +[2023-10-17 02:04:25] 193400032 10.81 0.000926490522 +[2023-10-17 02:04:30] 193400032 10.82 0.000926418439 +[2023-10-17 02:04:35] 193400032 10.80 0.000926315620 +[2023-10-17 02:04:40] 193400032 10.79 0.000926311529 +[2023-10-17 02:04:45] 193400032 10.78 0.000926462631 +[2023-10-17 02:04:50] 193400032 10.76 0.000926522378 +[2023-10-17 02:04:55] 193400032 10.75 0.000926544124 +[2023-10-17 02:05:00] 193400032 10.73 0.000926556466 +[2023-10-17 02:05:05] 193400032 10.72 0.000926653520 +[2023-10-17 02:05:10] 193400032 10.70 0.000926635944 +[2023-10-17 02:05:15] 193400032 10.69 0.000926583501 +[2023-10-17 02:05:20] 193400032 10.69 0.000926591729 +[2023-10-17 02:05:25] 193400032 10.69 0.000926602504 +[2023-10-17 02:05:30] 193400032 10.69 0.000926559323 +[2023-10-17 02:05:35] 193400032 10.69 0.000926709693 +[2023-10-17 02:05:40] 193400032 10.69 0.000926737641 +[2023-10-17 02:05:45] 193400032 10.70 0.000926747127 +[2023-10-17 02:05:50] 193400032 10.69 0.000926680430 +[2023-10-17 02:05:55] 193400032 10.69 0.000926711820 +[2023-10-17 02:06:00] 193400032 10.68 0.000926733174 +[2023-10-17 02:06:05] 193400032 10.67 0.000926737907 +[2023-10-17 02:06:10] 193400032 10.65 0.000926808897 +[2023-10-17 02:06:15] 193400032 10.64 0.000926801481 +[2023-10-17 02:06:20] 193400032 10.63 0.000926683930 +[2023-10-17 02:06:25] 193400032 10.62 0.000926880470 +[2023-10-17 02:06:30] 193400032 10.62 0.000926833416 +[2023-10-17 02:06:35] 193400032 10.62 0.000926876315 +[2023-10-17 02:06:40] 193400032 10.61 0.000926677552 +[2023-10-17 02:06:45] 193400032 10.61 0.000926811238 +[2023-10-17 02:06:50] 193400032 10.60 0.000926865607 +[2023-10-17 02:06:55] 193400032 10.60 0.000926992536 +[2023-10-17 02:07:00] 193400032 10.59 0.000926825868 +[2023-10-17 02:07:05] 193400032 10.59 0.000927033440 +[2023-10-17 02:07:10] 193400032 10.58 0.000926998696 +[2023-10-17 02:07:15] 193400032 10.57 0.000926954863 +[2023-10-17 02:07:20] 193400032 10.56 0.000926929638 +[2023-10-17 02:07:25] 193400032 10.55 0.000927040945 +[2023-10-17 02:07:30] 193400032 10.54 0.000926997452 +[2023-10-17 02:07:35] 193400032 10.53 0.000927017530 +[2023-10-17 02:07:40] 193400032 10.53 0.000927108918 +[2023-10-17 02:07:45] 193400032 10.52 0.000926981644 +[2023-10-17 02:07:50] 193400032 10.51 0.000926975904 +[2023-10-17 02:07:55] 193400032 10.50 0.000927023685 +[2023-10-17 02:08:00] 193400032 10.50 0.000927095521 +[2023-10-17 02:08:05] 193400032 10.49 0.000927160484 +[2023-10-17 02:08:10] 193400032 10.49 0.000927137134 +[2023-10-17 02:08:15] 193400032 10.49 0.000927152378 +[2023-10-17 02:08:20] 193400032 10.48 0.000927053153 +[2023-10-17 02:08:25] 193400032 10.47 0.000927174775 +[2023-10-17 02:08:30] 193400032 10.46 0.000927283291 +[2023-10-17 02:08:35] 193400032 10.46 0.000927108892 +[2023-10-17 02:08:40] 193400032 10.45 0.000927284927 +[2023-10-17 02:08:45] 193400032 10.45 0.000927327178 +[2023-10-17 02:08:50] 193400032 10.44 0.000927261142 +[2023-10-17 02:08:55] 193400032 10.43 0.000927281517 +[2023-10-17 02:09:00] 193400032 10.42 0.000927277953 +[2023-10-17 02:09:05] 193400032 10.41 0.000927377703 +[2023-10-17 02:09:10] 193400032 10.40 0.000927336959 +[2023-10-17 02:09:16] 193400032 10.40 0.000927318420 +[2023-10-17 02:09:21] 193400032 10.40 0.000927411668 +[2023-10-17 02:09:26] 193400032 10.39 0.000927397408 +[2023-10-17 02:09:31] 193400032 10.39 0.000927395255 +[2023-10-17 02:09:36] 193400032 10.39 0.000927313813 +[2023-10-17 02:09:41] 193400032 10.38 0.000927391617 +[2023-10-17 02:09:46] 193400032 10.38 0.000927447536 +[2023-10-17 02:09:51] 193400032 10.37 0.000927435696 +[2023-10-17 02:09:56] 193400032 10.36 0.000927474960 +[2023-10-17 02:10:01] 193400032 10.34 0.000927376814 +[2023-10-17 02:10:06] 193400032 10.33 0.000927490159 +[2023-10-17 02:10:11] 193400032 10.31 0.000927521556 +[2023-10-17 02:10:16] 193400032 10.30 0.000927535171 +[2023-10-17 02:10:21] 193400032 10.30 0.000927465781 +[2023-10-17 02:10:26] 193400032 10.30 0.000927529533 +[2023-10-17 02:10:31] 193400032 10.29 0.000927578443 +[2023-10-17 02:10:36] 193400032 10.29 0.000927565777 +[2023-10-17 02:10:41] 193400032 10.30 0.000927638812 +[2023-10-17 02:10:46] 193400032 10.29 0.000927621369 +[2023-10-17 02:10:51] 193400032 10.28 0.000927586367 +[2023-10-17 02:10:56] 193400032 10.27 0.000927544570 +[2023-10-17 02:11:01] 193400032 10.27 0.000927642573 +[2023-10-17 02:11:06] 193400032 10.26 0.000927635094 +[2023-10-17 02:11:11] 193400032 10.26 0.000927784233 +[2023-10-17 02:11:16] 193400032 10.25 0.000927726164 +[2023-10-17 02:11:21] 193400032 10.24 0.000927588152 +[2023-10-17 02:11:26] 193400032 10.23 0.000927633503 +[2023-10-17 02:11:31] 193400032 10.23 0.000927757690 +[2023-10-17 02:11:36] 193400032 10.21 0.000927806472 +[2023-10-17 02:11:41] 193400032 10.20 0.000927685990 +[2023-10-17 02:11:46] 193400032 10.19 0.000927773261 +[2023-10-17 02:11:51] 193400032 10.19 0.000927795991 +[2023-10-17 02:11:56] 193400032 10.18 0.000927850639 +[2023-10-17 02:12:01] 193400032 10.18 0.000927793107 +[2023-10-17 02:12:06] 193400032 10.17 0.000927844115 +[2023-10-17 02:12:11] 193400032 10.17 0.000927895364 +[2023-10-17 02:12:16] 193400032 10.15 0.000927858621 +[2023-10-17 02:12:21] 193400032 10.14 0.000927937265 +[2023-10-17 02:12:26] 193400032 10.14 0.000927849341 +[2023-10-17 02:12:31] 193400032 10.13 0.000927756303 +[2023-10-17 02:12:36] 193400032 10.14 0.000927879200 +[2023-10-17 02:12:41] 193400032 10.14 0.000927899489 +[2023-10-17 02:12:46] 193400032 10.13 0.000927832995 +[2023-10-17 02:12:51] 193400032 10.13 0.000927942324 +[2023-10-17 02:12:56] 193400032 10.13 0.000927985660 +[2023-10-17 02:13:01] 193400032 10.13 0.000928107544 +[2023-10-17 02:13:06] 193400032 10.12 0.000928036149 +[2023-10-17 02:13:11] 193400032 10.10 0.000928049079 +[2023-10-17 02:13:16] 193400032 10.09 0.000928125160 +[2023-10-17 02:13:21] 193400032 10.07 0.000928184336 +[2023-10-17 02:13:26] 193400032 10.07 0.000928119921 +[2023-10-17 02:13:31] 193400032 10.06 0.000928130743 +[2023-10-17 02:13:36] 193400032 10.05 0.000928170827 +[2023-10-17 02:13:41] 193400032 10.04 0.000928034874 +[2023-10-17 02:13:46] 193400032 10.04 0.000928115847 +[2023-10-17 02:13:51] 193400032 10.04 0.000928080112 +[2023-10-17 02:13:56] 193400032 10.03 0.000928190523 +[2023-10-17 02:14:01] 193400032 10.02 0.000928165622 +[2023-10-17 02:14:06] 193400032 10.00 0.000928293491 +[2023-10-17 02:14:11] 193400032 10.00 0.000928321102 +[2023-10-17 02:14:16] 193400032 09.99 0.000928328468 +[2023-10-17 02:14:21] 193400032 09.99 0.000928300975 +[2023-10-17 02:14:26] 193400032 09.98 0.000928363421 +[2023-10-17 02:14:31] 193400032 09.98 0.000928345488 +[2023-10-17 02:14:36] 193400032 09.98 0.000928248964 +[2023-10-17 02:14:41] 193400032 09.97 0.000928313631 +[2023-10-17 02:14:46] 193400032 09.97 0.000928302837 +[2023-10-17 02:14:51] 193400032 09.97 0.000928289906 +[2023-10-17 02:14:56] 193400032 09.97 0.000928303423 +[2023-10-17 02:15:01] 193400032 09.97 0.000928422397 +[2023-10-17 02:15:06] 193400032 09.97 0.000928304530 +[2023-10-17 02:15:11] 193400032 09.97 0.000928473047 +[2023-10-17 02:15:16] 193400032 09.95 0.000928438319 +[2023-10-17 02:15:21] 193400032 09.94 0.000928445202 +[2023-10-17 02:15:26] 193400032 09.94 0.000928503531 +[2023-10-17 02:15:31] 193400032 09.93 0.000928466370 +[2023-10-17 02:15:36] 193400032 09.92 0.000928492416 +[2023-10-17 02:15:41] 193400032 09.91 0.000928589518 +[2023-10-17 02:15:46] 193400032 09.90 0.000928473768 +[2023-10-17 02:15:51] 193400032 09.89 0.000928526006 +[2023-10-17 02:15:56] 193400032 09.88 0.000928513654 +[2023-10-17 02:16:01] 193400032 09.87 0.000928513022 +[2023-10-17 02:16:06] 193400032 09.86 0.000928557538 +[2023-10-17 02:16:11] 193400032 09.85 0.000928588553 +[2023-10-17 02:16:16] 193400032 09.85 0.000928665272 +[2023-10-17 02:16:21] 193400032 09.84 0.000928605968 +[2023-10-17 02:16:26] 193400032 09.84 0.000928705723 +[2023-10-17 02:16:31] 193400032 09.84 0.000928651932 +[2023-10-17 02:16:36] 193400032 09.83 0.000928612544 +[2023-10-17 02:16:41] 193400032 09.83 0.000928674778 +[2023-10-17 02:16:46] 193400032 09.83 0.000928784659 +[2023-10-17 02:16:51] 193400032 09.82 0.000928821716 +[2023-10-17 02:16:56] 193400032 09.81 0.000928678554 +[2023-10-17 02:17:01] 193400032 09.80 0.000928705428 +[2023-10-17 02:17:06] 193400032 09.79 0.000928835011 +[2023-10-17 02:17:11] 193400032 09.79 0.000928720093 +[2023-10-17 02:17:16] 193400032 09.78 0.000928719698 +[2023-10-17 02:17:21] 193400032 09.77 0.000928849079 +[2023-10-17 02:17:26] 193400032 09.77 0.000928709722 +[2023-10-17 02:17:31] 193400032 09.76 0.000928733380 +[2023-10-17 02:17:36] 193400032 09.75 0.000928828342 +[2023-10-17 02:17:41] 193400032 09.74 0.000928808233 +[2023-10-17 02:17:46] 193400032 09.74 0.000928789062 +[2023-10-17 02:17:51] 193400032 09.72 0.000928838365 +[2023-10-17 02:17:56] 193400032 09.72 0.000928803953 +[2023-10-17 02:18:01] 193400032 09.71 0.000928914284 +[2023-10-17 02:18:06] 193400032 09.71 0.000929029986 +[2023-10-17 02:18:11] 193400032 09.71 0.000928937124 +[2023-10-17 02:18:16] 193400032 09.71 0.000928993520 +[2023-10-17 02:18:21] 193400032 09.71 0.000928908344 +[2023-10-17 02:18:26] 193400032 09.70 0.000928953045 +[2023-10-17 02:18:31] 193400032 09.70 0.000928907622 +[2023-10-17 02:18:36] 193400032 09.70 0.000928930597 +[2023-10-17 02:18:41] 193400032 09.70 0.000928972010 +[2023-10-17 02:18:46] 193400032 09.69 0.000928988073 +[2023-10-17 02:18:51] 193400032 09.68 0.000929016868 +[2023-10-17 02:18:57] 193400032 09.68 0.000929002290 +[2023-10-17 02:19:02] 193400032 09.67 0.000929068662 +[2023-10-17 02:19:07] 193400032 09.66 0.000929192965 +[2023-10-17 02:19:12] 193400032 09.64 0.000929103953 +[2023-10-17 02:19:17] 193400032 09.64 0.000929180395 +[2023-10-17 02:19:22] 193400032 09.63 0.000929038917 +[2023-10-17 02:19:27] 193400032 09.62 0.000929115514 +[2023-10-17 02:19:32] 193400032 09.62 0.000929106979 +[2023-10-17 02:19:37] 193400032 09.61 0.000929183378 +[2023-10-17 02:19:42] 193400032 09.60 0.000929304779 +[2023-10-17 02:19:47] 193400032 09.59 0.000929295041 +[2023-10-17 02:19:52] 193400032 09.58 0.000929200380 +[2023-10-17 02:19:57] 193400032 09.56 0.000929258455 +[2023-10-17 02:20:02] 193400032 09.56 0.000929202082 +[2023-10-17 02:20:07] 193400032 09.57 0.000929270241 +[2023-10-17 02:20:12] 193400032 09.56 0.000929341728 +[2023-10-17 02:20:17] 193400032 09.57 0.000929244498 +[2023-10-17 02:20:22] 193400032 09.57 0.000929329615 +[2023-10-17 02:20:27] 193400032 09.57 0.000929412204 +[2023-10-17 02:20:32] 193400032 09.57 0.000929268588 +[2023-10-17 02:20:37] 193400032 09.56 0.000929436891 +[2023-10-17 02:20:42] 193400032 09.55 0.000929392184 +[2023-10-17 02:20:47] 193400032 09.54 0.000929356215 +[2023-10-17 02:20:52] 193400032 09.53 0.000929478427 +[2023-10-17 02:20:57] 193400032 09.52 0.000929384306 +[2023-10-17 02:21:02] 193400032 09.50 0.000929507576 +[2023-10-17 02:21:07] 193400032 09.49 0.000929392061 +[2023-10-17 02:21:12] 193400032 09.48 0.000929377112 +[2023-10-17 02:21:17] 193400032 09.48 0.000929533238 +[2023-10-17 02:21:22] 193400032 09.48 0.000929519844 +[2023-10-17 02:21:27] 193400032 09.48 0.000929589320 +[2023-10-17 02:21:32] 193400032 09.47 0.000929603230 +[2023-10-17 02:21:37] 193400032 09.46 0.000929617141 +[2023-10-17 02:21:42] 193400032 09.45 0.000929630268 +[2023-10-17 02:21:47] 193400032 09.45 0.000929618248 +[2023-10-17 02:21:52] 193400032 09.45 0.000929573360 +[2023-10-17 02:21:57] 193400032 09.44 0.000929673887 +[2023-10-17 02:22:02] 193400032 09.44 0.000929624518 +[2023-10-17 02:22:07] 193400032 09.43 0.000929722673 +[2023-10-17 02:22:12] 193400032 09.42 0.000929540809 +[2023-10-17 02:22:17] 193400032 09.42 0.000929706171 +[2023-10-17 02:22:22] 193400032 09.41 0.000929738222 +[2023-10-17 02:22:27] 193400032 09.42 0.000929602254 +[2023-10-17 02:22:32] 193400032 09.41 0.000929676848 +[2023-10-17 02:22:37] 193400032 09.40 0.000929615901 +[2023-10-17 02:22:42] 193400032 09.40 0.000929714090 +[2023-10-17 02:22:47] 193400032 09.39 0.000929721837 +[2023-10-17 02:22:52] 193400032 09.38 0.000929692964 +[2023-10-17 02:22:57] 193400032 09.38 0.000929757403 +[2023-10-17 02:23:02] 193400032 09.37 0.000929721790 +[2023-10-17 02:23:07] 193400032 09.37 0.000929732674 +[2023-10-17 02:23:12] 193400032 09.35 0.000929775343 +[2023-10-17 02:23:17] 193400032 09.35 0.000929886872 +[2023-10-17 02:23:22] 193400032 09.34 0.000929866338 +[2023-10-17 02:23:27] 193400032 09.33 0.000929812774 +[2023-10-17 02:23:32] 193400032 09.33 0.000929927681 +[2023-10-17 02:23:37] 193400032 09.32 0.000929835561 +[2023-10-17 02:23:42] 193400032 09.31 0.000929873362 +[2023-10-17 02:23:47] 193400032 09.31 0.000929887467 +[2023-10-17 02:23:52] 193400032 09.30 0.000929985675 +[2023-10-17 02:23:57] 193400032 09.29 0.000929813503 +[2023-10-17 02:24:02] 193400032 09.28 0.000929903432 +[2023-10-17 02:24:07] 193400032 09.28 0.000930050107 +[2023-10-17 02:24:12] 193400032 09.28 0.000929956622 +[2023-10-17 02:24:17] 193400032 09.27 0.000930079072 +[2023-10-17 02:24:22] 193400032 09.27 0.000929848530 +[2023-10-17 02:24:27] 193400032 09.27 0.000929967655 +[2023-10-17 02:24:32] 193400032 09.27 0.000929891698 +[2023-10-17 02:24:37] 193400032 09.26 0.000929869922 +[2023-10-17 02:24:42] 193400032 09.25 0.000930124723 +[2023-10-17 02:24:47] 193400032 09.25 0.000930038981 +[2023-10-17 02:24:52] 193400032 09.25 0.000930017105 +[2023-10-17 02:24:57] 193400032 09.25 0.000929974022 +[2023-10-17 02:25:02] 193400032 09.24 0.000930132176 +[2023-10-17 02:25:07] 193400032 09.23 0.000930193490 +[2023-10-17 02:25:12] 193400032 09.22 0.000930118868 +[2023-10-17 02:25:17] 193400032 09.21 0.000930092720 +[2023-10-17 02:25:22] 193400032 09.20 0.000930222947 +[2023-10-17 02:25:27] 193400032 09.19 0.000930216096 +[2023-10-17 02:25:32] 193400032 09.18 0.000930153277 +[2023-10-17 02:25:37] 193400032 09.18 0.000930219800 +[2023-10-17 02:25:42] 193400032 09.17 0.000930321764 +[2023-10-17 02:25:47] 193400032 09.17 0.000930310713 +[2023-10-17 02:25:52] 193400032 09.16 0.000930211183 +[2023-10-17 02:25:57] 193400032 09.17 0.000930204334 +[2023-10-17 02:26:02] 193400032 09.16 0.000930247423 +[2023-10-17 02:26:07] 193400032 09.15 0.000930317130 +[2023-10-17 02:26:12] 193400032 09.14 0.000930220457 +[2023-10-17 02:26:17] 193400032 09.15 0.000930276138 +[2023-10-17 02:26:22] 193400032 09.14 0.000930362865 +[2023-10-17 02:26:27] 193400032 09.14 0.000930434537 +[2023-10-17 02:26:32] 193400032 09.13 0.000930326013 +[2023-10-17 02:26:37] 193400032 09.12 0.000930233611 +[2023-10-17 02:26:42] 193400032 09.11 0.000930246977 +[2023-10-17 02:26:47] 193400032 09.10 0.000930313001 +[2023-10-17 02:26:52] 193400032 09.09 0.000930483642 +[2023-10-17 02:26:57] 193400032 09.08 0.000930400909 +[2023-10-17 02:27:02] 193400032 09.07 0.000930464098 +[2023-10-17 02:27:07] 193400032 09.06 0.000930407499 +[2023-10-17 02:27:12] 193400032 09.05 0.000930553397 +[2023-10-17 02:27:17] 193400032 09.05 0.000930473033 +[2023-10-17 02:27:22] 193400032 09.05 0.000930569137 +[2023-10-17 02:27:27] 193400032 09.04 0.000930474624 +[2023-10-17 02:27:32] 193400032 09.05 0.000930595783 +[2023-10-17 02:27:37] 193400032 09.05 0.000930585062 +[2023-10-17 02:27:42] 193400032 09.05 0.000930468003 +[2023-10-17 02:27:47] 193400032 09.05 0.000930516776 +[2023-10-17 02:27:52] 193400032 09.05 0.000930510757 +[2023-10-17 02:27:57] 193400032 09.04 0.000930609221 +[2023-10-17 02:28:02] 193400032 09.03 0.000930556122 +[2023-10-17 02:28:07] 193400032 09.03 0.000930555333 +[2023-10-17 02:28:12] 193400032 09.02 0.000930551411 +[2023-10-17 02:28:17] 193400032 09.02 0.000930578537 +[2023-10-17 02:28:22] 193400032 09.02 0.000930532800 +[2023-10-17 02:28:27] 193400032 09.01 0.000930662427 +[2023-10-17 02:28:32] 193400032 09.00 0.000930629286 +[2023-10-17 02:28:37] 193400032 08.99 0.000930803254 +[2023-10-17 02:28:42] 193400032 08.98 0.000930681196 +[2023-10-17 02:28:47] 193400032 08.96 0.000930663379 +[2023-10-17 02:28:52] 193400032 08.95 0.000930720746 +[2023-10-17 02:28:57] 193400032 08.95 0.000930689805 +[2023-10-17 02:29:02] 193400032 08.94 0.000930735057 +[2023-10-17 02:29:07] 193400032 08.93 0.000930761975 +[2023-10-17 02:29:12] 193400032 08.93 0.000930617046 +[2023-10-17 02:29:17] 193400032 08.93 0.000930736727 +[2023-10-17 02:29:22] 193400032 08.93 0.000930791976 +[2023-10-17 02:29:27] 193400032 08.92 0.000930910241 +[2023-10-17 02:29:32] 193400032 08.92 0.000930866381 +[2023-10-17 02:29:37] 193400032 08.92 0.000930830991 +[2023-10-17 02:29:43] 193400032 08.91 0.000930757907 +[2023-10-17 02:29:48] 193400032 08.90 0.000930771404 +[2023-10-17 02:29:53] 193400032 08.89 0.000930904758 +[2023-10-17 02:29:58] 193400032 08.89 0.000930954635 +[2023-10-17 02:30:03] 193400032 08.89 0.000930951087 +[2023-10-17 02:30:08] 193400032 08.89 0.000930823733 +[2023-10-17 02:30:13] 193400032 08.89 0.000930948597 +[2023-10-17 02:30:18] 193400032 08.89 0.000930907639 +[2023-10-17 02:30:23] 193400032 08.88 0.000931060394 +[2023-10-17 02:30:28] 193400032 08.88 0.000931080500 +[2023-10-17 02:30:33] 193400032 08.87 0.000931010404 +[2023-10-17 02:30:38] 193400032 08.86 0.000931006878 +[2023-10-17 02:30:43] 193400032 08.86 0.000931035419 +[2023-10-17 02:30:48] 193400032 08.84 0.000931077276 +[2023-10-17 02:30:53] 193400032 08.83 0.000931160548 +[2023-10-17 02:30:58] 193400032 08.82 0.000931043132 +[2023-10-17 02:31:03] 193400032 08.81 0.000931067474 +[2023-10-17 02:31:08] 193400032 08.80 0.000930977353 +[2023-10-17 02:31:13] 193400032 08.79 0.000931157173 +[2023-10-17 02:31:18] 193400032 08.79 0.000931147552 +[2023-10-17 02:31:23] 193400032 08.78 0.000930995224 +[2023-10-17 02:31:28] 193400032 08.77 0.000931168745 +[2023-10-17 02:31:33] 193400032 08.76 0.000931123223 +[2023-10-17 02:31:38] 193400032 08.76 0.000931252913 +[2023-10-17 02:31:43] 193400032 08.76 0.000931137329 +[2023-10-17 02:31:48] 193400032 08.76 0.000931156592 +[2023-10-17 02:31:53] 193400032 08.76 0.000931128027 +[2023-10-17 02:31:58] 193400032 08.77 0.000931168570 +[2023-10-17 02:32:03] 193400032 08.77 0.000931151678 +[2023-10-17 02:32:08] 193400032 08.77 0.000931259206 +[2023-10-17 02:32:13] 193400032 08.76 0.000931357928 +[2023-10-17 02:32:18] 193400032 08.76 0.000931271276 +[2023-10-17 02:32:23] 193400032 08.75 0.000931239484 +[2023-10-17 02:32:28] 193400032 08.74 0.000931288487 +[2023-10-17 02:32:33] 193400032 08.73 0.000931238841 +[2023-10-17 02:32:38] 193400032 08.73 0.000931312109 +[2023-10-17 02:32:43] 193400032 08.72 0.000931285715 +[2023-10-17 02:32:48] 193400032 08.70 0.000931252385 +[2023-10-17 02:32:53] 193400032 08.70 0.000931380158 +[2023-10-17 02:32:58] 193400032 08.69 0.000931440484 +[2023-10-17 02:33:03] 193400032 08.69 0.000931469115 +[2023-10-17 02:33:08] 193400032 08.68 0.000931438508 +[2023-10-17 02:33:13] 193400032 08.67 0.000931416714 +[2023-10-17 02:33:18] 193400032 08.66 0.000931483559 +[2023-10-17 02:33:23] 193400032 08.66 0.000931391856 +[2023-10-17 02:33:28] 193400032 08.66 0.000931525008 +[2023-10-17 02:33:33] 193400032 08.66 0.000931471373 +[2023-10-17 02:33:38] 193400032 08.64 0.000931485478 +[2023-10-17 02:33:43] 193400032 08.64 0.000931499583 +[2023-10-17 02:33:48] 193400032 08.63 0.000931623403 +[2023-10-17 02:33:53] 193400032 08.63 0.000931611454 +[2023-10-17 02:33:58] 193400032 08.63 0.000931525987 +[2023-10-17 02:34:03] 193400032 08.62 0.000931506093 +[2023-10-17 02:34:08] 193400032 08.62 0.000931565995 +[2023-10-17 02:34:13] 193400032 08.61 0.000931493550 +[2023-10-17 02:34:18] 193400032 08.61 0.000931606373 +[2023-10-17 02:34:23] 193400032 08.61 0.000931542140 +[2023-10-17 02:34:28] 193400032 08.60 0.000931482679 +[2023-10-17 02:34:33] 193400032 08.60 0.000931506643 +[2023-10-17 02:34:38] 193400032 08.60 0.000931550128 +[2023-10-17 02:34:43] 193400032 08.60 0.000931626759 +[2023-10-17 02:34:48] 193400032 08.59 0.000931695748 +[2023-10-17 02:34:53] 193400032 08.58 0.000931599597 +[2023-10-17 02:34:58] 193400032 08.58 0.000931669190 +[2023-10-17 02:35:03] 193400032 08.57 0.000931771318 +[2023-10-17 02:35:08] 193400032 08.56 0.000931794171 +[2023-10-17 02:35:13] 193400032 08.56 0.000931781119 +[2023-10-17 02:35:18] 193400032 08.55 0.000931833633 +[2023-10-17 02:35:23] 193400032 08.54 0.000931762294 +[2023-10-17 02:35:28] 193400032 08.53 0.000931775506 +[2023-10-17 02:35:33] 193400032 08.53 0.000931872034 +[2023-10-17 02:35:38] 193400032 08.51 0.000931796028 +[2023-10-17 02:35:43] 193400032 08.50 0.000931884086 +[2023-10-17 02:35:48] 193400032 08.50 0.000931827531 +[2023-10-17 02:35:53] 193400032 08.50 0.000931840460 +[2023-10-17 02:35:58] 193400032 08.49 0.000931879795 +[2023-10-17 02:36:03] 193400032 08.49 0.000931976009 +[2023-10-17 02:36:08] 193400032 08.49 0.000931766589 +[2023-10-17 02:36:13] 193400032 08.48 0.000931927090 +[2023-10-17 02:36:18] 193400032 08.49 0.000931893115 +[2023-10-17 02:36:23] 193400032 08.49 0.000931916737 +[2023-10-17 02:36:28] 193400032 08.48 0.000931910652 +[2023-10-17 02:36:33] 193400032 08.49 0.000931963825 +[2023-10-17 02:36:38] 193400032 08.49 0.000931926098 +[2023-10-17 02:36:43] 193400032 08.47 0.000932062864 +[2023-10-17 02:36:48] 193400032 08.47 0.000932097821 +[2023-10-17 02:36:53] 193400032 08.46 0.000932071302 +[2023-10-17 02:36:58] 193400032 08.45 0.000932018932 +[2023-10-17 02:37:03] 193400032 08.44 0.000932030098 +[2023-10-17 02:37:08] 193400032 08.44 0.000932100691 +[2023-10-17 02:37:13] 193400032 08.43 0.000931968332 +[2023-10-17 02:37:18] 193400032 08.43 0.000932147112 +[2023-10-17 02:37:23] 193400032 08.42 0.000932114829 +[2023-10-17 02:37:28] 193400032 08.41 0.000931960341 +[2023-10-17 02:37:33] 193400032 08.40 0.000932071888 +[2023-10-17 02:37:38] 193400032 08.40 0.000932090795 +[2023-10-17 02:37:43] 193400032 08.39 0.000932181111 +[2023-10-17 02:37:48] 193400032 08.38 0.000932136476 +[2023-10-17 02:37:53] 193400032 08.37 0.000932199771 +[2023-10-17 02:37:58] 193400032 08.36 0.000932193093 +[2023-10-17 02:38:03] 193400032 08.36 0.000932027376 +[2023-10-17 02:38:08] 193400032 08.36 0.000932106434 +[2023-10-17 02:38:13] 193400032 08.35 0.000932132653 +[2023-10-17 02:38:18] 193400032 08.34 0.000932283138 +[2023-10-17 02:38:23] 193400032 08.34 0.000932192983 +[2023-10-17 02:38:28] 193400032 08.34 0.000932217208 +[2023-10-17 02:38:33] 193400032 08.34 0.000932270219 +[2023-10-17 02:38:38] 193400032 08.34 0.000932282157 +[2023-10-17 02:38:43] 193400032 08.34 0.000932219150 +[2023-10-17 02:38:48] 193400032 08.34 0.000932322893 +[2023-10-17 02:38:53] 193400032 08.33 0.000932340140 +[2023-10-17 02:38:58] 193400032 08.33 0.000932367856 +[2023-10-17 02:39:03] 193400032 08.32 0.000932329639 +[2023-10-17 02:39:08] 193400032 08.32 0.000932271609 +[2023-10-17 02:39:13] 193400032 08.32 0.000932288420 +[2023-10-17 02:39:18] 193400032 08.31 0.000932420178 +[2023-10-17 02:39:23] 193400032 08.30 0.000932403381 +[2023-10-17 02:39:28] 193400032 08.30 0.000932307883 +[2023-10-17 02:39:33] 193400032 08.29 0.000932376972 +[2023-10-17 02:39:38] 193400032 08.28 0.000932318002 +[2023-10-17 02:39:43] 193400032 08.27 0.000932478358 +[2023-10-17 02:39:48] 193400032 08.27 0.000932402768 +[2023-10-17 02:39:53] 193400032 08.26 0.000932427007 +[2023-10-17 02:39:58] 193400032 08.26 0.000932547385 +[2023-10-17 02:40:03] 193400032 08.25 0.000932477353 +[2023-10-17 02:40:08] 193400032 08.24 0.000932429091 +[2023-10-17 02:40:13] 193400032 08.23 0.000932594157 +[2023-10-17 02:40:18] 193400032 08.23 0.000932553099 +[2023-10-17 02:40:23] 193400032 08.22 0.000932497459 +[2023-10-17 02:40:28] 193400032 08.22 0.000932459230 +[2023-10-17 02:40:33] 193400032 08.22 0.000932665140 +[2023-10-17 02:40:38] 193400032 08.22 0.000932675210 +[2023-10-17 02:40:44] 193400032 08.22 0.000932640512 +[2023-10-17 02:40:49] 193400032 08.21 0.000932678066 +[2023-10-17 02:40:54] 193400032 08.21 0.000932665140 +[2023-10-17 02:40:59] 193400032 08.21 0.000932617231 +[2023-10-17 02:41:04] 193400032 08.21 0.000932711961 +[2023-10-17 02:41:09] 193400032 08.20 0.000932652539 +[2023-10-17 02:41:14] 193400032 08.18 0.000932651123 +[2023-10-17 02:41:19] 193400032 08.18 0.000932687844 +[2023-10-17 02:41:24] 193400032 08.17 0.000932659174 +[2023-10-17 02:41:29] 193400032 08.17 0.000932691283 +[2023-10-17 02:41:34] 193400032 08.16 0.000932706172 +[2023-10-17 02:41:39] 193400032 08.15 0.000932778074 diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_messurements.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400032_messurements.txt new file mode 100644 index 00000000..e69de29b diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_aggregations.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_aggregations.txt new file mode 100644 index 00000000..8c81ea53 --- /dev/null +++ b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_aggregations.txt @@ -0,0 +1,63 @@ +193400261 6.02 0.0009392425 6.03 0.0009411937 6.05 0.0009416988 0.03 0.0000024563 576 +193400261 6.01 0.0009393319 6.02 0.0009412432 6.04 0.0009431653 0.03 0.0000038333 566 +193400261 6.09 0.0009387801 6.13 0.0009405516 6.18 0.0009425985 0.09 0.0000038184 565 +193400261 6.28 0.0009381984 6.34 0.0009400291 6.38 0.0009420317 0.10 0.0000038333 565 +193400261 6.49 0.0009377807 6.54 0.0009396311 6.59 0.0009415991 0.10 0.0000038184 551 +193400261 6.68 0.0009374377 6.73 0.0009393290 6.77 0.0009412710 0.09 0.0000038333 544 +193400261 6.85 0.0009371990 6.89 0.0009390768 6.93 0.0009410174 0.08 0.0000038184 560 +193400261 7.01 0.0009369753 7.05 0.0009388430 7.08 0.0009408086 0.07 0.0000038333 559 +193400261 7.15 0.0009367664 7.17 0.0009386809 7.20 0.0009405998 0.05 0.0000038333 561 +193400261 7.25 0.0009365875 7.27 0.0009385313 7.30 0.0009404506 0.05 0.0000038632 528 +193400261 7.33 0.0009364830 7.36 0.0009383757 7.39 0.0009403164 0.06 0.0000038333 569 +193400261 7.48 0.0009363786 7.56 0.0009382420 7.62 0.0009401971 0.14 0.0000038184 547 +193400261 7.77 0.0009362444 7.82 0.0009381664 7.88 0.0009400927 0.11 0.0000038483 445 +193400261 8.00 0.0009361996 8.05 0.0009381043 8.11 0.0009400181 0.11 0.0000038184 564 +193400261 8.23 0.0009361102 8.28 0.0009379931 8.34 0.0009399286 0.11 0.0000038184 541 +193400261 8.45 0.0009360505 8.50 0.0009379356 8.54 0.0009398689 0.09 0.0000038184 533 +193400261 8.66 0.0009359759 8.70 0.0009378712 8.74 0.0009398093 0.08 0.0000038333 449 +193400261 9.01 0.0009359163 9.04 0.0009377975 9.08 0.0009397496 0.07 0.0000038333 469 +193400261 9.62 0.0009367090 9.68 0.0009373762 9.75 0.0009393618 0.13 0.0000026528 587 +193400261 9.90 0.0009352301 9.95 0.0009370899 10.01 0.0009390486 0.11 0.0000038184 531 +193400261 10.14 0.0009350064 10.20 0.0009368401 10.25 0.0009388248 0.11 0.0000038184 555 +193400261 10.38 0.0009347379 10.41 0.0009366516 10.44 0.0009385862 0.06 0.0000038483 256 +193400261 10.57 0.0009352372 10.62 0.0009365810 10.67 0.0009385414 0.10 0.0000033042 585 +193400261 10.78 0.0009344843 10.80 0.0009364646 10.82 0.0009383177 0.04 0.0000038333 233 +193400261 10.98 0.0009344843 11.02 0.0009363802 11.06 0.0009385316 0.08 0.0000040473 642 +193400261 11.15 0.0009343054 11.23 0.0009361851 11.30 0.0009381238 0.15 0.0000038184 552 +193400261 11.42 0.0009341264 11.49 0.0009360142 11.57 0.0009379597 0.15 0.0000038333 529 +193400261 11.71 0.0009339623 11.77 0.0009359739 11.83 0.0009377956 0.12 0.0000038333 328 +193400261 12.00 0.0009339474 12.07 0.0009358156 12.13 0.0009377807 0.13 0.0000038333 585 +193400261 12.26 0.0009338131 12.29 0.0009356585 12.32 0.0009376465 0.06 0.0000038333 209 +193400261 12.96 0.0009337535 12.99 0.0009357100 13.04 0.0009376465 0.08 0.0000038930 819 +193400261 13.14 0.0009336789 13.18 0.0009356075 13.24 0.0009374973 0.10 0.0000038184 229 +193400261 13.40 0.0009341445 13.48 0.0009355429 13.54 0.0009374824 0.14 0.0000033379 584 +193400261 13.69 0.0009335447 13.75 0.0009353696 13.81 0.0009373780 0.12 0.0000038333 335 +193400261 14.05 0.0009335148 14.07 0.0009353909 14.10 0.0009373631 0.05 0.0000038483 304 +193400261 14.22 0.0009334701 14.24 0.0009353549 14.26 0.0009372885 0.04 0.0000038184 198 +193400261 14.43 0.0009334402 14.48 0.0009353251 14.54 0.0009371464 0.11 0.0000037061 584 +193400261 15.88 0.0009333209 15.92 0.0009352583 16.02 0.0009371543 0.14 0.0000038333 1180 +193400261 17.11 0.0009331867 17.13 0.0009350471 17.16 0.0009370200 0.05 0.0000038333 199 +193400261 17.36 0.0009331419 17.44 0.0009351012 17.52 0.0009371924 0.16 0.0000040504 585 +193400261 17.66 0.0009330972 17.73 0.0009350828 17.79 0.0009369454 0.13 0.0000038483 482 +193400261 17.95 0.0009330673 18.00 0.0009349876 18.07 0.0009369007 0.12 0.0000038333 348 +193400261 18.26 0.0009330226 18.28 0.0009350013 18.31 0.0009368858 0.05 0.0000038632 307 +193400261 18.48 0.0009329779 19.12 0.0009348957 19.23 0.0009368261 0.75 0.0000038483 1029 +193400261 19.67 0.0009328884 19.73 0.0009347954 19.81 0.0009367664 0.14 0.0000038781 706 +193400261 20.25 0.0009328436 20.30 0.0009347765 20.37 0.0009367068 0.12 0.0000038632 691 +193400261 20.85 0.0009328138 20.87 0.0009347445 20.90 0.0009366471 0.05 0.0000038333 430 +193400261 21.00 0.0009327840 21.01 0.0009347230 21.03 0.0009366024 0.03 0.0000038184 120 +193400261 21.40 0.0009327541 21.46 0.0009347010 21.54 0.0009366024 0.14 0.0000038483 629 +193400261 21.69 0.0009327094 21.77 0.0009346280 21.83 0.0009365576 0.14 0.0000038483 560 +193400261 22.87 0.0009326199 22.91 0.0009345334 22.96 0.0009364532 0.09 0.0000038333 587 +193400261 23.58 0.0009325751 23.66 0.0009344785 23.74 0.0009364234 0.16 0.0000038483 571 +193400261 24.91 0.0009325006 24.95 0.0009344148 24.98 0.0009363339 0.07 0.0000038333 580 +193400261 25.06 0.0009324558 25.38 0.0009344330 25.46 0.0009363041 0.40 0.0000038483 698 +193400261 26.23 0.0009324111 26.73 0.0009343240 26.82 0.0009362593 0.59 0.0000038483 921 +193400261 27.63 0.0009323663 27.70 0.0009343291 27.76 0.0009362146 0.13 0.0000038483 535 +193400261 28.15 0.0009323365 28.21 0.0009342437 28.27 0.0009361698 0.12 0.0000038333 677 +193400261 28.97 0.0009322917 29.02 0.0009342231 29.07 0.0009361400 0.10 0.0000038483 583 +193400261 29.86 0.0009322768 29.92 0.0009341635 29.98 0.0009361102 0.12 0.0000038333 562 +193400261 30.12 0.0009322619 30.17 0.0009342142 30.22 0.0009360803 0.10 0.0000038184 266 +193400261 31.99 0.0009322172 32.05 0.0009341761 32.12 0.0009362788 0.13 0.0000040616 716 +193400261 33.17 0.0009322022 33.22 0.0009341488 33.32 0.0009360356 0.15 0.0000038333 1039 +193400261 34.14 0.0009321724 34.19 0.0009341249 34.25 0.0009360057 0.11 0.0000038333 882 diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_backwards.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_backwards.txt new file mode 100644 index 00000000..648eeb20 --- /dev/null +++ b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_backwards.txt @@ -0,0 +1,1568 @@ +[2023-10-19 04:42:57] 193400261 34.43 0.000892612663 +[2023-10-19 04:43:07] 193400261 34.41 0.000892539877 +[2023-10-19 04:43:17] 193400261 34.38 0.000892615250 +[2023-10-19 04:43:27] 193400261 34.35 0.000892627198 +[2023-10-19 04:43:37] 193400261 34.30 0.000892657009 +[2023-10-19 04:43:47] 193400261 34.25 0.000892653436 +[2023-10-19 04:43:57] 193400261 34.21 0.000892823829 +[2023-10-19 04:44:07] 193400261 34.19 0.000892710656 +[2023-10-19 04:44:17] 193400261 34.17 0.000892852557 +[2023-10-19 04:44:27] 193400261 34.13 0.000892896158 +[2023-10-19 04:44:37] 193400261 34.06 0.000892864402 +[2023-10-19 04:44:47] 193400261 34.07 0.000892907528 +[2023-10-19 04:44:57] 193400261 33.89 0.000892930349 +[2023-10-19 04:45:07] 193400261 33.79 0.000893035028 +[2023-10-19 04:45:17] 193400261 33.79 0.000893009275 +[2023-10-19 04:45:27] 193400261 33.80 0.000893067378 +[2023-10-19 04:45:37] 193400261 33.80 0.000893099290 +[2023-10-19 04:45:47] 193400261 33.79 0.000893168010 +[2023-10-19 04:45:57] 193400261 33.76 0.000893117459 +[2023-10-19 04:46:07] 193400261 33.71 0.000893283678 +[2023-10-19 04:46:17] 193400261 33.68 0.000893327144 +[2023-10-19 04:46:27] 193400261 33.63 0.000893326175 +[2023-10-19 04:46:37] 193400261 33.58 0.000893389018 +[2023-10-19 04:46:47] 193400261 33.47 0.000893407912 +[2023-10-19 04:46:57] 193400261 33.43 0.000893404725 +[2023-10-19 04:47:08] 193400261 33.42 0.000893528603 +[2023-10-19 04:47:18] 193400261 33.29 0.000893561824 +[2023-10-19 04:47:28] 193400261 33.19 0.000893593158 +[2023-10-19 04:47:38] 193400261 33.28 0.000893656475 +[2023-10-19 04:47:48] 193400261 33.18 0.000893682796 +[2023-10-19 04:47:58] 193400261 33.15 0.000893690254 +[2023-10-19 04:48:08] 193400261 33.11 0.000893775949 +[2023-10-19 04:48:18] 193400261 33.07 0.000893812849 +[2023-10-19 04:48:28] 193400261 33.03 0.000893811517 +[2023-10-19 04:48:38] 193400261 32.98 0.000893903979 +[2023-10-19 04:48:48] 193400261 32.91 0.000893942069 +[2023-10-19 04:48:58] 193400261 32.81 0.000893954378 +[2023-10-19 04:49:08] 193400261 32.76 0.000894035640 +[2023-10-19 04:49:18] 193400261 32.75 0.000894111067 +[2023-10-19 04:49:28] 193400261 32.70 0.000894115642 +[2023-10-19 04:49:38] 193400261 32.62 0.000894173852 +[2023-10-19 04:49:48] 193400261 32.57 0.000894236874 +[2023-10-19 04:49:58] 193400261 32.54 0.000894250794 +[2023-10-19 04:50:08] 193400261 32.49 0.000894326109 +[2023-10-19 04:50:18] 193400261 32.39 0.000894404271 +[2023-10-19 04:50:28] 193400261 32.37 0.000894413376 +[2023-10-19 04:50:38] 193400261 32.32 0.000894486792 +[2023-10-19 04:50:48] 193400261 32.28 0.000894541025 +[2023-10-19 04:50:58] 193400261 32.23 0.000894536479 +[2023-10-19 04:51:08] 193400261 32.18 0.000894624423 +[2023-10-19 04:51:18] 193400261 32.13 0.000894687270 +[2023-10-19 04:51:28] 193400261 32.06 0.000894714143 +[2023-10-19 04:51:38] 193400261 31.99 0.000894782028 +[2023-10-19 04:51:48] 193400261 31.94 0.000894847903 +[2023-10-19 04:51:58] 193400261 31.91 0.000894835955 +[2023-10-19 04:52:08] 193400261 31.88 0.000894914989 +[2023-10-19 04:52:18] 193400261 31.82 0.000895011070 +[2023-10-19 04:52:28] 193400261 31.72 0.000895034590 +[2023-10-19 04:52:38] 193400261 31.70 0.000895057920 +[2023-10-19 04:52:48] 193400261 31.68 0.000895139500 +[2023-10-19 04:52:58] 193400261 31.59 0.000895157261 +[2023-10-19 04:53:08] 193400261 31.52 0.000895216081 +[2023-10-19 04:53:18] 193400261 31.49 0.000895329627 +[2023-10-19 04:53:28] 193400261 31.47 0.000895333113 +[2023-10-19 04:53:38] 193400261 31.43 0.000895387431 +[2023-10-19 04:53:48] 193400261 31.31 0.000895452148 +[2023-10-19 04:53:58] 193400261 31.28 0.000895509007 +[2023-10-19 04:54:08] 193400261 31.24 0.000895538253 +[2023-10-19 04:54:18] 193400261 31.19 0.000895595902 +[2023-10-19 04:54:28] 193400261 31.16 0.000895631639 +[2023-10-19 04:54:38] 193400261 31.12 0.000895685473 +[2023-10-19 04:54:48] 193400261 31.06 0.000895746395 +[2023-10-19 04:54:58] 193400261 31.03 0.000895775645 +[2023-10-19 04:55:08] 193400261 30.99 0.000895849053 +[2023-10-19 04:55:18] 193400261 30.94 0.000895903881 +[2023-10-19 04:55:28] 193400261 30.88 0.000895969086 +[2023-10-19 04:55:38] 193400261 30.84 0.000896022034 +[2023-10-19 04:55:48] 193400261 30.78 0.000896058248 +[2023-10-19 04:55:58] 193400261 30.72 0.000896130067 +[2023-10-19 04:56:08] 193400261 30.68 0.000896191237 +[2023-10-19 04:56:18] 193400261 30.64 0.000896260004 +[2023-10-19 04:56:28] 193400261 30.59 0.000896217886 +[2023-10-19 04:56:38] 193400261 30.52 0.000896301798 +[2023-10-19 04:56:48] 193400261 30.46 0.000896495700 +[2023-10-19 04:56:58] 193400261 30.45 0.000896466155 +[2023-10-19 04:57:08] 193400261 30.44 0.000896461423 +[2023-10-19 04:57:18] 193400261 30.40 0.000896505934 +[2023-10-19 04:57:28] 193400261 30.33 0.000896623321 +[2023-10-19 04:57:38] 193400261 30.27 0.000896583028 +[2023-10-19 04:57:48] 193400261 30.22 0.000896690094 +[2023-10-19 04:57:58] 193400261 30.17 0.000896727588 +[2023-10-19 04:58:08] 193400261 30.13 0.000896789947 +[2023-10-19 04:58:18] 193400261 30.09 0.000896834313 +[2023-10-19 04:58:28] 193400261 30.07 0.000896857578 +[2023-10-19 04:58:38] 193400261 30.05 0.000896887993 +[2023-10-19 04:58:48] 193400261 29.95 0.000896972957 +[2023-10-19 04:58:58] 193400261 29.89 0.000897085392 +[2023-10-19 04:59:08] 193400261 29.87 0.000897128849 +[2023-10-19 04:59:18] 193400261 29.85 0.000897142398 +[2023-10-19 04:59:28] 193400261 29.75 0.000897232542 +[2023-10-19 04:59:38] 193400261 29.71 0.000897230755 +[2023-10-19 04:59:48] 193400261 29.67 0.000897336891 +[2023-10-19 04:59:58] 193400261 29.63 0.000897440722 +[2023-10-19 05:00:08] 193400261 29.61 0.000897424659 +[2023-10-19 05:00:18] 193400261 29.59 0.000897548503 +[2023-10-19 05:00:28] 193400261 29.53 0.000897483753 +[2023-10-19 05:00:38] 193400261 29.42 0.000897528033 +[2023-10-19 05:00:48] 193400261 29.39 0.000897611907 +[2023-10-19 05:00:58] 193400261 29.39 0.000897628477 +[2023-10-19 05:01:08] 193400261 29.36 0.000897718780 +[2023-10-19 05:01:18] 193400261 29.31 0.000897800504 +[2023-10-19 05:01:28] 193400261 29.27 0.000897906542 +[2023-10-19 05:01:38] 193400261 29.24 0.000897865909 +[2023-10-19 05:01:48] 193400261 29.19 0.000897926191 +[2023-10-19 05:01:58] 193400261 29.13 0.000898063408 +[2023-10-19 05:02:08] 193400261 29.08 0.000898046442 +[2023-10-19 05:02:18] 193400261 29.04 0.000898116322 +[2023-10-19 05:02:28] 193400261 29.01 0.000898227261 +[2023-10-19 05:02:38] 193400261 29.00 0.000898176183 +[2023-10-19 05:02:48] 193400261 28.89 0.000898226352 +[2023-10-19 05:02:58] 193400261 28.84 0.000898317971 +[2023-10-19 05:03:08] 193400261 28.83 0.000898310496 +[2023-10-19 05:03:18] 193400261 28.83 0.000898340565 +[2023-10-19 05:03:28] 193400261 28.76 0.000898452545 +[2023-10-19 05:03:38] 193400261 28.71 0.000898474151 +[2023-10-19 05:03:48] 193400261 28.68 0.000898450077 +[2023-10-19 05:03:58] 193400261 28.64 0.000898557041 +[2023-10-19 05:04:08] 193400261 28.58 0.000898685209 +[2023-10-19 05:04:18] 193400261 28.52 0.000898695665 +[2023-10-19 05:04:28] 193400261 28.49 0.000898700340 +[2023-10-19 05:04:38] 193400261 28.47 0.000898831678 +[2023-10-19 05:04:48] 193400261 28.42 0.000898879242 +[2023-10-19 05:04:58] 193400261 28.36 0.000898879451 +[2023-10-19 05:05:08] 193400261 28.31 0.000898911123 +[2023-10-19 05:05:18] 193400261 28.29 0.000898909547 +[2023-10-19 05:05:28] 193400261 28.28 0.000899089751 +[2023-10-19 05:05:38] 193400261 28.24 0.000899065401 +[2023-10-19 05:05:48] 193400261 28.15 0.000899176810 +[2023-10-19 05:05:58] 193400261 28.12 0.000899251572 +[2023-10-19 05:06:08] 193400261 28.10 0.000899272863 +[2023-10-19 05:06:18] 193400261 28.05 0.000899309584 +[2023-10-19 05:06:28] 193400261 28.00 0.000899393868 +[2023-10-19 05:06:38] 193400261 27.96 0.000899357673 +[2023-10-19 05:06:49] 193400261 27.94 0.000899439491 +[2023-10-19 05:06:59] 193400261 27.89 0.000899500373 +[2023-10-19 05:07:09] 193400261 27.85 0.000899603488 +[2023-10-19 05:07:19] 193400261 27.82 0.000899555638 +[2023-10-19 05:07:29] 193400261 27.79 0.000899677592 +[2023-10-19 05:07:39] 193400261 27.75 0.000899777345 +[2023-10-19 05:07:49] 193400261 27.71 0.000899771458 +[2023-10-19 05:07:59] 193400261 27.68 0.000899834787 +[2023-10-19 05:08:09] 193400261 27.64 0.000899875112 +[2023-10-19 05:08:19] 193400261 27.58 0.000899898792 +[2023-10-19 05:08:29] 193400261 27.49 0.000899876998 +[2023-10-19 05:08:39] 193400261 27.47 0.000899964538 +[2023-10-19 05:08:49] 193400261 27.47 0.000900004571 +[2023-10-19 05:08:59] 193400261 27.44 0.000900057229 +[2023-10-19 05:09:09] 193400261 27.38 0.000900071963 +[2023-10-19 05:09:19] 193400261 27.33 0.000900216110 +[2023-10-19 05:09:29] 193400261 27.31 0.000900141520 +[2023-10-19 05:09:39] 193400261 27.30 0.000900258825 +[2023-10-19 05:09:49] 193400261 27.23 0.000900279750 +[2023-10-19 05:09:59] 193400261 27.17 0.000900432605 +[2023-10-19 05:10:09] 193400261 27.15 0.000900435499 +[2023-10-19 05:10:19] 193400261 27.13 0.000900404761 +[2023-10-19 05:10:29] 193400261 27.08 0.000900525206 +[2023-10-19 05:10:39] 193400261 26.96 0.000900477801 +[2023-10-19 05:10:49] 193400261 26.94 0.000900676575 +[2023-10-19 05:10:59] 193400261 26.97 0.000900676211 +[2023-10-19 05:11:09] 193400261 26.96 0.000900750222 +[2023-10-19 05:11:19] 193400261 26.89 0.000900694869 +[2023-10-19 05:11:29] 193400261 26.81 0.000900777687 +[2023-10-19 05:11:39] 193400261 26.79 0.000900916589 +[2023-10-19 05:11:49] 193400261 26.79 0.000900909635 +[2023-10-19 05:11:59] 193400261 26.74 0.000901008963 +[2023-10-19 05:12:09] 193400261 26.66 0.000900893796 +[2023-10-19 05:12:19] 193400261 26.62 0.000901058293 +[2023-10-19 05:12:29] 193400261 26.60 0.000901077298 +[2023-10-19 05:12:39] 193400261 26.60 0.000901094703 +[2023-10-19 05:12:49] 193400261 26.55 0.000901212985 +[2023-10-19 05:12:59] 193400261 26.50 0.000901153872 +[2023-10-19 05:13:09] 193400261 26.45 0.000901331883 +[2023-10-19 05:13:19] 193400261 26.43 0.000901274024 +[2023-10-19 05:13:29] 193400261 26.40 0.000901329384 +[2023-10-19 05:13:39] 193400261 26.35 0.000901533663 +[2023-10-19 05:13:49] 193400261 26.30 0.000901478039 +[2023-10-19 05:13:59] 193400261 26.28 0.000901591501 +[2023-10-19 05:14:09] 193400261 26.24 0.000901603390 +[2023-10-19 05:14:19] 193400261 26.20 0.000901681209 +[2023-10-19 05:14:29] 193400261 26.17 0.000901719989 +[2023-10-19 05:14:39] 193400261 26.15 0.000901653846 +[2023-10-19 05:14:49] 193400261 26.09 0.000901767578 +[2023-10-19 05:14:59] 193400261 26.04 0.000901804413 +[2023-10-19 05:15:09] 193400261 26.00 0.000901910933 +[2023-10-19 05:15:19] 193400261 25.99 0.000901934761 +[2023-10-19 05:15:29] 193400261 25.97 0.000901933342 +[2023-10-19 05:15:39] 193400261 25.92 0.000902059340 +[2023-10-19 05:15:49] 193400261 25.83 0.000901969481 +[2023-10-19 05:15:59] 193400261 25.81 0.000902126586 +[2023-10-19 05:16:09] 193400261 25.80 0.000902163689 +[2023-10-19 05:16:19] 193400261 25.77 0.000902211825 +[2023-10-19 05:16:29] 193400261 25.73 0.000902151049 +[2023-10-19 05:16:39] 193400261 25.67 0.000902266206 +[2023-10-19 05:16:49] 193400261 25.65 0.000902235980 +[2023-10-19 05:16:59] 193400261 25.61 0.000902407828 +[2023-10-19 05:17:09] 193400261 25.60 0.000902493779 +[2023-10-19 05:17:19] 193400261 25.58 0.000902495929 +[2023-10-19 05:17:29] 193400261 25.53 0.000902511740 +[2023-10-19 05:17:39] 193400261 25.48 0.000902510558 +[2023-10-19 05:17:49] 193400261 25.43 0.000902651804 +[2023-10-19 05:17:59] 193400261 25.39 0.000902635434 +[2023-10-19 05:18:09] 193400261 25.35 0.000902808686 +[2023-10-19 05:18:19] 193400261 25.33 0.000902829709 +[2023-10-19 05:18:29] 193400261 25.31 0.000902890059 +[2023-10-19 05:18:39] 193400261 25.29 0.000902945554 +[2023-10-19 05:18:49] 193400261 25.26 0.000902906778 +[2023-10-19 05:18:59] 193400261 25.19 0.000903006011 +[2023-10-19 05:19:09] 193400261 25.14 0.000903050857 +[2023-10-19 05:19:19] 193400261 25.10 0.000903082987 +[2023-10-19 05:19:29] 193400261 25.08 0.000903057542 +[2023-10-19 05:19:39] 193400261 25.08 0.000903141491 +[2023-10-19 05:19:49] 193400261 25.06 0.000903268325 +[2023-10-19 05:19:59] 193400261 24.97 0.000903224453 +[2023-10-19 05:20:09] 193400261 24.94 0.000903294976 +[2023-10-19 05:20:19] 193400261 24.92 0.000903372908 +[2023-10-19 05:20:29] 193400261 24.87 0.000903430313 +[2023-10-19 05:20:39] 193400261 24.83 0.000903439210 +[2023-10-19 05:20:49] 193400261 24.83 0.000903456657 +[2023-10-19 05:20:59] 193400261 24.81 0.000903529705 +[2023-10-19 05:21:09] 193400261 24.76 0.000903677399 +[2023-10-19 05:21:19] 193400261 24.67 0.000903639191 +[2023-10-19 05:21:29] 193400261 24.65 0.000903706773 +[2023-10-19 05:21:39] 193400261 24.66 0.000903785885 +[2023-10-19 05:21:49] 193400261 24.62 0.000903803132 +[2023-10-19 05:21:59] 193400261 24.57 0.000903831547 +[2023-10-19 05:22:09] 193400261 24.54 0.000903802490 +[2023-10-19 05:22:19] 193400261 24.51 0.000903864431 +[2023-10-19 05:22:29] 193400261 24.47 0.000903930890 +[2023-10-19 05:22:39] 193400261 24.43 0.000903951450 +[2023-10-19 05:22:49] 193400261 24.40 0.000904123890 +[2023-10-19 05:22:59] 193400261 24.39 0.000904114537 +[2023-10-19 05:23:09] 193400261 24.38 0.000904216046 +[2023-10-19 05:23:19] 193400261 24.28 0.000904197770 +[2023-10-19 05:23:29] 193400261 24.24 0.000904257302 +[2023-10-19 05:23:39] 193400261 24.23 0.000904329103 +[2023-10-19 05:23:49] 193400261 24.19 0.000904321572 +[2023-10-19 05:23:59] 193400261 24.14 0.000904344938 +[2023-10-19 05:24:09] 193400261 24.12 0.000904442349 +[2023-10-19 05:24:19] 193400261 24.12 0.000904560644 +[2023-10-19 05:24:29] 193400261 24.07 0.000904497780 +[2023-10-19 05:24:39] 193400261 24.04 0.000904534660 +[2023-10-19 05:24:49] 193400261 24.00 0.000904691165 +[2023-10-19 05:24:59] 193400261 23.97 0.000904578191 +[2023-10-19 05:25:09] 193400261 23.91 0.000904647307 +[2023-10-19 05:25:19] 193400261 23.86 0.000904711394 +[2023-10-19 05:25:29] 193400261 23.86 0.000904819664 +[2023-10-19 05:25:39] 193400261 23.87 0.000904757167 +[2023-10-19 05:25:49] 193400261 23.83 0.000904890296 +[2023-10-19 05:25:59] 193400261 23.74 0.000904942422 +[2023-10-19 05:26:09] 193400261 23.71 0.000905024920 +[2023-10-19 05:26:19] 193400261 23.71 0.000905067495 +[2023-10-19 05:26:29] 193400261 23.69 0.000905061046 +[2023-10-19 05:26:39] 193400261 23.64 0.000905118003 +[2023-10-19 05:26:50] 193400261 23.58 0.000905244512 +[2023-10-19 05:27:00] 193400261 23.56 0.000905203961 +[2023-10-19 05:27:10] 193400261 23.56 0.000905212870 +[2023-10-19 05:27:20] 193400261 23.54 0.000905290463 +[2023-10-19 05:27:30] 193400261 23.52 0.000905364124 +[2023-10-19 05:27:40] 193400261 23.43 0.000905357443 +[2023-10-19 05:27:50] 193400261 23.39 0.000905431646 +[2023-10-19 05:28:00] 193400261 23.38 0.000905504690 +[2023-10-19 05:28:10] 193400261 23.38 0.000905558347 +[2023-10-19 05:28:20] 193400261 23.35 0.000905666032 +[2023-10-19 05:28:30] 193400261 23.30 0.000905529826 +[2023-10-19 05:28:40] 193400261 23.25 0.000905586229 +[2023-10-19 05:28:50] 193400261 23.23 0.000905645726 +[2023-10-19 05:29:00] 193400261 23.22 0.000905733523 +[2023-10-19 05:29:10] 193400261 23.19 0.000905719176 +[2023-10-19 05:29:20] 193400261 23.14 0.000905864792 +[2023-10-19 05:29:30] 193400261 23.11 0.000905932004 +[2023-10-19 05:29:40] 193400261 23.09 0.000905952046 +[2023-10-19 05:29:50] 193400261 23.06 0.000905920650 +[2023-10-19 05:30:00] 193400261 23.01 0.000906111094 +[2023-10-19 05:30:10] 193400261 22.98 0.000905963873 +[2023-10-19 05:30:20] 193400261 22.95 0.000906119262 +[2023-10-19 05:30:30] 193400261 22.92 0.000906188930 +[2023-10-19 05:30:40] 193400261 22.89 0.000906215136 +[2023-10-19 05:30:50] 193400261 22.87 0.000906336845 +[2023-10-19 05:31:00] 193400261 22.84 0.000906310866 +[2023-10-19 05:31:10] 193400261 22.81 0.000906390977 +[2023-10-19 05:31:20] 193400261 22.78 0.000906390786 +[2023-10-19 05:31:30] 193400261 22.76 0.000906452317 +[2023-10-19 05:31:40] 193400261 22.71 0.000906407078 +[2023-10-19 05:31:50] 193400261 22.65 0.000906479460 +[2023-10-19 05:32:00] 193400261 22.64 0.000906614357 +[2023-10-19 05:32:10] 193400261 22.63 0.000906536051 +[2023-10-19 05:32:20] 193400261 22.59 0.000906654783 +[2023-10-19 05:32:30] 193400261 22.56 0.000906665676 +[2023-10-19 05:32:40] 193400261 22.53 0.000906700078 +[2023-10-19 05:32:50] 193400261 22.50 0.000906738745 +[2023-10-19 05:33:00] 193400261 22.46 0.000906789205 +[2023-10-19 05:33:10] 193400261 22.44 0.000906778143 +[2023-10-19 05:33:20] 193400261 22.42 0.000906866426 +[2023-10-19 05:33:30] 193400261 22.38 0.000907079525 +[2023-10-19 05:33:40] 193400261 22.33 0.000907038397 +[2023-10-19 05:33:50] 193400261 22.32 0.000906990757 +[2023-10-19 05:34:00] 193400261 22.33 0.000907121426 +[2023-10-19 05:34:10] 193400261 22.29 0.000907112686 +[2023-10-19 05:34:20] 193400261 22.22 0.000907144609 +[2023-10-19 05:34:30] 193400261 22.18 0.000907137477 +[2023-10-19 05:34:40] 193400261 22.16 0.000907220451 +[2023-10-19 05:34:50] 193400261 22.14 0.000907319717 +[2023-10-19 05:35:00] 193400261 22.13 0.000907393743 +[2023-10-19 05:35:10] 193400261 22.08 0.000907355414 +[2023-10-19 05:35:20] 193400261 22.04 0.000907491975 +[2023-10-19 05:35:30] 193400261 22.02 0.000907471673 +[2023-10-19 05:35:40] 193400261 22.00 0.000907550173 +[2023-10-19 05:35:50] 193400261 21.96 0.000907592948 +[2023-10-19 05:36:00] 193400261 21.91 0.000907543296 +[2023-10-19 05:36:10] 193400261 21.89 0.000907681384 +[2023-10-19 05:36:20] 193400261 21.89 0.000907716282 +[2023-10-19 05:36:30] 193400261 21.87 0.000907714144 +[2023-10-19 05:36:40] 193400261 21.83 0.000907842200 +[2023-10-19 05:36:50] 193400261 21.77 0.000907837843 +[2023-10-19 05:37:00] 193400261 21.72 0.000907905773 +[2023-10-19 05:37:10] 193400261 21.70 0.000907957039 +[2023-10-19 05:37:20] 193400261 21.71 0.000908026195 +[2023-10-19 05:37:30] 193400261 21.73 0.000908055025 +[2023-10-19 05:37:40] 193400261 21.68 0.000908012359 +[2023-10-19 05:37:50] 193400261 21.57 0.000907969343 +[2023-10-19 05:38:00] 193400261 21.54 0.000908187547 +[2023-10-19 05:38:10] 193400261 21.53 0.000908179564 +[2023-10-19 05:38:20] 193400261 21.51 0.000908221858 +[2023-10-19 05:38:30] 193400261 21.51 0.000908371376 +[2023-10-19 05:38:40] 193400261 21.52 0.000908391897 +[2023-10-19 05:38:50] 193400261 21.48 0.000908400853 +[2023-10-19 05:39:00] 193400261 21.39 0.000908429997 +[2023-10-19 05:39:10] 193400261 21.36 0.000908431816 +[2023-10-19 05:39:20] 193400261 21.36 0.000908388640 +[2023-10-19 05:39:30] 193400261 21.33 0.000908518595 +[2023-10-19 05:39:40] 193400261 21.30 0.000908607216 +[2023-10-19 05:39:50] 193400261 21.28 0.000908637496 +[2023-10-19 05:40:00] 193400261 21.28 0.000908670141 +[2023-10-19 05:40:10] 193400261 21.24 0.000908728361 +[2023-10-19 05:40:20] 193400261 21.20 0.000908773178 +[2023-10-19 05:40:30] 193400261 21.17 0.000908713216 +[2023-10-19 05:40:40] 193400261 21.13 0.000908789883 +[2023-10-19 05:40:50] 193400261 21.08 0.000908899272 +[2023-10-19 05:41:00] 193400261 21.07 0.000909007100 +[2023-10-19 05:41:10] 193400261 21.08 0.000909068904 +[2023-10-19 05:41:20] 193400261 21.06 0.000908980642 +[2023-10-19 05:41:30] 193400261 20.96 0.000909091764 +[2023-10-19 05:41:40] 193400261 20.94 0.000909014938 +[2023-10-19 05:41:50] 193400261 20.94 0.000909148275 +[2023-10-19 05:42:00] 193400261 20.91 0.000909174728 +[2023-10-19 05:42:10] 193400261 20.87 0.000909259883 +[2023-10-19 05:42:20] 193400261 20.86 0.000909214528 +[2023-10-19 05:42:30] 193400261 20.87 0.000909263803 +[2023-10-19 05:42:40] 193400261 20.85 0.000909403523 +[2023-10-19 05:42:50] 193400261 20.79 0.000909378802 +[2023-10-19 05:43:00] 193400261 20.70 0.000909448236 +[2023-10-19 05:43:10] 193400261 20.69 0.000909500756 +[2023-10-19 05:43:20] 193400261 20.70 0.000909540509 +[2023-10-19 05:43:30] 193400261 20.70 0.000909603038 +[2023-10-19 05:43:40] 193400261 20.67 0.000909608180 +[2023-10-19 05:43:50] 193400261 20.62 0.000909561232 +[2023-10-19 05:44:00] 193400261 20.58 0.000909741889 +[2023-10-19 05:44:10] 193400261 20.56 0.000909820997 +[2023-10-19 05:44:20] 193400261 20.54 0.000909739754 +[2023-10-19 05:44:30] 193400261 20.52 0.000909852390 +[2023-10-19 05:44:40] 193400261 20.49 0.000909780001 +[2023-10-19 05:44:50] 193400261 20.48 0.000909881536 +[2023-10-19 05:45:00] 193400261 20.44 0.000910036146 +[2023-10-19 05:45:10] 193400261 20.38 0.000909965832 +[2023-10-19 05:45:20] 193400261 20.34 0.000910021646 +[2023-10-19 05:45:30] 193400261 20.35 0.000910118498 +[2023-10-19 05:45:40] 193400261 20.36 0.000910203964 +[2023-10-19 05:45:50] 193400261 20.32 0.000910120030 +[2023-10-19 05:46:00] 193400261 20.28 0.000910157383 +[2023-10-19 05:46:10] 193400261 20.24 0.000910225779 +[2023-10-19 05:46:20] 193400261 20.22 0.000910272688 +[2023-10-19 05:46:30] 193400261 20.19 0.000910331035 +[2023-10-19 05:46:41] 193400261 20.17 0.000910419271 +[2023-10-19 05:46:51] 193400261 20.16 0.000910411784 +[2023-10-19 05:47:01] 193400261 20.14 0.000910476397 +[2023-10-19 05:47:11] 193400261 20.11 0.000910486689 +[2023-10-19 05:47:21] 193400261 20.06 0.000910398051 +[2023-10-19 05:47:31] 193400261 20.04 0.000910558042 +[2023-10-19 05:47:41] 193400261 20.03 0.000910628849 +[2023-10-19 05:47:51] 193400261 20.01 0.000910595651 +[2023-10-19 05:48:01] 193400261 19.98 0.000910719238 +[2023-10-19 05:48:11] 193400261 19.93 0.000910712410 +[2023-10-19 05:48:21] 193400261 19.91 0.000910767172 +[2023-10-19 05:48:31] 193400261 19.91 0.000910808046 +[2023-10-19 05:48:41] 193400261 19.89 0.000910916568 +[2023-10-19 05:48:51] 193400261 19.86 0.000910962654 +[2023-10-19 05:49:01] 193400261 19.80 0.000910956085 +[2023-10-19 05:49:11] 193400261 19.76 0.000911035978 +[2023-10-19 05:49:21] 193400261 19.75 0.000910987972 +[2023-10-19 05:49:31] 193400261 19.76 0.000910991273 +[2023-10-19 05:49:41] 193400261 19.75 0.000911123707 +[2023-10-19 05:49:51] 193400261 19.72 0.000911082615 +[2023-10-19 05:50:01] 193400261 19.64 0.000911103030 +[2023-10-19 05:50:11] 193400261 19.62 0.000911239923 +[2023-10-19 05:50:21] 193400261 19.62 0.000911279086 +[2023-10-19 05:50:31] 193400261 19.60 0.000911249851 +[2023-10-19 05:50:41] 193400261 19.54 0.000911343388 +[2023-10-19 05:50:51] 193400261 19.51 0.000911299092 +[2023-10-19 05:51:01] 193400261 19.53 0.000911430181 +[2023-10-19 05:51:11] 193400261 19.53 0.000911538596 +[2023-10-19 05:51:21] 193400261 19.49 0.000911471837 +[2023-10-19 05:51:31] 193400261 19.44 0.000911577110 +[2023-10-19 05:51:41] 193400261 19.40 0.000911587013 +[2023-10-19 05:51:51] 193400261 19.38 0.000911651541 +[2023-10-19 05:52:01] 193400261 19.36 0.000911603454 +[2023-10-19 05:52:11] 193400261 19.34 0.000911731329 +[2023-10-19 05:52:21] 193400261 19.33 0.000911788851 +[2023-10-19 05:52:31] 193400261 19.31 0.000911783197 +[2023-10-19 05:52:41] 193400261 19.27 0.000911866968 +[2023-10-19 05:52:51] 193400261 19.25 0.000911979049 +[2023-10-19 05:53:01] 193400261 19.24 0.000911871802 +[2023-10-19 05:53:11] 193400261 19.22 0.000911961634 +[2023-10-19 05:53:21] 193400261 19.17 0.000912023266 +[2023-10-19 05:53:31] 193400261 19.13 0.000912067658 +[2023-10-19 05:53:41] 193400261 19.13 0.000912080591 +[2023-10-19 05:53:51] 193400261 19.13 0.000912070061 +[2023-10-19 05:54:01] 193400261 19.08 0.000912184873 +[2023-10-19 05:54:11] 193400261 19.02 0.000912118752 +[2023-10-19 05:54:21] 193400261 19.00 0.000912284434 +[2023-10-19 05:54:31] 193400261 19.02 0.000912207170 +[2023-10-19 05:54:41] 193400261 19.01 0.000912287939 +[2023-10-19 05:54:51] 193400261 18.96 0.000912337714 +[2023-10-19 05:55:01] 193400261 18.92 0.000912353314 +[2023-10-19 05:55:11] 193400261 18.90 0.000912502753 +[2023-10-19 05:55:21] 193400261 18.89 0.000912513111 +[2023-10-19 05:55:31] 193400261 18.87 0.000912577714 +[2023-10-19 05:55:41] 193400261 18.85 0.000912537567 +[2023-10-19 05:55:51] 193400261 18.82 0.000912617088 +[2023-10-19 05:56:01] 193400261 18.79 0.000912571184 +[2023-10-19 05:56:11] 193400261 18.76 0.000912635797 +[2023-10-19 05:56:21] 193400261 18.73 0.000912732821 +[2023-10-19 05:56:31] 193400261 18.70 0.000912664051 +[2023-10-19 05:56:41] 193400261 18.70 0.000912763023 +[2023-10-19 05:56:51] 193400261 18.68 0.000912902786 +[2023-10-19 05:57:01] 193400261 18.66 0.000912832412 +[2023-10-19 05:57:11] 193400261 18.63 0.000912875723 +[2023-10-19 05:57:21] 193400261 18.61 0.000912979675 +[2023-10-19 05:57:31] 193400261 18.60 0.000912939593 +[2023-10-19 05:57:41] 193400261 18.57 0.000912939173 +[2023-10-19 05:57:51] 193400261 18.55 0.000913061129 +[2023-10-19 05:58:01] 193400261 18.51 0.000913036305 +[2023-10-19 05:58:11] 193400261 18.47 0.000913114329 +[2023-10-19 05:58:21] 193400261 18.45 0.000913230444 +[2023-10-19 05:58:31] 193400261 18.44 0.000913207965 +[2023-10-19 05:58:41] 193400261 18.41 0.000913374688 +[2023-10-19 05:58:51] 193400261 18.41 0.000913411280 +[2023-10-19 05:59:01] 193400261 18.39 0.000913374466 +[2023-10-19 05:59:11] 193400261 18.36 0.000913464030 +[2023-10-19 05:59:21] 193400261 18.32 0.000913313973 +[2023-10-19 05:59:31] 193400261 18.29 0.000913489535 +[2023-10-19 05:59:41] 193400261 18.28 0.000913475531 +[2023-10-19 05:59:51] 193400261 18.25 0.000913604212 +[2023-10-19 06:00:01] 193400261 18.24 0.000913615340 +[2023-10-19 06:00:11] 193400261 18.21 0.000913601727 +[2023-10-19 06:00:21] 193400261 18.18 0.000913575993 +[2023-10-19 06:00:31] 193400261 18.17 0.000913587551 +[2023-10-19 06:00:41] 193400261 18.17 0.000913776423 +[2023-10-19 06:00:51] 193400261 18.14 0.000913821552 +[2023-10-19 06:01:01] 193400261 18.08 0.000913812530 +[2023-10-19 06:01:11] 193400261 18.04 0.000913858450 +[2023-10-19 06:01:21] 193400261 18.04 0.000913892712 +[2023-10-19 06:01:31] 193400261 18.05 0.000913972481 +[2023-10-19 06:01:41] 193400261 18.04 0.000913953382 +[2023-10-19 06:01:51] 193400261 17.95 0.000914061901 +[2023-10-19 06:02:01] 193400261 17.93 0.000914118780 +[2023-10-19 06:02:11] 193400261 17.93 0.000914152689 +[2023-10-19 06:02:21] 193400261 17.93 0.000914203494 +[2023-10-19 06:02:31] 193400261 17.91 0.000914199152 +[2023-10-19 06:02:41] 193400261 17.88 0.000914243359 +[2023-10-19 06:02:51] 193400261 17.85 0.000914273157 +[2023-10-19 06:03:01] 193400261 17.84 0.000914334707 +[2023-10-19 06:03:11] 193400261 17.82 0.000914314274 +[2023-10-19 06:03:21] 193400261 17.79 0.000914309210 +[2023-10-19 06:03:31] 193400261 17.76 0.000914454200 +[2023-10-19 06:03:41] 193400261 17.75 0.000914434996 +[2023-10-19 06:03:51] 193400261 17.75 0.000914426803 +[2023-10-19 06:04:01] 193400261 17.71 0.000914514123 +[2023-10-19 06:04:11] 193400261 17.66 0.000914413261 +[2023-10-19 06:04:21] 193400261 17.65 0.000914654872 +[2023-10-19 06:04:31] 193400261 17.65 0.000914569250 +[2023-10-19 06:04:41] 193400261 17.61 0.000914574464 +[2023-10-19 06:04:51] 193400261 17.59 0.000914716947 +[2023-10-19 06:05:01] 193400261 17.59 0.000914747130 +[2023-10-19 06:05:11] 193400261 17.57 0.000914698756 +[2023-10-19 06:05:21] 193400261 17.53 0.000914840919 +[2023-10-19 06:05:31] 193400261 17.49 0.000914786664 +[2023-10-19 06:05:41] 193400261 17.47 0.000914895714 +[2023-10-19 06:05:51] 193400261 17.47 0.000914961998 +[2023-10-19 06:06:01] 193400261 17.46 0.000915044682 +[2023-10-19 06:06:12] 193400261 17.43 0.000915005770 +[2023-10-19 06:06:22] 193400261 17.40 0.000915046589 +[2023-10-19 06:06:32] 193400261 17.37 0.000915131703 +[2023-10-19 06:06:42] 193400261 17.36 0.000915071579 +[2023-10-19 06:06:52] 193400261 17.35 0.000915141867 +[2023-10-19 06:07:02] 193400261 17.32 0.000915219996 +[2023-10-19 06:07:12] 193400261 17.30 0.000915282727 +[2023-10-19 06:07:22] 193400261 17.28 0.000915229015 +[2023-10-19 06:07:32] 193400261 17.25 0.000915299834 +[2023-10-19 06:07:42] 193400261 17.23 0.000915355742 +[2023-10-19 06:07:52] 193400261 17.22 0.000915407206 +[2023-10-19 06:08:02] 193400261 17.19 0.000915335918 +[2023-10-19 06:08:12] 193400261 17.16 0.000915465336 +[2023-10-19 06:08:22] 193400261 17.13 0.000915476198 +[2023-10-19 06:08:32] 193400261 17.12 0.000915612142 +[2023-10-19 06:08:42] 193400261 17.13 0.000915676723 +[2023-10-19 06:08:52] 193400261 17.11 0.000915599304 +[2023-10-19 06:09:02] 193400261 17.07 0.000915715456 +[2023-10-19 06:09:12] 193400261 17.03 0.000915679250 +[2023-10-19 06:09:22] 193400261 17.01 0.000915697259 +[2023-10-19 06:09:32] 193400261 17.01 0.000915769786 +[2023-10-19 06:09:42] 193400261 17.00 0.000915812810 +[2023-10-19 06:09:52] 193400261 16.97 0.000915739569 +[2023-10-19 06:10:02] 193400261 16.94 0.000915788418 +[2023-10-19 06:10:12] 193400261 16.93 0.000915880287 +[2023-10-19 06:10:22] 193400261 16.90 0.000915945210 +[2023-10-19 06:10:32] 193400261 16.87 0.000915971543 +[2023-10-19 06:10:42] 193400261 16.84 0.000916033383 +[2023-10-19 06:10:52] 193400261 16.84 0.000916110733 +[2023-10-19 06:11:02] 193400261 16.83 0.000916102741 +[2023-10-19 06:11:12] 193400261 16.83 0.000916051192 +[2023-10-19 06:11:22] 193400261 16.79 0.000916147855 +[2023-10-19 06:11:32] 193400261 16.74 0.000916168588 +[2023-10-19 06:11:42] 193400261 16.71 0.000916267907 +[2023-10-19 06:11:52] 193400261 16.71 0.000916288902 +[2023-10-19 06:12:02] 193400261 16.71 0.000916207667 +[2023-10-19 06:12:12] 193400261 16.68 0.000916320152 +[2023-10-19 06:12:22] 193400261 16.64 0.000916407186 +[2023-10-19 06:12:32] 193400261 16.63 0.000916451374 +[2023-10-19 06:12:42] 193400261 16.61 0.000916468630 +[2023-10-19 06:12:52] 193400261 16.61 0.000916390669 +[2023-10-19 06:13:02] 193400261 16.60 0.000916478594 +[2023-10-19 06:13:12] 193400261 16.57 0.000916634516 +[2023-10-19 06:13:22] 193400261 16.55 0.000916553619 +[2023-10-19 06:13:32] 193400261 16.51 0.000916619753 +[2023-10-19 06:13:42] 193400261 16.48 0.000916690558 +[2023-10-19 06:13:52] 193400261 16.47 0.000916742479 +[2023-10-19 06:14:02] 193400261 16.45 0.000916697773 +[2023-10-19 06:14:12] 193400261 16.44 0.000916713984 +[2023-10-19 06:14:22] 193400261 16.42 0.000916885318 +[2023-10-19 06:14:32] 193400261 16.40 0.000916826799 +[2023-10-19 06:14:42] 193400261 16.37 0.000916929736 +[2023-10-19 06:14:52] 193400261 16.34 0.000916957807 +[2023-10-19 06:15:02] 193400261 16.33 0.000916993195 +[2023-10-19 06:15:12] 193400261 16.32 0.000916988269 +[2023-10-19 06:15:22] 193400261 16.31 0.000917028863 +[2023-10-19 06:15:32] 193400261 16.29 0.000917114539 +[2023-10-19 06:15:42] 193400261 16.26 0.000917147588 +[2023-10-19 06:15:52] 193400261 16.24 0.000917138097 +[2023-10-19 06:16:02] 193400261 16.22 0.000917200279 +[2023-10-19 06:16:12] 193400261 16.19 0.000917180925 +[2023-10-19 06:16:22] 193400261 16.17 0.000917273406 +[2023-10-19 06:16:32] 193400261 16.17 0.000917267111 +[2023-10-19 06:16:42] 193400261 16.15 0.000917393437 +[2023-10-19 06:16:52] 193400261 16.12 0.000917372495 +[2023-10-19 06:17:02] 193400261 16.11 0.000917328384 +[2023-10-19 06:17:12] 193400261 16.09 0.000917482765 +[2023-10-19 06:17:22] 193400261 16.06 0.000917388613 +[2023-10-19 06:17:32] 193400261 16.03 0.000917368413 +[2023-10-19 06:17:42] 193400261 16.02 0.000917586604 +[2023-10-19 06:17:52] 193400261 16.01 0.000917596480 +[2023-10-19 06:18:02] 193400261 15.99 0.000917601891 +[2023-10-19 06:18:12] 193400261 15.97 0.000917639651 +[2023-10-19 06:18:22] 193400261 15.95 0.000917722511 +[2023-10-19 06:18:32] 193400261 15.94 0.000917697228 +[2023-10-19 06:18:42] 193400261 15.91 0.000917748166 +[2023-10-19 06:18:52] 193400261 15.89 0.000917740282 +[2023-10-19 06:19:02] 193400261 15.88 0.000917775558 +[2023-10-19 06:19:12] 193400261 15.86 0.000917882052 +[2023-10-19 06:19:22] 193400261 15.83 0.000917940961 +[2023-10-19 06:19:32] 193400261 15.81 0.000917891244 +[2023-10-19 06:19:42] 193400261 15.80 0.000918071045 +[2023-10-19 06:19:52] 193400261 15.79 0.000918028630 +[2023-10-19 06:20:02] 193400261 15.78 0.000918030552 +[2023-10-19 06:20:12] 193400261 15.74 0.000918008762 +[2023-10-19 06:20:22] 193400261 15.71 0.000918109883 +[2023-10-19 06:20:32] 193400261 15.70 0.000918035248 +[2023-10-19 06:20:42] 193400261 15.69 0.000918199409 +[2023-10-19 06:20:52] 193400261 15.68 0.000918145957 +[2023-10-19 06:21:02] 193400261 15.66 0.000918191322 +[2023-10-19 06:21:12] 193400261 15.65 0.000918257564 +[2023-10-19 06:21:22] 193400261 15.63 0.000918331695 +[2023-10-19 06:21:32] 193400261 15.61 0.000918333831 +[2023-10-19 06:21:42] 193400261 15.58 0.000918400959 +[2023-10-19 06:21:52] 193400261 15.55 0.000918464481 +[2023-10-19 06:22:02] 193400261 15.52 0.000918452136 +[2023-10-19 06:22:12] 193400261 15.50 0.000918520112 +[2023-10-19 06:22:22] 193400261 15.51 0.000918560899 +[2023-10-19 06:22:32] 193400261 15.50 0.000918471019 +[2023-10-19 06:22:42] 193400261 15.48 0.000918514810 +[2023-10-19 06:22:52] 193400261 15.44 0.000918643430 +[2023-10-19 06:23:02] 193400261 15.43 0.000918702362 +[2023-10-19 06:23:12] 193400261 15.41 0.000918725354 +[2023-10-19 06:23:22] 193400261 15.40 0.000918676546 +[2023-10-19 06:23:32] 193400261 15.39 0.000918723781 +[2023-10-19 06:23:42] 193400261 15.37 0.000918733179 +[2023-10-19 06:23:52] 193400261 15.36 0.000918867210 +[2023-10-19 06:24:02] 193400261 15.34 0.000918946139 +[2023-10-19 06:24:12] 193400261 15.31 0.000918917339 +[2023-10-19 06:24:23] 193400261 15.27 0.000919011180 +[2023-10-19 06:24:33] 193400261 15.24 0.000918900187 +[2023-10-19 06:24:43] 193400261 15.23 0.000918956711 +[2023-10-19 06:24:53] 193400261 15.23 0.000919044303 +[2023-10-19 06:25:03] 193400261 15.23 0.000919087349 +[2023-10-19 06:25:13] 193400261 15.23 0.000919123778 +[2023-10-19 06:25:23] 193400261 15.20 0.000919113413 +[2023-10-19 06:25:33] 193400261 15.16 0.000919124313 +[2023-10-19 06:25:43] 193400261 15.12 0.000919112657 +[2023-10-19 06:25:53] 193400261 15.10 0.000919231790 +[2023-10-19 06:26:03] 193400261 15.10 0.000919319677 +[2023-10-19 06:26:13] 193400261 15.12 0.000919339469 +[2023-10-19 06:26:23] 193400261 15.12 0.000919428522 +[2023-10-19 06:26:33] 193400261 15.08 0.000919389221 +[2023-10-19 06:26:43] 193400261 15.03 0.000919410451 +[2023-10-19 06:26:53] 193400261 15.00 0.000919444201 +[2023-10-19 06:27:03] 193400261 14.99 0.000919446126 +[2023-10-19 06:27:13] 193400261 14.97 0.000919449946 +[2023-10-19 06:27:23] 193400261 14.97 0.000919479810 +[2023-10-19 06:27:33] 193400261 14.97 0.000919543542 +[2023-10-19 06:27:43] 193400261 14.96 0.000919666704 +[2023-10-19 06:27:53] 193400261 14.93 0.000919663068 +[2023-10-19 06:28:03] 193400261 14.90 0.000919687080 +[2023-10-19 06:28:13] 193400261 14.87 0.000919678955 +[2023-10-19 06:28:23] 193400261 14.86 0.000919753876 +[2023-10-19 06:28:33] 193400261 14.85 0.000919873078 +[2023-10-19 06:28:43] 193400261 14.83 0.000919810117 +[2023-10-19 06:28:53] 193400261 14.81 0.000919875068 +[2023-10-19 06:29:03] 193400261 14.80 0.000919853600 +[2023-10-19 06:29:13] 193400261 14.79 0.000919844154 +[2023-10-19 06:29:23] 193400261 14.77 0.000919970616 +[2023-10-19 06:29:33] 193400261 14.74 0.000920008945 +[2023-10-19 06:29:43] 193400261 14.72 0.000919994012 +[2023-10-19 06:29:53] 193400261 14.71 0.000920050019 +[2023-10-19 06:30:03] 193400261 14.70 0.000920043434 +[2023-10-19 06:30:13] 193400261 14.69 0.000920060501 +[2023-10-19 06:30:23] 193400261 14.67 0.000920210560 +[2023-10-19 06:30:33] 193400261 14.65 0.000920203410 +[2023-10-19 06:30:43] 193400261 14.63 0.000920177490 +[2023-10-19 06:30:53] 193400261 14.60 0.000920204229 +[2023-10-19 06:31:03] 193400261 14.58 0.000920328437 +[2023-10-19 06:31:13] 193400261 14.57 0.000920357914 +[2023-10-19 06:31:23] 193400261 14.56 0.000920340903 +[2023-10-19 06:31:33] 193400261 14.55 0.000920392532 +[2023-10-19 06:31:43] 193400261 14.54 0.000920477830 +[2023-10-19 06:31:53] 193400261 14.53 0.000920412523 +[2023-10-19 06:32:03] 193400261 14.50 0.000920517513 +[2023-10-19 06:32:13] 193400261 14.46 0.000920412856 +[2023-10-19 06:32:23] 193400261 14.43 0.000920537301 +[2023-10-19 06:32:33] 193400261 14.43 0.000920656037 +[2023-10-19 06:32:43] 193400261 14.44 0.000920611125 +[2023-10-19 06:32:53] 193400261 14.43 0.000920682299 +[2023-10-19 06:33:03] 193400261 14.41 0.000920622887 +[2023-10-19 06:33:13] 193400261 14.37 0.000920702732 +[2023-10-19 06:33:23] 193400261 14.34 0.000920755628 +[2023-10-19 06:33:33] 193400261 14.34 0.000920842125 +[2023-10-19 06:33:43] 193400261 14.33 0.000920794173 +[2023-10-19 06:33:53] 193400261 14.32 0.000920847199 +[2023-10-19 06:34:03] 193400261 14.29 0.000920948441 +[2023-10-19 06:34:13] 193400261 14.26 0.000920889822 +[2023-10-19 06:34:23] 193400261 14.25 0.000920950779 +[2023-10-19 06:34:33] 193400261 14.25 0.000921019802 +[2023-10-19 06:34:43] 193400261 14.24 0.000920967026 +[2023-10-19 06:34:53] 193400261 14.22 0.000921095026 +[2023-10-19 06:35:03] 193400261 14.21 0.000921163187 +[2023-10-19 06:35:13] 193400261 14.18 0.000921138255 +[2023-10-19 06:35:23] 193400261 14.16 0.000921055888 +[2023-10-19 06:35:33] 193400261 14.13 0.000921162879 +[2023-10-19 06:35:43] 193400261 14.12 0.000921233963 +[2023-10-19 06:35:53] 193400261 14.11 0.000921263563 +[2023-10-19 06:36:03] 193400261 14.10 0.000921284271 +[2023-10-19 06:36:13] 193400261 14.09 0.000921310476 +[2023-10-19 06:36:23] 193400261 14.09 0.000921280027 +[2023-10-19 06:36:33] 193400261 14.06 0.000921305739 +[2023-10-19 06:36:43] 193400261 14.04 0.000921346536 +[2023-10-19 06:36:53] 193400261 14.02 0.000921458338 +[2023-10-19 06:37:03] 193400261 14.00 0.000921402464 +[2023-10-19 06:37:13] 193400261 13.98 0.000921595093 +[2023-10-19 06:37:23] 193400261 13.97 0.000921444355 +[2023-10-19 06:37:33] 193400261 13.96 0.000921486540 +[2023-10-19 06:37:43] 193400261 13.95 0.000921651172 +[2023-10-19 06:37:53] 193400261 13.93 0.000921530281 +[2023-10-19 06:38:03] 193400261 13.91 0.000921696415 +[2023-10-19 06:38:13] 193400261 13.88 0.000921693751 +[2023-10-19 06:38:23] 193400261 13.86 0.000921702421 +[2023-10-19 06:38:33] 193400261 13.85 0.000921801489 +[2023-10-19 06:38:43] 193400261 13.84 0.000921789233 +[2023-10-19 06:38:53] 193400261 13.84 0.000921852956 +[2023-10-19 06:39:03] 193400261 13.82 0.000921883493 +[2023-10-19 06:39:13] 193400261 13.80 0.000921890757 +[2023-10-19 06:39:23] 193400261 13.78 0.000921833661 +[2023-10-19 06:39:33] 193400261 13.77 0.000921897235 +[2023-10-19 06:39:43] 193400261 13.75 0.000921946110 +[2023-10-19 06:39:53] 193400261 13.73 0.000921976642 +[2023-10-19 06:40:03] 193400261 13.71 0.000922001114 +[2023-10-19 06:40:13] 193400261 13.70 0.000922134625 +[2023-10-19 06:40:23] 193400261 13.69 0.000922186588 +[2023-10-19 06:40:33] 193400261 13.67 0.000922118865 +[2023-10-19 06:40:43] 193400261 13.65 0.000922111777 +[2023-10-19 06:40:53] 193400261 13.65 0.000922194098 +[2023-10-19 06:41:03] 193400261 13.64 0.000922180213 +[2023-10-19 06:41:13] 193400261 13.62 0.000922198754 +[2023-10-19 06:41:23] 193400261 13.60 0.000922290248 +[2023-10-19 06:41:33] 193400261 13.57 0.000922290867 +[2023-10-19 06:41:43] 193400261 13.55 0.000922263105 +[2023-10-19 06:41:53] 193400261 13.53 0.000922328859 +[2023-10-19 06:42:03] 193400261 13.53 0.000922385905 +[2023-10-19 06:42:13] 193400261 13.53 0.000922544741 +[2023-10-19 06:42:23] 193400261 13.53 0.000922417560 +[2023-10-19 06:42:33] 193400261 13.52 0.000922558827 +[2023-10-19 06:42:43] 193400261 13.49 0.000922553603 +[2023-10-19 06:42:53] 193400261 13.46 0.000922577324 +[2023-10-19 06:43:03] 193400261 13.43 0.000922617078 +[2023-10-19 06:43:13] 193400261 13.41 0.000922624271 +[2023-10-19 06:43:23] 193400261 13.40 0.000922651182 +[2023-10-19 06:43:33] 193400261 13.40 0.000922618073 +[2023-10-19 06:43:43] 193400261 13.40 0.000922702881 +[2023-10-19 06:43:53] 193400261 13.39 0.000922721886 +[2023-10-19 06:44:03] 193400261 13.36 0.000922818215 +[2023-10-19 06:44:13] 193400261 13.33 0.000922870978 +[2023-10-19 06:44:24] 193400261 13.31 0.000922791341 +[2023-10-19 06:44:34] 193400261 13.30 0.000922884459 +[2023-10-19 06:44:44] 193400261 13.29 0.000922868226 +[2023-10-19 06:44:54] 193400261 13.28 0.000922964983 +[2023-10-19 06:45:04] 193400261 13.27 0.000922911305 +[2023-10-19 06:45:14] 193400261 13.25 0.000922973515 +[2023-10-19 06:45:24] 193400261 13.24 0.000922956511 +[2023-10-19 06:45:34] 193400261 13.22 0.000923054715 +[2023-10-19 06:45:44] 193400261 13.20 0.000923083687 +[2023-10-19 06:45:54] 193400261 13.19 0.000923049957 +[2023-10-19 06:46:04] 193400261 13.19 0.000923097436 +[2023-10-19 06:46:14] 193400261 13.17 0.000923159176 +[2023-10-19 06:46:24] 193400261 13.15 0.000923206022 +[2023-10-19 06:46:34] 193400261 13.11 0.000923228142 +[2023-10-19 06:46:44] 193400261 13.10 0.000923164388 +[2023-10-19 06:46:54] 193400261 13.10 0.000923257119 +[2023-10-19 06:47:04] 193400261 13.09 0.000923371417 +[2023-10-19 06:47:14] 193400261 13.09 0.000923400626 +[2023-10-19 06:47:24] 193400261 13.07 0.000923460612 +[2023-10-19 06:47:34] 193400261 13.04 0.000923348196 +[2023-10-19 06:47:44] 193400261 13.02 0.000923351591 +[2023-10-19 06:47:54] 193400261 13.00 0.000923525768 +[2023-10-19 06:48:04] 193400261 12.99 0.000923401798 +[2023-10-19 06:48:14] 193400261 12.98 0.000923572026 +[2023-10-19 06:48:24] 193400261 12.97 0.000923556572 +[2023-10-19 06:48:34] 193400261 12.96 0.000923625223 +[2023-10-19 06:48:44] 193400261 12.95 0.000923610004 +[2023-10-19 06:48:54] 193400261 12.92 0.000923724598 +[2023-10-19 06:49:04] 193400261 12.91 0.000923668136 +[2023-10-19 06:49:14] 193400261 12.89 0.000923733636 +[2023-10-19 06:49:24] 193400261 12.88 0.000923657231 +[2023-10-19 06:49:34] 193400261 12.87 0.000923773287 +[2023-10-19 06:49:44] 193400261 12.85 0.000923774264 +[2023-10-19 06:49:54] 193400261 12.84 0.000923886955 +[2023-10-19 06:50:04] 193400261 12.81 0.000923831114 +[2023-10-19 06:50:14] 193400261 12.81 0.000923927601 +[2023-10-19 06:50:24] 193400261 12.80 0.000923870856 +[2023-10-19 06:50:34] 193400261 12.80 0.000923927656 +[2023-10-19 06:50:44] 193400261 12.78 0.000923978111 +[2023-10-19 06:50:54] 193400261 12.76 0.000924021872 +[2023-10-19 06:51:04] 193400261 12.74 0.000924021416 +[2023-10-19 06:51:14] 193400261 12.71 0.000924059044 +[2023-10-19 06:51:24] 193400261 12.69 0.000924121283 +[2023-10-19 06:51:34] 193400261 12.69 0.000924051476 +[2023-10-19 06:51:44] 193400261 12.68 0.000924075973 +[2023-10-19 06:51:54] 193400261 12.68 0.000924272510 +[2023-10-19 06:52:04] 193400261 12.66 0.000924208084 +[2023-10-19 06:52:14] 193400261 12.64 0.000924244691 +[2023-10-19 06:52:24] 193400261 12.62 0.000924315352 +[2023-10-19 06:52:34] 193400261 12.61 0.000924259457 +[2023-10-19 06:52:44] 193400261 12.60 0.000924394409 +[2023-10-19 06:52:54] 193400261 12.59 0.000924406199 +[2023-10-19 06:53:04] 193400261 12.58 0.000924398939 +[2023-10-19 06:53:14] 193400261 12.56 0.000924424888 +[2023-10-19 06:53:24] 193400261 12.53 0.000924412468 +[2023-10-19 06:53:34] 193400261 12.52 0.000924531235 +[2023-10-19 06:53:44] 193400261 12.52 0.000924549037 +[2023-10-19 06:53:54] 193400261 12.51 0.000924542136 +[2023-10-19 06:54:04] 193400261 12.49 0.000924544663 +[2023-10-19 06:54:14] 193400261 12.48 0.000924662187 +[2023-10-19 06:54:24] 193400261 12.45 0.000924624882 +[2023-10-19 06:54:34] 193400261 12.45 0.000924641194 +[2023-10-19 06:54:44] 193400261 12.45 0.000924700901 +[2023-10-19 06:54:54] 193400261 12.44 0.000924709157 +[2023-10-19 06:55:04] 193400261 12.42 0.000924789162 +[2023-10-19 06:55:14] 193400261 12.39 0.000924704311 +[2023-10-19 06:55:24] 193400261 12.37 0.000924730680 +[2023-10-19 06:55:34] 193400261 12.36 0.000924802131 +[2023-10-19 06:55:44] 193400261 12.34 0.000924887616 +[2023-10-19 06:55:54] 193400261 12.34 0.000924825391 +[2023-10-19 06:56:04] 193400261 12.33 0.000924879538 +[2023-10-19 06:56:14] 193400261 12.32 0.000925010018 +[2023-10-19 06:56:24] 193400261 12.31 0.000925007334 +[2023-10-19 06:56:34] 193400261 12.29 0.000925084985 +[2023-10-19 06:56:44] 193400261 12.27 0.000925045032 +[2023-10-19 06:56:54] 193400261 12.25 0.000925151361 +[2023-10-19 06:57:04] 193400261 12.24 0.000925054940 +[2023-10-19 06:57:14] 193400261 12.23 0.000925076235 +[2023-10-19 06:57:24] 193400261 12.22 0.000925154331 +[2023-10-19 06:57:34] 193400261 12.20 0.000925216372 +[2023-10-19 06:57:44] 193400261 12.19 0.000925238483 +[2023-10-19 06:57:54] 193400261 12.20 0.000925313369 +[2023-10-19 06:58:04] 193400261 12.19 0.000925284995 +[2023-10-19 06:58:14] 193400261 12.18 0.000925232746 +[2023-10-19 06:58:24] 193400261 12.14 0.000925382487 +[2023-10-19 06:58:34] 193400261 12.10 0.000925429940 +[2023-10-19 06:58:44] 193400261 12.07 0.000925308699 +[2023-10-19 06:58:54] 193400261 12.07 0.000925464601 +[2023-10-19 06:59:04] 193400261 12.08 0.000925490461 +[2023-10-19 06:59:14] 193400261 12.09 0.000925442238 +[2023-10-19 06:59:24] 193400261 12.09 0.000925452677 +[2023-10-19 06:59:34] 193400261 12.07 0.000925544886 +[2023-10-19 06:59:44] 193400261 12.03 0.000925531187 +[2023-10-19 06:59:54] 193400261 12.01 0.000925623590 +[2023-10-19 07:00:04] 193400261 11.99 0.000925592028 +[2023-10-19 07:00:14] 193400261 11.98 0.000925591702 +[2023-10-19 07:00:24] 193400261 11.99 0.000925612763 +[2023-10-19 07:00:34] 193400261 11.99 0.000925658803 +[2023-10-19 07:00:44] 193400261 11.97 0.000925647079 +[2023-10-19 07:00:54] 193400261 11.95 0.000925715230 +[2023-10-19 07:01:04] 193400261 11.93 0.000925689913 +[2023-10-19 07:01:14] 193400261 11.92 0.000925776123 +[2023-10-19 07:01:24] 193400261 11.92 0.000925822459 +[2023-10-19 07:01:34] 193400261 11.91 0.000925763589 +[2023-10-19 07:01:44] 193400261 11.89 0.000925800558 +[2023-10-19 07:01:54] 193400261 11.86 0.000925889480 +[2023-10-19 07:02:04] 193400261 11.83 0.000925880910 +[2023-10-19 07:02:14] 193400261 11.82 0.000925983313 +[2023-10-19 07:02:24] 193400261 11.82 0.000925948737 +[2023-10-19 07:02:34] 193400261 11.81 0.000925924563 +[2023-10-19 07:02:44] 193400261 11.80 0.000925904320 +[2023-10-19 07:02:54] 193400261 11.79 0.000926007843 +[2023-10-19 07:03:04] 193400261 11.80 0.000926102124 +[2023-10-19 07:03:14] 193400261 11.79 0.000926172935 +[2023-10-19 07:03:24] 193400261 11.79 0.000926129451 +[2023-10-19 07:03:34] 193400261 11.75 0.000926233996 +[2023-10-19 07:03:44] 193400261 11.72 0.000926207206 +[2023-10-19 07:03:54] 193400261 11.69 0.000926142659 +[2023-10-19 07:04:04] 193400261 11.68 0.000926322350 +[2023-10-19 07:04:15] 193400261 11.67 0.000926390116 +[2023-10-19 07:04:25] 193400261 11.68 0.000926293973 +[2023-10-19 07:04:35] 193400261 11.68 0.000926400167 +[2023-10-19 07:04:45] 193400261 11.66 0.000926417397 +[2023-10-19 07:04:55] 193400261 11.64 0.000926373392 +[2023-10-19 07:05:05] 193400261 11.62 0.000926385665 +[2023-10-19 07:05:15] 193400261 11.60 0.000926528499 +[2023-10-19 07:05:25] 193400261 11.60 0.000926425162 +[2023-10-19 07:05:35] 193400261 11.58 0.000926597212 +[2023-10-19 07:05:45] 193400261 11.57 0.000926530218 +[2023-10-19 07:05:55] 193400261 11.56 0.000926571051 +[2023-10-19 07:06:05] 193400261 11.55 0.000926667399 +[2023-10-19 07:06:15] 193400261 11.54 0.000926722844 +[2023-10-19 07:06:25] 193400261 11.53 0.000926700158 +[2023-10-19 07:06:35] 193400261 11.51 0.000926697299 +[2023-10-19 07:06:45] 193400261 11.51 0.000926681329 +[2023-10-19 07:06:55] 193400261 11.49 0.000926645773 +[2023-10-19 07:07:05] 193400261 11.48 0.000926757141 +[2023-10-19 07:07:15] 193400261 11.47 0.000926758762 +[2023-10-19 07:07:25] 193400261 11.44 0.000926742434 +[2023-10-19 07:07:35] 193400261 11.42 0.000926898551 +[2023-10-19 07:07:45] 193400261 11.41 0.000926956033 +[2023-10-19 07:07:55] 193400261 11.41 0.000926828966 +[2023-10-19 07:08:05] 193400261 11.42 0.000926909571 +[2023-10-19 07:08:15] 193400261 11.41 0.000926975738 +[2023-10-19 07:08:25] 193400261 11.39 0.000927011519 +[2023-10-19 07:08:35] 193400261 11.38 0.000927005240 +[2023-10-19 07:08:45] 193400261 11.35 0.000927069892 +[2023-10-19 07:08:55] 193400261 11.33 0.000927021445 +[2023-10-19 07:09:05] 193400261 11.32 0.000927070260 +[2023-10-19 07:09:15] 193400261 11.31 0.000927062307 +[2023-10-19 07:09:25] 193400261 11.31 0.000927057716 +[2023-10-19 07:09:35] 193400261 11.30 0.000927205513 +[2023-10-19 07:09:45] 193400261 11.28 0.000927213554 +[2023-10-19 07:09:55] 193400261 11.28 0.000927220836 +[2023-10-19 07:10:05] 193400261 11.26 0.000927247705 +[2023-10-19 07:10:15] 193400261 11.24 0.000927296970 +[2023-10-19 07:10:25] 193400261 11.23 0.000927237666 +[2023-10-19 07:10:35] 193400261 11.22 0.000927329436 +[2023-10-19 07:10:45] 193400261 11.21 0.000927335532 +[2023-10-19 07:10:55] 193400261 11.20 0.000927412852 +[2023-10-19 07:11:05] 193400261 11.19 0.000927325242 +[2023-10-19 07:11:15] 193400261 11.17 0.000927485560 +[2023-10-19 07:11:25] 193400261 11.15 0.000927414340 +[2023-10-19 07:11:35] 193400261 11.15 0.000927424809 +[2023-10-19 07:11:45] 193400261 11.14 0.000927540072 +[2023-10-19 07:11:55] 193400261 11.12 0.000927425126 +[2023-10-19 07:12:05] 193400261 11.11 0.000927567829 +[2023-10-19 07:12:15] 193400261 11.09 0.000927563227 +[2023-10-19 07:12:25] 193400261 11.08 0.000927542263 +[2023-10-19 07:12:35] 193400261 11.08 0.000927579409 +[2023-10-19 07:12:45] 193400261 11.07 0.000927679618 +[2023-10-19 07:12:55] 193400261 11.06 0.000927685596 +[2023-10-19 07:13:05] 193400261 11.04 0.000927698611 +[2023-10-19 07:13:15] 193400261 11.03 0.000927720816 +[2023-10-19 07:13:25] 193400261 11.02 0.000927769951 +[2023-10-19 07:13:35] 193400261 11.01 0.000927795939 +[2023-10-19 07:13:45] 193400261 11.01 0.000927739979 +[2023-10-19 07:13:55] 193400261 10.99 0.000927843955 +[2023-10-19 07:14:05] 193400261 10.96 0.000927778879 +[2023-10-19 07:14:15] 193400261 10.94 0.000927912518 +[2023-10-19 07:14:25] 193400261 10.94 0.000927932312 +[2023-10-19 07:14:35] 193400261 10.94 0.000927949040 +[2023-10-19 07:14:45] 193400261 10.94 0.000927948557 +[2023-10-19 07:14:55] 193400261 10.93 0.000927999795 +[2023-10-19 07:15:05] 193400261 10.91 0.000927993316 +[2023-10-19 07:15:15] 193400261 10.89 0.000928087042 +[2023-10-19 07:15:25] 193400261 10.88 0.000927994937 +[2023-10-19 07:15:35] 193400261 10.87 0.000928100204 +[2023-10-19 07:15:45] 193400261 10.86 0.000928167559 +[2023-10-19 07:15:55] 193400261 10.85 0.000928089076 +[2023-10-19 07:16:05] 193400261 10.83 0.000928196152 +[2023-10-19 07:16:15] 193400261 10.82 0.000928160105 +[2023-10-19 07:16:25] 193400261 10.81 0.000928194646 +[2023-10-19 07:16:35] 193400261 10.81 0.000928212924 +[2023-10-19 07:16:45] 193400261 10.80 0.000928275109 +[2023-10-19 07:16:55] 193400261 10.79 0.000928325648 +[2023-10-19 07:17:05] 193400261 10.78 0.000928350500 +[2023-10-19 07:17:15] 193400261 10.75 0.000928355968 +[2023-10-19 07:17:25] 193400261 10.73 0.000928341505 +[2023-10-19 07:17:35] 193400261 10.72 0.000928322888 +[2023-10-19 07:17:45] 193400261 10.72 0.000928389243 +[2023-10-19 07:17:55] 193400261 10.71 0.000928391376 +[2023-10-19 07:18:05] 193400261 10.71 0.000928391861 +[2023-10-19 07:18:15] 193400261 10.70 0.000928463222 +[2023-10-19 07:18:25] 193400261 10.69 0.000928577720 +[2023-10-19 07:18:35] 193400261 10.67 0.000928479322 +[2023-10-19 07:18:45] 193400261 10.66 0.000928472922 +[2023-10-19 07:18:55] 193400261 10.64 0.000928639660 +[2023-10-19 07:19:05] 193400261 10.63 0.000928586656 +[2023-10-19 07:19:15] 193400261 10.62 0.000928583193 +[2023-10-19 07:19:25] 193400261 10.61 0.000928723144 +[2023-10-19 07:19:35] 193400261 10.61 0.000928654849 +[2023-10-19 07:19:45] 193400261 10.60 0.000928714433 +[2023-10-19 07:19:55] 193400261 10.59 0.000928813874 +[2023-10-19 07:20:05] 193400261 10.58 0.000928714357 +[2023-10-19 07:20:15] 193400261 10.56 0.000928765317 +[2023-10-19 07:20:25] 193400261 10.54 0.000928720053 +[2023-10-19 07:20:35] 193400261 10.52 0.000928762092 +[2023-10-19 07:20:45] 193400261 10.51 0.000928840289 +[2023-10-19 07:20:55] 193400261 10.51 0.000928966057 +[2023-10-19 07:21:05] 193400261 10.50 0.000928957849 +[2023-10-19 07:21:15] 193400261 10.50 0.000928986027 +[2023-10-19 07:21:25] 193400261 10.50 0.000928889770 +[2023-10-19 07:21:35] 193400261 10.48 0.000928995526 +[2023-10-19 07:21:45] 193400261 10.46 0.000929018666 +[2023-10-19 07:21:55] 193400261 10.44 0.000929126934 +[2023-10-19 07:22:05] 193400261 10.43 0.000929128953 +[2023-10-19 07:22:15] 193400261 10.42 0.000928986891 +[2023-10-19 07:22:25] 193400261 10.42 0.000929132332 +[2023-10-19 07:22:35] 193400261 10.41 0.000929143319 +[2023-10-19 07:22:45] 193400261 10.41 0.000929217976 +[2023-10-19 07:22:55] 193400261 10.39 0.000929163346 +[2023-10-19 07:23:05] 193400261 10.38 0.000929241231 +[2023-10-19 07:23:15] 193400261 10.37 0.000929201605 +[2023-10-19 07:23:26] 193400261 10.36 0.000929346982 +[2023-10-19 07:23:36] 193400261 10.34 0.000929243617 +[2023-10-19 07:23:46] 193400261 10.32 0.000929310069 +[2023-10-19 07:23:56] 193400261 10.31 0.000929335055 +[2023-10-19 07:24:06] 193400261 10.30 0.000929385241 +[2023-10-19 07:24:16] 193400261 10.30 0.000929399686 +[2023-10-19 07:24:26] 193400261 10.29 0.000929379729 +[2023-10-19 07:24:36] 193400261 10.29 0.000929442182 +[2023-10-19 07:24:46] 193400261 10.28 0.000929478400 +[2023-10-19 07:24:56] 193400261 10.26 0.000929537313 +[2023-10-19 07:25:06] 193400261 10.24 0.000929517299 +[2023-10-19 07:25:16] 193400261 10.23 0.000929530936 +[2023-10-19 07:25:26] 193400261 10.22 0.000929541681 +[2023-10-19 07:25:36] 193400261 10.22 0.000929665328 +[2023-10-19 07:25:46] 193400261 10.22 0.000929525505 +[2023-10-19 07:25:56] 193400261 10.21 0.000929641763 +[2023-10-19 07:26:06] 193400261 10.20 0.000929701686 +[2023-10-19 07:26:16] 193400261 10.19 0.000929622618 +[2023-10-19 07:26:26] 193400261 10.17 0.000929673806 +[2023-10-19 07:26:36] 193400261 10.16 0.000929732745 +[2023-10-19 07:26:46] 193400261 10.14 0.000929658613 +[2023-10-19 07:26:56] 193400261 10.13 0.000929797450 +[2023-10-19 07:27:06] 193400261 10.12 0.000929770758 +[2023-10-19 07:27:16] 193400261 10.11 0.000929766742 +[2023-10-19 07:27:26] 193400261 10.10 0.000929904804 +[2023-10-19 07:27:36] 193400261 10.09 0.000929921003 +[2023-10-19 07:27:46] 193400261 10.08 0.000929935894 +[2023-10-19 07:27:56] 193400261 10.08 0.000929858604 +[2023-10-19 07:28:06] 193400261 10.07 0.000929924955 +[2023-10-19 07:28:16] 193400261 10.06 0.000929857927 +[2023-10-19 07:28:26] 193400261 10.06 0.000929952330 +[2023-10-19 07:28:36] 193400261 10.04 0.000929886142 +[2023-10-19 07:28:46] 193400261 10.02 0.000929990866 +[2023-10-19 07:28:56] 193400261 10.00 0.000929997500 +[2023-10-19 07:29:06] 193400261 09.99 0.000930140034 +[2023-10-19 07:29:16] 193400261 10.00 0.000930060122 +[2023-10-19 07:29:26] 193400261 09.99 0.000930056600 +[2023-10-19 07:29:36] 193400261 09.98 0.000930069097 +[2023-10-19 07:29:46] 193400261 09.96 0.000930123305 +[2023-10-19 07:29:56] 193400261 09.94 0.000930187808 +[2023-10-19 07:30:06] 193400261 09.93 0.000930226084 +[2023-10-19 07:30:16] 193400261 09.92 0.000930325315 +[2023-10-19 07:30:26] 193400261 09.93 0.000930367654 +[2023-10-19 07:30:36] 193400261 09.93 0.000930235330 +[2023-10-19 07:30:46] 193400261 09.92 0.000930281483 +[2023-10-19 07:30:56] 193400261 09.90 0.000930235228 +[2023-10-19 07:31:06] 193400261 09.89 0.000930303548 +[2023-10-19 07:31:16] 193400261 09.87 0.000930300819 +[2023-10-19 07:31:26] 193400261 09.85 0.000930303971 +[2023-10-19 07:31:36] 193400261 09.84 0.000930435060 +[2023-10-19 07:31:46] 193400261 09.83 0.000930495835 +[2023-10-19 07:31:56] 193400261 09.83 0.000930520550 +[2023-10-19 07:32:06] 193400261 09.83 0.000930503388 +[2023-10-19 07:32:16] 193400261 09.82 0.000930467734 +[2023-10-19 07:32:26] 193400261 09.80 0.000930464720 +[2023-10-19 07:32:36] 193400261 09.80 0.000930477936 +[2023-10-19 07:32:46] 193400261 09.79 0.000930552433 +[2023-10-19 07:32:56] 193400261 09.78 0.000930668861 +[2023-10-19 07:33:06] 193400261 09.78 0.000930550493 +[2023-10-19 07:33:16] 193400261 09.77 0.000930564236 +[2023-10-19 07:33:26] 193400261 09.75 0.000930706164 +[2023-10-19 07:33:36] 193400261 09.74 0.000930706518 +[2023-10-19 07:33:46] 193400261 09.72 0.000930697524 +[2023-10-19 07:33:56] 193400261 09.70 0.000930698376 +[2023-10-19 07:34:06] 193400261 09.70 0.000930852905 +[2023-10-19 07:34:16] 193400261 09.69 0.000930790501 +[2023-10-19 07:34:26] 193400261 09.69 0.000930881619 +[2023-10-19 07:34:36] 193400261 09.68 0.000930883329 +[2023-10-19 07:34:46] 193400261 09.67 0.000930821214 +[2023-10-19 07:34:56] 193400261 09.65 0.000930942993 +[2023-10-19 07:35:06] 193400261 09.65 0.000930901849 +[2023-10-19 07:35:16] 193400261 09.64 0.000931004412 +[2023-10-19 07:35:26] 193400261 09.64 0.000930980184 +[2023-10-19 07:35:36] 193400261 09.63 0.000930947111 +[2023-10-19 07:35:46] 193400261 09.62 0.000930967396 +[2023-10-19 07:35:56] 193400261 09.60 0.000930973091 +[2023-10-19 07:36:06] 193400261 09.58 0.000930994771 +[2023-10-19 07:36:16] 193400261 09.56 0.000931053365 +[2023-10-19 07:36:26] 193400261 09.56 0.000931036889 +[2023-10-19 07:36:36] 193400261 09.55 0.000931138793 +[2023-10-19 07:36:46] 193400261 09.55 0.000931146766 +[2023-10-19 07:36:56] 193400261 09.55 0.000931133043 +[2023-10-19 07:37:06] 193400261 09.54 0.000931195186 +[2023-10-19 07:37:16] 193400261 09.53 0.000931205960 +[2023-10-19 07:37:26] 193400261 09.52 0.000931203637 +[2023-10-19 07:37:36] 193400261 09.51 0.000931242792 +[2023-10-19 07:37:46] 193400261 09.49 0.000931290899 +[2023-10-19 07:37:56] 193400261 09.48 0.000931307769 +[2023-10-19 07:38:06] 193400261 09.47 0.000931254140 +[2023-10-19 07:38:16] 193400261 09.47 0.000931402197 +[2023-10-19 07:38:26] 193400261 09.47 0.000931254408 +[2023-10-19 07:38:36] 193400261 09.45 0.000931375926 +[2023-10-19 07:38:46] 193400261 09.44 0.000931447212 +[2023-10-19 07:38:56] 193400261 09.43 0.000931448580 +[2023-10-19 07:39:06] 193400261 09.42 0.000931392790 +[2023-10-19 07:39:16] 193400261 09.41 0.000931387286 +[2023-10-19 07:39:26] 193400261 09.39 0.000931445787 +[2023-10-19 07:39:36] 193400261 09.38 0.000931427481 +[2023-10-19 07:39:46] 193400261 09.37 0.000931512289 +[2023-10-19 07:39:56] 193400261 09.36 0.000931527347 +[2023-10-19 07:40:06] 193400261 09.36 0.000931554867 +[2023-10-19 07:40:16] 193400261 09.35 0.000931570844 +[2023-10-19 07:40:26] 193400261 09.35 0.000931586348 +[2023-10-19 07:40:36] 193400261 09.34 0.000931659296 +[2023-10-19 07:40:46] 193400261 09.34 0.000931644175 +[2023-10-19 07:40:56] 193400261 09.33 0.000931598500 +[2023-10-19 07:41:06] 193400261 09.31 0.000931659866 +[2023-10-19 07:41:16] 193400261 09.30 0.000931668980 +[2023-10-19 07:41:26] 193400261 09.29 0.000931763705 +[2023-10-19 07:41:36] 193400261 09.28 0.000931760398 +[2023-10-19 07:41:46] 193400261 09.27 0.000931839363 +[2023-10-19 07:41:56] 193400261 09.26 0.000931867844 +[2023-10-19 07:42:06] 193400261 09.25 0.000931875541 +[2023-10-19 07:42:16] 193400261 09.24 0.000931788666 +[2023-10-19 07:42:26] 193400261 09.23 0.000931873854 +[2023-10-19 07:42:36] 193400261 09.22 0.000931955860 +[2023-10-19 07:42:46] 193400261 09.21 0.000931925459 +[2023-10-19 07:42:56] 193400261 09.21 0.000931987508 +[2023-10-19 07:43:06] 193400261 09.21 0.000931974740 +[2023-10-19 07:43:16] 193400261 09.20 0.000931950840 +[2023-10-19 07:43:27] 193400261 09.19 0.000932106781 +[2023-10-19 07:43:37] 193400261 09.18 0.000932111840 +[2023-10-19 07:43:47] 193400261 09.17 0.000932096593 +[2023-10-19 07:43:57] 193400261 09.15 0.000932118381 +[2023-10-19 07:44:07] 193400261 09.15 0.000932120058 +[2023-10-19 07:44:17] 193400261 09.14 0.000932136526 +[2023-10-19 07:44:27] 193400261 09.12 0.000932205730 +[2023-10-19 07:44:37] 193400261 09.11 0.000932148378 +[2023-10-19 07:44:47] 193400261 09.12 0.000932120492 +[2023-10-19 07:44:57] 193400261 09.11 0.000932140896 +[2023-10-19 07:45:07] 193400261 09.11 0.000932274517 +[2023-10-19 07:45:17] 193400261 09.09 0.000932213062 +[2023-10-19 07:45:27] 193400261 09.08 0.000932260120 +[2023-10-19 07:45:37] 193400261 09.07 0.000932326204 +[2023-10-19 07:45:47] 193400261 09.05 0.000932258993 +[2023-10-19 07:45:57] 193400261 09.04 0.000932420744 +[2023-10-19 07:46:07] 193400261 09.04 0.000932295291 +[2023-10-19 07:46:17] 193400261 09.03 0.000932450579 +[2023-10-19 07:46:27] 193400261 09.02 0.000932334212 +[2023-10-19 07:46:37] 193400261 09.02 0.000932431004 +[2023-10-19 07:46:47] 193400261 09.01 0.000932400030 +[2023-10-19 07:46:57] 193400261 08.99 0.000932497132 +[2023-10-19 07:47:07] 193400261 08.99 0.000932425965 +[2023-10-19 07:47:17] 193400261 08.99 0.000932524749 +[2023-10-19 07:47:27] 193400261 08.98 0.000932558916 +[2023-10-19 07:47:37] 193400261 08.97 0.000932574857 +[2023-10-19 07:47:47] 193400261 08.96 0.000932614327 +[2023-10-19 07:47:57] 193400261 08.95 0.000932592233 +[2023-10-19 07:48:07] 193400261 08.93 0.000932588086 +[2023-10-19 07:48:17] 193400261 08.92 0.000932666069 +[2023-10-19 07:48:27] 193400261 08.92 0.000932701133 +[2023-10-19 07:48:37] 193400261 08.92 0.000932638859 +[2023-10-19 07:48:47] 193400261 08.90 0.000932698454 +[2023-10-19 07:48:57] 193400261 08.90 0.000932736951 +[2023-10-19 07:49:07] 193400261 08.88 0.000932766270 +[2023-10-19 07:49:17] 193400261 08.88 0.000932705085 +[2023-10-19 07:49:27] 193400261 08.88 0.000932697160 +[2023-10-19 07:49:37] 193400261 08.86 0.000932727296 +[2023-10-19 07:49:47] 193400261 08.86 0.000932865565 +[2023-10-19 07:49:57] 193400261 08.85 0.000932851773 +[2023-10-19 07:50:07] 193400261 08.85 0.000932815442 +[2023-10-19 07:50:17] 193400261 08.83 0.000932873558 +[2023-10-19 07:50:27] 193400261 08.82 0.000932880823 +[2023-10-19 07:50:37] 193400261 08.81 0.000932847132 +[2023-10-19 07:50:47] 193400261 08.80 0.000932849755 +[2023-10-19 07:50:57] 193400261 08.79 0.000932954675 +[2023-10-19 07:51:07] 193400261 08.78 0.000932924551 +[2023-10-19 07:51:17] 193400261 08.78 0.000933055722 +[2023-10-19 07:51:27] 193400261 08.77 0.000932973091 +[2023-10-19 07:51:37] 193400261 08.76 0.000933059986 +[2023-10-19 07:51:47] 193400261 08.75 0.000933080200 +[2023-10-19 07:51:57] 193400261 08.75 0.000933046952 +[2023-10-19 07:52:07] 193400261 08.74 0.000933052420 +[2023-10-19 07:52:17] 193400261 08.72 0.000933126959 +[2023-10-19 07:52:27] 193400261 08.72 0.000933128972 +[2023-10-19 07:52:37] 193400261 08.72 0.000933115482 +[2023-10-19 07:52:47] 193400261 08.71 0.000933153922 +[2023-10-19 07:52:57] 193400261 08.69 0.000933249327 +[2023-10-19 07:53:07] 193400261 08.68 0.000933157744 +[2023-10-19 07:53:17] 193400261 08.67 0.000933231275 +[2023-10-19 07:53:27] 193400261 08.66 0.000933273023 +[2023-10-19 07:53:37] 193400261 08.66 0.000933247261 +[2023-10-19 07:53:47] 193400261 08.65 0.000933256080 +[2023-10-19 07:53:57] 193400261 08.65 0.000933376472 +[2023-10-19 07:54:07] 193400261 08.64 0.000933289262 +[2023-10-19 07:54:17] 193400261 08.63 0.000933321721 +[2023-10-19 07:54:27] 193400261 08.62 0.000933340378 +[2023-10-19 07:54:37] 193400261 08.62 0.000933343242 +[2023-10-19 07:54:47] 193400261 08.61 0.000933366671 +[2023-10-19 07:54:57] 193400261 08.60 0.000933424294 +[2023-10-19 07:55:07] 193400261 08.59 0.000933492600 +[2023-10-19 07:55:17] 193400261 08.58 0.000933389158 +[2023-10-19 07:55:27] 193400261 08.57 0.000933504100 +[2023-10-19 07:55:37] 193400261 08.56 0.000933521190 +[2023-10-19 07:55:47] 193400261 08.55 0.000933500270 +[2023-10-19 07:55:57] 193400261 08.55 0.000933570242 +[2023-10-19 07:56:07] 193400261 08.54 0.000933554955 +[2023-10-19 07:56:17] 193400261 08.52 0.000933615533 +[2023-10-19 07:56:27] 193400261 08.52 0.000933630302 +[2023-10-19 07:56:37] 193400261 08.52 0.000933646338 +[2023-10-19 07:56:47] 193400261 08.51 0.000933755833 +[2023-10-19 07:56:57] 193400261 08.51 0.000933630100 +[2023-10-19 07:57:07] 193400261 08.49 0.000933778058 +[2023-10-19 07:57:17] 193400261 08.48 0.000933740253 +[2023-10-19 07:57:27] 193400261 08.48 0.000933670370 +[2023-10-19 07:57:37] 193400261 08.47 0.000933659125 +[2023-10-19 07:57:47] 193400261 08.46 0.000933865436 +[2023-10-19 07:57:57] 193400261 08.46 0.000933815906 +[2023-10-19 07:58:07] 193400261 08.45 0.000933838781 +[2023-10-19 07:58:17] 193400261 08.44 0.000933879693 +[2023-10-19 07:58:27] 193400261 08.43 0.000933856997 +[2023-10-19 07:58:37] 193400261 08.43 0.000933838768 +[2023-10-19 07:58:47] 193400261 08.42 0.000933906892 +[2023-10-19 07:58:57] 193400261 08.41 0.000933938569 +[2023-10-19 07:59:07] 193400261 08.39 0.000933954088 +[2023-10-19 07:59:17] 193400261 08.39 0.000933901975 +[2023-10-19 07:59:27] 193400261 08.37 0.000933964165 +[2023-10-19 07:59:37] 193400261 08.36 0.000934064787 +[2023-10-19 07:59:47] 193400261 08.36 0.000934007519 +[2023-10-19 07:59:57] 193400261 08.36 0.000934063891 +[2023-10-19 08:00:07] 193400261 08.34 0.000934122550 +[2023-10-19 08:00:17] 193400261 08.34 0.000934002161 +[2023-10-19 08:00:27] 193400261 08.33 0.000934056723 +[2023-10-19 08:00:37] 193400261 08.32 0.000934103439 +[2023-10-19 08:00:47] 193400261 08.32 0.000934110895 +[2023-10-19 08:00:57] 193400261 08.31 0.000934084717 +[2023-10-19 08:01:07] 193400261 08.30 0.000934203851 +[2023-10-19 08:01:17] 193400261 08.30 0.000934185568 +[2023-10-19 08:01:27] 193400261 08.28 0.000934236136 +[2023-10-19 08:01:37] 193400261 08.28 0.000934254869 +[2023-10-19 08:01:47] 193400261 08.27 0.000934277616 +[2023-10-19 08:01:57] 193400261 08.26 0.000934294345 +[2023-10-19 08:02:07] 193400261 08.26 0.000934260260 +[2023-10-19 08:02:17] 193400261 08.26 0.000934236173 +[2023-10-19 08:02:27] 193400261 08.26 0.000934307690 +[2023-10-19 08:02:37] 193400261 08.24 0.000934427044 +[2023-10-19 08:02:47] 193400261 08.23 0.000934369330 +[2023-10-19 08:02:58] 193400261 08.23 0.000934328090 +[2023-10-19 08:03:08] 193400261 08.22 0.000934448167 +[2023-10-19 08:03:18] 193400261 08.20 0.000934340802 +[2023-10-19 08:03:28] 193400261 08.19 0.000934513024 +[2023-10-19 08:03:38] 193400261 08.18 0.000934481981 +[2023-10-19 08:03:48] 193400261 08.17 0.000934407615 +[2023-10-19 08:03:58] 193400261 08.17 0.000934436751 +[2023-10-19 08:04:08] 193400261 08.17 0.000934520878 +[2023-10-19 08:04:18] 193400261 08.16 0.000934560727 +[2023-10-19 08:04:28] 193400261 08.16 0.000934622003 +[2023-10-19 08:04:38] 193400261 08.15 0.000934666293 +[2023-10-19 08:04:48] 193400261 08.16 0.000934676612 +[2023-10-19 08:04:58] 193400261 08.14 0.000934571522 +[2023-10-19 08:05:08] 193400261 08.12 0.000934649592 +[2023-10-19 08:05:18] 193400261 08.10 0.000934561127 +[2023-10-19 08:05:28] 193400261 08.10 0.000934737102 +[2023-10-19 08:05:38] 193400261 08.10 0.000934652500 +[2023-10-19 08:05:48] 193400261 08.09 0.000934699733 +[2023-10-19 08:05:58] 193400261 08.08 0.000934719813 +[2023-10-19 08:06:08] 193400261 08.08 0.000934787502 +[2023-10-19 08:06:18] 193400261 08.07 0.000934848927 +[2023-10-19 08:06:28] 193400261 08.06 0.000934781516 +[2023-10-19 08:06:38] 193400261 08.06 0.000934756946 +[2023-10-19 08:06:48] 193400261 08.05 0.000934718247 +[2023-10-19 08:06:58] 193400261 08.04 0.000934848746 +[2023-10-19 08:07:08] 193400261 08.04 0.000934851285 +[2023-10-19 08:07:18] 193400261 08.03 0.000934838565 +[2023-10-19 08:07:28] 193400261 08.02 0.000934882624 +[2023-10-19 08:07:38] 193400261 08.00 0.000934965232 +[2023-10-19 08:07:48] 193400261 08.00 0.000934865231 +[2023-10-19 08:07:58] 193400261 08.00 0.000934912966 +[2023-10-19 08:08:08] 193400261 07.99 0.000935035530 +[2023-10-19 08:08:18] 193400261 07.98 0.000935015762 +[2023-10-19 08:08:28] 193400261 07.97 0.000935031659 +[2023-10-19 08:08:38] 193400261 07.97 0.000935085736 +[2023-10-19 08:08:48] 193400261 07.96 0.000935060024 +[2023-10-19 08:08:58] 193400261 07.95 0.000935049023 +[2023-10-19 08:09:08] 193400261 07.94 0.000935091173 +[2023-10-19 08:09:18] 193400261 07.93 0.000935142807 +[2023-10-19 08:09:28] 193400261 07.93 0.000934996997 +[2023-10-19 08:09:38] 193400261 07.92 0.000935081756 +[2023-10-19 08:09:48] 193400261 07.92 0.000935168555 +[2023-10-19 08:09:58] 193400261 07.91 0.000935192683 +[2023-10-19 08:10:08] 193400261 07.91 0.000935184853 +[2023-10-19 08:10:18] 193400261 07.91 0.000935239985 +[2023-10-19 08:10:28] 193400261 07.89 0.000935262730 +[2023-10-19 08:10:38] 193400261 07.88 0.000935235521 +[2023-10-19 08:10:48] 193400261 07.87 0.000935159520 +[2023-10-19 08:10:58] 193400261 07.87 0.000935195374 +[2023-10-19 08:11:08] 193400261 07.85 0.000935281594 +[2023-10-19 08:11:18] 193400261 07.84 0.000935318670 +[2023-10-19 08:11:28] 193400261 07.84 0.000935246790 +[2023-10-19 08:11:38] 193400261 07.84 0.000935270212 +[2023-10-19 08:11:48] 193400261 07.83 0.000935466596 +[2023-10-19 08:11:58] 193400261 07.82 0.000935415108 +[2023-10-19 08:12:08] 193400261 07.81 0.000935454145 +[2023-10-19 08:12:18] 193400261 07.81 0.000935380091 +[2023-10-19 08:12:28] 193400261 07.80 0.000935462254 +[2023-10-19 08:12:38] 193400261 07.80 0.000935479060 +[2023-10-19 08:12:48] 193400261 07.80 0.000935438489 +[2023-10-19 08:12:58] 193400261 07.79 0.000935503663 +[2023-10-19 08:13:08] 193400261 07.78 0.000935536079 +[2023-10-19 08:13:18] 193400261 07.77 0.000935485576 +[2023-10-19 08:13:28] 193400261 07.77 0.000935615051 +[2023-10-19 08:13:38] 193400261 07.77 0.000935499128 +[2023-10-19 08:13:48] 193400261 07.75 0.000935555302 +[2023-10-19 08:13:58] 193400261 07.74 0.000935694498 +[2023-10-19 08:14:08] 193400261 07.73 0.000935616205 +[2023-10-19 08:14:18] 193400261 07.72 0.000935679388 +[2023-10-19 08:14:28] 193400261 07.72 0.000935654789 +[2023-10-19 08:14:38] 193400261 07.71 0.000935643964 +[2023-10-19 08:14:48] 193400261 07.70 0.000935697364 +[2023-10-19 08:14:58] 193400261 07.70 0.000935695203 +[2023-10-19 08:15:08] 193400261 07.69 0.000935689177 +[2023-10-19 08:15:18] 193400261 07.68 0.000935712689 +[2023-10-19 08:15:28] 193400261 07.68 0.000935749999 +[2023-10-19 08:15:38] 193400261 07.68 0.000935686549 +[2023-10-19 08:15:48] 193400261 07.66 0.000935751145 +[2023-10-19 08:15:58] 193400261 07.66 0.000935790186 +[2023-10-19 08:16:08] 193400261 07.65 0.000935775910 +[2023-10-19 08:16:18] 193400261 07.65 0.000935804239 +[2023-10-19 08:16:28] 193400261 07.64 0.000935964067 +[2023-10-19 08:16:38] 193400261 07.64 0.000935853384 +[2023-10-19 08:16:48] 193400261 07.63 0.000935932076 +[2023-10-19 08:16:58] 193400261 07.62 0.000935928061 +[2023-10-19 08:17:08] 193400261 07.61 0.000935934211 +[2023-10-19 08:17:18] 193400261 07.60 0.000935905574 +[2023-10-19 08:17:28] 193400261 07.59 0.000935992399 +[2023-10-19 08:17:38] 193400261 07.58 0.000935922592 +[2023-10-19 08:17:48] 193400261 07.58 0.000936011680 +[2023-10-19 08:17:58] 193400261 07.58 0.000936078536 +[2023-10-19 08:18:08] 193400261 07.56 0.000935959983 +[2023-10-19 08:18:18] 193400261 07.57 0.000936090890 +[2023-10-19 08:18:28] 193400261 07.56 0.000936072218 +[2023-10-19 08:18:38] 193400261 07.55 0.000936018082 +[2023-10-19 08:18:48] 193400261 07.55 0.000935992486 +[2023-10-19 08:18:58] 193400261 07.55 0.000936075483 +[2023-10-19 08:19:08] 193400261 07.54 0.000936236371 +[2023-10-19 08:19:18] 193400261 07.53 0.000936174083 +[2023-10-19 08:19:28] 193400261 07.52 0.000936150213 +[2023-10-19 08:19:38] 193400261 07.51 0.000936145442 +[2023-10-19 08:19:48] 193400261 07.50 0.000936231126 +[2023-10-19 08:19:58] 193400261 07.50 0.000936226986 +[2023-10-19 08:20:08] 193400261 07.49 0.000936240449 +[2023-10-19 08:20:18] 193400261 07.48 0.000936305704 +[2023-10-19 08:20:28] 193400261 07.46 0.000936272734 +[2023-10-19 08:20:38] 193400261 07.45 0.000936268731 +[2023-10-19 08:20:48] 193400261 07.45 0.000936401160 +[2023-10-19 08:20:58] 193400261 07.45 0.000936427613 +[2023-10-19 08:21:08] 193400261 07.45 0.000936369334 +[2023-10-19 08:21:18] 193400261 07.44 0.000936404280 +[2023-10-19 08:21:28] 193400261 07.44 0.000936308644 +[2023-10-19 08:21:38] 193400261 07.43 0.000936384436 +[2023-10-19 08:21:49] 193400261 07.42 0.000936437921 +[2023-10-19 08:21:59] 193400261 07.42 0.000936396352 +[2023-10-19 08:22:09] 193400261 07.42 0.000936443054 +[2023-10-19 08:22:19] 193400261 07.41 0.000936366962 +[2023-10-19 08:22:29] 193400261 07.40 0.000936444318 +[2023-10-19 08:22:39] 193400261 07.39 0.000936416366 +[2023-10-19 08:22:49] 193400261 07.39 0.000936417104 +[2023-10-19 08:22:59] 193400261 07.38 0.000936526089 +[2023-10-19 08:23:09] 193400261 07.37 0.000936539348 +[2023-10-19 08:23:19] 193400261 07.36 0.000936571206 +[2023-10-19 08:23:29] 193400261 07.35 0.000936574926 +[2023-10-19 08:23:39] 193400261 07.35 0.000936592392 +[2023-10-19 08:23:49] 193400261 07.34 0.000936613261 +[2023-10-19 08:23:59] 193400261 07.34 0.000936577396 +[2023-10-19 08:24:09] 193400261 07.33 0.000936583661 +[2023-10-19 08:24:19] 193400261 07.32 0.000936588804 +[2023-10-19 08:24:29] 193400261 07.32 0.000936674187 +[2023-10-19 08:24:39] 193400261 07.31 0.000936691542 +[2023-10-19 08:24:49] 193400261 07.30 0.000936656366 +[2023-10-19 08:24:59] 193400261 07.30 0.000936727608 +[2023-10-19 08:25:09] 193400261 07.29 0.000936664181 +[2023-10-19 08:25:19] 193400261 07.28 0.000936712068 +[2023-10-19 08:25:29] 193400261 07.28 0.000936847053 +[2023-10-19 08:25:39] 193400261 07.28 0.000936784972 +[2023-10-19 08:25:49] 193400261 07.27 0.000936776251 +[2023-10-19 08:25:59] 193400261 07.26 0.000936789006 +[2023-10-19 08:26:09] 193400261 07.26 0.000936852644 +[2023-10-19 08:26:19] 193400261 07.25 0.000936871142 +[2023-10-19 08:26:29] 193400261 07.25 0.000936807498 +[2023-10-19 08:26:39] 193400261 07.24 0.000936924019 +[2023-10-19 08:26:49] 193400261 07.24 0.000936916966 +[2023-10-19 08:26:59] 193400261 07.22 0.000936875576 +[2023-10-19 08:27:09] 193400261 07.21 0.000937048759 +[2023-10-19 08:27:19] 193400261 07.21 0.000936932350 +[2023-10-19 08:27:29] 193400261 07.19 0.000936933655 +[2023-10-19 08:27:39] 193400261 07.19 0.000937004117 +[2023-10-19 08:27:49] 193400261 07.19 0.000936955084 +[2023-10-19 08:27:59] 193400261 07.18 0.000937026306 +[2023-10-19 08:28:09] 193400261 07.18 0.000937059293 +[2023-10-19 08:28:19] 193400261 07.18 0.000937037602 +[2023-10-19 08:28:29] 193400261 07.17 0.000937027539 +[2023-10-19 08:28:39] 193400261 07.16 0.000937069895 +[2023-10-19 08:28:49] 193400261 07.16 0.000937003050 +[2023-10-19 08:28:59] 193400261 07.15 0.000937066550 +[2023-10-19 08:29:09] 193400261 07.15 0.000937036892 +[2023-10-19 08:29:19] 193400261 07.14 0.000937195311 +[2023-10-19 08:29:29] 193400261 07.13 0.000937099109 +[2023-10-19 08:29:39] 193400261 07.12 0.000937103696 +[2023-10-19 08:29:49] 193400261 07.12 0.000937221588 +[2023-10-19 08:29:59] 193400261 07.11 0.000937184294 +[2023-10-19 08:30:09] 193400261 07.10 0.000937184776 +[2023-10-19 08:30:19] 193400261 07.09 0.000937190196 +[2023-10-19 08:30:29] 193400261 07.09 0.000937213652 +[2023-10-19 08:30:39] 193400261 07.08 0.000937297899 +[2023-10-19 08:30:49] 193400261 07.07 0.000937247287 +[2023-10-19 08:30:59] 193400261 07.07 0.000937310911 +[2023-10-19 08:31:09] 193400261 07.07 0.000937253531 +[2023-10-19 08:31:19] 193400261 07.06 0.000937314647 +[2023-10-19 08:31:29] 193400261 07.05 0.000937284962 +[2023-10-19 08:31:39] 193400261 07.05 0.000937464910 +[2023-10-19 08:31:49] 193400261 07.05 0.000937376663 +[2023-10-19 08:31:59] 193400261 07.04 0.000937347551 +[2023-10-19 08:32:09] 193400261 07.03 0.000937443465 +[2023-10-19 08:32:19] 193400261 07.02 0.000937447394 +[2023-10-19 08:32:29] 193400261 07.02 0.000937381261 +[2023-10-19 08:32:39] 193400261 07.01 0.000937490784 +[2023-10-19 08:32:49] 193400261 06.99 0.000937565222 +[2023-10-19 08:32:59] 193400261 06.99 0.000937503539 +[2023-10-19 08:33:09] 193400261 06.99 0.000937489126 +[2023-10-19 08:33:19] 193400261 06.98 0.000937546802 +[2023-10-19 08:33:29] 193400261 06.98 0.000937441140 +[2023-10-19 08:33:39] 193400261 06.97 0.000937530560 +[2023-10-19 08:33:49] 193400261 06.96 0.000937546181 +[2023-10-19 08:33:59] 193400261 06.96 0.000937535848 +[2023-10-19 08:34:09] 193400261 06.96 0.000937576501 +[2023-10-19 08:34:19] 193400261 06.95 0.000937703427 +[2023-10-19 08:34:29] 193400261 06.94 0.000937636713 +[2023-10-19 08:34:39] 193400261 06.93 0.000937579694 +[2023-10-19 08:34:49] 193400261 06.92 0.000937666605 +[2023-10-19 08:34:59] 193400261 06.92 0.000937604240 +[2023-10-19 08:35:09] 193400261 06.92 0.000937626812 +[2023-10-19 08:35:19] 193400261 06.91 0.000937707414 +[2023-10-19 08:35:29] 193400261 06.91 0.000937668925 +[2023-10-19 08:35:39] 193400261 06.90 0.000937728148 +[2023-10-19 08:35:49] 193400261 06.90 0.000937728356 +[2023-10-19 08:35:59] 193400261 06.89 0.000937748562 +[2023-10-19 08:36:09] 193400261 06.89 0.000937781172 +[2023-10-19 08:36:19] 193400261 06.88 0.000937764467 +[2023-10-19 08:36:29] 193400261 06.88 0.000937726830 +[2023-10-19 08:36:39] 193400261 06.87 0.000937928427 +[2023-10-19 08:36:49] 193400261 06.86 0.000937898754 +[2023-10-19 08:36:59] 193400261 06.86 0.000937880808 +[2023-10-19 08:37:09] 193400261 06.85 0.000937877348 +[2023-10-19 08:37:19] 193400261 06.84 0.000937876832 +[2023-10-19 08:37:29] 193400261 06.84 0.000937926789 +[2023-10-19 08:37:39] 193400261 06.82 0.000937979122 +[2023-10-19 08:37:49] 193400261 06.83 0.000937993357 +[2023-10-19 08:37:59] 193400261 06.82 0.000937943221 +[2023-10-19 08:38:09] 193400261 06.81 0.000937960851 +[2023-10-19 08:38:19] 193400261 06.81 0.000938081239 +[2023-10-19 08:38:29] 193400261 06.80 0.000937990359 +[2023-10-19 08:38:39] 193400261 06.79 0.000937981010 +[2023-10-19 08:38:49] 193400261 06.79 0.000937968808 +[2023-10-19 08:38:59] 193400261 06.78 0.000938033883 +[2023-10-19 08:39:09] 193400261 06.77 0.000938053607 +[2023-10-19 08:39:19] 193400261 06.77 0.000938005208 +[2023-10-19 08:39:29] 193400261 06.76 0.000938160609 +[2023-10-19 08:39:39] 193400261 06.76 0.000938089499 +[2023-10-19 08:39:49] 193400261 06.76 0.000938139917 +[2023-10-19 08:39:59] 193400261 06.75 0.000938203636 +[2023-10-19 08:40:09] 193400261 06.74 0.000938087065 +[2023-10-19 08:40:19] 193400261 06.74 0.000938134833 +[2023-10-19 08:40:29] 193400261 06.73 0.000938225976 +[2023-10-19 08:40:39] 193400261 06.73 0.000938100769 +[2023-10-19 08:40:49] 193400261 06.72 0.000938233421 +[2023-10-19 08:40:59] 193400261 06.72 0.000938211912 +[2023-10-19 08:41:09] 193400261 06.70 0.000938240068 +[2023-10-19 08:41:19] 193400261 06.70 0.000938346650 +[2023-10-19 08:41:30] 193400261 06.69 0.000938278736 +[2023-10-19 08:41:40] 193400261 06.69 0.000938269205 +[2023-10-19 08:41:50] 193400261 06.68 0.000938261116 +[2023-10-19 08:42:00] 193400261 06.68 0.000938289474 +[2023-10-19 08:42:10] 193400261 06.67 0.000938330637 +[2023-10-19 08:42:20] 193400261 06.66 0.000938314813 +[2023-10-19 08:42:30] 193400261 06.66 0.000938400284 +[2023-10-19 08:42:40] 193400261 06.66 0.000938431057 +[2023-10-19 08:42:50] 193400261 06.66 0.000938319703 +[2023-10-19 08:43:00] 193400261 06.65 0.000938394218 +[2023-10-19 08:43:10] 193400261 06.64 0.000938322292 +[2023-10-19 08:43:20] 193400261 06.63 0.000938466788 +[2023-10-19 08:43:30] 193400261 06.63 0.000938434553 +[2023-10-19 08:43:40] 193400261 06.63 0.000938376630 +[2023-10-19 08:43:50] 193400261 06.63 0.000938444978 +[2023-10-19 08:44:00] 193400261 06.62 0.000938459521 +[2023-10-19 08:44:10] 193400261 06.61 0.000938473302 +[2023-10-19 08:44:20] 193400261 06.61 0.000938514151 +[2023-10-19 08:44:30] 193400261 06.60 0.000938537946 +[2023-10-19 08:44:40] 193400261 06.60 0.000938553602 +[2023-10-19 08:44:50] 193400261 06.60 0.000938631260 +[2023-10-19 08:45:00] 193400261 06.59 0.000938584682 +[2023-10-19 08:45:10] 193400261 06.58 0.000938517173 +[2023-10-19 08:45:20] 193400261 06.57 0.000938533557 +[2023-10-19 08:45:30] 193400261 06.57 0.000938687227 +[2023-10-19 08:45:40] 193400261 06.56 0.000938645198 +[2023-10-19 08:45:50] 193400261 06.55 0.000938685482 +[2023-10-19 08:46:00] 193400261 06.54 0.000938679251 +[2023-10-19 08:46:10] 193400261 06.53 0.000938634852 +[2023-10-19 08:46:20] 193400261 06.53 0.000938629330 +[2023-10-19 08:46:30] 193400261 06.53 0.000938821557 +[2023-10-19 08:46:40] 193400261 06.52 0.000938699007 +[2023-10-19 08:46:50] 193400261 06.52 0.000938766867 +[2023-10-19 08:47:00] 193400261 06.51 0.000938728061 +[2023-10-19 08:47:10] 193400261 06.51 0.000938753142 +[2023-10-19 08:47:20] 193400261 06.50 0.000938742856 +[2023-10-19 08:47:30] 193400261 06.50 0.000938823128 +[2023-10-19 08:47:40] 193400261 06.50 0.000938820635 +[2023-10-19 08:47:50] 193400261 06.50 0.000938803816 +[2023-10-19 08:48:00] 193400261 06.49 0.000938894855 +[2023-10-19 08:48:10] 193400261 06.49 0.000938853531 +[2023-10-19 08:48:20] 193400261 06.48 0.000938866138 +[2023-10-19 08:48:30] 193400261 06.47 0.000938854242 +[2023-10-19 08:48:40] 193400261 06.46 0.000938902988 +[2023-10-19 08:48:50] 193400261 06.46 0.000938862089 +[2023-10-19 08:49:00] 193400261 06.45 0.000939009009 +[2023-10-19 08:49:10] 193400261 06.44 0.000938957221 +[2023-10-19 08:49:20] 193400261 06.44 0.000938923726 +[2023-10-19 08:49:30] 193400261 06.43 0.000938952826 +[2023-10-19 08:49:40] 193400261 06.43 0.000938985827 +[2023-10-19 08:49:50] 193400261 06.43 0.000938956302 +[2023-10-19 08:50:00] 193400261 06.42 0.000938925641 +[2023-10-19 08:50:10] 193400261 06.41 0.000939046058 +[2023-10-19 08:50:20] 193400261 06.40 0.000939028024 +[2023-10-19 08:50:30] 193400261 06.41 0.000939134952 +[2023-10-19 08:50:40] 193400261 06.40 0.000939098105 +[2023-10-19 08:50:50] 193400261 06.39 0.000938969292 +[2023-10-19 08:51:00] 193400261 06.39 0.000939094356 +[2023-10-19 08:51:10] 193400261 06.38 0.000939102537 +[2023-10-19 08:51:20] 193400261 06.38 0.000939209877 +[2023-10-19 08:51:30] 193400261 06.37 0.000939092849 +[2023-10-19 08:51:40] 193400261 06.37 0.000939160062 +[2023-10-19 08:51:50] 193400261 06.36 0.000939114255 +[2023-10-19 08:52:00] 193400261 06.36 0.000939169559 +[2023-10-19 08:52:10] 193400261 06.35 0.000939115424 +[2023-10-19 08:52:20] 193400261 06.35 0.000939129756 +[2023-10-19 08:52:30] 193400261 06.34 0.000939182887 +[2023-10-19 08:52:40] 193400261 06.33 0.000939225483 +[2023-10-19 08:52:50] 193400261 06.33 0.000939252801 +[2023-10-19 08:53:00] 193400261 06.32 0.000939170076 +[2023-10-19 08:53:10] 193400261 06.32 0.000939263008 +[2023-10-19 08:53:20] 193400261 06.31 0.000939306763 +[2023-10-19 08:53:30] 193400261 06.31 0.000939299890 +[2023-10-19 08:53:40] 193400261 06.30 0.000939293929 +[2023-10-19 08:53:50] 193400261 06.30 0.000939389356 +[2023-10-19 08:54:00] 193400261 06.30 0.000939381220 +[2023-10-19 08:54:10] 193400261 06.29 0.000939357017 +[2023-10-19 08:54:20] 193400261 06.29 0.000939365692 +[2023-10-19 08:54:30] 193400261 06.28 0.000939360910 +[2023-10-19 08:54:40] 193400261 06.28 0.000939423333 +[2023-10-19 08:54:50] 193400261 06.27 0.000939377612 +[2023-10-19 08:55:00] 193400261 06.27 0.000939436668 +[2023-10-19 08:55:10] 193400261 06.27 0.000939434610 +[2023-10-19 08:55:20] 193400261 06.26 0.000939342810 +[2023-10-19 08:55:30] 193400261 06.24 0.000939468062 +[2023-10-19 08:55:40] 193400261 06.24 0.000939477332 +[2023-10-19 08:55:50] 193400261 06.24 0.000939478085 +[2023-10-19 08:56:00] 193400261 06.24 0.000939460839 +[2023-10-19 08:56:10] 193400261 06.23 0.000939420795 +[2023-10-19 08:56:20] 193400261 06.22 0.000939451716 +[2023-10-19 08:56:30] 193400261 06.22 0.000939500909 +[2023-10-19 08:56:40] 193400261 06.22 0.000939550170 +[2023-10-19 08:56:50] 193400261 06.21 0.000939564164 +[2023-10-19 08:57:00] 193400261 06.20 0.000939489920 +[2023-10-19 08:57:10] 193400261 06.20 0.000939546966 +[2023-10-19 08:57:20] 193400261 06.20 0.000939505965 +[2023-10-19 08:57:30] 193400261 06.19 0.000939574935 +[2023-10-19 08:57:40] 193400261 06.18 0.000939642518 +[2023-10-19 08:57:50] 193400261 06.19 0.000939579869 +[2023-10-19 08:58:00] 193400261 06.18 0.000939709187 +[2023-10-19 08:58:10] 193400261 06.18 0.000939625642 +[2023-10-19 08:58:20] 193400261 06.18 0.000939594838 +[2023-10-19 08:58:30] 193400261 06.17 0.000939767375 +[2023-10-19 08:58:40] 193400261 06.16 0.000939775462 +[2023-10-19 08:58:50] 193400261 06.15 0.000939722404 +[2023-10-19 08:59:00] 193400261 06.14 0.000939743050 +[2023-10-19 08:59:10] 193400261 06.14 0.000939675400 +[2023-10-19 08:59:20] 193400261 06.14 0.000939728593 +[2023-10-19 08:59:30] 193400261 06.13 0.000939768472 +[2023-10-19 08:59:40] 193400261 06.13 0.000939797785 +[2023-10-19 08:59:50] 193400261 06.12 0.000939829483 +[2023-10-19 09:00:00] 193400261 06.11 0.000939788618 +[2023-10-19 09:00:10] 193400261 06.11 0.000939817960 +[2023-10-19 09:00:20] 193400261 06.11 0.000939865006 +[2023-10-19 09:00:30] 193400261 06.10 0.000939828070 +[2023-10-19 09:00:40] 193400261 06.11 0.000939894526 +[2023-10-19 09:00:50] 193400261 06.10 0.000939901414 +[2023-10-19 09:01:00] 193400261 06.10 0.000939847717 +[2023-10-19 09:01:10] 193400261 06.09 0.000939934254 +[2023-10-19 09:01:20] 193400261 06.08 0.000939950570 +[2023-10-19 09:01:31] 193400261 06.07 0.000939850466 +[2023-10-19 09:01:41] 193400261 06.07 0.000939873691 +[2023-10-19 09:01:51] 193400261 06.07 0.000939946450 +[2023-10-19 09:02:01] 193400261 06.06 0.000939992580 +[2023-10-19 09:02:11] 193400261 06.06 0.000940067073 +[2023-10-19 09:02:21] 193400261 06.05 0.000939968249 +[2023-10-19 09:02:31] 193400261 06.04 0.000939978130 +[2023-10-19 09:02:41] 193400261 06.04 0.000940131047 +[2023-10-19 09:02:51] 193400261 06.04 0.000939995537 +[2023-10-19 09:03:01] 193400261 06.03 0.000940038811 +[2023-10-19 09:03:11] 193400261 06.03 0.000940118625 +[2023-10-19 09:03:21] 193400261 06.01 0.000940106776 +[2023-10-19 09:03:31] 193400261 06.01 0.000940079175 +[2023-10-19 09:03:41] 193400261 06.01 0.000940079566 +[2023-10-19 09:03:51] 193400261 06.01 0.000940035029 +[2023-10-19 09:04:01] 193400261 06.01 0.000940115054 +[2023-10-19 09:04:11] 193400261 06.00 0.000940167452 +[2023-10-19 09:04:21] 193400261 06.00 0.000940210180 \ No newline at end of file diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_messurements.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/193400261_messurements.txt new file mode 100644 index 00000000..e69de29b diff --git a/Common/CommonConsole/temperature_calibrations_26_10_2023/temp.txt b/Common/CommonConsole/temperature_calibrations_26_10_2023/temp.txt new file mode 100644 index 00000000..9358aa7a --- /dev/null +++ b/Common/CommonConsole/temperature_calibrations_26_10_2023/temp.txt @@ -0,0 +1,48 @@ +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 06.47, 0.0009391250, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 07.30, 0.0009369401, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 08.85, 0.0009330479, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 10.91, 0.0009284861, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 12.76, 0.0009245231, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 14.91, 0.0009202363, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 16.62, 0.0009168799, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 18.80, 0.0009130502, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 20.81, 0.0009097416, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 22.98, 0.0009064282, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 24.86, 0.0009036648, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 26.97, 0.0009008063, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 28.94, 0.0008982777, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 30.64, 0.0008962144, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 32.78, 0.0008938249, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400032, 34.73, 0.0008917956, 1); + +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 34.07, 0.000892907528, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 33.03, 0.000893811517, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 32.06, 0.000894714143, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 31.03, 0.000895775645, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 30.05, 0.000896887993, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 29.00, 0.000898176183, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 28.00, 0.000899393868, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 27.08, 0.000900525206, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 26.00, 0.000901910933, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 25.06, 0.000903268325, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 24.00, 0.000904691165, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 23.01, 0.000906111094, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 22.00, 0.000907550173, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 21.06, 0.000908980642, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 20.01, 0.000910595651, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 19.00, 0.000912284434, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 18.04, 0.000913953382, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 17.00, 0.000915812810, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 16.01, 0.000917596480, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 15.00, 0.000919444201, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 14.00, 0.000921402464, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 13.00, 0.000923525768, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 12.01, 0.000925623590, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 11.01, 0.000927739979, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 10.00, 0.000930060122, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 09.01, 0.000932400030, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 08.00, 0.000934965232, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 07.01, 0.000937490784, 1); +INSERT INTO [CordonelTempLuts] ([PcbId], [RefTempC], [AvgTof], [Active]) VALUES (193400261, 06.00, 0.000940210180, 1); + + diff --git a/Common/OmniPlus/App.config b/Common/OmniPlus/App.config deleted file mode 100644 index aee9adf4..00000000 --- a/Common/OmniPlus/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs b/Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs deleted file mode 100644 index bee53ae8..00000000 --- a/Common/OmniPlus/Connection/Contracts/ISerialPortConnection.cs +++ /dev/null @@ -1,15 +0,0 @@ -using OmniPlus.Connection.Events; - -namespace OmniPlus.Connection.Contracts -{ - public interface ISerialPortConnection - { - event SerialPortStateChangedEventHandler StateChanged; - - void Write(SerialPortMessage message); - - void Close(); - - void Open(); - } -} diff --git a/Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs b/Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs deleted file mode 100644 index 1b1ae0a3..00000000 --- a/Common/OmniPlus/Connection/Contracts/ISerialPortReader.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Connection.Contracts -{ - public interface ISerialPortReader - { - void Read(byte b); - } -} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/BaudRate.cs b/Common/OmniPlus/Connection/Enums/BaudRate.cs deleted file mode 100644 index 0418af62..00000000 --- a/Common/OmniPlus/Connection/Enums/BaudRate.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace OmniPlus.Connection.Enums -{ - public enum BaudRate - { - BaudRate300 = 300, - BaudRate600 = 600, - BaudRate1200 = 1200, - BaudRate2400 = 2400, - BaudRate4800 = 4800, - BaudRate9600 = 9600, - BaudRate19200 = 19200, - BaudRate38400 = 38400, - BaudRate57600 = 57600, - BaudRate115200 = 115200, - BaudRate230400 = 230400, - BaudRate460800 = 460800, - BaudRate921600 = 921600 - } -} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/DataBits.cs b/Common/OmniPlus/Connection/Enums/DataBits.cs deleted file mode 100644 index c4605d4e..00000000 --- a/Common/OmniPlus/Connection/Enums/DataBits.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OmniPlus.Connection.Enums -{ - public enum DataBits - { - DataBits5 = 5, - DataBits6 = 6, - DataBits7 = 7, - DataBits8 = 8 - } -} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs b/Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs deleted file mode 100644 index 45fae72f..00000000 --- a/Common/OmniPlus/Connection/Events/SerialPortStateChangedEventHandler.cs +++ /dev/null @@ -1,6 +0,0 @@ -using OmniPlus.Connection.Enums; - -namespace OmniPlus.Connection.Events -{ - public delegate void SerialPortStateChangedEventHandler(SerialPortState state, string message); -} diff --git a/Common/OmniPlus/Connection/SerialPortConnection.cs b/Common/OmniPlus/Connection/SerialPortConnection.cs deleted file mode 100644 index d9767c60..00000000 --- a/Common/OmniPlus/Connection/SerialPortConnection.cs +++ /dev/null @@ -1,193 +0,0 @@ -using OmniPlus.Connection.Contracts; -using OmniPlus.Connection.Enums; -using OmniPlus.Connection.Events; - -using System; -using System.IO; -using System.IO.Ports; - -namespace OmniPlus.Connection -{ - public abstract class SerialPortConnection : ISerialPortConnection - { - private event Action Read; - private event Action Log; - - private SerialPort serialPort; - private SerialPortState state; - - protected bool reading; - protected SerialPortStream stream; - protected SerialPortOptions options; - - protected SerialPortConnection() - => this.options = new SerialPortOptions(); - - public event SerialPortStateChangedEventHandler StateChanged; - - protected bool connected => this.state == SerialPortState.Open; - - public void Close() - { - if (this.serialPort != null) - { - this.serialPort.DataReceived -= this.Port_DataReceived; - this.serialPort.Disposed -= this.Port_Disposed; - this.serialPort.ErrorReceived -= this.Port_ErrorReceived; - this.serialPort.PinChanged -= this.Port_PinChanged; - } - - this.serialPort?.Close(); - - this.stream = null; - this.serialPort = null; - this.state = SerialPortState.Closed; - - this.StateChanged?.Invoke(this.state, $"{this.options.PortName} closed."); - - this.Read -= this.SerialPortConnection_Read; - this.Log -= this.SerialPortConnection_Log; - this.StateChanged -= this.SerialPortConnection_StateChanged; - } - - public void Open() - { - this.Close(); - - try - { - var fileInfo = new FileInfo(this.options.LogFile); - fileInfo.Directory.Create(); - - File.AppendAllText(this.options.LogFile, string.Empty); - - this.Log += this.SerialPortConnection_Log; - this.StateChanged += this.SerialPortConnection_StateChanged; - } - catch (Exception e) - { - this.state = SerialPortState.ErrorReceived; - - Console.WriteLine($"[{this.state}] {this.options.PortName}: {e}"); - } - - try - { - this.stream = new SerialPortStream(); - this.serialPort = new SerialPort - { - PortName = options.PortName, - BaudRate = (int)options.BaudRate, - DataBits = (int)options.DataBits, - Parity = options.Parity, - StopBits = options.StopBits, - RtsEnable = options.RtsEnabled, - DtrEnable = options.DtrEnabled - }; - - this.serialPort.DataReceived += this.Port_DataReceived; - this.serialPort.Disposed += this.Port_Disposed; - this.serialPort.ErrorReceived += this.Port_ErrorReceived; - this.serialPort.PinChanged += this.Port_PinChanged; - - this.serialPort.Open(); - - this.state = SerialPortState.Open; - - this.Read += this.SerialPortConnection_Read; - - this.StateChanged?.Invoke(this.state, $"{this.options.PortName} opened" - + $", {this.options.BaudRate}" - + $", {this.options.DataBits}" - + $", {this.options.Parity}" - + $", {this.options.StopBits}"); - } - catch (Exception e) - { - this.state = SerialPortState.ErrorReceived; - - this.StateChanged?.Invoke(this.state, $"{this.options.PortName}: {e}"); - - this.Close(); - } - } - - public virtual void Write(SerialPortMessage message) - { - if (this.connected && message.Length > 0) - { - this.serialPort.Write(message, 0, message.Length); - } - - this.Log?.Invoke($"TX: {BitConverter.ToString(message)}"); - } - - public virtual void Write(params byte[] message) - { - if (this.connected && message.Length > 0) - { - this.serialPort.Write(message, 0, message.Length); - } - - this.Log?.Invoke($"TX: {BitConverter.ToString(message)}"); - } - - protected abstract void SerialPortConnection_Read(); - - private void Port_PinChanged(object sender, SerialPinChangedEventArgs args) - { - this.state = SerialPortState.PinChanged; - - this.StateChanged?.Invoke(SerialPortState.PinChanged, $"{this.options.PortName} {args.EventType}."); - - this.Close(); - } - - private void Port_ErrorReceived(object sender, SerialErrorReceivedEventArgs args) - { - this.state = SerialPortState.ErrorReceived; - - this.StateChanged?.Invoke(SerialPortState.ErrorReceived, $"{this.options.PortName} {args.EventType}."); - - this.Close(); - } - - private void Port_Disposed(object sender, EventArgs args) - { - this.state = SerialPortState.Disposed; - - this.StateChanged?.Invoke(SerialPortState.Disposed, $"{this.options.PortName} disposed."); - - this.Close(); - } - - private void Port_DataReceived(object sender, SerialDataReceivedEventArgs args) - { - if (this.connected && sender is System.IO.Ports.SerialPort port && port.BytesToRead > 0) - { - var bytes = new byte[port.BytesToRead]; - var lock_object = new object(); - - lock (lock_object) - { - port.Read(bytes, 0, port.BytesToRead); - } - - this.stream.Append(bytes); - - if (!this.reading) - { - this.Read?.Invoke(); - } - - this.Log?.Invoke($"RX: {BitConverter.ToString(bytes)}"); - } - } - - private void SerialPortConnection_Log(string message) - => File.AppendAllText(this.options.LogFile, $"{message}{Environment.NewLine}"); - - private void SerialPortConnection_StateChanged(SerialPortState state, string message) - => File.AppendAllText(this.options.LogFile, $"[{state}] {message}{Environment.NewLine}"); - } -} diff --git a/Common/OmniPlus/Connection/SerialPortMessage.cs b/Common/OmniPlus/Connection/SerialPortMessage.cs deleted file mode 100644 index 472c204f..00000000 --- a/Common/OmniPlus/Connection/SerialPortMessage.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace OmniPlus.Connection -{ - public abstract class SerialPortMessage - { - protected readonly byte[] bytes; - protected readonly byte[] payload; - protected readonly bool isResponse; - - protected SerialPortMessage(byte[] bytes, bool response) - { - this.isResponse = response; - - if (this.isResponse) - { - this.bytes = bytes; - this.payload = this.ParseMessage(bytes); - } - else - { - this.payload = bytes; - this.bytes = this.CreateMessage(bytes); - } - } - - public int Length => this.bytes.Length; - - public byte[] Payload => this.payload; - - protected abstract byte[] CreateMessage(byte[] payload); - - protected abstract byte[] ParseMessage(byte[] message); - - public static implicit operator byte[](SerialPortMessage message) - => message?.bytes ?? Array.Empty(); - } -} diff --git a/Common/OmniPlus/Connection/SerialPortOptions.cs b/Common/OmniPlus/Connection/SerialPortOptions.cs deleted file mode 100644 index 574e7b45..00000000 --- a/Common/OmniPlus/Connection/SerialPortOptions.cs +++ /dev/null @@ -1,40 +0,0 @@ -using OmniPlus.Connection.Enums; - -using System.IO.Ports; - -namespace OmniPlus.Connection -{ - public class SerialPortOptions - { - public SerialPortOptions() - { - foreach (var portName in SerialPort.GetPortNames()) - { - this.PortName = portName; - - break; - } - - this.BaudRate = BaudRate.BaudRate4800; - this.DataBits = DataBits.DataBits8; - this.Parity = Parity.None; - this.StopBits = StopBits.One; - } - - public string PortName { get; set; } - - public BaudRate BaudRate { get; set; } = BaudRate.BaudRate4800; - - public Parity Parity { get; set; } = Parity.None; - - public DataBits DataBits { get; set; } = DataBits.DataBits8; - - public StopBits StopBits { get; set; } = StopBits.One; - - public bool RtsEnabled { get; set; } - - public bool DtrEnabled { get; set; } - - public string LogFile { get; set; } - } -} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/SerialPortStream.cs b/Common/OmniPlus/Connection/SerialPortStream.cs deleted file mode 100644 index 275b4d4d..00000000 --- a/Common/OmniPlus/Connection/SerialPortStream.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; - -namespace OmniPlus.Connection -{ - public class SerialPortStream - { - private readonly int minBufferLength; - - private byte[] buffer; - private int dataLength; - - public SerialPortStream(int minBufferLength = byte.MaxValue) - { - this.minBufferLength = minBufferLength; - this.buffer = new byte[this.minBufferLength]; - } - - public byte this[int index] => this.buffer[index]; - - public void Append(byte[] bytes) - { - var bytesLength = bytes?.Length ?? 0; - - if (bytesLength <= 0) - { - return; - } - - var lock_object = new object(); - - lock (lock_object) - { - if (this.dataLength + bytesLength > this.buffer.Length) - { - var buffer = new byte[this.buffer.Length * 2]; - - Array.Copy(this.buffer, 0, buffer, 0, this.dataLength); - } - - this.dataLength += bytesLength; - - Array.Copy(bytes, 0, this.buffer, this.dataLength, bytesLength); - } - } - - public void CopyTo(byte[] destinationArray, int destinationIndex, int sourceIndex, int length) - { - var requiredBufferLength = sourceIndex + length; - - if (destinationArray is null || destinationIndex < 0 || sourceIndex < 0 || requiredBufferLength > this.buffer.Length) - { - return; - } - - Array.Copy(this.buffer, sourceIndex, destinationArray, destinationIndex, length); - } - - public void Flush(int length) - { - var lock_object = new object(); - - lock (lock_object) - { - if (length <= 0 || this.dataLength - length <= 0) - { - this.buffer = new byte[this.minBufferLength]; - } - else - { - var dataLength = this.dataLength - length; - var newBufferLength = this.minBufferLength; - - while (newBufferLength <= dataLength) - { - newBufferLength *= 2; - } - - var newBuffer = new byte[newBufferLength]; - - Array.Copy(this.buffer, dataLength, newBuffer, 0, dataLength); - } - } - } - } -} diff --git a/Common/OmniPlus/Connections/Extensions.cs b/Common/OmniPlus/Connections/Extensions.cs deleted file mode 100644 index 9763a140..00000000 --- a/Common/OmniPlus/Connections/Extensions.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; - -namespace OmniPlus.Connections -{ - public static class Extensions - { - /// - /// TODO: Test calculated crc - /// - /// The message for CRC16. - /// The start index. - /// The length from the start index. - /// Two bytes array from the calculated CRC16 in LSB0. - public static byte[] CalculateCRC(this byte[] message, int start, int length) - { - var crc = 0xFFFF; - - for (int i = 0; i < length; i++) - { - //copy data byte to lower word because of LSB will be XORed - var dataWord = (UInt16)(message[i] & 0x00FF); - - for (var b = 0; b < 8; b++) - { - //test if CRC lowest bit is XORed set to one - if (0x0001 == ((crc ^ dataWord) & 0x0001)) - { - crc >>= 1; - //apply generator polynomial - crc ^= 0x8408; - } - else - { - crc >>= 1; - } - - dataWord >>= 1; - } - } - - //var test = default(byte); - //var zeichen = default(byte); - //var crcSum = ushort.MaxValue; - //var messageLength = length - start; - - //while (start < messageLength) - //{ - // zeichen = message[start]; - // start++; - - // for (byte h = 0; h < 8; h++) - // { - // test = 0; - - // if ((crcSum & 0x8000) != 0) - // { - // test = 0x80; - // } - - // crcSum <<= 1; - - // if (((zeichen & 0x80) ^ test) != 0) - // { - // crcSum ^= 0x1021; - // } - - // zeichen <<= 1; - // } - //} - - return BitConverter.GetBytes(crc); - } - - public static byte[] CalculateCheckSum16(this byte[] bytes, int length) - { - ushort checksum = 0; - - for (int i = 0; i < length; i++) - { - checksum += bytes[i]; - } - - return BitConverter.GetBytes(checksum); - } - } -} diff --git a/Common/OmniPlus/Connections/IrdaConnection.cs b/Common/OmniPlus/Connections/IrdaConnection.cs deleted file mode 100644 index da2d49ea..00000000 --- a/Common/OmniPlus/Connections/IrdaConnection.cs +++ /dev/null @@ -1,92 +0,0 @@ -namespace OmniPlus.Connections -{ - using OmniPlus.Connection; - using OmniPlus.Connection.Enums; - using OmniPlus.Connections.Messages; - - using System; - using System.IO.Ports; - using System.Threading; - - public class IrdaConnection : SerialPortConnection - { - internal const byte MSG_START = 0x9B; - internal const byte MSG_OMNI2PC = 0x43; - internal const byte MSG_PC2OMNI = 0x33; - - private event Action messageReceived; - - public IrdaConnection(string portName, string logFile = null) - { - this.options.PortName = portName; - this.options.BaudRate = BaudRate.BaudRate115200; - this.options.DataBits = DataBits.DataBits8; - this.options.Parity = Parity.None; - this.options.StopBits = StopBits.One; - this.options.LogFile = logFile ?? ".\\IrdaConnection.txt"; - } - - public byte[] Write(byte[] command, int timeout, int delay) - { - var ui1236Request = new UI1236Message(command); - var irdaRequest = new IrdaMessage(ui1236Request); - var responseBytes = Array.Empty(); - var retriesCount = 3; - var received = false; - - this.messageReceived += irdaResponse => - { - var ui1236Response = new UI1236Message(irdaResponse.Payload, true); - responseBytes = ui1236Response.Payload; - received = true; - }; - - while (!received && retriesCount-- > 0) - { - this.Write(0x01, 0x01, 0x01, 0x01); - Thread.Sleep(1); - this.Write(irdaRequest); - // this.Write(0x9B, 0x33, 0x04, 0x0D, 0x05, 0x08, 0xFD, 0xC6, 0x01, 0xDD, 0x00, 0x3B, 0x1B); - - var sleep = timeout; - - while (!received && sleep >= 0) - { - sleep -= delay; - - Thread.Sleep(delay); - } - } - - return responseBytes; - } - - protected override void SerialPortConnection_Read() - { - this.reading = true; - - var message = default(byte[]); - var length = 0; - var start = 0; - - while (true) - { - if (this.stream[start] == MSG_START) - { - length = this.stream[start + 2] * 2 + 5; - message = new byte[length]; - - this.stream.CopyTo(message, 0, start, length); - - break; - } - - start++; - } - - this.messageReceived?.Invoke(message); - - this.reading = false; - } - } -} diff --git a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs b/Common/OmniPlus/Connections/Messages/IrdaMessage.cs deleted file mode 100644 index 7403b822..00000000 --- a/Common/OmniPlus/Connections/Messages/IrdaMessage.cs +++ /dev/null @@ -1,71 +0,0 @@ -using OmniPlus.Connection; - -using System; -using System.Linq; -using Xylem.Common.Utils.Crc16Ccitt; - -namespace OmniPlus.Connections.Messages -{ - public class IrdaMessage : SerialPortMessage - { - public const int MIN_LENGTH = 5; - public const int CRC_LENGTH = 2; - - public IrdaMessage(byte[] bytes, bool response = false) : base(bytes, response) - { - } - - public byte Start - { - get => this.bytes[0]; - set => this.bytes[0] = value; - } - - public byte Type - { - get => this.bytes[1]; - set => this.bytes[1] = value; - } - - public byte DataLength - { - get => this.bytes[2]; - set => this.bytes[2] = value; - } - - protected override byte[] CreateMessage(byte[] payload) - { - var messageLength = payload.Length; - messageLength += messageLength % 2; - - var index = 0; - var message = new byte[messageLength + MIN_LENGTH]; - message[index++] = IrdaConnection.MSG_START; - message[index++] = IrdaConnection.MSG_PC2OMNI; - message[index++] = (byte)(messageLength / 2); - - payload.CopyTo(message, index); - - messageLength = message.Length; - - var crc16 = BitConverter.GetBytes(Crc16Ccitt.CalculateReversedLsb8408(message.Skip(1).Take(message.Length - 3).ToArray())); - message[messageLength - 2] = crc16[1]; - message[messageLength - 1] = crc16[0]; - - return message; - } - - protected override byte[] ParseMessage(byte[] message) - { - var payloadLength = message.Length - MIN_LENGTH; - var payload = new byte[payloadLength]; - - Array.Copy(message, 3, payload, 0, payloadLength); - - return payload; - } - - public static implicit operator IrdaMessage(byte[] bytes) - => new IrdaMessage(bytes, true); - } -} diff --git a/Common/OmniPlus/Connections/Messages/MessageHandler.cs b/Common/OmniPlus/Connections/Messages/MessageHandler.cs deleted file mode 100644 index 22772862..00000000 --- a/Common/OmniPlus/Connections/Messages/MessageHandler.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace OmniPlus.Connections.Messages -{ - public delegate byte[] MessageHandler(byte[] command, int timeout, int delay); -} diff --git a/Common/OmniPlus/Connections/Messages/UI1236Message.cs b/Common/OmniPlus/Connections/Messages/UI1236Message.cs deleted file mode 100644 index 8784493c..00000000 --- a/Common/OmniPlus/Connections/Messages/UI1236Message.cs +++ /dev/null @@ -1,61 +0,0 @@ -using OmniPlus.Connection; -using OmniPlus.Features.Enums; -using OmniPlus.Features.Types; - -using System; - -namespace OmniPlus.Connections.Messages -{ - public class UI1236Message : SerialPortMessage - { - public const byte START_BYTE = 0x0D; - public const byte MIN_LENGTH = 0x05; - public const byte HEADER_BYTES = 0x03; - - public UI1236Message(byte[] bytes, bool response = false) : base(bytes, response) - { - } - - public byte Start => this.bytes[0]; - - public byte DataLength => this.bytes[1]; - - public Control Control => this.bytes[2]; - - public Status Status - => this.isResponse - ? (Status)this.bytes[3] - : Status.Completed; - - protected override byte[] CreateMessage(byte[] payload) - { - var messageLength = payload.Length + MIN_LENGTH; - var message = new byte[messageLength]; - var index = 0; - - message[index++] = START_BYTE; - message[index++] = (byte)(payload.Length + HEADER_BYTES); - - Control control = 0; - control.ReturnResponse = true; - message[index++] = control; - - payload.CopyTo(message, index); - - var checksum = message.CalculateCheckSum16(messageLength - 2); - message[messageLength - 2] = checksum[1]; - message[messageLength - 1] = checksum[0]; - - return message; - } - - protected override byte[] ParseMessage(byte[] message) - { - var payload = new byte[message.Length - MIN_LENGTH]; - - Array.Copy(message, 3, payload, 0, payload.Length); - - return payload; - } - } -} diff --git a/Common/OmniPlus/Connections/UniProConnection.cs b/Common/OmniPlus/Connections/UniProConnection.cs deleted file mode 100644 index 694b3c12..00000000 --- a/Common/OmniPlus/Connections/UniProConnection.cs +++ /dev/null @@ -1,30 +0,0 @@ -using OmniPlus.Connection; -using OmniPlus.Connection.Enums; - -using System.IO.Ports; - -namespace OmniPlus.Connections -{ - public class UniProConnection : SerialPortConnection - { - public UniProConnection(string portName) - { - this.options.PortName = portName; - this.options.BaudRate = BaudRate.BaudRate2400; - this.options.DataBits = DataBits.DataBits8; - this.options.Parity = Parity.None; - this.options.StopBits = StopBits.One; - this.options.RtsEnabled = true; - } - - public byte[] Write(byte[] command, int timeout, int delay) - { - throw new System.NotImplementedException(); - } - - protected override void SerialPortConnection_Read() - { - throw new System.NotImplementedException(); - } - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs b/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs deleted file mode 100644 index 8e350522..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltage.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct BatteryVoltage - { - public const byte BASE = 0xFD; - public const byte GET = 0xA9; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs b/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs deleted file mode 100644 index 2cc70396..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/BatteryVoltageMeasurementCalibrationFactors.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct BatteryVoltageMeasurementCalibrationFactors - { - public const byte BASE = 0xFD; - public const byte GET = 0xAA; - public const byte SET = 0xAB; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs b/Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs deleted file mode 100644 index 931f8cd1..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/CalibrationResults.cs +++ /dev/null @@ -1,47 +0,0 @@ -using OmniPlus.Features.Enums; - -using System; - -namespace OmniPlus.Features.DeviceSpecific -{ - public struct CalibrationResults - { - private const byte FAILED = 0x01; - private const byte COMPLETED = 0x02; - - private CalibrationResults(byte[] bytes) - { - this.Status = Status.UnknownCommand; - this.Completed = default(bool); - this.Rotations = default(ushort); - this.Dauer = default(uint); - - if (bytes?.Length == 8) - { - this.Status = (Status)bytes[0]; - this.Completed = bytes[1] == COMPLETED; - this.Rotations = BitConverter.ToUInt16(bytes, 2); - this.Dauer = BitConverter.ToUInt16(bytes, 4); - } - } - - public Status Status { get; } - - public bool Completed { get; } - - public ushort Rotations { get; } - - public uint Dauer { get; } - - - public static byte[] RequestResults => new byte[] - { - FactoryMeterChamberCalibrationTest.BASE, - FactoryMeterChamberCalibrationTest.SET, - FactoryMeterChamberCalibrationTest.VIEW, - }; - - public static implicit operator CalibrationResults(byte[] bytes) - => new CalibrationResults(bytes); - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs b/Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs deleted file mode 100644 index fbea3715..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/ConfigurationParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -using OmniPlus.Features.UI1236; - -namespace OmniPlus.Features.DeviceSpecific -{ - public struct ConfigurationParameters - { - public const byte BASE = 0xFD; - public const byte GET = 0xC7; - public const byte ALL = 0x01; - - public ProgrammableID ProgrammableId { get; } - - public FactoryID FactoryId { get; } - - public NumberOfReadingDigits ReadingDigits { get; } - - public Reading Reading { get; } - - public OptionalUniDirectionalFields OptionalUniDirectionalFields { get; } - - public AlarmPersistencePeriod AlarmPersistensePeriaod { get; } - - public DataLogInterval DataLogInterval { get; } - - public RegisterDeviceIDString DeviceIDString { get; } - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs b/Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs deleted file mode 100644 index 4d1ae41e..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/DataLogData.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct DataLogData - { - public const byte BASE = 0xFD; - public const byte GET = 0x80; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs b/Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs deleted file mode 100644 index bc05b4e0..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/DataLogInterval.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct DataLogInterval - { - public const byte BASE = 0xFD; - public const byte SET = 0x7D; - public const byte GET = 0x7E; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs b/Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs deleted file mode 100644 index e6970af0..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/DisplayMode.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct DisplayMode - { - public const byte BASE = 0xFD; - public const byte GET = 0x14; - public const byte SET = 0x15; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs b/Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs deleted file mode 100644 index 255cbaac..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/EnabledLCDViews.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct EnabledLCDViews - { - public const byte BASE = 0xFD; - public const byte GET = 0x7B; - public const byte SET = 0x7C; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs b/Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs deleted file mode 100644 index 04ae1b83..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/EnabledPredefinedAlarms.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct EnabledPredefinedAlarms - { - public const byte BASE = 0xFD; - public const byte GET = 0x12; - public const byte SET = 0x13; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs b/Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs deleted file mode 100644 index 99e0394f..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/ExtendedResolutionSetting.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct ExtendedResolutionSetting - { - public const byte BASE = 0xFD; - public const byte GET = 0x28; - public const byte SET = 0x29; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs deleted file mode 100644 index 15f2dadc..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/FactoryCalibration.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct FactoryCalibration - { - public const byte BASE = 0xFD; - public const byte GET = 0x08; - public const byte SET = 0x09; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs deleted file mode 100644 index 5a443386..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/FactoryMeterChamberCalibrationTest.cs +++ /dev/null @@ -1,54 +0,0 @@ -using OmniPlus.Features.Enums; - -using System; - -namespace OmniPlus.Features.DeviceSpecific -{ - public struct FactoryMeterChamberCalibrationTest - { - public const byte BASE = 0xFD; - public const byte SET = 0x67; - public const byte VIEW = 0x01; - - private FactoryMeterChamberCalibrationTest(byte[] bytes) : this() - { - this.Status = Status.UnknownCommand; - this.CalibrationState = default(CalibrationState); - this.Rotations = default(ushort); - this.Dauer = default(ushort); - - if (bytes?.Length == 6) - { - this.Status = (Status)bytes[0]; - this.CalibrationState = (CalibrationState)bytes[1]; - this.Rotations = BitConverter.ToUInt16(bytes, 2); - this.Dauer = BitConverter.ToUInt16(bytes, 4); - } - } - - public Status Status { get; set; } - - public CalibrationState CalibrationState { get; set; } - - public ushort Rotations { get; set; } - - public ushort Dauer { get; set; } - - public static implicit operator FactoryMeterChamberCalibrationTest(byte[] bytes) - => new FactoryMeterChamberCalibrationTest(bytes); - - public static implicit operator byte[] (FactoryMeterChamberCalibrationTest calibration) - { - var bytes = new byte[7]; - - bytes[0] = BASE; - bytes[1] = SET; - bytes[2] = (byte)(calibration.CalibrationState); - - BitConverter.GetBytes(calibration.Rotations).CopyTo(bytes, 3); - BitConverter.GetBytes(calibration.Dauer).CopyTo(bytes, 5); - - return bytes; - } - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs b/Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs deleted file mode 100644 index a6f7fcb7..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/FactoryPulseTestMode.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct FactoryPulseTestMode - { - public const byte BASE = 0xFD; - public const byte SET = 0x1B; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs b/Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs deleted file mode 100644 index a62052f7..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/FactorySeal.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct FactorySeal - { - public const byte BASE = 0xFD; - public const byte GET = 0x63; - public const byte SET = 0x64; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs b/Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs deleted file mode 100644 index 9cf4a007..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/FieldCalibration.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct FieldCalibration - { - public const byte BASE = 0xFD; - public const byte GET = 0x0A; - public const byte SET = 0x0B; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs b/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs deleted file mode 100644 index 65b422d1..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/InputVolume.cs +++ /dev/null @@ -1,66 +0,0 @@ -using OmniPlus.Features.Enums; -using OmniPlus.Features.Types; - -using System; - -namespace OmniPlus.Features.DeviceSpecific -{ - public struct InputVolume - { - public const byte BASE = 0xFD; - public const byte GET = 0x02; - public const byte SET = 0x03; - - private InputVolume(byte[] bytes) : this() - { - this.Status = Status.UnknownCommand; - this.MilliliterPerPulse = default(ushort); - this.FractionalPart = default(ushort); - this.MeterSize = default(byte); - this.MeterRange = default(byte); - - if (bytes?.Length == 6) - { - this.Status = (Status)bytes[0]; - this.MilliliterPerPulse = BitConverter.ToUInt16(bytes, 1); - this.MilliliterPerPulse = BitConverter.ToUInt16(bytes, 3); - this.MeterSize = bytes[5]; - this.MeterRange = bytes[6]; - } - } - - public Status Status { get; } - - public ushort MilliliterPerPulse { get; set; } - - public ushort FractionalPart { get; set; } - - public MeterSize MeterSize { get; set; } - - public MeterRange MeterRange { get; set; } - - public static byte[] GetCommand => new byte[] { BASE, GET }; - - public static implicit operator InputVolume(byte[] bytes) - => new InputVolume(bytes); - - public static implicit operator byte[] (InputVolume inputVolume) - { - var bytes = new byte[8]; - - bytes[0] = BASE; - bytes[1] = SET; - - BitConverter.GetBytes(inputVolume.MilliliterPerPulse).CopyTo(bytes, 2); - BitConverter.GetBytes(inputVolume.FractionalPart).CopyTo(bytes, 4); - - bytes[6] = inputVolume.MeterSize; - bytes[7] = inputVolume.MeterRange; - - return bytes; - } - } -} - - - diff --git a/Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs b/Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs deleted file mode 100644 index 627eb38e..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/LCDSegmentTest.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct LCDSegmentTest - { - public const byte BASE = 0xFD; - public const byte SET = 0x62; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs b/Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs deleted file mode 100644 index 07d34aa2..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/LCDTimeout.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct LCDTimeout - { - public const byte BASE = 0xFD; - public const byte GET = 0x8B; - public const byte SET = 0x8C; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/LidState.cs b/Common/OmniPlus/Features/DeviceSpecific/LidState.cs deleted file mode 100644 index 2fa1b93f..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/LidState.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct LidState - { - public const byte BASE = 0xFD; - public const byte GET = 0xAC; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs b/Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs deleted file mode 100644 index 3b317656..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/LifeTimeMaxSensorPulsesperSecond.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct LifeTimeMaxSensorPulsesperSecond - { - public const byte BASE = 0xFD; - public const byte GET = 0x22; - public const byte SET = 0x23; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs b/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs deleted file mode 100644 index 05090d3e..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTestCommand.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct ManufacturingTestCommand - { - public const byte BASE = 0xFD; - public const byte SET = 0x65; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs b/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs deleted file mode 100644 index 9e60fddc..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/ManufacturingTime.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct ManufacturingTime - { - public const byte BASE = 0xFD; - public const byte GET = 0x39; - public const byte SET = 0x3A; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs b/Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs deleted file mode 100644 index fd338089..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/OmniSize.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct OmniSize - { - public const byte BASE = 0xFD; - public const byte GET = 0xB7; - public const byte SET = 0xB8; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs b/Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs deleted file mode 100644 index f4a73e80..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/OutputPulseSettings.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct OutputPulseSettings - { - public const byte BASE = 0xFD; - public const byte GET = 0x0E; - public const byte SET = 0x0F; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs b/Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs deleted file mode 100644 index 6d468abb..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/PeriodicAlarmLogEntries.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct PeriodicAlarmLogEntries - { - public const byte BASE = 0xFD; - public const byte GET = 0xC2; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs b/Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs deleted file mode 100644 index 4c3e814b..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/RebootCount.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct RebootCount - { - public const byte BASE = 0xFD; - public const byte GET = 0x55; - public const byte SET = 0x56; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs b/Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs deleted file mode 100644 index a8b4b17d..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/RegisterDeviceIDString.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct RegisterDeviceIDString - { - public const byte BASE = 0xFD; - public const byte GET = 0x26; - public const byte SET = 0x27; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs b/Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs deleted file mode 100644 index e2b211fd..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/RegisterSetting.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct RegisterSetting - { - public const byte BASE = 0xFD; - public const byte GET = 0x24; - public const byte SET = 0x25; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs b/Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs deleted file mode 100644 index dfc697fd..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/SecondsActive.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct SecondsActive - { - public const byte BASE = 0xFD; - public const byte GET = 0x3D; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs b/Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs deleted file mode 100644 index b4d12083..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/SendFlexNetSerialCommands.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct SendFlexNetSerialCommands - { - public const byte BASE = 0xFD; - public const byte SET = 0x98; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs b/Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs deleted file mode 100644 index 97f9fcb9..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/SendMultipleFlexNetSerialCommands.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct SendMultipleFlexNetSerialCommands - { - public const byte BASE = 0xFD; - public const byte SET = 0xA2; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs b/Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs deleted file mode 100644 index 0d80d5c7..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/SystemParameters.cs +++ /dev/null @@ -1,63 +0,0 @@ -using OmniPlus.Features.Enums; -using OmniPlus.Features.Types; - -using System; - -namespace OmniPlus.Features.DeviceSpecific -{ - public struct SystemParameters - { - public const byte BASE = 0xFD; - public const byte GET = 0xC6; - - private SystemParameters(byte[] bytes) - { - this.Status = Status.UnknownCommand; - this.BuildInfo = default(byte[]); - this.ManifacturingTime = default(uint); - this.SystemTime = default(uint); - this.RebootCount = default(byte); - this.VersionAndType = default(byte[]); - this.BytteryV = default(double); - this.BytteryADC = default(uint); - this.Sealed = default(bool); - - if (bytes?.Length >= 60) - { - this.Status = (Status)bytes[0]; - this.BuildInfo = bytes.Subarray(1, 16); - this.ManifacturingTime = BitConverter.ToUInt32(bytes, 17); - this.SystemTime = BitConverter.ToUInt32(bytes, 21); - this.RebootCount = bytes[25]; - this.VersionAndType = bytes.Subarray(26, 27); - this.BytteryV = BitConverter.ToUInt16(bytes, 53) / 1000.0; - this.BytteryADC = BitConverter.ToUInt32(bytes, 55); - this.Sealed = bytes[59] == 1; - } - } - - public Status Status { get; } - - public ASCIIString BuildInfo { get; } - - public TimeSinse20000101 ManifacturingTime { get; } - - public TimeSinse20000101 SystemTime { get; } - - public byte RebootCount { get; } - - public ASCIIString VersionAndType { get; } - - public double BytteryV { get; } - - public uint BytteryADC { get; } - - public bool Sealed { get; } - - public static byte[] GetCommand - => new byte[] { BASE, GET }; - - public static implicit operator SystemParameters(byte[] bytes) - => new SystemParameters(bytes); - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs b/Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs deleted file mode 100644 index 363966ab..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/SystemTime.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct SystemTime - { - public const byte BASE = 0xFD; - public const byte GET = 0x10; - public const byte SET = 0x11; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs b/Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs deleted file mode 100644 index e2d3ec2f..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/TestPulse.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct TestPulse - { - public const byte BASE = 0xFD; - public const byte SET = 0x66; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs b/Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs deleted file mode 100644 index a8a31bc7..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/TestTotalizerValue.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct TestTotalizerValue - { - public const byte BASE = 0xFD; - public const byte GET = 0x06; - public const byte SET = 0x07; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs b/Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs deleted file mode 100644 index bf6874d6..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/TimeofFactorySeal.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct TimeofFactorySeal - { - public const byte BASE = 0xFD; - public const byte GET = 0x05; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs b/Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs deleted file mode 100644 index 5254aeb1..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/TimeofInstallation.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct TimeofInstallation - { - public const byte BASE = 0xFD; - public const byte GET = 0xBC; - public const byte SET = 0xBD; - } -} diff --git a/Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs b/Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs deleted file mode 100644 index e7553b0b..00000000 --- a/Common/OmniPlus/Features/DeviceSpecific/TriggerWatchdogReset.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.DeviceSpecific -{ - public struct TriggerWatchdogReset - { - public const byte BASE = 0xFD; - public const byte SET = 0x8D; - } -} diff --git a/Common/OmniPlus/Features/Enums/CalibrationState.cs b/Common/OmniPlus/Features/Enums/CalibrationState.cs deleted file mode 100644 index 87f6ff02..00000000 --- a/Common/OmniPlus/Features/Enums/CalibrationState.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum CalibrationState : byte - { - OK = 0x00, - Failed = 0x01, - Completed = 0x02 - } -} diff --git a/Common/OmniPlus/Features/Enums/DeviceCommands.cs b/Common/OmniPlus/Features/Enums/DeviceCommands.cs deleted file mode 100644 index 70f7424b..00000000 --- a/Common/OmniPlus/Features/Enums/DeviceCommands.cs +++ /dev/null @@ -1,234 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum DeviceCommands : byte - { - /// - /// Device specific - /// - Specific = 0xFD, - /// - ///Available after seal: Yes - /// - GetInputVolumeValue = 0x02, - /// - ///Available after seal: No - /// - SetInputVolumeValue = 0x03, - /// - ///Available after seal: Yes - /// - GetTimeofFactorySeal = 0x05, - /// - ///Available after seal: Yes - /// - GetTestTotalizerValue = 0x06, - /// - ///Available after seal: Yes - /// - SetTestTotalizerValue = 0x07, - /// - ///Available after seal: Yes - /// - GetFactoryCalibration = 0x08, - /// - ///Available after seal: No - /// - SetFactoryCalibration = 0x09, - /// - ///Available after seal: Yes - /// - GetFieldCalibration = 0x0A, - /// - ///Available after seal: Yes - /// - SetFieldCalibration = 0x0B, - /// - ///Available after seal: Yes - /// - GetOutputPulseSettings = 0x0E, - /// - ///Available after seal: Yes - /// - SetOutputPulseSettings = 0x0F, - /// - ///Available after seal: Yes - /// - GetSystemTime = 0x10, - /// - ///Available after seal: Yes - /// - SetSystemTime = 0x11, - /// - ///Available after seal: Yes - /// - GetEnabledPredefinedAlarms = 0x12, - /// - ///Available after seal: Yes - /// - SetEnabledPredefinedAlarms = 0x13, - /// - ///Available after seal: Yes - /// - GetDisplayMode = 0x14, - /// - ///Available after seal: Yes - /// - SetDisplayMode = 0x15, - /// - ///Available after seal: No - /// - SetFactoryPulseTestMode = 0x1B, - /// - ///Available after seal: Yes - /// - GetLifeTimeMaxSensorPulsesperSecond = 0x22, - /// - ///Available after seal: No - /// - SetLifeTimeMaxSensorPulsesperSecond = 0x23, - /// - ///Available after seal: Yes - /// - GetRegisterSetting = 0x24, - /// - ///Available after seal: No - /// - SetRegisterSetting = 0x25, - /// - ///Available after seal: Yes - /// - GetRegisterDeviceIDString = 0x26, - /// - ///Available after seal: No - /// - SetRegisterDeviceIDString = 0x27, - /// - ///Available after seal: Yes - /// - GetExtendedResolutionSetting = 0x28, - /// - ///Available after seal: Yes - /// - SetExtendedResolutionSetting = 0x29, - /// - ///Available after seal: Yes - /// - GetManufacturingTime = 0x39, - /// - ///Available after seal: No - /// - SetManufacturingTime = 0x3A, - /// - ///Available after seal: Yes - /// - GetSecondsActive = 0x3D, - /// - ///Available after seal: Yes - /// - Getrebootcount = 0x55, - /// - ///Available after seal: No - /// - Setrebootcount = 0x56, - /// - ///Available after seal: No - /// - SetLCDSegmentTest = 0x62, - /// - ///Available after seal: Yes - /// - GetFactorySeal = 0x63, - /// - ///Available after seal: No - /// - SetFactorySeal = 0x64, - /// - ///Available after seal: Conditional - /// - ManufacturingTestCommand = 0x65, - /// - ///Available after seal: Yes - /// - SetTestPulse = 0x66, - /// - ///Available after seal: No - /// - FactoryMeterChamberCalibrationTest = 0x67, - /// - ///Available after seal: Yes - /// - GetEnabledLCDViews = 0x7B, - /// - ///Available after seal: Yes - /// - SetEnabledLCDViews = 0x7C, - /// - ///Available after seal: Yes - /// - SetDataLogInterval = 0x7D, - /// - ///Available after seal: Yes - /// - GetDataLogInterval = 0x7E, - /// - ///Available after seal: Yes - /// - GetDataLogData = 0x80, - /// - ///Available after seal: Yes - /// - GetLCDTimeout = 0x8B, - /// - ///Available after seal: Yes - /// - SetLCDTimeout = 0x8C, - /// - ///Available after seal: Yes - /// - TriggerWatchdogReset = 0x8D, - /// - ///Available after seal: Yes - /// - SendFlexNetSerialCommands = 0x98, - /// - ///Available after seal: Yes - /// - SendMultipleFlexNetSerialCommands = 0xA2, - /// - ///Available after seal: Yes - /// - GetBatteryVoltage = 0xA9, - /// - ///Available after seal: Yes - /// - GetBatteryVoltageMeasurementCalibrationFactors = 0xAA, - /// - ///Available after seal: No - /// - SetBatteryVoltageMeasurementCalibrationFactors = 0xAB, - /// - ///Available after seal: Yes - /// - GetLidState = 0xAC, - /// - ///Available after seal: Yes - /// - GetMeterSize = 0xB7, - /// - ///Available after seal: Yes - /// - SetMeterSize = 0xB8, - /// - ///Available after seal: Yes - /// - GetTimeofInstallation = 0xBC, - /// - ///Available after seal: No - /// - SetTimeofInstallation = 0xBD, - /// - ///Available after seal: Yes - /// - GetPeriodicAlarmLogEntries = 0xC2 - } -} diff --git a/Common/OmniPlus/Features/Enums/MeterRanges.cs b/Common/OmniPlus/Features/Enums/MeterRanges.cs deleted file mode 100644 index cf5ec8ab..00000000 --- a/Common/OmniPlus/Features/Enums/MeterRanges.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum MeterRanges : byte - { - From1To2 = 0x00, - From3To4 = 0x01, - SixInch = 0x02, - EightInch = 0x03, - TenInch = 0x04, - } -} diff --git a/Common/OmniPlus/Features/Enums/MeterSizes.cs b/Common/OmniPlus/Features/Enums/MeterSizes.cs deleted file mode 100644 index 48509d08..00000000 --- a/Common/OmniPlus/Features/Enums/MeterSizes.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum MeterSizes : byte - { - Unknown = 0x00, - OneHalfIn = 0x05, - TwoIn = 0x06, - ThreeIn = 0x07, - FourIn = 0x08, - SixIn = 0x09, - EightIn = 0x0A, - TenIn = 0x0B, - } -} diff --git a/Common/OmniPlus/Features/Enums/PredefinedAlarms.cs b/Common/OmniPlus/Features/Enums/PredefinedAlarms.cs deleted file mode 100644 index 61aadc29..00000000 --- a/Common/OmniPlus/Features/Enums/PredefinedAlarms.cs +++ /dev/null @@ -1,139 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum PredefinedAlarms : byte - { - /// - /// Set when the unit is in a mode that is updating the firmware. - /// - /// Trigger Condition: Alarm is set when the device begins to receive firmware image blocks. - /// It is marked as no longer occurring before executing the flasher app as the last part of a firmware upgrade. - /// Upon booting into the upgraded image, the alarm is in persistent state with start time associated with the reception of Load Start command - /// and stop time associated with the reception of Flash Start command. - /// If after loading the new image, the CRC fails, the Alarm condition is maintained until a Reset Firmware Image is received - /// or a new image is attempted to be loaded. - /// - /// - UpgradeMode = 0x00, - - /// - /// Not supported by OMNI+ - /// - // SevereHardwareFailure = 0x01, - - /// - /// NV memory error alarm becomes active when an NV memory location fails a checksum check. - /// - /// Alarm is triggered whenever a checksum check of any of the above modules and log entries fails. - /// - /// - NVMemoryError = 0x02, - - /// - /// Not supported by OMNI+ - /// - // DeadBattery = 0x03, - /// - /// Not supported by OMNI+ - /// - // EmptyPipe = 0x04, - /// - /// Not supported by OMNI+ - /// - // MagneticTamper = 0x05, - - - /// - /// Omni+ presently does not have the hardware capability to detect a cut or broken wire, - /// however the Alarm should be supported through the system so that once hardware is capable that no changes in the system have to be made to support the alarm. - /// - /// Trigger Condition: Detection of a broken or cut wire going to the sensor. - /// - /// - MeterDisconnectTamper = 0x06, - /// - /// Register has reached the end of its operational life. - /// - /// Trigger Condition: For a 10 year battery device, Near End of Life alarm becomes active 10.5 years from date of manufacture or 9.5 years from Date of Activation whichever is less. - /// Alarm-specific additional data field indicates number of days remaining before meter reaches end-of-life. Alarm is updated once a day at midnight. - /// - /// - NearEndOfLife = 0x07, - /// - /// NV memory error alarm becomes active when an NV memory location fails a checksum check. - /// - /// Trigger Condition: For a 10 year battery device, End-of-life alarm becomes active 11 years from date of manufacture or 10 years from Date of Activation whichever is less. - /// Alarm-specific additional data field indicates number of days elapsed after meter reached end-of-life. Alarm is updated once a day at midnight. - /// - /// - BeyondEndOfLife = 0x08, - - /// - /// Not supported by OMNI+ - /// - // CommunicationsFailure = 0x09, - /// - /// Not supported by OMNI+ - /// - // CriticalHardwareWarning = 0x10, - - /// - /// This is a one-shot alarm. Its start and stop time are the same. For that reason, this alarm is never reported as active. It persists for the persistence period. - /// - /// Trigger Condition: Reboot alarm is triggered when the register has rebooted. - /// - /// - Reboot = 0x11, - - /// - /// Not supported by OMNI+ - /// - // EMFRange = 0x12, - /// - /// Not supported by OMNI+ - /// - // LowField = 0x13, - /// - /// Not supported by OMNI+ - /// - // HighCurrent = 0x14, - - /// - /// Update Interval: Battery voltage is measured every 15 minutes - /// - /// Trigger Condition: Battery low voltage alarm becomes active when the battery voltage is below 2.7 V for an 4 consecutive 15 sample periods. - /// - /// - LowPrimaryBattery = 0x15, - - /// - /// Not supported by OMNI+ - /// - // LowSecondaryBattery = 0x16, - /// - /// Not supported by OMNI+ - /// - // GlideSlope = 0x17, - /// - /// Not supported by OMNI+ - /// - // HighTemperature = 0x18, - - /// - /// Reason for this alarm: uint32LE bitmap indicating which calibration factors/factory required parameters are missing: - /// Factory seal not set: bit 15 of the additional data. - /// - /// Trigger Conditions: Configuration error alarm becomes active when factory seal is not set. Alarm is checked once an hour. - /// - /// - ConfigError = 0x19, - - /// - /// Not supported by OMNI+ - /// - // ActuatorFailure = 0x20, - /// - /// Not supported by OMNI+ - /// - // HumiditySensorRead = 0x21 - } -} diff --git a/Common/OmniPlus/Features/Enums/Status.cs b/Common/OmniPlus/Features/Enums/Status.cs deleted file mode 100644 index 370dd95b..00000000 --- a/Common/OmniPlus/Features/Enums/Status.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum Status : byte - { - /// - /// Used by communication devices to indicate communication failure/timeout. Should not be used by a slave device implementing UI-1236. - /// - FailureOrTimeout = 0x00, - /// - /// Command complete, no errors - /// - Completed = 0x01, - /// - /// Error, unable to execute command - /// - UnableToExecute = 0x02, - /// - /// Error, unknown command - /// - UnknownCommand = 0x03, - /// - /// Error, unsupported control bit pattern - /// - UnsupportedControl = 0x04, - /// - /// Error, command blocked by factory seal. Added in version B1.23 - /// - BlockedBySeal = 0x05, - /// - /// Frame received, no error - /// - FrameReceived = 0xFC, - /// - /// Message corrupt - /// - MessageCorrupt = 0xFD, - /// - /// Wait status - /// - Waiting = 0xFE, - /// - /// Used by communication devices to indicate unrecognized communication device command. - /// - UnrecognizedDevice = 0xFF - - } -} diff --git a/Common/OmniPlus/Features/Enums/UI1203Units.cs b/Common/OmniPlus/Features/Enums/UI1203Units.cs deleted file mode 100644 index fa0dee57..00000000 --- a/Common/OmniPlus/Features/Enums/UI1203Units.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum UI1203Units : byte - { - /// - /// Cubic meters - /// - M3 = 0x00, - /// - /// Cubic feets - /// - CF = 0x01, - /// - /// US gallons - /// - GAL = 0x04, - /// - /// Imperial gallons - /// - IGAL = 0x05, - /// - /// Acre feets - /// - AF = 0x06, - } -} diff --git a/Common/OmniPlus/Features/Enums/UI1236Commands.cs b/Common/OmniPlus/Features/Enums/UI1236Commands.cs deleted file mode 100644 index 9ce08108..00000000 --- a/Common/OmniPlus/Features/Enums/UI1236Commands.cs +++ /dev/null @@ -1,131 +0,0 @@ -namespace OmniPlus.Features.Enums -{ - public enum UI1236Commands : byte - { - /// - /// Available after seal: Yes - /// - GetFactoryID = 0x01, - /// - /// Available after seal: No - /// - SetFactoryID = 0x02, - /// - /// Available after seal: Yes - /// - GetProgrammableID = 0x03, - /// - /// Available after seal: Yes - /// - SetProgrammableID = 0x04, - /// - /// Available after seal: Yes - /// - GetVersionAndType = 0x05, - /// - /// Available after seal: Yes - /// - GetCustomerText = 0x07, - /// - /// Available after seal: Yes - /// - SetCustomerText = 0x08, - /// - /// Available after seal: Yes - /// - GetNumberOfReadingDigits = 0x09, - /// - /// Available after seal: Yes - /// - SetNumberOfReadingDigits = 0x0A, - /// - /// Available after seal: Yes - /// - GetReadingUnits = 0x0B, - /// - /// Available after seal: Yes - /// - SetReadingUnits = 0x0C, - /// - /// Available after seal: Yes - /// - GetRateUnits = 0x0D, - /// - /// Available after seal: Yes - /// - SetRateUnits = 0x0E, - /// - /// Available after seal: Yes - /// - GetReadingResolution = 0x0F, - /// - /// Available after seal: Yes - /// - GetRateResolution = 0x11, - /// - /// Available after seal: Yes - /// - GetReading = 0x13, - /// - /// Note1: Conditional - /// - SetReadingPreset = 0x14, - /// - /// Available after seal: Yes - /// - GetReadingMode = 0x15, - /// - /// Available after seal: Yes - /// - SetReadingMode = 0x16, - /// - /// Available after seal: Yes - /// - GetBuildInformation = 0x17, - /// - /// Available after seal: No - /// - SetBuildInformation = 0x18, - /// - /// Available after seal: Yes - /// - GetMetrologyAlarmSettings1F = 0x1F, - /// - /// Available after seal: Yes - /// - SetMetrologyAlarmSettings1F = 0x20, - /// - /// Available after seal: Yes - /// - GetMetrologyAlarmSettings21 = 0x21, - /// - /// Available after seal: Yes - /// - SetMetrologyAlarmSettings21 = 0x20, - /// - /// Available after seal: Yes - /// - ClearMetrologyAlarms = 0x22, - /// - /// Available after seal: Yes - /// - GetAlarmPersistencePeriod = 0x25, - /// - /// Available after seal: Yes - SetAlarmPersistencePeriod = 0x26, - /// - /// Available after seal: Yes - /// - GetOptionalUniDirectionalFields = 0x27, - /// - /// Available after seal: Yes - /// - SetOptionalUniDirectionalFields = 0x28, - /// - /// Available after seal: Yes - /// - GetUniDirectionalString = 0x29 - } -} - - diff --git a/Common/OmniPlus/Features/Types/ASCIIString.cs b/Common/OmniPlus/Features/Types/ASCIIString.cs deleted file mode 100644 index 0f7c1d2e..00000000 --- a/Common/OmniPlus/Features/Types/ASCIIString.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace OmniPlus.Features.Types -{ - using System; - using System.Text; - - public struct ASCIIString - { - private readonly string value; - - private ASCIIString(byte[] data) - => this.value = Encoding.ASCII.GetString(data); - - public override string ToString() - => this.value; - - public static implicit operator ASCIIString(byte[] data) - => new ASCIIString(data ?? Array.Empty()); - - public static implicit operator byte[](ASCIIString asciiString) - => Encoding.ASCII.GetBytes(asciiString.value ?? string.Empty); - } -} diff --git a/Common/OmniPlus/Features/Types/MeterRange.cs b/Common/OmniPlus/Features/Types/MeterRange.cs deleted file mode 100644 index 89d082bc..00000000 --- a/Common/OmniPlus/Features/Types/MeterRange.cs +++ /dev/null @@ -1,24 +0,0 @@ -using OmniPlus.Features.Enums; - -namespace OmniPlus.Features.Types -{ - public struct MeterRange - { - private MeterRanges rangeId; - - public MeterRange(MeterRanges rangeId) - => this.rangeId = rangeId; - - public static implicit operator MeterRange(byte rangeId) - => new MeterRange((MeterRanges)rangeId); - - public static implicit operator MeterRange(MeterRanges rangeId) - => new MeterRange(rangeId); - - public static implicit operator byte(MeterRange range) - => (byte)range.rangeId; - - public static implicit operator MeterRanges(MeterRange range) - => range.rangeId; - } -} diff --git a/Common/OmniPlus/Features/Types/MeterSize.cs b/Common/OmniPlus/Features/Types/MeterSize.cs deleted file mode 100644 index d1453b25..00000000 --- a/Common/OmniPlus/Features/Types/MeterSize.cs +++ /dev/null @@ -1,24 +0,0 @@ -using OmniPlus.Features.Enums; - -namespace OmniPlus.Features.Types -{ - public struct MeterSize - { - private MeterSizes sizeId; - - public MeterSize(MeterSizes sizeId) - => this.sizeId = sizeId; - - public static implicit operator MeterSize(byte sizeId) - => new MeterSize((MeterSizes)sizeId); - - public static implicit operator MeterSize(MeterSizes sizeId) - => new MeterSize(sizeId); - - public static implicit operator byte(MeterSize size) - => (byte)size.sizeId; - - public static implicit operator MeterSizes(MeterSize size) - => size.sizeId; - } -} diff --git a/Common/OmniPlus/Features/Types/TimeSinse20000101.cs b/Common/OmniPlus/Features/Types/TimeSinse20000101.cs deleted file mode 100644 index 3eeca835..00000000 --- a/Common/OmniPlus/Features/Types/TimeSinse20000101.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace OmniPlus.Features.Types -{ - public struct TimeSinse20000101 - { - private readonly uint seconds; - - public TimeSinse20000101(uint seconds) - => this.seconds = seconds; - - public override string ToString() - { - DateTime dateTime = this; - - return dateTime.ToString("yyyy-MM-dd HH:mm:ss"); - } - - public static implicit operator TimeSinse20000101(uint seconds) - => new TimeSinse20000101(seconds); - - public static implicit operator uint(TimeSinse20000101 time) - => time.seconds; - - public static implicit operator DateTime(TimeSinse20000101 time) - => new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc).AddSeconds(time); - } -} diff --git a/Common/OmniPlus/Features/Types/TypesExtensions.cs b/Common/OmniPlus/Features/Types/TypesExtensions.cs deleted file mode 100644 index 2be8f36d..00000000 --- a/Common/OmniPlus/Features/Types/TypesExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace OmniPlus.Features.Types -{ - public static class TypesExtensions - { - public static byte[] Subarray(this byte[] sourceArray, int start, int length) - { - if (sourceArray is null) - { - throw new ArgumentNullException(nameof(sourceArray)); - } - - if (length <= 0) - { - throw new ArgumentException($"Invalid subarray length."); - } - - var subarray = new byte[length]; - var sourceL = sourceArray.Length; - - if (sourceL >= length + start) - { - Array.Copy(sourceArray, start, subarray, 0, length); - } - - return subarray; - } - } -} diff --git a/Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs b/Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs deleted file mode 100644 index 22653cd9..00000000 --- a/Common/OmniPlus/Features/UI1236/AlarmPersistencePeriod.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct AlarmPersistencePeriod - { - public const byte GET = 0x25; - public const byte SET = 0x26; - } -} diff --git a/Common/OmniPlus/Features/UI1236/BuildInformation.cs b/Common/OmniPlus/Features/UI1236/BuildInformation.cs deleted file mode 100644 index 9205ac8c..00000000 --- a/Common/OmniPlus/Features/UI1236/BuildInformation.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct BuildInformation - { - public const byte GET = 0x17; - public const byte SET = 0x18; - } -} diff --git a/Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs b/Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs deleted file mode 100644 index de85a74f..00000000 --- a/Common/OmniPlus/Features/UI1236/ClearMetrologyAlarms.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct ClearMetrologyAlarms - { - public const byte SET = 0x22; - } -} diff --git a/Common/OmniPlus/Features/UI1236/CustomerText.cs b/Common/OmniPlus/Features/UI1236/CustomerText.cs deleted file mode 100644 index cdac60cc..00000000 --- a/Common/OmniPlus/Features/UI1236/CustomerText.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct CustomerText - { - public const byte GET = 0x07; - public const byte SET = 0x08; - } -} diff --git a/Common/OmniPlus/Features/UI1236/FactoryID.cs b/Common/OmniPlus/Features/UI1236/FactoryID.cs deleted file mode 100644 index 84a59cb6..00000000 --- a/Common/OmniPlus/Features/UI1236/FactoryID.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct FactoryID - { - public const byte GET = 0x01; - public const byte SET = 0x02; - } -} diff --git a/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs b/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs deleted file mode 100644 index 3efab82b..00000000 --- a/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings1F.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct MetrologyAlarmSettings1F - { - public const byte SET = 0x20; - public const byte GET = 0x1F; - } -} diff --git a/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs b/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs deleted file mode 100644 index 72aaa976..00000000 --- a/Common/OmniPlus/Features/UI1236/MetrologyAlarmSettings21.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct MetrologyAlarmSettings21 - { - public const byte SET = 0x20; - public const byte GET = 0x21; - } -} diff --git a/Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs b/Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs deleted file mode 100644 index 98cc803e..00000000 --- a/Common/OmniPlus/Features/UI1236/NumberOfReadingDigits.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct NumberOfReadingDigits - { - public const byte GET = 0x09; - public const byte SET = 0x0A; - } -} diff --git a/Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs b/Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs deleted file mode 100644 index cdc2cc59..00000000 --- a/Common/OmniPlus/Features/UI1236/OptionalUniDirectionalFields.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct OptionalUniDirectionalFields - { - public const byte GET = 0x27; - public const byte SET = 0x28; - } -} diff --git a/Common/OmniPlus/Features/UI1236/ProgrammableID.cs b/Common/OmniPlus/Features/UI1236/ProgrammableID.cs deleted file mode 100644 index 6376055d..00000000 --- a/Common/OmniPlus/Features/UI1236/ProgrammableID.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct ProgrammableID - { - public const byte GET = 0x03; - public const byte SET = 0x04; - } -} diff --git a/Common/OmniPlus/Features/UI1236/RateResolution.cs b/Common/OmniPlus/Features/UI1236/RateResolution.cs deleted file mode 100644 index cc2922e5..00000000 --- a/Common/OmniPlus/Features/UI1236/RateResolution.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct RateResolution - { - public const byte GET = 0x11; - } -} diff --git a/Common/OmniPlus/Features/UI1236/RateUnits.cs b/Common/OmniPlus/Features/UI1236/RateUnits.cs deleted file mode 100644 index 687654b6..00000000 --- a/Common/OmniPlus/Features/UI1236/RateUnits.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct RateUnits - { - public const byte GET = 0x0D; - public const byte SET = 0x0E; - } -} diff --git a/Common/OmniPlus/Features/UI1236/Reading.cs b/Common/OmniPlus/Features/UI1236/Reading.cs deleted file mode 100644 index af2c739a..00000000 --- a/Common/OmniPlus/Features/UI1236/Reading.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct Reading - { - public const byte GET = 0x13; - } -} diff --git a/Common/OmniPlus/Features/UI1236/ReadingMode.cs b/Common/OmniPlus/Features/UI1236/ReadingMode.cs deleted file mode 100644 index a74bec63..00000000 --- a/Common/OmniPlus/Features/UI1236/ReadingMode.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct ReadingMode - { - public const byte GET = 0x15; - public const byte SET = 0x16; - } -} diff --git a/Common/OmniPlus/Features/UI1236/ReadingPreset.cs b/Common/OmniPlus/Features/UI1236/ReadingPreset.cs deleted file mode 100644 index f672a92e..00000000 --- a/Common/OmniPlus/Features/UI1236/ReadingPreset.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct ReadingPreset - { - public const byte SET = 0x14; - } -} diff --git a/Common/OmniPlus/Features/UI1236/ReadingResolution.cs b/Common/OmniPlus/Features/UI1236/ReadingResolution.cs deleted file mode 100644 index 3814e5e3..00000000 --- a/Common/OmniPlus/Features/UI1236/ReadingResolution.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct ReadingResolution - { - public const byte GET = 0x0F; - } -} diff --git a/Common/OmniPlus/Features/UI1236/ReadingUnits.cs b/Common/OmniPlus/Features/UI1236/ReadingUnits.cs deleted file mode 100644 index bfdba0ff..00000000 --- a/Common/OmniPlus/Features/UI1236/ReadingUnits.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct ReadingUnits - { - public const byte GET = 0x0B; - public const byte SET = 0x0C; - } -} diff --git a/Common/OmniPlus/Features/UI1236/UniDirectionalString.cs b/Common/OmniPlus/Features/UI1236/UniDirectionalString.cs deleted file mode 100644 index 51a1dcc6..00000000 --- a/Common/OmniPlus/Features/UI1236/UniDirectionalString.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct UniDirectionalString - { - public const byte GET = 0x29; - } -} diff --git a/Common/OmniPlus/Features/UI1236/VersionAndType.cs b/Common/OmniPlus/Features/UI1236/VersionAndType.cs deleted file mode 100644 index 4026ba1a..00000000 --- a/Common/OmniPlus/Features/UI1236/VersionAndType.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace OmniPlus.Features.UI1236 -{ - public struct VersionAndType - { - public const byte GET = 0x05; - } -} diff --git a/Common/OmniPlus/OmniPlus.csproj b/Common/OmniPlus/OmniPlus.csproj deleted file mode 100644 index 4cd03d5f..00000000 --- a/Common/OmniPlus/OmniPlus.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Debug - AnyCPU - {920435CC-ABDF-497A-9C34-1A8511F0CB56} - Exe - OmniPlus - OmniPlus - v4.8.1 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {91DEF0C0-AA4F-40AE-8F18-CB717FDE7E7F} - Crc16Ccitt - - - - \ No newline at end of file diff --git a/Common/OmniPlus/OmniRegister.cs b/Common/OmniPlus/OmniRegister.cs deleted file mode 100644 index e9f1b9b6..00000000 --- a/Common/OmniPlus/OmniRegister.cs +++ /dev/null @@ -1,54 +0,0 @@ -using OmniPlus.Connections; -using OmniPlus.Connections.Messages; -using OmniPlus.Features.DeviceSpecific; -using OmniPlus.Features.Enums; - -namespace OmniPlus -{ - public class OmniRegister - { - private readonly string portName; - private readonly IrdaConnection irdaConnection; - private readonly UniProConnection uniProConnection; - - private MessageHandler messageHandler; - - public OmniRegister(string portName) - { - this.portName = portName; - this.irdaConnection = new IrdaConnection(portName); - this.uniProConnection = new UniProConnection(portName); - } - - public void ActivateIrda() - { - this.uniProConnection?.Close(); - this.irdaConnection?.Open(); - this.messageHandler = this.irdaConnection.Write; - } - - public void ActivateUniPro() - { - this.irdaConnection?.Close(); - this.uniProConnection?.Open(); - this.messageHandler = this.uniProConnection.Write; - } - - public SystemParameters GetSystemParameters() - => this.messageHandler?.Invoke(SystemParameters.GetCommand, 3000, 300); - - - public bool SetInputVolume(InputVolume inputVolume) - { - inputVolume = this.messageHandler?.Invoke(inputVolume, 3000, 300); - - return inputVolume.Status == Status.Completed; - } - - public FactoryMeterChamberCalibrationTest StartCalibration(FactoryMeterChamberCalibrationTest calibrationOptions) - => this.messageHandler?.Invoke(calibrationOptions, 3000, 300); - - public CalibrationResults GetCalibrationResults() - => this.messageHandler?.Invoke(CalibrationResults.RequestResults, 3000, 300); - } -} diff --git a/Common/OmniPlus/Program.cs b/Common/OmniPlus/Program.cs deleted file mode 100644 index fc5f960f..00000000 --- a/Common/OmniPlus/Program.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace OmniPlus -{ - class Program - { - static void Main(string[] args) - { - var omniRegister = new OmniRegister("COM4"); - - omniRegister.ActivateIrda(); - - var systemParameters = omniRegister.GetSystemParameters(); - - - //var inputVolumeSetted = omniRegister.SetInputVolume(new InputVolume - //{ - // MilliliterPerPulse = 1500, - // FractionalPart = 500, - // MeterSize = MeterSizes.OneHalfIn, - // MeterRange = MeterRanges.From1To2, - //}); - //var calibrationStart = omniRegister.StartCalibration(new FactoryMeterChamberCalibrationTest - //{ - // CalibrationState = CalibrationState.OK, - // Rotations = 1000, - // Dauer = 10000 - //}); - //var calibration = omniRegister.GetCalibrationResults(); - } - } -} diff --git a/Common/OmniPlusInspection/Domains/LogicalConnections/IrdaConnection.cs b/Common/OmniPlusInspection/Domains/LogicalConnections/IrdaConnection.cs new file mode 100644 index 00000000..b57912b8 --- /dev/null +++ b/Common/OmniPlusInspection/Domains/LogicalConnections/IrdaConnection.cs @@ -0,0 +1,84 @@ +using OmniPlusInspection.Domains.PhysicalConnections.Enums; + +using System; +using System.IO.Ports; +using System.Threading; + +using static OmniPlusInspection.Domains.LogicalConnections.LogicalConnectionExtensions; + +namespace OmniPlusInspection.Domains.LogicalConnections +{ + public class IrdaConnection : LogicalConnection + { + public IrdaConnection(string portName) : base(portName) + { + this.Options.BaudRate = BaudRate.K115200; + this.Options.DataBits = DataBits.X8; + this.Options.Parity = Parity.None; + this.Options.StopBits = StopBits.One; + } + + public override byte[] WriteBytes(byte[] command) + { + var response = new byte[0]; + var received = false; + + if (command is null) + { + return response; + } + + this.MessageReceived += bytes => + { + response = bytes + .FromIrdaMessage() + .FromUI1236Message(); + received = true; + }; + + this.Write(OxO1, OxO1, OxO1, OxO1); + + var request = command + .ToUI1236Message() + .ToIrdaMessage(); + var sleep = 5000; + var delay = 500; + + this.Write(request); + + while (!received && sleep >= 0) + { + sleep -= delay; + + Thread.Sleep(delay); + } + + return response; + } + + protected override void SerialPortConnection_DataReceived(byte[] bytes) + { + var message = default(byte[]); + var length = bytes.Length; + var start = 0; + + while (start < bytes.Length) + { + if (bytes[start] == IRDA_START) + { + var messageLength = bytes[start + 2] * 2; + messageLength += IRDA_MIN_LENGTH; + message = new byte[messageLength]; + + Array.Copy(bytes, start, message, 0, messageLength); + + break; + } + + start++; + } + + this.NotifyMessageReceived(message); + } + } +} diff --git a/Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnection.cs b/Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnection.cs new file mode 100644 index 00000000..b82de4b6 --- /dev/null +++ b/Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnection.cs @@ -0,0 +1,19 @@ +using OmniPlusInspection.Domains.PhysicalConnections; + +namespace OmniPlusInspection.Domains.LogicalConnections +{ + public delegate void MessageReceived(byte[] bytes); + + public abstract class LogicalConnection : SerialPortConnection + { + protected event MessageReceived MessageReceived; + + public LogicalConnection(string portName) + => this.Options.PortName = portName; + + public abstract byte[] WriteBytes(byte[] command); + + protected void NotifyMessageReceived(byte[] bytes) + => this.MessageReceived?.Invoke(bytes); + } +} diff --git a/Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnectionExtensions.cs b/Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnectionExtensions.cs new file mode 100644 index 00000000..15a95a63 --- /dev/null +++ b/Common/OmniPlusInspection/Domains/LogicalConnections/LogicalConnectionExtensions.cs @@ -0,0 +1,272 @@ +using System; + +namespace OmniPlusInspection.Domains.LogicalConnections +{ + public static class LogicalConnectionExtensions + { + public const byte OxO1 = 0x01; + + public const byte UNIPRO_START = 0x53; + public const byte UNIPRO_PC2REG = 0x57; + public const byte UNIPRO_REG2PC = 0x52; + public const byte UNIPRO_STOP = 0x0D; + public const byte UNIPRO_MIN_LENGTH = 4; + + public const byte UI1236_START = 0x0D; + public const byte UI1236_MIN_LENGTH = 5; + public const byte UI1236_HED_LENGTH = 3; + + public const byte IRDA_START = 0x9B; + public const byte IRDA_PC2REG = 0x33; + public const byte IRDA_REG2PC = 0x43; + public const byte IRDA_MIN_LENGTH = 5; + public const byte IRDA_CRC_LENGTH = 2; + + /// + /// UI1236 structure: + /// 0. 0x0D - Start byte + /// 1. .... - Length: max. 254 + /// 2. .... - Control byte + /// 3+n. .... - Payload + /// n-2. .... - Checksum 0 + /// n-1. .... - Checksum 1 + /// + public static byte[] ToUI1236Message(this byte[] bytes) + { + var bytesLength = bytes.Length; + var payloadLength = bytes.Length + UI1236_MIN_LENGTH; + payloadLength += payloadLength % 2; + + var index = 0; + var message = new byte[payloadLength]; + message[index++] = UI1236_START; + message[index++] = (byte)(bytesLength + UI1236_HED_LENGTH); + + UI1236ControlByte control = 0; + control.ReturnResponse = true; + message[index++] = control; + + bytes.CopyTo(message, index--); + + var checksum = message.CalculateChecksum(message.Length - 2); + var checksumIndex = bytesLength + UI1236_HED_LENGTH; + message[checksumIndex++] = checksum[1]; + message[checksumIndex++] = checksum[0]; + + return message; + } + + /// + /// UI1236 structure: + /// 0. 0x0D - Start byte + /// 1. .... - Length: max. 254 + /// 2. .... - Control byte + /// 3+n. .... - Payload + /// n-2. .... - Checksum 0 + /// n-1. .... - Checksum 1 + /// + public static byte[] FromUI1236Message(this byte[] bytes) + { + var payload = new byte[byte.MinValue]; + + if (bytes is null) + { + return payload; + } + + var payloadLength = bytes.Length - UI1236_MIN_LENGTH; + + if (payloadLength <= 0) + { + return payload; + } + + payload = new byte[payloadLength]; + + Array.Copy(bytes, 3, payload, 0, payloadLength); + + return payload; + } + + /// + /// UniPro structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length + /// .. .... - Payload + /// n-1. .... - Stop byte + /// + public static byte[] ToUniProMessage(this byte[] bytes) + { + var messageLength = (byte)(bytes.Length + UNIPRO_MIN_LENGTH); + var message = new byte[messageLength]; + var index = 0; + + message[index++] = UNIPRO_START; + message[index++] = UNIPRO_PC2REG; + message[index++] = messageLength; + message[messageLength - 1] = UNIPRO_STOP; + + bytes.CopyTo(message, index); + + return message; + } + + /// + /// UniPro structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length + /// .. .... - Payload + /// n-1. .... - Stop byte + /// + public static byte[] FromUniProMessage(this byte[] bytes) + { + var payload = new byte[byte.MinValue]; + + if (bytes is null) + { + return payload; + } + + var payloadLength = bytes.Length - UNIPRO_MIN_LENGTH; + + if (payloadLength <= 0) + { + return payload; + } + + payload = new byte[payloadLength]; + + Array.Copy(bytes, 3, payload, 0, payloadLength); + + return payload; + } + + /// + /// UI1236 structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length / 2 + /// 3+n. .... - Payload + /// n-3. .... - alignment byte + /// n-2. .... - CRC16 0 + /// n-1. .... - CRC16 1 + /// + public static byte[] ToIrdaMessage(this byte[] bytes) + { + var payloadLength = bytes.Length; + payloadLength += payloadLength % 2; + + var index = 0; + var message = new byte[payloadLength + IRDA_MIN_LENGTH]; + message[index++] = IRDA_START; + message[index++] = IRDA_PC2REG; + message[index++] = (byte)(payloadLength / 2); + + bytes.CopyTo(message, index); + + var messageLength = message.Length; + var crc16 = message.CalculateCRC(1, messageLength - IRDA_CRC_LENGTH); + message[messageLength - 2] = crc16[0]; + message[messageLength - 1] = crc16[1]; + + return message; + } + /// + /// UI1236 structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length / 2 + /// 3+n. .... - Payload + /// n-3. .... - alignment byte + /// n-2. .... - CRC16 0 + /// n-1. .... - CRC16 1 + /// + public static byte[] FromIrdaMessage(this byte[] bytes) + { + var payload = new byte[byte.MinValue]; + + if (bytes is null) + { + return payload; + } + + var payloadLength = bytes.Length - IRDA_MIN_LENGTH; + + if (payloadLength <= 0) + { + return payload; + } + + payload = new byte[payloadLength]; + + Array.Copy(bytes, 3, payload, 0, payloadLength); + + return payload; + } + + public static byte[] CalculateCRC(this byte[] message, int start, int length) + { + var crc = 0xFFFF; + + for (int x = start; x < length; x++) + { + crc = crc ^ (0x00FF & message[x]); + + for (int i = 8; i > 0; i--) + { + if ((crc & 0x0001) != 0) + { + crc = (crc >> 1) ^ 0x8408; + } + else + { + crc >>= 1; + } + } + } + + crc = ~crc; + + return BitConverter.GetBytes(crc); + } + + public static byte[] CalculateChecksum(this byte[] bytes, int length) + { + ushort checksum = 0; + + for (int i = 0; i < length; i++) + { + checksum += bytes[i]; + } + + return BitConverter.GetBytes(checksum); + } + + public static byte[] Subarray(this byte[] sourceArray, int start, int stop) + { + if (sourceArray is null) + { + throw new ArgumentNullException(nameof(sourceArray)); + } + + var length = stop - start + 1; + + if (length <= 0) + { + throw new ArgumentException($"Invalid subarray length."); + } + + var subarray = new byte[length]; + var sourceL = sourceArray.Length; + + if (sourceL >= length) + { + Array.Copy(sourceArray, start, subarray, 0, length); + } + + return subarray; + } + } +} diff --git a/Common/OmniPlus/Features/Types/Control.cs b/Common/OmniPlusInspection/Domains/LogicalConnections/UI1236ControlByte.cs similarity index 79% rename from Common/OmniPlus/Features/Types/Control.cs rename to Common/OmniPlusInspection/Domains/LogicalConnections/UI1236ControlByte.cs index 72c8161f..5ab1f46b 100644 --- a/Common/OmniPlus/Features/Types/Control.cs +++ b/Common/OmniPlusInspection/Domains/LogicalConnections/UI1236ControlByte.cs @@ -1,10 +1,10 @@ -namespace OmniPlus.Features.Types +namespace OmniPlusInspection.Domains.LogicalConnections { - public class Control + public struct UI1236ControlByte { private readonly byte[] bits; - private Control(byte[] bits) + private UI1236ControlByte(byte[] bits) => this.bits = bits; public bool E0Encryption => this.bits[0] == 1; @@ -39,7 +39,7 @@ set => this.bits[7] = (byte)(value ? 1 : 0); } - public static implicit operator Control(byte controlByte) + public static implicit operator UI1236ControlByte(byte controlByte) { var bits = new byte[8]; @@ -48,13 +48,13 @@ bits[i] = (byte)((controlByte >> i) & 1); } - return new Control(bits); + return new UI1236ControlByte(bits); } - public static implicit operator byte (Control control) + public static implicit operator byte(UI1236ControlByte control) { var @byte = default(byte); - + for (int i = 0; i < 8; i++) { @byte ^= (byte)(control.bits[i] << i); diff --git a/Common/OmniPlusInspection/Domains/LogicalConnections/UniProConnection.cs b/Common/OmniPlusInspection/Domains/LogicalConnections/UniProConnection.cs new file mode 100644 index 00000000..2c239c6a --- /dev/null +++ b/Common/OmniPlusInspection/Domains/LogicalConnections/UniProConnection.cs @@ -0,0 +1,71 @@ +using System; +using System.Threading; + +using static OmniPlusInspection.Domains.LogicalConnections.LogicalConnectionExtensions; + +namespace OmniPlusInspection.Domains.LogicalConnections +{ + public class UniProConnection : LogicalConnection + { + public UniProConnection(string portName) : base(portName) + { + throw new Exception("Serial port options not configured!"); + } + + public override byte[] WriteBytes(byte[] command) + { + var response = new byte[0]; + var received = false; + + if (command is null) + { + return response; + } + + this.MessageReceived += bytes => + { + response = bytes.FromUniProMessage(); + received = true; + }; + + var request = command.ToUniProMessage(); + var sleep = 5000; + var delay = 500; + + this.Write(request); + + while (!received && sleep >= 0) + { + sleep -= delay; + + Thread.Sleep(delay); + } + + return response; + } + + protected override void SerialPortConnection_DataReceived(byte[] bytes) + { + var message = default(byte[]); + var length = bytes.Length; + var start = 0; + + while (start < bytes.Length) + { + if (bytes[start] == UNIPRO_START) + { + var messageLength = bytes[start + 2]; + message = new byte[messageLength]; + + Array.Copy(bytes, start, message, 0, messageLength); + + break; + } + + start++; + } + + this.NotifyMessageReceived(message); + } + } +} diff --git a/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/BaudRate.cs b/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/BaudRate.cs new file mode 100644 index 00000000..5663616f --- /dev/null +++ b/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/BaudRate.cs @@ -0,0 +1,19 @@ +namespace OmniPlusInspection.Domains.PhysicalConnections.Enums +{ + public enum BaudRate + { + K300 = 300, + K600 = 600, + K1200 = 1200, + K2400 = 2400, + K4800 = 4800, + K9600 = 9600, + K19200 = 19200, + K38400 = 38400, + K57600 = 57600, + K115200 = 115200, + K230400 = 230400, + K460800 = 460800, + K921600 = 921600 + } +} \ No newline at end of file diff --git a/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/DataBits.cs b/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/DataBits.cs new file mode 100644 index 00000000..62c66f87 --- /dev/null +++ b/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/DataBits.cs @@ -0,0 +1,10 @@ +namespace OmniPlusInspection.Domains.PhysicalConnections.Enums +{ + public enum DataBits + { + X5 = 5, + X6 = 6, + X7 = 7, + X8 = 8 + } +} \ No newline at end of file diff --git a/Common/OmniPlus/Connection/Enums/SerialPortState.cs b/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/SerialPortState.cs similarity index 67% rename from Common/OmniPlus/Connection/Enums/SerialPortState.cs rename to Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/SerialPortState.cs index 2f16697d..67509c5f 100644 --- a/Common/OmniPlus/Connection/Enums/SerialPortState.cs +++ b/Common/OmniPlusInspection/Domains/PhysicalConnections/Enums/SerialPortState.cs @@ -1,4 +1,4 @@ -namespace OmniPlus.Connection.Enums +namespace OmniPlusInspection.Domains.PhysicalConnections.Enums { public enum SerialPortState { diff --git a/Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortConnection.cs b/Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortConnection.cs new file mode 100644 index 00000000..969307cf --- /dev/null +++ b/Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortConnection.cs @@ -0,0 +1,181 @@ +using OmniPlusInspection.Domains.PhysicalConnections.Enums; + +using System; +using System.IO; +using System.IO.Ports; + +namespace OmniPlusInspection.Domains.PhysicalConnections +{ + public abstract class SerialPortConnection + { + public event Action StateChanged; + + private event Action DataReceived; + private event Action Log; + + private SerialPort serialPort; + private SerialPortState state; + + protected SerialPortConnection() + => this.Options = new SerialPortOptions(); + + protected SerialPortOptions Options { get; set; } + + protected bool Connected + => this.state == SerialPortState.Open; + + public virtual void Close() + { + if (this.serialPort != null) + { + this.serialPort.DataReceived -= this.SerialPort_DataReceived; + this.serialPort.Disposed -= this.SerialPort_Disposed; + this.serialPort.ErrorReceived -= this.SerialPort_ErrorReceived; + this.serialPort.PinChanged -= this.SerialPort_PinChanged; + } + + this.serialPort?.Close(); + + this.serialPort = null; + this.state = SerialPortState.Closed; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} closed."); + + this.Log -= this.SerialPortConnection_Log; + this.DataReceived -= this.SerialPortConnection_DataReceived; + this.StateChanged -= this.SerialPortConnection_StateChanged; + } + + public virtual void Open() + { + this.Close(); + + try + { + var fileInfo = new FileInfo(this.Options.LogFile); + fileInfo.Directory.Create(); + + File.AppendAllText(this.Options.LogFile, Environment.NewLine); + + this.Log += this.SerialPortConnection_Log; + } + catch (Exception e) + { + this.state = SerialPortState.ErrorReceived; + + Console.WriteLine($"[{this.state}] {this.Options.PortName}: {e}"); + } + + try + { + this.serialPort = new SerialPort + { + PortName = Options.PortName, + BaudRate = (int)Options.BaudRate, + DataBits = (int)Options.DataBits, + Parity = Options.Parity, + StopBits = Options.StopBits, + RtsEnable = Options.RtsEnabled, + DtrEnable = Options.DtrEnabled + }; + + this.serialPort.DataReceived += this.SerialPort_DataReceived; + this.serialPort.Disposed += this.SerialPort_Disposed; + this.serialPort.ErrorReceived += this.SerialPort_ErrorReceived; + this.serialPort.PinChanged += this.SerialPort_PinChanged; + + this.serialPort.Open(); + + this.state = SerialPortState.Open; + this.DataReceived += this.SerialPortConnection_DataReceived; + this.StateChanged += this.SerialPortConnection_StateChanged; + + this.StateChanged?.Invoke(this.state, this.Options.ToString()); + } + catch (Exception e) + { + this.state = SerialPortState.ErrorReceived; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName}: {e}"); + + this.Close(); + } + } + + protected void Write(params byte[] message) + { + if (this.Connected && message.Length > 0) + { + this.serialPort.Write(message, 0, message.Length); + } + + this.Log?.Invoke($"TX: {BitConverter.ToString(message)}"); + } + + protected abstract void SerialPortConnection_DataReceived(byte[] bytes); + + private void SerialPort_PinChanged(object sender, SerialPinChangedEventArgs args) + { + this.state = SerialPortState.PinChanged; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} {args.EventType}."); + + this.Close(); + } + + private void SerialPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs args) + { + this.state = SerialPortState.ErrorReceived; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} {args.EventType}."); + + this.Close(); + } + + private void SerialPort_Disposed(object sender, EventArgs args) + { + this.state = SerialPortState.Disposed; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} disposed."); + + this.Close(); + } + + private void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs args) + { + if (this.Connected && sender is SerialPort port && port.BytesToRead > 0) + { + var bytesToRead = port.BytesToRead; + var bytes = new byte[bytesToRead]; + + port.Read(bytes, 0, bytesToRead); + + this.DataReceived?.Invoke(bytes); + this.Log?.Invoke($"RX: {BitConverter.ToString(bytes)}"); + } + } + + private void SerialPortConnection_Log(string message) + => File.AppendAllText(this.Options.LogFile, $"{message}{Environment.NewLine}"); + + private void SerialPortConnection_StateChanged(SerialPortState state, string message) + => File.AppendAllText(this.Options.LogFile, $"[{state}] {message}{Environment.NewLine}"); + + protected static bool Exists(string portName) + { + var exists = false; + + foreach (var _portName in SerialPort.GetPortNames()) + { + exists = _portName == portName; + + if (exists) + { + break; + } + } + + return exists; + } + } +} diff --git a/Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortOptions.cs b/Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortOptions.cs new file mode 100644 index 00000000..1e74fc5e --- /dev/null +++ b/Common/OmniPlusInspection/Domains/PhysicalConnections/SerialPortOptions.cs @@ -0,0 +1,51 @@ +using OmniPlusInspection.Domains.PhysicalConnections.Enums; + +using System; +using System.IO.Ports; +using System.Reflection; + +namespace OmniPlusInspection.Domains.PhysicalConnections +{ + public class SerialPortOptions + { + public SerialPortOptions() + { + this.BaudRate = BaudRate.K4800; + this.DataBits = DataBits.X8; + this.Parity = Parity.None; + this.StopBits = StopBits.One; + this.Handshake = Handshake.None; + } + + public string PortName { get; set; } + + public BaudRate BaudRate { get; set; } + + public Parity Parity { get; set; } + + public DataBits DataBits { get; set; } + + public StopBits StopBits { get; set; } + + public Handshake Handshake { get; set; } + + public bool RtsEnabled { get; set; } + + public bool DtrEnabled { get; set; } + + public string LogFile => $".\\SerialPorts\\[{this.PortName}]\\{DateTime.Now:yyyy_MM_dd}.txt"; + + public override string ToString() + { + var properties = typeof(SerialPortOptions).GetProperties(BindingFlags.Public | BindingFlags.Instance); + var serialPortOptions = string.Empty; + + foreach (var property in properties) + { + serialPortOptions += $"{property.Name}: {property.GetValue(this, null)}"; + } + + return serialPortOptions; + } + } +} \ No newline at end of file diff --git a/Common/OmniPlusInspection/MainForm.Designer.cs b/Common/OmniPlusInspection/MainForm.Designer.cs new file mode 100644 index 00000000..bf2794a4 --- /dev/null +++ b/Common/OmniPlusInspection/MainForm.Designer.cs @@ -0,0 +1,40 @@ +namespace OmniPlusInspection +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} + diff --git a/Common/OmniPlusInspection/MainForm.cs b/Common/OmniPlusInspection/MainForm.cs new file mode 100644 index 00000000..e0ea6971 --- /dev/null +++ b/Common/OmniPlusInspection/MainForm.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace OmniPlusInspection +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + } +} diff --git a/Common/OmniPlusInspection/OmniPlusInspection.csproj b/Common/OmniPlusInspection/OmniPlusInspection.csproj new file mode 100644 index 00000000..aab080f4 --- /dev/null +++ b/Common/OmniPlusInspection/OmniPlusInspection.csproj @@ -0,0 +1,86 @@ + + + + + Debug + AnyCPU + {E301450E-2E4F-4942-886B-F92903D6C5B1} + WinExe + OmniPlusInspection + OmniPlusInspection + v4.0 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + \ No newline at end of file diff --git a/Common/OmniPlusInspection/Program.cs b/Common/OmniPlusInspection/Program.cs new file mode 100644 index 00000000..c92006b1 --- /dev/null +++ b/Common/OmniPlusInspection/Program.cs @@ -0,0 +1,16 @@ +using System; +using System.Windows.Forms; + +namespace OmniPlusInspection +{ + public static class Program + { + [STAThread] + public static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/Common/OmniPlus/Properties/AssemblyInfo.cs b/Common/OmniPlusInspection/Properties/AssemblyInfo.cs similarity index 88% rename from Common/OmniPlus/Properties/AssemblyInfo.cs rename to Common/OmniPlusInspection/Properties/AssemblyInfo.cs index 8c505827..cc448bff 100644 --- a/Common/OmniPlus/Properties/AssemblyInfo.cs +++ b/Common/OmniPlusInspection/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("OmniPlus")] +[assembly: AssemblyTitle("OmniPlusInspection")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OmniPlus")] +[assembly: AssemblyProduct("OmniPlusInspection")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("920435cc-abdf-497a-9c34-1a8511f0cb56")] +[assembly: Guid("e301450e-2e4f-4942-886b-f92903d6c5b1")] // Version information for an assembly consists of the following four values: // diff --git a/Common/OmniPlusInspection/Properties/Resources.Designer.cs b/Common/OmniPlusInspection/Properties/Resources.Designer.cs new file mode 100644 index 00000000..a41ad947 --- /dev/null +++ b/Common/OmniPlusInspection/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OmniPlusInspection.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OmniPlusInspection.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Common/OmniPlusInspection/Properties/Resources.resx b/Common/OmniPlusInspection/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Common/OmniPlusInspection/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Common/OmniPlusInspection/Properties/Settings.Designer.cs b/Common/OmniPlusInspection/Properties/Settings.Designer.cs new file mode 100644 index 00000000..6e473aee --- /dev/null +++ b/Common/OmniPlusInspection/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OmniPlusInspection.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Common/OmniPlusInspection/Properties/Settings.settings b/Common/OmniPlusInspection/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/Common/OmniPlusInspection/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj index 65db8bb5..977f3794 100644 --- a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj +++ b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj @@ -748,12 +748,13 @@ PreserveNewest Designer - - - - - - + + + + + + + PreserveNewest From 751f703b807245b58e95686874468157ef8956d6 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Wed, 1 Nov 2023 15:47:57 +0100 Subject: [PATCH 18/56] OMNI Plus whit UI --- Common/.vs/config/applicationhost.config | 2 +- Common/Common.sln | 136 ++++++++ Common/OmniPipes/OmniPipe.cs | 106 +++++++ Common/OmniPipes/OmniPipeClient.cs | 21 ++ Common/OmniPipes/OmniPipeServer.cs | 22 ++ Common/OmniPipes/OmniPipes.csproj | 49 +++ Common/OmniPipes/Properties/AssemblyInfo.cs | 36 +++ Common/OmniPlusUI/App.config | 7 + Common/OmniPlusUI/Models/COMPorts.cs | 37 +++ Common/OmniPlusUI/Models/Enums/Alarms.cs | 28 ++ .../OmniPlusUI/Models/Enums/CommandStatus.cs | 52 +++ Common/OmniPlusUI/Models/Enums/FDCommands.cs | 70 +++++ .../Models/Enums/MessurementUnits.cs | 17 + Common/OmniPlusUI/Models/Enums/ReadingType.cs | 11 + .../OmniPlusUI/Models/Enums/ReadingUnits.cs | 12 + Common/OmniPlusUI/Models/Enums/TimeUnits.cs | 12 + .../OmniPlusUI/Models/Enums/UI1236Commands.cs | 38 +++ .../Models/Features/AlarmPersistencePeriod.cs | 44 +++ .../Models/Features/AlarmSettings.cs | 18 ++ .../OmniPlusUI/Models/Features/AlarmState.cs | 18 ++ .../Models/Features/Alarms/AlarmMask.cs | 20 ++ .../Models/Features/Alarms/HighFlowAlarm.cs | 16 + .../Models/Features/Alarms/LeakAlarm.cs | 16 + .../Features/Alarms/ReverseFlowAlarm.cs | 18 ++ .../OmniPlusUI/Models/Features/BuildInfo.cs | 33 ++ Common/OmniPlusUI/Models/Features/Command.cs | 42 +++ .../Features/ConfigurationParameters.cs | 81 +++++ .../Models/Features/CustomerText.cs | 57 ++++ .../Models/Features/DataLogInterval.cs | 29 ++ Common/OmniPlusUI/Models/Features/DeviceID.cs | 56 ++++ .../Models/Features/FactoryCalibration.cs | 82 +++++ .../OmniPlusUI/Models/Features/FactoryID.cs | 54 ++++ .../OmniPlusUI/Models/Features/FactorySeal.cs | 51 +++ .../Models/Features/ManifacturingTest.cs | 22 ++ .../Models/Features/NumberOfReadingDigits.cs | 47 +++ .../Models/Features/OptionalUniDirFields.cs | 21 ++ .../Models/Features/ProgrammableID.cs | 54 ++++ .../Models/Features/RateResolution.cs | 37 +++ .../OmniPlusUI/Models/Features/RateUnits.cs | 44 +++ Common/OmniPlusUI/Models/Features/Reading.cs | 71 +++++ .../OmniPlusUI/Models/Features/ReadingMode.cs | 49 +++ .../Models/Features/ReadingResolution.cs | 39 +++ .../OmniPlusUI/Models/Features/ReadingUnit.cs | 43 +++ .../OmniPlusUI/Models/Features/RebootCount.cs | 19 ++ .../Models/Features/SmartPointConfig.cs | 43 +++ .../Models/Features/UniDirFields.cs | 15 + .../Models/Features/VersionAndType.cs | 44 +++ .../LogicalConnections/IrdaConnection.cs | 94 ++++++ .../LogicalConnections/Messages/Alarm.cs | 45 +++ .../Messages/BatteryVoltage.cs | 29 ++ .../Messages/ConfigurationParameters.cs | 65 ++++ .../Messages/FactoryCalibration.cs | 18 ++ .../Messages/FactoryCalibrationParameters.cs | 61 ++++ .../Messages/FactoryCalibrationRequest.cs | 27 ++ .../Messages/FactoryCalibrationResult.cs | 31 ++ .../Messages/FactorySeal.cs | 62 ++++ .../Messages/InputVolume.cs | 67 ++++ .../Messages/ManifacturingTime.cs | 30 ++ .../LogicalConnections/Messages/Message.cs | 39 +++ .../Messages/MessageExtensions.cs | 272 ++++++++++++++++ .../Messages/RegisterSettings.cs | 76 +++++ .../Messages/StatusResponse.cs | 26 ++ .../Messages/SystemParameters.cs | 49 +++ .../LogicalConnections/Messages/SystemTime.cs | 56 ++++ .../LogicalConnections/UI1236Connection.cs | 22 ++ .../LogicalConnections/UniProConnection.cs | 22 ++ .../LogicalConnections/Values/ASCIIString.cs | 29 ++ .../Values/CalibrationResult.cs | 20 ++ .../LogicalConnections/Values/Constants.cs | 25 ++ .../LogicalConnections/Values/Control.cs | 66 ++++ .../Values/Epoch20000101.cs | 41 +++ .../LogicalConnections/Values/Float32.cs | 30 ++ .../LogicalConnections/Values/FlowRate.cs | 34 ++ .../LogicalConnections/Values/FlowUnit.cs | 38 +++ .../LogicalConnections/Values/MeterRange.cs | 40 +++ .../LogicalConnections/Values/MeterSize.cs | 46 +++ .../LogicalConnections/Values/PulseUpdate.cs | 46 +++ .../LogicalConnections/Values/PulseWeight.cs | 50 +++ .../LogicalConnections/Values/PulseWidth.cs | 44 +++ .../LogicalConnections/Values/ReadingUnit.cs | 42 +++ Common/OmniPlusUI/Models/OmniAuftrag.cs | 37 +++ Common/OmniPlusUI/Models/OmniConnection.cs | 80 +++++ Common/OmniPlusUI/Models/OmniConstants.cs | 13 + Common/OmniPlusUI/Models/OmniDatabase.cs | 220 +++++++++++++ Common/OmniPlusUI/Models/OmniDatabase.sql | 146 +++++++++ Common/OmniPlusUI/Models/OmniModel.cs | 152 +++++++++ Common/OmniPlusUI/Models/OmniPool.cs | 295 ++++++++++++++++++ .../PhysicalConnection/Enums/BaudRate.cs | 19 ++ .../PhysicalConnection/Enums/DataBits.cs | 10 + .../Enums/SerialPortState.cs | 11 + .../SerialPortConnection.cs | 174 +++++++++++ .../PhysicalConnection/SerialPortOptions.cs | 36 +++ Common/OmniPlusUI/OmniPlusUI.Designer.cs | 130 ++++++++ Common/OmniPlusUI/OmniPlusUI.cs | 230 ++++++++++++++ Common/OmniPlusUI/OmniPlusUI.csproj | 172 ++++++++++ Common/OmniPlusUI/OmniPlusUI.resx | 123 ++++++++ Common/OmniPlusUI/Program.cs | 16 + Common/OmniPlusUI/Properties/AssemblyInfo.cs | 36 +++ .../Properties/Resources.Designer.cs | 71 +++++ Common/OmniPlusUI/Properties/Resources.resx | 117 +++++++ .../Properties/Settings.Designer.cs | 30 ++ .../OmniPlusUI/Properties/Settings.settings | 7 + 102 files changed, 5605 insertions(+), 1 deletion(-) create mode 100644 Common/OmniPipes/OmniPipe.cs create mode 100644 Common/OmniPipes/OmniPipeClient.cs create mode 100644 Common/OmniPipes/OmniPipeServer.cs create mode 100644 Common/OmniPipes/OmniPipes.csproj create mode 100644 Common/OmniPipes/Properties/AssemblyInfo.cs create mode 100644 Common/OmniPlusUI/App.config create mode 100644 Common/OmniPlusUI/Models/COMPorts.cs create mode 100644 Common/OmniPlusUI/Models/Enums/Alarms.cs create mode 100644 Common/OmniPlusUI/Models/Enums/CommandStatus.cs create mode 100644 Common/OmniPlusUI/Models/Enums/FDCommands.cs create mode 100644 Common/OmniPlusUI/Models/Enums/MessurementUnits.cs create mode 100644 Common/OmniPlusUI/Models/Enums/ReadingType.cs create mode 100644 Common/OmniPlusUI/Models/Enums/ReadingUnits.cs create mode 100644 Common/OmniPlusUI/Models/Enums/TimeUnits.cs create mode 100644 Common/OmniPlusUI/Models/Enums/UI1236Commands.cs create mode 100644 Common/OmniPlusUI/Models/Features/AlarmPersistencePeriod.cs create mode 100644 Common/OmniPlusUI/Models/Features/AlarmSettings.cs create mode 100644 Common/OmniPlusUI/Models/Features/AlarmState.cs create mode 100644 Common/OmniPlusUI/Models/Features/Alarms/AlarmMask.cs create mode 100644 Common/OmniPlusUI/Models/Features/Alarms/HighFlowAlarm.cs create mode 100644 Common/OmniPlusUI/Models/Features/Alarms/LeakAlarm.cs create mode 100644 Common/OmniPlusUI/Models/Features/Alarms/ReverseFlowAlarm.cs create mode 100644 Common/OmniPlusUI/Models/Features/BuildInfo.cs create mode 100644 Common/OmniPlusUI/Models/Features/Command.cs create mode 100644 Common/OmniPlusUI/Models/Features/ConfigurationParameters.cs create mode 100644 Common/OmniPlusUI/Models/Features/CustomerText.cs create mode 100644 Common/OmniPlusUI/Models/Features/DataLogInterval.cs create mode 100644 Common/OmniPlusUI/Models/Features/DeviceID.cs create mode 100644 Common/OmniPlusUI/Models/Features/FactoryCalibration.cs create mode 100644 Common/OmniPlusUI/Models/Features/FactoryID.cs create mode 100644 Common/OmniPlusUI/Models/Features/FactorySeal.cs create mode 100644 Common/OmniPlusUI/Models/Features/ManifacturingTest.cs create mode 100644 Common/OmniPlusUI/Models/Features/NumberOfReadingDigits.cs create mode 100644 Common/OmniPlusUI/Models/Features/OptionalUniDirFields.cs create mode 100644 Common/OmniPlusUI/Models/Features/ProgrammableID.cs create mode 100644 Common/OmniPlusUI/Models/Features/RateResolution.cs create mode 100644 Common/OmniPlusUI/Models/Features/RateUnits.cs create mode 100644 Common/OmniPlusUI/Models/Features/Reading.cs create mode 100644 Common/OmniPlusUI/Models/Features/ReadingMode.cs create mode 100644 Common/OmniPlusUI/Models/Features/ReadingResolution.cs create mode 100644 Common/OmniPlusUI/Models/Features/ReadingUnit.cs create mode 100644 Common/OmniPlusUI/Models/Features/RebootCount.cs create mode 100644 Common/OmniPlusUI/Models/Features/SmartPointConfig.cs create mode 100644 Common/OmniPlusUI/Models/Features/UniDirFields.cs create mode 100644 Common/OmniPlusUI/Models/Features/VersionAndType.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/IrdaConnection.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/Alarm.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/BatteryVoltage.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/ConfigurationParameters.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibration.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationParameters.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationRequest.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationResult.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/FactorySeal.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/InputVolume.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/ManifacturingTime.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/Message.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/MessageExtensions.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/RegisterSettings.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/StatusResponse.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemParameters.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemTime.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/UI1236Connection.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/UniProConnection.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/ASCIIString.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/CalibrationResult.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/Constants.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/Control.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/Epoch20000101.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/Float32.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/FlowRate.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/FlowUnit.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/MeterRange.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/MeterSize.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/PulseUpdate.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWeight.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWidth.cs create mode 100644 Common/OmniPlusUI/Models/LogicalConnections/Values/ReadingUnit.cs create mode 100644 Common/OmniPlusUI/Models/OmniAuftrag.cs create mode 100644 Common/OmniPlusUI/Models/OmniConnection.cs create mode 100644 Common/OmniPlusUI/Models/OmniConstants.cs create mode 100644 Common/OmniPlusUI/Models/OmniDatabase.cs create mode 100644 Common/OmniPlusUI/Models/OmniDatabase.sql create mode 100644 Common/OmniPlusUI/Models/OmniModel.cs create mode 100644 Common/OmniPlusUI/Models/OmniPool.cs create mode 100644 Common/OmniPlusUI/Models/PhysicalConnection/Enums/BaudRate.cs create mode 100644 Common/OmniPlusUI/Models/PhysicalConnection/Enums/DataBits.cs create mode 100644 Common/OmniPlusUI/Models/PhysicalConnection/Enums/SerialPortState.cs create mode 100644 Common/OmniPlusUI/Models/PhysicalConnection/SerialPortConnection.cs create mode 100644 Common/OmniPlusUI/Models/PhysicalConnection/SerialPortOptions.cs create mode 100644 Common/OmniPlusUI/OmniPlusUI.Designer.cs create mode 100644 Common/OmniPlusUI/OmniPlusUI.cs create mode 100644 Common/OmniPlusUI/OmniPlusUI.csproj create mode 100644 Common/OmniPlusUI/OmniPlusUI.resx create mode 100644 Common/OmniPlusUI/Program.cs create mode 100644 Common/OmniPlusUI/Properties/AssemblyInfo.cs create mode 100644 Common/OmniPlusUI/Properties/Resources.Designer.cs create mode 100644 Common/OmniPlusUI/Properties/Resources.resx create mode 100644 Common/OmniPlusUI/Properties/Settings.Designer.cs create mode 100644 Common/OmniPlusUI/Properties/Settings.settings diff --git a/Common/.vs/config/applicationhost.config b/Common/.vs/config/applicationhost.config index ecc20ba7..a894c3cf 100644 --- a/Common/.vs/config/applicationhost.config +++ b/Common/.vs/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/Common/Common.sln b/Common/Common.sln index a68b8b4c..6ff53667 100644 --- a/Common/Common.sln +++ b/Common/Common.sln @@ -187,6 +187,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "modbus_master_csharp", "mod EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniPlusInspection", "OmniPlusInspection\OmniPlusInspection.csproj", "{E301450E-2E4F-4942-886B-F92903D6C5B1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OmniPlus", "OmniPlus", "{D1CAF04E-407D-4F01-B588-54815EA88B0D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniPlusUI", "OmniPlusUI\OmniPlusUI.csproj", "{A403975F-65A1-431C-8192-CE0DE0321B2C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OmniPipes", "OmniPipes\OmniPipes.csproj", "{B84DF613-96AA-443B-BB46-86746E6C87F9}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4 @@ -4381,6 +4387,134 @@ Global {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x64.Build.0 = Release|Any CPU {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x86.ActiveCfg = Release|Any CPU {E301450E-2E4F-4942-886B-F92903D6C5B1}.XP32bit|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.COM|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|x64.ActiveCfg = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|x64.Build.0 = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|x86.ActiveCfg = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Debug|x86.Build.0 = Debug|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.PerformTest|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.Release|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.ReleaseTest|x86.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|Any CPU.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|x64.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|x64.Build.0 = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|x86.ActiveCfg = Release|Any CPU + {A403975F-65A1-431C-8192-CE0DE0321B2C}.XP32bit|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.COM|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|x64.ActiveCfg = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|x64.Build.0 = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|x86.ActiveCfg = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Debug|x86.Build.0 = Debug|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.PerformTest|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.Release|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.ReleaseTest|x86.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|Any CPU.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|x64.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|x64.Build.0 = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|x86.ActiveCfg = Release|Any CPU + {B84DF613-96AA-443B-BB46-86746E6C87F9}.XP32bit|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4466,6 +4600,8 @@ Global {AFC428F5-0141-4A3F-BEF2-470A89D972F6} = {C17363DF-A043-4F25-8EBA-2B3B078227DC} {F14940F8-3C86-4BB7-A915-B021E4B3052D} = {B4F8545B-F379-42A5-BDE9-763FD7B79598} {E301450E-2E4F-4942-886B-F92903D6C5B1} = {03D4F23E-7E4A-4091-BC96-036C996D351A} + {A403975F-65A1-431C-8192-CE0DE0321B2C} = {D1CAF04E-407D-4F01-B588-54815EA88B0D} + {B84DF613-96AA-443B-BB46-86746E6C87F9} = {D1CAF04E-407D-4F01-B588-54815EA88B0D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164} diff --git a/Common/OmniPipes/OmniPipe.cs b/Common/OmniPipes/OmniPipe.cs new file mode 100644 index 00000000..1dba6990 --- /dev/null +++ b/Common/OmniPipes/OmniPipe.cs @@ -0,0 +1,106 @@ +namespace OmniPipes +{ + using System.ComponentModel; + using System.IO.Pipes; + using System; + + public abstract class OmniPipe + { + protected const string PIPE_NAME = "OmniPipeExample"; + protected const byte FLOW_REQUEST = 1; + protected const byte DATA_REQUEST = 2; + protected const byte MSG_LENGTH = 9; + + protected PipeStream pipe; + + private readonly BackgroundWorker worker; + + public OmniPipe() + { + this.worker = new BackgroundWorker(); + this.worker.DoWork += this.Run; + } + + public event Action Connected; + public event Action Disconnected; + public event Action DataRequest; + public event Action FlowRequest; + + public bool IsConnected => this.pipe?.IsConnected == true; + + public void Disconnect() + { + this.pipe.Dispose(); + this.worker.Dispose(); + } + + public void Connect() + => this.worker.RunWorkerAsync(); + + public void SendFlowRequest(double value) + => this.SendMessage(value, FLOW_REQUEST); + + public void SendDataRequest(double value = 0) + => this.SendMessage(value, DATA_REQUEST); + + protected void SendMessage(double value, byte endpoint) + { + if (this.pipe.IsConnected) + { + var message = new byte[MSG_LENGTH]; + message[0] = endpoint; + + BitConverter + .GetBytes(value) + .CopyTo(message, 1); + + this.pipe.Write(message, 0, message.Length); + } + } + + protected virtual void Run(object sender, DoWorkEventArgs args) + { + this.Connected?.Invoke(); + + var buffer = new byte[byte.MaxValue]; + + while (this.pipe.IsConnected) + { + var asyncResult = this.pipe.BeginRead(buffer, 0, byte.MaxValue, this.AsyncCallback, buffer); + + if (asyncResult.AsyncWaitHandle.WaitOne()) + { + continue; + } + else + { + break; + } + } + + if (!this.pipe.IsConnected) + { + this.Disconnected?.Invoke(); + } + } + + private void AsyncCallback(IAsyncResult asyncResult) + { + if (this.pipe.IsConnected && asyncResult.AsyncState is byte[] buffer) + { + var readLength = this.pipe.EndRead(asyncResult); + + if (readLength > 0 && buffer.Length >= readLength) + { + var value = BitConverter.ToDouble(buffer, 1); + + switch (buffer[0]) + { + case FLOW_REQUEST: this.FlowRequest?.Invoke(value); break; + case DATA_REQUEST: this.DataRequest?.Invoke(value); break; + } + } + } + } + } +} diff --git a/Common/OmniPipes/OmniPipeClient.cs b/Common/OmniPipes/OmniPipeClient.cs new file mode 100644 index 00000000..5ce19d30 --- /dev/null +++ b/Common/OmniPipes/OmniPipeClient.cs @@ -0,0 +1,21 @@ +namespace OmniPipes +{ + using System.ComponentModel; + using System.IO.Pipes; + + public class OmniPipeClient : OmniPipe + { + protected override void Run(object sender, DoWorkEventArgs args) + { + var pipe = new NamedPipeClientStream( + serverName: ".", + pipeName: OmniPipe.PIPE_NAME, + direction: PipeDirection.InOut, + options: PipeOptions.Asynchronous); + this.pipe = pipe; + + pipe.Connect(); + base.Run(sender, args); + } + } +} diff --git a/Common/OmniPipes/OmniPipeServer.cs b/Common/OmniPipes/OmniPipeServer.cs new file mode 100644 index 00000000..72715c76 --- /dev/null +++ b/Common/OmniPipes/OmniPipeServer.cs @@ -0,0 +1,22 @@ +namespace OmniPipes +{ + using System.ComponentModel; + using System.IO.Pipes; + + public class OmniPipeServer : OmniPipe + { + protected override void Run(object sender, DoWorkEventArgs args) + { + var pipe = new NamedPipeServerStream( + pipeName: PIPE_NAME, + direction: PipeDirection.InOut, + maxNumberOfServerInstances: 1, + transmissionMode: PipeTransmissionMode.Byte, + options: PipeOptions.Asynchronous); + this.pipe = pipe; + + pipe.WaitForConnection(); + base.Run(sender, args); + } + } +} diff --git a/Common/OmniPipes/OmniPipes.csproj b/Common/OmniPipes/OmniPipes.csproj new file mode 100644 index 00000000..09d214e4 --- /dev/null +++ b/Common/OmniPipes/OmniPipes.csproj @@ -0,0 +1,49 @@ + + + + + Debug + AnyCPU + {B84DF613-96AA-443B-BB46-86746E6C87F9} + Library + Properties + OmniPipes + OmniPipes + v4.0 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Common/OmniPipes/Properties/AssemblyInfo.cs b/Common/OmniPipes/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f353288d --- /dev/null +++ b/Common/OmniPipes/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OmniPipes")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OmniPipes")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b84df613-96aa-443b-bb46-86746e6c87f9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Common/OmniPlusUI/App.config b/Common/OmniPlusUI/App.config new file mode 100644 index 00000000..62f03933 --- /dev/null +++ b/Common/OmniPlusUI/App.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Common/OmniPlusUI/Models/COMPorts.cs b/Common/OmniPlusUI/Models/COMPorts.cs new file mode 100644 index 00000000..d0e4432a --- /dev/null +++ b/Common/OmniPlusUI/Models/COMPorts.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace OmniPlusUI.Models +{ + public struct COMPorts : IEnumerable + { + private string[] values; + + private COMPorts(string values) + { + this.values = values + ?.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + ?? new string[0]; + + for (int i = 0; i < this.values.Length; i++) + { + this.values[i] = this.values[i]?.Trim(); + } + } + + public IEnumerator GetEnumerator() + { + foreach (var value in this.values) + { + yield return value; + } + } + + IEnumerator IEnumerable.GetEnumerator() + => this.values.GetEnumerator(); + + public static implicit operator COMPorts(string values) + => new COMPorts(values); + } +} diff --git a/Common/OmniPlusUI/Models/Enums/Alarms.cs b/Common/OmniPlusUI/Models/Enums/Alarms.cs new file mode 100644 index 00000000..28866126 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/Alarms.cs @@ -0,0 +1,28 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum Alarms : byte + { + UpgradeMode = 0, + // SevereHardwareFailure = 1, + NVMemoryError = 2, + // DeadBattery = 3, + // EmptyPipe = 4, + // MagneticTamper = 5, + MeterDisconnectTamper = 6, + NearEndOfLife = 7, + BeyondEndOfLife = 8, + // CommunicationsFailure = 9, + // CriticalHardwareWarning = 10, + Reboot = 11, + // EMFRange = 12, + // LowField = 13, + // HighCurrent = 14, + LowPrimaryBattery = 15, + // LowSecondaryBattery = 16, + // GlideSlope = 17, + // HighTemperature = 18, + ConfigError = 19, + // ActuatorFailure = 20 + // HumiditySensorRead = 21 + } +} diff --git a/Common/OmniPlusUI/Models/Enums/CommandStatus.cs b/Common/OmniPlusUI/Models/Enums/CommandStatus.cs new file mode 100644 index 00000000..91f99a41 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/CommandStatus.cs @@ -0,0 +1,52 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum CommandStatus : byte + { + /// + /// Used by communication devices to indicate communication failure/timeout. + /// Should not be used by a slave device implementing UI-1236. + /// + FailureOrTimeout = 0x00, + /// + /// Command complete, no errors + /// + Completed = 0x01, + /// + /// Error, unable to execute command + /// + UnableToExecute = 0x02, + /// + /// Error, unknown command + /// + UnknownCommand = 0x03, + /// + /// Error, unsupported control bit pattern + /// + UnsupportedControl = 0x04, + /// + /// Error, command blocked by factory seal. + /// Added in version B1.23 + /// + BlockedBySeal = 0x05, + /// + /// Custom field. + /// + Request = 0x80, + /// + /// Frame received, no error + /// + FrameReceived = 0xFC, + /// + /// Message corrupt + /// + MessageCorrupt = 0, + /// + /// Wait status + /// + Waiting = 0xFE, + /// + /// Used by communication devices to indicate unrecognized communication device command. + /// + UnrecognizedDevice = 0xFF + } +} diff --git a/Common/OmniPlusUI/Models/Enums/FDCommands.cs b/Common/OmniPlusUI/Models/Enums/FDCommands.cs new file mode 100644 index 00000000..bedc7697 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/FDCommands.cs @@ -0,0 +1,70 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum FDCommands + { + None = 0, + FD = 0xFD, + ViewInputVolumeValue = 0x02, + SetInputVolumeValue = 0x03, + ViewTimeOfFactorySeal = 0x05, + ViewTestTotalizerValue = 0x06, + SetTestTotalizerValue = 0x07, + ViewFactoryCalibration = 0x08, + SetFactoryCalibration = 0x09, + ViewFieldCalibration = 0x0A, + SetFieldCalibration = 0x0B, + ViewOutputPulseSettings = 0x0E, + SetOutputPulseSettings = 0x0F, + ViewSystemTime = 0x10, + SetSystemTime = 0x11, + ViewEnabledPredefinedAlarms = 0x12, + SetEnabledPredefinedAlarms = 0x13, + ViewDisplayMode = 0x14, + SetDisplayMode = 0x15, + SetFactoryPulseTestMode = 0x1B, + ViewLifeTimeMaxSensorPulsesPerSecond = 0x22, + SetLifeTimeMaxSensorPulsesPerSecond = 0x23, + ViewRegisterSetting = 0x24, + SetRegisterSetting = 0x25, + ViewRegisterDeviceIDString = 0x26, + SetRegisterDeviceIDString = 0x27, + ViewExtendedResolutionSetting = 0x28, + SetExtendedResolutionSetting = 0x29, + ViewManufacturingTime = 0x39, + SetManufacturingTime = 0x3A, + ViewSecondsActive = 0x3D, + ViewRebootCount = 0x55, + SetRebootCount = 0x56, + SetLCDSegmentTest = 0x62, + ViewFactorySeal = 0x63, + SetFactorySeal = 0x64, + ManufacturingTestCommand = 0x65, + SetTestPulse = 0x66, + FactoryMeterChamberCalibrationTest = 0x67, + ViewEnabledLCDViews = 0x7B, + SetEnabledLCDViews = 0x7C, + SetDataLogInterval = 0x7D, + ViewDataLogInterval = 0x7E, + ViewDataLogData = 0x80, + ViewLCDTimeout = 0x8B, + SetLCDTimeout = 0x8C, + TriggerWatchdogReset = 0x8D, + SendFlexNetSerialCommands = 0x98, + SendMultipleFlexNetSerialCommands = 0xA2, + ViewBatteryVoltage = 0xA9, + ViewBatteryVoltageMeasurementCalibrationFactors = 0xAA, + SetBatteryVoltageMeasurementCalibrationFactors = 0xAB, + ViewLidState = 0xAC, + ViewMeterSize = 0xB7, + SetMeterSize = 0xB8, + ViewTimeOfInstallation = 0xBC, + SetTimeOfInstallation = 0xBD, + ViewPeriodicAlarmLogEntries = 0xC2, + ViewDetailedAlarmLogEntries = 0xC3, + ViewAlarmCounters = 0xC4, + SetAlarmCounters = 0xC5, + ViewAggregateSystemParameters = 0xC6, + ViewAggregateConfigurationParameters = 0xC7, + SetAggregateConfigurationParameters = 0xC8, + } +} diff --git a/Common/OmniPlusUI/Models/Enums/MessurementUnits.cs b/Common/OmniPlusUI/Models/Enums/MessurementUnits.cs new file mode 100644 index 00000000..b73e0b46 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/MessurementUnits.cs @@ -0,0 +1,17 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum MessurementUnits : byte + { + CubicMeters = 0, + CubicFeets = 1, + CubicInches = 2, + CubicYards = 3, + USGallons = 4, + ImperialGallons = 5, + AcreFeets = 6, + Kiloliters = 7, + Liters = 8, + WattHours = 9, + KilowattHours = 10 + } +} diff --git a/Common/OmniPlusUI/Models/Enums/ReadingType.cs b/Common/OmniPlusUI/Models/Enums/ReadingType.cs new file mode 100644 index 00000000..0feff878 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/ReadingType.cs @@ -0,0 +1,11 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum ReadingType : byte + { + Totalizer = 0x00, + TotalForward = 0x01, + TotalReverse = 0x02, + LifetimeTotalizer = 0x03, + TestTotalizer = 0x04, + } +} diff --git a/Common/OmniPlusUI/Models/Enums/ReadingUnits.cs b/Common/OmniPlusUI/Models/Enums/ReadingUnits.cs new file mode 100644 index 00000000..679f0890 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/ReadingUnits.cs @@ -0,0 +1,12 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum ReadingUnits : byte + { + CubicMeter = 0x00, + CubicFeet = 0x01, + USGallon = 0x04, + IGallon = 0x05, + AcreFeet = 0x06, + Reset = 0xFF + } +} diff --git a/Common/OmniPlusUI/Models/Enums/TimeUnits.cs b/Common/OmniPlusUI/Models/Enums/TimeUnits.cs new file mode 100644 index 00000000..2d411c4e --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/TimeUnits.cs @@ -0,0 +1,12 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum TimeUnits : byte + { + Milliseconds = 0, + Seconds = 1, + Minutes = 2, + Hours = 3, + Days = 4, + Years = 5 + } +} diff --git a/Common/OmniPlusUI/Models/Enums/UI1236Commands.cs b/Common/OmniPlusUI/Models/Enums/UI1236Commands.cs new file mode 100644 index 00000000..ae833ed4 --- /dev/null +++ b/Common/OmniPlusUI/Models/Enums/UI1236Commands.cs @@ -0,0 +1,38 @@ +namespace OmniPlusUI.Models.Enums +{ + public enum UI1236Commands : byte + { + None = 0, + ViewFactoryID = 0x01, + SetFactoryID = 0x02, + ViewProgrammableID = 0x03, + SetProgrammableID = 0x04, + ViewVersionAndType = 0x05, + ViewCustomerText = 0x07, + SetCustomerText = 0x08, + ViewNumberOfReadingDigits = 0x09, + SetNumberOfReadingDigits = 0x0A, + ViewReadingUnits = 0x0B, + SetReadingUnits = 0x0C, + ViewRateUnits = 0x0D, + SetRateUnits = 0x0E, + ViewReadingResolution = 0x0F, + ViewRateResolution = 0x11, + ViewReading = 0x13, + SetReadingPreset = 0x14, + ViewReadingMode = 0x15, + SetReadingMode = 0x16, + ViewBuildInformation = 0x17, + SetBuildInformation = 0x18, + ViewMetrologyAlarmSettings = 0x1F, + SetMetrologyAlarmSettings = 0x20, + ViewMetrologyAlarmState = 0x21, + ClearMetrologyAlarmsState = 0x22, + ViewAlarmPersistencePeriod = 0x25, + SetAlarmPersistencePeriod = 0x26, + ViewOptionalUniDirectionalFields = 0x27, + SetOptionalUniDirectionalFields = 0x28, + ViewUniDirectionalString = 0x29, + ViewSmartPointConfig = 0x2B + } +} diff --git a/Common/OmniPlusUI/Models/Features/AlarmPersistencePeriod.cs b/Common/OmniPlusUI/Models/Features/AlarmPersistencePeriod.cs new file mode 100644 index 00000000..c4c7267f --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/AlarmPersistencePeriod.cs @@ -0,0 +1,44 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + /// + /// Default persistence period is 35 days. + /// + /// Persistence periods of 0 to 255 days are supported. + /// Persistence of 0 days means that alarms never enter persistence period. + /// There has been talk about using 255 to mean persist forever, but that has not been implemented. + /// + /// + public class AlarmPersistencePeriod : Command + { + private readonly byte persistencePeriod; + + private AlarmPersistencePeriod(CommandStatus status, byte persistencePeriod) + : base(status) + => this.persistencePeriod = persistencePeriod; + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewAlarmPersistencePeriod }; + + public override byte[] SetCommand() + => new byte[] { (byte)UI1236Commands.SetAlarmPersistencePeriod, this.persistencePeriod }; + + public static implicit operator AlarmPersistencePeriod(byte persistencePeriod) + => new AlarmPersistencePeriod(CommandStatus.Request, persistencePeriod); + + public static implicit operator AlarmPersistencePeriod(byte[] bytes) + { + var status = default(CommandStatus); + var persistencePeriod = default(byte); + + if (bytes?.Length >= 2) + { + status = (CommandStatus)bytes[0]; + persistencePeriod = bytes[1]; + } + + return new AlarmPersistencePeriod(status, persistencePeriod); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/AlarmSettings.cs b/Common/OmniPlusUI/Models/Features/AlarmSettings.cs new file mode 100644 index 00000000..46fd86d5 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/AlarmSettings.cs @@ -0,0 +1,18 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + // TODO: To be implemented. + public class AlarmSettings : Command + { + private AlarmSettings(CommandStatus status) : base(status) + { + } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewMetrologyAlarmSettings }; + + public override byte[] SetCommand() + => new byte[] { (byte)UI1236Commands.SetMetrologyAlarmSettings }; + } +} diff --git a/Common/OmniPlusUI/Models/Features/AlarmState.cs b/Common/OmniPlusUI/Models/Features/AlarmState.cs new file mode 100644 index 00000000..befb48ac --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/AlarmState.cs @@ -0,0 +1,18 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + // TODO: To be implemented. + public class AlarmState : Command + { + private AlarmState(CommandStatus status) : base(status) + { + } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewMetrologyAlarmState }; + + public override byte[] SetCommand() + => new byte[] { (byte)UI1236Commands.ClearMetrologyAlarmsState }; + } +} diff --git a/Common/OmniPlusUI/Models/Features/Alarms/AlarmMask.cs b/Common/OmniPlusUI/Models/Features/Alarms/AlarmMask.cs new file mode 100644 index 00000000..bf50a0e7 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/Alarms/AlarmMask.cs @@ -0,0 +1,20 @@ +namespace OmniPlusUI.Models.Features.Alarms +{ + /// + /// TODO: To be implemented. Handle alarm bits + /// + public class AlarmMask + { + public const int BYTES = 6; + + private readonly byte[] bytes; + // private readonly byte[] alarms; + + private AlarmMask(byte[] bytes) + { + this.bytes = new byte[BYTES]; + + bytes?.CopyTo(this.bytes, 0); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/Alarms/HighFlowAlarm.cs b/Common/OmniPlusUI/Models/Features/Alarms/HighFlowAlarm.cs new file mode 100644 index 00000000..b5b55265 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/Alarms/HighFlowAlarm.cs @@ -0,0 +1,16 @@ +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.Features +{ + public class HighFlowAlarm + { + public byte AlarmID => 0x02; + + /// + /// TODO: Set default + /// + public Float32 RateLimit { get; } // = 0.4166667 gal/sec + + public uint TimeLimit { get; } + } +} diff --git a/Common/OmniPlusUI/Models/Features/Alarms/LeakAlarm.cs b/Common/OmniPlusUI/Models/Features/Alarms/LeakAlarm.cs new file mode 100644 index 00000000..511ae823 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/Alarms/LeakAlarm.cs @@ -0,0 +1,16 @@ +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.Features +{ + public class LeakAlarm + { + public byte AlarmID => 0x01; + + /// + /// TODO: Set default. + /// + public Float32 RateLimit { get; } // = 0.0041666667 gal/sec + + public uint TimeLimit { get; } = 3600; + } +} diff --git a/Common/OmniPlusUI/Models/Features/Alarms/ReverseFlowAlarm.cs b/Common/OmniPlusUI/Models/Features/Alarms/ReverseFlowAlarm.cs new file mode 100644 index 00000000..822fd052 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/Alarms/ReverseFlowAlarm.cs @@ -0,0 +1,18 @@ +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.Features.Alarms +{ + public class ReverseFlowAlarm + { + public byte AlarmType => 0x05; + + public byte AlarmID => 0x04; + + /// + /// TODO: Set default + /// + public Float32 RateLimit { get; } // = -0.016667 gal /sec + + public uint TimeLimit { get; } = 60; + } +} diff --git a/Common/OmniPlusUI/Models/Features/BuildInfo.cs b/Common/OmniPlusUI/Models/Features/BuildInfo.cs new file mode 100644 index 00000000..6388f5df --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/BuildInfo.cs @@ -0,0 +1,33 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + /// + /// Build Information string must be at most 14 characters long. + /// There are no restrictions on character type. + /// Command is not available after factory seal. + /// + public class BuildInfo : Message + { + private const int LENGTH = 14; + + private readonly ASCIIString value; + + private BuildInfo(CommandStatus status, ASCIIString value) + : base(status) + => this.Value = value; + + public ASCIIString Value { get; } + + public static implicit operator string(BuildInfo buildInfo) + => buildInfo?.Value; + + public static implicit operator BuildInfo(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new BuildInfo(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/Command.cs b/Common/OmniPlusUI/Models/Features/Command.cs new file mode 100644 index 00000000..48121ab6 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/Command.cs @@ -0,0 +1,42 @@ +using OmniPlusUI.Models.Enums; + +using System; + +namespace OmniPlusUI.Models.Features +{ + public abstract class Command + { + protected Command(CommandStatus status) + => this.Status = status; + + public CommandStatus Status { get; protected set; } + + public virtual byte[] SetCommand() + => new byte[0]; + + public static void ParseBytes(byte[] bytes, int requiredLength, out CommandStatus status, out byte[] data) + { + status = default(CommandStatus); + data = new byte[requiredLength]; + + if (bytes is null) + { + return; + } + + var bytesLength = bytes.Length; + var startIndex = default(int); + + if (bytesLength >= requiredLength + 1) + { + status = (CommandStatus)bytes[0]; + startIndex = 1; + } + + if (startIndex + requiredLength <= bytesLength) + { + Array.Copy(bytes, startIndex, data, 0, requiredLength); + } + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/ConfigurationParameters.cs b/Common/OmniPlusUI/Models/Features/ConfigurationParameters.cs new file mode 100644 index 00000000..3aaf9729 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/ConfigurationParameters.cs @@ -0,0 +1,81 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Messages; + +using System; +using System.Text; + +namespace OmniPlusUI.Models.Features +{ + /// + /// Optional parameter: + /// 0 – Returns all of the elements of the response up to the Device ID String. + /// 1 – Returns all of the elements of the response including the Device ID String. + /// + public class ConfigurationParameters : Command + { + public const byte SET = 0xC8; + public const int LENGTH = 62; + + public ConfigurationParameters(CommandStatus status, byte[] data) : base(status) + { + if (data.Length >= LENGTH) + { + this.ProgrammableID = data.Subarray(0, 20); + this.FactoryID = data.Subarray(21, 33); + this.ReadingDigits = data.Subarray(34, 35); + this.Reading = data.Subarray(36, 45); + this.OptionalUniDirFields = data.Subarray(46, 49); + this.AlarmPersistencePeriod = data[50]; + this.DataLogInterval = data.Subarray(51, 52); + this.DeviceID = data.Subarray(53, 61); + } + } + public ProgrammableID ProgrammableID { get; set; } + + public FactoryID FactoryID { get; set; } + + public NumberOfReadingDigits ReadingDigits { get; set; } + + // TODO: To be changed according to the documentation. + public Reading Reading { get; set; } + + public OptionalUniDirFields OptionalUniDirFields { get; set; } + + public AlarmPersistencePeriod AlarmPersistencePeriod { get; set; } + + public DataLogInterval DataLogInterval { get; set; } + + public ManifacturingTime ManifacturingTime { private get; set; } + + public SystemTime SystemTime { private get; set; } + + public RebootCount RebootCount { private get; set; } + + public BuildInfo BuildInfo { private get; set; } + + public DeviceID DeviceID { get; set; } + + public static byte[] View + => new byte[] + { + (byte)FDCommands.FD, + (byte)FDCommands.ViewAggregateConfigurationParameters + }; + + public static implicit operator ConfigurationParameters(byte[] bytes) + { + string x = Encoding.ASCII.GetString(bytes); + var status = default(CommandStatus); + var data = new byte[LENGTH]; + + if (bytes?.Length >= LENGTH + 1) + { + status = (CommandStatus)bytes[0]; + + Array.Copy(bytes, 1, data, 0, LENGTH); + } + + return new ConfigurationParameters(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/CustomerText.cs b/Common/OmniPlusUI/Models/Features/CustomerText.cs new file mode 100644 index 00000000..69cb3710 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/CustomerText.cs @@ -0,0 +1,57 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.Features +{ + /// + /// (;) and (,) are not allowed. + /// + public class CustomerText : Command + { + private const int LENGTH = 20; + + private readonly ASCIIString value; + + private CustomerText(CommandStatus status, ASCIIString value) + : base(status) + => this.value = value; + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewCustomerText }; + + public override byte[] SetCommand() + { + var command = new byte[LENGTH + 1]; + command[0] = (byte)UI1236Commands.SetCustomerText; + + byte[] value = this.value; + value.CopyTo(command, 1); + + return command; + } + + public static implicit operator string(CustomerText factoryID) + => factoryID?.value; + + public static implicit operator CustomerText(string value) + => new CustomerText(CommandStatus.Request, value?.Substring(LENGTH)); + + public static implicit operator CustomerText(byte[] bytes) + { + var status = default(CommandStatus); + var data = new byte[LENGTH]; + + if (bytes?.Length >= LENGTH + 1) + { + status = (CommandStatus)bytes[0]; + + Array.Copy(bytes, 1, data, 0, LENGTH); + } + + return new CustomerText(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/DataLogInterval.cs b/Common/OmniPlusUI/Models/Features/DataLogInterval.cs new file mode 100644 index 00000000..d939d537 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/DataLogInterval.cs @@ -0,0 +1,29 @@ +using System; + +namespace OmniPlusUI.Models.Features +{ + /// + /// Number of minutes between log entries. + /// + public class DataLogInterval + { + public const byte GET = 0x7E; + + private readonly ushort value; + + private DataLogInterval(ushort digits) + => this.value = digits; + + public static implicit operator DataLogInterval(byte[] digits) + => new DataLogInterval((ushort)BitConverter.ToUInt16(digits, 0)); + + public static implicit operator DataLogInterval(ushort digits) + => new DataLogInterval(digits); + + public static implicit operator ushort(DataLogInterval readingDigits) + => readingDigits?.value ?? default(ushort); + + public static implicit operator byte[](DataLogInterval readingDigits) + => BitConverter.GetBytes(readingDigits?.value ?? default(ushort)); + } +} diff --git a/Common/OmniPlusUI/Models/Features/DeviceID.cs b/Common/OmniPlusUI/Models/Features/DeviceID.cs new file mode 100644 index 00000000..41a4210b --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/DeviceID.cs @@ -0,0 +1,56 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.Features +{ + public class DeviceID : Command + { + private const int LENGTH = 9; + + private readonly ASCIIString value; + + private DeviceID(CommandStatus status, ASCIIString value) + : base(status) + => this.value = value; + + public static byte[] View + => new byte[] { 0, 0x01 }; + + public override byte[] SetCommand() + { + var command = new byte[LENGTH + 1]; + // TODO: to be implemented + //command[0] = 0; + //command[1] = 0; + + //byte[] value = this.value; + //value.CopyTo(command, 1); + + return command; + } + + public static implicit operator string(DeviceID factoryID) + => factoryID?.value; + + public static implicit operator DeviceID(string value) + => new DeviceID(CommandStatus.Request, value?.Substring(LENGTH)); + + public static implicit operator DeviceID(byte[] bytes) + { + var status = default(CommandStatus); + var data = new byte[LENGTH]; + + if (bytes?.Length >= LENGTH + 1) + { + status = (CommandStatus)bytes[0]; + + Array.Copy(bytes, 1, data, 0, LENGTH); + } + + return new DeviceID(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/FactoryCalibration.cs b/Common/OmniPlusUI/Models/Features/FactoryCalibration.cs new file mode 100644 index 00000000..fdd5c79c --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/FactoryCalibration.cs @@ -0,0 +1,82 @@ +namespace OmniPlusUI.Models.Features +{ + public class FactoryCalibration + { + public const byte CMD = 0x67; + public const int OFFSET = 32768; + private uint secondsTaken; + + /// + /// 0 – Activate Factory Calibration Test. + /// 1 – Request Factory Calibration Test Results. + /// + public CalibrationAction Action { get; set; } + + /// + /// 0 – Test Activation Successful. + /// 1 – Test Failed(Timeout). + /// 2 – Test Successfully Completed. + /// + public CalibrationResult Result { get; set; } + + /// + /// Number of Rotations to collect or collected. + /// Not required if Requesting Calibration results. + /// Limited to 1 to 5000 rotations. + /// On Test Activation, this field echoes the number of rotations requested. + /// On Test Failed and Test Successfully Completed, returns the number of rotations collected. + /// + public ushort NumberOfRotations { get; set; } + + /// + /// Maximum Time command is supposed to take to execute - 1 to 3600 Seconds. + /// + public ushort NumberOfSeconds { get; set; } + + /// + /// Total Time it took to collect the indicated rotations. Each count is equal to 30.5176us. + /// On Test Activation Successful, returns number of seconds test is allowed to take. + /// On Test Failed, this field will show 0 indicating that the tested failed. + /// + public uint SecondsTaken + { + get => this.secondsTaken * OFFSET; + set => this.secondsTaken = value / OFFSET; + } + + public class CalibrationAction + { + private readonly byte value; + + private CalibrationAction(byte value) + => this.value = value; + + public static CalibrationAction Activate = 0; + public static CalibrationAction Request = 1; + + public static implicit operator CalibrationAction(byte value) + => new CalibrationAction(value); + + public static implicit operator byte(CalibrationAction action) + => action.value; + } + + public class CalibrationResult + { + private readonly byte value; + + private CalibrationResult(byte value) + => this.value = value; + + public static CalibrationResult Success = 0; + public static CalibrationResult Failed = 1; + public static CalibrationResult Completed = 2; + + public static implicit operator CalibrationResult(byte value) + => new CalibrationResult(value); + + public static implicit operator byte(CalibrationResult action) + => action.value; + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/FactoryID.cs b/Common/OmniPlusUI/Models/Features/FactoryID.cs new file mode 100644 index 00000000..1676d61e --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/FactoryID.cs @@ -0,0 +1,54 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.Features +{ + public class FactoryID : Command + { + private const int LENGTH = 12; + + private readonly ASCIIString value; + + private FactoryID(CommandStatus status, ASCIIString value) + : base(status) + => this.value = value; + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewFactoryID }; + + public override byte[] SetCommand() + { + var command = new byte[LENGTH + 1]; + command[0] = (byte)UI1236Commands.SetFactoryID; + + byte[] value = this.value; + value.CopyTo(command, 1); + + return command; + } + + public static implicit operator string(FactoryID factoryID) + => factoryID.value; + + public static implicit operator FactoryID(string value) + => new FactoryID(CommandStatus.Request, value); + + public static implicit operator FactoryID(byte[] bytes) + { + var status = default(CommandStatus); + var data = new byte[LENGTH]; + + if (bytes?.Length >= LENGTH + 1) + { + status = (CommandStatus)bytes[0]; + + Array.Copy(bytes, 1, data, 0, LENGTH); + } + + return new FactoryID(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/FactorySeal.cs b/Common/OmniPlusUI/Models/Features/FactorySeal.cs new file mode 100644 index 00000000..8185cc70 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/FactorySeal.cs @@ -0,0 +1,51 @@ +namespace OmniPlusUI.Models.Features +{ + public class FactorySeal + { + public const byte GET = 0x63; + public const byte SET = 0x64; + + private readonly bool value; + + private FactorySeal(byte value) + => this.value = value == 1; + + public static implicit operator FactorySeal(byte value) + => new FactorySeal(value); + + public static implicit operator FactorySeal(bool value) + => new FactorySeal((byte)(value ? 1 : 0)); + + public static implicit operator byte(FactorySeal rebootCount) + => (byte)(rebootCount.value ? 1 : 0); + + public static implicit operator bool(FactorySeal rebootCount) + => rebootCount.value; + } +} +/** TODO: Factory unseal + * Set factory seal to prevent execution of core meter configuration commands. + * Command has two formats: + * ⦁ If the first octet is non-zero, the factory seal is set. + * ⦁ If the first octet is zero, the next 8 octets are a 64-bit big endian hash code. + * If the 64-bit hash code matches the currently valid unseal hash for the meter, the factory seal will be broken/cleared/unset. + * Otherwise, the seal state is not modified. + * The hash code is a function of the responses from several commands combined into the format 0xSSSSIIIICCCCVVVV. + * This is identical to code used to unseal iPERL and ally meters. + * ⦁ SSSS: ((View Seconds Active) >> 8) & 0xFFFF, little endian. + * ⦁ IIII: CRC16_iPERL(View Factory ID), little endian. (Don’t worry about the null character. + * CRC16_iPERL doesn’t care about additional 0’s at the end of input.) + * ⦁ CCCC: Each nibble corresponds to the number of bits set in the first four characters in (View Customer Text), little endian. + * ⦁ VVVV: Characters 3-6 of response from View Reading Preset, counting the first character as character 1 + * reinterpreted as a big endian uint32 modulo 11. For example, if View Reading Preset is “12345678”, characters 3-6 would be “3456”. + * The ASCII values in hex for those characters are 0x33 34 35 36 which when reinterpreted as a uint32BE represents the + * value 859059510 in decimal. That, mod 11 is 1, so VVVV is 0x0001. + * When the input data is a string, and does not contain the number of characters required for this algorithm, + * the value used is the input data written over the value “Factory”. + * For example, if View Customer Text returns the string “Boo”, the value used in the CCCC step would be “Bootory.” + * Note that due to the reliance on time and reading, the hash may become invalidated before you are able to send the unseal command. + * Because of this, if the register responds with Unable to execute, you should recalculate the hash which should last for a longer period + * if SSSS is large/close to rolling over. + * Also, if the 7th digit rolls over during unsealing, the hash will not be valid. + * Current system time is written into manufacturing date/time if the manufacturing date/time has not been set when factory seal is set. + */ diff --git a/Common/OmniPlusUI/Models/Features/ManifacturingTest.cs b/Common/OmniPlusUI/Models/Features/ManifacturingTest.cs new file mode 100644 index 00000000..47f1ec7f --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/ManifacturingTest.cs @@ -0,0 +1,22 @@ +namespace OmniPlusUI.Models.Features +{ + /// + /// 01 Verify NFC Connectivity None Yes + /// 02 Enable NFC Periodic Updates and Initialize NFC Storage Memory None No + /// 03 Disable NFC Periodic Updates None No + /// 04 Force Update NFC NDEF data None No + /// 05 Force Update NFC Periodic RMA data None No + /// 06 View Sensor Setting None Yes + /// 07 Set Sensor Settings + /// [0 - 3] Samples Per Second + /// [4 - 7] Pulse Width No + /// 0A Board Variant and PcbId None Yes + /// 0B NFC Status None No + /// TODO: Implement options + /// + public class ManifacturingTest + { + public const byte SET = 0x65; + + } +} diff --git a/Common/OmniPlusUI/Models/Features/NumberOfReadingDigits.cs b/Common/OmniPlusUI/Models/Features/NumberOfReadingDigits.cs new file mode 100644 index 00000000..d6d63b00 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/NumberOfReadingDigits.cs @@ -0,0 +1,47 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + public class NumberOfReadingDigits : Command + { + private NumberOfReadingDigits(CommandStatus status, byte digits, byte offset) : base(status) + { + this.Digits = digits; + this.Offset = offset; + } + + /// + /// Max: 9 + /// + public byte Digits { get; set; } + + public byte Offset { get; set; } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewNumberOfReadingDigits }; + + public override byte[] SetCommand() + => new byte[] + { + (byte)UI1236Commands.SetNumberOfReadingDigits, + this.Digits, + this.Offset + }; + + public static implicit operator NumberOfReadingDigits(byte[] bytes) + { + var status = default(CommandStatus); + var digits = default(byte); + var offset = default(byte); + + if (bytes?.Length >= 3) + { + status = (CommandStatus)bytes[0]; + digits = bytes[1]; + offset = bytes[2]; + } + + return new NumberOfReadingDigits(status, digits, offset); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/OptionalUniDirFields.cs b/Common/OmniPlusUI/Models/Features/OptionalUniDirFields.cs new file mode 100644 index 00000000..5f6248fa --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/OptionalUniDirFields.cs @@ -0,0 +1,21 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + // TODO: To be implemented. + public class OptionalUniDirFields : Command + { + private OptionalUniDirFields(CommandStatus status) : base(status) + { + } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewOptionalUniDirectionalFields }; + + public override byte[] SetCommand() + => new byte[] { (byte)UI1236Commands.SetOptionalUniDirectionalFields }; + + public static implicit operator OptionalUniDirFields(byte[] bytes) + => new OptionalUniDirFields((CommandStatus)(bytes?[0] ?? default(byte))); + } +} diff --git a/Common/OmniPlusUI/Models/Features/ProgrammableID.cs b/Common/OmniPlusUI/Models/Features/ProgrammableID.cs new file mode 100644 index 00000000..76bb6368 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/ProgrammableID.cs @@ -0,0 +1,54 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.Features +{ + public class ProgrammableID : Command + { + private const int LENGTH = 20; + + private readonly ASCIIString value; + + private ProgrammableID(CommandStatus status, ASCIIString value) + : base(status) + => this.value = value; + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewProgrammableID }; + + public override byte[] SetCommand() + { + var command = new byte[LENGTH + 1]; + command[0] = (byte)UI1236Commands.SetProgrammableID; + + byte[] value = this.value; + value.CopyTo(command, 1); + + return command; + } + + public static implicit operator string(ProgrammableID factoryID) + => factoryID.value; + + public static implicit operator ProgrammableID(string value) + => new ProgrammableID(CommandStatus.Request, value); + + public static implicit operator ProgrammableID(byte[] bytes) + { + var status = default(CommandStatus); + var data = new byte[LENGTH]; + + if (bytes?.Length >= LENGTH + 1) + { + status = (CommandStatus)bytes[0]; + + Array.Copy(bytes, 1, data, 0, LENGTH); + } + + return new ProgrammableID(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/RateResolution.cs b/Common/OmniPlusUI/Models/Features/RateResolution.cs new file mode 100644 index 00000000..b3862e7b --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/RateResolution.cs @@ -0,0 +1,37 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + public class RateResolution : Command + { + private RateResolution(CommandStatus status) : base(status) + { + } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewReadingResolution }; + + public static implicit operator RateResolution(byte[] bytes) + { + var status = default(CommandStatus); + + if (bytes?.Length >= 1) + { + status = (CommandStatus)bytes[0]; + } + + return new RateResolution(status); + } + } +} + +// TODO: implement rate resolution +// Meter Range Cubic Meters Cubic Feet Gallons Acre Feet +// M3/Hour CF/Min GAL/Min and IGAL/Min +// 1 ½” or 2” -3 -3 -3 Not Supported +// 3” or 4” Extended Resolution -3 -3 -3 Not Supported +// 3” or 4” Normal Resolution -3 -3 -3 Not Supported +// 6” -3 -2 -2 Not Supported +// 8” -2 -2 -2 Not Supported +// 10” -2 -2 -2 Not Supported + diff --git a/Common/OmniPlusUI/Models/Features/RateUnits.cs b/Common/OmniPlusUI/Models/Features/RateUnits.cs new file mode 100644 index 00000000..8c577360 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/RateUnits.cs @@ -0,0 +1,44 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + public class RateUnits : Command + { + private RateUnits(CommandStatus status, MessurementUnits flowUnit, TimeUnits timeUnit) : base(status) + { + this.FlowUnit = flowUnit; + this.TimeUnit = timeUnit; + } + + public MessurementUnits FlowUnit { get; set; } + + public TimeUnits TimeUnit { get; set; } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewRateUnits }; + + public override byte[] SetCommand() + => new byte[] + { + (byte)UI1236Commands.SetRateUnits, + (byte)this.FlowUnit, + (byte)this.TimeUnit + }; + + public static implicit operator RateUnits(byte[] bytes) + { + var status = default(CommandStatus); + var flowUnit = default(MessurementUnits); + var timeUnit = default(TimeUnits); + + if (bytes?.Length >= 3) + { + status = (CommandStatus)bytes[0]; + flowUnit = (MessurementUnits)bytes[1]; + timeUnit = (TimeUnits)bytes[2]; + } + + return new RateUnits(status, flowUnit, timeUnit); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/Reading.cs b/Common/OmniPlusUI/Models/Features/Reading.cs new file mode 100644 index 00000000..bab080be --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/Reading.cs @@ -0,0 +1,71 @@ +using OmniPlusUI.Models.Enums; + +using System; + +namespace OmniPlusUI.Models.Features +{ + public class Reading : Command + { + // TODO: parse additional data + private readonly byte[] readingData; + + private Reading(CommandStatus status, byte sensorId, ReadingType readingType, byte viewType, byte[] readingData) : base(status) + { + this.SensorID = sensorId; + this.ReadingType = readingType; + this.ViewType = viewType; + this.readingData = readingData; + } + + /// + /// 0x00 is the volume, only supported sensor for Omni+ + /// + public byte SensorID { get; } + + public ReadingType ReadingType { get; set; } + + /// + /// Include units and multiplier? (optional octet) + /// 0x00 – Only the reading will be returned. + /// 0x01 – Response will include the reading, power of 10, and units of measure, separated by commas. + /// + public byte ViewType { get; set; } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewReading }; + + public override byte[] SetCommand() + => new byte[] + { + (byte)UI1236Commands.SetReadingPreset, + this.SensorID, + (byte)this.ReadingType + }; + + public static implicit operator Reading(byte[] bytes) + { + var status = default(CommandStatus); + var sensorId = default(byte); + var readingType = default(ReadingType); + var viewType = default(byte); + var readingData = default(byte[]); + + if (bytes?.Length >= 3) + { + status = (CommandStatus)bytes[0]; + sensorId = bytes[1]; + readingType = (ReadingType)bytes[2]; + + if (bytes.Length >= 4) + { + viewType = bytes[3]; + readingData = new byte[bytes.Length - 4]; + + Array.Copy(bytes, 4, readingData, 0, readingData.Length); + } + } + + return new Reading(status, sensorId, readingType, viewType, readingData); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/ReadingMode.cs b/Common/OmniPlusUI/Models/Features/ReadingMode.cs new file mode 100644 index 00000000..e2088e1c --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/ReadingMode.cs @@ -0,0 +1,49 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + public class ReadingMode : Command + { + /// + /// Response will either indicate Fixed or Undefined (like ally). Use cmd 0x27 instead. + /// + private readonly byte mode; + + private ReadingMode(CommandStatus status, byte mode) + : base(status) + => this.mode = mode; + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewReadingMode }; + + /// + /// Fixed mode requires a Programmable ID of exactly 8 characters and exactly 4 AMR digits. + /// If Programmable ID or number of AMR digits is invalid, command will return Unable to Execute. + /// The following actions will cause the register to exit Fixed mode: + /// Setting the reading string fields with cmd 0x28 will exit fixed mode. + /// Changing the Programmable ID to a length other than exactly 8 characters will exit fixed mode. + /// Changing the number AMR digits to a value other than 4 will exit fixed mode. + /// If programmable ID or number of AMR digits is set to something invalid for fixed mode, + /// then to re - enter fixed mode requires correcting the changed parameter and sending command 0x16 Set Reading Mode again. + /// + public override byte[] SetCommand() + => new byte[] { (byte)UI1236Commands.SetReadingMode, this.mode }; + + public static implicit operator ReadingMode(byte mode) + => new ReadingMode(CommandStatus.Request, mode); + + public static implicit operator ReadingMode(byte[] bytes) + { + var status = default(CommandStatus); + var mode = default(byte); + + if (bytes?.Length >= 2) + { + status = (CommandStatus)bytes[0]; + mode = bytes[1]; + } + + return new ReadingMode(status, mode); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/ReadingResolution.cs b/Common/OmniPlusUI/Models/Features/ReadingResolution.cs new file mode 100644 index 00000000..851ced83 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/ReadingResolution.cs @@ -0,0 +1,39 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + public class ReadingResolution : Command + { + private ReadingResolution(CommandStatus status) : base(status) + { + } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewReadingResolution }; + + public static implicit operator ReadingResolution(byte[] bytes) + { + var status = default(CommandStatus); + + if (bytes?.Length >= 1) + { + status = (CommandStatus)bytes[0]; + } + + return new ReadingResolution(status); + } + } +} + + +// TODO: implement reading resolution +// Meter Range Cubic Meters Cubic Feet Imperial Gallons Gallons Acre Feet +// 1 ½” or 2” -3 -2 0 0 -5 +// 3” or 4” -2 -2 0 0 -5 +// Extended Resolution +// 3” or 4” -2 0 0 0 -5 +// Normal Resolution +// 6” -2 0 0 0 -5 +// 8” -2 0 0 0 -4 +// 10” -2 0 0 0 -4 + diff --git a/Common/OmniPlusUI/Models/Features/ReadingUnit.cs b/Common/OmniPlusUI/Models/Features/ReadingUnit.cs new file mode 100644 index 00000000..fa87a9de --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/ReadingUnit.cs @@ -0,0 +1,43 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + /// + /// 0xFF in the reading units byte does not change the reading units. + /// 0xFF disables reporting of multiplier and units in the reading and flowrate uni-directional fields. + /// Setting reading units to one of the actual supported values, enables reporting of multiplier and units in the reading and flowrate uni-directional fields. + /// Reading Resolution is based on Meter Range and Units of Measure.Omni+ does not support a separate command to set reading resolution. + /// + public class ReadingUnit : Command + { + private readonly ReadingUnits readingUnit; + + private ReadingUnit(CommandStatus status, ReadingUnits readingUnit) + : base(status) + => this.readingUnit = readingUnit; + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewReadingUnits }; + + public override byte[] SetCommand() + => new byte[] + { + (byte)UI1236Commands.SetReadingUnits, + (byte)this.readingUnit + }; + + public static implicit operator ReadingUnit(byte[] bytes) + { + var status = default(CommandStatus); + var redingUnit = default(ReadingUnits); + + if (bytes?.Length >= 2) + { + status = (CommandStatus)bytes[0]; + redingUnit = (ReadingUnits)bytes[1]; + } + + return new ReadingUnit(status, redingUnit); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/RebootCount.cs b/Common/OmniPlusUI/Models/Features/RebootCount.cs new file mode 100644 index 00000000..562748d4 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/RebootCount.cs @@ -0,0 +1,19 @@ +namespace OmniPlusUI.Models.Features +{ + public class RebootCount + { + public const byte GET = 0x55; + public const byte SET = 0x56; + + private readonly byte value; + + private RebootCount(byte value) + => this.value = value; + + public static implicit operator RebootCount(byte value) + => new RebootCount(value); + + public static implicit operator byte(RebootCount rebootCount) + => rebootCount.value; + } +} diff --git a/Common/OmniPlusUI/Models/Features/SmartPointConfig.cs b/Common/OmniPlusUI/Models/Features/SmartPointConfig.cs new file mode 100644 index 00000000..7213de92 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/SmartPointConfig.cs @@ -0,0 +1,43 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.Features +{ + public class SmartPointConfig : Command + { + public SmartPointConfig(CommandStatus status, byte productType, MeterSize meterSize, byte availableSensors) : base(status) + { + this.ProductType = productType; + this.MeterSize = meterSize; + this.AvailableSensors = availableSensors; + } + + public byte ProductType { get; } + + public MeterSize MeterSize { get; } + + public byte AvailableSensors { get; } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewSmartPointConfig }; + + public static implicit operator SmartPointConfig(byte[] bytes) + { + var status = default(CommandStatus); + var productType = default(byte); + var meterSize = default(MeterSize); + var availableSensors = default(byte); + + if (bytes?.Length >= 4) + { + status = (CommandStatus)bytes[0]; + productType = bytes[1]; + meterSize = bytes[2]; + availableSensors = bytes[3]; + } + + return new SmartPointConfig(status, productType, meterSize, availableSensors); + } + } +} diff --git a/Common/OmniPlusUI/Models/Features/UniDirFields.cs b/Common/OmniPlusUI/Models/Features/UniDirFields.cs new file mode 100644 index 00000000..c62529b6 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/UniDirFields.cs @@ -0,0 +1,15 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.Features +{ + // TODO: To be implemented. + public class UniDirFields : Command + { + private UniDirFields(CommandStatus status) : base(status) + { + } + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewUniDirectionalString }; + } +} diff --git a/Common/OmniPlusUI/Models/Features/VersionAndType.cs b/Common/OmniPlusUI/Models/Features/VersionAndType.cs new file mode 100644 index 00000000..9d36d661 --- /dev/null +++ b/Common/OmniPlusUI/Models/Features/VersionAndType.cs @@ -0,0 +1,44 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.Features +{ + public class VersionAndType : Command + { + // TODO: how long should be version&type string? + private const int LENGTH = 27; + + private readonly ASCIIString value; + + private VersionAndType(CommandStatus status, ASCIIString value) + : base(status) + => this.value = value; + + public static implicit operator string(VersionAndType factoryID) + => factoryID.value; + + public static implicit operator VersionAndType(string value) + => new VersionAndType(CommandStatus.Request, value); + + public static byte[] View + => new byte[] { (byte)UI1236Commands.ViewVersionAndType }; + + public static implicit operator VersionAndType(byte[] bytes) + { + var status = default(CommandStatus); + var data = new byte[LENGTH]; + + if (bytes?.Length >= 1) + { + status = (CommandStatus)bytes[0]; + + Array.Copy(bytes, 1, data, 0, LENGTH); + } + + return new VersionAndType(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/IrdaConnection.cs b/Common/OmniPlusUI/Models/LogicalConnections/IrdaConnection.cs new file mode 100644 index 00000000..3dd90a12 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/IrdaConnection.cs @@ -0,0 +1,94 @@ +using OmniPlusUI.Models.LogicalConnections.Messages; +using OmniPlusUI.Models.PhysicalConnection; +using OmniPlusUI.Models.PhysicalConnection.Enums; + +using System; +using System.IO.Ports; +using System.Threading; + +namespace OmniPlusUI.Models.LogicalConnections +{ + public class IrdaConnection : SerialPortConnection + { + private const byte OxO1 = 0x01; + + private event Action messageReceived; + + public IrdaConnection(string portName, string logFile = null) + { + this.Options.PortName = portName; + this.Options.BaudRate = BaudRate.K115200; + this.Options.DataBits = DataBits.X8; + this.Options.Parity = Parity.None; + this.Options.StopBits = StopBits.One; + this.Options.LogFile = logFile ?? $".\\IRDA\\[{portName}].txt"; + } + + public byte[] WriteBytes(byte[] command) + { + var response = new byte[0]; + var received = false; + + if (command is null) + { + return response; + } + + this.messageReceived += bytes => + { + response = bytes + .FromIrdaMessage() + .FromUI1236Message(); + received = true; + }; + + this.Write(OxO1, OxO1, OxO1, OxO1); + + var request = command + .ToUI1236Message() + .ToIrdaMessage(); + var sleep = 5000; + var delay = 500; + + this.Write(request); + + while (!received && sleep >= 0) + { + sleep -= delay; + + Thread.Sleep(delay); + } + + return response; + } + + protected override void SerialPortConnection_DataReceived(byte[] bytes) + { + this.Reading = true; + + var message = default(byte[]); + var length = bytes.Length; + var start = 0; + + while (start < bytes.Length) + { + if (bytes[start] == MessageExtensions.IRDA_START) + { + var messageLength = bytes[start + 2] * 2; + messageLength += MessageExtensions.IRDA_MIN_LENGTH; + message = new byte[messageLength]; + + Array.Copy(bytes, start, message, 0, messageLength); + + break; + } + + start++; + } + + this.messageReceived?.Invoke(message); + + this.Reading = false; + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/Alarm.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/Alarm.cs new file mode 100644 index 00000000..84f2ed0f --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/Alarm.cs @@ -0,0 +1,45 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class Alarm : Message + { + public Alarm() : base(CommandStatus.Request) + { + } + + public byte MetrologyDeviceId => 0x00; + + public virtual byte AlarmType { get; } + + public virtual byte AlarmId { get; } + + public byte ActionChannel => 0x00; + + public Float32 Rate { get; set; } + + public uint TimeLimit { get; set; } + } + + public class LeakAlarm : Alarm + { + public override byte AlarmType => 0x04; + + public override byte AlarmId => 0x01; + } + + public class HighFlowAlarm : Alarm + { + public override byte AlarmType => 0x04; + + public override byte AlarmId => 0x02; + } + + public class ReverseFlowAlarm : Alarm + { + public override byte AlarmType => 0x05; + + public override byte AlarmId => 0x04; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/BatteryVoltage.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/BatteryVoltage.cs new file mode 100644 index 00000000..aa580b5d --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/BatteryVoltage.cs @@ -0,0 +1,29 @@ +using OmniPlusUI.Models.Enums; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class BatteryVoltage : Message + { + public const double MIN = 3.19; + public const double MAX = 3.75; + public const int LENGTH = 0x06; + + public readonly byte[] bytes; + + private BatteryVoltage(CommandStatus status, byte[] bytes) : base(status) + => this.bytes = bytes; + + public double Volts => BitConverter.ToUInt16(this.bytes, 0) / 1000.0; + + public uint ADCCount => BitConverter.ToUInt32(this.bytes, 2); + + public static implicit operator BatteryVoltage(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new BatteryVoltage(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/ConfigurationParameters.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/ConfigurationParameters.cs new file mode 100644 index 00000000..f6dd3b16 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/ConfigurationParameters.cs @@ -0,0 +1,65 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class ConfigurationParameters : Message + { + private const int LENGTH = 62; + + public ConfigurationParameters() : base(CommandStatus.Request) + { + } + + public ConfigurationParameters(CommandStatus status, byte[] data) : base(status) + { + this.ProgrammableID = data.Subarray(0, 20); + this.FactoryID = data.Subarray(21, 33); + this.NumberOfReadingDigits = (sbyte)BitConverter.ToInt16(data, 34); + this.ReadingPreset = data.Subarray(36, 45); + this.OptionalUniDirFields = BitConverter.ToUInt16(data, 46); + this.AlarmPersistencePeriod = data[50]; + this.DataLogInterval = BitConverter.ToUInt16(data, 51); + this.DeviceID = data.Subarray(53, 61); + } + + public ASCIIString ProgrammableID { get; set; } + + public ASCIIString FactoryID { get; set; } + + public sbyte NumberOfReadingDigits { get; set; } + + public ASCIIString ReadingPreset { get; set; } + + public ushort OptionalUniDirFields { get; set; } + + public byte AlarmPersistencePeriod { get; set; } + + public ushort DataLogInterval { get; set; } + + public ASCIIString DeviceID { get; set; } + + public Epoch20000101 ManifacturingTime { get; set; } + + public Epoch20000101 SystemTime => DateTime.UtcNow; + + public int RebootsCount { get; } + + public ASCIIString BuildInfo { get; set; } + + public static implicit operator byte[] (ConfigurationParameters configuration) + { + // TODO: Build the message + return new byte[0]; + } + + public static implicit operator ConfigurationParameters(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new ConfigurationParameters(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibration.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibration.cs new file mode 100644 index 00000000..3e5cc307 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibration.cs @@ -0,0 +1,18 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class FactoryCalibration : Message + { + protected const byte CMDLEN = 2; + protected const byte LENGTH = 5; + + protected FactoryCalibration(CommandStatus status = CommandStatus.Request) : base(status) + { + } + + public ushort Rotations { get; set; } + + public ushort Duration { get; set; } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationParameters.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationParameters.cs new file mode 100644 index 00000000..8cbdcc44 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationParameters.cs @@ -0,0 +1,61 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class FactoryCalibrationParameters : FactoryCalibration, IComparable + { + public const byte ACTIVATE = 0x00; + public const byte REQUEST = 0x01; + + + public FactoryCalibrationParameters(byte action = ACTIVATE) + : base(CommandStatus.Request) + => this.Action = ACTIVATE; + + private FactoryCalibrationParameters(CommandStatus status, byte[] data) : base(status) + { + this.Action = data[0]; + this.Rotations = BitConverter.ToUInt16(data, 1); + this.Duration = BitConverter.ToUInt16(data, 3); + } + + public byte Action { get; } + + public double Volume { get; set; } + + public int CompareTo(FactoryCalibrationParameters other) + => other?.Volume.CompareTo(this.Volume) ?? default(int); + + public static implicit operator byte[](FactoryCalibrationParameters parameters) + { + var bytes = new byte[LENGTH + CMDLEN]; + + if (parameters != null) + { + var rotations = BitConverter.GetBytes(parameters.Rotations); + var duration = BitConverter.GetBytes(parameters.Duration); + var index = 0; + + bytes[index++] = Constants.DeviceSpecific; + bytes[index++] = Constants.FactoryCalibration; + bytes[index++] = parameters.Action; + bytes[index++] = rotations[Constants.LSB]; + bytes[index++] = rotations[Constants.MSB]; + bytes[index++] = duration[Constants.LSB]; + bytes[index++] = duration[Constants.MSB]; + } + + return bytes; + } + + public static implicit operator FactoryCalibrationParameters(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new FactoryCalibrationParameters(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationRequest.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationRequest.cs new file mode 100644 index 00000000..c85404a5 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationRequest.cs @@ -0,0 +1,27 @@ +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class FactoryCalibrationRequest : FactoryCalibrationParameters + { + public FactoryCalibrationRequest() : base(REQUEST) + { + } + + public static implicit operator byte[] (FactoryCalibrationRequest request) + { + var bytes = new byte[3]; + + if (request != null) + { + var index = 0; + + bytes[index++] = Constants.DeviceSpecific; + bytes[index++] = Constants.FactoryCalibration; + bytes[index++] = REQUEST; + } + + return bytes; + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationResult.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationResult.cs new file mode 100644 index 00000000..2e5313fc --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactoryCalibrationResult.cs @@ -0,0 +1,31 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class FactoryCalibrationResult : FactoryCalibration + { + private const int ADD = 2; + + public FactoryCalibrationResult(CommandStatus status, byte[] data) : base(status) + { + this.Result = data[0]; + this.Rotations = BitConverter.ToUInt16(data, 1); + this.TimeTooked = BitConverter.ToUInt32(data, 3) * (1/ 32768); + } + + public CalibrationResult Result { get; set; } + + public uint TimeTooked { get; } + + + public static implicit operator FactoryCalibrationResult(byte[] bytes) + { + ParseBytes(bytes, LENGTH + ADD, out var status, out var data); + + return new FactoryCalibrationResult(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactorySeal.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactorySeal.cs new file mode 100644 index 00000000..89acf58f --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/FactorySeal.cs @@ -0,0 +1,62 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class FactorySeal : Message + { + public FactorySeal(CommandStatus status) : base(status) + { + } + } + + public class ViewFactorySeal : FactorySeal + { + private readonly byte[] command; + + private ViewFactorySeal(CommandStatus status, bool @sealed) + : base(status) + => this.Sealed = @sealed; + + public bool Sealed { get; } + + public static implicit operator byte[] (ViewFactorySeal factorySeal) + => new byte[] { Constants.DeviceSpecific, Constants.ViewFactorySeal }; + + public static implicit operator ViewFactorySeal(byte[] data) + { + var status = default(CommandStatus); + var @sealed = default(bool); + + if (data?.Length >= 2) + { + status = (CommandStatus)data[0]; + @sealed = data[1] == 1; + } + + return new ViewFactorySeal(status, @sealed); + } + } + + public class SetFactorySeal : FactorySeal + { + private readonly byte[] command; + + public SetFactorySeal(bool seal) + : base(CommandStatus.Request) + => this.command = new byte[] + { + Constants.DeviceSpecific, + Constants.SetFactorySeal, + (byte)(seal ? 0x01 : 0x00) + }; + + public static implicit operator SetFactorySeal(bool seal) + => new SetFactorySeal(seal); + + public static implicit operator byte[](SetFactorySeal factorySeal) + => factorySeal?.command ?? new byte[0]; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/InputVolume.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/InputVolume.cs new file mode 100644 index 00000000..9ab66216 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/InputVolume.cs @@ -0,0 +1,67 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class InputVolume : Message + { + private const byte CMDLEN = 2; + private const byte LENGTH = 6; + + public InputVolume() : base(CommandStatus.Request) + { + } + + private InputVolume(CommandStatus status, byte[] data) : base(status) + { + var index = 0; + this.IntPart = data[index++]; + this.Direction = data[index++]; + this.FractionLSB = data[index++]; + this.FractionMSB = data[index++]; + this.MeterSize = data[index++]; + this.MeterRange = data[index++]; + } + + public byte IntPart { get; set; } + + public byte Direction { get; set; } + + public byte FractionLSB { get; set; } + + public byte FractionMSB { get; set; } + + public byte MeterSize { get; set; } + + public byte MeterRange { get; set; } + + public ushort CorrectionFactor { get; set; } + + public static implicit operator byte[] (InputVolume inputVolume) + { + var bytes = new byte[LENGTH + CMDLEN]; + + if (inputVolume != null) + { + var index = 0; + bytes[index++] = Constants.DeviceSpecific; + bytes[index++] = Constants.SetInputVolumeValue; + bytes[index++] = inputVolume.IntPart; + bytes[index++] = inputVolume.Direction; + bytes[index++] = inputVolume.FractionLSB; + bytes[index++] = inputVolume.FractionMSB; + bytes[index++] = inputVolume.MeterSize; + bytes[index++] = inputVolume.MeterRange; + } + + return bytes; + } + + public static implicit operator InputVolume(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new InputVolume(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/ManifacturingTime.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/ManifacturingTime.cs new file mode 100644 index 00000000..447c7e7a --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/ManifacturingTime.cs @@ -0,0 +1,30 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class ManifacturingTime : Message + { + public const byte GET = 0x39; + public const byte SET = 0x3A; + public const byte LENGTH = 4; + public const int MAX_AGE = 365; + + private readonly Epoch20000101 value; + + private ManifacturingTime(CommandStatus status, byte[] data) + : base(status) + => this.value = data; + + public DateTime DateTime => value.DateTime; + + public static implicit operator ManifacturingTime(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new ManifacturingTime(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/Message.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/Message.cs new file mode 100644 index 00000000..0176b70c --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/Message.cs @@ -0,0 +1,39 @@ +using OmniPlusUI.Models.Enums; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public abstract class Message + { + protected Message(CommandStatus status) + => this.Status = status; + + public CommandStatus Status { get; protected set; } + + public static void ParseBytes(byte[] bytes, int requiredLength, out CommandStatus status, out byte[] data) + { + status = default(CommandStatus); + data = new byte[requiredLength]; + + if (bytes is null) + { + return; + } + + var bytesLength = bytes.Length; + var startIndex = default(int); + + if (bytesLength >= requiredLength + 1) + { + status = (CommandStatus)bytes[0]; + startIndex = 1; + } + + if (startIndex + requiredLength <= bytesLength) + { + Array.Copy(bytes, startIndex, data, 0, requiredLength); + } + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/MessageExtensions.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/MessageExtensions.cs new file mode 100644 index 00000000..4a2577c3 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/MessageExtensions.cs @@ -0,0 +1,272 @@ +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public static class MessageExtensions + { + public const byte UNIPRO_START = 0x53; + public const byte UNIPRO_PC2REG = 0x57; + public const byte UNIPRO_REG2PC = 0x52; + public const byte UNIPRO_STOP = 0x0D; + public const byte UNIPRO_MIN_LENGTH = 4; + + public const byte UI1236_START = 0x0D; + public const byte UI1236_MIN_LENGTH = 5; + public const byte UI1236_HED_LENGTH = 3; + + public const byte IRDA_START = 0x9B; + public const byte IRDA_PC2REG = 0x33; + public const byte IRDA_REG2PC = 0x43; + public const byte IRDA_MIN_LENGTH = 5; + public const byte IRDA_CRC_LENGTH = 2; + + /// + /// UI1236 structure: + /// 0. 0x0D - Start byte + /// 1. .... - Length: max. 254 + /// 2. .... - Control byte + /// 3+n. .... - Payload + /// n-2. .... - Checksum 0 + /// n-1. .... - Checksum 1 + /// + public static byte[] ToUI1236Message(this byte[] bytes) + { + var bytesLength = bytes.Length; + var payloadLength = bytes.Length + UI1236_MIN_LENGTH; + payloadLength += payloadLength % 2; + + var index = 0; + var message = new byte[payloadLength]; + message[index++] = UI1236_START; + message[index++] = (byte)(bytesLength + UI1236_HED_LENGTH); + + Control control = 0; + control.ReturnResponse = true; + message[index++] = control; + + bytes.CopyTo(message, index--); + + var checksum = message.CalculateChecksum(message.Length - 2); + var checksumIndex = bytesLength + UI1236_HED_LENGTH; + message[checksumIndex++] = checksum[1]; + message[checksumIndex++] = checksum[0]; + + return message; + } + + /// + /// UI1236 structure: + /// 0. 0x0D - Start byte + /// 1. .... - Length: max. 254 + /// 2. .... - Control byte + /// 3+n. .... - Payload + /// n-2. .... - Checksum 0 + /// n-1. .... - Checksum 1 + /// + public static byte[] FromUI1236Message(this byte[] bytes) + { + var payload = new byte[0]; + + if (bytes is null) + { + return payload; + } + + var payloadLength = bytes.Length - UI1236_MIN_LENGTH; + + if (payloadLength <= 0) + { + return payload; + } + + payload = new byte[payloadLength]; + + Array.Copy(bytes, 3, payload, 0, payloadLength); + + return payload; + } + + /// + /// UniPro structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length + /// .. .... - Payload + /// n-1. .... - Stop byte + /// + public static byte[] ToUniProMessage(this byte[] bytes) + { + var messageLength = (byte)(bytes.Length + UNIPRO_MIN_LENGTH); + var message = new byte[messageLength]; + var index = 0; + + message[index++] = UNIPRO_START; + message[index++] = UNIPRO_PC2REG; + message[index++] = messageLength; + message[messageLength - 1] = UNIPRO_STOP; + + bytes.CopyTo(message, index); + + return message; + } + + /// + /// UniPro structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length + /// .. .... - Payload + /// n-1. .... - Stop byte + /// + public static byte[] FromUniProMessage(this byte[] bytes) + { + var payload = new byte[0]; + + if (bytes is null) + { + return payload; + } + + var payloadLength = bytes.Length - UNIPRO_MIN_LENGTH; + + if (payloadLength <= 0) + { + return payload; + } + + payload = new byte[payloadLength]; + + Array.Copy(bytes, 3, payload, 0, payloadLength); + + return payload; + } + + /// + /// UI1236 structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length / 2 + /// 3+n. .... - Payload + /// n-3. .... - alignment byte + /// n-2. .... - CRC16 0 + /// n-1. .... - CRC16 1 + /// + public static byte[] ToIrdaMessage(this byte[] bytes) + { + var payloadLength = bytes.Length; + payloadLength += payloadLength % 2; + + var index = 0; + var message = new byte[payloadLength + IRDA_MIN_LENGTH]; + message[index++] = IRDA_START; + message[index++] = IRDA_PC2REG; + message[index++] = (byte)(payloadLength / 2); + + bytes.CopyTo(message, index); + + var messageLength = message.Length; + var crc16 = message.CalculateCRC(1, messageLength - IRDA_CRC_LENGTH); + message[messageLength - 2] = crc16[0]; + message[messageLength - 1] = crc16[1]; + + return message; + } + /// + /// UI1236 structure: + /// 0. .... - Start byte + /// 1. .... - Direction + /// 2. .... - Length / 2 + /// 3+n. .... - Payload + /// n-3. .... - alignment byte + /// n-2. .... - CRC16 0 + /// n-1. .... - CRC16 1 + /// + public static byte[] FromIrdaMessage(this byte[] bytes) + { + var payload = new byte[0]; + + if (bytes is null) + { + return payload; + } + + var payloadLength = bytes.Length - IRDA_MIN_LENGTH; + + if (payloadLength <= 0) + { + return payload; + } + + payload = new byte[payloadLength]; + + Array.Copy(bytes, 3, payload, 0, payloadLength); + + return payload; + } + + public static byte[] CalculateCRC(this byte[] message, int start, int length) + { + var crc = 0xFFFF; + + for (int x = start; x < length; x++) + { + crc = crc ^ (0x00FF & message[x]); + + for (int i = 8; i > 0; i--) + { + if ((crc & 0x0001) != 0) + { + crc = (crc >> 1) ^ 0x8408; + } + else + { + crc >>= 1; + } + } + } + + crc = ~crc; + + return BitConverter.GetBytes(crc); + } + + public static byte[] CalculateChecksum(this byte[] bytes, int length) + { + ushort checksum = 0; + + for (int i = 0; i < length; i++) + { + checksum += bytes[i]; + } + + return BitConverter.GetBytes(checksum); + } + + public static byte[] Subarray(this byte[] sourceArray, int start, int stop) + { + if (sourceArray is null) + { + throw new ArgumentNullException(nameof(sourceArray)); + } + + var length = stop - start + 1; + + if (length <= 0) + { + throw new ArgumentException($"Invalid subarray length."); + } + + var subarray = new byte[length]; + var sourceL = sourceArray.Length; + + if (sourceL >= length) + { + Array.Copy(sourceArray, start, subarray, 0, length); + } + + return subarray; + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/RegisterSettings.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/RegisterSettings.cs new file mode 100644 index 00000000..d740f88c --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/RegisterSettings.cs @@ -0,0 +1,76 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class RegisterSettings : Message + { + private const int LENGTH = 18; + + public RegisterSettings() : base(CommandStatus.Completed) + { + + } + + private RegisterSettings(CommandStatus status, byte[] data) : base(status) + { + // TODO: Parse register settings + } + + /// + /// Is the 2 byte integer part of the Volume per milliliter. + /// The Most Significant bit of the 16 bit hex value is used to indicate the direction of the meter flow. + /// The bit is clear for 1 ½”, 2”, 3”, 4” or 6” meters.The bit is set for 8” ro 10” meters. + /// See Command 0 03 for more information of the definition of the Vpr_ml setting. + /// + public ushort MilliliterPerPulse { get; set; } + + /// + /// Is the 2 byte integer part of the Volume per milliliter. + /// See Command 003 for more information of the definition of the Vpr_ml setting. + /// + public ushort FractionalPart { get; set; } + + public MeterSize MeterSize { get; set; } + + public MeterRange MeterRange { get; set; } + + public byte VppUnits { get; } + + public ReadingUnit MeterUnits { get; set; } + + public byte FlowUnits { get; set; } + + public FlowRate FlowRate { get; set; } + + /// + /// +/- 12% + /// + public sbyte FactoryCorrection { get; set; } + + /// + /// +/- 8% + /// + public byte FieldCorrection { get; } + + public byte PulseWeight { get; set; } + + public byte PulseReserved { get; } + + public byte PulseWidthUpdateRate { get; set; } + + public static implicit operator byte[] (RegisterSettings registerSettings) + { + // TODO: Build the message + return new byte[0]; + } + + public static implicit operator RegisterSettings(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new RegisterSettings(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/StatusResponse.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/StatusResponse.cs new file mode 100644 index 00000000..c6f6f07f --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/StatusResponse.cs @@ -0,0 +1,26 @@ +using OmniPlusUI.Models.Enums; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class StatusResponse : Message + { + public StatusResponse(CommandStatus status) : base(status) + { + } + + public static implicit operator bool(StatusResponse response) + => response?.Status == CommandStatus.Completed; + + public static implicit operator StatusResponse(byte[] bytes) + { + var status = default(CommandStatus); + + if (bytes?.Length >= 1) + { + status = (CommandStatus)bytes[0]; + } + + return new StatusResponse(status); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemParameters.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemParameters.cs new file mode 100644 index 00000000..1b6bc9a7 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemParameters.cs @@ -0,0 +1,49 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + public class SystemParameters : Message + { + private const byte LENGTH = 59; + + private SystemParameters(CommandStatus status, byte[] data) : base(status) + { + if (data?.Length >= LENGTH) + { + this.BuildInfo = data.Subarray(0, 15); + this.ManifacturingTime = data.Subarray(16, 19); + this.SystemTime = data.Subarray(20, 23); + this.RebootCount = data[24]; + this.VersionAndType = data.Subarray(25, 51); + this.BatteryVoltage = data.Subarray(52, 57); + this.FactorySealed = data[58] == 1; + } + } + + public ASCIIString BuildInfo { get; } + + public Epoch20000101 ManifacturingTime { get; } + + public Epoch20000101 SystemTime { get; } + + public byte RebootCount { get; } + + public ASCIIString VersionAndType { get; } + + public BatteryVoltage BatteryVoltage { get; } + + public double Volts => this.BatteryVoltage?.Volts ?? default(double); + + public uint ADCCount => this.BatteryVoltage?.ADCCount ?? default(uint); + + public bool FactorySealed { get; } + + public static implicit operator SystemParameters(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new SystemParameters(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemTime.cs b/Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemTime.cs new file mode 100644 index 00000000..5389509a --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Messages/SystemTime.cs @@ -0,0 +1,56 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Messages +{ + /// + /// Once the command response has been received, + /// the Factory Configuration needs to delay 5 seconds to allow the Register + /// to complete initialization and to perform a power on reset. + /// + public class SystemTime : Message + { + public const byte GET = 0x10; + public const byte LENGTH = 4; + public const int MAX_DRIFT = 700; + + private readonly Epoch20000101 value; + + public SystemTime() : base(CommandStatus.Request) + { + } + + private SystemTime(CommandStatus status, byte[] data) + : base(status) + => this.value = data; + + public DateTime DateTime => value.DateTime; + + public static implicit operator byte[](SystemTime systemTime) + { + var index = 0; + var bytes = new byte[LENGTH + 2]; + bytes[index++] = Constants.DeviceSpecific; + bytes[index++] = Constants.SetSystemTime; + + + if (systemTime != null) + { + BitConverter + .GetBytes(systemTime.value) + .CopyTo(bytes, index); + } + + return bytes; + } + + public static implicit operator SystemTime(byte[] bytes) + { + ParseBytes(bytes, LENGTH, out var status, out var data); + + return new SystemTime(status, data); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/UI1236Connection.cs b/Common/OmniPlusUI/Models/LogicalConnections/UI1236Connection.cs new file mode 100644 index 00000000..4afc35f5 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/UI1236Connection.cs @@ -0,0 +1,22 @@ +using OmniPlusUI.Models.PhysicalConnection; + +namespace OmniPlusUI.Models.LogicalConnections +{ + public class UI1236Connection : SerialPortConnection + { + public UI1236Connection(string portName) + { + throw new System.NotImplementedException(); + } + + public byte[] Write(byte[] command, int timeout, int delay) + { + throw new System.NotImplementedException(); + } + + protected override void SerialPortConnection_DataReceived(byte[] bytes) + { + throw new System.NotImplementedException(); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/UniProConnection.cs b/Common/OmniPlusUI/Models/LogicalConnections/UniProConnection.cs new file mode 100644 index 00000000..e5f5a7a9 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/UniProConnection.cs @@ -0,0 +1,22 @@ +using OmniPlusUI.Models.PhysicalConnection; + +namespace OmniPlusUI.Models.LogicalConnections +{ + public class UniProConnection : SerialPortConnection + { + public UniProConnection(string portName) + { + throw new System.NotImplementedException(); + } + + public byte[] WriteBytes(byte[] command) + { + throw new System.NotImplementedException(); + } + + protected override void SerialPortConnection_DataReceived(byte[] bytes) + { + throw new System.NotImplementedException(); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/ASCIIString.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/ASCIIString.cs new file mode 100644 index 00000000..ad04522b --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/ASCIIString.cs @@ -0,0 +1,29 @@ +using System; +using System.Linq; +using System.Text; + +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public struct ASCIIString + { + private ASCIIString(string value) + => this.Value = value.Trim(); + + public string Value { get; } + + public override string ToString() + => this.Value?.Trim(); + + public static implicit operator ASCIIString(string value) + => new ASCIIString(value ?? string.Empty); + + public static implicit operator ASCIIString(byte[] bytes) + => Encoding.ASCII.GetString(bytes?.Where(x => x != 0)?.ToArray() ?? new byte[0]); + + public static implicit operator string(ASCIIString asciiString) + => asciiString.ToString(); + + public static implicit operator byte[](ASCIIString asciiString) + => Encoding.ASCII.GetBytes(asciiString); + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/CalibrationResult.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/CalibrationResult.cs new file mode 100644 index 00000000..089f7ef8 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/CalibrationResult.cs @@ -0,0 +1,20 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public struct CalibrationResult + { + private readonly byte result; + + private CalibrationResult(byte result) + => this.result = result; + + public static CalibrationResult ActivationSuccessful = 0x00; + public static CalibrationResult FailedOrTimeout = 0x01; + public static CalibrationResult SuccessfullyCompleted = 0x02; + + public static implicit operator CalibrationResult(byte result) + => new CalibrationResult(result); + + public static implicit operator byte(CalibrationResult result) + => result.result; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/Constants.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/Constants.cs new file mode 100644 index 00000000..73dc0814 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/Constants.cs @@ -0,0 +1,25 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class Constants + { + public const byte ClearMetrologyAlarms = 0x22; + public const byte DeviceSpecific = 0xFD; + public const byte FactoryCalibration = 0x67; + + public const byte ViewConfigurationParameters = 0xC7; + public const byte ViewFactorySeal = 0x63; + public const byte ViewInputVolumeValue = 0x02; + public const byte ViewRegisterSettings = 0x24; + public const byte ViewMetrologyAlarms = 0x21; + public const byte ViewSystemParameters = 0xC6; + + public const byte SetFactorySeal = 0x64; + public const byte SetInputVolumeValue = 0x03; + public const byte SetSystemTime = 0x11; + public const byte SetReadingUnits = 0x0C; + public const byte SetRegisterSettings = 0x25; + + public const int LSB = 0; + public const int MSB = 1; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/Control.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/Control.cs new file mode 100644 index 00000000..084d332f --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/Control.cs @@ -0,0 +1,66 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class Control + { + private readonly byte[] bits; + + private Control(byte[] bits) + => this.bits = bits; + + public bool E0Encryption => this.bits[0] == 1; + + public bool E1Encryption => this.bits[1] == 1; + + public bool E2Encryption => this.bits[2] == 1; + + public bool ReturnResponse + { + get => this.bits[3] == 1; + set => this.bits[3] = (byte)(value ? 1 : 0); + } + + public bool NFNetwork => this.bits[4] == 1; + + public bool MultipleCommands + { + get => this.bits[5] == 1; + set => this.bits[5] = (byte)(value ? 1 : 0); + } + + public bool LongControl + { + get => this.bits[6] == 1; + set => this.bits[6] = (byte)(value ? 1 : 0); + } + + public bool MultipleFrames + { + get => this.bits[7] == 1; + set => this.bits[7] = (byte)(value ? 1 : 0); + } + + public static implicit operator Control(byte controlByte) + { + var bits = new byte[8]; + + for (int i = 0; i < 8; i++) + { + bits[i] = (byte)((controlByte >> i) & 1); + } + + return new Control(bits); + } + + public static implicit operator byte (Control control) + { + var @byte = default(byte); + + for (int i = 0; i < 8; i++) + { + @byte ^= (byte)(control.bits[i] << i); + } + + return @byte; + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/Epoch20000101.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/Epoch20000101.cs new file mode 100644 index 00000000..ee4598b7 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/Epoch20000101.cs @@ -0,0 +1,41 @@ +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public struct Epoch20000101 + { + private static readonly DateTime epoch = new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc); + + private readonly uint seconds; + + private Epoch20000101(uint seconds) : this() + => this.seconds = seconds; + + public DateTime DateTime => epoch.AddSeconds(seconds); + + public override string ToString() + => this.DateTime.ToString("yyyy-MM-dd HH:mm:ss"); + + public static implicit operator uint(Epoch20000101 epoch) + => epoch.seconds; + + public static implicit operator Epoch20000101(byte[] bytes) + { + var seconds = default(uint); + + if (bytes?.Length == 4) + { + seconds = BitConverter.ToUInt32(bytes, 0); + } + + return new Epoch20000101(seconds); + } + + public static implicit operator Epoch20000101(DateTime dateTime) + { + var seconds = (ushort)Math.Abs(dateTime.Subtract(epoch).Seconds); + + return new Epoch20000101(seconds); + } + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/Float32.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/Float32.cs new file mode 100644 index 00000000..3e96c8f8 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/Float32.cs @@ -0,0 +1,30 @@ +using System; + +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public struct Float32 + { + private readonly float value; + + private Float32(float value) + => this.value = value; + + public static implicit operator Float32(float value) + => new Float32(value); + + public static implicit operator Float32(byte[] bytes) + => new Float32(BitConverter.ToSingle(bytes, 0)); + + public static implicit operator Float32(int number) + => new Float32(BitConverter.ToSingle(BitConverter.GetBytes(number), 0)); + + public static implicit operator float(Float32 float32) + => float32.value; + + public static implicit operator byte[] (Float32 float32) + => BitConverter.GetBytes(float32.value); + + public static implicit operator int(Float32 float32) + => BitConverter.ToInt32(float32, 0); + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/FlowRate.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/FlowRate.cs new file mode 100644 index 00000000..db868248 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/FlowRate.cs @@ -0,0 +1,34 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class FlowRate + { + private Units value; + + private FlowRate(byte value) + => this.value = (Units)value; + + private FlowRate(Units value) + => this.value = value; + + public enum Units : byte + { + PerMinute = 2, + PerHour = 3 + } + + public static FlowRate PerMinute = Units.PerMinute; + public static FlowRate PerHour = Units.PerHour; + + public static implicit operator FlowRate(byte value) + => new FlowRate(value); + + public static implicit operator FlowRate(Units value) + => new FlowRate(value); + + public static implicit operator Units(FlowRate meterSize) + => meterSize.value; + + public static implicit operator byte(FlowRate meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/FlowUnit.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/FlowUnit.cs new file mode 100644 index 00000000..d7b711c5 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/FlowUnit.cs @@ -0,0 +1,38 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class FlowUnit + { + private Units value; + + private FlowUnit(byte value) + => this.value = (Units)value; + + private FlowUnit(Units value) + => this.value = value; + + public enum Units : byte + { + CubicMeter = 0, + CubicFeet = 1, + USGallon = 4, + IGallon = 5 + } + + public static FlowUnit CubicMeter = Units.CubicMeter; + public static FlowUnit CubicFeet = Units.CubicFeet; + public static FlowUnit USGallon = Units.USGallon; + public static FlowUnit IGallon = Units.IGallon; + + public static implicit operator FlowUnit(byte value) + => new FlowUnit(value); + + public static implicit operator FlowUnit(Units value) + => new FlowUnit(value); + + public static implicit operator Units(FlowUnit meterSize) + => meterSize.value; + + public static implicit operator byte(FlowUnit meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/MeterRange.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/MeterRange.cs new file mode 100644 index 00000000..01889d79 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/MeterRange.cs @@ -0,0 +1,40 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class MeterRange + { + private Ranges value; + + private MeterRange(byte value) + => this.value = (Ranges)value; + + private MeterRange(Ranges value) + => this.value = value; + + public enum Ranges : byte + { + OneTow = 0, + ThreeFour = 1, + Six = 2, + Eight = 3, + Ten = 4 + } + + public static MeterRange OneHalfTow = Ranges.OneTow; + public static MeterRange ThreeFour = Ranges.ThreeFour; + public static MeterRange Six = Ranges.Six; + public static MeterRange Eight = Ranges.Eight; + public static MeterRange Ten = Ranges.Ten; + + public static implicit operator MeterRange(byte value) + => new MeterRange(value); + + public static implicit operator MeterRange(Ranges value) + => new MeterRange(value); + + public static implicit operator Ranges(MeterRange MeterRange) + => MeterRange.value; + + public static implicit operator byte(MeterRange MeterRange) + => (byte)MeterRange.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/MeterSize.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/MeterSize.cs new file mode 100644 index 00000000..839882cb --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/MeterSize.cs @@ -0,0 +1,46 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class MeterSize + { + private Sizes value; + + private MeterSize(byte value) + => this.value = (Sizes)value; + + private MeterSize(Sizes value) + => this.value = value; + + public enum Sizes : byte + { + Unknown = 0, + OneHalf = 5, + Two = 6, + Three = 7, + Four = 8, + Six = 9, + Eight = 10, + Ten = 11 + } + + public static MeterSize Unknown = Sizes.Unknown; + public static MeterSize OneHalf = Sizes.OneHalf; + public static MeterSize Two = Sizes.Two; + public static MeterSize Three = Sizes.Three; + public static MeterSize Four = Sizes.Four; + public static MeterSize Six = Sizes.Six; + public static MeterSize Eight = Sizes.Eight; + public static MeterSize Ten = Sizes.Ten; + + public static implicit operator MeterSize(byte value) + => new MeterSize(value); + + public static implicit operator MeterSize(Sizes value) + => new MeterSize(value); + + public static implicit operator Sizes(MeterSize meterSize) + => meterSize.value; + + public static implicit operator byte(MeterSize meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseUpdate.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseUpdate.cs new file mode 100644 index 00000000..f0aa2c0c --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseUpdate.cs @@ -0,0 +1,46 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class PulseUpdate + { + private Units value; + + private PulseUpdate(byte value) + => this.value = (Units)value; + + private PulseUpdate(Units value) + => this.value = value; + + public enum Units : byte + { + After1s = 0, + After2s = 1, + After5s = 2, + After10s = 3, + After30s = 4, + After60s = 5, + Reserved1 = 6, + Reserved2 = 7, + } + + public static PulseUpdate After1s = Units.After1s; + public static PulseUpdate After2s = Units.After2s; + public static PulseUpdate After5s = Units.After5s; + public static PulseUpdate After10s = Units.After10s; + public static PulseUpdate After30s = Units.After30s; + public static PulseUpdate After60s = Units.After60s; + public static PulseUpdate Reserved1 = Units.Reserved1; + public static PulseUpdate Reserved2 = Units.Reserved2; + + public static implicit operator PulseUpdate(byte value) + => new PulseUpdate(value); + + public static implicit operator PulseUpdate(Units value) + => new PulseUpdate(value); + + public static implicit operator Units(PulseUpdate meterSize) + => meterSize.value; + + public static implicit operator byte(PulseUpdate meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWeight.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWeight.cs new file mode 100644 index 00000000..f6e914ee --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWeight.cs @@ -0,0 +1,50 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class PulseWeight + { + private Units value; + + private PulseWeight(byte value) + => this.value = (Units)value; + + private PulseWeight(Units value) + => this.value = value; + + public enum Units : byte + { + O = 0, + I = 1, + I0 = 2, + I00 = 3, + I000 = 4, + I0000 = 5, + I00000 = 6, + I000000 = 7, + I0000000 = 8, + I00000000 = 9, + } + + public static PulseWeight Disable = Units.O; + public static PulseWeight IPerU = Units.I; + public static PulseWeight I0PerU = Units.I0; + public static PulseWeight I00PerU = Units.I00; + public static PulseWeight I000PerU = Units.I000; + public static PulseWeight I0000PerU = Units.I0000; + public static PulseWeight I00000PerU = Units.I00000; + public static PulseWeight I000000PerU = Units.I000000; + public static PulseWeight I0000000PerU = Units.I0000000; + public static PulseWeight I00000000PerU = Units.I00000000; + + public static implicit operator PulseWeight(byte value) + => new PulseWeight(value); + + public static implicit operator PulseWeight(Units value) + => new PulseWeight(value); + + public static implicit operator Units(PulseWeight meterSize) + => meterSize.value; + + public static implicit operator byte(PulseWeight meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWidth.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWidth.cs new file mode 100644 index 00000000..1cba0e61 --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/PulseWidth.cs @@ -0,0 +1,44 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class PulseWidth + { + private Units value; + + private PulseWidth(byte value) + => this.value = (Units)value; + + private PulseWidth(Units value) + => this.value = value; + + public enum Units : byte + { + Ms5 = 0, + Ms10 = 1, + Ms20 = 2, + Ms50 = 3, + Ms100 = 4, + Ms500 = 5, + Dynamic = 7, + } + + public static PulseWidth Ms5 = Units.Ms5; + public static PulseWidth Ms10 = Units.Ms10; + public static PulseWidth Ms20 = Units.Ms20; + public static PulseWidth Ms50 = Units.Ms50; + public static PulseWidth Ms100 = Units.Ms100; + public static PulseWidth Ms500 = Units.Ms500; + public static PulseWidth Dynamic = Units.Dynamic; + + public static implicit operator PulseWidth(byte value) + => new PulseWidth(value); + + public static implicit operator PulseWidth(Units value) + => new PulseWidth(value); + + public static implicit operator Units(PulseWidth meterSize) + => meterSize.value; + + public static implicit operator byte(PulseWidth meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/LogicalConnections/Values/ReadingUnit.cs b/Common/OmniPlusUI/Models/LogicalConnections/Values/ReadingUnit.cs new file mode 100644 index 00000000..3515e11a --- /dev/null +++ b/Common/OmniPlusUI/Models/LogicalConnections/Values/ReadingUnit.cs @@ -0,0 +1,42 @@ +namespace OmniPlusUI.Models.LogicalConnections.Values +{ + public class ReadingUnit + { + private Units value; + + private ReadingUnit(byte value) + => this.value = (Units)value; + + private ReadingUnit(Units value) + => this.value = value; + + public enum Units : byte + { + CubicMeter = 0x00, + CubicFeet = 0x01, + USGallon = 0x04, + IGallon = 0x05, + AcreFeet = 0x06, + Reset = 0xFF + } + + public static ReadingUnit CubicMeter = Units.CubicMeter; + public static ReadingUnit CubicFeet = Units.CubicFeet; + public static ReadingUnit USGallon = Units.USGallon; + public static ReadingUnit IGallon = Units.IGallon; + public static ReadingUnit AcreFeet = Units.AcreFeet; + public static ReadingUnit Reset = Units.Reset; + + public static implicit operator ReadingUnit(byte value) + => new ReadingUnit(value); + + public static implicit operator ReadingUnit(Units value) + => new ReadingUnit(value); + + public static implicit operator Units(ReadingUnit meterSize) + => meterSize.value; + + public static implicit operator byte(ReadingUnit meterSize) + => (byte)meterSize.value; + } +} diff --git a/Common/OmniPlusUI/Models/OmniAuftrag.cs b/Common/OmniPlusUI/Models/OmniAuftrag.cs new file mode 100644 index 00000000..1331121e --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniAuftrag.cs @@ -0,0 +1,37 @@ +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models +{ + public class OmniAuftrag + { + public int AuftragNr { get; set; } + + public short PosNr { get; set; } + + public int OmniId { get; set; } + + public string MeterType { get; set; } + + public MeterSize MeterSize { get; set; } + + public MeterRange MeterRange { get; set; } + + public int IntPart { get; set; } + + public int Fraction { get; set; } + + public int Correction { get; set; } + + public double MinFlowGal { get; set; } + + public int MinRotations { get; set; } + + public int MinDurationSec { get; set; } + + public double MaxFlowGal { get; set; } + + public int MaxRotations { get; set; } + + public int MaxDurationSec { get; set; } + } +} \ No newline at end of file diff --git a/Common/OmniPlusUI/Models/OmniConnection.cs b/Common/OmniPlusUI/Models/OmniConnection.cs new file mode 100644 index 00000000..fb83c78d --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniConnection.cs @@ -0,0 +1,80 @@ +using OmniPlusUI.Models.LogicalConnections; +using OmniPlusUI.Models.LogicalConnections.Messages; +using OmniPlusUI.Models.LogicalConnections.Values; + +namespace OmniPlusUI.Models +{ + public delegate byte[] MessageHandler(params byte[] bytes); + + public class OmniConnection + { + private readonly IrdaConnection irdaConnection; + + private MessageHandler MessageHandler; + + public OmniConnection(string portName) + { + this.irdaConnection = new IrdaConnection(portName); + this.MessageHandler = this.irdaConnection.WriteBytes; + + //var unipro = new UniProConnection(portName); + //this.MessageHandler = unipro.WriteBytes; + } + + public bool Connect() + { + this.irdaConnection?.Open(); + + return this.irdaConnection?.Connected == true; + } + + public void Dispose() + => this.irdaConnection?.Close(); + + public StatusResponse MemorySettingsByckToDefault() + => this.MessageHandler?.Invoke(new SystemTime()); + + public FactoryCalibrationParameters StartFactoryCalibration(FactoryCalibrationParameters calibrationParameters) + => this.MessageHandler?.Invoke(calibrationParameters); + + public FactoryCalibrationResult CheckFactoryCalibration(FactoryCalibrationRequest calibrationRequest) + => this.MessageHandler?.Invoke(calibrationRequest); + + public ConfigurationParameters ViewConfigurationParameters() + // 0x00 – Returns all of the elements of the response up to the Device ID String. + // Same as the response with no parameters specified. + // 0x01 – Returns all of the elements of the response including the Device ID String. + => this.MessageHandler?.Invoke(Constants.DeviceSpecific, Constants.ViewConfigurationParameters, 0x01); + + public SystemParameters ViewSystemParameters() + => this.MessageHandler?.Invoke(Constants.DeviceSpecific, Constants.ViewSystemParameters); + + public RegisterSettings ViewRegisterSettings() + => this.MessageHandler?.Invoke(Constants.DeviceSpecific, Constants.ViewRegisterSettings); + + public StatusResponse SetInputVolume(InputVolume inputVolume) + => this.MessageHandler?.Invoke(inputVolume); + + public StatusResponse SetRegisterSettings(RegisterSettings registerSettings) + => this.MessageHandler?.Invoke(registerSettings); + + public StatusResponse SetConfigurationParameters(ConfigurationParameters configurationParameters) + => this.MessageHandler?.Invoke(configurationParameters); + + public StatusResponse RemoveReadingUnitAndResolution() + // 0xFF in the reading units byte does not change the reading units. + // 0xFF disables reporting of multiplier and units in the reading and flowrate uni-directional fields. + // Setting reading units to one of the actual supported values, enables reporting of multiplier and units in the reading and flowrate uni-directional fields. + // Reading Resolution is based on Meter Range and Units of Measure.Omni+ does not support a separate command to set reading resolution. + => this.MessageHandler?.Invoke(Constants.SetReadingUnits, byte.MaxValue); + + public StatusResponse ClearMetrologyAlarms() + => this.MessageHandler?.Invoke(Constants.ClearMetrologyAlarms, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); + + public StatusResponse FactorySeal(SetFactorySeal factorySeal) + => this.MessageHandler?.Invoke(factorySeal); + + internal ViewFactorySeal ViewFactorySeal() + => this.MessageHandler?.Invoke(default(ViewFactorySeal)); + } +} diff --git a/Common/OmniPlusUI/Models/OmniConstants.cs b/Common/OmniPlusUI/Models/OmniConstants.cs new file mode 100644 index 00000000..4b6844eb --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniConstants.cs @@ -0,0 +1,13 @@ +namespace OmniPlusUI.Models +{ + public class OmniConstants + { + public const string BUILD_INFO = "Build Info"; + public const string COMS_KEY = "COMS"; + public const string EINBAUPLATZ = "Einbauplatz"; + public const string FIRMWARE = "Firmware"; + public const string METER_TYPE = "Zählertyp"; + public const string OMNIDB_KEY = "OMNIDB"; + public const string VOLTAGE = "Spannung (V)"; + } +} diff --git a/Common/OmniPlusUI/Models/OmniDatabase.cs b/Common/OmniPlusUI/Models/OmniDatabase.cs new file mode 100644 index 00000000..8afb1929 --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniDatabase.cs @@ -0,0 +1,220 @@ +using OmniPlusUI.Models.LogicalConnections.Messages; + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data.SqlClient; + +namespace OmniPlusUI.Models +{ + public class OmniDatabase + { + private readonly string connectionString; + + public OmniDatabase() + => this.connectionString = ConfigurationManager.AppSettings.Get(OmniConstants.OMNIDB_KEY); + + public InputVolume GetInputVolume(int meterSize) + { + var inputVolume = new InputVolume(); + + using (var sqlConnection = new SqlConnection(this.connectionString)) + { + sqlConnection.FireInfoMessageEventOnUserErrors = true; + sqlConnection.InfoMessage += (sender, args) + => System.Console.WriteLine(args.Message); + sqlConnection.Open(); + + using (var sqlCommand = sqlConnection.CreateCommand()) + { + sqlCommand.CommandText = $@" + SELECT [OmniSettings].[IntPart] + , [OmniSettings].[Direction] + , [OmniSettings].[FractionLSB] + , [OmniSettings].[FractionMSB] + , [Omni].[Size] + , [Omni].[Range] + FROM [OmniSettings] + JOIN [Omni] + ON [Omni].[Id] = [OmniSettings].[OmniId] + WHERE [Omni].[Size] = @{nameof(meterSize)}"; + sqlCommand.Parameters.Add(new SqlParameter(nameof(meterSize), meterSize)); + + using (var sqlDataReader = sqlCommand.ExecuteReader()) + { + if (sqlDataReader.Read()) + { + var index = 0; + + inputVolume.IntPart = sqlDataReader.Get(index++); + inputVolume.Direction = sqlDataReader.Get(index++); + inputVolume.FractionLSB = sqlDataReader.Get(index++); + inputVolume.FractionMSB = sqlDataReader.Get(index++); + inputVolume.MeterSize = sqlDataReader.Get(index++); + inputVolume.MeterRange = sqlDataReader.Get(index++); + } + } + } + } + + return inputVolume; + } + + public OmniAuftrag GetOmniAuftrag(Int32 auftragNr, Int16 posNr) + { + var auftrag = new OmniAuftrag(); + var omniId = default(int); + var index = default(int); + + using (var sqlConnection = new SqlConnection(this.connectionString)) + { + sqlConnection.FireInfoMessageEventOnUserErrors = true; + sqlConnection.InfoMessage += (sender, args) + => Console.WriteLine(args.Message); + sqlConnection.Open(); + + using (var sqlCommand = sqlConnection.CreateCommand()) + { + // TODO: Load auftrag by number and position + sqlCommand.CommandText = $@" + SELECT [Omni].[Id] + , [Omni].[Type] + , [Omni].[Size] + , [Omni].[Range] + , [OmniSettings].[IntPart] + , [OmniSettings].[Fraction] + , [OmniSettings].[CorrectionFactor] + FROM [Omni] + JOIN [OmniSettings] ON [OmniSettings].[OmniId] = [Omni].[Id] + WHERE [Omni].[Id] = 1"; + + using (var sqlDataReader = sqlCommand.ExecuteReader()) + { + if (sqlDataReader.Read()) + { + index = 0; + omniId = sqlDataReader.Get(index++); + + auftrag.AuftragNr = auftragNr; + auftrag.PosNr = posNr; + auftrag.OmniId = omniId; + auftrag.MeterType = sqlDataReader.Get(index++); + auftrag.MeterSize = sqlDataReader.Get(index++); + auftrag.MeterRange = sqlDataReader.Get(index++); + auftrag.IntPart = sqlDataReader.Get(index++); + auftrag.Fraction = sqlDataReader.Get(index++); + auftrag.Correction = sqlDataReader.Get(index++); + } + } + } + + using (var sqlCommand = sqlConnection.CreateCommand()) + { + sqlCommand.CommandText = $@" + SELECT * FROM (SELECT TOP 1 + [MinSettings].[GalPerMin] + , [MinSettings].[Rotations] + , [MinSettings].[Duration] + FROM [OmniTestSettings] AS [MinSettings] + WHERE [MinSettings].[OmniId] = @{nameof(omniId)} + ORDER BY [MinSettings].[GalPerMin] ASC) + AS [Min] + UNION + SELECT * FROM (SELECT TOP 1 + [MaxSettings].[GalPerMin] + , [MaxSettings].[Rotations] + , [MaxSettings].[Duration] + FROM [OmniTestSettings] AS [MaxSettings] + WHERE [MaxSettings].[OmniId] = @{nameof(omniId)} + ORDER BY [MaxSettings].[GalPerMin] DESC) + AS [Max]"; + sqlCommand.Parameters.Add(new SqlParameter(nameof(omniId), omniId)); + + using (var sqlDataReader = sqlCommand.ExecuteReader()) + { + if (sqlDataReader.Read()) + { + index = 0; + + auftrag.MinFlowGal = sqlDataReader.Get(index++); + auftrag.MinRotations = sqlDataReader.Get(index++); + auftrag.MinDurationSec = sqlDataReader.Get(index++); + } + + if (sqlDataReader.Read()) + { + index = 0; + + auftrag.MaxFlowGal = sqlDataReader.Get(index++); + auftrag.MaxRotations = sqlDataReader.Get(index++); + auftrag.MaxDurationSec = sqlDataReader.Get(index++); + } + } + } + } + + return auftrag; + } + + public IEnumerable GetFactoryCalibrationParameters(byte meterSize) + { + var calibrationParameters = new List(); + + using (var sqlConnection = new SqlConnection(this.connectionString)) + { + sqlConnection.FireInfoMessageEventOnUserErrors = true; + sqlConnection.InfoMessage += (sender, args) + => System.Console.WriteLine(args.Message); + sqlConnection.Open(); + + using (var sqlCommand = sqlConnection.CreateCommand()) + { + sqlCommand.CommandText = $@" + SELECT [OmniTestSettings].[Rotations] + , [OmniTestSettings].[Duration] + , [OmniTestSettings].[GalPerMin] + FROM [OmniTestSettings] + JOIN [Omni] + ON [Omni].[Id] = [OmniTestSettings].[OmniId] + WHERE [Omni].[Size] = @{nameof(meterSize)}"; + sqlCommand.Parameters.Add(new SqlParameter(nameof(meterSize), meterSize)); + + using (var sqlDataReader = sqlCommand.ExecuteReader()) + { + while (sqlDataReader.Read()) + { + var index = 0; + + calibrationParameters.Add(new FactoryCalibrationParameters + { + Rotations = (ushort)sqlDataReader.Get(index++), + Duration = (ushort)sqlDataReader.Get(index++), + Volume = sqlDataReader.Get(index++), + }); + } + } + } + } + + return calibrationParameters; + } + } + + public static class DBConnectionExtensions + { + public static T Get(this SqlDataReader reader, int index) + { + if (reader is null || reader.IsDBNull(index)) + { + return default(T); + } + + if (reader.GetValue(index) is T value) + { + return value; + } + + return default(T); + } + } +} diff --git a/Common/OmniPlusUI/Models/OmniDatabase.sql b/Common/OmniPlusUI/Models/OmniDatabase.sql new file mode 100644 index 00000000..9cc0dd47 --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniDatabase.sql @@ -0,0 +1,146 @@ +USE [AuftragKopie] + +DROP TABLE [OmniTestSettings]; +DROP TABLE [OmniSettings]; +DROP TABLE [Omni]; + +CREATE TABLE [Omni] ( + [Id] TINYINT NOT NULL IDENTITY(1, 1), + [Type] VARCHAR(5) NOT NULL, + [Size] TINYINT NOT NULL, + [Range] TINYINT NOT NULL, + CONSTRAINT [PK_Omni_Id] PRIMARY KEY ([Id]) +); + +INSERT INTO [Omni] + ([Type], [Size], [Range]) +VALUES ( '1½"', 0x05, 0x00) + , ( '2"', 0x06, 0x00) + , ( '3"', 0x07, 0x01) + , ( '4"', 0x08, 0x01) + , ( '6"', 0x09, 0x02) + , ( '8"', 0x0A, 0x03) + , ( '10"', 0x0B, 0x04); + +CREATE TABLE [OmniSettings] ( + [OmniId] TINYINT NOT NULL, + [Direction] TINYINT NOT NULL, + [IntPart] TINYINT NOT NULL, + [IntHex] INT NOT NULL, + [Fraction] INT NOT NULL, + [FractionLSB] TINYINT NOT NULL, + [FractionMSB] TINYINT NOT NULL, + [CorrectionFactor] SMALLINT NOT NULL, + CONSTRAINT [PK_OmniSettings_OmniId] PRIMARY KEY ([OmniId]), + CONSTRAINT [FK_OmniSettings_OmniId_Omni_Id] FOREIGN KEY ([OmniId]) REFERENCES [Omni]([Id]) +); + +INSERT INTO [OmniSettings] + ([OmniId], [Direction], [IntPart], [IntHex], [Fraction], [FractionLSB], [FractionMSB], [CorrectionFactor]) +VALUES ( 1, 0x00, 0x00, 0x0000, 34017, 0xE1, 0x84, 100) + , ( 2, 0x00, 0x00, 0x0000, 34017, 0xE1, 0x84, 100) + , ( 3, 0x00, 0x01, 0x0001, 50827, 0x8B, 0xC6, 100) + , ( 4, 0x00, 0x01, 0x0001, 50827, 0x8B, 0xC6, 100) + , ( 5, 0x00, 0x06, 0x0006, 16754, 0x72, 0x41, 100) + , ( 6, 0x80, 0x01, 0x8001, 36814, 0xCE, 0x8F, 1000) + , ( 7, 0x80, 0x02, 0x8002, 21667, 0xA3, 0x54, 1000); + +CREATE TABLE [OmniTestSettings] ( + [Id] SMALLINT NOT NULL IDENTITY(1, 1), + [OmniId] TINYINT NOT NULL, + [GalPerMin] FLOAT NOT NULL, + [Rotations] SMALLINT NOT NULL, + [Duration] SMALLINT NOT NULL, + CONSTRAINT [PK_OmniTestSettings_Id] PRIMARY KEY ([Id]), + CONSTRAINT [FK_OmniTestSettings_OmniId_Omni_Id] FOREIGN KEY ([OmniId]) REFERENCES [Omni]([Id]), + CONSTRAINT [CHK_OmniTestSettings_Rotations] CHECK ([Rotations] BETWEEN 1 AND 5000), + CONSTRAINT [CHK_OmniTestSettings_Duration] CHECK ([Duration] BETWEEN 1 AND 3600) +); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 1, 200.00, 900, 36) + , ( 1, 160.00, 700, 35) + , ( 1, 150.00, 600, 32) + , ( 1, 2.50, 10, 32) + , ( 1, 2.00, 8, 32) + , ( 1, 1.50, 6, 32) + , ( 1, 1.25, 6, 38) + , ( 1, 1.00, 4, 32) + , ( 1, 0.75, 4, 43) + , ( 1, 0.25, 4, 127); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 2, 200.00, 1000, 40) + , ( 2, 160.00, 800, 40) + , ( 2, 2.50, 10, 32) + , ( 2, 1.50, 8, 43) + , ( 2, 0.25, 4, 127); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 3, 500.00, 700, 38) + , ( 3, 400.00, 580, 40) + , ( 3, 350.00, 450, 35) + , ( 3, 20.00, 30, 41) + , ( 3, 10.00, 16, 44) + , ( 3, 2.50, 4, 44) + , ( 3, 2.00, 4, 55) + , ( 3, 1.50, 4, 73) + , ( 3, 0.50, 4, 217); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 4, 1000.00, 1200, 33) + , ( 4, 800.00, 1100, 38) + , ( 4, 30.00, 40, 37) + , ( 4, 3.00, 4, 37) + , ( 4, 2.00, 4, 55) + , ( 4, 1.50, 4, 73) + , ( 4, 0.75, 4, 145); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 5, 2000.00, 800, 39) + , ( 5, 1600.00, 660, 40) + , ( 5, 50.00, 20, 39) + , ( 5, 5.00, 4, 77) + , ( 5, 4.00, 4, 96) + , ( 5, 3.00, 4, 127) + , ( 5, 2.50, 4, 153) + , ( 5, 1.50, 4, 254); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 6, 3500.00, 500, 34) + , ( 6, 2700.00, 400, 36) + , ( 6, 7.00, 4, 136) + , ( 6, 5.00, 4, 191) + , ( 6, 4.00, 4, 238) + , ( 6, 3.00, 4, 317) + , ( 6, 2.50, 4, 381); + +INSERT INTO [OmniTestSettings] + ([OmniId], [GalPerMin], [Rotations], [Duration]) +VALUES ( 7, 5500.00, 550, 36) + , ( 7, 4000.00, 400, 36) + , ( 7, 2500.00, 260, 37) + , ( 7, 14.00, 4, 102) + , ( 7, 5.00, 4, 284) + , ( 7, 3.50, 4, 406); + +SELECT * FROM [Omni]; +SELECT * FROM [OmniSettings]; +SELECT * FROM [OmniTestSettings]; + + + + + + + + + + + diff --git a/Common/OmniPlusUI/Models/OmniModel.cs b/Common/OmniPlusUI/Models/OmniModel.cs new file mode 100644 index 00000000..3ad8a0d9 --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniModel.cs @@ -0,0 +1,152 @@ +using OmniPlusUI.Models.Enums; +using OmniPlusUI.Models.LogicalConnections.Messages; +using OmniPlusUI.Models.LogicalConnections.Values; + +using System; +using System.Text.RegularExpressions; + +namespace OmniPlusUI.Models +{ + public class OmniModel + { + public bool Initialized { get; internal set; } + + public bool Calibrated { get; internal set; } = true; + + public bool Finished { get; internal set; } + + public SystemParameters SystemParameters { get; internal set; } + + public InputVolume InputVolume { get; internal set; } + + public ConfigurationParameters ConfigurationParameters { get; internal set; } + + public RegisterSettings RegisterSettings { get; internal set; } + + public FactoryCalibrationParameters CalibrationParametersMin { get; internal set; } + + public FactoryCalibrationResult CalibrationResultMin { get; internal set; } + + public FactoryCalibrationParameters CalibrationParametersMax { get; internal set; } + + public FactoryCalibrationResult CalibrationResultMax { get; internal set; } + + public RegisterSettings RegisterSettingsOut => new RegisterSettings + { + MilliliterPerPulse = BitConverter.ToUInt16(new byte[] + { + this.InputVolume.IntPart, + this.InputVolume.Direction, + }, 0), + FractionalPart = BitConverter.ToUInt16(new byte[] + { + this.InputVolume.FractionLSB, + this.InputVolume.FractionMSB, + }, 0), + MeterSize = this.InputVolume.MeterSize, + MeterRange = this.InputVolume.MeterRange, + MeterUnits = ReadingUnit.USGallon, + FlowUnits = 0x24, // 2(min) - time unit | 4(gal) - messurement unit + FactoryCorrection = 0x01, // TODO: Factory Correction Factor 0x01 is 0.1% if correction is 3.5% => 3.5 * 10 => 35 => 0x23 + PulseWeight = 0x01, + PulseWidthUpdateRate = 0x02 // pulse width is 2 which is 20ms and pulse update rate is 0 which is 1 second per update. + // If Pulse Rate is not specified default to 2 for 20ms. + }; + + public ConfigurationParameters ConfigurationParametersOut => new ConfigurationParameters + { + ProgrammableID = this.ConfigurationParameters.ProgrammableID, // TODO: ? serial number + FactoryID = this.ConfigurationParameters.FactoryID, // TODO: ? serial number + NumberOfReadingDigits = this.ConfigurationParameters.NumberOfReadingDigits, // TODO: ? (8) - 9 are in the documentation example. + ReadingPreset = this.ConfigurationParameters.ReadingPreset, // TODO: ? bleibt es gleih wie die eingelesene wert. + // TODO: Since we are using the UI1236 v1.23 version of the command to allow us to set up to 9 digits, + // it is necessary to start the string with 00 00 followed by up to 9 digits of Ascii data followed by a NULL terminator. + // The total length of the data has to be 12 total bytes of data. + // To set the volume to 100, we would generate a string of 00 00 31 30 30 00 00 00 00 00 00 00. + OptionalUniDirFields = this.ConfigurationParameters.OptionalUniDirFields, // TODO: ? bleibt es gleih wie die eingelesene wert. + AlarmPersistencePeriod = this.ConfigurationParameters.AlarmPersistencePeriod, // TODO: is Alarm Persistence Period for a Persistence Period of 31 days would require us to set the period to 1F which converts to . + // The Alarm Persistence Period is a one byte field but the command requires 2 bytes of data. + // The first byte is used to specify that this is a Volume Device which is 00 and the Persistence Period 1F is the second. + // So to set the Period to 31 days we would enter in 00 1F. + DataLogInterval = this.ConfigurationParameters.DataLogInterval, // TODO: ? bleibt es gleih wie die eingelesene wert. + ManifacturingTime = this.SystemParameters.ManifacturingTime, + BuildInfo = this.SystemParameters.BuildInfo + }; + + public bool ValidateSystemParameters() + { + this.Initialized = true; + + if (this.Initialized && this.SystemParameters.Status != CommandStatus.Completed) + { + // TODO: Handle failed response. + + this.Initialized = false; + } + + if (this.Initialized && this.SystemParameters.FactorySealed) + { + // TODO: Handle factory sealed. + + this.Initialized = false; + } + + if (this.Initialized && !Regex.IsMatch(this.SystemParameters.VersionAndType, @"^\s*[A-Z][0-9]+\.[0-9]+,OMNI-0[12],[A-Z][0-9]+\.[0-9]+\.[0-9]+\s*$")) + { + // TODO: Handle invalid version and type. + + this.Initialized = false; + } + + if (this.Initialized && BatteryVoltage.MIN > this.SystemParameters.Volts || this.SystemParameters.Volts > BatteryVoltage.MAX) + { + // TODO: Handle invalid battery voltage. + + this.Initialized = false; + } + + if (this.Initialized && this.SystemParameters.RebootCount == byte.MaxValue) + { + // TODO: Handle invalid battery voltage. + + this.Initialized = false; + } + + var differenceTimeSpan = DateTime.UtcNow - this.SystemParameters.SystemTime.DateTime; + var systemTimeDrift = Math.Abs(differenceTimeSpan.Seconds); + + if (this.Initialized && systemTimeDrift > SystemTime.MAX_DRIFT) + { + // TODO: Handle invalid system time drift. + + this.Initialized = false; + } + + var manifacturingDays = Math.Abs((this.SystemParameters.ManifacturingTime.DateTime - DateTime.UtcNow).TotalDays); + + if (this.Initialized && manifacturingDays > ManifacturingTime.MAX_AGE) + { + // TODO: Handle invalid system time drift. + + // this.Initialized = false; + } + + return this.Initialized; + } + + public void Calibrate() + { + // TODO: check calibration state. + this.Calibrated = this.CalibrationResultMin.Status == CommandStatus.Completed + && this.CalibrationResultMin.Result == CalibrationResult.SuccessfullyCompleted + && this.CalibrationResultMax.Status == CommandStatus.Completed + && this.CalibrationResultMax.Result == CalibrationResult.SuccessfullyCompleted; + + if (this.Calibrated) + { + // TODO: calculate calibration offset + // TODO: this.Calibrated = calibration offset +/- 12% + } + } + } +} diff --git a/Common/OmniPlusUI/Models/OmniPool.cs b/Common/OmniPlusUI/Models/OmniPool.cs new file mode 100644 index 00000000..ff84b399 --- /dev/null +++ b/Common/OmniPlusUI/Models/OmniPool.cs @@ -0,0 +1,295 @@ +using OmniPipes; +using OmniPlusUI.Models.LogicalConnections.Messages; + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Configuration; +using System.Threading.Tasks; + +using static OmniPlusUI.Models.OmniConstants; + +namespace OmniPlusUI.Models +{ + public delegate void StateChanged(int column, bool succeeded, string header, string value); + + public class OmniPool + { + // TODO: load meter size from the order data. + private const byte METER_SIZE = 0x05; + + private readonly OmniPipeClient omniPipeClient; + private readonly OmniDatabase omniDatabase; + + private OmniAuftrag auftrag; + private ConcurrentDictionary meters; + private ConcurrentDictionary connections; + + public OmniPool() + { + this.omniDatabase = new OmniDatabase(); + this.omniPipeClient = new OmniPipeClient(); + } + + public event StateChanged StateChanged; + + public void Dispose() + { + + } + + public void InitializePool(int auftragNr, short posNr) + { + // TODO: uncomment for real scenarios. + if (this.omniPipeClient?.IsConnected == false) + { + this.omniPipeClient.Connect(); + } + + if (this.connections?.Count > 0) + { + foreach (var kvp in this.connections) + { + kvp.Value?.Dispose(); + } + } + + this.auftrag = this.omniDatabase.GetOmniAuftrag(auftragNr, posNr); + this.connections = new ConcurrentDictionary(); + this.meters = new ConcurrentDictionary(); + + COMPorts portNames = ConfigurationManager.AppSettings.Get(COMS_KEY); + Random random = new Random(); + OmniConnection connection; + OmniModel omniModel; + int comIndex = 1; + + foreach (var portName in portNames) + { + connection = new OmniConnection(portName); + omniModel = default(OmniModel); + + if (/*TODO: connection.Connect()*/random.Next(0, 2) == 1) + { + omniModel = new OmniModel(); + } + else + { + connection.Dispose(); + connection = null; + } + + this.connections[comIndex] = connection; + this.meters[comIndex] = omniModel; + + this.StateChanged?.Invoke(comIndex, connection != null, EINBAUPLATZ, $"{comIndex}"); + this.StateChanged?.Invoke(comIndex, connection != null, METER_TYPE, this.auftrag.MeterType); + + comIndex++; + } + } + + public void InitializeInspection() + { + var taskFactory = Task.Factory; + var tasksCount = this.connections.Count; + var tasks = new List(); + + foreach (var key in this.connections.Keys) + { + tasks.Add(taskFactory.StartNew(() => this.InitializeInspection(key))); + } + + taskFactory.ContinueWhenAll(tasks.ToArray(), t => + { + + }); + } + + public void StartInspection() + { + var tasksCount = this.connections.Count; + var tasks = new List(); + + for (int i = 0; i < tasksCount; i++) + { + //var meter = this.GetMeter(i); + + //if (meter.Initialized) + //{ + // var connection = this.connections[i]; + + // this.StartInspection(connection, i); + + // // tasks.Add(Task.Run(() => this.StartInspection(connection, i - 1))); + //} + } + + // Task.WaitAll(tasks.ToArray()); + } + + public void FinischInspection() + { + var tasksCount = this.connections.Count; + var tasks = new List(); + + for (int i = 0; i < tasksCount; i++) + { + if (this.meters.TryGetValue(i, out var meter) && meter.Calibrated) + { + var connection = this.connections[i]; + + this.FinischInspection(connection, i); + + // tasks.Add(Task.Run(() => this.FinischInspection(connection, i - 1))); + } + } + + // Task.WaitAll(tasks.ToArray()); + } + + private void InitializeInspection(int index) + { + var connection = default(OmniConnection); + var meter = default(OmniModel); + var succeeded = false; + + if (this.connections.TryGetValue(index, out connection) && this.meters.TryGetValue(index, out meter)) + { + succeeded = connection != null && meter != null; + + if (succeeded) + { + ////TODO: Uncomment when omni register/s connected. + //meter.SystemParameters = connection.ViewSystemParameters(); + + //if (meter.ValidateSystemParameters()) + //{ + // meter.InputVolume = this.omniDatabase.GetInputVolume(METER_SIZE); + // meter.Initialized = connection.SetInputVolume(meter.InputVolume); + + // succeeded = true; + // // TODO: Save system parameters for later usage. + //} + } + } + + this.StateChanged?.Invoke(index, succeeded, BUILD_INFO, meter?.SystemParameters?.BuildInfo ?? BUILD_INFO); + this.StateChanged?.Invoke(index, succeeded, FIRMWARE, meter?.SystemParameters?.VersionAndType ?? FIRMWARE); + this.StateChanged?.Invoke(index, succeeded, VOLTAGE, $"{meter?.SystemParameters?.Volts ?? 0:0.00}"); + } + + private void StartInspection(OmniConnection connection, int index) + { + var calibrated = true; + var calibrationParameters = this.omniDatabase + .GetFactoryCalibrationParameters(METER_SIZE); + var calibrationRequest = new FactoryCalibrationRequest(); + //var meter = this.GetMeter(index); + + //meter.CalibrationParametersMin = connection.StartFactoryCalibration(calibrationParameters.Min(x => x)); + + //if (calibrated && meter.CalibrationParametersMin.Status == CommandStatus.Completed && meter.CalibrationParametersMin.Action == default(byte)) + //{ + // //TODO: Start reference meter messurements. + + // Thread.Sleep((meter.CalibrationParametersMin.Duration + 3) * 1120); + + // //TODO: Stop reference meter messurements. + // //TODO: Get reference meter messurements. + + // meter.CalibrationResultMin = connection.CheckFactoryCalibration(calibrationRequest); + //} + + //meter.CalibrationParametersMax = connection.StartFactoryCalibration(calibrationParameters.Max(x => x)); + + //if (calibrated && meter.CalibrationParametersMax.Status == CommandStatus.Completed && meter.CalibrationParametersMax.Action == default(byte)) + //{ + // //TODO: Start reference meter messurements. + + // Thread.Sleep((meter.CalibrationParametersMin.Duration + 3) * 1120); + + // //TODO: Stop reference meter messurements. + // //TODO: Get reference meter messurements. + + // meter.CalibrationResultMax = connection.CheckFactoryCalibration(calibrationRequest); + //} + + //meter.Calibrate(); + } + + private void FinischInspection(OmniConnection connection, int index) + { + //var meter = this.GetMeter(index); + //meter.ConfigurationParameters = connection.ViewConfigurationParameters(); + + //if (meter.ConfigurationParameters.Status != CommandStatus.Completed) + //{ + // // TODO: whats next ? + //} + + //var resetSucceeded = connection.MemorySettingsByckToDefault(); + + //if (resetSucceeded) + //{ + // Thread.Sleep(5000); + //} + //else + //{ + // // TODO: whats next ? + //} + + //var registerSettingsSucceeded = connection.SetRegisterSettings(meter.RegisterSettingsOut); + + //if (!registerSettingsSucceeded) + //{ + // // TODO: whats next ? + //} + + //var configurationParametersSucceeded = connection.SetConfigurationParameters(meter.ConfigurationParametersOut); + + //if (!configurationParametersSucceeded) + //{ + // // TODO: whats next ? + //} + + //var readingReadingUnitAndResolution = connection.RemoveReadingUnitAndResolution(); + + //if (!readingReadingUnitAndResolution) + //{ + // // TODO: whats next ? + //} + + //// This settings are available after seal. + //// TODO: 7. 0x20 Customer specific leak alarm + //// TODO: 8. 0x20 Customer specific heigh flow alarm + //// TODO: 9. 0x20 Customer specific reverce flow alarm + //// TODO: 10. 0x22 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF clear alarms + //// TODO: 11. 0xFD 0x65 0x02 enable NFC + //// TODO: 12. 0xFD 0x24 Verify Configuration + //// TODO: 13. 0xFD 0xC6 Verify Configuration + //// TODO: 14. 0xFD 0xC7 Verify Configuration + //// TODO: 15. 0x21 0xFF 0x00 0x00 View Alarm State + //// TODO: 16. 0x1F 0x00 0x04 0x01 verify alarm 1 + //// TODO: 17. 0x1F 0x00 0x04 0x01 verify alarm 2 + //// TODO: 18. 0x1F 0x00 0x04 0x01 verify alarm 4 + + + //var factorySealSucceeded = connection.FactorySeal(true); + + //if (!factorySealSucceeded) + //{ + // // TODO: whats next ? + //} + + //var factorySeal = connection.ViewFactorySeal(); + + //if (factorySeal.Status != CommandStatus.Completed || !factorySeal.Sealed) + //{ + // // TODO: whats next ? + //} + + //// TODO: Meter successfully inspected. + } + } +} diff --git a/Common/OmniPlusUI/Models/PhysicalConnection/Enums/BaudRate.cs b/Common/OmniPlusUI/Models/PhysicalConnection/Enums/BaudRate.cs new file mode 100644 index 00000000..6ab12bb4 --- /dev/null +++ b/Common/OmniPlusUI/Models/PhysicalConnection/Enums/BaudRate.cs @@ -0,0 +1,19 @@ +namespace OmniPlusUI.Models.PhysicalConnection.Enums +{ + public enum BaudRate + { + K300 = 300, + K600 = 600, + K1200 = 1200, + K2400 = 2400, + K4800 = 4800, + K9600 = 9600, + K19200 = 19200, + K38400 = 38400, + K57600 = 57600, + K115200 = 115200, + K230400 = 230400, + K460800 = 460800, + K921600 = 921600 + } +} \ No newline at end of file diff --git a/Common/OmniPlusUI/Models/PhysicalConnection/Enums/DataBits.cs b/Common/OmniPlusUI/Models/PhysicalConnection/Enums/DataBits.cs new file mode 100644 index 00000000..9bc7ad60 --- /dev/null +++ b/Common/OmniPlusUI/Models/PhysicalConnection/Enums/DataBits.cs @@ -0,0 +1,10 @@ +namespace OmniPlusUI.Models.PhysicalConnection.Enums +{ + public enum DataBits + { + X5 = 5, + X6 = 6, + X7 = 7, + X8 = 8 + } +} \ No newline at end of file diff --git a/Common/OmniPlusUI/Models/PhysicalConnection/Enums/SerialPortState.cs b/Common/OmniPlusUI/Models/PhysicalConnection/Enums/SerialPortState.cs new file mode 100644 index 00000000..702d28db --- /dev/null +++ b/Common/OmniPlusUI/Models/PhysicalConnection/Enums/SerialPortState.cs @@ -0,0 +1,11 @@ +namespace OmniPlusUI.Models.PhysicalConnection.Enums +{ + public enum SerialPortState + { + Closed, + Disposed, + PinChanged, + ErrorReceived, + Open + } +} diff --git a/Common/OmniPlusUI/Models/PhysicalConnection/SerialPortConnection.cs b/Common/OmniPlusUI/Models/PhysicalConnection/SerialPortConnection.cs new file mode 100644 index 00000000..15e92e1a --- /dev/null +++ b/Common/OmniPlusUI/Models/PhysicalConnection/SerialPortConnection.cs @@ -0,0 +1,174 @@ +using OmniPlusUI.Models.PhysicalConnection.Enums; + +using System; +using System.IO; +using System.IO.Ports; + +namespace OmniPlusUI.Models.PhysicalConnection +{ + public abstract class SerialPortConnection + { + private event Action DataReceived; + private event Action Log; + + private SerialPort serialPort; + private SerialPortState state; + + protected SerialPortConnection() + => this.Options = new SerialPortOptions(); + + public event Action StateChanged; + + protected bool Reading { get; set; } + + protected SerialPortOptions Options { get; set; } + + public bool Connected + => this.state == SerialPortState.Open; + + public virtual void Close() + { + if (this.serialPort != null) + { + this.serialPort.DataReceived -= this.SerialPort_DataReceived; + this.serialPort.Disposed -= this.SerialPort_Disposed; + this.serialPort.ErrorReceived -= this.SerialPort_ErrorReceived; + this.serialPort.PinChanged -= this.SerialPort_PinChanged; + } + + this.serialPort?.Close(); + + this.serialPort = null; + this.state = SerialPortState.Closed; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} closed."); + + this.Log -= this.SerialPortConnection_Log; + this.DataReceived -= this.SerialPortConnection_DataReceived; + this.StateChanged -= this.SerialPortConnection_StateChanged; + } + + public virtual void Open() + { + this.Close(); + + try + { + var fileInfo = new FileInfo(this.Options.LogFile); + fileInfo.Directory.Create(); + + File.AppendAllText(this.Options.LogFile, string.Empty); + + this.Log += this.SerialPortConnection_Log; + } + catch (Exception e) + { + this.state = SerialPortState.ErrorReceived; + + Console.WriteLine($"[{this.state}] {this.Options.PortName}: {e}"); + } + + try + { + this.serialPort = new SerialPort + { + PortName = Options.PortName, + BaudRate = (int)Options.BaudRate, + DataBits = (int)Options.DataBits, + Parity = Options.Parity, + StopBits = Options.StopBits, + RtsEnable = Options.RtsEnabled, + DtrEnable = Options.DtrEnabled + }; + + this.serialPort.DataReceived += this.SerialPort_DataReceived; + this.serialPort.Disposed += this.SerialPort_Disposed; + this.serialPort.ErrorReceived += this.SerialPort_ErrorReceived; + this.serialPort.PinChanged += this.SerialPort_PinChanged; + + this.serialPort.Open(); + + this.state = SerialPortState.Open; + this.DataReceived += this.SerialPortConnection_DataReceived; + this.StateChanged += this.SerialPortConnection_StateChanged; + + this.StateChanged?.Invoke(this.state + , $"{this.Options.PortName} opened" + + $", {this.Options.BaudRate}" + + $", {this.Options.DataBits}" + + $", {this.Options.Parity}" + + $", {this.Options.StopBits}"); + } + catch (Exception e) + { + this.state = SerialPortState.ErrorReceived; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName}: {e}"); + + this.Close(); + } + } + + protected void Write(params byte[] message) + { + if (this.Connected && message.Length > 0) + { + this.serialPort.Write(message, 0, message.Length); + } + + this.Log?.Invoke($"TX: {BitConverter.ToString(message)}"); + } + + protected abstract void SerialPortConnection_DataReceived(byte[] bytes); + + private void SerialPort_PinChanged(object sender, SerialPinChangedEventArgs args) + { + this.state = SerialPortState.PinChanged; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} {args.EventType}."); + + this.Close(); + } + + private void SerialPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs args) + { + this.state = SerialPortState.ErrorReceived; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} {args.EventType}."); + + this.Close(); + } + + private void SerialPort_Disposed(object sender, EventArgs args) + { + this.state = SerialPortState.Disposed; + + this.StateChanged?.Invoke(this.state, $"{this.Options.PortName} disposed."); + + this.Close(); + } + + private void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs args) + { + if (this.Connected && sender is SerialPort port && port.BytesToRead > 0) + { + var bytes = new byte[port.BytesToRead]; + var lock_object = new object(); + + lock (lock_object) + { + port.Read(bytes, 0, port.BytesToRead); + } + + this.DataReceived?.Invoke(bytes); + this.Log?.Invoke($"RX: {BitConverter.ToString(bytes)}"); + } + } + + private void SerialPortConnection_Log(string message) + => File.AppendAllText(this.Options.LogFile, $"{message}{Environment.NewLine}"); + + private void SerialPortConnection_StateChanged(SerialPortState state, string message) + => File.AppendAllText(this.Options.LogFile, $"[{state}] {message}{Environment.NewLine}"); + } +} diff --git a/Common/OmniPlusUI/Models/PhysicalConnection/SerialPortOptions.cs b/Common/OmniPlusUI/Models/PhysicalConnection/SerialPortOptions.cs new file mode 100644 index 00000000..f8dbf96a --- /dev/null +++ b/Common/OmniPlusUI/Models/PhysicalConnection/SerialPortOptions.cs @@ -0,0 +1,36 @@ +using OmniPlusUI.Models.PhysicalConnection.Enums; + +using System.IO.Ports; + +namespace OmniPlusUI.Models.PhysicalConnection +{ + public class SerialPortOptions + { + public SerialPortOptions() + { + this.BaudRate = BaudRate.K4800; + this.DataBits = DataBits.X8; + this.Parity = Parity.None; + this.StopBits = StopBits.One; + this.Handshake = Handshake.None; + } + + public string PortName { get; set; } + + public BaudRate BaudRate { get; set; } + + public Parity Parity { get; set; } + + public DataBits DataBits { get; set; } + + public StopBits StopBits { get; set; } + + public Handshake Handshake { get; set; } + + public bool RtsEnabled { get; set; } + + public bool DtrEnabled { get; set; } + + public string LogFile { get; set; } + } +} \ No newline at end of file diff --git a/Common/OmniPlusUI/OmniPlusUI.Designer.cs b/Common/OmniPlusUI/OmniPlusUI.Designer.cs new file mode 100644 index 00000000..4ef2eb44 --- /dev/null +++ b/Common/OmniPlusUI/OmniPlusUI.Designer.cs @@ -0,0 +1,130 @@ +namespace OmniPlusUI +{ + partial class OmniPlusUI + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.layout = new System.Windows.Forms.TableLayoutPanel(); + this.navbar = new System.Windows.Forms.TableLayoutPanel(); + this.pruefungStartBTN = new System.Windows.Forms.Button(); + this.body = new System.Windows.Forms.TableLayoutPanel(); + this.pruefungBackground = new System.ComponentModel.BackgroundWorker(); + this.layout.SuspendLayout(); + this.navbar.SuspendLayout(); + this.SuspendLayout(); + // + // layout + // + this.layout.ColumnCount = 1; + this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.layout.Controls.Add(this.navbar, 0, 1); + this.layout.Controls.Add(this.body, 0, 0); + this.layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.layout.Location = new System.Drawing.Point(0, 0); + this.layout.Name = "layout"; + this.layout.RowCount = 2; + this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.layout.Size = new System.Drawing.Size(1266, 713); + this.layout.TabIndex = 0; + // + // navbar + // + this.navbar.AutoSize = true; + this.navbar.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.navbar.ColumnCount = 2; + this.navbar.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.navbar.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.navbar.Controls.Add(this.pruefungStartBTN, 1, 0); + this.navbar.Dock = System.Windows.Forms.DockStyle.Fill; + this.navbar.Location = new System.Drawing.Point(0, 679); + this.navbar.Margin = new System.Windows.Forms.Padding(0); + this.navbar.Name = "navbar"; + this.navbar.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.navbar.RowCount = 2; + this.navbar.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.navbar.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.navbar.Size = new System.Drawing.Size(1266, 34); + this.navbar.TabIndex = 0; + // + // pruefungStartBTN + // + this.pruefungStartBTN.AutoSize = true; + this.pruefungStartBTN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.pruefungStartBTN.Dock = System.Windows.Forms.DockStyle.Fill; + this.pruefungStartBTN.Location = new System.Drawing.Point(1078, 3); + this.pruefungStartBTN.Name = "pruefungStartBTN"; + this.pruefungStartBTN.Padding = new System.Windows.Forms.Padding(30, 0, 30, 0); + this.navbar.SetRowSpan(this.pruefungStartBTN, 2); + this.pruefungStartBTN.Size = new System.Drawing.Size(182, 25); + this.pruefungStartBTN.TabIndex = 0; + this.pruefungStartBTN.Text = "Prüfung starten"; + this.pruefungStartBTN.UseVisualStyleBackColor = true; + this.pruefungStartBTN.Click += new System.EventHandler(this.PruefungStartBTN_Click); + // + // body + // + this.body.ColumnCount = 1; + this.body.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.body.Dock = System.Windows.Forms.DockStyle.Fill; + this.body.Location = new System.Drawing.Point(0, 0); + this.body.Margin = new System.Windows.Forms.Padding(0); + this.body.Name = "body"; + this.body.Padding = new System.Windows.Forms.Padding(3, 3, 3, 0); + this.body.RowCount = 1; + this.body.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.body.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 671F)); + this.body.Size = new System.Drawing.Size(1266, 679); + this.body.TabIndex = 1; + // + // OmniPlusUI + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1266, 713); + this.Controls.Add(this.layout); + this.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "OmniPlusUI"; + this.Text = "OMNI Plus"; + this.layout.ResumeLayout(false); + this.layout.PerformLayout(); + this.navbar.ResumeLayout(false); + this.navbar.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel layout; + private System.Windows.Forms.TableLayoutPanel navbar; + private System.Windows.Forms.TableLayoutPanel body; + private System.Windows.Forms.Button pruefungStartBTN; + private System.ComponentModel.BackgroundWorker pruefungBackground; + } +} + diff --git a/Common/OmniPlusUI/OmniPlusUI.cs b/Common/OmniPlusUI/OmniPlusUI.cs new file mode 100644 index 00000000..68c1a574 --- /dev/null +++ b/Common/OmniPlusUI/OmniPlusUI.cs @@ -0,0 +1,230 @@ +using OmniPlusUI.Models; + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace OmniPlusUI +{ + public partial class OmniPlusUI : Form + { + private readonly OmniPool omniPool; + + public OmniPlusUI() + { + this.InitializeComponent(); + + this.omniPool = new OmniPool(); + + this.HandleCreated += this.OmniPlusUI_HandleCreated; + this.HandleDestroyed += this.OmniPlusUI_HandleDestroyed; + } + + private void OmniPlusUI_HandleDestroyed(object _, EventArgs _1) + { + this.omniPool.Dispose(); + + this.omniPool.StateChanged -= this.OmniPool_StateChanged; + this.pruefungBackground.DoWork -= this.PruefungBackground_DoWork; + } + + private void OmniPlusUI_HandleCreated(object _, EventArgs _1) + { + this.InitializeBody(); + + this.omniPool.StateChanged += this.OmniPool_StateChanged; + this.pruefungBackground.DoWork += this.PruefungBackground_DoWork; + } + + private void PruefungStartBTN_Click(object _, EventArgs _1) + => this.pruefungBackground.RunWorkerAsync(); + + private void PruefungBackground_DoWork(object _, DoWorkEventArgs _1) + { + this.Invoke(new Action(() => + { + this.Cursor = Cursors.WaitCursor; + this.pruefungStartBTN.Enabled = false; + })); + + this.ClearBody(); + this.omniPool.InitializePool(0, 0); + this.omniPool.InitializeInspection(); + //this.omniPool.StartInspection(); + //this.omniPool.FinischInspection(); + + this.Invoke(new Action(() => + { + this.Cursor = Cursors.Default; + this.pruefungStartBTN.Enabled = true; + })); + } + + private void OmniPool_StateChanged(int column, bool succeeded, string header, string value) + { + this.Invoke(new Action(() => + { + var headerIndex = this.GetRowIndex(header); + var columnIndex = headerIndex + column; + var controls = this.body.Controls; + var controlsCount = controls.Count; + + if (controls[headerIndex] is Label rowHeader) + { + rowHeader.Text = header; + rowHeader.TextAlign = ContentAlignment.MiddleLeft; + rowHeader.BackColor = SystemColors.ControlLight; + rowHeader.ForeColor = SystemColors.ControlText; + } + + if (controls[columnIndex] is Label columnLabel) + { + columnLabel.Text + = succeeded || headerIndex == 0 + ? value + : "---"; + columnLabel.BackColor + = headerIndex == 0 + ? SystemColors.ControlLight + : SystemColors.Window; + columnLabel.ForeColor + = succeeded + ? SystemColors.ControlText + : SystemColors.ControlDark; + } + })); + } + + private int GetRowIndex(string header) + { + var controls = this.body.Controls; + var controlsCount = controls.Count; + var cols = this.body.ColumnCount; + var rows = this.body.RowCount; + var rowIndex = int.MinValue; + var row = default(int); + + for (row = 0; row < rows; row++) + { + var headerIndex = row * cols; + + if (headerIndex >= controlsCount) + { + break; + } + + if (controls[headerIndex] is Label label) + { + var labelText = label.Text?.Trim()?.ToLower(); + var headerText = header?.Trim()?.ToLower(); + + if (string.IsNullOrWhiteSpace(labelText) || labelText == headerText) + { + rowIndex = headerIndex; + + break; + } + } + else break; + } + + if (rowIndex == int.MinValue) + { + rowIndex = (rows - 1) * cols; + } + + return rowIndex; + } + + private void InitializeBody() + { + var ready = false; + + this.body.Invoke(new Action(() => + { + var cols = 9; + var rows = 20; + + this.body.RowCount = 0; + this.body.ColumnCount = 0; + + this.body.Controls.Clear(); + this.body.RowStyles.Clear(); + this.body.ColumnStyles.Clear(); + + var bold = new Font(this.body.Font, FontStyle.Bold); + + for (int row = 0; row < rows; row++) + { + var firstRow = row == 0; + + this.body.RowCount++; + this.body.RowStyles.Add(new RowStyle(SizeType.AutoSize)); + + for (int col = 0; col < cols; col++) + { + var firstCol = col == 0; + var lastCol = col == cols - 1; + + if (firstRow) + { + this.body.ColumnCount++; + this.body.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, firstCol ? 100F : 70F)); + } + + var label = new Label + { + Dock = DockStyle.Fill, + Padding = new Padding(3), + Margin = new Padding(0, 0, lastCol ? 0 : 3, 3), + TextAlign = ContentAlignment.MiddleCenter, + BackColor = this.body.BackColor, + ForeColor = this.body.BackColor, + Text = default(string) + }; + + if (firstCol || firstRow) + { + label.Font = bold; + } + + this.body.Controls.Add(label, col, row); + } + } + + this.body.RowCount++; + this.body.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + + ready = true; + })); + + while (!ready) ; + } + + private void ClearBody() + { + var ready = false; + + this.body.Invoke(new Action(() => + { + for (int row = 0; row < this.body.RowCount; row++) + { + for (int col = 0; col < this.body.ColumnCount; col++) + { + if (this.body.Controls[row + col] is Label label) + { + label.Text = default(string); + label.BackColor = this.body.BackColor; + label.ForeColor = this.body.ForeColor; + } + } + } + + ready = true; + })); + + while (!ready) ; + } + } +} diff --git a/Common/OmniPlusUI/OmniPlusUI.csproj b/Common/OmniPlusUI/OmniPlusUI.csproj new file mode 100644 index 00000000..40890be2 --- /dev/null +++ b/Common/OmniPlusUI/OmniPlusUI.csproj @@ -0,0 +1,172 @@ + + + + + Debug + AnyCPU + {A403975F-65A1-431C-8192-CE0DE0321B2C} + WinExe + OmniPlusUI + OmniPlusUI + v4.0 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + OmniPlusUI.cs + + + + + OmniPlusUI.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {B84DF613-96AA-443B-BB46-86746E6C87F9} + OmniPipes + + + + \ No newline at end of file diff --git a/Common/OmniPlusUI/OmniPlusUI.resx b/Common/OmniPlusUI/OmniPlusUI.resx new file mode 100644 index 00000000..9b8b901c --- /dev/null +++ b/Common/OmniPlusUI/OmniPlusUI.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Common/OmniPlusUI/Program.cs b/Common/OmniPlusUI/Program.cs new file mode 100644 index 00000000..5e3ac0dd --- /dev/null +++ b/Common/OmniPlusUI/Program.cs @@ -0,0 +1,16 @@ +using System; +using System.Windows.Forms; + +namespace OmniPlusUI +{ + public static class Program + { + [STAThread] + public static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new OmniPlusUI()); + } + } +} diff --git a/Common/OmniPlusUI/Properties/AssemblyInfo.cs b/Common/OmniPlusUI/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..bf2c4c69 --- /dev/null +++ b/Common/OmniPlusUI/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OmniPlusUI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OmniPlusUI")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a403975f-65a1-431c-8192-ce0de0321b2c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Common/OmniPlusUI/Properties/Resources.Designer.cs b/Common/OmniPlusUI/Properties/Resources.Designer.cs new file mode 100644 index 00000000..8f4589d7 --- /dev/null +++ b/Common/OmniPlusUI/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OmniPlusUI.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OmniPlusUI.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Common/OmniPlusUI/Properties/Resources.resx b/Common/OmniPlusUI/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Common/OmniPlusUI/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Common/OmniPlusUI/Properties/Settings.Designer.cs b/Common/OmniPlusUI/Properties/Settings.Designer.cs new file mode 100644 index 00000000..f4ae1359 --- /dev/null +++ b/Common/OmniPlusUI/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OmniPlusUI.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Common/OmniPlusUI/Properties/Settings.settings b/Common/OmniPlusUI/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/Common/OmniPlusUI/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + From 7b2f53b83920a6410d415e07afd837c462627747 Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Thu, 2 Nov 2023 11:09:04 +0100 Subject: [PATCH 19/56] Temperature calibration changes --- .../GenesisToolBox/FrmTempMeter.Designer.cs | 231 +++++--------- Common/Ui/GenesisToolBox/FrmTempMeter.cs | 44 +-- Common/Ui/GenesisToolBox/FrmTempMeter.resx | 6 + .../Ui/GenesisToolBox/GenesisToolBox.csproj | 7 - .../Infrastructure/Appsettings.cs | 20 +- .../Infrastructure/TempMeterModels.cs | 281 ++++++++++-------- .../Models/Search/SearchWildcardModel.cs | 29 +- .../LaaProductionWeb/2023_11_02.debug | 0 .../App_Content/css/styles.css | 5 + .../Controllers/SearchController.cs | 57 +++- .../LaaProductionWeb/LaaProductionWeb.csproj | 1 + .../Views/Search/Passwords.cshtml | 84 ++++++ .../Views/Shared/_Layout.cshtml | 6 + 13 files changed, 418 insertions(+), 353 deletions(-) create mode 100644 LaaProductionWeb/LaaProductionWeb/2023_11_02.debug create mode 100644 LaaProductionWeb/LaaProductionWeb/Views/Search/Passwords.cshtml diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs index 39c68bbe..58d072cc 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.Designer.cs @@ -31,16 +31,16 @@ namespace Xylem.Common.Ui.GenesisToolBox private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.automaticCalibrationTabControl = new System.Windows.Forms.TabControl(); @@ -70,15 +70,11 @@ namespace Xylem.Common.Ui.GenesisToolBox this.automaticControlsPanel = new System.Windows.Forms.Panel(); this.messurementStopMs = new System.Windows.Forms.TextBox(); this.label10 = new System.Windows.Forms.Label(); - this.backwardsStepMS = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); - this.messurementStepMS = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); + this.temperatureChecksSec = new System.Windows.Forms.TextBox(); this.stopBackwardsBtn = new System.Windows.Forms.Button(); this.startBackwardBtn = new System.Windows.Forms.Button(); this.saveSettingsBtn = new System.Windows.Forms.Button(); - this.messurementDauerMS = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); this.stopAutomaticBtn = new System.Windows.Forms.Button(); this.startAutomaticBtn = new System.Windows.Forms.Button(); this.GMHPort = new System.Windows.Forms.TextBox(); @@ -112,8 +108,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timer3 = new System.Windows.Forms.Timer(this.components); this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); - this.tofRecordingDauerSeconds = new System.Windows.Forms.TextBox(); - this.label11 = new System.Windows.Forms.Label(); this.automaticCalibrationTabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -412,19 +406,13 @@ namespace Xylem.Common.Ui.GenesisToolBox // automaticControlsPanel // this.automaticControlsPanel.BackColor = System.Drawing.SystemColors.Menu; - this.automaticControlsPanel.Controls.Add(this.tofRecordingDauerSeconds); - this.automaticControlsPanel.Controls.Add(this.label11); this.automaticControlsPanel.Controls.Add(this.messurementStopMs); this.automaticControlsPanel.Controls.Add(this.label10); - this.automaticControlsPanel.Controls.Add(this.backwardsStepMS); this.automaticControlsPanel.Controls.Add(this.label2); - this.automaticControlsPanel.Controls.Add(this.messurementStepMS); - this.automaticControlsPanel.Controls.Add(this.label8); + this.automaticControlsPanel.Controls.Add(this.temperatureChecksSec); this.automaticControlsPanel.Controls.Add(this.stopBackwardsBtn); this.automaticControlsPanel.Controls.Add(this.startBackwardBtn); this.automaticControlsPanel.Controls.Add(this.saveSettingsBtn); - this.automaticControlsPanel.Controls.Add(this.messurementDauerMS); - this.automaticControlsPanel.Controls.Add(this.label3); this.automaticControlsPanel.Controls.Add(this.stopAutomaticBtn); this.automaticControlsPanel.Controls.Add(this.startAutomaticBtn); this.automaticControlsPanel.Controls.Add(this.GMHPort); @@ -442,7 +430,7 @@ namespace Xylem.Common.Ui.GenesisToolBox | System.Windows.Forms.AnchorStyles.Right))); this.messurementStopMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.messurementStopMs.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementStopMs.Location = new System.Drawing.Point(5, 242); + this.messurementStopMs.Location = new System.Drawing.Point(5, 152); this.messurementStopMs.Margin = new System.Windows.Forms.Padding(0); this.messurementStopMs.Name = "messurementStopMs"; this.messurementStopMs.Size = new System.Drawing.Size(318, 24); @@ -453,7 +441,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label10.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label10.Location = new System.Drawing.Point(5, 219); + this.label10.Location = new System.Drawing.Point(5, 129); this.label10.Margin = new System.Windows.Forms.Padding(5); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(318, 18); @@ -461,62 +449,37 @@ namespace Xylem.Common.Ui.GenesisToolBox this.label10.Text = "Messungsende in Stunden"; this.label10.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // - // backwardsStepMS - // - this.backwardsStepMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.backwardsStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.backwardsStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.backwardsStepMS.Location = new System.Drawing.Point(5, 190); - this.backwardsStepMS.Margin = new System.Windows.Forms.Padding(0); - this.backwardsStepMS.Name = "backwardsStepMS"; - this.backwardsStepMS.Size = new System.Drawing.Size(318, 24); - this.backwardsStepMS.TabIndex = 20; - // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(5, 115); + this.label2.Location = new System.Drawing.Point(5, 67); this.label2.Margin = new System.Windows.Forms.Padding(5); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(318, 18); this.label2.TabIndex = 2; - this.label2.Text = "Messschritt in Millisekunden"; + this.label2.Text = "Messschritt in Sekunden"; this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // - // messurementStepMS + // temperatureChecksSec // - this.messurementStepMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.temperatureChecksSec.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.messurementStepMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.messurementStepMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementStepMS.Location = new System.Drawing.Point(5, 138); - this.messurementStepMS.Margin = new System.Windows.Forms.Padding(0); - this.messurementStepMS.Name = "messurementStepMS"; - this.messurementStepMS.Size = new System.Drawing.Size(318, 24); - this.messurementStepMS.TabIndex = 3; - // - // label8 - // - this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label8.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label8.Location = new System.Drawing.Point(5, 167); - this.label8.Margin = new System.Windows.Forms.Padding(5); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(318, 18); - this.label8.TabIndex = 19; - this.label8.Text = "Rückwärtsmessschritt in Millisekunden"; - this.label8.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + this.temperatureChecksSec.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.temperatureChecksSec.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.temperatureChecksSec.Location = new System.Drawing.Point(5, 90); + this.temperatureChecksSec.Margin = new System.Windows.Forms.Padding(0); + this.temperatureChecksSec.Name = "temperatureChecksSec"; + this.temperatureChecksSec.Size = new System.Drawing.Size(318, 24); + this.temperatureChecksSec.TabIndex = 3; // // stopBackwardsBtn // this.stopBackwardsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopBackwardsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 511); + this.stopBackwardsBtn.Location = new System.Drawing.Point(5, 374); this.stopBackwardsBtn.Margin = new System.Windows.Forms.Padding(5); this.stopBackwardsBtn.Name = "stopBackwardsBtn"; this.stopBackwardsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -531,7 +494,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startBackwardBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startBackwardBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startBackwardBtn.Location = new System.Drawing.Point(5, 465); + this.startBackwardBtn.Location = new System.Drawing.Point(5, 328); this.startBackwardBtn.Margin = new System.Windows.Forms.Padding(5); this.startBackwardBtn.Name = "startBackwardBtn"; this.startBackwardBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -546,7 +509,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSettingsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.saveSettingsBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.saveSettingsBtn.Location = new System.Drawing.Point(5, 327); + this.saveSettingsBtn.Location = new System.Drawing.Point(5, 190); this.saveSettingsBtn.Margin = new System.Windows.Forms.Padding(5); this.saveSettingsBtn.Name = "saveSettingsBtn"; this.saveSettingsBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -556,37 +519,12 @@ namespace Xylem.Common.Ui.GenesisToolBox this.saveSettingsBtn.UseVisualStyleBackColor = true; this.saveSettingsBtn.Click += new System.EventHandler(this.SaveSettingsBtn_Click); // - // messurementDauerMS - // - this.messurementDauerMS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.messurementDauerMS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.messurementDauerMS.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.messurementDauerMS.Location = new System.Drawing.Point(5, 86); - this.messurementDauerMS.Margin = new System.Windows.Forms.Padding(0); - this.messurementDauerMS.Name = "messurementDauerMS"; - this.messurementDauerMS.Size = new System.Drawing.Size(318, 24); - this.messurementDauerMS.TabIndex = 15; - // - // label3 - // - this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label3.Location = new System.Drawing.Point(5, 63); - this.label3.Margin = new System.Windows.Forms.Padding(5); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(318, 18); - this.label3.TabIndex = 14; - this.label3.Text = "Messdauer in Millisekunden"; - this.label3.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // // stopAutomaticBtn // this.stopAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.stopAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 419); + this.stopAutomaticBtn.Location = new System.Drawing.Point(5, 282); this.stopAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.stopAutomaticBtn.Name = "stopAutomaticBtn"; this.stopAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -601,7 +539,7 @@ namespace Xylem.Common.Ui.GenesisToolBox this.startAutomaticBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.startAutomaticBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.startAutomaticBtn.Location = new System.Drawing.Point(5, 373); + this.startAutomaticBtn.Location = new System.Drawing.Point(5, 236); this.startAutomaticBtn.Margin = new System.Windows.Forms.Padding(5); this.startAutomaticBtn.Name = "startAutomaticBtn"; this.startAutomaticBtn.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); @@ -653,14 +591,14 @@ namespace Xylem.Common.Ui.GenesisToolBox // this.temperatureChecksGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.temperatureChecksGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.ButtonFace; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.temperatureChecksGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11; this.temperatureChecksGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.TemperatureCheck_Pcb, this.TemperatureCheck_PrevC, @@ -671,14 +609,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.TemperatureCheck_PrevTOF, this.TemperatureCheck_CurrentTOF, this.TemperatureCheck_NextTOF}); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.temperatureChecksGridView.DefaultCellStyle = dataGridViewCellStyle12; this.temperatureChecksGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.temperatureChecksGridView.Location = new System.Drawing.Point(0, 24); this.temperatureChecksGridView.Name = "temperatureChecksGridView"; @@ -782,14 +720,14 @@ namespace Xylem.Common.Ui.GenesisToolBox this.aggregationsGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.aggregationsGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke; this.aggregationsGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.aggregationsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle13; this.aggregationsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.aggregationsGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.PcbId, @@ -810,8 +748,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // PcbId // this.PcbId.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.PcbId.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.PcbId.DefaultCellStyle = dataGridViewCellStyle14; this.PcbId.HeaderText = "PcbId"; this.PcbId.Name = "PcbId"; this.PcbId.ReadOnly = true; @@ -819,8 +757,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_Nr // this.Avg_Nr.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_Nr.DefaultCellStyle = dataGridViewCellStyle15; this.Avg_Nr.HeaderText = "Nr"; this.Avg_Nr.Name = "Avg_Nr"; this.Avg_Nr.ReadOnly = true; @@ -828,8 +766,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_T // this.Avg_T.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_T.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_T.DefaultCellStyle = dataGridViewCellStyle16; this.Avg_T.HeaderText = "Avg °C"; this.Avg_T.Name = "Avg_T"; this.Avg_T.ReadOnly = true; @@ -837,8 +775,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // Avg_TOF // this.Avg_TOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Avg_TOF.DefaultCellStyle = dataGridViewCellStyle17; this.Avg_TOF.HeaderText = "Avg TOF"; this.Avg_TOF.Name = "Avg_TOF"; this.Avg_TOF.ReadOnly = true; @@ -846,16 +784,16 @@ namespace Xylem.Common.Ui.GenesisToolBox // diffT // this.diffT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffT.DefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffT.DefaultCellStyle = dataGridViewCellStyle18; this.diffT.HeaderText = "°C max - min"; this.diffT.Name = "diffT"; // // diffTOF // this.diffTOF.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.diffTOF.DefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.diffTOF.DefaultCellStyle = dataGridViewCellStyle19; this.diffTOF.HeaderText = "TOF max - min"; this.diffTOF.Name = "diffTOF"; this.diffTOF.ReadOnly = true; @@ -863,8 +801,8 @@ namespace Xylem.Common.Ui.GenesisToolBox // seconds // this.seconds.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.seconds.DefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.seconds.DefaultCellStyle = dataGridViewCellStyle20; this.seconds.HeaderText = "Seconds"; this.seconds.Name = "seconds"; this.seconds.ReadOnly = true; @@ -927,31 +865,6 @@ namespace Xylem.Common.Ui.GenesisToolBox this.mainMenuStrip.TabIndex = 57; this.mainMenuStrip.Text = "menuStrip1"; // - // tofRecordingDauerSeconds - // - this.tofRecordingDauerSeconds.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tofRecordingDauerSeconds.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.tofRecordingDauerSeconds.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tofRecordingDauerSeconds.Location = new System.Drawing.Point(5, 294); - this.tofRecordingDauerSeconds.Margin = new System.Windows.Forms.Padding(0); - this.tofRecordingDauerSeconds.Name = "tofRecordingDauerSeconds"; - this.tofRecordingDauerSeconds.Size = new System.Drawing.Size(318, 24); - this.tofRecordingDauerSeconds.TabIndex = 24; - // - // label11 - // - this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label11.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label11.Location = new System.Drawing.Point(5, 271); - this.label11.Margin = new System.Windows.Forms.Padding(5); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(318, 18); - this.label11.TabIndex = 23; - this.label11.Text = "TOF aufnahme dauer in Sekunden"; - this.label11.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // // FrmTempMeter // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1020,12 +933,10 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.Panel automaticControlsPanel; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox GMHPort; - private System.Windows.Forms.TextBox messurementStepMS; + private System.Windows.Forms.TextBox temperatureChecksSec; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button stopAutomaticBtn; private System.Windows.Forms.Button startAutomaticBtn; - private System.Windows.Forms.TextBox messurementDauerMS; - private System.Windows.Forms.Label label3; private System.Windows.Forms.Button saveSettingsBtn; private System.Windows.Forms.TabPage lutTab; private System.Windows.Forms.DataGridView aggregationsGridView; @@ -1048,8 +959,6 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_PrevTOF; private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_CurrentTOF; private System.Windows.Forms.DataGridViewTextBoxColumn TemperatureCheck_NextTOF; - private System.Windows.Forms.TextBox backwardsStepMS; - private System.Windows.Forms.Label label8; private System.Windows.Forms.DataGridViewTextBoxColumn PcbId; private System.Windows.Forms.DataGridViewTextBoxColumn Avg_Nr; private System.Windows.Forms.DataGridViewTextBoxColumn Avg_T; @@ -1060,7 +969,5 @@ namespace Xylem.Common.Ui.GenesisToolBox private System.Windows.Forms.DataGridViewCheckBoxColumn Selected; private System.Windows.Forms.TextBox messurementStopMs; private System.Windows.Forms.Label label10; - private System.Windows.Forms.TextBox tofRecordingDauerSeconds; - private System.Windows.Forms.Label label11; } } \ No newline at end of file diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.cs b/Common/Ui/GenesisToolBox/FrmTempMeter.cs index 94885924..d75a7960 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.cs +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.cs @@ -353,8 +353,6 @@ private double OutputAvgTof(Boolean stop = false) { - // TODO: Prüfung der TOF signal ??? - var avgToF = default(double); try @@ -649,11 +647,8 @@ this.automaticCalibrationTabControl.GotFocus += (Object sender, EventArgs e) => { this.GMHPort.Text = Appsettings.GMHPort.ToString(); - this.messurementStepMS.Text = Appsettings.MessurementStepMs.ToString(); - this.messurementDauerMS.Text = Appsettings.MessurementDauerMs.ToString(); - this.backwardsStepMS.Text = Appsettings.BackwardsStepMs.ToString(); + this.temperatureChecksSec.Text = Appsettings.TemperatureChecksSec.ToString(); this.messurementStopMs.Text = Appsettings.MessurementStopHours.ToString(); - this.tofRecordingDauerSeconds.Text = Appsettings.TOFRecordingDauerSeconds.ToString(); }; this.SetEnabled(ProgrammState.Start); @@ -819,26 +814,20 @@ => this.currentGenesis ?.StartRecordData(); - public Double AvgTOF() + public double[] GetMessurements() { if (this.currentGenesis is null) { this.automaticCalibration?.StopMessuring(); - return double.MinValue; + return Array.Empty(); } - - var tofs = this.currentGenesis + + return this.currentGenesis .CurrentRecords .Where(s => s.Channel == 2) - .Select(x => x.TotalTimeOfFlightS); - - if (tofs.Any()) - { - return tofs.Average(); - } - - return 1; + .Select(x => x.TotalTimeOfFlightS) + .ToArray(); } protected override void OnFormClosed(FormClosedEventArgs e) @@ -851,19 +840,9 @@ Appsettings.GMHPort = gmhPort; } - if (int.TryParse($"{this.messurementStepMS.Text}", out int msStep)) + if (int.TryParse($"{this.temperatureChecksSec.Text}", out int checkC)) { - Appsettings.MessurementStepMs = msStep; - } - - if (int.TryParse($"{this.messurementDauerMS.Text}", out int msDauer)) - { - Appsettings.MessurementDauerMs = msDauer; - } - - if (int.TryParse($"{this.backwardsStepMS.Text}", out int bwStep)) - { - Appsettings.BackwardsStepMs = bwStep; + Appsettings.TemperatureChecksSec = checkC; } if (int.TryParse($"{this.messurementStopMs.Text}", out int msStop)) @@ -871,11 +850,6 @@ Appsettings.MessurementStopHours = msStop; } - if (int.TryParse($"{this.tofRecordingDauerSeconds.Text}", out int tofRecording)) - { - Appsettings.TOFRecordingDauerSeconds = tofRecording; - } - Appsettings.SaveSettings(); MessageBox.Show("Die Einstellungen wurden erfolgreich gespeichert."); } diff --git a/Common/Ui/GenesisToolBox/FrmTempMeter.resx b/Common/Ui/GenesisToolBox/FrmTempMeter.resx index 15e6b68b..d67f5424 100644 --- a/Common/Ui/GenesisToolBox/FrmTempMeter.resx +++ b/Common/Ui/GenesisToolBox/FrmTempMeter.resx @@ -123,6 +123,12 @@ 104, 17 + + 531, 17 + + + 413, 17 + True diff --git a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj index 977f3794..04b57624 100644 --- a/Common/Ui/GenesisToolBox/GenesisToolBox.csproj +++ b/Common/Ui/GenesisToolBox/GenesisToolBox.csproj @@ -748,13 +748,6 @@ PreserveNewest Designer - - - - - - - PreserveNewest diff --git a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs index 3ed25446..eb0ff9d3 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/Appsettings.cs @@ -21,19 +21,7 @@ set => SetValue(value); } - public static int MessurementStepMs - { - get => GetInt32(); - set => SetValue(value); - } - - public static int MessurementDauerMs - { - get => GetInt32(); - set => SetValue(value); - } - - public static int BackwardsStepMs + public static int TemperatureChecksSec { get => GetInt32(); set => SetValue(value); @@ -45,12 +33,6 @@ set => SetValue(value); } - public static int TOFRecordingDauerSeconds - { - get => GetInt32(); - set => SetValue(value); - } - private static short GetInt16([CallerMemberName] string property = EMPTY) { var value = settings[property]?.Value?.ToString() ?? string.Empty; diff --git a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs index e6c3a500..d31ede48 100644 --- a/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs +++ b/Common/Ui/GenesisToolBox/Infrastructure/TempMeterModels.cs @@ -13,15 +13,13 @@ using System.Timers; using System.Windows; - using SystemThreadingThread = System.Threading.Thread; - internal interface ITempMeterForm { void AddMessage(string message); - double AvgTOF(); + double[] GetMessurements(); - IAsyncResult BeginInvoke(Delegate @delegate); + object Invoke(Delegate @delegate); void StartRecording(); } @@ -58,8 +56,9 @@ [DllImport("GMH3x32E.dll")] unsafe public static extern Int16 GMH_Transmit(Int16 ini16DeviceAddress, Int16 ini16TransmitCode, Int16* refi16ptrPriority, double* refdblptrFloatValue, Int32* refi32ptrIntegerValue); - - public TemperatureSource() => UniversalOpenCom(Appsettings.GMHPort, 4800, 8, 0, 0); + + public TemperatureSource() + => UniversalOpenCom(Appsettings.GMHPort, 4800, 8, 0, 0); public double GetTemperature() { @@ -79,7 +78,9 @@ public void Dispose() => GMH_CloseCom(); } - partial class AutomaticTemperatureCalibration + delegate void ProcessRecords(double startT, DateTime startTime, double endT, DateTime dateTime); + + internal class AutomaticTemperatureCalibration { private const string BASE_ADDRESS = "http://sla12iis01.emea.sensus.net/LaaProductionWeb"; // private const string BASE_ADDRESS = "http://localhost:52822/LaaProductionWeb"; @@ -95,11 +96,8 @@ private readonly ITempMeterForm tempMeterForm; private TemperatureSource temperatureSource; - private Timer longTimer; - private Timer shortTimer; - private Timer stopTimer; - private Timer resetTimer; - private bool messuring; + private Timer temperatureWatcher; + private Timer stopWatcher; public AutomaticTemperatureCalibration(string pcbId, ITempMeterForm genesisMeter) { @@ -112,112 +110,162 @@ this.aggregationsFile = this.GetOrCreateFile(this.pcbId, AGGREGATIONS_FILE); this.backwardsFile = this.GetOrCreateFile(this.pcbId, BACKWARDS_FILE); } - - this.temperatureSource = new TemperatureSource(); } public void StartMessuring() { - this.messuring = false; this.temperatureSource = new TemperatureSource(); - - this.shortTimer = new Timer(Appsettings.MessurementStepMs) + this.temperatureWatcher = new Timer(Appsettings.TemperatureChecksSec * 1000) { Enabled = true, AutoReset = true }; - this.shortTimer.Elapsed += this.ShortTimerElapsed; - this.shortTimer.Stop(); - this.longTimer = new Timer(Appsettings.MessurementDauerMs) + this.updateC = true; + this.previousT = DateTime.Now; + this.ProcessRecords += this.AutomaticTemperatureCalibration_ProcessRecords; + + this.temperatureWatcher.Elapsed += this.TemperatureWatcher_Elapsed; + this.temperatureWatcher.Start(); + + this.stopWatcher = new Timer(Appsettings.MessurementStopHours * 60 * 60 * 1000) { Enabled = true, AutoReset = true }; - this.longTimer.Elapsed += this.LongTimerElapsed; - this.LongTimerElapsed(null, null); - this.longTimer.Start(); - this.resetTimer = new Timer(Appsettings.TOFRecordingDauerSeconds * 1000) - { - Enabled = true, - AutoReset = true, - }; - this.resetTimer.Elapsed += (_1, _2) - => this.tempMeterForm.StartRecording(); - this.resetTimer.Start(); - - if (Appsettings.MessurementStopHours > 0) - { - this.stopTimer = new Timer(Appsettings.MessurementStopHours * 24 * 60 * 60 * 1000) - { - Enabled = true, - AutoReset = true - }; - this.stopTimer.Elapsed += (sender, args) - => this.StopMessuring(); - this.stopTimer.Start(); - } + this.stopWatcher.Elapsed += (_1, _2) => this.StopMessuring(); + this.stopWatcher.Start(); File.AppendAllText(this.aggregationsFile, Environment.NewLine); } - public void StopMessuring() + private bool updateC; + private bool recording; + private double previousC; + private DateTime previousT; + private event ProcessRecords ProcessRecords; + + private void TemperatureWatcher_Elapsed(Object _, ElapsedEventArgs args) { - this.shortTimer?.Stop(); - this.shortTimer?.Dispose(); - this.shortTimer = null; + var currentC = double.MinValue; - this.longTimer?.Stop(); - this.longTimer?.Dispose(); - this.longTimer = null; - - this.stopTimer?.Stop(); - this.stopTimer?.Dispose(); - this.stopTimer = null; - - this.resetTimer?.Stop(); - this.resetTimer?.Dispose(); - this.resetTimer = null; - - this.temperatureSource?.Dispose(); - this.temperatureSource = null; - } - - private void LongTimerElapsed(Object _1, ElapsedEventArgs _2) - { - this.messuring = !this.messuring; - - SystemThreadingThread.Sleep(1_000); - - if (this.messuring) + this.tempMeterForm.Invoke(new Action(() => { - this.shortTimer.Start(); + currentC = this.temperatureSource.GetTemperature(); + })); + + // 20.22, 20.23, 20.27, 20.55 + if (Math.Abs(this.previousC - currentC) <= 0.05) + { + if (!this.recording) + { + this.updateC = false; + this.recording = true; + + this.tempMeterForm?.StartRecording(); + } } else { - this.shortTimer.Stop(); - this.ParseMessurements(); + if (this.recording) + { + this.updateC = true; + this.recording = false; + + this.ProcessRecords?.Invoke(this.previousC, this.previousT, currentC, args.SignalTime); + } + } + + if (this.updateC) + { + this.previousC = currentC; + this.previousT = args.SignalTime; } } - private void ShortTimerElapsed(Object sender, ElapsedEventArgs args) + private void AutomaticTemperatureCalibration_ProcessRecords(double startC, DateTime startT, double endC, DateTime endT) { - lock (this.shortTimer) - { - this.tempMeterForm.BeginInvoke(new Action(() => - { - var messurement = !this.TryGetTOFandT(out double currentTOF, out double currentT) - ? $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t invalid record (TOF: {currentTOF} & T: {currentT})" - : $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; + var averageTOF = this.tempMeterForm + .GetMessurements() + .GroupBy(x => Math.Round(x, 6)) + .OrderByDescending(x => x.Count()) + .FirstOrDefault() + .AsEnumerable() + .Distinct() + .Average(); - if (this.messuring) - { - this.tempMeterForm.AddMessage(messurement); - File.AppendAllLines(this.messurementsFile, new[] { messurement }); - } - })); + File.AppendAllText(this.messurementsFile + , $"{startC,4:00.00}\t" + + $"{endC,4:00.00}\t" + + $"{Math.Abs(startC - endC),4:00.00}\t" + + $"{Math.Abs((startT - endT).Minutes),3}\t" + + $"{averageTOF,12:0.0000000000}" + + $"{Environment.NewLine}"); + } + + public void StopMessuring() + { + this.ProcessRecords -= this.AutomaticTemperatureCalibration_ProcessRecords; + this.temperatureSource?.Dispose(); + this.temperatureSource = null; + + if (this.temperatureWatcher != null) + { + this.temperatureWatcher.Elapsed -= this.TemperatureWatcher_Elapsed; + + this.temperatureWatcher.Stop(); + this.temperatureWatcher.Dispose(); + this.temperatureWatcher = null; } + + if (this.stopWatcher != null) + { + this.stopWatcher.Stop(); + this.stopWatcher.Dispose(); + this.stopWatcher = null; + } + } + + internal void StartBackward() + { + this.temperatureSource = new TemperatureSource(); + this.temperatureWatcher = new Timer(Appsettings.TemperatureChecksSec * 1000) + { + Enabled = true, + AutoReset = true + }; + + this.temperatureWatcher.Elapsed += this.TemperatureWatcher_Elapsed_Backwards; + this.temperatureWatcher.Start(); + + // TODO: backwards calibration + } + + private void TemperatureWatcher_Elapsed_Backwards(object _, ElapsedEventArgs _1) + { + var currentC = double.MinValue; + + this.tempMeterForm.Invoke(new Action(() => + { + currentC = this.temperatureSource.GetTemperature(); + })); + + var averageTOF = this.tempMeterForm + .GetMessurements() + .GroupBy(x => Math.Round(x, 6)) + .OrderByDescending(x => x.Count()) + .FirstOrDefault() + .AsEnumerable() + .Distinct() + .Average(); + + File.AppendAllText(this.backwardsFile + , $"{currentC,4:00.00}\t" + + $"{averageTOF,12:0.0000000000}" + + $"{Environment.NewLine}"); + + this.tempMeterForm?.StartRecording(); } private String GetOrCreateFile(string pcbId, string fileBase) @@ -535,44 +583,6 @@ return pcbs; } - internal void StartBackward() - { - this.temperatureSource = new TemperatureSource(); - this.shortTimer = new Timer(Appsettings.BackwardsStepMs) - { - Enabled = true, - AutoReset = true - }; - this.shortTimer.Elapsed += this.BackwardsElapsed; - this.shortTimer.Start(); - } - - private void BackwardsElapsed(object sender, ElapsedEventArgs args) - { - this.tempMeterForm.BeginInvoke(new Action(() => - { - var messurement = !this.TryGetTOFandT(out double currentTOF, out double currentT) - ? $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t invalid record (TOF: {currentTOF} & T: {currentT})" - : $"[{args.SignalTime:yyyy-MM-dd hh:mm:ss}]\t{this.pcbId,9}\t{currentT,5:00.00}\t{currentTOF,14:0.000000000000}"; - - this.tempMeterForm.AddMessage(messurement); - File.AppendAllLines(this.backwardsFile, new[] { messurement }); - })); - } - - private bool TryGetTOFandT(out double actualTOF, out double actualT) - { - actualTOF = this.tempMeterForm.AvgTOF(); - actualT = this.temperatureSource.GetTemperature(); - - if (actualTOF >= 1 || actualT <= double.MinValue) - { - return false; - } - - return true; - } - internal IEnumerable AvailableCheckPcbs() => Directory .CreateDirectory(WORKING_DIR) @@ -779,4 +789,23 @@ public static string Header => $"Pcb Id\tMin °C\tMin TOF\tAvg °C\tAvg TOF\tMax °C\tMax TOF\tDif °C\tDif TOF\tCount"; } -} \ No newline at end of file +} + +//// ..1 2 3 4 5 6 7 8 9 10 +//// 0.0 0 0 9 2[4 5 2]3 1 +//for (int i = 8; i >= 6; i--) +//{ +// // 8. Alle grupiert bei 0.00092[452] => wird die gruppe mit größte anzahl an tofs gennohmen +// // 7. Alle grupiert bei 0.00092[450] => wird die gruppe mit größte anzahl an tofs gennohmen +// // 6. Alle grupiert bei 0.00092[400] => wird die gruppe mit größte anzahl an tofs gennohmen +// var maxTOFs = messurements +// .GroupBy(x => Math.Round(x, i)) +// .OrderByDescending(x => x.Count()) +// .FirstOrDefault() +// .AsEnumerable(); + +// aggregations.AddRange(maxTOFs); +//} + + +//var averageTOF = aggregations.Distinct().Average(); \ No newline at end of file diff --git a/LaaProductionWeb/LaaProduction.Services/Models/Search/SearchWildcardModel.cs b/LaaProductionWeb/LaaProduction.Services/Models/Search/SearchWildcardModel.cs index a5ca3c6e..0638866c 100644 --- a/LaaProductionWeb/LaaProduction.Services/Models/Search/SearchWildcardModel.cs +++ b/LaaProductionWeb/LaaProduction.Services/Models/Search/SearchWildcardModel.cs @@ -6,11 +6,34 @@ public class SearchWildcardModel { [Display(Name = "Radioadress | PcbId | SerienNr | KundenSerienNr")] - public string Token { get; set; } + public virtual string Token { get; set; } [Display(Name = "Select fields")] - public IDictionary Fields { get; set; } + public virtual IDictionary Fields { get; set; } - public IEnumerable> Results { get; set; } + public virtual IEnumerable> Results { get; set; } + } + + public class SearchPasswordsModel : SearchWildcardModel + { + [Display(Name = "Radioadress | PcbId | SerienNr | KundenSerienNr")] + public override string Token + { + get => base.Token; + set => base.Token = value; + } + + [Display(Name = "Select fields")] + public override IDictionary Fields + { + get => base.Fields; + set => base.Fields = value; + } + + public override IEnumerable> Results + { + get => base.Results; + set => base.Results = value; + } } } \ No newline at end of file diff --git a/LaaProductionWeb/LaaProductionWeb/2023_11_02.debug b/LaaProductionWeb/LaaProductionWeb/2023_11_02.debug new file mode 100644 index 00000000..e69de29b diff --git a/LaaProductionWeb/LaaProductionWeb/App_Content/css/styles.css b/LaaProductionWeb/LaaProductionWeb/App_Content/css/styles.css index 0781785b..802e3792 100644 --- a/LaaProductionWeb/LaaProductionWeb/App_Content/css/styles.css +++ b/LaaProductionWeb/LaaProductionWeb/App_Content/css/styles.css @@ -332,3 +332,8 @@ td .field-validation-error { position: absolute !important; bottom: 0 !important; } + +.th-sticky { + position: sticky; + top: 70px; +} diff --git a/LaaProductionWeb/LaaProductionWeb/Controllers/SearchController.cs b/LaaProductionWeb/LaaProductionWeb/Controllers/SearchController.cs index 6b79aad1..2f2b682e 100644 --- a/LaaProductionWeb/LaaProductionWeb/Controllers/SearchController.cs +++ b/LaaProductionWeb/LaaProductionWeb/Controllers/SearchController.cs @@ -64,7 +64,7 @@ { if (fieldsResult.Value != null) { - model.Fields = fieldsResult.Value.ToDictionary(x => x, x => false); + model.Fields = fieldsResult.Value.ToDictionary(x => x, x => true); } } else @@ -103,5 +103,60 @@ return this.View(model); } + + [HttpGet] + [AllowedRoles(EmployeesRoles.WEB_API)] + public async Task Passwords() + { + var fieldsResult = await this.httpClient + .Get("/Search/Wildcard") + .AuthorizeBearer(this.User.GetNameIdentifier()) + .SendAsync>(); + + var model = new SearchPasswordsModel(); + + if (fieldsResult.Succeeded) + { + if (fieldsResult.Value != null) + { + model.Fields = fieldsResult.Value.ToDictionary(x => x, x => true); + } + } + else + { + this.ModelState.AddModelErrors(fieldsResult); + } + + return this.View(model); + } + + [HttpPost] + [AllowedRoles(EmployeesRoles.WEB_API)] + public async Task Passwords(SearchPasswordsModel model) + { + var fields = string.Empty; + + if (model.Fields.Any(x => x.Value)) + { + fields = WebUtility.UrlEncode(string.Join(",", model.Fields.Where(x => x.Value).Select(x => x.Key))); + } + + var httpResult = await this.httpClient + .Post($"/Search/Wildcard") + .WhitJsonBody(new { model.Token, fields }) + .AuthorizeBearer(this.User.GetNameIdentifier()) + .SendAsync>>(); + + if (httpResult.Succeeded) + { + model.Results = httpResult.Value ?? Array.Empty>(); + } + else + { + this.ModelState.AddModelErrors(httpResult); + } + + return this.View(model); + } } } \ No newline at end of file diff --git a/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj b/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj index cfdc92b4..98346ec5 100644 --- a/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj +++ b/LaaProductionWeb/LaaProductionWeb/LaaProductionWeb.csproj @@ -293,6 +293,7 @@ + diff --git a/LaaProductionWeb/LaaProductionWeb/Views/Search/Passwords.cshtml b/LaaProductionWeb/LaaProductionWeb/Views/Search/Passwords.cshtml new file mode 100644 index 00000000..403817e9 --- /dev/null +++ b/LaaProductionWeb/LaaProductionWeb/Views/Search/Passwords.cshtml @@ -0,0 +1,84 @@ +@model LaaProduction.Services.Models.Search.SearchPasswordsModel + +
+
+
+
+ @this.Html.LabelFor(x => x.Fields, new { @for = "serial_nr", @class = "text-smallcaps fw-bold" }) +
+ @if (this.Model.Fields != null) + { +
+ @foreach (var fieldKVP in this.Model.Fields) + { + var key = fieldKVP.Key; + var value = fieldKVP.Value; + var id = $"Fields_{key}"; + var name = $"Fields[{key}]"; + +
+ @this.Html.CheckBox(name, value, new { @class = "form-check-input", id }) + @this.Html.Label(key, new { @class = "form-check-label text-smallcaps", @for = id }) +
+ } +
+ } +
+
+ @this.Html.ValidationSummary() +
+
+
+
+
+ @this.Html.TextBoxFor(x => x.Token, new { id = "serial_nr", @class = "form-control", placeholder = "0000000000" }) + @this.Html.LabelFor(x => x.Token, new { @for = "serial_nr", @class = "opacity-50 text-smallcaps bi bi-search ps-4" }) +
+ +
+ @this.Html.ValidationMessageFor(x => x.Token, string.Empty, new { @class = "small text-danger mt-0" }) +
+
+
+
+
+
+ @if (this.Model.Results != null) + { + var headers = this.Model.Results.FirstOrDefault()?.Keys ?? Array.Empty(); + + + + + @foreach (var header in headers) + { + + } + + + + @if (this.Model.Results.Any()) + { + foreach (var data in this.Model.Results) + { + + @foreach (var value in data.Values) + { + + } + + } + } + else if (this.IsPost) + { + + + + } + +
@header
@value
Keine ergebnisse gefunden for '@this.Model.Token'
+ } +
+
+
+
diff --git a/LaaProductionWeb/LaaProductionWeb/Views/Shared/_Layout.cshtml b/LaaProductionWeb/LaaProductionWeb/Views/Shared/_Layout.cshtml index 642d1336..a4b3198a 100644 --- a/LaaProductionWeb/LaaProductionWeb/Views/Shared/_Layout.cshtml +++ b/LaaProductionWeb/LaaProductionWeb/Views/Shared/_Layout.cshtml @@ -64,6 +64,12 @@ Prüfmittel } + @if (this.User.IsInRole(EmployeesRoles.WEB_API)) + { + + }