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
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using log4net;
namespace TBF.BenchControl.Various.Drawing.Bypass
{
public class Component : ComponentBase, SchematicDrawing.IDrawingItemCmpnt
{
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.IDrawingItemCfg DrawingItemCfg { get { return myCfg as SchematicDrawing.IDrawingItemCfg; } }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as Configuration;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,91 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Bypass
{
public class Configuration : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
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; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public Orient ValOrient { get; set; }
public Configuration() { }
public Configuration(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
Shape = SchematicDrawing.Shape.Bypass;
Sz = Sz.K1;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ComponentName { get { return Name; } }
public void InitializeAll() { }
string[] paramNames = new string[0] { };
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
return string.Format("name={0} x={1} y={2} sz={3} orient={4}", Name, X, Y, Sz, Orient);
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
return CfgUpdateFlags.None;
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = "Invalid index";
return false;
}
void CopyContentTo(Configuration prms) { }
public Config.Entities.IParamsProvider Clone()
{
Configuration pars = new Configuration();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Bypass
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new Configuration(this.GetType().Namespace.Substring(33), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this);
}
}
}
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using log4net;
namespace TBF.BenchControl.Various.Drawing.Cross
{
public class Component : ComponentBase, SchematicDrawing.IDrawingItemCmpnt
{
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.IDrawingItemCfg DrawingItemCfg { get { return myCfg as SchematicDrawing.IDrawingItemCfg; } }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as Configuration;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,91 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Cross
{
public class Configuration : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
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; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public Orient ValOrient { get; set; }
public Configuration() { }
public Configuration(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
Shape = SchematicDrawing.Shape.Cross;
Sz = Sz.K1;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ComponentName { get { return Name; } }
public void InitializeAll() { }
string[] paramNames = new string[0] { };
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
return string.Format("name={0} x={1} y={2} sz={3} orient={4}", Name, X, Y, Sz, Orient);
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
return CfgUpdateFlags.None;
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = "Invalid index";
return false;
}
void CopyContentTo(Configuration prms) { }
public Config.Entities.IParamsProvider Clone()
{
Configuration pars = new Configuration();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Cross
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new Configuration(this.GetType().Namespace.Substring(33), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this);
}
}
}
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using log4net;
namespace TBF.BenchControl.Various.Drawing.Edges
{
public class Component : ComponentBase, SchematicDrawing.IDrawingItemCmpnt
{
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.IDrawingItemCfg DrawingItemCfg { get { return myCfg as SchematicDrawing.IDrawingItemCfg; } }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as Configuration;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,143 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Edges
{
public class Configuration : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
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; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public Orient ValOrient { get; set; }
///
public string[] Edges { get; set; }
public Configuration() { }
///
public Configuration(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
Shape = Shape.Edges;
Edges = new string[0];
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
Sz = Sz.S;
Edges = new string[0];
}
string[] paramNames = new string[] { "Size" };
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i)
{
if (i == 0)
{
IList<string> values = new List<string>();
for (var size = Sz.S; size <= Sz.XL; size++) values.Add(size.ToString());
return values;
}
return null;
}
public string ToString(int i)
{
if (i == -1) return string.Format("name={0} sz={1}", Name, Sz);
if (i == 0) return Sz.ToString();
return string.Empty;
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
for (var size = Sz.S; size <= Sz.XL; size++)
{
if (strValue == size.ToString())
{
Sz = size;
return CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd;
}
}
break;
}
return CfgUpdateFlags.None;
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
switch (i)
{
case 0:
for (var size = Sz.S; size <= Sz.XL; size++)
{
if (strValue == size.ToString()) return true;
}
message = string.Format("Invalid '{0}'", ParamName(i));
return false;
default:
message = "Invalid index";
return false;
}
}
void CopyContentTo(Configuration prms)
{
prms.Shape = this.Shape;
prms.Sz = this.Sz;
prms.Edges = new string[this.Edges.Length];
for (int i = 0; i < this.Edges.Length; i++)
{
prms.Edges[i] = this.Edges[i];
}
}
public Config.Entities.IParamsProvider Clone()
{
Configuration pars = new Configuration();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Edges
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new Configuration(this.GetType().Namespace.Substring(33), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this);
}
}
}
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using log4net;
namespace TBF.BenchControl.Various.Drawing.Junction
{
public class Component : ComponentBase, SchematicDrawing.IDrawingItemCmpnt
{
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.IDrawingItemCfg DrawingItemCfg { get { return myCfg as SchematicDrawing.IDrawingItemCfg; } }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as Configuration;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,90 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Junction
{
public class Configuration : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
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; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public Orient ValOrient { get; set; }
public Configuration() { }
public Configuration(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
Shape = Shape.Junction;
Sz = Sz.S;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ComponentName { get { return Name; } }
public void InitializeAll() { }
string[] paramNames = new string[0] { };
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
return string.Format("name={0} x={1} y={2} sz={3} orient={4}", Name, X, Y, Sz, Orient);
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
return CfgUpdateFlags.None;
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = "Invalid index";
return false;
}
void CopyContentTo(Configuration prms) { }
public Config.Entities.IParamsProvider Clone()
{
Configuration pars = new Configuration();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Junction
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new Configuration("J", this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this);
}
}
}
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using log4net;
namespace TBF.BenchControl.Various.Drawing.Knee
{
public class Component : ComponentBase, SchematicDrawing.IDrawingItemCmpnt
{
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.IDrawingItemCfg DrawingItemCfg { get { return myCfg as SchematicDrawing.IDrawingItemCfg; } }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as Configuration;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,91 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Knee
{
public class Configuration : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
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; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public Orient ValOrient { get; set; }
public Configuration() { }
public Configuration(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
Shape = SchematicDrawing.Shape.Knee;
Sz = Sz.K1;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ComponentName { get { return Name; } }
public void InitializeAll() { }
string[] paramNames = new string[0] { };
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
return string.Format("name={0} x={1} y={2} sz={3} orient={4}", Name, X, Y, Sz, Orient);
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
return CfgUpdateFlags.None;
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = "Invalid index";
return false;
}
void CopyContentTo(Configuration prms) { }
public Config.Entities.IParamsProvider Clone()
{
Configuration pars = new Configuration();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Knee
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new Configuration(this.GetType().Namespace.Substring(33), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this);
}
}
}
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using log4net;
namespace TBF.BenchControl.Various.Drawing.Tee
{
public class Component : ComponentBase, SchematicDrawing.IDrawingItemCmpnt
{
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.IDrawingItemCfg DrawingItemCfg { get { return myCfg as SchematicDrawing.IDrawingItemCfg; } }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
myCfg = cfg as Configuration;
log.Debug(this.ToString());
}
}
}
@@ -0,0 +1,91 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Tee
{
public class Configuration : ComponentCfgBase, IComponentCfg, Config.Entities.IParamsProvider, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(Configuration) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
///
/// Serialized parameters
///
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; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public Orient ValOrient { get; set; }
public Configuration() { }
public Configuration(string name, IComponentFactory factory)
: this()
{
Name = name;
ParentName = string.Empty;
Factory = factory;
Shape = SchematicDrawing.Shape.Tee;
Sz = Sz.K1;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ComponentName { get { return Name; } }
public void InitializeAll() { }
string[] paramNames = new string[0] { };
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
return string.Format("name={0} x={1} y={2} sz={3} orient={4}", Name, X, Y, Sz, Orient);
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
return CfgUpdateFlags.None;
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = "Invalid index";
return false;
}
void CopyContentTo(Configuration prms) { }
public Config.Entities.IParamsProvider Clone()
{
Configuration pars = new Configuration();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}
@@ -0,0 +1,27 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Various.Drawing.Tee
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new Configuration(this.GetType().Namespace.Substring(33), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(Configuration.Serializer, component, this);
}
}
}
@@ -15,7 +15,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
private static readonly ILog log = LogManager.GetLogger(typeof(Errors));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(-1));
}
///
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Errors.ResetStaticProperties(); }
@@ -10,6 +10,7 @@ namespace TBF.BenchControl.Various.ManualLevelMsrmnt
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { ManualLevelMsrmnt.ResetStaticProperties(); }
@@ -10,6 +10,7 @@ namespace TBF.BenchControl.Various.StatisticsMonitoring
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { ProcessStatistics.ResetStaticProperties(); }
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Various.TankWithLevelMsrmnt
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Tank.ResetStaticProperties(); }