SchematicDrawing: Editing completed, TODO: Display

This commit is contained in:
Milan Hanajik
2020-06-02 12:00:45 +02:00
parent 2c100c7150
commit 070a76aade
337 changed files with 6267 additions and 663 deletions
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.CometAmbient
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.Common
public class Factory : IComponentFactory
{
public string ClassName { get { return "Modbus"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Modbus.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.Danfoss.VLT
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }
+2 -1
View File
@@ -67,12 +67,13 @@ namespace TBF.BenchControl.Modbus.Danfoss.VLT
}
public class Pump : ComponentBase, IDevice, IOperation, GenericDevices.IPumpFM, GenericDevices.IValve
public class Pump : ComponentBase, IDevice, IOperation, GenericDevices.IPumpFM, GenericDevices.IValve, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(Pump));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(1)); }
private readonly PumpCfg pumpCfg;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return pumpCfg as SchematicDrawing.IDrawingItemCfg; } }
public int Delay { get { return pumpCfg.Delay; } }
public ValveCategory Category { get { return ValveCategory.Feeding; } } /// Pump category is Feeding
+21 -2
View File
@@ -7,7 +7,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.Danfoss.VLT
{
public class PumpCfg : ComponentCfgBase, Generic.IChildComponentCfg
public class PumpCfg : ComponentCfgBase, Generic.IChildComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -21,6 +21,22 @@ namespace TBF.BenchControl.Modbus.Danfoss.VLT
public int Delay; // Delay of the pump function in [s] (affects the duration of transition sequence steps)
public byte ModbusAddress; /// 1..254
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
PumpCfg()
{
@@ -29,6 +45,7 @@ namespace TBF.BenchControl.Modbus.Danfoss.VLT
BitPosition = 0;
Delay = 1;
ModbusAddress = 49;
Shape = SchematicDrawing.Shape.PumpFM;
}
public PumpCfg(IComponentFactory factory)
@@ -37,7 +54,9 @@ namespace TBF.BenchControl.Modbus.Danfoss.VLT
this.Factory = factory;
}
public string ToString(int i)
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("name={0} bit={1} delay={2} addr={3} parent={4}",
Name,
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.Easytherm
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Easytherm.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.Meret.PressureMeter
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { PressureMeter.ResetStaticProperties(); }
@@ -9,13 +9,15 @@ using TBF.Boxes;
namespace TBF.BenchControl.Modbus.Meret.PressureMeter
{
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter, IDevice
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter, IDevice, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(PressureMeter));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(1)); }
readonly PressureMeterCfg pressureMtrCfg;
readonly GenericDevices.IModbus modbus;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return pressureMtrCfg as SchematicDrawing.IDrawingItemCfg; } }
readonly GenericDevices.IModbus modbus;
double receivedPressure;
public PressureMeter()
@@ -7,7 +7,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.Meret.PressureMeter
{
public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -19,12 +19,29 @@ namespace TBF.BenchControl.Modbus.Meret.PressureMeter
///
public byte ModbusAddress; /// 1..255
/// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
PressureMeterCfg()
{
Name = "Pr";
ParentName = "Modbus";
ModbusAddress = 49;
Shape = SchematicDrawing.Shape.PressM;
}
public PressureMeterCfg(IComponentFactory factory)
@@ -33,7 +50,9 @@ namespace TBF.BenchControl.Modbus.Meret.PressureMeter
this.Factory = factory;
}
public string ToString(int i)
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("name={0} addr={1} parent={2}",
Name,
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.Meret.TempMeter
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { TempMeter.ResetStaticProperties(); }
@@ -9,13 +9,15 @@ using TBF.Boxes;
namespace TBF.BenchControl.Modbus.Meret.TempMeter
{
public class TempMeter : ComponentBase, GenericDevices.ITempMeter, IDevice
public class TempMeter : ComponentBase, GenericDevices.ITempMeter, IDevice, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(1)); }
readonly TempMeterCfg tempMtrCfg;
readonly GenericDevices.IModbus modbus;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return tempMtrCfg as SchematicDrawing.IDrawingItemCfg; } }
readonly GenericDevices.IModbus modbus;
double receivedTemp;
public TempMeter()
@@ -7,7 +7,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.Meret.TempMeter
{
public class TempMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
public class TempMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -19,12 +19,29 @@ namespace TBF.BenchControl.Modbus.Meret.TempMeter
///
public byte ModbusAddress; /// 1..254
/// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
TempMeterCfg()
{
Name = "T";
ParentName = "Modbus";
ModbusAddress = 49;
Shape = SchematicDrawing.Shape.TempM;
}
public TempMeterCfg(IComponentFactory factory)
@@ -33,7 +50,9 @@ namespace TBF.BenchControl.Modbus.Meret.TempMeter
this.Factory = factory;
}
public string ToString(int i)
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("name={0} addr={1} parent={2}",
Name,
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.QuidoRS
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { QuidoRS.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.TankSelector
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { TankSelector.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { LevelMeter.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Modbus.WaterAnalyzer
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Analyzer.ResetStaticProperties(); }