Schematic drawing with live function, bench control by mouse, Dijkstra algo, vacuum, etc.

This commit is contained in:
Milan Hanajik
2020-06-14 13:01:53 +02:00
parent 2945049288
commit 1f67899a5c
223 changed files with 5684 additions and 3772 deletions
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2017 Sensus Metering Systems
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using log4net;
using Config.Entities;
@@ -9,12 +9,13 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
/// <summary>
/// This component = instance of this class is a placeholder for a combined main watermeter
/// </summary>
public class WaterMeter : ComponentBase, GenericDevices.IWaterMeter
public class WaterMeter : ComponentBase, GenericDevices.IWaterMeter, SchematicDrawing.IDrawingItCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(WaterMeter));
public override string ToString() { return string.Format("WaterMeter({0})", Cfg.ToString(1)); }
readonly WaterMeterCfg waterMeterCfg;
public SchematicDrawing.IDrawingItem DrawingItem { get { return waterMeterCfg as SchematicDrawing.IDrawingItem; } }
/// <summary>WaterMeter type (product name) and producer</summary>
public string ProductName { get { return waterMeterCfg.ProcParams.ProductName; } }
@@ -1,20 +1,39 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
using System.Collections.Generic;
namespace TBF.BenchControl.WaterMeters.WaterMeter
{
public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg
public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg, IDrawingItem
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(WaterMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new WaterMeterCfgCtrl(); }
///
/// Serialized parameters
///
/// Schematic drawing info
public Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public Sz Sz { get; set; }
public Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public Orient LblOrient { get; set; }
[XmlIgnore]
public IList<GNode> GNodes { get; set; }
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcParams ProcParams;
@@ -24,20 +43,24 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
/// Private parameterless constructor invoked by all other (public) constructors
WaterMeterCfg()
{
Name = "WM";
ParentName = string.Empty;
ProcParams = CreateProcParamsProvider() as ProcParams;
GNodes = new List<GNode>();
}
public WaterMeterCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
Shape = Shape.WaterM;
Sz = Sz.L;
Factory = factory;
Name = "WM";
ParentName = string.Empty;
}
public string ToString(int i)
{
return string.Format("Name={0}", Name);
return string.Format("{0} {1}[{2},{3}]", Name, Shape, X, Y);
}
}
}