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
@@ -11,13 +11,13 @@ using TBF.Resources;
namespace TBF.BenchControl.Elde.PressureMeter
{
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter, GenericDevices.IHasCalendarEvents, SchematicDrawing.IDrawingItemCmpnt
public class PressureMeter : ComponentBase, GenericDevices.IPressureMeter, GenericDevices.IHasCalendarEvents, SchematicDrawing.IDrawingItCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(PressureMeter));
public override string ToString() { return string.Format("PressureMeter({0})", Cfg.ToString(1)); }
readonly PressureMeterCfg pressureMeterCfg;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return pressureMeterCfg as SchematicDrawing.IDrawingItemCfg; } }
public SchematicDrawing.IDrawingItem DrawingItem { get { return pressureMeterCfg as SchematicDrawing.IDrawingItem; } }
public readonly ControlBoardDev ControlBoard;
@@ -6,11 +6,12 @@ using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PressureMeter
{
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg, SchematicDrawing.IDrawingItemCfg
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg, IDrawingItem
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -30,39 +31,40 @@ namespace TBF.BenchControl.Elde.PressureMeter
public DateTime CalibValidDate { get; set; }
/// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; }
public 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 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 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; }
public Orient LblOrient { get; set; }
[XmlIgnore]
public IList<GNode> GNodes { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
PressureMeterCfg()
{
GNodes = new List<GNode>();
}
public PressureMeterCfg(IComponentFactory factory)
: this()
{
Shape = Shape.PressM;
Sz = Sz.M;
Factory = factory;
Name = "Pr";
Shape = SchematicDrawing.Shape.PressM;
ParentName = "CB";
Idx0 = 0;
Protocol = MeretProtocol.Modbus;
RS485Address = 99;
}
public PressureMeterCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
@@ -5,6 +5,7 @@ using System;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.UI.Bench.Components;
namespace TBF.BenchControl.Elde.PressureMeter
{
@@ -35,9 +36,9 @@ namespace TBF.BenchControl.Elde.PressureMeter
parent = ParentForm as ComponentParametersDlg;
if (parent == null) return;
if (parent.TbfComponents != null)
if (parent.CmpntEntities != null)
{
foreach (var cmpnt in parent.TbfComponents)
foreach (var cmpnt in parent.CmpntEntities)
{
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is ControlBoard.Legacy.ControlBoardFactory)
{