├── .gitignore ├── Attributes ├── NtcipAccessAttribute.cs ├── NtcipMandatoryAttribute.cs └── NtcipOidAttribute.cs ├── DMS ├── CharacterInfoList.cs ├── CharacterTable.cs ├── DmsClimateCtrlStatusTable.cs ├── DmsMessageTable.cs ├── DmsPowerStatusTable.cs ├── FontTable.cs ├── GeneralErrorException.cs ├── IAuxIoEntry.cs ├── ICharacterEntry.cs ├── IDms.cs ├── IDmsActionEntry.cs ├── IDmsClimateCtrlStatusEntry.cs ├── IDmsMessage.cs ├── IDmsMessageEntry.cs ├── IDmsPowerStatusEntry.cs ├── IDmsSignConfig.cs ├── IDmsStatus.cs ├── IFontDefinition.cs ├── IFontEntry.cs ├── IFontInformation.cs ├── IFontVersionByteStream.cs ├── IIllumination.cs ├── IMultiConfig.cs ├── IPixelFailureEntry.cs ├── ISchedule.cs ├── ISignControl.cs ├── IStatError.cs ├── IStatMultiFieldEntry.cs ├── IStatPower.cs ├── IStatTemp.cs ├── IVmsCfg.cs ├── MessageActivationCode.cs ├── MessageIDCode.cs ├── MultiUtility.cs ├── PixelFailureTable.cs ├── PowerIndex.cs └── StatMultiFieldTable.cs ├── Helper.cs ├── IAuxiliaryIo.cs ├── IGlobalConfiguration.cs ├── LICENSE ├── ModuleTableEntry.cs ├── Properties └── AssemblyInfo.cs ├── README.md ├── ReadOnlyTable.cs ├── SharpNTCIP.csproj ├── SharpNTCIP.sln ├── SpeedSensorSample.cs ├── TSS ├── DataBufferEntry.cs ├── DataCollection.cs ├── DataCollectionEntry.cs ├── ITSSControl.cs ├── ITSSDevice.cs ├── ITSSInductiveLoop.cs ├── ITSSMachineVision.cs ├── ITSSSystemSetup.cs ├── LoopOutputConditioningEntry.cs ├── LoopSensorSetupEntry.cs ├── LoopSystemStatusEntry.cs ├── MachineVisionCameraEntry.cs ├── OutputConditioningEntry.cs ├── OutputConfigurationEntry.cs ├── OutputGroupEntry.cs ├── SampleDataEntry.cs ├── SensorZoneEntry.cs └── ZoneSequenceTableEntry.cs ├── Table.cs └── Test ├── Runner ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── SharpNTCIP.Test.Runner.csproj └── Tests ├── Properties └── AssemblyInfo.cs ├── SharpNTCIP.Test.Tests.csproj └── Test_Multi.cs /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML 109 | -------------------------------------------------------------------------------- /Attributes/NtcipAccessAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.Attributes 7 | { 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class NtcipAccessAttribute : System.Attribute 10 | { 11 | public enum Access 12 | { 13 | none = 0, 14 | read = 1, 15 | write = 2, 16 | } 17 | 18 | private Access _access; 19 | 20 | public Access NtcipAccess 21 | { 22 | get 23 | { 24 | return _access; 25 | } 26 | set 27 | { 28 | _access = value; 29 | } 30 | } 31 | 32 | public NtcipAccessAttribute(Access access) 33 | { 34 | _access = access; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Attributes/NtcipMandatoryAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.Attributes 7 | { 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class NtcipMandatoryAttribute : System.Attribute 10 | { 11 | private bool _mandatory; 12 | 13 | public bool NtcipMandatory 14 | { 15 | get 16 | { 17 | return _mandatory; 18 | } 19 | set 20 | { 21 | _mandatory = value; 22 | } 23 | } 24 | 25 | public NtcipMandatoryAttribute(bool mandatory) 26 | { 27 | _mandatory = mandatory; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Attributes/NtcipOidAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.Attributes 7 | { 8 | [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Property | AttributeTargets.Class)] 9 | public class NtcipOidAttribute : System.Attribute 10 | { 11 | private string _oid; 12 | 13 | public string NtcipOid 14 | { 15 | get 16 | { 17 | return _oid; 18 | } 19 | set 20 | { 21 | _oid = value; 22 | } 23 | } 24 | 25 | public NtcipOidAttribute(string oid) 26 | { 27 | _oid = oid; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /DMS/CharacterInfoList.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.4")] 10 | public class CharacterInfoList : SharpNTCIP.Table,ICharacterEntry> 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DMS/CharacterTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | public class CharacterTable : Table, ICharacterEntry> 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DMS/DmsClimateCtrlStatusTable.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.17")] 10 | public class DmsClimateCtrlStatusTable : Table, IDmsClimateCtrlStatusEntry> 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DMS/DmsMessageTable.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8")] 10 | public class DmsMessageTable : Table, IDmsMessageEntry> 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DMS/DmsPowerStatusTable.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13")] 10 | public class DmsPowerStatusTable : Table 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DMS/FontTable.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2")] 10 | public class FontTable : Table, IFontEntry> 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DMS/GeneralErrorException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// A general error exception during NTCIP communications 9 | /// 10 | /// NTCIP 1203:1997 -- National Transportation Communications 11 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 12 | /// Signs (DMS) 13 | 14 | public class GeneralErrorException : Exception 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DMS/IAuxIoEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// Indicates the type of auxiliary I/O 9 | /// 10 | public enum AuxIoPortType 11 | { 12 | other = 1, 13 | analog = 2, 14 | digital = 3 15 | } 16 | 17 | /// 18 | /// Indicates whether the state of a port can be set (output), read 19 | /// (input), or both (bidirectional) 20 | /// 21 | public enum AuxIoPortDirection 22 | { 23 | output = 1, 24 | input = 2, 25 | bidirectional = 3 26 | } 27 | 28 | /// 29 | /// A means to access the auxiliary I/O of a Controller, this 30 | /// includes reading/setting input/output. 31 | /// 32 | /// NTCIP 1203:1997 -- National Transportation Communications 33 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 34 | /// Signs (DMS) 35 | public interface IAuxIoEntry 36 | { 37 | /// 38 | /// Indicates the type of auxiliary I/O, which can be analog, 39 | /// digital or other 40 | /// 41 | AuxIoPortType auxIOPortType 42 | { 43 | get; 44 | } 45 | 46 | /// 47 | /// Indicates the port number for the associated port type. 48 | /// 49 | /// 50 | /// Port numbers are used sequentially from one to max for 51 | /// each port type. There can be a port 1 for analog port and 52 | /// port 1 for digital port 53 | /// 54 | byte auxIOPortNumber 55 | { 56 | get; 57 | } 58 | 59 | /// 60 | /// Informational text field describing the device at the 61 | /// associated auxiliary I/O 62 | /// 63 | string auxIODescription 64 | { 65 | get; 66 | set; 67 | } 68 | 69 | /// 70 | /// Defines number of bits used for the IO-port 71 | /// 72 | /// 73 | /// The width of digital, resolution of analog 74 | /// 75 | byte auxIOResolution 76 | { 77 | get; 78 | set; 79 | } 80 | 81 | /// 82 | /// For input or bidirectional ports, this contains the current 83 | /// value of the input. For output ports, this is the last 84 | /// commanded value of the port. A genError shall be generated, 85 | /// if this object is set and the port is an input 86 | /// 87 | uint auxIOValue 88 | { 89 | get; 90 | set; 91 | } 92 | 93 | /// 94 | /// Indicates whether state of this port can be set (output), 95 | /// read (input) or both (bidirectional) 96 | /// 97 | AuxIoPortDirection auxIOPortDirection 98 | { 99 | get; 100 | set; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /DMS/ICharacterEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.4.1")] 9 | public interface ICharacterEntry 10 | { 11 | /// 12 | /// Indicates the binary value associated with this character 13 | /// of this font. For example, if the font set followed the 14 | /// ASCII numbering scheme, the character giving the bitmap 15 | /// of ‘A’ would be characterNumber 65 (41 hex) 16 | /// 17 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.4.1.1.{0}.{1}"), 18 | NtcipAccess(NtcipAccessAttribute.Access.read), 19 | NtcipMandatory(true)] 20 | UInt16 characterNumber 21 | { 22 | get; 23 | } 24 | 25 | /// 26 | /// Indicates the width of this character in pixels. 27 | /// A width of zero (0) indicates this row is invalid 28 | /// 29 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.4.1.2.{0}.{1}"), 30 | NtcipAccess(NtcipAccessAttribute.Access.read | 31 | NtcipAccessAttribute.Access.write), 32 | NtcipMandatory(true)] 33 | byte characterWidth 34 | { 35 | get; 36 | set; 37 | } 38 | 39 | /// 40 | /// A bitmap that defines each pixel within a rectangular 41 | /// region as being either ON (bit=1) or OFF (bit=0). The 42 | /// result of this bitmap is how the character appears on the 43 | /// sign. 44 | /// The octet string is treated as a binary bit string. 45 | /// The most significant bit defines the state of the pixel in 46 | /// the upper left corner of the rectangular region. The 47 | /// rectangular region is processed by rows, left to right, 48 | /// then top to bottom. The size of the rectangular region is 49 | /// defined by the fontHeight and characterWidth objects. After 50 | /// the rectangular region is defined, any remaining bits shall 51 | /// be zero (0). 52 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.4.1.3.{0}.{1}"), 53 | NtcipAccess(NtcipAccessAttribute.Access.read | 54 | NtcipAccessAttribute.Access.write), 55 | NtcipMandatory(true)] 56 | byte[] characterBitmap 57 | { 58 | get; 59 | set; 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /DMS/IDms.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// This node is an identifier used to group all objects for DMS sign 10 | /// configurations that are common to all DMS devices 11 | /// 12 | /// NTCIP 1203:1997 -- National Transportation Communications 13 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 14 | /// Signs (DMS) 15 | public interface IDms : IGlobalConfiguration 16 | { 17 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1"), 18 | NtcipAccess(NtcipAccessAttribute.Access.read), 19 | NtcipMandatory(true)] 20 | IDmsSignConfig dmsSignCfg 21 | { 22 | get; 23 | } 24 | 25 | /// 26 | /// Objects for support of VMS sign configurations that are 27 | /// common to all VMS devices. 28 | /// 29 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2"), 30 | NtcipAccess(NtcipAccessAttribute.Access.read), 31 | NtcipMandatory(true)] 32 | IVmsCfg vmsCfg 33 | { 34 | get; 35 | } 36 | 37 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3"), 38 | NtcipAccess(NtcipAccessAttribute.Access.read), 39 | NtcipMandatory(true)] 40 | IFontDefinition fontDefinition 41 | { 42 | get; 43 | } 44 | 45 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4"), 46 | NtcipAccess(NtcipAccessAttribute.Access.none), 47 | NtcipMandatory(true)] 48 | IMultiConfig multiCfg 49 | { 50 | get; 51 | } 52 | 53 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5"), 54 | NtcipAccess(NtcipAccessAttribute.Access.read), 55 | NtcipMandatory(true)] 56 | IDmsMessage dmsMessage 57 | { 58 | get; 59 | } 60 | 61 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.6"), 62 | NtcipAccess(NtcipAccessAttribute.Access.read), 63 | NtcipMandatory(true)] 64 | ISignControl signControl 65 | { 66 | get; 67 | } 68 | 69 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.7"), 70 | NtcipAccess(NtcipAccessAttribute.Access.read), 71 | NtcipMandatory(true)] 72 | IIllumination illum 73 | { 74 | get; 75 | } 76 | 77 | [NtcipOid(""), 78 | NtcipAccess(NtcipAccessAttribute.Access.read), 79 | NtcipMandatory(true)] 80 | ISchedule dmsSchedule 81 | { 82 | get; 83 | } 84 | 85 | [NtcipOid(""), 86 | NtcipAccess(NtcipAccessAttribute.Access.read), 87 | NtcipMandatory(true)] 88 | IDmsStatus dmsStatus 89 | { 90 | get; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /DMS/IDmsActionEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// 9 | /// 10 | /// NTCIP 1203:1997 -- National Transportation Communications 11 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 12 | /// Signs (DMS) 13 | public interface IDmsActionEntry 14 | { 15 | /// 16 | /// Enumerated listing of row entries. The value of this 17 | /// object cannot exceed the value of the numActionTableEntries - 18 | /// object. 19 | /// 20 | byte dmsActionIndex 21 | { 22 | get; 23 | } 24 | 25 | /// 26 | /// A number indicating the message memory type, the message 27 | /// number and the associated message-specific CRC as indicated 28 | /// within the message table 29 | /// 30 | MessageIDCode dmsActionMsgCode 31 | { 32 | get; 33 | set; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DMS/IDmsClimateCtrlStatusEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.17.1")] 10 | public interface IDmsClimateCtrlStatusEntry 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DMS/IDmsMessage.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// This node is an identifier used to group all objects for support of DMS Message Table 10 | /// functions that are common to DMS devices. 11 | /// 12 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5")] 13 | public interface IDmsMessage 14 | { 15 | /// 16 | /// “Indicates the current number of Messages stored in 17 | /// non-volatile, non-changeable memory (e.g., EPROM). 18 | /// For CMS and BOS, this is the number of different 19 | /// messages that can be assembled 20 | /// 21 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.1.0"), 22 | NtcipAccess(NtcipAccessAttribute.Access.read), 23 | NtcipMandatory(true)] 24 | UInt16 dmsNumPermanentMsg 25 | { 26 | get; 27 | } 28 | 29 | /// 30 | /// “Indicates the current number of Messages stored in 31 | /// non-volatile, changeable memory. For CMS and BOS, 32 | /// this number shall be zero (0) 33 | /// 34 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.2.0"), 35 | NtcipAccess(NtcipAccessAttribute.Access.read), 36 | NtcipMandatory(true)] 37 | UInt16 dmsNumChangeableMsg 38 | { 39 | get; 40 | } 41 | 42 | /// 43 | /// Indicates the maximum number of Messages that the 44 | /// sign can store in non-volatile, changeable memory. 45 | /// For CMS and BOS, this number shall be zero (0). 46 | /// 47 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.3.0"), 48 | NtcipAccess(NtcipAccessAttribute.Access.read), 49 | NtcipMandatory(true)] 50 | UInt16 dmsMaxChangeableMsg 51 | { 52 | get; 53 | } 54 | 55 | /// 56 | /// Indicates the number of bytes available within 57 | /// non-volatile, changeable memory. For CMS and BOS, 58 | /// this number shall be zero (0). 59 | /// 60 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.4.0"), 61 | NtcipAccess(NtcipAccessAttribute.Access.read), 62 | NtcipMandatory(true)] 63 | uint dmsFreeChangeableMemory 64 | { 65 | get; 66 | } 67 | 68 | /// 69 | /// Indicates the current number of Messages stored in 70 | /// volatile, changeable memory. For CMS and BOS, this 71 | /// number shall be zero (0). 72 | /// 73 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.5.0"), 74 | NtcipAccess(NtcipAccessAttribute.Access.read), 75 | NtcipMandatory(true)] 76 | UInt16 dmsNumVolatileMsg 77 | { 78 | get; 79 | } 80 | 81 | /// 82 | /// Indicates the maximum number of Messages that the 83 | /// sign can store in volatile, changeable memory. For 84 | /// CMS and BOS, this number shall be zero (0) 85 | /// 86 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.6.0"), 87 | NtcipAccess(NtcipAccessAttribute.Access.read), 88 | NtcipMandatory(true)] 89 | UInt16 dmsMaxVolatileMsg 90 | { 91 | get; 92 | } 93 | 94 | /// 95 | /// Indicates the number of bytes available within 96 | /// volatile, changeable memory. For CMS and BOS, 97 | /// this number shall be zero (0). 98 | /// 99 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.7.0"), 100 | NtcipAccess(NtcipAccessAttribute.Access.read), 101 | NtcipMandatory(true)] 102 | uint dmsFreeVolatileMemory 103 | { 104 | get; 105 | } 106 | 107 | /// 108 | /// A table containing the information needed to activate a Message on a sign. The values 109 | /// of a columnar object (except the dmsMessageStatus) cannot be changed when the ‘dmsMessageStatus’- 110 | /// object of that particular row has the value of ‘valid’ 111 | /// 112 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8"), 113 | NtcipAccess(NtcipAccessAttribute.Access.none), 114 | NtcipMandatory(true)] 115 | DmsMessageTable dmsMessageTable 116 | { 117 | get; 118 | } 119 | 120 | /// 121 | /// This is an error code used to identify why a 122 | /// message was not validated. If multiple errors 123 | /// occur, only the first value will be indicated. 124 | /// The syntaxMULTI error is further detailed in 125 | /// the dmsMultiSyntaxError, 126 | /// dmsMultiSyntaxErrorPosition and 127 | /// dmsMultiOtherErrorDescription objects 128 | /// 129 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.9.0"), 130 | NtcipAccess(NtcipAccessAttribute.Access.read), 131 | NtcipMandatory(true)] 132 | ValidateMessageError dmsValidateMessageError 133 | { 134 | get; 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /DMS/IDmsMessageEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | public enum DmsMessageMemoryType 9 | { 10 | /// 11 | /// any other type of memory type that is not listed 12 | /// within one of the values below, refer to device manual; 13 | /// 14 | other = 1, 15 | /// 16 | /// non-volatile and non-changeable 17 | /// 18 | permanent = 2, 19 | /// 20 | /// non-volatile and changeable; 21 | /// 22 | changeable = 3, 23 | /// 24 | /// volatile and changeable 25 | /// 26 | @volatile = 4, 27 | /// 28 | /// contains the information regarding the currently 29 | /// displayed message. Only one entry in the table can 30 | /// have the value of currentBuffer and the value of the 31 | /// dmsMessageNumber object must be one (1) 32 | /// 33 | currentBuffer = 5, 34 | /// 35 | /// this entry contains information regarding the currently 36 | /// scheduled message as determined by the time-base 37 | /// scheduler (if present). Only one entry in the table can 38 | /// have the value of ‘schedule’ and the dmsMessageNumber- 39 | /// object-value for this entry must be 1. This will be the 40 | /// displayed message when the dmsMessageSourceMode is 41 | /// timebasedScheduler 42 | /// 43 | schedule = 6, 44 | /// 45 | /// there shall be 255 (message numbers 1 through 255) 46 | /// pre-defined, static rows with this message type. These rows are 47 | /// defined so that message codes (e.g., objects with SYNTAX of 48 | /// either MessageIDCode or MessageActivationCode) can blank the 49 | /// sign at a stated run-time priority. The run-time priority of the blank 50 | /// message is equal to the message number (e.g., blank message 51 | /// number 1 has a run time priority of 1 and so on). The 52 | /// dmsMessageCRC for all messages of this type shall be 0x0000 and 53 | /// the dmsMessageMultiString shall be an OCTET STRING with a length of 54 | /// zero (0). The activation priority shall be determined from the 55 | /// activation priority of the MessageActivationCode. 56 | /// 57 | blank = 7 58 | } 59 | 60 | public enum MessageStatus 61 | { 62 | /// 63 | /// This is a state value and indicates that the row does 64 | /// not contain any valid message data. Controller memory 65 | /// may or may not be released to free memory pool in this 66 | /// state. Reading an object from a row when this object is 67 | /// set to notUsed in undetermined, i.e., last contents, or 68 | /// random data may be returned. Setting any object (except 69 | /// this object) for a row that is notUsed shall return a 70 | /// GeneralErrorException. The only valid command in this 71 | /// state is modifyReq 72 | /// 73 | notUsed = 1, 74 | /// 75 | /// This is a state value and indicates that the row is 76 | /// being modified to define a message. Modifying any 77 | /// objects (except this object) can only be done when the 78 | /// row is in this state, otherwise a GenError shall be 79 | /// returned. The valid commands in this state is 80 | /// validateReq and notUsedReq. 81 | /// 82 | modifying = 2, 83 | /// 84 | /// This is a state value and indicates that the 85 | /// controller is validating all of the message data for 86 | /// the row. When validation is complete, the controller 87 | /// will automatically change the state to either valid 88 | /// (message data is good), or error (some error found 89 | /// within the message data). The only valid command is 90 | /// the notUsedReq command, which shall set the state to 91 | /// notUsed or return a GeneralErrorException 92 | /// 93 | validating = 3, 94 | /// 95 | /// This is a state and indicates the message data is 96 | /// valid and the message can be activated. Activation 97 | /// of a message cannot occur in any other state. The 98 | /// valid commands in this state are notUsedReq and 99 | /// modifyReq 100 | /// 101 | valid = 4, 102 | /// 103 | /// This is a state and indicates that an error was 104 | /// detected during the validation process. The valid 105 | /// commands in this state are modifyReq and notUsedReq 106 | /// 107 | error = 5, 108 | /// 109 | /// This is a command that indicates the user wishes to 110 | /// modify the row to define a message. A GenError may 111 | /// be returned if the controller is in the notUsed 112 | /// state and there is insufficient memory to define a 113 | /// new message. A successful request will change the 114 | /// state of the row to modifying. An unsuccessful 115 | /// request will leave the row in the same state as it 116 | /// was prior to the command. This command can be 117 | /// issued while in the notUsed, valid and error states 118 | /// 119 | modifyReq = 6, 120 | /// 121 | /// This is a command that indicates the user wishes to 122 | /// validate the current message data. This command can 123 | /// only be issued while the row is in the modify state, 124 | /// else a GenError shall be returned. A successful 125 | /// request will change the state of the row to 126 | /// validating. An unsuccessful request will leave the 127 | /// row in the same state as it was prior to the command 128 | /// 129 | validateReq = 7, 130 | /// 131 | /// This is a command that indicates the user wishes to 132 | /// end use of the current message data. This command 133 | /// can be issued while the row is in the modify, 134 | /// validating, valid, and error states. A successful 135 | /// request will change the state of the row to notUsed. 136 | /// An unsuccessful request will leave the row in the 137 | /// same state as it was prior to the command 138 | /// 139 | notUsedReq = 8 140 | } 141 | 142 | public enum ValidateMessageError 143 | { 144 | other = 1, 145 | none = 2, 146 | beacons = 3, 147 | pixelService = 4, 148 | syntaxMULTI = 5 149 | } 150 | 151 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1")] 152 | public interface IDmsMessageEntry 153 | { 154 | /// 155 | /// Indicates the memory-type used to store a message. 156 | /// Also provides access to current message (currentBuffer) 157 | /// and currently scheduled message (schedule). 158 | /// 159 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.1.{0}.{1}"), 160 | NtcipAccess(NtcipAccessAttribute.Access.read), 161 | NtcipMandatory(true)] 162 | DmsMessageMemoryType dmsMessageMemoryType 163 | { 164 | get; 165 | } 166 | 167 | /// 168 | /// Enumerated listing of row entries within the value of 169 | /// the primary index to this table (dmsMessageMemoryType 170 | /// -object). When the primary index is ‘currentBuffer’ or 171 | /// ‘schedule’, then this value must be one (1). 172 | /// 173 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.2.{0}.{1}"), 174 | NtcipAccess(NtcipAccessAttribute.Access.read), 175 | NtcipMandatory(true)] 176 | UInt16 dmsMessageNumber 177 | { 178 | get; 179 | } 180 | 181 | /// 182 | /// Contains the message written in MULTI-language 183 | /// 184 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.3.{0}.{1}"), 185 | NtcipAccess(NtcipAccessAttribute.Access.read | 186 | NtcipAccessAttribute.Access.write), 187 | NtcipMandatory(true)] 188 | string dmsMessageMultiString 189 | { 190 | get; 191 | set; 192 | } 193 | 194 | /// 195 | /// Indicates the owner or author of this row 196 | /// 197 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.4.{0}.{1}"), 198 | NtcipAccess(NtcipAccessAttribute.Access.read | 199 | NtcipAccessAttribute.Access.write), 200 | NtcipMandatory(true)] 201 | string dmsMessageOwner 202 | { 203 | get; 204 | set; 205 | } 206 | 207 | /// 208 | /// “Indicates the CRC-16 (polynominal defined in ISO/IEC 209 | /// 3309) value created using the values of the 210 | /// dmsMessageMultiString- (MULTI-Message), the 211 | /// dmsMessageBeacon-, and the dmsMessagePixelService 212 | /// -objects in the order listed, not including the type 213 | /// or length fields 214 | /// 215 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.5.{0}.{1}"), 216 | NtcipAccess(NtcipAccessAttribute.Access.read), 217 | NtcipMandatory(true)] 218 | UInt16 dmsMessageCRC 219 | { 220 | get; 221 | } 222 | 223 | /// 224 | /// Indicates if connected beacon(s) are to be activated 225 | /// when the associated message is displayed. 226 | /// False (0) = Beacon(s) are Disabled ; 227 | /// true (1) = Beacon(s) are Enabled 228 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.6.{0}.{1}"), 229 | NtcipAccess(NtcipAccessAttribute.Access.read | 230 | NtcipAccessAttribute.Access.write), 231 | NtcipMandatory(true)] 232 | bool dmsMessageBeacon 233 | { 234 | get; 235 | set; 236 | } 237 | 238 | /// 239 | /// Indicates whether pixel service shall be enabled (1) 240 | /// or disabled (0) while this message is active 241 | /// 242 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.7.{0}.{1}"), 243 | NtcipAccess(NtcipAccessAttribute.Access.read | 244 | NtcipAccessAttribute.Access.write), 245 | NtcipMandatory(true)] 246 | bool dmsMessagePixelService 247 | { 248 | get; 249 | set; 250 | } 251 | 252 | /// 253 | /// Indicates the run time priority assigned to a 254 | /// particular message. The value of 1 indicates the 255 | /// lowest level, the value of 255 indicates the 256 | /// highest level 257 | /// 258 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.8.{0}.{1}"), 259 | NtcipAccess(NtcipAccessAttribute.Access.read | 260 | NtcipAccessAttribute.Access.write), 261 | NtcipMandatory(true)] 262 | byte dmsMessageRunTimePriority 263 | { 264 | get; 265 | set; 266 | } 267 | 268 | /// 269 | /// Indicates the current state of the message. This 270 | /// state-machine allows for defining a message, 271 | /// validating a message, and freeing message use. 272 | /// 273 | /// The enumerated values can be divided 274 | /// into two types, state values and command values. 275 | /// State values can only be read, a GenErr shall 276 | /// occur if a SET is attempted. Command values can 277 | /// be written to, and will cause a state change if 278 | /// accepted, and thus cannot be returned. 279 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.5.8.1.9.{0}.{1}"), 280 | NtcipAccess(NtcipAccessAttribute.Access.read | 281 | NtcipAccessAttribute.Access.write), 282 | NtcipMandatory(true)] 283 | MessageStatus dmsMessageStatus 284 | { 285 | get; 286 | set; 287 | } 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /DMS/IDmsPowerStatusEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | public enum DmsPowerStatus 10 | { 11 | other = 1, 12 | noError = 2, 13 | powerFail = 3, 14 | voltageOutOfSpec = 4, 15 | currentOutOfSpec = 5 16 | } 17 | 18 | public enum DmsPowerType 19 | { 20 | other = 1, 21 | acLine = 2, 22 | generator = 3, 23 | solar = 4, 24 | battery_UPS = 5, 25 | ledSupply = 6, 26 | lampSupply = 7 27 | } 28 | 29 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1")] 30 | public interface IDmsPowerStatusEntry 31 | { 32 | 33 | [NtcipAccess(NtcipAccessAttribute.Access.read), 34 | NtcipMandatory(true), 35 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1.1.{0}")] 36 | DmsRowIndex dmsPowerIndex 37 | { 38 | get; 39 | } 40 | 41 | [NtcipAccess(NtcipAccessAttribute.Access.read), 42 | NtcipMandatory(true), 43 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1.2.{0}")] 44 | String dmsPowerDescription 45 | { 46 | get; 47 | } 48 | 49 | [NtcipAccess(NtcipAccessAttribute.Access.read), 50 | NtcipMandatory(true), 51 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1.3.{0}")] 52 | String dmsPowerMfrStatus 53 | { 54 | get; 55 | } 56 | 57 | [NtcipAccess(NtcipAccessAttribute.Access.read), 58 | NtcipMandatory(true), 59 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1.4.{0}")] 60 | DmsPowerStatus dmsPowerStatus 61 | { 62 | get; 63 | } 64 | 65 | [NtcipAccess(NtcipAccessAttribute.Access.read), 66 | NtcipMandatory(true), 67 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1.5.{0}")] 68 | UInt16 dmsPowerVoltage 69 | { 70 | get; 71 | } 72 | 73 | [NtcipAccess(NtcipAccessAttribute.Access.read), 74 | NtcipMandatory(true), 75 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13.1.6.{0}")] 76 | DmsPowerType dmsPowerType 77 | { 78 | get; 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /DMS/IDmsSignConfig.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// Indicates the access method to a sign. These may be added 10 | /// together to indicate more than one method of entry. 11 | /// 12 | [Flags] 13 | public enum DMSAccess 14 | { 15 | /// 16 | /// Other 17 | /// 18 | Other = 1, 19 | /// 20 | /// Walk-in access 21 | /// 22 | WalkInAccess = 2, 23 | /// 24 | /// Rear access 25 | /// 26 | RearAccess = 4, 27 | /// 28 | /// Front access 29 | /// 30 | FrontAccess = 8 31 | } 32 | 33 | /// 34 | /// Indicates the type of a sign 35 | /// 36 | public enum DMSType 37 | { 38 | /// 39 | /// Device not specified through any other definition 40 | /// Refer to device manual 41 | /// 42 | other = 1, 43 | /// 44 | /// Device is a Blank-Out Sign 45 | /// 46 | bos = 2, 47 | /// 48 | /// Device is a Changeable Message Sign 49 | /// 50 | cms = 3, 51 | /// 52 | /// Device is a Variable Message Sign with character matrix setup 53 | /// 54 | vmsChar = 4, 55 | /// 56 | /// Device is a Variable Message Sign with line matrix setup 57 | /// 58 | vmsLine = 5, 59 | /// 60 | /// Device is a Variable Message Sign with full matrix setup 61 | /// 62 | vmsFull = 6, 63 | /// 64 | /// Device is portable but not specified through any other definition, 65 | /// Refer to device manual 66 | /// 67 | portableOther = 128 + DMSType.other, 68 | /// 69 | /// Device is a Changeable Message Sign 70 | /// 71 | portableBOS = 128 + DMSType.bos, 72 | /// 73 | /// Device is a Portable Variable Message Sign with character matrix setup 74 | /// 75 | portableCMS = 128 + DMSType.cms, 76 | /// 77 | /// Device is a Portable Variable Message Sign with line matrix setup 78 | /// 79 | portableVMSChar = 128 + DMSType.vmsChar, 80 | /// 81 | /// Device is a Portable Variable Message Sign with line matrix setup 82 | /// 83 | portableVMSLine = 128 + DMSType.vmsLine, 84 | /// 85 | /// Device is a Portable Variable Message Sign with full matrix setup 86 | /// 87 | portableVMSFull = 128 + DMSType.vmsFull 88 | } 89 | 90 | /// 91 | /// Indicates the configuration of the type, numbers and 92 | /// flashing patterns of beacons on a sign 93 | /// 94 | public enum DmsBeaconType 95 | { 96 | /// 97 | /// Other types, numbers and patterns of beacons on a sign supported by the device 98 | /// 99 | other = 1, 100 | /// 101 | /// Patterns of beacons not supported by the device 102 | /// 103 | none = 2, 104 | /// 105 | /// 1 beacon flashing 106 | /// 107 | oneBeacon = 3, 108 | /// 109 | /// 2 beacons, synchronized flashing 110 | /// 111 | twoBeaconSyncFlash = 4, 112 | /// 113 | /// 2 beacons, opposing flashing 114 | /// 115 | twoBeaconsOppFlash = 5, 116 | /// 117 | /// 4 beacons, synchronized flashing 118 | /// 119 | fourBeaconSyncFlash = 6, 120 | /// 121 | /// 4 beacons, alternate row flashing 122 | /// 123 | fourBeaconAltRowFlash = 7, 124 | /// 125 | /// 4 beacons, alternate column flashing 126 | /// 127 | fourBeaconAltColumnFlash = 8, 128 | /// 129 | /// 4 beacons, alternate diagonal flashing 130 | /// 131 | fourBeaconAltDiagonalFlash = 9, 132 | /// 133 | /// 4 beacons, no synchronized flashing 134 | /// 135 | fourBeaconNoSyncFlash = 10, 136 | /// 137 | /// 1 beacon, strobe light 138 | /// 139 | oneBeaconStrobe = 11, 140 | /// 141 | /// two beacons, strobe light 142 | /// 143 | twoBeaconStrobe = 12, 144 | /// 145 | /// 4 beacons, strobe light 146 | /// 147 | fourBeaconStrobe = 13 148 | } 149 | 150 | /// 151 | /// Indicates if a Legend is shown on the sign 152 | /// 153 | public enum DmsLegend 154 | { 155 | /// 156 | /// Some unspecified configuration exists 157 | /// 158 | other = 1, 159 | /// 160 | /// The sign displays no legend 161 | /// 162 | noLegend = 2, 163 | /// 164 | /// The sign displays a legend 165 | /// 166 | legendExists = 3 167 | } 168 | 169 | /// 170 | /// Indicates the utilized technology in a bitmap format 171 | /// Hybrids will have to set the bits for all technologies that the sign utilizes. 172 | /// 173 | [Flags] 174 | public enum DmsSignTechnology 175 | { 176 | other = 1, 177 | led = 2, 178 | flipDisk = 4, 179 | fiberOptics = 8, 180 | shuttered = 16, 181 | lamp = 32, 182 | drum = 64 183 | } 184 | 185 | /// 186 | /// Dynamic Message Sign (DMS) object interface. Instances used to query 187 | /// and/or control DMS devices shall implement this interface 188 | /// 189 | /// NTCIP 1203:1997 -- National Transportation Communications 190 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 191 | /// Signs (DMS) 192 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1")] 193 | public interface IDmsSignConfig 194 | { 195 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.1.0"), 196 | NtcipAccess(NtcipAccessAttribute.Access.read), 197 | NtcipMandatory(true)] 198 | DMSAccess dmsSignAccess 199 | { 200 | get; 201 | } 202 | 203 | /// 204 | /// Indicates the type of sign 205 | /// 206 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.2.0"), 207 | NtcipAccess(NtcipAccessAttribute.Access.read), 208 | NtcipMandatory(true)] 209 | DMSType dmsSignType 210 | { 211 | get; 212 | } 213 | 214 | /// 215 | /// Indicates the sign height in millimeters 216 | /// 217 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.3.0"), 218 | NtcipAccess(NtcipAccessAttribute.Access.read), 219 | NtcipMandatory(true)] 220 | UInt16 dmsSignHeight 221 | { 222 | get; 223 | } 224 | 225 | /// 226 | /// Indicates the Sign width in millimeters. 227 | /// 228 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.4.0"), 229 | NtcipAccess(NtcipAccessAttribute.Access.read), 230 | NtcipMandatory(true)] 231 | UInt16 dmsSignWidth 232 | { 233 | get; 234 | } 235 | 236 | /// 237 | /// Indicates the minimum border distance, in millimeters, 238 | /// that exists on the left and right sides of the sign. 239 | /// 240 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.5.0"), 241 | NtcipAccess(NtcipAccessAttribute.Access.read), 242 | NtcipMandatory(true)] 243 | UInt16 dmsHorizontalBorder 244 | { 245 | get; 246 | } 247 | 248 | /// 249 | /// Indicates the minimum border distance, in millimeters, 250 | /// that exists on the top and bottom of the sign. 251 | /// 252 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.6.0"), 253 | NtcipAccess(NtcipAccessAttribute.Access.read), 254 | NtcipMandatory(true)] 255 | UInt16 dmsVerticalBorder 256 | { 257 | get; 258 | } 259 | 260 | /// 261 | /// Indicates if a Legend is shown on the sign 262 | /// 263 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.7.0"), 264 | NtcipAccess(NtcipAccessAttribute.Access.read), 265 | NtcipMandatory(true)] 266 | DmsLegend dmsLegend 267 | { 268 | get; 269 | } 270 | 271 | /// 272 | /// Indicates the configuration of the type, numbers and 273 | /// flashing patterns of beacons on the sign 274 | /// 275 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.8.0"), 276 | NtcipAccess(NtcipAccessAttribute.Access.read), 277 | NtcipMandatory(true)] 278 | DmsBeaconType dmsBeaconType 279 | { 280 | get; 281 | } 282 | 283 | /// 284 | /// Indicates the utilized technology in a bitmap format 285 | /// (Hybrids will have to set the bits for all technologies that the sign utilizes) 286 | /// If a bit is set to one (1), then the associated feature exists; if the bit is set to 287 | /// zero (0), then the associated feature does not exist 288 | /// 289 | /// 290 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.1.9.0"), 291 | NtcipAccess(NtcipAccessAttribute.Access.read), 292 | NtcipMandatory(true)] 293 | DmsSignTechnology dmsSignTechnology 294 | { 295 | get; 296 | } 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /DMS/IDmsStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using SharpNTCIP.Attributes; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// Supports DMS sign status monitoring functions common to DMS devices 10 | /// 11 | /// NTCIP 1203:1997 -- National Transportation Communications 12 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 13 | /// Signs (DMS) 14 | public interface IDmsStatus 15 | { 16 | /// 17 | /// Indicates the number of rows in the statMultiFieldTable 18 | /// that are currently being used 19 | /// 20 | [NtcipAccess(NtcipAccessAttribute.Access.read), 21 | NtcipMandatory(true), 22 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.1.0")] 23 | byte statMultiFieldRows 24 | { 25 | get; 26 | } 27 | 28 | [NtcipAccess(NtcipAccessAttribute.Access.read), 29 | NtcipMandatory(true), 30 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.2")] 31 | StatMultiFieldTable statMultiFieldTable 32 | { 33 | get; 34 | } 35 | 36 | /// 37 | /// Used to retrieve the current speed value as detected by 38 | /// the attached device. The speed is transmitted in kilometers 39 | /// per hour (km/h). This value may vary from the displayed speed 40 | /// value due to application specific implementation 41 | /// 42 | [NtcipAccess(NtcipAccessAttribute.Access.read), 43 | NtcipMandatory(true), 44 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.3.0")] 45 | byte dmsCurrentSpeed 46 | { 47 | get; 48 | } 49 | 50 | /// 51 | /// Indicates the current speed limit in kilometers per hour (km/h) 52 | /// 53 | [NtcipAccess(NtcipAccessAttribute.Access.read), 54 | NtcipMandatory(true), 55 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.4.0")] 56 | byte dmsCurrentSpeedLimit 57 | { 58 | get; 59 | set; 60 | } 61 | 62 | /// 63 | /// Indicates the number of watchdog failures that have occurred 64 | /// 65 | [NtcipAccess(NtcipAccessAttribute.Access.read), 66 | NtcipMandatory(true), 67 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.5.0")] 68 | int watchdogFailureCount 69 | { 70 | get; 71 | } 72 | 73 | /// 74 | /// Indicates whether any of the doors to the controller cabinet 75 | /// or the sign housing are open. This is a bitmap; if a bit is 76 | /// set (= 1) then the door is open; if a bit not is not set, then 77 | /// the associated door is closed 78 | /// 79 | [NtcipAccess(NtcipAccessAttribute.Access.read), 80 | NtcipMandatory(true), 81 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.6.0")] 82 | byte dmsStatDoorOpen 83 | { 84 | get; 85 | } 86 | 87 | /// 88 | /// Supports monitoring DMS sign message error status 89 | /// 90 | [NtcipAccess(NtcipAccessAttribute.Access.read), 91 | NtcipMandatory(true), 92 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7")] 93 | IStatError statError 94 | { 95 | get; 96 | } 97 | 98 | /// 99 | /// Supports monitoring DMS sign power status 100 | /// 101 | [NtcipAccess(NtcipAccessAttribute.Access.read), 102 | NtcipMandatory(true), 103 | NtcipOid("")] 104 | IStatPower statPower 105 | { 106 | get; 107 | } 108 | 109 | /// 110 | /// Supports monitoring DMS sign temperature status 111 | /// 112 | [NtcipAccess(NtcipAccessAttribute.Access.read), 113 | NtcipMandatory(true), 114 | NtcipOid("")] 115 | IStatTemp statTemp 116 | { 117 | get; 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /DMS/IFontDefinition.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// Used to group all objects for DMS font configurations 10 | /// that are common to DMS device 11 | /// 12 | /// NTCIP 1203:1997 -- National Transportation Communications 13 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 14 | /// Signs (DMS) 15 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3")] 16 | public interface IFontDefinition 17 | { 18 | /// 19 | /// Indicates the maximum number of fonts that the 20 | /// sign can store 21 | /// 22 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.1.0")] 23 | byte numFonts 24 | { 25 | get; 26 | } 27 | 28 | /// 29 | /// A table containing the information needed to 30 | /// configure/define a particular font 31 | /// 32 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2")] 33 | FontTable fontTable 34 | { 35 | get; 36 | } 37 | 38 | /// 39 | /// Indicates the maximum number of rows in the character table that can exist for any given font 40 | /// 41 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.3.0")] 42 | UInt16 maxFontCharacters 43 | { 44 | get; 45 | } 46 | 47 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.4")] 48 | CharacterTable characterTable 49 | { 50 | get; 51 | } 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DMS/IFontEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | public enum FontStatus 10 | { 11 | notUsed = 1, ///This row is currently not used 12 | modifying = 2, ///The objects defined in this row can be modified 13 | calculatingID = 3, ///The fontVersionID is currently being calculated 14 | readyForUse = 4, ///Can be used for message display 15 | inUse = 5, ///Currently being used for the displayed message. 16 | permanent = 6, ///Permanent font that cannot be modified 17 | modifyReq = 7, ///A command has been sent to request transition to the modifying state 18 | readyForUseReq = 8, ///A command has been sent to request transition to the readyForUse state 19 | notUsedReq = 9, ///A command has been sent to request the transition to the notUsed state 20 | unmanagedReq = 10, ///A command has been sent to request the transition to the unmanaged state 21 | unmanaged = 11 ///Is not managed using the fontStatus object. Manage font as defined by NTCIP 1203 v1 22 | } 23 | 24 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1")] 25 | public interface IFontEntry 26 | { 27 | /// 28 | /// Indicates the row number of the entry 29 | /// 30 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.1.{0}"), 31 | NtcipAccess(NtcipAccessAttribute.Access.read), 32 | NtcipMandatory(true)] 33 | byte fontIndex 34 | { 35 | get; 36 | } 37 | 38 | /// 39 | /// A unique, user-specified number for a particular font which 40 | /// can be different from the value of the fontIndex-object. This 41 | /// is the number referenced by MULTI when specifying a particular 42 | /// font. 43 | /// 44 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.2.{0}"), 45 | NtcipAccess(NtcipAccessAttribute.Access.read | 46 | NtcipAccessAttribute.Access.write), 47 | NtcipMandatory(true)] 48 | byte fontNumber 49 | { 50 | get; 51 | set; 52 | } 53 | 54 | /// 55 | /// Indicates the name of the font. 56 | /// 57 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.3.{0}"), 58 | NtcipAccess(NtcipAccessAttribute.Access.read | 59 | NtcipAccessAttribute.Access.write), 60 | NtcipMandatory(true)] 61 | string fontName 62 | { 63 | get; 64 | set; 65 | } 66 | 67 | /// 68 | /// Indicates the height of the font in pixels. Changing the value 69 | /// of this object invalidates this fontTable row, sets all 70 | /// corresponding characterWidth objects to zero (0), and sets all 71 | /// corresponding characterBitmap objects to zero length. Character 72 | /// Matrix and Line Matrix VMS shall subrange this object either to 73 | /// a value of zero (0) or the value of vmsCharacterHeightPixels; a 74 | /// Full Matrix VMS shall subrange this object to the range of zero 75 | /// (0) to the value of vmsSignHeightPixels or 255, whichever is 76 | /// less. 77 | /// 78 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.4.{0}"), 79 | NtcipAccess(NtcipAccessAttribute.Access.read | 80 | NtcipAccessAttribute.Access.write), 81 | NtcipMandatory(true)] 82 | byte fontHeight 83 | { 84 | get; 85 | set; 86 | } 87 | 88 | /// 89 | /// Indicates the default horizontal spacing (in pixels) between 90 | /// each of the characters within the font. If the font changes on 91 | /// a line, then the average character spacing of the two fonts, 92 | /// rounded up to the nearest whole pixel, shall be used between 93 | /// the two characters where the font changes. Character Matrix VMS 94 | /// shall ignore the value of this object; Line Matrix and Full 95 | /// Matrix VMS shall subrange this object to the range of zero (0) 96 | /// to the smaller of 255 or the value of vmsSignWidthPixels. 97 | /// 98 | /// See also the MULTI tag 'spacing character [sc]'. 99 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.5.{0}"), 100 | NtcipAccess(NtcipAccessAttribute.Access.read | 101 | NtcipAccessAttribute.Access.write), 102 | NtcipMandatory(true)] 103 | byte fontCharSpacing 104 | { 105 | get; 106 | set; 107 | } 108 | 109 | /// 110 | /// Indicates the default vertical spacing (in pixels) between each 111 | /// of the lines within the font for Full Matrix VMS. The line 112 | /// spacing for a line is the largest font line spacing of all fonts 113 | /// used on that line. The number of pixels between adjacent lines is 114 | /// the average of the 2 line spacings of each line, rounded up to 115 | /// the nearest whole pixel. Character Matrix VMS and Line Matrix VMS 116 | /// shall ignore the value of this object; Full Matrix VMS shall 117 | /// subrange this object to the range of zero (0) to the smaller of 118 | /// 255 or the value of vmsSignHeightPixels. 119 | /// 120 | /// the MULTI tag 'new line [nl]'. 121 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.6.{0}"), 122 | NtcipAccess(NtcipAccessAttribute.Access.read | 123 | NtcipAccessAttribute.Access.write), 124 | NtcipMandatory(true)] 125 | byte fontLineSpacing 126 | { 127 | get; 128 | set; 129 | } 130 | 131 | /// 132 | /// Each font that has been downloaded to a sign shall have a 133 | /// relatively unique ID. This ID shall be calculated using the 134 | /// CRC-16 algorithm defined in ISO 3309 and the associated 135 | /// OER-encoded (as defined in NTCIP 1102) FontVersionByteStream. 136 | /// 137 | /// The sign shall respond with the version ID value that is valid at 138 | /// the time. 139 | /// 140 | /// NTCIP 1204v03-04 Part 1, Chapter 5.4.2.7 141 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.7.{0}"), 142 | NtcipAccess(NtcipAccessAttribute.Access.read), 143 | NtcipMandatory(true)] 144 | UInt16 fontVersionID 145 | { 146 | get; 147 | } 148 | 149 | /// 150 | /// This object defines a state machine allowing to manage fonts 151 | /// stored within a DMS 152 | /// 153 | /// 154 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.3.2.1.8.{0}"), 155 | NtcipAccess(NtcipAccessAttribute.Access.read | NtcipAccessAttribute.Access.write), 156 | NtcipMandatory(true)] 157 | FontStatus fontStatus 158 | { 159 | get; 160 | set; 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /DMS/IFontInformation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// FontInformation describes the characteristics of the font which 9 | /// are common to each character and defines the order in which this 10 | /// information appears when constructing the byte stream which will 11 | /// be used to calculate the CRC 12 | /// 13 | /// NTCIP 1203:1997 -- National Transportation Communications 14 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 15 | /// Signs (DMS) 16 | public interface IFontInformation 17 | { 18 | /// 19 | /// A unique, user-specified number for a particular font which 20 | /// can be different from the value of the fontIndex-object. 21 | /// This is the number referenced by MULTI when specifying a 22 | /// particular font. A device shall return a 23 | /// GeneralErrorException if this 24 | /// value is not unique 25 | /// 26 | int fontNumber 27 | { 28 | get; 29 | } 30 | 31 | /// 32 | /// Indicates the height of the font in pixels. Setting this 33 | /// object to zero (0) invalidates this fontTable row, and also 34 | /// invalidates all corresponding entries into the characterTable 35 | /// 36 | int fontHeight 37 | { 38 | get; 39 | } 40 | 41 | /// 42 | /// Indicates the default horizontal spacing (in pixels) between 43 | /// each of the characters within the font. This object only 44 | /// applies to Full Matrix and Line Matrix VMS. If the font 45 | /// changes on a line, then the average value of the two fonts 46 | /// shall be used between sequential characters. Character Matrix 47 | /// VMS shall either set this object to zero (0), or not support 48 | /// this object 49 | /// 50 | int fontCharSpacing 51 | { 52 | get; 53 | } 54 | 55 | /// 56 | /// Indicates the default vertical spacing (in pixels) between 57 | /// each of the lines within the font. This object only applies 58 | /// to Full Matrix. The line spacing for a line is the largest 59 | /// font line spacing of all fonts used on that line. The number 60 | /// of pixels between adjacent lines is the average of the line 61 | /// spacings of each line. Character Matrix VMS and Line Matrix 62 | /// VMS shall either set this object to zero (0), or not support 63 | /// this object 64 | /// 65 | int fontLineSpacing 66 | { 67 | get; 68 | } 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DMS/IFontVersionByteStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | public interface IFontVersionByteStream 8 | { 9 | IFontInformation fontInformation 10 | { 11 | get; 12 | } 13 | 14 | CharacterInfoList characterInfoList 15 | { 16 | get; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DMS/IIllumination.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using SharpNTCIP.Attributes; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// Indicates methods used to select Brightness Level 10 | /// 11 | public enum IlluminationControl 12 | { 13 | /// 14 | /// The Brightness Level is set by some other method 15 | /// 16 | other = 1, 17 | /// 18 | /// The Brightness Level is based on photocell status 19 | /// 20 | photocell = 2, 21 | /// 22 | /// The Brightness Level is set by an internal timer 23 | /// 24 | timer = 3, 25 | /// 26 | /// the Brightness Level must be changed via the 27 | /// dmsIllumManLevelobject 28 | /// 29 | manual = 4 30 | } 31 | 32 | /// 33 | /// Error type encountered when brightness table is set 34 | /// 35 | public enum IlluminationBrightnessValuesError 36 | { 37 | other = 1, 38 | none = 2, 39 | photocellGap = 3, 40 | negativeSlope = 4, 41 | tooManyLevels = 5, 42 | invalidData = 6 43 | } 44 | 45 | /// 46 | /// Used to group all objects supporting DMS sign illumination 47 | /// functions that are common to DMS devices 48 | /// 49 | /// NTCIP 1203:1997 -- National Transportation Communications 50 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 51 | /// Signs (DMS) 52 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7")] 53 | public interface IIllumination 54 | { 55 | /// 56 | /// Indicates the method used to select the Brightness Level 57 | /// 58 | /// 59 | /// When switching to manual mode from any other mode, 60 | /// the current brightness level shall automatically be 61 | /// loaded into the dmsIllumManLevel object 62 | /// 63 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.1.0"), 64 | NtcipAccess(NtcipAccessAttribute.Access.read | 65 | NtcipAccessAttribute.Access.write), 66 | NtcipMandatory(true)] 67 | IlluminationControl dmsIllumControl 68 | { 69 | get; 70 | set; 71 | } 72 | 73 | /// 74 | /// Indicates the maximum value given by the 75 | /// dmsIllumPhotocellLevelStatus-object 76 | /// 77 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.2.0"), 78 | NtcipAccess(NtcipAccessAttribute.Access.read), 79 | NtcipMandatory(true)] 80 | UInt16 dmsIllumMaxPhotocellLevel 81 | { 82 | get; 83 | } 84 | 85 | /// 86 | /// Indicates the level of Ambient Light as a value 87 | /// ranging from 0 (darkest) to the value of 88 | /// dmsIllumMaxPhotocellLevel- object (brightest), based 89 | /// on the photocell detection 90 | /// 91 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.3.0"), 92 | NtcipAccess(NtcipAccessAttribute.Access.read), 93 | NtcipMandatory(true)] 94 | UInt16 dmsIllumPhotocellLevelStatus 95 | { 96 | get; 97 | } 98 | 99 | /// 100 | /// Indicates the number of individually selectable 101 | /// Brightness Levels supported by the device, excluding 102 | /// the OFF level 103 | /// 104 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.4.0"), 105 | NtcipAccess(NtcipAccessAttribute.Access.read), 106 | NtcipMandatory(true)] 107 | byte dmsIllumNumBrightLevels 108 | { 109 | get; 110 | } 111 | 112 | /// 113 | /// Indicates the current Brightness Level of the device, 114 | /// ranging from 0 (OFF) to the maximum value given by 115 | /// the dmsIllumNumBrightLevels- object (Brightest) 116 | /// 117 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.5.0"), 118 | NtcipAccess(NtcipAccessAttribute.Access.read), 119 | NtcipMandatory(true)] 120 | byte dmsIllumBrightLevelStatus 121 | { 122 | get; 123 | } 124 | 125 | /// 126 | /// Indicates the desired value of the Brightness Level 127 | /// as a value ranging from 0 to the value of the 128 | /// dmsIllumNumBrightLevels-object when under manual control 129 | /// 130 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.6.0"), 131 | NtcipAccess(NtcipAccessAttribute.Access.read | 132 | NtcipAccessAttribute.Access.write), 133 | NtcipMandatory(true)] 134 | byte dmsIllumManLevel 135 | { 136 | get; 137 | set; 138 | } 139 | 140 | /// 141 | /// An byte array describing the sign's Brightness Level in 142 | /// relationship to the Photocell(s) detection of ambient 143 | /// light. For each brightness level, there is a 144 | /// corresponding range of photocell levels. The number 145 | /// of levels transmitted is defined by the first byte of 146 | /// the datapacket, but cannot exceed the value of the 147 | /// dmsIllumNumBrightLevels object 148 | /// 149 | /// 150 | /// After a SET, an implementation may interpolate these 151 | /// entries to create a table with as many entries as 152 | /// needed. For each level, there are three 16-bit values 153 | /// that occur in the following order: Brightness point, 154 | /// Photocell level down, Photocell level up. The 155 | /// Brightness point is a value between 0 (no light 156 | /// output) and 65535 (maximum light output). Each step 157 | /// is 1/65535 of the maximum light output (linear scale). 158 | /// The Photocell-level-down is the lowest photocell 159 | /// level for this brightness level. Should the photocell 160 | /// level go below this point, the automatic brightness 161 | /// level would go down one level. The Photocell-level-up 162 | /// is the highest photocell level for this brightness 163 | /// level. Should the photocell level go above this point, 164 | /// the automatic brightness level would go up one level. 165 | /// The photocell level (Up and Down) values may not 166 | /// exceed the value of the dmsIllumMaxPhotocellLevel 167 | /// object. 168 | /// 169 | /// The points transmitted should be selected so that there is 170 | /// no photocell level which does not have a brightness level. 171 | /// Hystersis is possible by defining the photocell-level-up 172 | /// at a level higher than the upper level's 173 | /// photocell-level-down. 174 | /// 175 | /// 176 | /// 177 | /// 0 1 2 3 178 | /// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 179 | /// +-+-+-+-+-+-+-+-+ 180 | /// |NumEntries = n | 181 | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 182 | /// | Brightness level 1 | Photocell-Level-Down point 1 | 183 | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 184 | /// | Photocell-Level-Up point 1 | Brightness level 2 | 185 | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 186 | /// | Photocell-Level-Down point 2 | Photocell-Level-Up point 2 | 187 | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 188 | /// 189 | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 190 | /// | Photocell-Level-Down point n | Photocell-Level-Up point n | 191 | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 192 | /// 193 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.7.0"), 194 | NtcipAccess(NtcipAccessAttribute.Access.read | 195 | NtcipAccessAttribute.Access.write), 196 | NtcipMandatory(true)] 197 | byte[] dmsIllumBrightnessValues 198 | { 199 | get; 200 | set; 201 | } 202 | 203 | /// 204 | /// Indicates the error encountered when the brightness table 205 | /// was last set 206 | /// 207 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.8.0"), 208 | NtcipAccess(NtcipAccessAttribute.Access.read), 209 | NtcipMandatory(true)] 210 | IlluminationBrightnessValuesError dmsIllumBrightnessValuesError 211 | { 212 | get; 213 | } 214 | 215 | /// 216 | /// Indicates the current physical light output value ranging 217 | /// from 0 (darkest) to 65535 (maximum output) 218 | /// 219 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.7.9.0"), 220 | NtcipAccess(NtcipAccessAttribute.Access.read), 221 | NtcipMandatory(true)] 222 | UInt16 dmsIllumLightOutputStatus 223 | { 224 | get; 225 | } 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /DMS/IMultiConfig.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// Each of the background colors on a sign should map to one 10 | /// of the colors listed. If a color is requested that is not 11 | /// supported, then a GeneralErrorException shall be returned 12 | /// 13 | public enum SignColor 14 | { 15 | black = 0, 16 | red = 1, 17 | yellow = 2, 18 | green = 3, 19 | cyan = 4, 20 | blue = 5, 21 | magenta = 6, 22 | white = 7, 23 | orange = 8, 24 | amber = 9 25 | } 26 | 27 | public enum HorizontalJustification 28 | { 29 | other = 1, 30 | left = 2, 31 | center = 3, 32 | right = 4, 33 | full = 5 34 | } 35 | 36 | public enum VerticalJustification 37 | { 38 | other = 1, 39 | top = 2, 40 | middle = 3, 41 | bottom = 4 42 | } 43 | 44 | public enum DmsColorScheme 45 | { 46 | monochrome1bit = 1, 47 | monochrome8bit = 2, 48 | colorClassic = 3, 49 | color24bit = 4 50 | } 51 | 52 | [Flags] 53 | public enum DmsSupportedMultiTags 54 | { 55 | none = 0, 56 | color_background = 1 << 0, 57 | color_goreground = 1 << 1, 58 | flashing = 1 << 2, 59 | font = 1 << 3, 60 | graphic = 1 << 4, 61 | hexadecimal_character = 1 << 5, 62 | justification_line = 1 << 6, 63 | justification_page = 1 << 7, 64 | manufacturer_specific = 1 << 8, 65 | moving_text = 1 << 9, 66 | new_line = 1 << 10, 67 | new_page = 1 << 11, 68 | page_time = 1 << 12, 69 | spacing_character = 1 << 13, 70 | field_local_time_12_hour = 1 << 14, 71 | field_local_time_24_hour = 1 << 15, 72 | ambient_temperature_c = 1 << 16, 73 | ambient_temperature_f = 1 << 17, 74 | speed_kmph = 1 << 18, 75 | speed_mph = 1 << 19, 76 | day_of_week = 1 << 20, 77 | date_of_month = 1 << 21, 78 | month_of_year = 1 << 22, 79 | year_2_digits = 1 << 23, 80 | year_4_digits = 1 << 24, 81 | local_time_12_hour_AMPM = 1 << 25, 82 | local_time_12_hour_ampm = 1 << 26, 83 | text_rectangle = 1 << 27, 84 | color_rectangle = 1 << 28, 85 | page_background = 1 << 29 86 | } 87 | 88 | /// 89 | /// The intent of this object is to provide a mechanism by which 90 | /// 16-bit character sets (and potentially other character sets) 91 | /// can be supported in a future version. Currently, this object 92 | /// only provides a standard for 8-bit character encoding 93 | /// 94 | public enum CharacterNumberEncoding 95 | { 96 | /// 97 | /// A character size is something other than those 98 | /// listed below, refer to the device manual 99 | /// 100 | other = 1, 101 | /// 102 | /// Each characterNumber of a given font is encoded 103 | /// as an 8-bit value 104 | /// 105 | eightBit = 2 106 | } 107 | 108 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4")] 109 | public interface IMultiConfig 110 | { 111 | /// 112 | /// Indicates the color of the background shown on the sign 113 | /// 114 | /// Each of the background colors on a sign should map 115 | /// to one of the colors listed. If a color is requested that 116 | /// is not supported, then a GeneralErrorException shall be 117 | /// returned 118 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.1.0"), 119 | NtcipAccess(NtcipAccessAttribute.Access.read | 120 | NtcipAccessAttribute.Access.write), 121 | NtcipMandatory(true)] 122 | SignColor defaultBackgroundColor 123 | { 124 | get; 125 | set; 126 | } 127 | 128 | /// 129 | /// Indicates the color of the foreground (the actual text) 130 | /// shown on the sign 131 | /// 132 | /// Each of the colors on a sign should map to one 133 | /// of the colors listed. If a color is requested that is not 134 | /// supported, then a GeneralErrorException shall be returned 135 | /// 136 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.2.0"), 137 | NtcipAccess(NtcipAccessAttribute.Access.none), 138 | NtcipMandatory(true)] 139 | SignColor defaultForegroundColor 140 | { 141 | get; 142 | set; 143 | } 144 | 145 | /// 146 | /// Indicates the default flash on time, in tenths of a 147 | /// second, for flashing text. If the time is set to zero (0), 148 | /// the default is NO FLASHing but the text remains visible 149 | /// 150 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.3.0"), 151 | NtcipAccess(NtcipAccessAttribute.Access.read | 152 | NtcipAccessAttribute.Access.write), 153 | NtcipMandatory(true)] 154 | byte defaultFlashOn 155 | { 156 | get; 157 | set; 158 | } 159 | 160 | /// 161 | /// Indicates the default flash off time, in tenths of a second, 162 | /// for flashing text. If the time is set to zero (0), the 163 | /// default is NO FLASHing but the text remains visible 164 | /// 165 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.4.0"), 166 | NtcipAccess(NtcipAccessAttribute.Access.read | 167 | NtcipAccessAttribute.Access.write), 168 | NtcipMandatory(true)] 169 | byte defaultFlashOff 170 | { 171 | get; 172 | set; 173 | } 174 | 175 | /// 176 | /// Indicates the default font number (fontNumber-object) 177 | /// for a message 178 | /// 179 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.5.0"), 180 | NtcipAccess(NtcipAccessAttribute.Access.read | 181 | NtcipAccessAttribute.Access.write), 182 | NtcipMandatory(true)] 183 | byte defaultFont 184 | { 185 | get; 186 | set; 187 | } 188 | 189 | /// 190 | /// Indicates the default line justification for a message 191 | /// 192 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.6.0"), 193 | NtcipAccess(NtcipAccessAttribute.Access.read | 194 | NtcipAccessAttribute.Access.write), 195 | NtcipMandatory(true)] 196 | HorizontalJustification defaultJustificationLine 197 | { 198 | get; 199 | set; 200 | } 201 | 202 | /// 203 | /// Indicates the default page justification for a message 204 | /// 205 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.7.0"), 206 | NtcipAccess(NtcipAccessAttribute.Access.read | 207 | NtcipAccessAttribute.Access.write), 208 | NtcipMandatory(true)] 209 | VerticalJustification defaultJustificationPage 210 | { 211 | get; 212 | set; 213 | } 214 | 215 | /// 216 | /// Indicates the default page on time, in tenths (1/10) 217 | /// of a second. If the message is only one page, this 218 | /// value is ignored, and the page is continuously 219 | /// displayed 220 | /// 221 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.8.0"), 222 | NtcipAccess(NtcipAccessAttribute.Access.read | 223 | NtcipAccessAttribute.Access.write), 224 | NtcipMandatory(true)] 225 | byte defaultPageOnTime 226 | { 227 | get; 228 | set; 229 | } 230 | 231 | /// 232 | /// Indicates the default page off time, in tenths (1/10) 233 | /// of a second. If the message is only one page, this 234 | /// value is ignored, and the page is continuously 235 | /// displayed 236 | /// 237 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.9.0"), 238 | NtcipAccess(NtcipAccessAttribute.Access.read | 239 | NtcipAccessAttribute.Access.write), 240 | NtcipMandatory(true)] 241 | byte defaultPageOffTime 242 | { 243 | get; 244 | set; 245 | } 246 | 247 | /// 248 | /// Indicates the default number of bits used to define a single 249 | /// character in a MULTI string. 250 | /// other (1): - a character size other than those listed below, 251 | /// refer to the device manual. 252 | /// eightBit (2): - each characterNumber of a given font is 253 | /// encoded as an 8-bit value. 254 | /// 255 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.10.0"), 256 | NtcipAccess(NtcipAccessAttribute.Access.read | 257 | NtcipAccessAttribute.Access.write), 258 | NtcipMandatory(true)] 259 | CharacterNumberEncoding defaultCharacterSet 260 | { 261 | get; 262 | set; 263 | } 264 | 265 | /// 266 | /// Indicates the color scheme supported by the DMS. The values are defined as: 267 | /// monochrome1bit (1): - Only two states are available for each pixel: 268 | /// on (1) and off (0). A value of 'on (1)' shall indicate that the 269 | /// defaultForegroundRGB is used and value of 'off(0)' shall indicate that 270 | /// the defaultBackgroundRGB is used. 271 | /// monochrome8bit (2): - this color palette supports 256 shades ranging from 272 | /// 0 (off) to 255 (full intensity). Values between zero and 255 are scaled 273 | /// to the nearest intensity level supported by the VMS. Therefore, it is 274 | /// not required that a VMS have true 8-bit (256 shade) capabilities. 275 | /// colorClassic (3): - the following values are available: 276 | /// black (0), 277 | /// red (1), 278 | /// yellow (2), 279 | /// green(3), 280 | /// cyan (4), 281 | /// blue (5), 282 | /// magenta (6), 283 | /// white (7), 284 | /// orange (8), 285 | /// amber (9). 286 | /// color24bit (4): - Each pixel is defined by three bytes, one each for red, 287 | /// green, and blue. Each color value ranges from 0 (off) to 255 (full 288 | /// intensity). The combination of the red, green, and blue colors equals 289 | /// the 16,777,216 number of colors. DMS with dmsColorScheme set to 290 | /// color24bit shall interpret MULTI tags with a single color parameter 291 | /// (e.g. [cfx]) as colorClassic 292 | /// 293 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.11.0"), 294 | NtcipAccess(NtcipAccessAttribute.Access.read), 295 | NtcipMandatory(true)] 296 | DmsColorScheme dmsColorScheme 297 | { 298 | get; 299 | } 300 | 301 | /// 302 | /// Indicates the color of the background shown on the sign if not 303 | /// changed by the ‘Page Background Color’ MULTI tag or the ‘Color 304 | /// Rectangle’ MULTI tag. The values are expressed in values appropriate 305 | /// to the color scheme indicated by the dmsColorScheme object. When 306 | /// the 'color24bit' scheme is used, then this object contains three 307 | /// octets. When 'color24bit' is used, then the object value contains 308 | /// 3 octets (first octet = red, second = green, third = blue). 309 | /// When 'monochrome1bit' is used, the value of this octet shall be 310 | /// either 0 or 1. When 'monochrome8bit' is used, the value of this 311 | /// octet shall be 0 to 255. In either the 'monochrome1bit' or 312 | /// 'monochrome8bit' scheme, the actual color is indicated in the 313 | /// monochromeColor object. When 'colorClassic' is used, the value of 314 | /// this octet shall be the value of the classic color. 315 | /// If the ‘colorClassic’ value (see dmsColorScheme object) is used, 316 | /// both defaultBackgroundColor and defaultBackgroundRGB objects shall 317 | /// return the same value if queried by a central system.. Each of the 318 | /// background colors on a sign shall map to one of the colors in the 319 | /// color scheme of the sign. 320 | /// 321 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.12.0"), 322 | NtcipAccess(NtcipAccessAttribute.Access.read | 323 | NtcipAccessAttribute.Access.write), 324 | NtcipMandatory(true)] 325 | byte[] defaultBackgroundRGB 326 | { 327 | get; 328 | set; 329 | } 330 | 331 | /// 332 | /// Indicates the color of the foreground shown on the sign unless 333 | /// changed by the ‘Color Foreground’ MULTI tag. This is the color 334 | /// used to illuminate the ‘ON’ pixels of displayed characters. 335 | /// The values are expressed in values appropriate to the color 336 | /// scheme indicated by the dmsColorScheme object. When the 337 | /// 'color24bit' scheme is used, then this object contains three 338 | /// octets (first octet = red, second = green, third = blue). 339 | /// When 'monochrome1bit' is used, the value of this octet shall 340 | /// be either 0 or 1. When 'monochrome8bit' is used, the value of 341 | /// this octet shall be 0 to 255. In either the 'monochrome1bit' or 342 | /// 'monochrome8bit' scheme, the actual color is indicated in the 343 | /// monochromeColor object. When 'colorClassic' is used, the value 344 | /// of this octet shall be the value of the classic color. 345 | /// If the ‘colorClassic’ value (see dmsColorScheme object) is used, 346 | /// both defaultForegroundColor and defaultForegroundRGB objects shall 347 | /// return the same value if queried by a central system. 348 | /// Each of the foreground colors on a sign shall map to one of the 349 | /// colors in the color scheme of the sign. 350 | /// 351 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.13.0"), 352 | NtcipAccess(NtcipAccessAttribute.Access.read | 353 | NtcipAccessAttribute.Access.write), 354 | NtcipMandatory(true)] 355 | byte[] defaultForegroundRGB 356 | { 357 | get; 358 | set; 359 | } 360 | 361 | /// 362 | /// An indication of the MULTI Tags supported by the device. 363 | /// This object is a bitmap representation of tag support. 364 | /// When a bit is set (=1), the device supports the 365 | /// corresponding tag. When a bit is cleared (=0), the device 366 | /// does not support the corresponding tag. 367 | /// 368 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.14.0"), 369 | NtcipAccess(NtcipAccessAttribute.Access.read), 370 | NtcipMandatory(true)] 371 | DmsSupportedMultiTags dmsSupportedMultiTags 372 | { 373 | get; 374 | } 375 | 376 | /// 377 | /// Indicates the maximum number of pages allowed in the 378 | /// dmsMessageMultiString 379 | /// 380 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.15.0"), 381 | NtcipAccess(NtcipAccessAttribute.Access.read), 382 | NtcipMandatory(true)] 383 | byte dmsMaxNumberPages 384 | { 385 | get; 386 | } 387 | 388 | /// 389 | /// Indicates the maximum number of bytes allowed within the 390 | /// dmsMessageMultiString 391 | /// 392 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.16.0"), 393 | NtcipAccess(NtcipAccessAttribute.Access.read), 394 | NtcipMandatory(true)] 395 | byte dmsMaxMultiStringLength 396 | { 397 | get; 398 | } 399 | 400 | /// 401 | /// Indicates the value of defaultFlashOn at activation of 402 | /// the currently active message for the purpose of determining 403 | /// what the value was at the time of activation. The value shall 404 | /// be created (overwritten) at the time when the message was 405 | /// copied into the currentBuffer 406 | /// 407 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.17.0"), 408 | NtcipAccess(NtcipAccessAttribute.Access.read), 409 | NtcipMandatory(true)] 410 | byte defaultFlashOnActivate 411 | { 412 | get; 413 | } 414 | 415 | /// 416 | /// Indicates the value of defaultFlashOff at activation of 417 | /// the currently active message for the purpose of determining 418 | /// what the value was at the time of activation. The value shall 419 | /// be created (overwritten) at the time when the message was 420 | /// copied into the currentBuffer 421 | /// 422 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.18.0"), 423 | NtcipAccess(NtcipAccessAttribute.Access.read), 424 | NtcipMandatory(true)] 425 | byte defaultFlashOffActivate 426 | { 427 | get; 428 | } 429 | 430 | /// 431 | /// Indicates the value of defaultFont at activation of 432 | /// the currently active message for the purpose of determining 433 | /// what the value was at the time of activation. The value shall 434 | /// be created (overwritten) at the time when the message was 435 | /// copied into the currentBuffer 436 | /// 437 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.19.0"), 438 | NtcipAccess(NtcipAccessAttribute.Access.read), 439 | NtcipMandatory(true)] 440 | byte defaultFontActivate 441 | { 442 | get; 443 | } 444 | 445 | /// 446 | /// Indicates the value of defaultJustificationLine at activation of 447 | /// the currently active message for the purpose of determining 448 | /// what the value was at the time of activation. The value shall 449 | /// be created (overwritten) at the time when the message was 450 | /// copied into the currentBuffer 451 | /// 452 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.20.0"), 453 | NtcipAccess(NtcipAccessAttribute.Access.read), 454 | NtcipMandatory(true)] 455 | HorizontalJustification defaultJustificationLineActivate 456 | { 457 | get; 458 | } 459 | 460 | /// 461 | /// Indicates the value of defaultJustificationPage at activation of 462 | /// the currently active message for the purpose of determining 463 | /// what the value was at the time of activation. The value shall 464 | /// be created (overwritten) at the time when the message was 465 | /// copied into the currentBuffer 466 | /// 467 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.21.0"), 468 | NtcipAccess(NtcipAccessAttribute.Access.read), 469 | NtcipMandatory(true)] 470 | VerticalJustification defaultJustificationPageActivate 471 | { 472 | get; 473 | } 474 | 475 | /// 476 | /// Indicates the value of defaultPageOnTime at activation of 477 | /// the currently active message for the purpose of determining 478 | /// what the value was at the time of activation. The value shall 479 | /// be created (overwritten) at the time when the message was 480 | /// copied into the currentBuffer 481 | /// 482 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.22.0"), 483 | NtcipAccess(NtcipAccessAttribute.Access.read), 484 | NtcipMandatory(true)] 485 | byte defaultPageOnTimeActivate 486 | { 487 | get; 488 | } 489 | 490 | /// 491 | /// Indicates the value of defaultPageOffTime at activation of 492 | /// the currently active message for the purpose of determining 493 | /// what the value was at the time of activation. The value shall 494 | /// be created (overwritten) at the time when the message was 495 | /// copied into the currentBuffer 496 | /// 497 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.23.0"), 498 | NtcipAccess(NtcipAccessAttribute.Access.read), 499 | NtcipMandatory(true)] 500 | byte defaultPageOffTimeActivate 501 | { 502 | get; 503 | } 504 | 505 | /// 506 | /// Indicates the value of defaultBackgroundRGB at activation of 507 | /// the currently active message for the purpose of determining 508 | /// what the value was at the time of activation. The value shall 509 | /// be created (overwritten) at the time when the message was 510 | /// copied into the currentBuffer 511 | /// 512 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.24.0"), 513 | NtcipAccess(NtcipAccessAttribute.Access.read), 514 | NtcipMandatory(true)] 515 | byte[] defaultBackgroundRGBActivate 516 | { 517 | get; 518 | } 519 | 520 | /// 521 | /// Indicates the value of defaultForegroundRGB at activation of 522 | /// the currently active message for the purpose of determining 523 | /// what the value was at the time of activation. The value shall 524 | /// be created (overwritten) at the time when the message was 525 | /// copied into the currentBuffer 526 | /// 527 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.4.25.0"), 528 | NtcipAccess(NtcipAccessAttribute.Access.read), 529 | NtcipMandatory(true)] 530 | byte[] defaultForegroundRGBActivate 531 | { 532 | get; 533 | } 534 | } 535 | } 536 | -------------------------------------------------------------------------------- /DMS/IPixelFailureEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | ///TODO: Label with NTCIP OIDs 8 | 9 | public enum PixelFailureDetectionType 10 | { 11 | other = 1, 12 | pixelTest = 2, 13 | messageDisplay = 3 14 | } 15 | 16 | [Flags] 17 | public enum PixelFailureStatus 18 | { 19 | stuckOff = 0, 20 | stuckOn = 1, 21 | colorError = 2, 22 | electricalError = 4, 23 | mechanicalError = 8 24 | } 25 | 26 | /// 27 | /// An entry containing the location of a failed pixel 28 | /// 29 | /// NTCIP 1203:1997 -- National Transportation Communications 30 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 31 | /// Signs (DMS) 32 | public interface IPixelFailureEntry 33 | { 34 | /// 35 | /// Indicates the type of test/display that leads to the pixel 36 | /// failure entry 37 | /// 38 | PixelFailureDetectionType pixelFailureDetectionType 39 | { 40 | get; 41 | } 42 | 43 | /// 44 | /// The index of the failed pixel in an enumeration of pixel 45 | /// entries 46 | /// 47 | UInt16 pixelFailureIndex 48 | { 49 | get; 50 | } 51 | 52 | /// 53 | /// Indicates the X location of the failed pixel. 54 | /// 55 | /// 56 | /// The X direction is the horizontal direction. The X location is 57 | /// counted from the left-most pixel in number of pixels 58 | /// 59 | UInt16 pixelFailureXLocation 60 | { 61 | get; 62 | } 63 | 64 | /// 65 | /// Indicates the Y location of the failed pixel. 66 | /// 67 | /// 68 | /// The Y direction is the vertical direction. The Y location is 69 | /// counted from the top-most pixel in number of pixels 70 | /// 71 | UInt16 pixelFailureYLocation 72 | { 73 | get; 74 | } 75 | 76 | /// 77 | /// Indicates the current status of the specified pixel and the 78 | /// operation which made this determination 79 | /// 80 | /// 81 | /// This value is an OR'd set of PixelFailureStatus enum values 82 | /// 83 | /// 84 | byte pixelFailureStatus 85 | { 86 | get; 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /DMS/ISchedule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// Used to group all DMS device-specific objects supporting 9 | /// DMS sign timebased scheduling 10 | /// 11 | /// NTCIP 1203:1997 -- National Transportation Communications 12 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 13 | /// Signs (DMS) 14 | public interface ISchedule 15 | { 16 | /// 17 | /// Indicates the number of rows that are stored in the 18 | /// dmsActionTable 19 | /// 20 | byte numActionTableEntries 21 | { 22 | get; 23 | } 24 | 25 | /// 26 | /// A table containing a list of message codes. The scheduler 27 | /// will determine when a message shall be displayed. The 28 | /// dayPlanTable of the scheduler points to a row in the table 29 | /// to identify the message to be activated 30 | /// 31 | /// 32 | /// TS3.4-1996, timebase-node 33 | /// 34 | IDmsActionEntry[] dmsActionTable 35 | { 36 | get; 37 | set; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DMS/IStatError.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | 9 | [Flags] 10 | public enum SystemError 11 | { 12 | other = 1, 13 | communications = 2, 14 | power = 4, 15 | attachedDevice = 8, 16 | lamp = 16, 17 | pixel = 32, 18 | photocell = 64, 19 | message = 128, 20 | controller = 256, 21 | temperature = 512, 22 | fan = 1024 23 | } 24 | 25 | public enum PixelTestActivation 26 | { 27 | other = 1, 28 | noTest = 2, 29 | test = 3, 30 | clearTable = 4 31 | } 32 | 33 | public enum TestActivation 34 | { 35 | other = 1, 36 | noTest = 2, 37 | test = 3 38 | } 39 | 40 | [Flags] 41 | public enum ControllerError 42 | { 43 | other = 1, 44 | prom = 2, 45 | programOrProcessor = 4, 46 | ram = 8 47 | } 48 | 49 | /// 50 | /// Supports DMS sign message error status functions that are common 51 | /// to DMS devices. 52 | /// 53 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7")] 54 | public interface IStatError 55 | { 56 | /// 57 | /// Current system errors 58 | /// 59 | /// 60 | /// This value is an OR'd set of SystemError enum values 61 | /// 62 | /// 63 | [NtcipAccess(NtcipAccessAttribute.Access.read), 64 | NtcipMandatory(true), 65 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.1.0")] 66 | SystemError shortErrorStatus 67 | { 68 | get; 69 | } 70 | 71 | /// 72 | /// The number of rows contained in the pixelFailureTable each 73 | /// indicating failed pixels 74 | /// 75 | [NtcipAccess(NtcipAccessAttribute.Access.read), 76 | NtcipMandatory(true), 77 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.2.0")] 78 | UInt16 pixelFailureTableNumRows 79 | { 80 | get; 81 | } 82 | 83 | /// 84 | /// A table containing the locations of failed pixels. 85 | /// 86 | /// 87 | /// The detection of pixel failures during message displays 88 | /// shall be appended to the end of the table 89 | /// 90 | PixelFailureTable pixelFailureTable 91 | { 92 | get; 93 | } 94 | 95 | /// 96 | /// Indicates the state of the pixel testing 97 | /// 98 | /// 99 | /// The actual test routine can vary among different manufacturers. 100 | /// The results of the pixel failure test shall be stored in the 101 | /// pixel failure table. The pixel failure table will be cleared, 102 | /// when a pixel test is started (test). Setting the value to test 103 | /// will start the test, meaning this test will be executed once. 104 | /// The sign controller will automatically set the value of this 105 | /// object back to noTest after completion. 106 | /// 107 | PixelTestActivation pixelTestActivation 108 | { 109 | get; 110 | set; 111 | } 112 | 113 | /// 114 | /// Indicates whether each lamp within the sign is stuck on as a 115 | /// bitmap. 116 | /// 117 | /// 118 | /// If a lamp is stuck on, its associated bit is set to one (1) 119 | /// 120 | byte[] lampFailureStuckOn 121 | { 122 | get; 123 | } 124 | 125 | /// 126 | /// “Indicates whether each lamp within the sign is stuck off as a 127 | /// bitmap 128 | /// 129 | /// 130 | /// If a lamp is stuck off, its associated bit is set to one (1) 131 | /// 132 | byte[] lampFailureStuckOff 133 | { 134 | get; 135 | } 136 | 137 | /// 138 | /// Indicates the state of the lamp testing 139 | /// 140 | /// 141 | /// The actual test routine can vary among different manufacturers. 142 | /// The results of the lamp failure test shall be stored 143 | /// appropriately, either in the lampFailureStuckOn- or in the 144 | /// lampFailureStuckOff-objects. Setting the value to test will 145 | /// start the test, meaning this test will be executed once. The 146 | /// sign controller shall automatically set the value of this 147 | /// object back to noTest after completion 148 | /// 149 | TestActivation lampTestActivation 150 | { 151 | get; 152 | set; 153 | } 154 | 155 | /// 156 | /// Indicates whether each fan (system) within a DMS is capable of 157 | /// operating, expressed as a bitmap 158 | /// 159 | /// 160 | /// If a fan (system) failed, its associated bit is set to one (1) 161 | /// 162 | [NtcipAccess(NtcipAccessAttribute.Access.read), 163 | NtcipMandatory(true), 164 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.8.0")] 165 | byte[] fanFailures 166 | { 167 | get; 168 | } 169 | 170 | /// 171 | /// Indicates the state of the fan testing 172 | /// 173 | /// 174 | /// The actual test routine can vary among different manufacturers. 175 | /// The results of the fan test shall be stored in either the 176 | /// fanFailures-objects. Setting the value to test will start the 177 | /// test, meaning this test will be executed once. The sign 178 | /// controller will automatically set the value of this object back 179 | /// to noTest after completion 180 | /// 181 | [NtcipAccess(NtcipAccessAttribute.Access.read), 182 | NtcipMandatory(true), 183 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.9.0")] 184 | TestActivation fanTestActivation 185 | { 186 | get; 187 | set; 188 | } 189 | 190 | /// 191 | /// A bitmap of controller related errors 192 | /// 193 | /// 194 | /// This value is an OR'd set of ControllerError enum values 195 | /// If flag is set, then the associated error is existing; 196 | /// if the flag is not set, then the associated error is not 197 | /// existing 198 | /// 199 | /// 200 | [NtcipAccess(NtcipAccessAttribute.Access.read), 201 | NtcipMandatory(true), 202 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.10.0")] 203 | ControllerError controllerErrorStatus 204 | { 205 | get; 206 | } 207 | 208 | [NtcipAccess(NtcipAccessAttribute.Access.read), 209 | NtcipMandatory(true), 210 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.11.0")] 211 | byte[] dmsPowerFailureStatusMap 212 | { 213 | get; 214 | } 215 | 216 | [NtcipAccess(NtcipAccessAttribute.Access.read), 217 | NtcipMandatory(true), 218 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.12.0")] 219 | DmsRowIndex dmsPowerNumRows 220 | { 221 | get; 222 | } 223 | 224 | [NtcipAccess(NtcipAccessAttribute.Access.read), 225 | NtcipMandatory(true), 226 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.13")] 227 | DmsPowerStatusTable dmsPowerStatusTable 228 | { 229 | get; 230 | } 231 | 232 | [NtcipAccess(NtcipAccessAttribute.Access.read), 233 | NtcipMandatory(true), 234 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.14.0")] 235 | byte[] dmsClimateCtrlStatusMap 236 | { 237 | get; 238 | } 239 | 240 | [NtcipAccess(NtcipAccessAttribute.Access.read), 241 | NtcipMandatory(true), 242 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.16.0")] 243 | DmsRowIndex dmsClimateCtrlNumRows 244 | { 245 | get; 246 | } 247 | 248 | [NtcipAccess(NtcipAccessAttribute.Access.read), 249 | NtcipMandatory(true), 250 | NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.7.17")] 251 | DmsClimateCtrlStatusTable dmsClimateCtrlStatusTable 252 | { 253 | get; 254 | } 255 | 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /DMS/IStatMultiFieldEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | ///TODO: Label with NTCIP OIDs 8 | 9 | /// 10 | /// Contains the currently displayed value of a specified Field 11 | /// 12 | public interface IStatMultiFieldEntry 13 | { 14 | /// 15 | /// The index number into this table indicating the sequential 16 | /// order of the field within the MULTI-string (1-255) 17 | /// 18 | byte statMultiFieldIndex 19 | { 20 | get; 21 | } 22 | 23 | /// 24 | /// Indicates the ID of the value of the 25 | /// statMultiCurrrentFieldValue-object. The field codes are 26 | /// indicated under the ‘Field’-tag in MULTI 27 | /// 28 | byte statMultiFieldCode 29 | { 30 | get; 31 | } 32 | 33 | /// 34 | /// Indicates the currently displayed text of the MULTI-message 35 | /// for the corresponding Field 36 | /// 37 | byte[] statMultiCurrentFieldValue 38 | { 39 | get; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /DMS/IStatPower.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// Indicates the source of power 9 | /// 10 | public enum PowerSource 11 | { 12 | /// 13 | /// method not listed below (see device manual) 14 | /// 15 | other = 1, 16 | /// 17 | /// there is just enough power to perform shutdown activities. 18 | /// 19 | powerShutdown = 2, 20 | /// 21 | /// sign controller has power but the sign display has no power 22 | /// 23 | noSignPower = 3, 24 | /// 25 | /// controller and sign is powered by AC power 26 | /// 27 | acLine = 4, 28 | /// 29 | /// sign and the controller are powered by a generator 30 | /// 31 | generator = 5, 32 | /// 33 | /// sign and the controller are powered by solar equipment 34 | /// 35 | solar = 6, 36 | /// 37 | /// sign and controller are powered by battery with no significant 38 | /// charging occurring 39 | /// 40 | battery = 7 41 | } 42 | 43 | /// 44 | /// Supports monitoring DMS sign power status 45 | /// 46 | public interface IStatPower 47 | { 48 | /// 49 | /// A voltage measurement in units of hundredth (1/100) of a volt 50 | /// 51 | /// 52 | /// The maximum value (0xFFFF) corresponds to a voltage of 655.35 53 | /// volts. This is an indication of the sign battery voltage. 54 | /// 55 | UInt16 signVolts 56 | { 57 | get; 58 | } 59 | 60 | /// 61 | /// Indicates the low fuel level threshold used to alert the user. 62 | /// 63 | /// 64 | /// The threshold is indicated as a percent (%) of a full tank. 65 | /// When the level of fuel is below the threshold, the bit for 66 | /// power alarm (bit 2) in the shortErrorStatus-object shall be 67 | /// set to one (1). 68 | /// 69 | byte lowFuelThreshold 70 | { 71 | get; 72 | set; 73 | } 74 | 75 | /// 76 | /// A number indicating the amount of fuel remaining. 77 | /// 78 | /// 79 | /// Specified as a percent (%) of full (0-100) 80 | /// 81 | byte fuelLevel 82 | { 83 | get; 84 | } 85 | 86 | /// 87 | /// Indicates the engine rpm in units of 100. 88 | /// 89 | /// 90 | /// This provides a range from 0 rpm to 25500 rpm 91 | /// 92 | byte engineRPM 93 | { 94 | get; 95 | } 96 | 97 | /// 98 | /// The DMS line voltage measurement in (1.0) volts 99 | /// 100 | /// 101 | /// The range is 0 volts to 255 volts 102 | /// 103 | byte lineVolts 104 | { 105 | get; 106 | } 107 | 108 | /// 109 | /// Indicates the source of power that is currently utilized by 110 | /// the sign 111 | /// 112 | PowerSource powerSource 113 | { 114 | get; 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /DMS/IStatTemp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.DMS 6 | { 7 | /// 8 | /// Supports monitoring DMS sign temperature status 9 | /// 10 | /// NTCIP 1203:1997 -- National Transportation Communications 11 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 12 | /// Signs (DMS) 13 | public interface IStatTemp 14 | { 15 | /// 16 | /// Indicates the current temperature, single sensor, or the 17 | /// current minimum temperature, multiple sensors, within the DMS 18 | /// Control Cabinet in degrees Celsius 19 | /// 20 | /// 21 | /// Supports values from -128 to 127 degrees Celsius 22 | /// 23 | Int16 tempMinCtrlCabinet 24 | { 25 | get; 26 | } 27 | 28 | /// 29 | /// Indicates the current temperature, single sensor, or the 30 | /// current maximum temperature, multiple sensors, within the DMS 31 | /// Control Cabinet in degrees Celsius 32 | /// 33 | /// 34 | /// Supports values from -128 to 127 degrees Celsius 35 | /// 36 | Int16 tempMaxCtrlCabinet 37 | { 38 | get; 39 | } 40 | 41 | /// 42 | /// Indicates the current outside ambient temperature, single 43 | /// sensor, or the current minimum outside ambient temperature, 44 | /// multiple sensors in degrees Celsius 45 | /// 46 | /// 47 | /// Supports values from -128 to 127 degrees Celsius 48 | /// 49 | Int16 tempMinAmbient 50 | { 51 | get; 52 | } 53 | 54 | /// 55 | /// Indicates the current outside ambient temperature, single 56 | /// sensor, or the current maximum outside ambient temperature, 57 | /// multiple sensors in degrees Celsius 58 | /// 59 | /// 60 | /// Supports values from -128 to 127 degrees Celsius 61 | /// 62 | Int16 tempMaxAmbient 63 | { 64 | get; 65 | } 66 | 67 | /// 68 | /// Indicates the current temperature, single sensor, or the 69 | /// current minimum temperature, multiple sensors in the sign 70 | /// housing in degrees Celsius 71 | /// 72 | /// 73 | /// Supports values from -128 to 127 degrees Celsius 74 | /// 75 | Int16 tempMinSignHousing 76 | { 77 | get; 78 | } 79 | 80 | /// 81 | /// Indicates the current temperature, single sensor, or the 82 | /// current maximum temperature, multiple sensors in the sign 83 | /// housing in degrees Celsius 84 | /// 85 | /// 86 | /// Supports values from -128 to 127 degrees Celsius 87 | /// 88 | Int16 tempMaxSignHousing 89 | { 90 | get; 91 | } 92 | 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /DMS/IVmsCfg.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | /// 9 | /// Objects for support of VMS sign configurations that are 10 | /// common to all VMS devices. 11 | /// 12 | /// NTCIP 1203:1997 -- National Transportation Communications 13 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 14 | /// Signs (DMS) 15 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2")] 16 | public interface IVmsCfg 17 | { 18 | /// 19 | /// Indicates the height of a single character in Pixels. 20 | /// The value zero (0) Indicates a variable character height 21 | /// 22 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.1.0")] 23 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 24 | [NtcipMandatory(true)] 25 | byte vmsCharacterHeightPixels 26 | { 27 | get; 28 | } 29 | 30 | /// 31 | /// Indicates the width of a single character in Pixels. 32 | /// The value zero (0) indicates a variable character width 33 | /// 34 | /// A full matrix sign is indicated by a height and 35 | /// width of zero (0). A line matrix sign is indicated by a 36 | /// width of zero (0) 37 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.2.0")] 38 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 39 | [NtcipMandatory(true)] 40 | byte vmsCharacterWidthPixels 41 | { 42 | get; 43 | } 44 | 45 | /// 46 | /// Indicates the number of rows of pixels for the entire sign 47 | /// 48 | /// To determine the number of lines for a line matrix 49 | /// or character matrix sign, divide the vmsSignHeightPixels 50 | /// object value by the vmsCharacterHeightPixels object value. 51 | /// This should result in a whole number, the number of lines 52 | /// for the sign 53 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.3.0")] 54 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 55 | [NtcipMandatory(true)] 56 | UInt16 vmsSignHeightPixels 57 | { 58 | get; 59 | } 60 | 61 | /// 62 | /// Indicates the number of columns of pixels for the entire sign 63 | /// 64 | /// To determine the number of characters for a 65 | /// character matrix sign, divide the vmsSignWidthPixels object 66 | /// value by the vmsCharacterWidthPixels object value. This 67 | /// should result in a whole number, the number of characters 68 | /// per line for the sign. 69 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.4.0")] 70 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 71 | [NtcipMandatory(true)] 72 | UInt16 vmsSignWidthPixels 73 | { 74 | get; 75 | } 76 | 77 | /// 78 | /// Indicates the horizontal distance from the center of one pixel to the center of the neighboring pixel in millimeters 79 | /// 80 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.5.0")] 81 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 82 | [NtcipMandatory(true)] 83 | byte vmsHorizontalPitch 84 | { 85 | get; 86 | } 87 | 88 | /// 89 | /// Indicates the vertical distance from the center of one 90 | /// pixel to the center of the neighboring pixel in 91 | /// millimeters 92 | /// 93 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.6.0")] 94 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 95 | [NtcipMandatory(true)] 96 | byte vmsVerticalPitch 97 | { 98 | get; 99 | } 100 | 101 | /// 102 | /// Indicates the color supported by a monochrome sign. If the 103 | /// 'monochrome1Bit' or 'monochrome8Bit' scheme is used, then 104 | /// this object will contain six octets. The first 3 octets shall, 105 | /// in this order, indicate the red, green, and blue component values 106 | /// of the color when the pixels are turned 'ON'. The last 3 octets 107 | /// shall, in this order, indicate the red, green, and blue component 108 | /// values of the color when the pixels are turned 'OFF'. 109 | /// 110 | /// If the sign is a non-monochrome sign, then the value of this 111 | /// object shall be an octet string of six zeros 112 | /// (0x00 0x00 0x00 0x00 0x00 0x00). 113 | /// 114 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.2.7.0")] 115 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 116 | [NtcipMandatory(true)] 117 | byte[] monochromeColor 118 | { 119 | get; 120 | } 121 | 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /DMS/MessageActivationCode.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Net; 5 | using System.Text; 6 | using System.Linq; 7 | 8 | namespace SharpNTCIP.DMS 9 | { 10 | /// TODO: ENSURE ENDIANNESS 11 | 12 | /// 13 | /// bit 0 is the most significant bit (msb) of the most significant byte (MSB) 14 | /// 15 | /// 16 | public class MessageActivationCode : MessageIDCode 17 | { 18 | public MessageActivationCode() 19 | { 20 | idCodeOffset = 3; 21 | } 22 | 23 | public MessageActivationCode(byte[] raw) : this() 24 | { 25 | decode(raw); 26 | } 27 | 28 | public MessageActivationCode(UInt16 duration, byte activatePriority, 29 | DmsMessageMemoryType dmsMessageMemoryType, UInt16 dmsMessageNumber, 30 | UInt16 dmsMessageCRC, IPAddress sourceAddress) : this() 31 | { 32 | Duration = duration; 33 | MsgMemoryType = dmsMessageMemoryType; 34 | MessageNumber = dmsMessageNumber; 35 | MessageCRC = dmsMessageCRC; 36 | ActivatePriority = activatePriority; 37 | SourceAddress = sourceAddress; 38 | } 39 | 40 | public MessageActivationCode(UInt16 duration, MessageIDCode idCode, 41 | byte activatePriority, IPAddress sourceAddress) : 42 | this(duration, activatePriority, idCode.MsgMemoryType, 43 | idCode.MessageNumber, idCode.MessageCRC, sourceAddress) { } 44 | 45 | public MessageActivationCode(IDmsMessageEntry entry, UInt16 duration, 46 | byte activatePriority, IPAddress sourceAddress) : 47 | this(duration, activatePriority, entry.dmsMessageMemoryType, 48 | entry.dmsMessageNumber, entry.dmsMessageCRC, sourceAddress) { } 49 | 50 | public override void decode(byte[] raw) 51 | { 52 | if (raw.Length != 12) 53 | throw new ArgumentException(); 54 | 55 | _data = raw; 56 | } 57 | 58 | /// 59 | /// The maximum amount of time the message may be displayed prior 60 | /// to activating the dmsDefaultEndDurationMessage. 61 | /// DmsMsgTimeRemaining shall be set to this value upon successful 62 | /// display of the indicated message. A Value of 65535 shall 63 | /// indicate an infinite duration 64 | /// 65 | public ushort Duration 66 | { 67 | get 68 | { 69 | return BitConverter.ToUInt16(_data.Take(2).Reverse().ToArray(), 0); 70 | } 71 | set 72 | { 73 | byte[] val = BitConverter.GetBytes(value).Reverse().ToArray(); 74 | _data[0] = val[0]; 75 | _data[1] = val[1]; 76 | } 77 | } 78 | 79 | /// 80 | /// If this value is greater than the dmsMsgRunTimePriority of the 81 | /// currently displayed message, the new message shall be displayed 82 | /// unless errors are detected. 83 | /// 84 | public byte ActivatePriority 85 | { 86 | get { return _data[2]; } 87 | set { _data[2] = value; } 88 | } 89 | 90 | /// 91 | /// the 4-byte IP address of the device which requested the 92 | /// activation. The dmsActivateMsgError object shall be used to 93 | /// indicate the success or failure of activating any message 94 | /// requested by an object of MessageActivationCode SYNTAX 95 | /// 96 | public IPAddress SourceAddress 97 | { 98 | get 99 | { 100 | return new IPAddress(_data.Skip(8).Take(4).Reverse().ToArray()); 101 | } 102 | set 103 | { 104 | byte[] val = value.GetAddressBytes().Reverse().ToArray(); 105 | for (int i = 0; i < 4; i++) 106 | _data[i+8] = val[i]; 107 | } 108 | } 109 | 110 | 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /DMS/MessageIDCode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Linq; 5 | using SharpNTCIP; 6 | using System.Security.Cryptography; 7 | 8 | namespace SharpNTCIP.DMS 9 | { 10 | /// 11 | /// Parameters required to define a message within a dmsMessageTable 12 | /// 13 | /// 14 | public class MessageIDCode 15 | { 16 | protected byte[] _data; 17 | protected int idCodeOffset = 0; 18 | 19 | public MessageIDCode() 20 | { 21 | _data = new byte[5]; 22 | } 23 | 24 | public MessageIDCode(byte[] raw) : this() 25 | { 26 | decode(raw); 27 | } 28 | 29 | public MessageIDCode(DmsMessageMemoryType dmsMessageMemoryType, 30 | UInt16 dmsMessageNumber, UInt16 dmsMessageCRC) : this() 31 | { 32 | MsgMemoryType = dmsMessageMemoryType; 33 | MessageNumber = dmsMessageNumber; 34 | MessageCRC = dmsMessageCRC; 35 | } 36 | 37 | public MessageIDCode(IDmsMessageEntry entry) : 38 | this(entry.dmsMessageMemoryType, entry.dmsMessageNumber, 39 | entry.dmsMessageCRC) { } 40 | 41 | public virtual void decode(byte[] raw) 42 | { 43 | if (raw.Length-idCodeOffset < 5) 44 | throw new ArgumentException(); 45 | Buffer.BlockCopy(raw,0,_data,idCodeOffset,5); 46 | } 47 | 48 | public byte[] encode() 49 | { 50 | byte[] bytes = new byte[5]; 51 | Array.Copy(_data,idCodeOffset,bytes,0,5); 52 | return bytes; 53 | } 54 | 55 | /// 56 | /// The dmsMsgMemoryType of the desired message. 57 | /// 58 | public DmsMessageMemoryType MsgMemoryType 59 | { 60 | get 61 | { 62 | if (_data[0] != 0) 63 | return (DmsMessageMemoryType)_data[0]; 64 | throw new IndexOutOfRangeException(); 65 | } 66 | set 67 | { 68 | _data[0] = (byte)value; 69 | } 70 | } 71 | 72 | /// 73 | /// The dmsMsgNumber of the desired message 74 | /// 75 | public UInt16 MessageNumber 76 | { 77 | get 78 | { 79 | return BitConverter.ToUInt16(_data.Skip(1).Take(2).Reverse().ToArray(),0); 80 | } 81 | set 82 | { 83 | var val = BitConverter.GetBytes(value); 84 | _data[idCodeOffset+1] = val[1]; 85 | _data[idCodeOffset+2] = val[0]; 86 | } 87 | } 88 | 89 | /// 90 | /// The dmsMsgMessageCRC of the desired message 91 | /// 92 | public UInt16 MessageCRC 93 | { 94 | get 95 | { 96 | return BitConverter.ToUInt16(_data.Skip(3).Take(2).Reverse().ToArray(),0); 97 | } 98 | set 99 | { 100 | var val = BitConverter.GetBytes(value); 101 | _data[idCodeOffset+3] = val[1]; 102 | _data[idCodeOffset+4] = val[0]; 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /DMS/MultiUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | using System.Linq; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using System.Xml; 8 | 9 | namespace SharpNTCIP.DMS 10 | { 11 | /// 12 | /// Utilities for working with Markup Language for Transportation 13 | /// Information 14 | /// 15 | public class MultiString 16 | { 17 | public MultiString(string multiString) 18 | { 19 | this.Multi = multiString; 20 | } 21 | 22 | private XDocument multiDocument; 23 | public XDocument MultiDocument 24 | { 25 | get { return multiDocument; } 26 | set { multiDocument = value; } 27 | } 28 | 29 | 30 | public string Multi 31 | { 32 | get 33 | { 34 | string retString; 35 | //Remove outer tag 36 | Regex outerStrip = new Regex(""); 37 | retString = outerStrip.Replace(multiDocument.ToString(), string.Empty); 38 | 39 | //Replace all square brackets with double square brackets 40 | retString = retString.Replace("[", "[[").Replace("]", "]]"); 41 | 42 | //Replace all angle brackets with single square brackets 43 | retString = retString.Replace("<", "[").Replace(" />", "]"); 44 | 45 | //Replace XML formatted characters with ASCII 46 | retString = retString 47 | .Replace(""", "\"") 48 | .Replace("'", "'") 49 | .Replace(">", ">") 50 | .Replace("<", "<") 51 | .Replace("&", "&"); 52 | 53 | return retString; 54 | } 55 | set 56 | { 57 | //Replace illegal XML characters with acceptable ones (ampersand must be first) 58 | string tempString = value 59 | .Replace("&", "&") 60 | .Replace("<", "<") 61 | .Replace(">", ">") 62 | .Replace("'", "'") 63 | .Replace("\"", """); 64 | 65 | //Replace all square brackets appearing alone (single) with xml tag ends "<" and ">" 66 | Regex openRegex = new Regex(@"(?"); 69 | 70 | //Replace all double square brackets with single square brackets 71 | tempString = tempString.Replace("[[", "[").Replace("]]", "]"); 72 | multiDocument = XDocument.Parse("" + tempString + ""); 73 | 74 | } 75 | } 76 | 77 | public override string ToString() 78 | { 79 | Regex bracketStrip = new Regex(@"\[\w+\]"); 80 | return bracketStrip.Replace(this.Multi, string.Empty); 81 | } 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /DMS/PixelFailureTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | public class PixelFailureTable : Table, IPixelFailureEntry> 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DMS/PowerIndex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP.DMS 7 | { 8 | public class DmsRowIndex : Tuple 9 | { 10 | public DmsRowIndex(UInt16 item1) : base(item1) 11 | { 12 | if (item1 > 512) 13 | throw new ArgumentException(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DMS/StatMultiFieldTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using SharpNTCIP.Attributes; 6 | 7 | namespace SharpNTCIP.DMS 8 | { 9 | [NtcipOid("1.3.6.1.4.1.1206.4.2.3.9.2")] 10 | public class StatMultiFieldTable : Table, IStatMultiFieldEntry> 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Helper.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace SharpNTCIP 8 | { 9 | public class Helper 10 | { 11 | public static string GetOid(Type implementedInterface, string implementedProperty) 12 | { 13 | string oid = string.Empty; 14 | var interfaceMethod = implementedInterface.GetProperty(implementedProperty); 15 | if (interfaceMethod != null) 16 | { 17 | NtcipOidAttribute attributeOid = interfaceMethod.GetCustomAttributes( 18 | typeof(NtcipOidAttribute), true).FirstOrDefault() as NtcipOidAttribute; 19 | if (attributeOid != null) 20 | { 21 | oid = attributeOid.NtcipOid; 22 | } 23 | } 24 | return oid; 25 | } 26 | 27 | public static T EnumParse(object value) 28 | { 29 | try 30 | { 31 | return (T)Enum.Parse(typeof(T), Enum.GetName(typeof(T), value)); 32 | } catch 33 | { 34 | throw new InvalidCastException("Returned value does not match known NTCIP values. Perhaps this device implements a newer version of the NTCIP standard"); 35 | } 36 | } 37 | 38 | protected static string formatOid(string oidString, params object[] list) 39 | { 40 | object[] idList = new object[list.Length]; 41 | for (int i = 0; i < idList.Length; i++) 42 | idList[i] = Convert.ToInt32(list[i]); 43 | string finalOid = String.Format(oidString, idList); 44 | return finalOid; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /IAuxiliaryIo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using SharpNTCIP.DMS; 5 | 6 | namespace SharpNTCIP 7 | { 8 | /// 9 | /// Used to control all objects supporting auxiliary IO 10 | /// 11 | /// NTCIP 1203:1997 -- National Transportation Communications 12 | /// for ITS Protocol (NTCIP) Object Definitions for Dynamic Message 13 | /// Signs (DMS) 14 | interface IAuxiliaryIo 15 | { 16 | /// 17 | /// The number of rows contained in the ‘auxIOTable’ with 18 | /// the auxPortType set to ‘digital’. 19 | /// 20 | byte maxAuxIODigital 21 | { 22 | get; 23 | } 24 | 25 | /// 26 | /// The number of rows contained in the ‘auxIOTable’ with 27 | /// the auxPortType set to ‘analog’ 28 | /// 29 | byte maxAuxIOAnalog 30 | { 31 | get; 32 | } 33 | 34 | /// 35 | /// A table providing the means to access the auxiliary I/O 36 | /// of the Controller, this includes reading inputs and setting 37 | /// outputs. A maximum of 255 auxiliary IOs can be defined for 38 | /// all, digital, analog or other types of ports 39 | /// 40 | IAuxIoEntry[] auxIOTable 41 | { 42 | get; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /IGlobalConfiguration.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP 7 | { 8 | /// 9 | /// This node is an identifier used to group all objects for support of configuration functions that are common to most device types 10 | /// TableType: static 11 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.6.1 12 | /// 13 | public interface IGlobalConfiguration 14 | { 15 | /// 16 | /// Specifies a relatively unique ID (e.g., this could be a counter, a check-sum, etc.) for all user-changeable parameters of the particular device-type currently implemented in the device. Often this ID is calculated using a CRC algorithm. This value shall be calculated when a change of any static database object has occurred. The value reported by this object shall not change unless there has been a change in the static data since the last request. If the actual objects, which are to be included to create this object value, are not defined in the actual device-level standard such as 1202 or 1203, then the general guidance is to include all configuration objects that are stored in a type of memory that survives power outages. A management station can use this object to detect any change in the static database objects by monitoring this value after it has established a baseline. 17 | /// 18 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.1.0")] 19 | [NtcipMandatory(false)] 20 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 21 | UInt16 globalSetIDParameter 22 | { 23 | get; 24 | } 25 | 26 | /// 27 | /// The number of rows that are listed in the globalModuleTable. 28 | /// 29 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.2.0")] 30 | [NtcipMandatory(true)] 31 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 32 | uint globalMaxModules 33 | { 34 | get; 35 | } 36 | 37 | /// 38 | /// A table containing information regarding manufacturer 39 | /// of software and hardware and the associated module models and 40 | /// version numbers as well as an indicator if the module is hardware 41 | /// or software related. The number of rows in this table shall equal 42 | /// the value of the globalMaxModules object 43 | /// 44 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3")] 45 | [NtcipMandatory(true)] 46 | [NtcipAccess(NtcipAccessAttribute.Access.none)] 47 | Table, ModuleTableEntry> globalModuleTable 48 | { 49 | get; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | All portions of this software not covered by other copyrights are hereby 2 | licensed under the: 3 | 4 | GNU LESSER GENERAL PUBLIC LICENSE 5 | Version 3, 29 June 2007 6 | 7 | Copyright (C) 2007 Free Software Foundation, Inc. 8 | Everyone is permitted to copy and distribute verbatim copies 9 | of this license document, but changing it is not allowed. 10 | 11 | 12 | This version of the GNU Lesser General Public License incorporates 13 | the terms and conditions of version 3 of the GNU General Public 14 | License, supplemented by the additional permissions listed below. 15 | 16 | 0. Additional Definitions. 17 | 18 | As used herein, "this License" refers to version 3 of the GNU Lesser 19 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 20 | General Public License. 21 | 22 | "The Library" refers to a covered work governed by this License, 23 | other than an Application or a Combined Work as defined below. 24 | 25 | An "Application" is any work that makes use of an interface provided 26 | by the Library, but which is not otherwise based on the Library. 27 | Defining a subclass of a class defined by the Library is deemed a mode 28 | of using an interface provided by the Library. 29 | 30 | A "Combined Work" is a work produced by combining or linking an 31 | Application with the Library. The particular version of the Library 32 | with which the Combined Work was made is also called the "Linked 33 | Version". 34 | 35 | The "Minimal Corresponding Source" for a Combined Work means the 36 | Corresponding Source for the Combined Work, excluding any source code 37 | for portions of the Combined Work that, considered in isolation, are 38 | based on the Application, and not on the Linked Version. 39 | 40 | The "Corresponding Application Code" for a Combined Work means the 41 | object code and/or source code for the Application, including any data 42 | and utility programs needed for reproducing the Combined Work from the 43 | Application, but excluding the System Libraries of the Combined Work. 44 | 45 | 1. Exception to Section 3 of the GNU GPL. 46 | 47 | You may convey a covered work under sections 3 and 4 of this License 48 | without being bound by section 3 of the GNU GPL. 49 | 50 | 2. Conveying Modified Versions. 51 | 52 | If you modify a copy of the Library, and, in your modifications, a 53 | facility refers to a function or data to be supplied by an Application 54 | that uses the facility (other than as an argument passed when the 55 | facility is invoked), then you may convey a copy of the modified 56 | version: 57 | 58 | a) under this License, provided that you make a good faith effort to 59 | ensure that, in the event an Application does not supply the 60 | function or data, the facility still operates, and performs 61 | whatever part of its purpose remains meaningful, or 62 | 63 | b) under the GNU GPL, with none of the additional permissions of 64 | this License applicable to that copy. 65 | 66 | 3. Object Code Incorporating Material from Library Header Files. 67 | 68 | The object code form of an Application may incorporate material from 69 | a header file that is part of the Library. You may convey such object 70 | code under terms of your choice, provided that, if the incorporated 71 | material is not limited to numerical parameters, data structure 72 | layouts and accessors, or small macros, inline functions and templates 73 | (ten or fewer lines in length), you do both of the following: 74 | 75 | a) Give prominent notice with each copy of the object code that the 76 | Library is used in it and that the Library and its use are 77 | covered by this License. 78 | 79 | b) Accompany the object code with a copy of the GNU GPL and this license 80 | document. 81 | 82 | 4. Combined Works. 83 | 84 | You may convey a Combined Work under terms of your choice that, 85 | taken together, effectively do not restrict modification of the 86 | portions of the Library contained in the Combined Work and reverse 87 | engineering for debugging such modifications, if you also do each of 88 | the following: 89 | 90 | a) Give prominent notice with each copy of the Combined Work that 91 | the Library is used in it and that the Library and its use are 92 | covered by this License. 93 | 94 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 95 | document. 96 | 97 | c) For a Combined Work that displays copyright notices during 98 | execution, include the copyright notice for the Library among 99 | these notices, as well as a reference directing the user to the 100 | copies of the GNU GPL and this license document. 101 | 102 | d) Do one of the following: 103 | 104 | 0) Convey the Minimal Corresponding Source under the terms of this 105 | License, and the Corresponding Application Code in a form 106 | suitable for, and under terms that permit, the user to 107 | recombine or relink the Application with a modified version of 108 | the Linked Version to produce a modified Combined Work, in the 109 | manner specified by section 6 of the GNU GPL for conveying 110 | Corresponding Source. 111 | 112 | 1) Use a suitable shared library mechanism for linking with the 113 | Library. A suitable mechanism is one that (a) uses at run time 114 | a copy of the Library already present on the user's computer 115 | system, and (b) will operate properly with a modified version 116 | of the Library that is interface-compatible with the Linked 117 | Version. 118 | 119 | e) Provide Installation Information, but only if you would otherwise 120 | be required to provide such information under section 6 of the 121 | GNU GPL, and only to the extent that such information is 122 | necessary to install and execute a modified version of the 123 | Combined Work produced by recombining or relinking the 124 | Application with a modified version of the Linked Version. (If 125 | you use option 4d0, the Installation Information must accompany 126 | the Minimal Corresponding Source and Corresponding Application 127 | Code. If you use option 4d1, you must provide the Installation 128 | Information in the manner specified by section 6 of the GNU GPL 129 | for conveying Corresponding Source.) 130 | 131 | 5. Combined Libraries. 132 | 133 | You may place library facilities that are a work based on the 134 | Library side by side in a single library together with other library 135 | facilities that are not Applications and are not covered by this 136 | License, and convey such a combined library under terms of your 137 | choice, if you do both of the following: 138 | 139 | a) Accompany the combined library with a copy of the same work based 140 | on the Library, uncombined with any other library facilities, 141 | conveyed under the terms of this License. 142 | 143 | b) Give prominent notice with the combined library that part of it 144 | is a work based on the Library, and explaining where to find the 145 | accompanying uncombined form of the same work. 146 | 147 | 6. Revised Versions of the GNU Lesser General Public License. 148 | 149 | The Free Software Foundation may publish revised and/or new versions 150 | of the GNU Lesser General Public License from time to time. Such new 151 | versions will be similar in spirit to the present version, but may 152 | differ in detail to address new problems or concerns. 153 | 154 | Each version is given a distinguishing version number. If the 155 | Library as you received it specifies that a certain numbered version 156 | of the GNU Lesser General Public License "or any later version" 157 | applies to it, you have the option of following the terms and 158 | conditions either of that published version or of any later version 159 | published by the Free Software Foundation. If the Library as you 160 | received it does not specify a version number of the GNU Lesser 161 | General Public License, you may choose any version of the GNU Lesser 162 | General Public License ever published by the Free Software Foundation. 163 | 164 | If the Library as you received it specifies that a proxy can decide 165 | whether future versions of the GNU Lesser General Public License shall 166 | apply, that proxy's public statement of acceptance of any version is 167 | permanent authorization for you to choose that version for the 168 | Library. 169 | 170 | Portions of this software (including summary descriptions appearing 171 | througout the software) contain derivations of MIB files which are 172 | copyrighted as follows: 173 | 174 | --Copyright 1997-2000 by the American Association of State Highway and 175 | --Transportation Officials (AASHTO), the Institute of Transportation Engineers 176 | --(ITE), and the National Electrical Manufacturers Association (NEMA). All 177 | --intellectual property rights, including, but not limited to, the rights of 178 | --reproduction in whole or in part in any form, translation into other 179 | --languages and display are reserved by the copyright owners under the laws of 180 | --the United States of America, the Universal Copyright Convention, the Berne 181 | --Convention, and the International and Pan American Copyright Conventions. 182 | --Except for the MIB, Do not copy without written permission of either AASHTO, 183 | --ITE, or NEMA. 184 | -- 185 | -- Joint NEMA, AASHTO, and ITE 186 | -- NTCIP Management Information Base 187 | -- DISTRIBUTION NOTICE 188 | -- 189 | --To the extent and in the limited event these materials are distributed by 190 | --AASHTO/ITE/NEMA in the form of a Management Information Base ("MIB"), 191 | --AASHTO/ITE/NEMA extends the following permissions: 192 | -- 193 | -- (i) you may make and/or distribute unlimited copies (including derivative 194 | --works) of the MIB, including copies for commercial distribution, provided 195 | --that (a) each copy you make and/or distribute contains this Notice and (b) 196 | --each derivative work of the MIB uses the same module name followed by "-", 197 | --followed by your Internet Assigned Number Authority (IANA)-assigned 198 | --enterprise number; 199 | --(ii) use of the MIB is restricted in that the syntax field may be modified 200 | --only to reflect a more restrictive sub-range or enumerated values; 201 | --(iii) the description field may be modified but only to the extent that: 202 | --(a) only those bit values or enumerated values that are supported are 203 | --listed; and (b) the more restrictive subrange is expressed. 204 | -- 205 | --These materials are delivered "AS IS" without any warranties as to their use 206 | --or performance. 207 | -- 208 | --AASHTO/ITE/NEMA AND THEIR SUPPLIERS DO NOT WARRANT THE PERFORMANCE OR 209 | --RESULTS YOU MAY OBTAIN BY USING THESE MATERIALS. AASHTO/ITE/NEMA AND THEIR 210 | --SUPPLIERS MAKE NO WARRANTIES, EXPRESS OR IMPLIED, AS TO NONINFRINGEMENT OF 211 | --THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. 212 | --IN NO EVENT WILL AASHTO, ITE OR NEMA OR THEIR SUPPLIERS BE LIABLE TO YOU OR 213 | --ANY THIRD PARTY FOR ANY CLAIM OR FOR ANY CONSEQUENTIAL, INCIDENTAL OR 214 | --SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, ARISING FROM 215 | --YOUR REPRODUCTION OR USE OF THESE MATERIALS, EVEN IF AN AASHTO, ITE, OR NEMA 216 | --REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Some 217 | --states or jurisdictions do not allow the exclusion or limitation of 218 | --incidental, consequential or special damages, or the exclusion of implied 219 | --warranties, so the above limitations may not apply to you. 220 | -- 221 | --Use of these materials does not constitute an endorsement or affiliation by 222 | --or between AASHTO, ITE, or NEMA and you, your company, or your products and 223 | --services. 224 | -- 225 | --NTCIP is a trademark of AASHTO/ITE/NEMA. 226 | --****************************************************************************** 227 | 228 | These derived portions are considered in compliance with: 229 | (i): through the inclusion of this notice with each copy of the software, 230 | that the purpose and character of this use is for nonprofit educational purposes, 231 | that the amount and substantiality of the portion used in relation to the 232 | copyrighted work as a whole is small, and that the effect of the use upon the 233 | potential market for or value of the copyrighted work is ovearall increased. 234 | (ii) and (iii): as no extra values or enumerations have been added, and a more 235 | restrictive subrange is instead expressed. 236 | 237 | No endorsement by or affiliation with AASHTO, ITE, or NEMA is claimed by or for 238 | this software. -------------------------------------------------------------------------------- /ModuleTableEntry.cs: -------------------------------------------------------------------------------- 1 | using SharpNTCIP.Attributes; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP 7 | { 8 | 9 | public enum ModuleType 10 | { 11 | other = 1, hardware = 2, software = 3 12 | } 13 | 14 | /// 15 | /// This object defines an entry in the module table. 16 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.6.1.3.1 17 | /// 18 | public class ModuleTableEntry 19 | { 20 | /// 21 | /// This object contains the row number (1..255) within 22 | /// this table for the associated module 23 | /// 24 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3.1.1.{0}")] 25 | [NtcipMandatory(true)] 26 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 27 | public virtual uint moduleNumber 28 | { 29 | get { return moduleNumber; } 30 | } 31 | 32 | /// 33 | /// This object contains the device node number of the 34 | /// device-type, e.g., an ASC signal controller would have an OID of 35 | /// 1.3.6.1.4.1.1206.4.2.1 36 | /// 37 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3.1.2.{0}")] 38 | [NtcipMandatory(true)] 39 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 40 | public virtual object moduleDeviceNode 41 | { 42 | get { return moduleDeviceNode; } 43 | } 44 | 45 | /// 46 | /// Definition>This object specifies the manufacturer of the 47 | /// associated module. A null-string shall be transmitted if this 48 | /// object has no entry. 49 | /// 50 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3.1.3.{0}")] 51 | [NtcipMandatory(true)] 52 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 53 | public virtual string moduleMake 54 | { 55 | get { return moduleMake; } 56 | } 57 | 58 | /// 59 | /// This object specifies the model number (hardware) or 60 | /// firmware reference (software) of the associated module. A nullstring 61 | /// shall be transmitted if this object has no entry. 62 | /// 63 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3.1.4.{0}")] 64 | [NtcipMandatory(true)] 65 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 66 | public virtual string moduleModel 67 | { 68 | get { return moduleModel; } 69 | } 70 | 71 | /// 72 | /// This object specifies the version of the associated 73 | /// module. If the moduleType has a value of software, the value of 74 | /// this object shall include the date on which the software was 75 | /// released as a string in the form of YYYYMMDD, it shall be followed 76 | /// by a space, a hyphen, another space, the lower-case letter ‘v’, 77 | /// followed by a version or configuration number. Preceding zeros 78 | /// shall be required for the date. For example, version 7.03.02 of 79 | /// the software released on July 5, 2002 would be presented as 80 | /// 20020705 – v7.03.02 81 | /// 82 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3.1.5.{0}")] 83 | [NtcipMandatory(true)] 84 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 85 | public virtual string moduleVersion 86 | { 87 | get { return moduleVersion; } 88 | } 89 | 90 | /// 91 | /// This object specifies whether the associated module 92 | /// is a hardware or software module 93 | /// 94 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.3.1.6.{0}")] 95 | [NtcipMandatory(true)] 96 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 97 | public virtual ModuleType moduleType 98 | { 99 | get { return moduleType; } 100 | } 101 | 102 | /// 103 | /// For use in this object, an ASCII string that shall 104 | /// identify all of the standard document numbers that define or 105 | /// reference MIBs upon which the device is based. Where applicable, 106 | /// profiles shall be referenced rather than the base standards. The 107 | /// version string shall be constructed as follows: The acronym of the 108 | /// standards development organization (or other body) that developed 109 | /// and approved the standard; a space; the standards document number; 110 | /// a colon; and the documents version number as designated by the 111 | /// standards development organization (or other body). Separate 112 | /// entries in the list of standards shall be separated by a carriage 113 | /// return (0x0d) and line feed (0x0a). 114 | /// In the case of NTCIP documents prior to formal approval, the 115 | /// version number shall be the version number in the form of lower 116 | /// case ‘v’ followed by the major version followed by a period 117 | /// followed by the minor revision. In the case of approved NTCIP 118 | /// standards, the publication year shall precede the version number. 119 | /// In the case of amended NTCIP standards, the version number shall 120 | /// be replaced by the four digit year of publication of the published 121 | /// standard followed by the upper case letter ‘A’, followed by the 122 | /// amendment number. 123 | /// For example, a message sign may have the following value for this 124 | /// object: 125 | /// NTCIP 1201:v02.19 126 | /// NTCIP 1203:1997A1 127 | /// NTCIP 2101:2001 v01.19 128 | /// NTCIP 2103:v01.13 129 | /// NTCIP 2201:v01.14 130 | /// NTCIP 2301:2001 v01.08 131 | /// 132 | [NtcipOid("1.3.6.1.4.1.1206.4.2.6.1.4.{0}")] 133 | [NtcipMandatory(true)] 134 | [NtcipAccess(NtcipAccessAttribute.Access.read)] 135 | public virtual string controllerBaseStandards 136 | { 137 | get { return controllerBaseStandards; } 138 | } 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SharpNTCIP")] 9 | [assembly: AssemblyDescription("A C# Implementation of NTCIP Interfaces and Data Structures")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SharpNTCIP")] 13 | [assembly: AssemblyCopyright("Copyright 2014 Mark Shook, Released under LGPL3")] 14 | [assembly: AssemblyTrademark("SharpNTCIP")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("41ce3b8c-85c0-4206-a6d5-2e61542e412d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SharpNTCIP 2 | ========== 3 | 4 | SharpNTCIP 5 | -------------------------------------------------------------------------------- /ReadOnlyTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP 7 | { 8 | public abstract class ReadOnlyTable : Table 9 | { 10 | public override bool IsReadOnly 11 | { 12 | get 13 | { 14 | return false; 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SharpNTCIP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.21022 7 | 2.0 8 | {2ED7257F-B768-406D-98E1-5DFF6C041287} 9 | Library 10 | Properties 11 | SharpNTCIP 12 | SharpNTCIP 13 | v4.0 14 | 512 15 | 16 | 17 | 3.5 18 | 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | SharpNTCIP_NuGet\lib\net40\ 26 | DEBUG;TRACE 27 | prompt 28 | 3 29 | 30 | 31 | false 32 | On 33 | false 34 | 35 | 36 | none 37 | true 38 | SharpNTCIP_NuGet\lib\net40\ 39 | TRACE 40 | prompt 41 | 4 42 | 43 | 44 | false 45 | false 46 | false 47 | 48 | 49 | x86 50 | SharpNTCIP_NuGet\lib\net40\ 51 | full 52 | 53 | 54 | x86 55 | SharpNTCIP_NuGet\lib\net40\ 56 | pdbonly 57 | true 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 167 | -------------------------------------------------------------------------------- /SharpNTCIP.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 2012 3 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{31D44373-C1C7-48D8-9A0B-005A35DC8C48}" 4 | EndProject 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNTCIP", "SharpNTCIP.csproj", "{2ED7257F-B768-406D-98E1-5DFF6C041287}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNTCIP.Test.Runner", "Test\Runner\SharpNTCIP.Test.Runner.csproj", "{1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}" 8 | EndProject 9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNTCIP.Test.Tests", "Test\Tests\SharpNTCIP.Test.Tests.csproj", "{307E5B67-2C36-40C2-B287-21EB9FAE397D}" 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpNTCIP_NuGet", "SharpNTCIP_NuGet\SharpNTCIP_NuGet.csproj", "{0451BAEF-DF2E-4B98-8644-94EE9415E389}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Debug|x86 = Debug|x86 17 | Release|Any CPU = Release|Any CPU 18 | Release|x86 = Release|x86 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Debug|x86.ActiveCfg = Debug|x86 24 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Debug|x86.Build.0 = Debug|x86 25 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Release|Any CPU.Build.0 = Release|Any CPU 27 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Release|x86.ActiveCfg = Release|x86 28 | {2ED7257F-B768-406D-98E1-5DFF6C041287}.Release|x86.Build.0 = Release|x86 29 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Debug|x86.ActiveCfg = Debug|x86 32 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Debug|x86.Build.0 = Debug|x86 33 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Release|Any CPU.ActiveCfg = Release|Any CPU 34 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Release|Any CPU.Build.0 = Release|Any CPU 35 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Release|x86.ActiveCfg = Release|x86 36 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9}.Release|x86.Build.0 = Release|x86 37 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 38 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Debug|Any CPU.Build.0 = Debug|Any CPU 39 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Debug|x86.ActiveCfg = Debug|x86 40 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Debug|x86.Build.0 = Debug|x86 41 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Release|x86.ActiveCfg = Release|x86 44 | {307E5B67-2C36-40C2-B287-21EB9FAE397D}.Release|x86.Build.0 = Release|x86 45 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 46 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|Any CPU.Build.0 = Debug|Any CPU 47 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|x86.ActiveCfg = Debug|x86 48 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|x86.Build.0 = Debug|x86 49 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Release|x86.ActiveCfg = Release|x86 51 | EndGlobalSection 52 | GlobalSection(SolutionProperties) = preSolution 53 | HideSolutionNode = FALSE 54 | EndGlobalSection 55 | GlobalSection(NestedProjects) = preSolution 56 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9} = {31D44373-C1C7-48D8-9A0B-005A35DC8C48} 57 | {307E5B67-2C36-40C2-B287-21EB9FAE397D} = {31D44373-C1C7-48D8-9A0B-005A35DC8C48} 58 | EndGlobalSection 59 | EndGlobal 60 | -------------------------------------------------------------------------------- /SpeedSensorSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SpeedSensorLib 7 | { 8 | /// 9 | /// Stores an NTCIP 1209 TSS speed measuring device sample 10 | /// 11 | class SpeedSensorSample 12 | { 13 | public uint sensor_id 14 | { 15 | get { return sensor_id; } 16 | set { sensor_id = value; } 17 | } 18 | 19 | public uint zone_id 20 | { 21 | get { return zone_id; } 22 | set { zone_id = value; } 23 | } 24 | 25 | public uint class_id 26 | { 27 | get { return class_id; } 28 | set { class_id = value; } 29 | } 30 | 31 | public float volume 32 | { 33 | get { return volume; } 34 | set { volume = value; } 35 | } 36 | 37 | public float occupancy 38 | { 39 | get { return occupancy; } 40 | set { occupancy = value; } 41 | } 42 | 43 | public float speed 44 | { 45 | get { return speed; } 46 | set { speed = value; } 47 | } 48 | 49 | public DateTime sample_end_time 50 | { 51 | get { return sample_end_time; } 52 | set { sample_end_time = value; } 53 | } 54 | 55 | public uint zone_status 56 | { 57 | get { return status; } 58 | set { status = value; } 59 | } 60 | 61 | public uint sequence_number 62 | { 63 | get { return sequence_number; } 64 | set { sequence_number = value; } 65 | } 66 | 67 | public bool timestamp_since_tss_reset 68 | { 69 | get { return timestamp_since_tss_reset; } 70 | set { timestamp_since_tss_reset = value; } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /TSS/DataBufferEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public class DataBufferEntry 8 | { 9 | public virtual uint endTimeBuffer 10 | { 11 | get; 12 | set; 13 | } 14 | 15 | public virtual UInt16 volumeDataBuffer 16 | { 17 | get; 18 | set; 19 | } 20 | 21 | public virtual UInt16 percentOccupancyBuffer 22 | { 23 | get; 24 | set; 25 | } 26 | 27 | public virtual UInt16 speedDataBuffer 28 | { 29 | get; 30 | set; 31 | } 32 | 33 | public virtual ZoneStatus zoneStatusBuffer 34 | { 35 | get; 36 | set; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /TSS/DataCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | /// 8 | /// Node for TSS data collection elements 9 | /// 10 | /// Reference: NTCIP1209v0209 11 | /// 12 | public class DataCollection 13 | { 14 | public virtual Dictionary dataCollectionTable 15 | { 16 | get; 17 | set; 18 | } 19 | 20 | public virtual Dictionary dataBufferTable 21 | { 22 | get; 23 | set; 24 | } 25 | 26 | public virtual Dictionary> zoneSequenceTable 27 | { 28 | get; 29 | set; 30 | } 31 | 32 | public virtual Dictionary> sampleDataTable 33 | { 34 | get; 35 | set; 36 | } 37 | 38 | public virtual List zoneClassTable 39 | { 40 | get; 41 | set; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /TSS/DataCollectionEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public abstract class DataCollectionEntry 8 | { 9 | public uint endTime 10 | { 11 | get; 12 | set; 13 | } 14 | 15 | public UInt16 volumeData 16 | { 17 | get; 18 | set; 19 | } 20 | 21 | public UInt16 percentOccupancy 22 | { 23 | get; 24 | set; 25 | } 26 | 27 | public UInt16 speedData 28 | { 29 | get; 30 | set; 31 | } 32 | 33 | public ZoneStatus zoneStatus 34 | { 35 | get; 36 | set; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /TSS/ITSSControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public interface ITSSControl 8 | { 9 | UInt16 maxOutputNumber 10 | { 11 | get; 12 | } 13 | 14 | List outputConfigurationEntry 15 | { 16 | get; 17 | } 18 | 19 | UInt16 maxOutputGroups 20 | { 21 | get; 22 | } 23 | 24 | List outputGroupTable 25 | { 26 | get; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TSS/ITSSDevice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | enum BinaryEnabled 8 | { 9 | Disabled = 0, 10 | Enabled = 1 11 | } 12 | 13 | public interface ITSSDevice : IGlobalConfiguration 14 | { 15 | ITSSSystemSetup tssSystemSetup 16 | { 17 | get; 18 | } 19 | 20 | ITSSControl tssControl 21 | { 22 | get; 23 | } 24 | 25 | DataCollection tssDataCollection 26 | { 27 | get; 28 | } 29 | 30 | ITSSInductiveLoop tssInductiveLoop 31 | { 32 | get; 33 | } 34 | 35 | ITSSMachineVision tssMachineVision 36 | { 37 | get; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /TSS/ITSSInductiveLoop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public interface ITSSInductiveLoop 8 | { 9 | List loopSensorSetupTable 10 | { 11 | get; 12 | set; 13 | } 14 | 15 | List loopOutputConditioningTable 16 | { 17 | get; 18 | set; 19 | } 20 | 21 | List loopoSystemStatusTable 22 | { 23 | get; 24 | set; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TSS/ITSSMachineVision.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public enum ImageType 8 | { 9 | snapshot = 1, 10 | baseline = 2 11 | } 12 | 13 | public enum ImageOverlayType 14 | { 15 | none = 1, 16 | thisZone, 17 | allZones, 18 | defaultOverlay 19 | } 20 | 21 | public enum ImageFormat 22 | { 23 | bitmap = 1, 24 | jpeg 25 | } 26 | 27 | public enum BuildImageCommand 28 | { 29 | buildImage = 1, 30 | cancelBuildInProgress 31 | } 32 | 33 | public enum BuildImageStatus 34 | { 35 | noImage = 1, 36 | buildingImage, 37 | imageReady, 38 | genericError, 39 | invalidParameter, 40 | noCameraForZone, 41 | multipleCamerasForZone, 42 | imageReceiveError, 43 | buildPending 44 | } 45 | 46 | public interface ITSSMachineVision 47 | { 48 | UInt16 maxCameraCount 49 | { 50 | get; 51 | set; 52 | } 53 | 54 | List machineVisionCameraTable 55 | { 56 | get; 57 | set; 58 | } 59 | 60 | UInt16 imageZoneNumber 61 | { 62 | get; 63 | set; 64 | } 65 | 66 | ImageType imageType 67 | { 68 | get; 69 | set; 70 | } 71 | 72 | ImageOverlayType imageOverlayType 73 | { 74 | get; 75 | set; 76 | } 77 | 78 | ImageFormat imageFormat 79 | { 80 | get; 81 | set; 82 | } 83 | 84 | UInt16 imageQuality 85 | { 86 | get; 87 | set; 88 | } 89 | 90 | BuildImageCommand buildImageCmd 91 | { 92 | get; 93 | set; 94 | } 95 | 96 | BuildImageStatus buildImageStatus 97 | { 98 | get; 99 | set; 100 | } 101 | 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /TSS/ITSSSystemSetup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public enum SensorSystemResetStatus 8 | { 9 | restart = 1, reinitializeUserSettings, restoreFactoryDefaults, retune, resyncSamplingPeriods, shortDiagnostics, fullDiagnostics, executePendingConfiguration, abortPendingConfiguration, validatePendingConfiguration, noResetInProgress 10 | } 11 | 12 | public enum SensorSystemStatus 13 | { 14 | other = 1, oK, initializing, pendingConfigurationChange, validatingPendingConfiguration, diagError, activeConfigError, pendingConfigError 15 | } 16 | 17 | public enum SensorSystemOccupancyType 18 | { 19 | normalizedOtherOccupancy = 1, nonNormalizedOccupancy, zoneOccupancy, normalizedSixFoorLoopOccupancy, normalizedTwoMeterLoopOccupancy, normalizedPointOccupancy 20 | } 21 | 22 | public enum SensorTechnology 23 | { 24 | other = 1, inductiveLoop = 2, machineVision = 3 25 | } 26 | 27 | public interface ITSSSystemSetup 28 | { 29 | SensorSystemResetStatus sensorSystemReset 30 | { 31 | get; 32 | set; 33 | } 34 | 35 | SensorSystemStatus sensorSystemStatus 36 | { 37 | get; 38 | } 39 | 40 | SensorSystemOccupancyType sensorSystemOccupancyType 41 | { 42 | get; 43 | } 44 | 45 | UInt16 maxSensorZones 46 | { 47 | get; 48 | } 49 | 50 | List sensorZoneTable 51 | { 52 | get; 53 | set; 54 | } 55 | 56 | bool clockAvailable 57 | { 58 | get; 59 | } 60 | 61 | SensorTechnology sensorTechnology 62 | { 63 | get; 64 | } 65 | 66 | UInt16 maxSampleDataEntries 67 | { 68 | get; 69 | } 70 | 71 | UInt16 maxNumberOfCharacters 72 | { 73 | get; 74 | } 75 | 76 | bool[] functionalCapabilities 77 | { 78 | get; 79 | } 80 | 81 | bool[] externalArmingInputs 82 | { 83 | get; 84 | set; 85 | } 86 | 87 | List outputConditioningTable 88 | { 89 | get; 90 | set; 91 | } 92 | 93 | string pendingConfigurationFileName 94 | { 95 | get; 96 | set; 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /TSS/LoopOutputConditioningEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | enum ZoneOutputMode 8 | { 9 | other=1, 10 | pulse, 11 | presence 12 | } 13 | 14 | public abstract class LoopOutputConditioningEntry 15 | { 16 | ZoneOutputMode zoneOutputMode 17 | { 18 | get; 19 | set; 20 | } 21 | 22 | UInt16 zoneMaxPresenceTime 23 | { 24 | get; 25 | set; 26 | } 27 | 28 | UInt16 zoneOutputDelayTime 29 | { 30 | get; 31 | set; 32 | } 33 | 34 | UInt16 zoneOutputExtendTime 35 | { 36 | get; 37 | set; 38 | } 39 | 40 | BinaryEnabled[] zoneOutputExtendEnable 41 | { 42 | get; 43 | set; 44 | } 45 | 46 | BinaryEnabled[] zoneOutputDelayEnable 47 | { 48 | get; 49 | set; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /TSS/LoopSensorSetupEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | enum ZoneSensitivityMode 8 | { 9 | deltaL = 1, deltaLOverSqrtL = 2, deltaLOverL = 3 10 | } 11 | 12 | enum SensorZoneLoopLayout 13 | { 14 | other = 1, 15 | oneSixBySixLoopOneLane, 16 | twoSixBySixLoopsOneLane, 17 | threeSixBySixLoopsOneLane, 18 | fourSixBySixLoopsOneLane, 19 | oneLongLoopOneLane, 20 | oneSixBySixLoopsMultipleLanes 21 | } 22 | 23 | public abstract class LoopSensorSetupEntry 24 | { 25 | ZoneSensitivityMode zoneSensitivityMode 26 | { 27 | get; 28 | set; 29 | } 30 | 31 | bool[] zoneSensitivity 32 | { 33 | get; 34 | set; 35 | } 36 | 37 | bool[] zoneFrequencyRange 38 | { 39 | get; 40 | set; 41 | } 42 | 43 | SensorZoneLoopLayout sensorZoneLoopLayout 44 | { 45 | get; 46 | set; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /TSS/LoopSystemStatusEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public abstract class LoopSystemStatusEntry 8 | { 9 | UInt16 zoneInductance 10 | { 11 | get; 12 | set; 13 | } 14 | 15 | UInt32 zoneFrequency 16 | { 17 | get; 18 | set; 19 | } 20 | 21 | UInt32 zoneInductanceChange 22 | { 23 | get; 24 | set; 25 | } 26 | 27 | bool[] zoneFaultHistory 28 | { 29 | get; 30 | set; 31 | } 32 | 33 | UInt16 zoneFaultCount 34 | { 35 | get; 36 | set; 37 | } 38 | 39 | UInt32 zonePercentInductanceChange 40 | { 41 | get; 42 | set; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /TSS/MachineVisionCameraEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public enum CameraDetectionState 8 | { 9 | detectionIsNotDisabled = 1, 10 | detectionIsDisabled 11 | } 12 | 13 | public enum BaselineImage 14 | { 15 | notSupported = 1, 16 | supportedAndAvailable, 17 | supportedButNotAvailable 18 | } 19 | 20 | public enum SnapshotImageSupport 21 | { 22 | notSupported = 1, 23 | supported 24 | } 25 | 26 | public abstract class MachineVisionCameraEntry 27 | { 28 | 29 | UInt16 cameraNumber 30 | { 31 | get; 32 | set; 33 | } 34 | 35 | string cameraNameLabel 36 | { 37 | get; 38 | set; 39 | } 40 | 41 | UInt16 imageReceptionDiagnostic 42 | { 43 | get; 44 | set; 45 | } 46 | 47 | CameraDetectionState cameraDetectionState 48 | { 49 | get; 50 | set; 51 | } 52 | 53 | bool[] zoneListForCamera 54 | { 55 | get; 56 | set; 57 | } 58 | 59 | BaselineImage baselineImage 60 | { 61 | get; 62 | set; 63 | } 64 | 65 | SnapshotImageSupport snapshotImage 66 | { 67 | get; 68 | set; 69 | } 70 | 71 | bool[] cameraImageFormat 72 | { 73 | get; 74 | set; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /TSS/OutputConditioningEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public enum SensorZoneOutputMode 8 | { 9 | other = 1, pulse = 2, presence = 3 10 | } 11 | 12 | public enum SensorZoneOutputDelayMode 13 | { 14 | delayEnablesHaveNoEffect = 1, delayEnablesORedActive = 2, delayEnablesORedNotActive = 3, dleayEnablesANDedActive = 4, delayEnablesANDedNotActive = 5 15 | } 16 | 17 | public enum SensorZoneOutputExtendMode 18 | { 19 | extendEnablesHaveNoEffect = 1, extendEnablesORedActive = 2, extendEnablesORedNotActive = 3, extendEnablesANDedActive = 4, extendEnablesANDedNotActive = 5 20 | } 21 | 22 | public abstract class OutputConditioningEntry 23 | { 24 | public abstract SensorZoneOutputMode sensorZoneOutputMode 25 | { 26 | get; 27 | set; 28 | } 29 | 30 | public abstract UInt16 sensorZoneMaxPresenceTime 31 | { 32 | get; 33 | set; 34 | } 35 | 36 | public abstract UInt16 sensorZoneOutputDelayTime 37 | { 38 | get; 39 | set; 40 | } 41 | 42 | public abstract SensorZoneOutputDelayMode sensorZoneOutputDelayMode 43 | { 44 | get; 45 | set; 46 | } 47 | 48 | public abstract bool[] sensorZoneOutputDelayEnables 49 | { 50 | get; 51 | set; 52 | } 53 | 54 | public abstract UInt16 sensorZoneOutputExtendTime 55 | { 56 | get; 57 | set; 58 | } 59 | 60 | public abstract SensorZoneOutputExtendMode sensorZoneOutputExtendMode 61 | { 62 | get; 63 | set; 64 | } 65 | 66 | public abstract bool[] sensorZoneOutputExtendEnables 67 | { 68 | get; 69 | set; 70 | } 71 | 72 | public abstract byte sensorZoneOutputSequenced 73 | { 74 | get; 75 | set; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /TSS/OutputConfigurationEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | enum OutputFailsafeMode 8 | { 9 | failsafeModeOn = 1, 10 | failsafeModeOff, 11 | overrideCommandOn, 12 | overrideCommandOff, 13 | normal = 5 14 | } 15 | 16 | enum OutputArmingMode 17 | { 18 | armingEnablesHaveNoEffect = 1, 19 | normOffArmingEnablesORedZone, 20 | normOnArmingEnablesORedZone, 21 | normZoneArmingEnablesORedOff, 22 | normZoneArmingEnablesORedOn, 23 | normOffArmingEnablesANDedZone, 24 | normOnArmingEnablesANDedZone, 25 | normZoneArmingEnablesANDedOff, 26 | normZoneArmingEnablesANDedOn 27 | } 28 | 29 | public abstract class OutputConfigurationEntry 30 | { 31 | UInt16 outputNumber 32 | { 33 | get; 34 | set; 35 | } 36 | 37 | UInt16 outputSensorZoneNumber 38 | { 39 | get; 40 | set; 41 | } 42 | 43 | OutputFailsafeMode outputFailsafeMode 44 | { 45 | get; 46 | set; 47 | } 48 | 49 | bool[] outputModeStatus 50 | { 51 | get; 52 | set; 53 | } 54 | 55 | string outputLabel 56 | { 57 | get; 58 | set; 59 | } 60 | 61 | bool[] outputArmingEnables 62 | { 63 | get; 64 | set; 65 | } 66 | 67 | OutputArmingMode outputArmingMode 68 | { 69 | get; 70 | set; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /TSS/OutputGroupEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public abstract class OutputGroupEntry 8 | { 9 | UInt16 outputGroupNumber 10 | { 11 | get; 12 | set; 13 | } 14 | 15 | bool[] outputGroupOutputState 16 | { 17 | get; 18 | set; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TSS/SampleDataEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | /// 8 | /// Identifies which historical sampling period that data is being requested from. 9 | /// 0 being the sampling period currently in progress. 10 | /// 1 being the most recently completed sampling period. 11 | /// 12 | /// Reference: NTCIP1209v0209 13 | /// 14 | public enum SampleEntryNumber 15 | { 16 | InProgress = 0, MostRecentCompleted, SecondmostRecentCompleted, ThirdmostRecentCompleted, ForthmostRecentCompleted 17 | } 18 | 19 | /// 20 | /// Detailed status returned as result of diagnostics, as follows: 21 | /// Value - Meaning 22 | /// 23 | /// --other(1) - Status returned indicating an error has occurred within the device for 24 | /// which there is no defined definition within this data element 25 | /// 26 | /// --oK(2) - Status returned indicating no other status values apply 27 | /// 28 | /// --initializing(3) - Status returned indicating an initialization or diagnostics 29 | /// procedure is in progress 30 | /// 31 | /// --noActivity(4) - Status returned indicating no activity condition 32 | /// 33 | /// --maxPresence(5) - Status returned indicating max presence condition 34 | /// 35 | /// --configurationError(6) - Status returned indicating an error within the device 36 | /// configuration setup 37 | /// 38 | /// --erraticCounts(7 )- Status returned indicating erratic counts 39 | /// 40 | /// --disabled(8) - Status returned indicating that the zone is disabled 41 | /// 42 | /// --overrideActive(9) - Status returned indicating an override is active 43 | /// 44 | /// --sensorFailure(10) - Status returned indicating a sensing element failure 45 | /// 46 | /// --inputDataIntegrity(11) - Status returned indicating input values are not 47 | /// sufficient to determine detector data accurately (e.g., bad communications, 48 | /// invalid video for machine vision) 49 | /// 50 | /// --poorContrast(12) - Status returned indicating insufficient contrast error 51 | /// condition 52 | /// 53 | /// --detectionAutoSuspended(13) - Status returned indicating that the detection zone 54 | /// was automatically disabled by the TSS device (e.g., camera is on a PTZ and was 55 | /// moved) 56 | /// 57 | /// --pairedZoneFault(14) - This zone status indicates that there was no problem with 58 | /// this zone, but a zone that it is paired with had a fault. This may affect the 59 | /// accuracy of data reported by this zone. 60 | /// 61 | /// Reference: NTCIP1209v0209 62 | /// 63 | public enum ZoneStatus 64 | { 65 | other=0, oK, initializing, noActivity, maxPresence, configurationError, erraticCounts, disabled, overrideActive, sensorFailer, inputDataIntegrity, poorContrast, detectionAutoSuspended, pairedZoneFault 66 | } 67 | 68 | /// 69 | /// Table containing the historical sample period data. The number of rows in this 70 | /// table is equal to the maxSensorZones data element multiplied by the 71 | /// maxSampleDataEntries data element. Table rows are set by the manufacturer, and row 72 | /// creation/deletion is not supported. 73 | /// 74 | /// To retrieve all historical data entries for a zone, the last (oldest) entry should 75 | /// be retrieved by using numSampleDataEntries and retrieving class 0 through 76 | /// numSensorZoneClass first. Class zero is an aggregation of the data from all of the 77 | /// other classes (if any exist). All of the class data for a particular 78 | /// numSampleDataEntries will have the same sequenceNumber. Once these entries are 79 | /// retrieved, the other entries sequence numbers denote the correct order of the 80 | /// samples. Sequence number is used rather than end date as the system clock may have 81 | /// been reset between data samples. 82 | /// 83 | /// TableType: static 84 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4 85 | /// Reference: NTCIP1209v0209 86 | /// 87 | public class SampleDataEntry 88 | { 89 | /// 90 | /// This would identify which historical sampling period that data is being 91 | /// requested from. 0 being the sampling period currently in progress. 1 being the 92 | /// most recently completed sampling period. 93 | /// 94 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.1 95 | /// Reference: NTCIP1209v0209 96 | /// 97 | public SampleEntryNumber sampleEntryNum 98 | { 99 | get; 100 | set; 101 | } 102 | 103 | /// 104 | /// This identifies the class of the sensor zone from which historical sampling period 105 | /// data is being requested. Class 0 will retrieve an aggregate of the data from all 106 | /// classes within the requested historical data entry. 107 | /// 108 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.2 109 | /// Reference: NTCIP1209v0209 110 | /// 111 | public byte sampleZoneClass 112 | { 113 | get; 114 | set; 115 | } 116 | 117 | /// 118 | /// Indicates the time at which the data collection period ended for the data 119 | /// contained in this row. If the clockAvailable data element indicates the 120 | /// presence of a clock, this time shall be expressed in local time as expressed 121 | /// as """The current local time expressed in seconds since 00:00:00 (midnight) 122 | /// January 1, 1970 of the same time offset. This value changes by 3600 seconds in 123 | /// response to a daylight saving time event."""; otherwise, this time shall be 124 | /// expressed in the number of seconds since the most recent device initialization. 125 | /// 126 | /// Unit: seconds 127 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.3 128 | /// Reference: NTCIP1209v0209 and NTCIP1201v0307 129 | /// 130 | public UInt32 sampleEndTime 131 | { 132 | get; 133 | set; 134 | } 135 | 136 | /// 137 | /// Counts per sample period. Counts are expressed as an integer value in the 138 | /// sampleVolumeData data element. The value of 65535 shall be returned to 139 | /// represent a missing value. A missing value is reported when the zoneStatus is 140 | /// anything other than OK for the entire sampling period. 141 | /// 142 | /// Units: count 143 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.4 144 | /// Reference: NTCIP1209v0209 145 | /// 146 | public UInt16 sampleVolumeData 147 | { 148 | get; 149 | set; 150 | } 151 | 152 | /// 153 | /// Percent occupancy over the sample period. Occupancy is expressed in tenths of a 154 | /// percent, from 0 to 100.0 percent, in the samplePercentOccupancy data element. 155 | /// The value of 65535 shall be return to represent an invalid or missing value. A 156 | /// missing value is reported when the zoneStatus is anything other than OK for the 157 | /// entire sampling period. Values 1001 through 65534 are reserved for future use. 158 | /// 159 | /// Units: percent 160 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.5 161 | /// Reference: NTCIP1209v0209 162 | /// 163 | public UInt16 samplePercentOccupancy 164 | { 165 | get; 166 | set; 167 | } 168 | 169 | /// 170 | /// Arithmetic mean of speeds collected over the sample period with units of 1/10ths 171 | /// of km/h. For a volume of zero during the sample period, the value of 65535 172 | /// shall be returned to represent an invalid or missing value. A missing value is 173 | /// reported when the zoneStatus returned indicates no other status values apply for 174 | /// the entire sampling period. Values 2551 through 65534 are reserved for future 175 | /// use. 176 | /// Units: tenths of km/h 177 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.6 178 | /// Reference: NTCIP1209v0209 179 | /// 180 | public UInt16 sampleSpeedData 181 | { 182 | get; 183 | set; 184 | } 185 | 186 | /// 187 | /// Detailed status returned as result of diagnostics 188 | /// If a condition occurs during the sample period, then that state remains for the duration of that sample period. If multiple conditions occur during a sample period, the last reported condition, other than OK, is retained. 189 | /// 190 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.7 191 | /// Reference: NTCIP1209v0209 192 | /// 193 | public ZoneStatus sampleZoneStatus 194 | { 195 | get; 196 | set; 197 | } 198 | 199 | /// 200 | /// The data samples sequence number, used to determine the appropriate order of 201 | /// samples for a particular zone. All data from the same sampling period will have 202 | /// the same historical sequence number (all classes from the same period will have 203 | /// the same sequence number). 204 | /// 205 | /// Units: count 206 | /// NTCIP OID: 1.3.6.1.4.1.1206.4.2.4.3.4.1.8 207 | /// Reference: NTCIP1209v0209 208 | /// 209 | public UInt16 sampleSequenceNumber 210 | { 211 | get; 212 | set; 213 | } 214 | } 215 | } 216 | -------------------------------------------------------------------------------- /TSS/SensorZoneEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | /// 8 | /// Contains sensor zone unit parameters. 9 | /// 10 | /// Reference: NTCIP1209v0209 11 | /// 12 | public class SensorZoneEntry 13 | { 14 | public UInt32 sensorZoneNumber 15 | { 16 | get; 17 | set; 18 | } 19 | 20 | public bool sensorZoneOptions 21 | { 22 | get; 23 | set; 24 | } 25 | 26 | public bool sensorZoneOptionStatus 27 | { 28 | get; 29 | set; 30 | } 31 | 32 | public UInt16 sensorZoneSamplePeriod 33 | { 34 | get; 35 | set; 36 | } 37 | 38 | public string sensorZoneLabel 39 | { 40 | get; 41 | set; 42 | } 43 | 44 | public UInt64 sensorZoneOperator 45 | { 46 | get; 47 | set; 48 | } 49 | 50 | public UInt64 sensorZoneOrOperator 51 | { 52 | get; 53 | set; 54 | } 55 | 56 | public byte sensorZonePairedZone 57 | { 58 | get; 59 | set; 60 | } 61 | 62 | public byte sensorZonePairedZoneOptions 63 | { 64 | get; 65 | set; 66 | } 67 | 68 | public UInt16 sensorZoneSpeedCorrectionFactor 69 | { 70 | get; 71 | set; 72 | } 73 | 74 | public UInt16 sensorZoneAvgVehicleLength 75 | { 76 | get; 77 | set; 78 | } 79 | 80 | public UInt16 sensorZoneLength 81 | { 82 | get; 83 | set; 84 | } 85 | 86 | public ZoneStatus sensorZoneStatus 87 | { 88 | get; 89 | set; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /TSS/ZoneSequenceTableEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SharpNTCIP.TSS 6 | { 7 | public abstract class ZoneSequenceTableEntry 8 | { 9 | UInt16 numSampleDataEntries 10 | { 11 | get; 12 | set; 13 | } 14 | 15 | UInt16 numSensorZoneClass 16 | { 17 | get; 18 | set; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Table.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace SharpNTCIP 7 | { 8 | public abstract class Table : IDictionary 9 | { 10 | protected IDictionary _table; 11 | 12 | public Table() 13 | { 14 | _table = new Dictionary(); 15 | } 16 | 17 | public Table(IDictionary table) 18 | { 19 | _table = new Dictionary(table); 20 | } 21 | 22 | public virtual void Add(K key, V value) 23 | { 24 | _table.Add(key, value); 25 | } 26 | 27 | public virtual bool ContainsKey(K key) 28 | { 29 | return _table.ContainsKey(key); 30 | } 31 | 32 | public virtual ICollection Keys 33 | { 34 | get { return _table.Keys; } 35 | } 36 | 37 | public virtual bool Remove(K key) 38 | { 39 | return _table.Remove(key); 40 | } 41 | 42 | public virtual bool TryGetValue(K key, out V value) 43 | { 44 | return _table.TryGetValue(key, out value); 45 | } 46 | 47 | public virtual ICollection Values 48 | { 49 | get { return _table.Values; } 50 | } 51 | 52 | public virtual V this[K key] 53 | { 54 | get 55 | { 56 | return _table[key]; 57 | } 58 | set 59 | { 60 | _table[key] = value; 61 | } 62 | } 63 | 64 | public virtual void Add(KeyValuePair item) 65 | { 66 | _table.Add(item.Key, item.Value); 67 | } 68 | 69 | public virtual void Clear() 70 | { 71 | _table.Clear(); 72 | } 73 | 74 | public virtual bool Contains(KeyValuePair item) 75 | { 76 | return _table.Contains(item); 77 | } 78 | 79 | public virtual void CopyTo(KeyValuePair[] array, int arrayIndex) 80 | { 81 | _table.CopyTo(array, arrayIndex); 82 | } 83 | 84 | public virtual int Count 85 | { 86 | get { return _table.Count; } 87 | } 88 | 89 | public virtual bool IsReadOnly 90 | { 91 | get { return false; } 92 | } 93 | 94 | public virtual bool Remove(KeyValuePair item) 95 | { 96 | return _table.Remove(item.Key); 97 | } 98 | 99 | public virtual IEnumerator> GetEnumerator() 100 | { 101 | return _table.GetEnumerator(); 102 | } 103 | 104 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 105 | { 106 | return _table.GetEnumerator() as System.Collections.IEnumerator; 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Test/Runner/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Test/Runner/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using SharpNTCIP.DMS; 7 | 8 | namespace Runner 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | MultiString example = new MultiString(@"THIS IS [cb3]A TEST [cb]WITH COLOR CHANGE"); 15 | string xmlExample = example.MultiDocument.ToString(); 16 | string textExample = example.ToString(); 17 | string htmlExpect = @"THIS IS A TEST WITH COLOR CHANGE"; 18 | string textExpect = @"THIS IS A TEST WITH COLOR CHANGE"; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Test/Runner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Runner")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Runner")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("34c94f59-3faf-4f52-ab5e-abb68f4c89e0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Test/Runner/SharpNTCIP.Test.Runner.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1ADB7C50-8DEA-4C0B-AD2F-0B60217562B9} 8 | Exe 9 | Properties 10 | Runner 11 | Runner 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | ..\bin\x86\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | ..\bin\x86\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | x86 36 | ..\bin\x86\Debug\ 37 | 38 | 39 | x86 40 | ..\bin\x86\Release\ 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {2ed7257f-b768-406d-98e1-5dff6c041287} 61 | SharpNTCIP 62 | 63 | 64 | 65 | 72 | -------------------------------------------------------------------------------- /Test/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SharpNtcipTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SharpNtcipTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fa0aebfc-4a03-44d5-b1a1-7466d3f6845e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Test/Tests/SharpNTCIP.Test.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {307E5B67-2C36-40C2-B287-21EB9FAE397D} 7 | Library 8 | Properties 9 | SharpNtcip.Test 10 | SharpNtcipTests 11 | v4.5 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | x86 39 | ..\bin\x86\Debug\ 40 | 41 | 42 | x86 43 | ..\bin\x86\Release\ 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | {2ed7257f-b768-406d-98e1-5dff6c041287} 69 | SharpNTCIP 70 | 71 | 72 | 73 | 74 | 75 | 76 | False 77 | 78 | 79 | False 80 | 81 | 82 | False 83 | 84 | 85 | False 86 | 87 | 88 | 89 | 90 | 91 | 92 | 99 | -------------------------------------------------------------------------------- /Test/Tests/Test_Multi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using SharpNTCIP.DMS; 4 | 5 | namespace SharpNtcipTests 6 | { 7 | [TestClass] 8 | public class Test_Multi 9 | { 10 | const string BASE_MULTI_STRING = @"THIS IS [cb3]A TEST [cb]WITH COLOR CHANGE"; 11 | const string BASE_XML_EXPECT = @"THIS IS A TEST WITH COLOR CHANGE"; 12 | const string BASE_TOSTRING_EXPECT = @"THIS IS A TEST WITH COLOR CHANGE"; 13 | 14 | [TestMethod] 15 | public void MultiInstantiation() 16 | { 17 | MultiString multi = new MultiString(BASE_MULTI_STRING); 18 | Assert.AreEqual(BASE_MULTI_STRING, multi.Multi, 19 | @"MULTI Instantiation failed"); 20 | } 21 | 22 | [TestMethod] 23 | public void MultiXml() 24 | { 25 | MultiString multi = new MultiString(BASE_MULTI_STRING); 26 | Assert.AreEqual(BASE_XML_EXPECT, multi.MultiDocument.ToString(), 27 | @"MULTI --> HTML Conversion failed"); 28 | } 29 | 30 | [TestMethod] 31 | public void MultiToString() 32 | { 33 | MultiString multi = new MultiString(BASE_MULTI_STRING); 34 | Assert.AreEqual(BASE_TOSTRING_EXPECT, multi.ToString(), 35 | @"MULTI --> ToString Conversion failed"); 36 | } 37 | } 38 | } 39 | --------------------------------------------------------------------------------