diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-19 14:05:34 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-19 14:05:34 +0300 |
| commit | 48c5d636927f832497e8939a8423ecd1c16892d7 (patch) | |
| tree | 2eac011bc0aca659131992408d8d9abd61494ed5 /Software/Visual_Studio | |
| parent | 1c64e05e5eb5fabe1548c124cbfb8aaab2d1c401 (diff) | |
| download | Tango-48c5d636927f832497e8939a8423ecd1c16892d7.tar.gz Tango-48c5d636927f832497e8939a8423ecd1c16892d7.zip | |
Implemented hardware parameter description and range through DB and observables generator.
Diffstat (limited to 'Software/Visual_Studio')
76 files changed, 198 insertions, 34 deletions
diff --git a/Software/Visual_Studio/Tango.BL/DTO/HardwareBlowerDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/HardwareBlowerDTOBase.cs index 4420c2d2c..9fb6b0bdd 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/HardwareBlowerDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/HardwareBlowerDTOBase.cs @@ -18,6 +18,11 @@ using Tango.BL.Entities; namespace Tango.BL.DTO { + + /// <summary> + /// + /// </summary> + public abstract class HardwareBlowerDTOBase : ObservableEntityDTO<HardwareBlowerDTO, HardwareBlower> { diff --git a/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs b/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs index 4a96510da..f88efdb71 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/AddressBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs index f6a8854df..1671069b3 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs index d47ba801f..c54fe23d6 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs index 76c803d5f..0e06e48db 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs index 7397d952d..e02d3f613 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStopBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs index c7bbdf4f7..6281c7606 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CartridgeTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs index 3805844b5..17bfd3f87 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CatBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs index 70cdedadd..92f4f17b9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CctBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs index bf54d2ad2..da3c15c5c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs index 0fd915fc2..3e0491ec5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsGroupBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs index 31bc845d4..fe026fc32 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs index 89d0a6061..a0a324b9f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalogsItemsRecipeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs index 08a2b31fe..9098a2eab 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorSpaceBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs index d0e9eb1d9..6b19ebb7f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ConfigurationBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs index 20e684270..610fcc27b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ContactBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs index 4c802446b..1d3dd576c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CustomerBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs b/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs index 986ecd683..a908da29c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/DispenserBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs index c2cde91c5..04f4dc261 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/DispenserTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs index 2cfba9f3f..148d53c6c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs index 7bbcb5780..f0100fe06 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EventTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs index ff241b784..cdc9bb76c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/FiberShapeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs b/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs index 847c078f5..d04050c4a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/FiberSynthBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs index 457de376e..0919d54c2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerBase.cs @@ -18,9 +18,15 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { + + /// <summary> + /// + /// </summary> + [Table("HARDWARE_BLOWERS")] public abstract class HardwareBlowerBase : ObservableEntity<HardwareBlower> { @@ -46,14 +52,14 @@ namespace Tango.BL.Entities [Column("HARDWARE_BLOWER_TYPE_GUID")] [ForeignKey("HardwareBlowerType")] - public String HardwareBlowerTypeGuid + public String HardwareBlowerTypeGuid { - get + get { - return _hardwareblowertypeguid; + return _hardwareblowertypeguid; } - set + set { if (_hardwareblowertypeguid != value) { @@ -72,14 +78,14 @@ namespace Tango.BL.Entities [Column("HARDWARE_VERSION_GUID")] [ForeignKey("HardwareVersion")] - public String HardwareVersionGuid + public String HardwareVersionGuid { - get + get { - return _hardwareversionguid; + return _hardwareversionguid; } - set + set { if (_hardwareversionguid != value) { @@ -97,14 +103,14 @@ namespace Tango.BL.Entities [Column("ENABLED")] - public Boolean Enabled + public Boolean Enabled { - get + get { - return _enabled; + return _enabled; } - set + set { if (_enabled != value) { @@ -119,19 +125,22 @@ namespace Tango.BL.Entities protected Double _voltage; /// <summary> - /// Gets or sets the hardwareblowerbase voltage. + /// Voltage Description /// </summary> [Column("VOLTAGE")] - public Double Voltage + [Description("Voltage Description")] + [Range(10.1, 300.2)] + + public Double Voltage { - get + get { - return _voltage; + return _voltage; } - set + set { if (_voltage != value) { @@ -151,14 +160,14 @@ namespace Tango.BL.Entities [Column("HEATING_VOLTAGE")] - public Double HeatingVoltage + public Double HeatingVoltage { - get + get { - return _heatingvoltage; + return _heatingvoltage; } - set + set { if (_heatingvoltage != value) { @@ -178,14 +187,14 @@ namespace Tango.BL.Entities [Column("ACTIVE")] - public Boolean Active + public Boolean Active { - get + get { - return _active; + return _active; } - set + set { if (_active != value) { @@ -207,12 +216,12 @@ namespace Tango.BL.Entities [JsonIgnore] public virtual HardwareBlowerType HardwareBlowerType { - get + get { - return _hardwareblowertype; + return _hardwareblowertype; } - set + set { if (_hardwareblowertype != value) { @@ -239,12 +248,12 @@ namespace Tango.BL.Entities [JsonIgnore] public virtual HardwareVersion HardwareVersion { - get + get { - return _hardwareversion; + return _hardwareversion; } - set + set { if (_hardwareversion != value) { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs index 676b1204c..dc614bd0c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs index 2ea472ddb..9cbaac688 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs index 710bb3cb8..5d69f19b5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs index 50e94ed33..a3fa5c1aa 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs index 3ed758575..3cd885790 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs index 54bea3973..e08a2b5b0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs index b6f5f464c..a63a148da 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs index 14b6b746c..e12e40f32 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs index bec6675b6..dbb8d2a1d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs index 4399c8557..3b7bb1e72 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs index d7bde826d..74ff9761d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs index 3989e96e9..c3bc80696 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs index 2213e8956..4c2808581 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs index 82d4699a2..8c8055c1e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs b/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs index 6c2ac7cba..b3e62f1fe 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/IdsPackBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs b/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs index 580f72b6e..0108dc3f5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormulaBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs index 1c5cd6bbc..c5354f2c7 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index ca534fff1..4d53a6d66 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs index 7d97e2ea4..ccd78a60b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnitBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs index 7076c5485..7683eadbc 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs index 30ea371d7..5aad28034 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidTypesRmlBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs index 79a4e48f0..6c59e43ba 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs index 29d916bc6..83bf72451 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs index aa44417c0..30602025e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs index 3940cc919..5091267e8 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachinesEventBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs index 89d04cf7b..12405642a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaConditionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs index 9bbd36c9e..2d0529506 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaMaterialBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs index 99bd98b4e..91fd93bd4 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaPurposBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs index c15bfd1ce..2467bcd8c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MidTankTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs index 37d44e100..b19cb6fc1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/OrganizationBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs index f040710e6..7f6ba7499 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/PermissionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs index 94ae5b20a..2757b0625 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTableBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs index 09edc7012..79e252b44 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroupBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs index bc97a2618..586d109ff 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RmlBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs index 4bd76f3a3..cca6b7600 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RoleBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs index aa46ba8ce..bdaaaac3c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/RolesPermissionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs index 07c7a09e0..40f86a34c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SegmentBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs index fd10b4f90..5794da91b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs index c2115daf4..55edff2e0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolTypeBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs index b71c0bc2f..91b1ca9ac 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SyncConfigurationBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs b/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs index db323c29a..2e99df9b0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SysdiagramBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs index 581bd85d7..a7bb72137 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/TangoVersionBase.cs @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs index 958754a60..24d61bb0a 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs @@ -66,6 +66,8 @@ namespace Tango.CodeGeneration public String DbDescription { get; set; } + public RangeDescriptionModel RangeDescription { get; set; } + public bool IsForeignKey { get; set; } public String ForeignKeyName { get; set; } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/RangeDescriptionModel.cs b/Software/Visual_Studio/Tango.CodeGeneration/RangeDescriptionModel.cs new file mode 100644 index 000000000..4600460b7 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/RangeDescriptionModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class RangeDescriptionModel + { + public String Description { get; set; } + public double Min { get; set; } + public double Max { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index a3b02afd5..6bff5b42e 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -77,6 +77,7 @@ <Compile Include="ProtoEnumFile.cs" /> <Compile Include="ProtoMessageFile.cs" /> <Compile Include="ProtoProperty.cs" /> + <Compile Include="RangeDescriptionModel.cs" /> <Compile Include="TangoDAOJavaFile.cs" /> <Compile Include="EnumerationFileJava.cs" /> <Compile Include="EnumerationFile.cs" /> @@ -128,7 +129,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index b5d47edab..950e24f79 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { @@ -66,6 +67,13 @@ namespace Tango.BL.Entities @(prop.IsForeignKey ? "[ForeignKey(\"" + prop.ForeignKeyName + "\")]" : "") @(prop.XmlIgnore ? "[XmlIgnore]" : "") @(prop.XmlIgnore ? "[JsonIgnore]" : "") + @if (prop.RangeDescription != null) + { + <div> + [Description("@(prop.RangeDescription.Description)")] + [Range(@(prop.RangeDescription.Min),@(prop.RangeDescription.Max))] + </div> + } public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { get { return _@(prop.Name.ToLower()); } diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs index 3b1c5f271..7107b9ee9 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IParameterizedExtensions.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; using System.Text; @@ -95,6 +97,22 @@ public static class IParameterizedExtensions item.Name = attribute.Name; } } + else + { + //Try get description and range attributes + DescriptionAttribute desAtt = propertyInfo.GetCustomAttribute<DescriptionAttribute>(); + if (desAtt != null) + { + item.Description = desAtt.Description; + } + + RangeAttribute rangeAtt = propertyInfo.GetCustomAttribute<RangeAttribute>(); + if (rangeAtt != null) + { + item.Minimum = rangeAtt.Minimum; + item.Maximum = rangeAtt.Maximum; + } + } if (mode == ParameterItemMode.Event) { diff --git a/Software/Visual_Studio/Tango.Core/ParameterItem.cs b/Software/Visual_Studio/Tango.Core/ParameterItem.cs index 01a9bf72c..ee7acfdd0 100644 --- a/Software/Visual_Studio/Tango.Core/ParameterItem.cs +++ b/Software/Visual_Studio/Tango.Core/ParameterItem.cs @@ -126,6 +126,18 @@ namespace Tango.Core /// <summary> + /// Gets or sets the parameter description. + /// </summary> + public String Description + { + get { return (String)GetValue(DescriptionProperty); } + set { SetValue(DescriptionProperty, value); } + } + public static readonly DependencyProperty DescriptionProperty = + DependencyProperty.Register("Description", typeof(String), typeof(ParameterItem), new PropertyMetadata(null)); + + + /// <summary> /// Gets a value indicating whether this instance requires custom editor. /// </summary> public bool HasCustomEditor diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/App.config b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/App.config index 250f57a4d..3d3d3571b 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/App.config +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/App.config @@ -13,4 +13,12 @@ <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.0.5.0" newVersion="5.0.5.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> </configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs index a8181dea8..3280f47f5 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -17,6 +17,7 @@ using System.Data; using System.Diagnostics; using static Tango.Core.Components.DataBaseDescriptionsHelper; using System.Threading; +using Newtonsoft.Json; namespace Tango.DBObservablesGenerator.CLI { @@ -120,7 +121,24 @@ namespace Tango.DBObservablesGenerator.CLI if (column_description != null) { - codeField.DbDescription = column_description.ToLines().Select(x => "/// " + x).Join(Environment.NewLine); + RangeDescriptionModel rangeDescription = null; + + try + { + rangeDescription = JsonConvert.DeserializeObject<RangeDescriptionModel>(column_description); + } + catch { } + + if (rangeDescription != null && rangeDescription.Description != null) + { + codeField.RangeDescription = rangeDescription; + codeField.DbDescription = rangeDescription.Description.ToLines().Select(x => "/// " + x).Join(Environment.NewLine); + } + else + { + codeField.DbDescription = column_description.ToLines().Select(x => "/// " + x).Join(Environment.NewLine); + } + } if (field.PropertyType.IsGenericType) diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj index 26647a6d1..ecfd3e864 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj @@ -41,6 +41,9 @@ <Reference Include="Humanizer, Version=2.2.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL"> <HintPath>..\..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll</HintPath> </Reference> + <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Core" /> @@ -84,7 +87,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config index fdcfca0bf..eb113e867 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/packages.config @@ -43,4 +43,5 @@ <package id="Humanizer.Core.zh-CN" version="2.2.0" targetFramework="net46" /> <package id="Humanizer.Core.zh-Hans" version="2.2.0" targetFramework="net46" /> <package id="Humanizer.Core.zh-Hant" version="2.2.0" targetFramework="net46" /> + <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" /> </packages>
\ No newline at end of file |
