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
+2 -1
View File
@@ -67,12 +67,13 @@ namespace TBF.BenchControl.Danfoss.VLT2800
}
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("Pump-Danfoss-VLT2800({0})", 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
@@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Danfoss.VLT2800
{
public class PumpCfg : ComponentCfgBase, Generic.IComponentCfg
public class PumpCfg : ComponentCfgBase, Generic.IComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -28,6 +28,22 @@ namespace TBF.BenchControl.Danfoss.VLT2800
public Parity Parity;
public int DataBits;
public StopBits StopBits;
/// 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
PumpCfg()
@@ -44,6 +60,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
DataBits = 8;
Parity = System.IO.Ports.Parity.Even; /// 'Parity.None' is the default value for Protocol = PumpProtocol.Modbus
StopBits = System.IO.Ports.StopBits.One;
Shape = SchematicDrawing.Shape.PumpFM;
}
public PumpCfg(IComponentFactory factory)
@@ -52,7 +69,9 @@ namespace TBF.BenchControl.Danfoss.VLT2800
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}, Delay={1}s, Protocol={2}, BusAddress={3}, Com{4}, {5}Bd, {6}-bits, parity={7}, stopBits={8}",
Name, Delay, Protocol, BusAddress, ComPortNr, BaudRate, DataBits, Parity, StopBits);
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
public class PumpFactory : IComponentFactory
{
public string ClassName { get { return "Pump-Danfoss-VLT2800"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }