SchematicDrawing: Editing completed, TODO: Display
This commit is contained in:
@@ -12,7 +12,7 @@ using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Elde.Diverter
|
||||
{
|
||||
public class Diverter : ComponentBase, IDevice, GenericDevices.IDiverter, GenericDevices.ISequenceCondition, GenericDevices.IHasCalendarEvents
|
||||
public class Diverter : ComponentBase, IDevice, GenericDevices.IDiverter, GenericDevices.ISequenceCondition, GenericDevices.IHasCalendarEvents, SchematicDrawing.IDrawingItemCmpnt
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Diverter));
|
||||
public override string ToString() { return string.Format("Diverter({0})", Cfg.ToString(1)); }
|
||||
@@ -33,6 +33,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
public int DiverterNr { get { return diverterNr0 + 1; } } /// 1-based public diverter number
|
||||
|
||||
readonly DiverterCfg diverterCfg;
|
||||
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return diverterCfg as SchematicDrawing.IDrawingItemCfg; } }
|
||||
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly UInt128 mask; /// derived from bitPosition in the constructor
|
||||
public int AdcNr { get { return diverterCfg.AdcNr; } }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.Diverter
|
||||
{
|
||||
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg, GenericDevices.ICalibInfoCfg
|
||||
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg, GenericDevices.ICalibInfoCfg, SchematicDrawing.IDrawingItemCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DiverterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -30,30 +30,32 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
public int DfltSwithTimeEndMs; /// Default diverter transition time 'end' or 'to sink' in ms
|
||||
|
||||
/// Calibration info serialized parameters displayed in Metrology tab page
|
||||
string calibCertificateNr;
|
||||
DateTime calibDate;
|
||||
DateTime calibValidDate;
|
||||
public string CalibCertificateNr
|
||||
{
|
||||
get { return calibCertificateNr; }
|
||||
set { calibCertificateNr = value; }
|
||||
}
|
||||
public DateTime CalibDate
|
||||
{
|
||||
get { return calibDate; }
|
||||
set { calibDate = value; }
|
||||
}
|
||||
public DateTime CalibValidDate
|
||||
{
|
||||
get { return calibValidDate; }
|
||||
set { calibValidDate = value; }
|
||||
}
|
||||
public string CalibCertificateNr { get; set; }
|
||||
public DateTime CalibDate { get; set; }
|
||||
public DateTime CalibValidDate { get; set; }
|
||||
|
||||
/// 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
|
||||
DiverterCfg()
|
||||
{
|
||||
Name = "Div";
|
||||
Shape = SchematicDrawing.Shape.Div;
|
||||
ParentName = "CB";
|
||||
BitPosition = 0;
|
||||
AdcNr = 5; /// Div1: AdcNr=5 , Div2: AdcNr=6
|
||||
@@ -62,7 +64,7 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
StartingLevel = 50;
|
||||
ThresholdLo = 10;
|
||||
ThresholdHi = 90;
|
||||
calibCertificateNr = string.Empty;
|
||||
CalibCertificateNr = string.Empty;
|
||||
}
|
||||
|
||||
public DiverterCfg(IComponentFactory factory)
|
||||
@@ -71,7 +73,9 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
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}, Parent={1}, Bit={2}, ADC#={3}, ADC2Sink={4}, ADC2Tank={5}, Gate={6}%, Lo={7}%, Lo={8}%",
|
||||
Name,
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
public class DiverterFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "Diverter"; } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public void ResetStaticProperties() { Diverter.ResetStaticProperties(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user