From 0a72be12ab28e63e31f98b7ef3d192e6a90cdaaa Mon Sep 17 00:00:00 2001 From: Rowlander Date: Mon, 4 Oct 2021 14:04:07 +0200 Subject: [PATCH] add toss weatherstation --- TBF_V2/Sources/TBF/DeviceTest/app.config | 13 +- TBF_V2/Sources/TBF/ResultsBrowser/app.config | 13 +- .../TBF/BenchControl/Ambient/Toss/Ambient.cs | 236 ++++++++++++++ .../BenchControl/Ambient/Toss/AmbientCfg.cs | 65 ++++ .../Ambient/Toss/AmbientCfgCtrl.Designer.cs | 287 ++++++++++++++++++ .../Ambient/Toss/AmbientCfgCtrl.cs | 119 ++++++++ .../Ambient/Toss/AmbientCfgCtrl.resx | 120 ++++++++ .../TBF/BenchControl/Ambient/Toss/Factory.cs | 26 ++ .../TBF/TBF/BenchControl/TbfComponents.cs | 3 +- .../TBF/TBF/Properties/AssemblyInfo.cs | 4 +- TBF_V2/Sources/TBF/TBF/TBF.csproj | 157 ++++------ TBF_V2/Sources/TBF/TBF/app.config | 12 +- TBF_V2/Sources/TBF/TBF/packages.config | 2 + 13 files changed, 949 insertions(+), 108 deletions(-) create mode 100644 TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Ambient.cs create mode 100644 TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfg.cs create mode 100644 TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.Designer.cs create mode 100644 TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.cs create mode 100644 TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.resx create mode 100644 TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Factory.cs diff --git a/TBF_V2/Sources/TBF/DeviceTest/app.config b/TBF_V2/Sources/TBF/DeviceTest/app.config index e3656033..8c5dac9d 100644 --- a/TBF_V2/Sources/TBF/DeviceTest/app.config +++ b/TBF_V2/Sources/TBF/DeviceTest/app.config @@ -1,3 +1,12 @@ - + - + + + + + + + + + + diff --git a/TBF_V2/Sources/TBF/ResultsBrowser/app.config b/TBF_V2/Sources/TBF/ResultsBrowser/app.config index e3656033..8c5dac9d 100644 --- a/TBF_V2/Sources/TBF/ResultsBrowser/app.config +++ b/TBF_V2/Sources/TBF/ResultsBrowser/app.config @@ -1,3 +1,12 @@ - + - + + + + + + + + + + diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Ambient.cs b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Ambient.cs new file mode 100644 index 00000000..0be89aba --- /dev/null +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Ambient.cs @@ -0,0 +1,236 @@ +using Config.Entities; +using log4net; +using RestSharp; +/// +/// Copyright (c) 2013-2016 Sensus Metering Systems +/// +using System; +using System.Collections.Generic; +using System.Net; +using TBF.BenchControl.Generic; +using TBF.Boxes; + +namespace TBF.BenchControl.Ambient.Toss +{ + /// + /// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232) + /// Connection settings: 9600 Bd 8-bits No-parity 2-stop-bits Flow control: none. + /// + public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient + { + private static readonly ILog log = LogManager.GetLogger(typeof(Ambient)); + public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); } + + private readonly AmbientCfg ambientCfg; + + /// Private fields + + /// The state of the measurement + private MsrmntState msrmntState; + + /// + /// Measured values when MsrmntState == MsrmntState.Valid + /// + private float temperature; /// [°C] + + + private float pressure; /// [bar] + + + private float humidity; /// [R%] + + + + /// Measurement time stamp when MsrmntState == MsrmntState.Valid + private int msrmntTimeStamp; + + public Ambient() + { + } + + /// + /// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232) + /// + public Ambient(AmbientCfg cfg, IList components) + : this(cfg) + { + } + + public Ambient(Generic.IComponentCfg cfg) + : base(cfg) + { + ambientCfg = cfg as AmbientCfg; + log.Debug(this.ToString()); + } + + public void Initialize() + { + if (ambientCfg.DebugLevel == DebugMode.Simulate) + { + temperature = 20.0f; + humidity = 40.0f; + pressure = 1.0f; + msrmntTimeStamp = StateMachine.Time; + msrmntState = MsrmntState.Valid; + return; + } + + + } + + + + /// Run this device + public void RunDeviceBefore() + { + if (ambientCfg.DebugLevel == DebugMode.Simulate || + ambientCfg.DebugLevel == DebugMode.FailureDuringOperation) + { + msrmntTimeStamp = StateMachine.Time; + return; + } + + + } + + /// Run this device + public void RunDeviceAfter() + { + if (ambientCfg.DebugLevel == DebugMode.Simulate || + ambientCfg.DebugLevel == DebugMode.FailureDuringOperation) + { + return; + } + + + + try + { + /// Each 10 seconds + if ((StateMachine.Time % 10) == 0) + { + + var client = new RestClient(ambientCfg.Url); + + var request = new RestRequest(Method.GET); + ServicePointManager.Expect100Continue = false; + + request.Timeout = ambientCfg.Timeout; + + + + var r = client.Get(request); + + if (r.StatusCode == HttpStatusCode.OK) + { + var c = r.Content; + var start = c.IndexOf(ambientCfg.TemperatureStartTag) + ambientCfg.TemperatureStartTag.Length; + var end = c.IndexOf(ambientCfg.TemperatureEndTag, start); + var LT = c.Substring(start, end - start).Trim().Replace(".", ","); + + start = c.IndexOf(ambientCfg.HumidityStartTag) + ambientCfg.HumidityStartTag.Length; + end = c.IndexOf(ambientCfg.HumidityEndTag, start); + + var RF = c.Substring(start, end - start).Trim().Replace(".", ","); + start = c.IndexOf(ambientCfg.PressureStartTag) + ambientCfg.PressureStartTag.Length; + end = c.IndexOf(ambientCfg.PressureEndTag, start); + var LD = c.Substring(start, end - start).Trim().Replace(".", ","); + + + float.TryParse(LT, out temperature); + float.TryParse(RF, out humidity); + float.TryParse(LD, out pressure); + } + + if (r.StatusCode != 0) + { + return; + } + + + } + } + catch (Exception e) + { + DebugLevel = DebugMode.FailureDuringOperation; + + log.FatalFormat("Ambient: web read failure : {0}", e.Message); + if (e.InnerException != null) + { + log.FatalFormat("InnerMessage : {0}", e.InnerException.Message); + } + } + } + + /// Stop this device + public void StopDevice() + { + + } + + public void StopDevice2() { } + + /// + /// Boxes for the operation result + /// + private FloatBox tempBox; + private FloatBox pressureBox; + private FloatBox humiBox; + + public IOperation ReadAmbientOp(FloatBox temperature, FloatBox pressure, FloatBox humidity) + { + this.tempBox = temperature; + this.pressureBox = pressure; + this.humiBox = humidity; + return this; + } + + /// Start this operation + public void Start() + { + if (tempBox != null) + { + tempBox.Val = temperature; + } + + if (pressureBox != null) + { + pressureBox.Val = pressure; + } + + if (humiBox != null) + { + humiBox.Val = humidity; + } + } + + /// Run this operation + /// + /// Event.FlowInDone or Event.FlowOutDone + /// + public Event Run() + { + if (tempBox != null) + { + tempBox.Val = temperature; + } + + if (pressureBox != null) + { + pressureBox.Val = pressure; + } + + if (humiBox != null) + { + humiBox.Val = humidity; + } + + return Event.AmbientDone; + } + + /// Stop this operation + public void Stop() + { + } + } +} diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfg.cs b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfg.cs new file mode 100644 index 00000000..84b7787f --- /dev/null +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfg.cs @@ -0,0 +1,65 @@ +/// +/// Copyright (c) 2013-2016 Sensus Metering Systems +/// +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Ambient.Toss +{ + public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); } + + /// + /// Serialized parameters + /// + public string Url; + + public int Timeout = 1000; + + public string TemperatureStartTag = ">LT="; + public string TemperatureEndTag = ""; + + public string HumidityStartTag = ">RF="; + public string HumidityEndTag = ""; + + public string PressureStartTag = ">LD="; + public string PressureEndTag = ""; + + + /// Private parameterless constructor invoked by all other (public) constructors + private AmbientCfg() + { + Name = "Ambient"; + ParentName = string.Empty; + Url = string.Empty; + + Timeout = 1000; + + TemperatureStartTag = ">LT="; + TemperatureEndTag = ""; + + HumidityStartTag = ">RF="; + HumidityEndTag = ""; + + PressureStartTag = ">LD="; + PressureEndTag = ""; + + } + + public AmbientCfg(IComponentFactory factory) + : this() + { + this.Factory = factory; + } + + public string ToString(int i) + { + return string.Format("Name={0}, Url{1}", + Name, Url); + } + } +} diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.Designer.cs b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.Designer.cs new file mode 100644 index 00000000..7b0c5bc1 --- /dev/null +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.Designer.cs @@ -0,0 +1,287 @@ +/// +/// Copyright (c) 2013-2015 Sensus Metering Systems +/// +namespace TBF.BenchControl.Ambient.Toss +{ + partial class AmbientCfgCtrl + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.UrlTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.nudTimeout = new System.Windows.Forms.NumericUpDown(); + this.txtTemperatureStartTag = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtHumidityStartTag = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.txtHumidityEndTag = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.txtPressureStartTag = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txtTemperatureEndTag = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txtPressureEndTag = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.nudTimeout)).BeginInit(); + this.SuspendLayout(); + // + // UrlTextBox + // + this.UrlTextBox.Enabled = false; + this.UrlTextBox.Location = new System.Drawing.Point(140, 52); + this.UrlTextBox.Name = "UrlTextBox"; + this.UrlTextBox.Size = new System.Drawing.Size(130, 20); + this.UrlTextBox.TabIndex = 4; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(29, 55); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(32, 13); + this.label1.TabIndex = 3; + this.label1.Text = "URL:"; + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(140, 28); + 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(30, 31); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(137, 7); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(29, 81); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(48, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Timeout:"; + // + // nudTimeout + // + this.nudTimeout.Location = new System.Drawing.Point(140, 78); + this.nudTimeout.Maximum = new decimal(new int[] { + 20000, + 0, + 0, + 0}); + this.nudTimeout.Minimum = new decimal(new int[] { + 80, + 0, + 0, + 0}); + this.nudTimeout.Name = "nudTimeout"; + this.nudTimeout.Size = new System.Drawing.Size(126, 20); + this.nudTimeout.TabIndex = 6; + this.nudTimeout.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + // + // txtTemperatureStartTag + // + this.txtTemperatureStartTag.Enabled = false; + this.txtTemperatureStartTag.Location = new System.Drawing.Point(140, 110); + this.txtTemperatureStartTag.Name = "txtTemperatureStartTag"; + this.txtTemperatureStartTag.Size = new System.Drawing.Size(130, 20); + this.txtTemperatureStartTag.TabIndex = 8; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(30, 113); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(111, 13); + this.label3.TabIndex = 7; + this.label3.Text = "TemperatureStartTag:"; + // + // txtHumidityStartTag + // + this.txtHumidityStartTag.Enabled = false; + this.txtHumidityStartTag.Location = new System.Drawing.Point(140, 161); + this.txtHumidityStartTag.Name = "txtHumidityStartTag"; + this.txtHumidityStartTag.Size = new System.Drawing.Size(130, 20); + this.txtHumidityStartTag.TabIndex = 10; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(29, 164); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(91, 13); + this.label4.TabIndex = 9; + this.label4.Text = "HumidityStartTag:"; + // + // txtHumidityEndTag + // + this.txtHumidityEndTag.Enabled = false; + this.txtHumidityEndTag.Location = new System.Drawing.Point(140, 191); + this.txtHumidityEndTag.Name = "txtHumidityEndTag"; + this.txtHumidityEndTag.Size = new System.Drawing.Size(130, 20); + this.txtHumidityEndTag.TabIndex = 12; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(29, 194); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(88, 13); + this.label5.TabIndex = 11; + this.label5.Text = "HumidityEndTag:"; + // + // txtPressureStartTag + // + this.txtPressureStartTag.Enabled = false; + this.txtPressureStartTag.Location = new System.Drawing.Point(141, 217); + this.txtPressureStartTag.Name = "txtPressureStartTag"; + this.txtPressureStartTag.Size = new System.Drawing.Size(130, 20); + this.txtPressureStartTag.TabIndex = 14; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(30, 220); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(92, 13); + this.label6.TabIndex = 13; + this.label6.Text = "PressureStartTag:"; + // + // txtTemperatureEndTag + // + this.txtTemperatureEndTag.Enabled = false; + this.txtTemperatureEndTag.Location = new System.Drawing.Point(140, 136); + this.txtTemperatureEndTag.Name = "txtTemperatureEndTag"; + this.txtTemperatureEndTag.Size = new System.Drawing.Size(130, 20); + this.txtTemperatureEndTag.TabIndex = 16; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(29, 139); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(108, 13); + this.label7.TabIndex = 15; + this.label7.Text = "TemperatureEndTag:"; + // + // txtPressureEndTag + // + this.txtPressureEndTag.Enabled = false; + this.txtPressureEndTag.Location = new System.Drawing.Point(140, 243); + this.txtPressureEndTag.Name = "txtPressureEndTag"; + this.txtPressureEndTag.Size = new System.Drawing.Size(130, 20); + this.txtPressureEndTag.TabIndex = 18; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(29, 246); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(89, 13); + this.label8.TabIndex = 17; + this.label8.Text = "PressureEndTag:"; + // + // AmbientCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.Controls.Add(this.txtPressureEndTag); + this.Controls.Add(this.label8); + this.Controls.Add(this.txtTemperatureEndTag); + this.Controls.Add(this.label7); + this.Controls.Add(this.txtPressureStartTag); + this.Controls.Add(this.label6); + this.Controls.Add(this.txtHumidityEndTag); + this.Controls.Add(this.label5); + this.Controls.Add(this.txtHumidityStartTag); + this.Controls.Add(this.label4); + this.Controls.Add(this.txtTemperatureStartTag); + this.Controls.Add(this.label3); + this.Controls.Add(this.nudTimeout); + this.Controls.Add(this.label2); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Controls.Add(this.UrlTextBox); + this.Controls.Add(this.label1); + this.Name = "AmbientCfgCtrl"; + this.Size = new System.Drawing.Size(300, 269); + this.Load += new System.EventHandler(this.AbbientCfgCtrl_Load); + ((System.ComponentModel.ISupportInitialize)(this.nudTimeout)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox UrlTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown nudTimeout; + private System.Windows.Forms.TextBox txtTemperatureStartTag; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtHumidityStartTag; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtHumidityEndTag; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtPressureStartTag; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtTemperatureEndTag; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txtPressureEndTag; + private System.Windows.Forms.Label label8; + } +} diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.cs b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.cs new file mode 100644 index 00000000..db3cc4c1 --- /dev/null +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.cs @@ -0,0 +1,119 @@ +using Config.Entities; +/// +/// Copyright (c) 2013-2015 Sensus Metering Systems +/// +using System; +using System.Windows.Forms; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Ambient.Toss +{ + public partial class AmbientCfgCtrl : UserControl, IComponentCfgCtrl + { + public bool ShowMore { get { return false; } } + + private AmbientCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as AmbientCfg; + Redraw(); + } + } + + public AmbientCfgCtrl() + { + InitializeComponent(); + } + + + private void AbbientCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + public void Closing() + { + } + + private void Redraw() + { + if (config == null) + { + return; + } + /// Control was not loaded, settings were not changed + + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + UrlTextBox.Text = config.Url.ToString(); + + nudTimeout.Value = config.Timeout; + txtTemperatureStartTag.Text = config.TemperatureStartTag; + txtTemperatureEndTag.Text = config.TemperatureEndTag; + txtHumidityStartTag.Text = config.HumidityStartTag; + txtHumidityEndTag.Text = config.HumidityEndTag; + + txtPressureStartTag.Text = config.PressureStartTag; + txtPressureEndTag.Text = config.PressureEndTag; + + + } + + public void Unlock() + { + nameTextBox.Enabled = true; + UrlTextBox.Enabled = true; + nudTimeout.Enabled = true; + txtTemperatureStartTag.Enabled = true; + txtTemperatureEndTag.Enabled = true; + txtHumidityStartTag.Enabled = true; + txtHumidityEndTag.Enabled = true; + + txtPressureStartTag.Enabled = true; + txtPressureEndTag.Enabled = true; + + } + + public CfgUpdateFlags UpdateCfg() + { + CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + + if (config == null) + { + return CfgUpdateFlags.Error; + } + /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + config.Url = UrlTextBox.Text; + + + config.Timeout = (int)nudTimeout.Value; + config.TemperatureStartTag = txtTemperatureStartTag.Text; + config.TemperatureEndTag = txtTemperatureEndTag.Text; + config.HumidityStartTag = txtHumidityStartTag.Text; + config.HumidityEndTag = txtHumidityEndTag.Text; + + config.PressureStartTag = txtPressureStartTag.Text; + config.PressureEndTag = txtPressureEndTag.Text; + + + return flags; + } + + public CfgUpdateFlags VerifyCfg(ref string message) + { + CfgUpdateFlags flags = CfgUpdateFlags.None; + + return flags; + } + + private void btnTest_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.resx b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/AmbientCfgCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Factory.cs b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Factory.cs new file mode 100644 index 00000000..352370f1 --- /dev/null +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/Ambient/Toss/Factory.cs @@ -0,0 +1,26 @@ +/// +/// Copyright (c) 2013-2016 Sensus Metering Systems +/// +using System.Collections.Generic; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.Ambient.Toss +{ + public class Factory : IComponentFactory + { + public string ClassName { get { return "Toss-Ambient"; } } + + public void ResetStaticProperties() { Ambient.ResetStaticProperties(); } + + public IComponent DummyComponent() { return new Ambient(); } + + public IComponent GetComponent(IComponentCfg cfg, IList components) { return new Ambient(cfg); } + + public IComponentCfg DefaultConfig() { return new AmbientCfg(this); } + + public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component) + { + return ComponentCfgBase.CreateFromDbEntity(AmbientCfg.Serializer, component, this); + } + } +} diff --git a/TBF_V2/Sources/TBF/TBF/BenchControl/TbfComponents.cs b/TBF_V2/Sources/TBF/TBF/BenchControl/TbfComponents.cs index 1c2d6013..59509ab7 100644 --- a/TBF_V2/Sources/TBF/TBF/BenchControl/TbfComponents.cs +++ b/TBF_V2/Sources/TBF/TBF/BenchControl/TbfComponents.cs @@ -81,7 +81,8 @@ namespace TBF.BenchControl Factories.Add(new DataEntry.WMStates.EntryFormFactory()); Factories.Add(new Ambient.Comet.Factory()); Factories.Add(new Ambient.Greco.Factory()); - Factories.Add(new Keithley.Multimeter_2010_RS232.Factory()); /// Keithley.Multimeter_2010_RS232 + Factories.Add(new Ambient.Toss.Factory()); + Factories.Add(new Keithley.Multimeter_2010_RS232.Factory()); /// Keithley.Multimeter_2010_RS232 Factories.Add(new Keithley.TempMeter.Factory()); /// Keithley.TempMeter Factories.Add(new MettlerToledo.Standard.BalanceFactory()); /// MettlerToledo Balance Factories.Add(new MettlerToledo.Standard.BalanceOldFactory()); /// MettlerToledoBalanceOld diff --git a/TBF_V2/Sources/TBF/TBF/Properties/AssemblyInfo.cs b/TBF_V2/Sources/TBF/TBF/Properties/AssemblyInfo.cs index 0f3239dc..facbab79 100644 --- a/TBF_V2/Sources/TBF/TBF/Properties/AssemblyInfo.cs +++ b/TBF_V2/Sources/TBF/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.20.002.0")] -[assembly: AssemblyFileVersion("2.20.002.0")] +[assembly: AssemblyVersion("2.20.003.0")] +[assembly: AssemblyFileVersion("2.20.003.0")] diff --git a/TBF_V2/Sources/TBF/TBF/TBF.csproj b/TBF_V2/Sources/TBF/TBF/TBF.csproj index c52c3ff4..fb1dac49 100644 --- a/TBF_V2/Sources/TBF/TBF/TBF.csproj +++ b/TBF_V2/Sources/TBF/TBF/TBF.csproj @@ -97,10 +97,6 @@ false - - False - ..\packages\Common\CommonCore.ThreadWatcher.dll - False ..\packages\ControlBoard\Genesis\ControlComponent3U.dll @@ -118,9 +114,8 @@ False ..\packages\log4net.2.0.2\lib\net40-full\log4net.dll - - False - ..\packages\Common\Logic.ProductionToProductMapper.dll + + ..\..\..\..\packages\Common\Logic.ProductionToProductMapper.dll True @@ -128,31 +123,21 @@ ..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll - - False - ..\packages\Common\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll ..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll - - False - ..\packages\Common\NLog.dll - False ..\packages\Oracle\Oracle.DataAccess.dll - - False - ..\packages\Common\PdfSharp.dll - ..\packages\Renci.SshNet\Renci.SshNet.dll - - False - ..\packages\Common\RestSharp.dll + + ..\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll @@ -162,116 +147,90 @@ - - False - ..\packages\Common\Xylem.Common.CommonCore.dll + + + ..\..\..\..\packages\Common\Xylem.Common.CommonCore.dll - - False - ..\packages\Common\Xylem.Common.CommonCore.Configuration.dll + + ..\..\..\..\packages\Common\Xylem.Common.CommonCore.Configuration.dll - ..\packages\Common\Xylem.Common.CommonCore.ThreadWatcher.dll + ..\..\..\..\packages\Common\Xylem.Common.CommonCore.ThreadWatcher.dll - - False - ..\packages\Common\Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll - - False - ..\packages\Common\Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll - - False - ..\packages\Common\Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Applications.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Applications.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.dll + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.ProtocolCore.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.ProtocolCore.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Registers.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.Registers.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll - - False - ..\packages\Common\Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll + + ..\..\..\..\packages\Common\Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll - - False - ..\packages\Common\Xylem.Common.Logic.ProductionOrderCore.dll + + ..\..\..\..\packages\Common\Xylem.Common.Logic.ProductionOrderCore.dll - - False - ..\packages\Common\Xylem.Common.Logic.RelatePcb.dll + + ..\..\..\..\packages\Common\Xylem.Common.Logic.RelatePcb.dll - - False - ..\packages\Common\Xylem.Common.Logic.ServiceCore.dll + + ..\..\..\..\packages\Common\Xylem.Common.Logic.ServiceCore.dll - - False - ..\packages\Common\Xylem.Common.Logic.SoftwareAccessHelper.dll + + ..\..\..\..\packages\Common\Xylem.Common.Logic.SoftwareAccessHelper.dll - - False - ..\packages\Common\Xylem.Common.Metrology.Measurements.dll - - - False - ..\packages\Common\Xylem.Common.Ui.CordonelPreadjustmentUi.dll + + ..\..\..\..\packages\Common\Xylem.Common.Metrology.Measurements.dll - ..\packages\Common\Xylem.Common.Utils.ByteArrayStyle.dll + ..\..\..\..\packages\Common\Xylem.Common.Utils.ByteArrayStyle.dll - - False - ..\packages\Common\Xylem.Common.Utils.Crc16Ccitt.dll + + ..\..\..\..\packages\Common\Xylem.Common.Utils.Crc16Ccitt.dll - - False - ..\packages\Common\Xylem.Common.Utils.Logging.dll + + ..\..\..\..\packages\Common\Xylem.Common.Utils.Logging.dll - ..\packages\Common\Xylem.Common.Utils.ProcessExec.dll + ..\..\..\..\packages\Common\Xylem.Common.Utils.ProcessExec.dll - - False - ..\packages\Common\XylemCommonUiLegacyGenCtl.dll + + ..\..\..\..\packages\Common\XylemCommonUiLegacyGenCtl.dll diff --git a/TBF_V2/Sources/TBF/TBF/app.config b/TBF_V2/Sources/TBF/TBF/app.config index 86fcc8b7..59cffbfd 100644 --- a/TBF_V2/Sources/TBF/TBF/app.config +++ b/TBF_V2/Sources/TBF/TBF/app.config @@ -1,6 +1,14 @@ - + - + + + + + + + + + diff --git a/TBF_V2/Sources/TBF/TBF/packages.config b/TBF_V2/Sources/TBF/TBF/packages.config index 671236a8..0292bead 100644 --- a/TBF_V2/Sources/TBF/TBF/packages.config +++ b/TBF_V2/Sources/TBF/TBF/packages.config @@ -4,6 +4,8 @@ + + \ No newline at end of file