From f96bf993d8bded8a3267e5a343524717eb4bdf26 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 21 Jan 2022 16:08:03 +0100 Subject: [PATCH] Various.Clamping added, Various.CoverTest modified, ver. 3.1.1857 --- SchematicDrawing/DrawingShape.cs | 16 ++ SchematicDrawing/Enums.cs | 6 +- SchematicDrawing/Pictures/Clamping-XL-off.png | Bin 0 -> 275 bytes SchematicDrawing/Pictures/Clamping-XL-on.png | Bin 0 -> 277 bytes SchematicDrawing/Pictures/Cover-XL-off.png | Bin 0 -> 510 bytes SchematicDrawing/Pictures/Cover-XL-on.png | Bin 0 -> 382 bytes .../Properties/Resources.Designer.cs | 40 +++++ SchematicDrawing/Properties/Resources.resx | 12 ++ SchematicDrawing/SchematicDrawing.csproj | 4 + TBF/Properties/AssemblyInfo.cs | 4 +- TBF/Resources/Strings.Designer.cs | 18 ++ TBF/Resources/Strings.cs.resx | 6 + TBF/Resources/Strings.resx | 6 + TBF/Rig/TbfComponents.cs | 2 + TBF/Rig/Various/Clamping/Component.cs | 27 +++ TBF/Rig/Various/Clamping/Configuration.cs | 160 ++++++++++++++++++ TBF/Rig/Various/Clamping/Factory.cs | 26 +++ TBF/Rig/Various/CoverTest/CoverTest.cs | 37 ++-- TBF/Rig/Various/CoverTest/CoverTestCfg.cs | 7 +- TBF/Rig/Various/CoverTest/Factory.cs | 3 +- TBF/TBF.csproj | 3 + 21 files changed, 346 insertions(+), 31 deletions(-) create mode 100644 SchematicDrawing/Pictures/Clamping-XL-off.png create mode 100644 SchematicDrawing/Pictures/Clamping-XL-on.png create mode 100644 SchematicDrawing/Pictures/Cover-XL-off.png create mode 100644 SchematicDrawing/Pictures/Cover-XL-on.png create mode 100644 TBF/Rig/Various/Clamping/Component.cs create mode 100644 TBF/Rig/Various/Clamping/Configuration.cs create mode 100644 TBF/Rig/Various/Clamping/Factory.cs diff --git a/SchematicDrawing/DrawingShape.cs b/SchematicDrawing/DrawingShape.cs index 81b2e9878..aef66bc4e 100644 --- a/SchematicDrawing/DrawingShape.cs +++ b/SchematicDrawing/DrawingShape.cs @@ -581,6 +581,22 @@ namespace SchematicDrawing Shapes[DrShIx(Shape.UniCB, Sz.M)] = Shapes[DrShIx(Shape.UniCB, Sz.L)]; Shapes[DrShIx(Shape.UniCB, Sz.XL)] = Shapes[DrShIx(Shape.UniCB, Sz.L)]; + /// Clamping device + Shapes[DrShIx(Shape.Clamping, Sz.XL)] = new DrawingShape(Shape.Clamping, Sz.XL, 5, 5, new Node[] { }, null, 0, 0, 50, 50, + Properties.Resources.Clamping_XL_on, + Properties.Resources.Clamping_XL_off); + Shapes[DrShIx(Shape.Clamping, Sz.S)] = Shapes[DrShIx(Shape.Clamping, Sz.XL)]; + Shapes[DrShIx(Shape.Clamping, Sz.M)] = Shapes[DrShIx(Shape.Clamping, Sz.XL)]; + Shapes[DrShIx(Shape.Clamping, Sz.L)] = Shapes[DrShIx(Shape.Clamping, Sz.XL)]; + + /// Cover device + Shapes[DrShIx(Shape.Cover, Sz.XL)] = new DrawingShape(Shape.Cover, Sz.XL, 6, 5, new Node[] { }, null, 0, 0, 60, 50, + Properties.Resources.Cover_XL_on, + Properties.Resources.Cover_XL_off); + Shapes[DrShIx(Shape.Cover, Sz.S)] = Shapes[DrShIx(Shape.Cover, Sz.XL)]; + Shapes[DrShIx(Shape.Cover, Sz.M)] = Shapes[DrShIx(Shape.Cover, Sz.XL)]; + Shapes[DrShIx(Shape.Cover, Sz.L)] = Shapes[DrShIx(Shape.Cover, Sz.XL)]; + /// Emergency stop Shapes[DrShIx(Shape.EmergencyStop, Sz.XL)] = new DrawingShape(Shape.EmergencyStop, Sz.XL, 5, 5, new Node[] { }, null, 0, 0, 50, 50, Properties.Resources.EmergencyStop_XL_on, diff --git a/SchematicDrawing/Enums.cs b/SchematicDrawing/Enums.cs index 9938bc885..7ad5dc782 100644 --- a/SchematicDrawing/Enums.cs +++ b/SchematicDrawing/Enums.cs @@ -29,8 +29,11 @@ namespace SchematicDrawing public enum Shape { Ambient, + Clamping, + Cover, Cross, Div, + EmergencyStop, FlowM, Junction, Knee, @@ -44,11 +47,10 @@ namespace SchematicDrawing Tank, Tee, TempM, + UniCB, Vacuum, Valve, WaterM, - UniCB, - EmergencyStop, Count } diff --git a/SchematicDrawing/Pictures/Clamping-XL-off.png b/SchematicDrawing/Pictures/Clamping-XL-off.png new file mode 100644 index 0000000000000000000000000000000000000000..27635d50beb1134f99bc2902fde5a9934ac20337 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nC-#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DinK$vl=HlH+5aD}IfV@QVc+Z%>_O$HJU4;Q&7l$NAC`KMk` zQc`02lC?+R($-}!8T#$tN1yt|WPgFr@_9VhgP?1dja!ZhNI7R5YWee5p>Fxkn610* zQ!+=dqDk8Y z38%-$x{e9VvN#-fJK`&!=DQPLa(EW5Y?JxA=KCj+R_x5Q`!lvI6;>1s;*b3=DinK$vl=HlH+5aFwTvV@QVc+Z%zr%?2V47x^?N8!$^K%xpY4 zyHVA+fl+0_LcSYLS_zfRMU^|BFaN8wb0P1R=~1tPgkIdLsA{_);grnbJ8QyzyN>N2 zFQ)CE{VRQTuJ#`{CBf>V{tHiTzPWyV!_E8eYwFiO{yy_{h01iXUPTkR(oCL(hAqbg zq?|K&7Jf`{1sXB$tekCxYra%r_%f5W3oXvyqFx8yTLd;9sKe9A>nDQ(liJdKKYFhM PUCrR>>gTe~DWM4f<1uEJ literal 0 HcmV?d00001 diff --git a/SchematicDrawing/Pictures/Cover-XL-off.png b/SchematicDrawing/Pictures/Cover-XL-off.png new file mode 100644 index 0000000000000000000000000000000000000000..6d0245e6a486a7d0253074203783c169a51a4c41 GIT binary patch literal 510 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0h38YK~!i%?U-F| zgD?;VNl(CIPuHs;u9DOBksGx6BwI2Y|J%FkfJdt8hl*xAYe0D%$MLt^h%fW|Hca8G zGlj2?`dxZmSF;N9`iy4Pj;L^sT#8nCR^c9kA!@~0go{LTK-*HLYm-8iwJ9vHn7t2g@M9oTf~ILD+AAY)+r36&N7h}6;`QC&?^iS zDvJwiSJo{IBq}@qLq%A#vRdJjG-qXUZPxF!QoOy~2VNGc@N6PBS@jIFjdnm5s1^oY zD+i8-yRqtb>28$+Rq6HhA4`-#r6`dRrVJt6RGG;7s=BD3VN3B@E~x4<%t&WfhG?ZM z7^bl0RNAfVkp$TrWf)sHL8&Yl?k=4pfxoGd1>-%I64Z)X9o0!5^X9{1Pn+Y$=Kl^siQH)F|IRF3v07*qoM6N<$f@ieZ Aq5uE@ literal 0 HcmV?d00001 diff --git a/SchematicDrawing/Pictures/Cover-XL-on.png b/SchematicDrawing/Pictures/Cover-XL-on.png new file mode 100644 index 0000000000000000000000000000000000000000..9c0fbb985739ab3a24b321c6dece570402137ad8 GIT binary patch literal 382 zcmV-^0fGLBP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0TW3?K~!i%?b%xn zf-n$;VPFM3x;nQ)x)oRFBRf#WObwToUI@^hnLjbkqhF>)6WehdKaHR|eixI1(Ni#b zw?C!(zURr`^ci_N-lgCeoU3ZUxxjVBgOi}IHxH|x4;~5z2cbTktCGRH&=lmnlfZ|+ zmb_Sk=3-AQ8%$6qwos@o3tS`AmJIe{D=7)Q!B(=>dC_1ew!)&oC|D{8M#56NU^Fb{ z1tVgqxQ7-9mU4nO+XX7TVW90&8}MSgU|4DaMn1|m|B(jVE)~ARVEw`9ch@F&!&3Tz zr5tBUk2HG1!Ql6o>LmP}oTqmfy>@zC_J??GMg5spTe6SzFbq81pD~6fJ<^9#FnS6` cPZ+pqzS?48CH91j1poj507*qoM6N<$f_R>p&j0`b literal 0 HcmV?d00001 diff --git a/SchematicDrawing/Properties/Resources.Designer.cs b/SchematicDrawing/Properties/Resources.Designer.cs index 92e8e5ef0..fad9b2f68 100644 --- a/SchematicDrawing/Properties/Resources.Designer.cs +++ b/SchematicDrawing/Properties/Resources.Designer.cs @@ -60,6 +60,46 @@ namespace SchematicDrawing.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Clamping_XL_off { + get { + object obj = ResourceManager.GetObject("Clamping_XL_off", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Clamping_XL_on { + get { + object obj = ResourceManager.GetObject("Clamping_XL_on", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Cover_XL_off { + get { + object obj = ResourceManager.GetObject("Cover_XL_off", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Cover_XL_on { + get { + object obj = ResourceManager.GetObject("Cover_XL_on", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/SchematicDrawing/Properties/Resources.resx b/SchematicDrawing/Properties/Resources.resx index a87ab6579..2546e19f8 100644 --- a/SchematicDrawing/Properties/Resources.resx +++ b/SchematicDrawing/Properties/Resources.resx @@ -382,4 +382,16 @@ ..\Pictures\EmergencyStop-XL-on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Pictures\Clamping-XL-off.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Pictures\Clamping-XL-on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Pictures\Cover-XL-off.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Pictures\Cover-XL-on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/SchematicDrawing/SchematicDrawing.csproj b/SchematicDrawing/SchematicDrawing.csproj index ac24cfe68..de57fbf5f 100644 --- a/SchematicDrawing/SchematicDrawing.csproj +++ b/SchematicDrawing/SchematicDrawing.csproj @@ -94,6 +94,10 @@ + + + + diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index f7ab9a3f2..1a2f92849 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.1.1856.0")] -[assembly: AssemblyFileVersion("3.1.1856.0")] +[assembly: AssemblyVersion("3.1.1857.0")] +[assembly: AssemblyFileVersion("3.1.1857.0")] diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index 29e62b45c..4f7700020 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -807,6 +807,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Clamping. + /// + internal static string Clamping { + get { + return ResourceManager.GetString("Clamping", resourceCulture); + } + } + /// /// Looks up a localized string similar to Class. /// @@ -1140,6 +1149,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Cover. + /// + internal static string Cover { + get { + return ResourceManager.GetString("Cover", resourceCulture); + } + } + /// /// Looks up a localized string similar to Create DB. /// diff --git a/TBF/Resources/Strings.cs.resx b/TBF/Resources/Strings.cs.resx index 6a0b0a8fc..376d2f97e 100644 --- a/TBF/Resources/Strings.cs.resx +++ b/TBF/Resources/Strings.cs.resx @@ -1704,4 +1704,10 @@ Spracování statistik + + Upínač + + + Kryt + \ No newline at end of file diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index abea1244e..1827e1b78 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -2359,4 +2359,10 @@ Processing statistics + + Clamping + + + Cover + \ No newline at end of file diff --git a/TBF/Rig/TbfComponents.cs b/TBF/Rig/TbfComponents.cs index dcc0c0321..087bce075 100644 --- a/TBF/Rig/TbfComponents.cs +++ b/TBF/Rig/TbfComponents.cs @@ -186,6 +186,8 @@ namespace TBF.Rig Factories.Add(new TestMethods.StandingStartMassCollection.HeatMeters.Factory()); Factories.Add(new BuiltIn.Valve.ValveFactory()); Factories.Add(new BuiltIn.ValveEx.ValveFactory()); + Factories.Add(new Various.Clamping.Factory()); + Factories.Add(new Various.CoverTest.Factory()); Factories.Add(new Various.Drawing.Junction.Factory()); Factories.Add(new Various.Drawing.Knee.Factory()); Factories.Add(new Various.Drawing.Pipes.Factory()); diff --git a/TBF/Rig/Various/Clamping/Component.cs b/TBF/Rig/Various/Clamping/Component.cs new file mode 100644 index 000000000..b63fa1b1d --- /dev/null +++ b/TBF/Rig/Various/Clamping/Component.cs @@ -0,0 +1,27 @@ +/// +/// Copyright (c) 2022 Sensus Slovensko a.s. +/// +using log4net; + +namespace TBF.Rig.Various.Clamping +{ + public class Component : ComponentBase, SchematicDrawing.IDrawingItCmpnt + { + private static readonly ILog log = LogManager.GetLogger(typeof(Component)); + public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); } + + readonly Configuration myCfg; + public SchematicDrawing.IDrawingItem DrawingItem { get { return myCfg as SchematicDrawing.IDrawingItem; } } + + public Component() { } + + public Component(Generic.IComponentCfg cfg) + : base(cfg) + { + myCfg = cfg as Configuration; + log.Warn(this.ToString()); + } + + public override void Initialize() { } + } +} diff --git a/TBF/Rig/Various/Clamping/Configuration.cs b/TBF/Rig/Various/Clamping/Configuration.cs new file mode 100644 index 000000000..d8c35da1d --- /dev/null +++ b/TBF/Rig/Various/Clamping/Configuration.cs @@ -0,0 +1,160 @@ +/// +/// Copyright (c) 2022 Sensus Slovensko a.s. +/// +using System.Collections.Generic; +using System.Xml.Serialization; +using Common; +using Config.Entities; +using SchematicDrawing; +using TBF.Resources; +using TBF.Rig.Generic; + +namespace TBF.Rig.Various.Clamping +{ + public class Configuration : ComponentCfgBase, IComponentCfg, IParamsProvider, IRouteBasedDrawingItem + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public IComponentCfgCtrl GetControl(IList cmpntEntities) + { + return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); + } + + /// + /// Serialized parameters + /// + public int BitNr { get; set; } /// Bit-position + public bool Inverted { get; set; } /// When true the valve function is inverted: 0 = open, 1 = closed + + 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 GNodes { get; set; } + [XmlIgnore] + public IList EdgesToSet { get; set; } + + public Configuration() + { + GNodes = new List(); + EdgesToSet = new List(); + } + + public Configuration(string name, IComponentFactory factory) + : this() + { + Name = name; + ParentName = string.Empty; + Factory = factory; + Shape = Shape.Clamping; + Sz = Sz.XL; + LblX = 43; + LblY = 22; + + InitializeAll(); + } + + public string ComponentName { get { return Name; } } + + public void InitializeAll() + { + BitNr = 97; + Inverted = false; + } + + string[] paramNames = new string[] + { + "Bit number", + "Inverted", + }; + public string ParamName(int i) { return paramNames[i]; } + public int ParamsCount() { return paramNames.Length; } + + public ICollection ParamValues(int i) + { + switch (i) + { + default: + case 0: + return null; + case 1: + return new string[] { Strings.yes, Strings.no }; + } + } + + public string ToString(int i) + { + switch (i) + { + case 0: + return BitNr.ToString(); + case 1: + return Inverted ? Strings.yes : Strings.no; + default: + return string.Format("name={0} x={1} y={2} sz={3} orient={4}", Name, X, Y, Sz, Orient); + } + } + + public CfgUpdateFlags UpdateParam(int i, string str) + { + switch (i) + { + case 0: + BitNr = int.Parse(str); + return CfgUpdateFlags.RestartRqrd; + case 1: + Inverted = str == Strings.yes; + return CfgUpdateFlags.RestartRqrd; + default: + return CfgUpdateFlags.None; + } + } + + public bool ValidateParam(int i, string str, out string message) + { + message = string.Empty; + int idummy; + switch (i) + { + case 0: + if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 254) return true; + break; + case 1: + if (ParamValues(i).Contains(str)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + void CopyContentTo(Configuration prms) + { + prms.BitNr = BitNr; + prms.Inverted = Inverted; + } + + public IParamsProvider Clone() + { + Configuration pars = new Configuration(); + CopyContentTo(pars); + return pars; + } + + public bool UpdateEmbeddedDbEntity() + { + return true; /// =OK, do nothing + } + } +} diff --git a/TBF/Rig/Various/Clamping/Factory.cs b/TBF/Rig/Various/Clamping/Factory.cs new file mode 100644 index 000000000..a630b65b8 --- /dev/null +++ b/TBF/Rig/Various/Clamping/Factory.cs @@ -0,0 +1,26 @@ +/// +/// Copyright (c) 2022 Sensus Slovensko a.s. +/// +using System.Collections.Generic; +using TBF.Resources; +using TBF.Rig.Generic; + +namespace TBF.Rig.Various.Clamping +{ + public class Factory : IComponentFactory + { + public string ClassName { get { return this.GetType().Namespace.Substring(8); } } + public override string ToString() { return ClassName; } + + public IComponent DummyComponent() { return new Component(); } + + public IComponent GetComponent(IComponentCfg cfg, IList components) { return new Component(cfg); } + + public IComponentCfg DefaultConfig() { return new Configuration(Strings.Clamping, this); } + + public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component) + { + return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this); + } + } +} diff --git a/TBF/Rig/Various/CoverTest/CoverTest.cs b/TBF/Rig/Various/CoverTest/CoverTest.cs index 82ec55810..5b542ea8a 100644 --- a/TBF/Rig/Various/CoverTest/CoverTest.cs +++ b/TBF/Rig/Various/CoverTest/CoverTest.cs @@ -15,15 +15,12 @@ namespace TBF.Rig.Various.CoverTest { private static readonly ILog log = LogManager.GetLogger(typeof(CoverTest)); private static readonly ILog bypassLog = LogManager.GetLogger("BypassLog"); - public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); } - readonly CoverTestCfg coverTestCfg; - - readonly IControlBoard controlBoard; - - int bitPosition; /// 0 .. 127 - UInt128 mask; /// derived from bitPosition in the constructor + readonly CoverTestCfg myCfg; + + public int BitPosition { get { return myCfg == null ? 0: myCfg.BitNr; } } + public UInt128 Mask; /// derived from bitPosition in the constructor UInt128 target; string message; Common.GID[] bypassLevel; @@ -34,26 +31,22 @@ namespace TBF.Rig.Various.CoverTest public CoverTest(Generic.IComponentCfg cfg, IList components) : base(cfg) { - coverTestCfg = cfg as CoverTestCfg; - - controlBoard = TbfComponents.FindComponent(cfg.ParentName, components) as IControlBoard; - if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); - - log.Warn(this.ToString()); + myCfg = cfg as CoverTestCfg; } public override void Initialize() { - bitPosition = coverTestCfg.BitNr; - mask = (((UInt128)1) << coverTestCfg.BitNr); - target = coverTestCfg.Inverted ? 0 : mask; - message = coverTestCfg.Message; + Mask = (((UInt128)1) << BitPosition); + target = myCfg.Inverted ? 0 : Mask; + message = myCfg.Message; var groups = new List(); - if (coverTestCfg.BypassGroup1 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup1); - if (coverTestCfg.BypassGroup2 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup2); - if (coverTestCfg.BypassGroup3 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup3); - if (coverTestCfg.BypassGroup4 != Common.GID.None) groups.Add(coverTestCfg.BypassGroup4); + if (myCfg.BypassGroup1 != Common.GID.None) groups.Add(myCfg.BypassGroup1); + if (myCfg.BypassGroup2 != Common.GID.None) groups.Add(myCfg.BypassGroup2); + if (myCfg.BypassGroup3 != Common.GID.None) groups.Add(myCfg.BypassGroup3); + if (myCfg.BypassGroup4 != Common.GID.None) groups.Add(myCfg.BypassGroup4); bypassLevel = groups.ToArray(); + + log.FatalFormat("{0} - Successfully initialized", Name); } @@ -108,7 +101,7 @@ namespace TBF.Rig.Various.CoverTest /// Event.ResultsPrinted public Event Run() { - bool conditionMet = ((controlBoard.Route & mask) == target); + bool conditionMet = ((StateMachine.ControlBoard.Route & Mask) == target); if (completed || conditionMet) { diff --git a/TBF/Rig/Various/CoverTest/CoverTestCfg.cs b/TBF/Rig/Various/CoverTest/CoverTestCfg.cs index 1a927dd6a..766a180b0 100644 --- a/TBF/Rig/Various/CoverTest/CoverTestCfg.cs +++ b/TBF/Rig/Various/CoverTest/CoverTestCfg.cs @@ -59,9 +59,8 @@ namespace TBF.Rig.Various.CoverTest public CoverTestCfg(string name, IComponentFactory factory) : this() { - //Shape = Shape.RtBasedArrow; - Shape = Shape.Pump; - Sz = Sz.M; + Shape = Shape.Cover; + Sz = Sz.XL; Name = name; Factory = factory; ParentName = string.Empty; @@ -72,7 +71,7 @@ namespace TBF.Rig.Various.CoverTest public void InitializeAll() { - BitNr = 22; + BitNr = 80; Inverted = false; Message = Strings.Close_the_cover; BypassGroup1 = GID.TestingSpecialists; diff --git a/TBF/Rig/Various/CoverTest/Factory.cs b/TBF/Rig/Various/CoverTest/Factory.cs index 8f8db8ab3..97ccf410e 100644 --- a/TBF/Rig/Various/CoverTest/Factory.cs +++ b/TBF/Rig/Various/CoverTest/Factory.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2017-2021 Sensus Slovensko a.s. /// using System.Collections.Generic; +using TBF.Resources; using TBF.Rig.Generic; namespace TBF.Rig.Various.CoverTest @@ -15,7 +16,7 @@ namespace TBF.Rig.Various.CoverTest public IComponent GetComponent(IComponentCfg cfg, IList components) { return new CoverTest(cfg, components); } - public IComponentCfg DefaultConfig() { return new CoverTestCfg("Cover", this); } + public IComponentCfg DefaultConfig() { return new CoverTestCfg(Strings.Cover, this); } public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component) { diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index c856bd1ca..c1906c02c 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -1709,6 +1709,9 @@ + + +