next backup
This commit is contained in:
parent
c2816c92cf
commit
19985eb084
1
.idea/.idea.TBF/.idea/.name
Normal file
1
.idea/.idea.TBF/.idea/.name
Normal file
@ -0,0 +1 @@
|
||||
TBF
|
||||
22
.idea/.idea.TBF/.idea/dataSources.local.xml
Normal file
22
.idea/.idea.TBF/.idea/dataSources.local.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="dataSourceStorageLocal" created-in="RD-241.19072.26">
|
||||
<data-source name="@localhost" uuid="2f1012d5-a96b-44db-ad21-032f973c657f">
|
||||
<database-info product="MySQL" version="5.5.39" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="5.5.39" exact-driver-version="8.2">
|
||||
<extra-name-characters>#@</extra-name-characters>
|
||||
<identifier-quote-string>`</identifier-quote-string>
|
||||
</database-info>
|
||||
<case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
|
||||
<user-name>root</user-name>
|
||||
<schema-mapping>
|
||||
<introspection-scope>
|
||||
<node kind="schema">
|
||||
<name qname="@" />
|
||||
<name qname="jor" />
|
||||
<name qname="jor-r" />
|
||||
</node>
|
||||
</introspection-scope>
|
||||
</schema-mapping>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/.idea.TBF/.idea/dataSources.xml
Normal file
13
.idea/.idea.TBF/.idea/dataSources.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="@localhost" uuid="2f1012d5-a96b-44db-ad21-032f973c657f">
|
||||
<driver-ref>mysql.8</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<configured-by-url>true</configured-by-url>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,2 @@
|
||||
#n:information_schema
|
||||
!<md> [null, 0, null, null, -2147483648, -2147483648]
|
||||
@ -0,0 +1,2 @@
|
||||
#n:jor-r
|
||||
!<md> [0, 0, null, null, -2147483648, -2147483648]
|
||||
@ -0,0 +1,2 @@
|
||||
#n:jor
|
||||
!<md> [0, 0, null, null, -2147483648, -2147483648]
|
||||
@ -0,0 +1,2 @@
|
||||
#n:mysql
|
||||
!<md> [null, 0, null, null, -2147483648, -2147483648]
|
||||
@ -0,0 +1,2 @@
|
||||
#n:performance_schema
|
||||
!<md> [null, 0, null, null, -2147483648, -2147483648]
|
||||
8
.idea/.idea.TBF/.idea/indexLayout.xml
Normal file
8
.idea/.idea.TBF/.idea/indexLayout.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.TBF/.idea/projectSettingsUpdater.xml
Normal file
6
.idea/.idea.TBF/.idea/projectSettingsUpdater.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="vcsConfiguration" value="2" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,4 @@
|
||||
<changelist name="Add_combo_box_for_box_input" date="1723454080052" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Add_combo_box_for_box_input/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Add combo box for box input" />
|
||||
</changelist>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
<changelist name="AdjustableMeterTest_cs_unit_Test" date="1708186855829" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/AdjustableMeterTest_cs_unit_Test/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="AdjustableMeterTest.cs unit Test" />
|
||||
</changelist>
|
||||
@ -0,0 +1,97 @@
|
||||
Index: TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs b/TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1706131720128)
|
||||
+++ b/TBFTests/Rig/Modbus/Meret/AdjustableScale/AdjustableMeterTest.cs (date 1706131720128)
|
||||
@@ -0,0 +1,86 @@
|
||||
+using System;
|
||||
+using System.Collections.Generic;
|
||||
+using Config.Entities;
|
||||
+using JetBrains.Annotations;
|
||||
+using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
+using TBF.Rig.Modbus.Meret.AdjustableScale;
|
||||
+
|
||||
+namespace TBFTests.Rig.Modbus.Meret.AdjustableScale
|
||||
+{
|
||||
+ [TestClass]
|
||||
+ [TestSubject(typeof(AdjustableMeter))]
|
||||
+ public class AdjustableMeterTest
|
||||
+ {
|
||||
+
|
||||
+ /**
|
||||
+ * new typ of linear correction - limit less from Hi
|
||||
+ */
|
||||
+ [TestMethod]
|
||||
+ public void GetCorrection()
|
||||
+ {
|
||||
+
|
||||
+ double rawValue, expectedVal;
|
||||
+ IList<MeasurementCorrection> corrections;
|
||||
+
|
||||
+ corrections = new List<MeasurementCorrection>(2);
|
||||
+ MeasurementCorrection Lo, Hi;
|
||||
+ Lo = new MeasurementCorrection(1);
|
||||
+ Lo.Measurement = 0.00; //CorrectionValLo;
|
||||
+ Lo.Correction = 0.0F; //MsrdValLimLo;
|
||||
+ corrections.Add(Lo);
|
||||
+ Hi = new MeasurementCorrection(2);
|
||||
+ Hi.Measurement = 0.22F;//CorrectionValHi;
|
||||
+ Hi.Correction = 2.0F;//MsrdValLimHi;
|
||||
+ corrections.Add(Hi);
|
||||
+
|
||||
+
|
||||
+ expectedVal = Lo.Correction;
|
||||
+ rawValue = Lo.Measurement; //Ampers
|
||||
+
|
||||
+ double CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
|
||||
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
|
||||
+ Assert.IsTrue(expectedVal == CorrectionVal);
|
||||
+
|
||||
+ expectedVal = Hi.Correction;
|
||||
+ rawValue = Hi.Measurement; //Ampers
|
||||
+
|
||||
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
|
||||
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
|
||||
+ Assert.IsTrue(expectedVal == CorrectionVal);
|
||||
+
|
||||
+ double toler = 0.01;
|
||||
+ expectedVal = Hi.Correction * 2.0;
|
||||
+ rawValue = Hi.Measurement * 2.0; //Ampers
|
||||
+
|
||||
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
|
||||
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
|
||||
+ Assert.IsTrue((expectedVal + toler) >= CorrectionVal && (expectedVal - toler) <= CorrectionVal);
|
||||
+
|
||||
+ corrections = new List<MeasurementCorrection>(2);
|
||||
+ Lo = new MeasurementCorrection(1);
|
||||
+ Lo.Measurement = 0.04; //CorrectionValLo;
|
||||
+ Lo.Correction = 0.0F; //MsrdValLimLo;
|
||||
+ corrections.Add(Lo);
|
||||
+ Hi = new MeasurementCorrection(2);
|
||||
+ Hi.Measurement = 0.22F;//CorrectionValHi;
|
||||
+ Hi.Correction = 2.0F;//MsrdValLimHi;
|
||||
+ corrections.Add(Hi);
|
||||
+
|
||||
+ toler = 0.3;
|
||||
+ expectedVal = 1.24; //bar
|
||||
+ rawValue = 0.152; //Ampers
|
||||
+
|
||||
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
|
||||
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
|
||||
+ Assert.IsTrue((expectedVal + toler) >= CorrectionVal && (expectedVal - toler) <= CorrectionVal);
|
||||
+
|
||||
+ toler = 0.0001;
|
||||
+ expectedVal = 1.0;
|
||||
+ rawValue = Lo.Measurement + ((Hi.Measurement - Lo.Measurement) / 2.0); //Ampers 0.129999999403954
|
||||
+
|
||||
+ CorrectionVal = AdjustableMeter.GetCorrectionLimitLessHi(rawValue, corrections);
|
||||
+ Console.WriteLine("{0} Correction - rawValue: {1} CorrectionVal: {2}", "TEST " + rawValue, rawValue, CorrectionVal);
|
||||
+ Assert.IsTrue((expectedVal + toler) >= CorrectionVal && (expectedVal - toler) <= CorrectionVal);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
4
.idea/.idea.TBF/.idea/shelf/DB_test_-_purchase_order.xml
Normal file
4
.idea/.idea.TBF/.idea/shelf/DB_test_-_purchase_order.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<changelist name="DB_test_-_purchase_order" date="1725258409183" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/DB_test_-_purchase_order/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="DB test - purchase order" />
|
||||
</changelist>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
<changelist name="Frequency_Meter_From_UniCB" date="1708416562473" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Frequency_Meter_From_UniCB/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Frequency Meter From UniCB" />
|
||||
</changelist>
|
||||
@ -0,0 +1,687 @@
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1708352606823)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfg.cs (date 1708352606823)
|
||||
@@ -0,0 +1,51 @@
|
||||
+using System.Collections.Generic;
|
||||
+using System.Xml.Serialization;
|
||||
+using Common;
|
||||
+using Config.Entities;
|
||||
+using TBF.Rig.Generic;
|
||||
+
|
||||
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
|
||||
+{
|
||||
+ public class RRCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
+ {
|
||||
+
|
||||
+ public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRCfg) })[0];
|
||||
+ public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
+
|
||||
+ IComponentCfgCtrl IComponentCfg.GetControl(IList<Component> cmpntEntities) { return new RRCfgCtrl(); }
|
||||
+
|
||||
+ ///
|
||||
+ /// Serialized parameters
|
||||
+ ///
|
||||
+ public int Position; /// 1..nrWaterMeters
|
||||
+
|
||||
+ /// <summary> Procedure parameters </summary>
|
||||
+ [XmlIgnore]
|
||||
+ public RRProcParams ProcParams;
|
||||
+ public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
|
||||
+ public override IParamsProvider CreateProcParamsProvider() { return new RRProcParams(true); }
|
||||
+
|
||||
+ /// Private parameterless constructor invoked by all other (public) constructors
|
||||
+ RRCfg()
|
||||
+ {
|
||||
+ ProcParams = new RRProcParams(true);
|
||||
+ }
|
||||
+
|
||||
+ public RRCfg(string name, IComponentFactory factory)
|
||||
+ : this()
|
||||
+ {
|
||||
+ Name = name;
|
||||
+ Factory = factory;
|
||||
+ ParentName = "UniCB";
|
||||
+ Position = 1;
|
||||
+ }
|
||||
+
|
||||
+ string IComponentCfg.ToString(int i)
|
||||
+ {
|
||||
+ return string.Format("Name={0}, Parent={1}, Position={2}",
|
||||
+ Name,
|
||||
+ (string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
||||
+ Position);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1708352608817)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.cs (date 1708352608817)
|
||||
@@ -0,0 +1,106 @@
|
||||
+///
|
||||
+/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
+///
|
||||
+using System;
|
||||
+using System.Windows.Forms;
|
||||
+using Common;
|
||||
+using TBF.Rig.Generic;
|
||||
+using TBF.UI.Bench.Components;
|
||||
+
|
||||
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
|
||||
+{
|
||||
+ public partial class RRCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
+ {
|
||||
+ ComponentParametersDlg parent;
|
||||
+
|
||||
+ bool IComponentCfgCtrl.ShowMore { get { return false; } }
|
||||
+
|
||||
+ RRCfg config;
|
||||
+
|
||||
+ IComponentCfg IComponentCfgCtrl.Config
|
||||
+ {
|
||||
+ get { return config as IComponentCfg; }
|
||||
+ set
|
||||
+ {
|
||||
+ config = value as RRCfg;
|
||||
+ Redraw();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public RRCfgCtrl()
|
||||
+ {
|
||||
+ InitializeComponent();
|
||||
+ }
|
||||
+
|
||||
+ private void RegisterReaderCfgCtrl_Load(object sender, EventArgs e)
|
||||
+ {
|
||||
+ parent = ParentForm as ComponentParametersDlg;
|
||||
+ if (parent == null) return;
|
||||
+
|
||||
+ if (parent.CmpntEntities != null)
|
||||
+ {
|
||||
+ foreach (var cmpnt in parent.CmpntEntities)
|
||||
+ {
|
||||
+ if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is ControlBoard.Uni.Factory)
|
||||
+ {
|
||||
+ parentNameComboBox.Items.Add(cmpnt.Name);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ Redraw();
|
||||
+ }
|
||||
+
|
||||
+ void IComponentCfgCtrl.Closing()
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ void Redraw()
|
||||
+ {
|
||||
+ if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
+
|
||||
+ componentNameLabel.Text = config.Factory.ClassName;
|
||||
+ nameTextBox.Text = config.Name;
|
||||
+ parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
|
||||
+ positionTextBox.Text = config.Position.ToString();
|
||||
+ }
|
||||
+
|
||||
+ void IComponentCfgCtrl.Unlock()
|
||||
+ {
|
||||
+ nameTextBox.Enabled = true;
|
||||
+ parentNameComboBox.Enabled = true;
|
||||
+ positionTextBox.Enabled = true;
|
||||
+ }
|
||||
+
|
||||
+ CfgUpdateFlags IComponentCfgCtrl.VerifyCfg(ref string message)
|
||||
+ {
|
||||
+ CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
+
|
||||
+ int dummy;
|
||||
+ if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
|
||||
+ {
|
||||
+ flags |= CfgUpdateFlags.Error;
|
||||
+ message += Environment.NewLine + "Invalid 'Parent Name'";
|
||||
+ }
|
||||
+ if (!int.TryParse(positionTextBox.Text, out dummy) || (dummy < 1))
|
||||
+ {
|
||||
+ flags |= CfgUpdateFlags.Error;
|
||||
+ message += Environment.NewLine + "'Position' should be >= 1";
|
||||
+ }
|
||||
+ return flags;
|
||||
+ }
|
||||
+
|
||||
+ CfgUpdateFlags IComponentCfgCtrl.UpdateCfg()
|
||||
+ {
|
||||
+ CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
|
||||
+
|
||||
+ if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
+
|
||||
+ config.Name = nameTextBox.Text;
|
||||
+ config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
|
||||
+ config.Position = int.Parse(positionTextBox.Text);
|
||||
+
|
||||
+ return flags;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1708348624609)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.designer.cs (date 1708348624609)
|
||||
@@ -0,0 +1,133 @@
|
||||
+///
|
||||
+/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
+///
|
||||
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
|
||||
+{
|
||||
+ partial class RRCfgCtrl
|
||||
+ {
|
||||
+ /// <summary>
|
||||
+ /// Required designer variable.
|
||||
+ /// </summary>
|
||||
+ private System.ComponentModel.IContainer components = null;
|
||||
+
|
||||
+ /// <summary>
|
||||
+ /// Clean up any resources being used.
|
||||
+ /// </summary>
|
||||
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
+ protected override void Dispose(bool disposing)
|
||||
+ {
|
||||
+ if (disposing && (components != null))
|
||||
+ {
|
||||
+ components.Dispose();
|
||||
+ }
|
||||
+ base.Dispose(disposing);
|
||||
+ }
|
||||
+
|
||||
+ #region Component Designer generated code
|
||||
+
|
||||
+ /// <summary>
|
||||
+ /// Required method for Designer support - do not modify
|
||||
+ /// the contents of this method with the code editor.
|
||||
+ /// </summary>
|
||||
+ private void InitializeComponent()
|
||||
+ {
|
||||
+ this.positionTextBox = new System.Windows.Forms.TextBox();
|
||||
+ this.positionLabel = new System.Windows.Forms.Label();
|
||||
+ this.parentNameLabel = new System.Windows.Forms.Label();
|
||||
+ this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
+ this.nameLabel = new System.Windows.Forms.Label();
|
||||
+ this.componentNameLabel = new System.Windows.Forms.Label();
|
||||
+ this.parentNameComboBox = new System.Windows.Forms.ComboBox();
|
||||
+ this.SuspendLayout();
|
||||
+ //
|
||||
+ // positionTextBox
|
||||
+ //
|
||||
+ this.positionTextBox.Enabled = false;
|
||||
+ this.positionTextBox.Location = new System.Drawing.Point(136, 119);
|
||||
+ this.positionTextBox.Name = "positionTextBox";
|
||||
+ this.positionTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
+ this.positionTextBox.TabIndex = 6;
|
||||
+ //
|
||||
+ // positionLabel
|
||||
+ //
|
||||
+ this.positionLabel.AutoSize = true;
|
||||
+ this.positionLabel.Location = new System.Drawing.Point(26, 122);
|
||||
+ this.positionLabel.Name = "positionLabel";
|
||||
+ this.positionLabel.Size = new System.Drawing.Size(44, 13);
|
||||
+ this.positionLabel.TabIndex = 5;
|
||||
+ this.positionLabel.Text = "Position";
|
||||
+ //
|
||||
+ // parentNameLabel
|
||||
+ //
|
||||
+ this.parentNameLabel.AutoSize = true;
|
||||
+ this.parentNameLabel.Location = new System.Drawing.Point(26, 96);
|
||||
+ this.parentNameLabel.Name = "parentNameLabel";
|
||||
+ this.parentNameLabel.Size = new System.Drawing.Size(69, 13);
|
||||
+ this.parentNameLabel.TabIndex = 3;
|
||||
+ this.parentNameLabel.Text = "Parent Name";
|
||||
+ //
|
||||
+ // nameTextBox
|
||||
+ //
|
||||
+ this.nameTextBox.Enabled = false;
|
||||
+ this.nameTextBox.Location = new System.Drawing.Point(136, 67);
|
||||
+ this.nameTextBox.Name = "nameTextBox";
|
||||
+ this.nameTextBox.Size = new System.Drawing.Size(130, 20);
|
||||
+ this.nameTextBox.TabIndex = 2;
|
||||
+ //
|
||||
+ // nameLabel
|
||||
+ //
|
||||
+ this.nameLabel.AutoSize = true;
|
||||
+ this.nameLabel.Location = new System.Drawing.Point(26, 70);
|
||||
+ this.nameLabel.Name = "nameLabel";
|
||||
+ this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
+ this.nameLabel.TabIndex = 1;
|
||||
+ this.nameLabel.Text = "Name";
|
||||
+ //
|
||||
+ // componentNameLabel
|
||||
+ //
|
||||
+ this.componentNameLabel.AutoSize = true;
|
||||
+ this.componentNameLabel.Location = new System.Drawing.Point(133, 43);
|
||||
+ this.componentNameLabel.Name = "componentNameLabel";
|
||||
+ this.componentNameLabel.Size = new System.Drawing.Size(83, 13);
|
||||
+ this.componentNameLabel.TabIndex = 0;
|
||||
+ this.componentNameLabel.Text = "ComonentName";
|
||||
+ //
|
||||
+ // parentNameComboBox
|
||||
+ //
|
||||
+ this.parentNameComboBox.Enabled = false;
|
||||
+ this.parentNameComboBox.FormattingEnabled = true;
|
||||
+ this.parentNameComboBox.Location = new System.Drawing.Point(136, 93);
|
||||
+ this.parentNameComboBox.Name = "parentNameComboBox";
|
||||
+ this.parentNameComboBox.Size = new System.Drawing.Size(130, 21);
|
||||
+ this.parentNameComboBox.TabIndex = 4;
|
||||
+ //
|
||||
+ // RegisterReaderCfgCtrl
|
||||
+ //
|
||||
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
+ this.Controls.Add(this.parentNameComboBox);
|
||||
+ this.Controls.Add(this.positionTextBox);
|
||||
+ this.Controls.Add(this.positionLabel);
|
||||
+ this.Controls.Add(this.parentNameLabel);
|
||||
+ this.Controls.Add(this.nameTextBox);
|
||||
+ this.Controls.Add(this.nameLabel);
|
||||
+ this.Controls.Add(this.componentNameLabel);
|
||||
+ this.Name = "RegisterReaderCfgCtrl";
|
||||
+ this.Size = new System.Drawing.Size(300, 200);
|
||||
+ this.Load += new System.EventHandler(this.RegisterReaderCfgCtrl_Load);
|
||||
+ this.ResumeLayout(false);
|
||||
+ this.PerformLayout();
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ #endregion
|
||||
+
|
||||
+ private System.Windows.Forms.TextBox positionTextBox;
|
||||
+ private System.Windows.Forms.Label positionLabel;
|
||||
+ private System.Windows.Forms.Label parentNameLabel;
|
||||
+ private System.Windows.Forms.TextBox nameTextBox;
|
||||
+ private System.Windows.Forms.Label nameLabel;
|
||||
+ private System.Windows.Forms.Label componentNameLabel;
|
||||
+ private System.Windows.Forms.ComboBox parentNameComboBox;
|
||||
+ }
|
||||
+}
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1703243321441)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRCfgCtrl.resx (date 1703243321441)
|
||||
@@ -0,0 +1,120 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<root>
|
||||
+ <!--
|
||||
+ Microsoft ResX Schema
|
||||
+
|
||||
+ Version 2.0
|
||||
+
|
||||
+ The primary goals of this format is to allow a simple XML format
|
||||
+ that is mostly human readable. The generation and parsing of the
|
||||
+ various data types are done through the TypeConverter classes
|
||||
+ associated with the data types.
|
||||
+
|
||||
+ Example:
|
||||
+
|
||||
+ ... ado.net/XML headers & schema ...
|
||||
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
+ <resheader name="version">2.0</resheader>
|
||||
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
+ </data>
|
||||
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
+ <comment>This is a comment</comment>
|
||||
+ </data>
|
||||
+
|
||||
+ There are any number of "resheader" rows that contain simple
|
||||
+ name/value pairs.
|
||||
+
|
||||
+ Each data row contains a name, and value. The row also contains a
|
||||
+ type or mimetype. Type corresponds to a .NET class that support
|
||||
+ text/value conversion through the TypeConverter architecture.
|
||||
+ Classes that don't support this are serialized and stored with the
|
||||
+ mimetype set.
|
||||
+
|
||||
+ The mimetype is used for serialized objects, and tells the
|
||||
+ ResXResourceReader how to depersist the object. This is currently not
|
||||
+ extensible. For a given mimetype the value must be set accordingly:
|
||||
+
|
||||
+ Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
+ that the ResXResourceWriter will generate, however the reader can
|
||||
+ read any of the formats listed below.
|
||||
+
|
||||
+ mimetype: application/x-microsoft.net.object.binary.base64
|
||||
+ value : The object must be serialized with
|
||||
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
+ : and then encoded with base64 encoding.
|
||||
+
|
||||
+ mimetype: application/x-microsoft.net.object.soap.base64
|
||||
+ value : The object must be serialized with
|
||||
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
+ : and then encoded with base64 encoding.
|
||||
+
|
||||
+ mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
+ value : The object must be serialized into a byte array
|
||||
+ : using a System.ComponentModel.TypeConverter
|
||||
+ : and then encoded with base64 encoding.
|
||||
+ -->
|
||||
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
+ <xsd:element name="root" msdata:IsDataSet="true">
|
||||
+ <xsd:complexType>
|
||||
+ <xsd:choice maxOccurs="unbounded">
|
||||
+ <xsd:element name="metadata">
|
||||
+ <xsd:complexType>
|
||||
+ <xsd:sequence>
|
||||
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
+ </xsd:sequence>
|
||||
+ <xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
+ <xsd:attribute name="type" type="xsd:string" />
|
||||
+ <xsd:attribute name="mimetype" type="xsd:string" />
|
||||
+ <xsd:attribute ref="xml:space" />
|
||||
+ </xsd:complexType>
|
||||
+ </xsd:element>
|
||||
+ <xsd:element name="assembly">
|
||||
+ <xsd:complexType>
|
||||
+ <xsd:attribute name="alias" type="xsd:string" />
|
||||
+ <xsd:attribute name="name" type="xsd:string" />
|
||||
+ </xsd:complexType>
|
||||
+ </xsd:element>
|
||||
+ <xsd:element name="data">
|
||||
+ <xsd:complexType>
|
||||
+ <xsd:sequence>
|
||||
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
+ </xsd:sequence>
|
||||
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
+ <xsd:attribute ref="xml:space" />
|
||||
+ </xsd:complexType>
|
||||
+ </xsd:element>
|
||||
+ <xsd:element name="resheader">
|
||||
+ <xsd:complexType>
|
||||
+ <xsd:sequence>
|
||||
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
+ </xsd:sequence>
|
||||
+ <xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
+ </xsd:complexType>
|
||||
+ </xsd:element>
|
||||
+ </xsd:choice>
|
||||
+ </xsd:complexType>
|
||||
+ </xsd:element>
|
||||
+ </xsd:schema>
|
||||
+ <resheader name="resmimetype">
|
||||
+ <value>text/microsoft-resx</value>
|
||||
+ </resheader>
|
||||
+ <resheader name="version">
|
||||
+ <value>2.0</value>
|
||||
+ </resheader>
|
||||
+ <resheader name="reader">
|
||||
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
+ </resheader>
|
||||
+ <resheader name="writer">
|
||||
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
+ </resheader>
|
||||
+</root>
|
||||
\ No newline at end of file
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1708352610233)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/RRProcParams.cs (date 1708352610233)
|
||||
@@ -0,0 +1,132 @@
|
||||
+///
|
||||
+/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
+///
|
||||
+using System;
|
||||
+using System.IO;
|
||||
+using System.Text;
|
||||
+using System.Xml.Serialization;
|
||||
+using Common;
|
||||
+using Config.Entities;
|
||||
+using TBF.Rig.Generic;
|
||||
+using TBF.Resources;
|
||||
+
|
||||
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
|
||||
+{
|
||||
+ public class RRProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
|
||||
+ {
|
||||
+ public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcParams) })[0];
|
||||
+ public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
+
|
||||
+ public double PulsesPerLtr; /// [l^-1]
|
||||
+ public int Filter;
|
||||
+
|
||||
+ public override void InitializeAll()
|
||||
+ {
|
||||
+ PulsesPerLtr = 1.0;
|
||||
+ Filter = 0;
|
||||
+ }
|
||||
+
|
||||
+ string[] paramNames = new string[]
|
||||
+ {
|
||||
+ Strings.PulsesPerLtr,
|
||||
+ Strings.Filter,
|
||||
+ };
|
||||
+ public override string ParamName(int i) { return paramNames[i]; }
|
||||
+ public override int ParamsCount() { return paramNames.Length; }
|
||||
+
|
||||
+ public override string ToString(int i)
|
||||
+ {
|
||||
+ switch (i)
|
||||
+ {
|
||||
+ case 0: return PulsesPerLtr.ToString();
|
||||
+ case 1: return Filter.ToString();
|
||||
+ default: return string.Empty;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /// Retrieves parameters from UI controls
|
||||
+ CfgUpdateFlags IParamsProvider.UpdateParam(int i, string strValue)
|
||||
+ {
|
||||
+ switch (i)
|
||||
+ {
|
||||
+ case 0: PulsesPerLtr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.None;
|
||||
+ case 1: Filter = int.Parse(strValue); return CfgUpdateFlags.None;
|
||||
+ default: return CfgUpdateFlags.None;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /// Verifies whether strings in UI controls represent valid parameters
|
||||
+ bool IParamsProvider.ValidateParam(int i, string strValue, out string message)
|
||||
+ {
|
||||
+ message = string.Empty;
|
||||
+
|
||||
+ double dummy;
|
||||
+ int idummy;
|
||||
+ switch (i)
|
||||
+ {
|
||||
+ case 0:
|
||||
+ if (Utils.TryParseUDouble(strValue, out dummy)) return true;
|
||||
+ break;
|
||||
+
|
||||
+ case 1:
|
||||
+ if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ message = "Invalid index";
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ message = ParamName(i) + " is invalid";
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ void CopyContentTo(RRProcParams prms)
|
||||
+ {
|
||||
+ prms.PulsesPerLtr = this.PulsesPerLtr;
|
||||
+ prms.Filter = this.Filter;
|
||||
+ }
|
||||
+
|
||||
+ IParamsProvider IParamsProvider.Clone()
|
||||
+ {
|
||||
+ RRProcParams pars = new RRProcParams();
|
||||
+ CopyContentTo(pars);
|
||||
+ return pars;
|
||||
+ }
|
||||
+
|
||||
+ public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
|
||||
+ {
|
||||
+ if (dbEntity == null) return;
|
||||
+ try
|
||||
+ {
|
||||
+ RRProcParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as RRProcParams;
|
||||
+
|
||||
+ procedureParamsEntity = dbEntity;
|
||||
+ componentName = dbEntity.CmpntName;
|
||||
+ procedure = dbEntity.Procedure;
|
||||
+
|
||||
+ if (tmp != null) tmp.CopyContentTo(this);
|
||||
+ }
|
||||
+ catch
|
||||
+ {
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ public RRProcParams()
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ public RRProcParams(bool initialize)
|
||||
+ {
|
||||
+ if (initialize) InitializeAll();
|
||||
+ }
|
||||
+
|
||||
+ public RRProcParams(ComponentProcedure procedureParamsEntity, string componentName, Procedure procedure)
|
||||
+ {
|
||||
+ this.procedureParamsEntity = procedureParamsEntity;
|
||||
+ this.componentName = componentName;
|
||||
+ this.procedure = procedure;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1708352610236)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/Factory.cs (date 1708352610236)
|
||||
@@ -0,0 +1,24 @@
|
||||
+using System.Collections.Generic;
|
||||
+using Config.Entities;
|
||||
+using TBF.Rig.Generic;
|
||||
+
|
||||
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
|
||||
+{
|
||||
+ public class Factory : IComponentFactory
|
||||
+ {
|
||||
+ string IComponentFactory.ClassName { get { return GetType().Namespace.Substring(8); } }
|
||||
+
|
||||
+ public override string ToString() { return ClassName; }
|
||||
+
|
||||
+ IComponent IComponentFactory.DummyComponent() { return new FrequencyRegisterReader(); }
|
||||
+
|
||||
+ IComponent IComponentFactory.GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new FrequencyRegisterReader(cfg, components); }
|
||||
+
|
||||
+ IComponentCfg IComponentFactory.DefaultConfig() { return new RRCfg("Puls", this); }
|
||||
+
|
||||
+ IComponentCfg IComponentFactory.CmpntCfgFromCmpntEntity(Component component)
|
||||
+ {
|
||||
+ throw new System.NotImplementedException();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
Index: TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs
|
||||
new file mode 100644
|
||||
--- /dev/null (date 1708352608953)
|
||||
+++ b/TBF/Rig/RegisterReaders/FrequencyMeterFromUniCB/FrequencyRegisterReader.cs (date 1708352608953)
|
||||
@@ -0,0 +1,47 @@
|
||||
+using System;
|
||||
+using System.Collections.Generic;
|
||||
+using Common;
|
||||
+using log4net;
|
||||
+using TBF.Rig.GenericDevices;
|
||||
+
|
||||
+namespace TBF.Rig.RegisterReaders.FrequencyMeterFromUniCB
|
||||
+{
|
||||
+ public class FrequencyRegisterReader : ComponentBase, GenericDevices.IRegReader
|
||||
+ {
|
||||
+ private static readonly ILog log = LogManager.GetLogger(typeof(FrequencyRegisterReader));
|
||||
+
|
||||
+ public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
+
|
||||
+ readonly RRCfg rrCfg;
|
||||
+ readonly TBF.Rig.ControlBoard.IControlBoard cb;
|
||||
+
|
||||
+ int IRegReader.Position { get{ return rrCfg.Position; } }
|
||||
+ Common.RegisterReaderType IRegReader.RegisterReaderType { get { return Common.RegisterReaderType.Pulses; } }
|
||||
+ double IRegReader.PulsesPerLtr { get { return rrCfg.ProcParams.PulsesPerLtr; } }
|
||||
+ double IRegReader.LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); ; } }
|
||||
+ public int Filter { get { return rrCfg.ProcParams.Filter; } }
|
||||
+
|
||||
+ int IRegReader.WMPulses { get { return cb.PulsesWM(Position); } }
|
||||
+ int IRegReader.WMRefPulses { get { return cb.RefPulsesWM(Position); } }
|
||||
+ double IRegReader.WMVolume { get { return LtrsPerPulse * Convert.ToDouble(WMPulses); } }
|
||||
+
|
||||
+ double IRegReader.BeginWMState { get { return 0; } } /// Always 0
|
||||
+ double IRegReader.EndWMState { get { return WMVolume; } } /// Derived from WMVolume
|
||||
+
|
||||
+
|
||||
+ public FrequencyRegisterReader() { }
|
||||
+
|
||||
+ public FrequencyRegisterReader(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
+ : base(cfg)
|
||||
+ {
|
||||
+ rrCfg = cfg as RRCfg;
|
||||
+
|
||||
+ cb = TbfComponents.FindComponent(cfg.ParentName, components) as TBF.Rig.ControlBoard.IControlBoard;
|
||||
+ if (cb == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
+
|
||||
+ log.Warn(this.ToString());
|
||||
+ }
|
||||
+
|
||||
+ public override void Initialize() { }
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
4
.idea/.idea.TBF/.idea/shelf/NEXT_5_24_2024.xml
Normal file
4
.idea/.idea.TBF/.idea/shelf/NEXT_5_24_2024.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<changelist name="NEXT_5_24_2024" date="1716547261313" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/NEXT_5_24_2024/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="NEXT_5/24/2024" />
|
||||
</changelist>
|
||||
206
.idea/.idea.TBF/.idea/shelf/NEXT_5_24_2024/shelved.patch
Normal file
206
.idea/.idea.TBF/.idea/shelf/NEXT_5_24_2024/shelved.patch
Normal file
File diff suppressed because one or more lines are too long
4
.idea/.idea.TBF/.idea/shelf/Pressure_meter_test.xml
Normal file
4
.idea/.idea.TBF/.idea/shelf/Pressure_meter_test.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<changelist name="Pressure_meter_test" date="1704310942302" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Pressure_meter_test/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Pressure meter test" />
|
||||
</changelist>
|
||||
156
.idea/.idea.TBF/.idea/shelf/Pressure_meter_test/shelved.patch
Normal file
156
.idea/.idea.TBF/.idea/shelf/Pressure_meter_test/shelved.patch
Normal file
@ -0,0 +1,156 @@
|
||||
Index: TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs
|
||||
===================================================================
|
||||
diff --git a/TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs b/TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs
|
||||
deleted file mode 100644
|
||||
--- a/TBFTests/Rig/Modbus/PressureMeter/AdjustableScale/PressureMeterTests.cs (revision 0ad8bc6d759d868e021fc7087d3db5ba55f6a354)
|
||||
+++ /dev/null (revision 0ad8bc6d759d868e021fc7087d3db5ba55f6a354)
|
||||
@@ -1,148 +0,0 @@
|
||||
-using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
-using TBF.Rig.Modbus.PressureMeter.AdjustableScale;
|
||||
-using System;
|
||||
-using System.Collections.Generic;
|
||||
-using System.Linq;
|
||||
-using System.Text;
|
||||
-using System.Threading.Tasks;
|
||||
-using TBF.Rig.Generic;
|
||||
-using Moq;
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-namespace TBF.Rig.Modbus.PressureMeter.AdjustableScale.Tests
|
||||
-{
|
||||
- [TestClass()]
|
||||
- public class PressureMeterTests
|
||||
- {
|
||||
-
|
||||
-
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void ToStringTest()
|
||||
- {
|
||||
- Factory factory = new Factory();
|
||||
- IList<Generic.IComponent> list = new List<Generic.IComponent>();
|
||||
- list.Add(factory.DummyComponent());
|
||||
- PressureMeter meter = new PressureMeter(factory.DefaultConfig(), list);
|
||||
-
|
||||
- string str = meter.ToString();
|
||||
- Assert.IsTrue(str == "Modbus.PressureMeter.AdjustableScale(Pr(Modbus) address=49)");
|
||||
-
|
||||
- }
|
||||
-
|
||||
- /* [TestMethod()]
|
||||
- public void PressureMeterTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void PressureMeterTest1()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void InitializeTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void RunDeviceBeforeTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void RunDeviceAfterTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void StopDeviceTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void StopDevice2Test()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }*/
|
||||
-
|
||||
- class PressureMeterSpy : PressureMeter
|
||||
- {
|
||||
- public PressureMeterSpy(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
- :base(cfg, components)
|
||||
- {
|
||||
-
|
||||
- }
|
||||
-
|
||||
- public new void InitModbus()
|
||||
- {
|
||||
- Console.Write("I am here!");
|
||||
- }
|
||||
-
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void ReadPressureTest()
|
||||
- {
|
||||
- Factory factory = new Factory();
|
||||
- IList<Generic.IComponent> list = new List<Generic.IComponent>();
|
||||
- list.Add(factory.DummyComponent());
|
||||
-
|
||||
-
|
||||
-
|
||||
- IComponentCfg componentCfg = factory.DefaultConfig();
|
||||
- PressureMeterCfg pressureMeterCfg = (PressureMeterCfg) componentCfg;
|
||||
-
|
||||
- pressureMeterCfg.CorrectionValLo = 0.4;
|
||||
- pressureMeterCfg.CorrectionValHi = 2.4;
|
||||
- pressureMeterCfg.MsrdValLimHi = 2.0;
|
||||
- pressureMeterCfg.MsrdValLimLo = 0.0;
|
||||
-
|
||||
- PressureMeterSpy meter = new PressureMeterSpy(componentCfg, list);
|
||||
-
|
||||
-
|
||||
-
|
||||
- meter.Initialize();
|
||||
-
|
||||
- double MeasuredVal = meter.MeasuredVal;
|
||||
-
|
||||
-
|
||||
- double value = meter.ReadPressure();
|
||||
- Assert.IsTrue(value == 0.0);
|
||||
-
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- [TestMethod()]
|
||||
- public void ReadPressureOpTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void ReadPressureOpTest1()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void ConditionNameTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }
|
||||
-
|
||||
- [TestMethod()]
|
||||
- public void ConditionOpTest()
|
||||
- {
|
||||
- Assert.Fail();
|
||||
- }*/
|
||||
- }
|
||||
-}
|
||||
\ No newline at end of file
|
||||
@ -0,0 +1,4 @@
|
||||
<changelist name="TBF_project_configuration_backup" date="1708187009519" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/TBF_project_configuration_backup/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="TBF project configuration backup" />
|
||||
</changelist>
|
||||
@ -0,0 +1,55 @@
|
||||
Index: TBF/app.config
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
||||
<+><?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<configuration>\r\n <configSections>\r\n <section name=\"oracle.manageddataaccess.client\"\r\n type=\"OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342\"/>\r\n </configSections>\r\n <startup>\r\n <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.7.2\"/>\r\n </startup>\r\n <system.data>\r\n <DbProviderFactories>\r\n <remove invariant=\"Oracle.ManagedDataAccess.Client\"/>\r\n <add name=\"ODP.NET, Managed Driver\" invariant=\"Oracle.ManagedDataAccess.Client\" description=\"Oracle Data Provider for .NET, Managed Driver\"\r\n type=\"Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342\"/>\r\n </DbProviderFactories>\r\n </system.data>\r\n <runtime>\r\n <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n <dependentAssembly>\r\n <publisherPolicy apply=\"no\"/>\r\n <assemblyIdentity name=\"Oracle.ManagedDataAccess\" publicKeyToken=\"89b483f429c47342\" culture=\"neutral\"/>\r\n <bindingRedirect oldVersion=\"4.121.0.0 - 4.65535.65535.65535\" newVersion=\"4.122.19.1\"/>\r\n </dependentAssembly>\r\n </assemblyBinding>\r\n </runtime>\r\n <oracle.manageddataaccess.client>\r\n <version number=\"*\">\r\n <dataSources>\r\n <dataSource alias=\"SampleDataSource\" descriptor=\"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) \"/>\r\n </dataSources>\r\n </version>\r\n </oracle.manageddataaccess.client>\r\n</configuration>\r\n
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/TBF/app.config b/TBF/app.config
|
||||
--- a/TBF/app.config (revision 153d031125d1637c9f23cea9e25ecff9c68bae9b)
|
||||
+++ b/TBF/app.config (date 1707773182036)
|
||||
@@ -1,32 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
- <section name="oracle.manageddataaccess.client"
|
||||
- type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
|
||||
+ <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||
</configSections>
|
||||
<startup>
|
||||
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
- <remove invariant="Oracle.ManagedDataAccess.Client"/>
|
||||
- <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
|
||||
- type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
|
||||
+ <remove invariant="Oracle.ManagedDataAccess.Client" />
|
||||
+ <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
- <publisherPolicy apply="no"/>
|
||||
- <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
|
||||
- <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/>
|
||||
+ <publisherPolicy apply="no" />
|
||||
+ <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
|
||||
+ <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1" />
|
||||
+ </dependentAssembly>
|
||||
+ <dependentAssembly>
|
||||
+ <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
+ <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<oracle.manageddataaccess.client>
|
||||
<version number="*">
|
||||
<dataSources>
|
||||
- <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/>
|
||||
+ <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
|
||||
</dataSources>
|
||||
</version>
|
||||
</oracle.manageddataaccess.client>
|
||||
@ -0,0 +1,4 @@
|
||||
<changelist name="TBF_project_configuration_backup1" date="1708187045753" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/TBF_project_configuration_backup1/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="TBF project configuration backup" />
|
||||
</changelist>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
<changelist name="TestPDFSharpToUseGraphics" date="1708186637637" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/TestPDFSharpToUseGraphics/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="TestPDFSharpToUseGraphics" />
|
||||
</changelist>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
<changelist name="Test_set_all_open,_closed_valves" date="1710251068900" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Test_set_all_open,_closed_valves/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Test set all open, closed valves" />
|
||||
</changelist>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
<changelist name="Uncommitted_changes_before_Checkout_at_10_11_2024_10_19_AM_[Changes]" date="1728634772275" recycled="false" toDelete="true">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Uncommitted_changes_before_Checkout_at_10_11_2024_10_19_AM_[Changes]/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 10/11/2024 10:19 AM [Changes]" />
|
||||
</changelist>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
<changelist name="Uncommitted_changes_before_Checkout_at_10_11_2024_10_36_AM_[Changes]" date="1728635764918" recycled="false" toDelete="true">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/.idea.TBF/.idea/shelf/Uncommitted_changes_before_Checkout_at_10_11_2024_10_36_AM_[Changes]/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 10/11/2024 10:36 AM [Changes]" />
|
||||
</changelist>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user