using System; using PdfSharp.Drawing; namespace GenesisDisplayTool { #region Labels and logging static class DataError { public const Int32 NoError = 0; public const Int32 TemperatureBelowRange = 0xF0B; public const Int32 TemperatureAboveRange = 0xF0C; public const Int32 BadPulse = 0x0F0D; public const Int32 AmplitudeOutOfRange = 0x0F0E; public const Int32 TofOutOfRange = 0x0F0F; public const Int32 DeltaTimeOfFlight = 0x0F10; public const Int32 TofTimeout = 0x0F11; public const Int32 TofOutOfRange2 = 0xF12; public const Int32 Unknown = 0xFFFF; } public static class ZeroOffsetTestConstants { public const Int32 StabilizationTime = 10; [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Tof")] public static readonly Double DeltaTofAverageFactor = ((Math.Pow(10, 12)) / (Math.Pow(2, 38)));// /3.6379788; public const Int32 BadDataLimit = 3; } static class Debugmessages { public const Boolean MessagesEnabled = true; public const String Line = "------------------------------------------------------------------------------------\n"; } static class Settingsfile { // for position of items in file public const Int32 CmdMeter1Baudrate = 0; public const Int32 CmdMeter1Databits = 1; public const Int32 CmdMeter1Comselect = 2; public const Int32 CmdMeter1Stopbits = 3; public const Int32 CmdMeter1Parity = 4; public const Int32 CmdMeter1Handshake = 5; public const Int32 DataMeter1Baudrate = 6; public const Int32 DataMeter1Databits = 7; public const Int32 DataMeter1Comselect = 8; public const Int32 DataMeter1Stopbits = 9; public const Int32 DataMeter1Parity = 10; public const Int32 DataMeter1Handshake = 11; public const Int32 RawLogEnable = 12; public const Int32 CsvLogEnable = 13; public const Int32 CsvLogPath0 = 14; public const Int32 CsvLogPath1 = 15; public const Int32 CsvLogPath2 = 16; public const Int32 ListBoxOption = 17; public const Int32 MaingraphXval = 18; public const Int32 MaingraphPath0 = 19; public const Int32 MaingraphPath1 = 20; public const Int32 MaingraphPath2 = 21; public const Int32 MaingraphFlowVal = 22; public const Int32 Password1 = 23; public const Int32 JsonPath = 24; public const Int32 StdDeviationXval = 25; public const Int32 StdDeviationValues = 26; public const Int32 StdDeviationEnHit0Path0 = 27; public const Int32 StdDeviationEnHit1Path0 = 28; public const Int32 StdDeviationEnHit2Path0 = 29; public const Int32 StdDeviationEnHit3Path0 = 30; public const Int32 StdDeviationEnHit4Path0 = 31; public const Int32 StdDeviationEnHit5Path0 = 32; public const Int32 StdDeviationEnHit6Path0 = 33; public const Int32 StdDeviationEnHit7Path0 = 34; public const Int32 StdDeviationEn3HitsPath0 = 35; public const Int32 StdDeviationEn8HitsPath0 = 36; public const Int32 StdDeviationEnHit0Path1 = 37; public const Int32 StdDeviationEnHit1Path1 = 38; public const Int32 StdDeviationEnHit2Path1 = 39; public const Int32 StdDeviationEnHit3Path1 = 40; public const Int32 StdDeviationEnHit4Path1 = 41; public const Int32 StdDeviationEnHit5Path1 = 42; public const Int32 StdDeviationEnHit6Path1 = 43; public const Int32 StdDeviationEnHit7Path1 = 44; public const Int32 StdDeviationEn3HitsPath1 = 45; public const Int32 StdDeviationEn8HitsPath1 = 46; public const Int32 StdDeviationEnHit0Path2 = 47; public const Int32 StdDeviationEnHit1Path2 = 48; public const Int32 StdDeviationEnHit2Path2 = 49; public const Int32 StdDeviationEnHit3Path2 = 50; public const Int32 StdDeviationEnHit4Path2 = 51; public const Int32 StdDeviationEnHit5Path2 = 52; public const Int32 StdDeviationEnHit6Path2 = 53; public const Int32 StdDeviationEnHit7Path2 = 54; public const Int32 StdDeviationEn3HitsPath2 = 55; public const Int32 StdDeviationEn8HitsPath2 = 56; public const Int32 LogDirectory = 57; public const Int32 ReportDirectory = 58; public const Int32 ImagesDirectory = 59; public const Int32 CsvDirectory = 60; public const Int32 MassLogging = 61; public const Int32 CmdMeter2Baudrate = 62; public const Int32 CmdMeter2Databits = 63; public const Int32 CmdMeter2Comselect = 64; public const Int32 CmdMeter2Stopbits = 65; public const Int32 CmdMeter2Parity = 66; public const Int32 CmdMeter2Handshake = 67; public const Int32 DataMeter2Baudrate = 68; public const Int32 DataMeter2Databits = 69; public const Int32 DataMeter2Comselect = 70; public const Int32 DataMeter2Stopbits = 71; public const Int32 DataMeter2Parity = 72; public const Int32 DataMeter2Handshake = 73; public const Int32 CmdMeter3Baudrate = 74; public const Int32 CmdMeter3Databits = 75; public const Int32 CmdMeter3Comselect = 76; public const Int32 CmdMeter3Stopbits = 77; public const Int32 CmdMeter3Parity = 78; public const Int32 CmdMeter3Handshake = 79; public const Int32 DataMeter3Baudrate = 80; public const Int32 DataMeter3Databits = 81; public const Int32 DataMeter3Comselect = 82; public const Int32 DataMeter3Stopbits = 83; public const Int32 DataMeter3Parity = 84; public const Int32 DataMeter3Handshake = 85; public const Int32 Password2 = 86; public const Int32 Password3 = 87; public const Int32 Splitcounter = 88; } static class ReportParams { public const Int32 LogoXPos = 500; public const Int32 LogoYPos = 10; public const Int32 LogoXSize = 50; public const Int32 LogoYSize = 20; public const Int32 HeadlineXPos = 0; public const Int32 HeadlineYPos = 50; public const Int32 Headline2XPos = 128; public const Int32 Headline2YPos = 113; public const Int32 PageNumberXPosition = 220; public const Int32 PageNumberYPosition = -20; public const Int32 StandardTextXPos = 128; public const Int32 StandardTextYPos = 150; public const Int32 ImageXSize = 400; public const Int32 ImageYSize = 240; public const Int32 ImageXPos = 125; public const Int32 ImageYPos = 135; public const Int32 IntroductionXPos = 100; public const Int32 IntroductionYPos = 600; public static readonly XFont font20 = new XFont("Eras Bold ITC ", 20, XFontStyle.Bold); public static readonly XFont font14 = new XFont("Calibri", 14, XFontStyle.Bold); public static readonly XFont font12 = new XFont("Calibri", 12, XFontStyle.BoldItalic); public static readonly XFont fontStandard = new XFont("Calibri", 10, XFontStyle.Regular); public const Int32 Column1 = 0; public const Int32 Column2 = 1; public const Int32 Column3 = 2; public const Int32 Column4 = 3; public const Int32 Column5 = 4; } static class Json { public static readonly String[] SupportedTypes = new String[8] { "uint8_t", "uint16_t", "uint32_t", "enum8", "bool_t", "int8_t", "int16_t", "int32_t"}; } static class Constants { public const Int32 RawCyclesToStorage = 1000; public static readonly Int32[] CsvCyclesToStorage = new Int32[Constants.NumberOfPaths] { 450, 500, 550 }; public const Double Vcal = 350; // For amplitude measurement. See TDC-GP30, vol.3, 2-6 public const UInt16 NumberOfMeters = 3; public const UInt16 Meter1 = 0; public const UInt16 Meter2 = 1; public const UInt16 Meter3 = 2; public const UInt16 CmdMeter1 = 1; public const UInt16 DataMeter1 = 2; public const UInt16 CmdMeter2 = 3; public const UInt16 DataMeter2 = 4; public const UInt16 CmdMeter3 = 5; public const UInt16 DataMeter3 = 6; public const UInt16 MainGraphDefaultXValues = 200; public const UInt16 MainGraphDefaultFlowValue = 10; public const UInt16 MainGraphListMaxElements = 20000; public const UInt16 StdDevGraphDefaultXValues = 200; public const UInt16 StdDevGraphDefaultElements = 20; public const UInt16 StdDevGraphListMaxElements = 20000; public const UInt16 NumberOfPaths = 3; public const UInt16 PATH0 = 0; public const UInt16 PATH1 = 1; public const UInt16 PATH2 = 2; public const UInt16 NOPATH = 4; public const UInt16 HIT0 = 0; public const UInt16 HIT1 = 1; public const UInt16 HIT2 = 2; public const UInt16 HIT3 = 3; public const UInt16 HIT4 = 4; public const UInt16 HIT5 = 5; public const UInt16 HIT6 = 6; public const UInt16 HIT7 = 7; public const UInt16 ListItem0 = 0; public const UInt16 ListItem1 = 1; public const UInt16 ListItem2 = 2; public const UInt16 ListItem3 = 3; public const UInt16 ListItem4 = 4; public const UInt16 ListItem5 = 5; public const UInt16 ListItem6 = 6; public const String CsvDefaultModeString = "0x1C"; public const Double DefaultScrollGrace = (Double)0.05; public const Double FirstHitLevelFactor = (Double)0.88; public const Double DefaultHccCorrectionFactor = 1.0; public const UInt16 Gp30WriteMultipleMaxLength = 20; // tbc public const Double NominalFrequency = 4.0; public const Double FlowFactor = 0.0036379788; public const Double TofFactor = 3.6379788; } static class Formats { #region Format strings for display #region Format strings for "Decoded Data"-display public const String TofDispString = "000000.000000000000"; public const String HccCorrectionValue = "0.00000"; public const String PwDispString = "0.00"; public const String AmpDispUpString = "000.0"; public const String AmpDispDownString = "-000.0"; public const String TempDispString = "0.00"; public const String Flow = "0.00"; #endregion #region Format strings for "Mean"-Display public const String MeanDispString = "0.00"; #endregion #region Format strings for "Std-Deviation"-Display public const String StdDevDispString = "0.00"; #endregion #endregion #region Format strings for CSV-Logging public const String TofLogString = "000000.000000000000"; public const String PwLogString = "0.00"; public const String AmpLogString = "000.0"; public const String TempLogString = "0.00"; public const String CsvDateTimeLogString = "HH:mm:ss:fff;yyyy.MM.dd;"; public const String ErrorLogString = "HH:mm:ss:fff;yyyy.MM.dd;"; public const String RawDataDateTimeLogString = "yyyy-MM-dd HH:mm:ss:fff "; public const String CsvIndexLogString = "{0:D8}"; public const String CsvFileDateTimeString = "yyyyMMdd_HHmmss_"; public const String TxtFileDateTimeString = "yyyyMMdd_HHmmss_"; #endregion #region Date/ Time for raw file naming public const String RawFileDateTimeString = "yyyyMMdd_HHmmss_"; #endregion #region Date/ Time for image files naming public const String ImageFileDateTimeString = "yyyyMMdd_HHmmss_"; #endregion #region Date/ Time for reports public const String ReportDateTimeTitleString = "yyyy-MM-dd"; public const String PdfDateTimeString = "yyyyMMdd_HHmmss_"; #endregion #region Format for GP30 first hit level adjustments public const String FirstHitLevelVoltage = "000.00"; #endregion } static class Units { #region Unit strings for Display public const String TofDispString = " ns"; public const String DifTofDispString = " ps"; public const String StdDevDispString = " ps"; public const String AmpDispString = " mV"; public const String TempDispString = " °C"; public const String Flow = " m³/h"; #endregion #region Unit Strings for CSV-Logging public const String TofCsvLogString = "E-9;"; #endregion #region First hit level voltage public const String FirstHitLevelVoltage = " mV"; #endregion } #endregion #region Serial stuff public static class SettingsFileError { public const Int32 Ok = 0x00; public const Int32 Length = 0x01; public const Int32 Format = 0x02; public const Int32 Unknown = 0x03; } public static class Message { public const String Data = "V"; public const String Temperature = "T"; public const String Comment = "C"; public const String Hcc = "H"; public const Int32 ProtocolIdentPosition = 24; public const Int32 MessageTypePosition = 26; public const Int32 PathIdentPosition = 28; public const Int32 ValidIdentPosition = 30; } #endregion #region GP30 stuff /* public static class GP30Registers { public static Byte[] TriggerUpgrade() { return new Byte[] { 0x00, 0x00 }; } public static Byte[] CheckPresence() { return new Byte[] { 0x00, 0x01 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Byte.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Pcb")] public static Byte[] PcbSerialNumber() { return new Byte[] { 0x00, 0x02 }; } public static Byte[] CustomerSerialNumber0() { return new Byte[] { 0x00, 0x03 }; } public static Byte[] CustomerSerialNumber1() { return new Byte[] { 0x00, 0x04 }; } public static Byte[] CustomerSerialNumber2() { return new Byte[] { 0x00, 0x05 }; } public static Byte[] CustomerSerialNumber3() { return new Byte[] { 0x00, 0x06 }; } public static Byte[] MonotonicSeconds() { return new Byte[] { 0x00, 0x07 }; } public static Byte[] CalendarSeconds() { return new Byte[] { 0x00, 0x08 }; } public static Byte[] CoreRevision() { return new Byte[] { 0x00, 0x09 }; } public static Byte[] DriveCapacity() { return new Byte[] { 0x00, 0x0A }; } public static Byte[] ExitReason() { return new Byte[] { 0x00, 0x0B }; } public static Byte[] CorePlatform() { return new Byte[] { 0x00, 0x0C }; } public static Byte[] Quota() { return new Byte[] { 0x08, 0x00 }; } public static Byte[] Drive() { return new Byte[] { 0x08, 0x01 }; } public static Byte[] TriggerLogFlush() { return new Byte[] { 0x08, 0x02 }; } public static Byte[] AlarmStatus0() { return new Byte[] { 0x09, 0x00 }; } public static Byte[] AlarmStatus1() { return new Byte[] { 0x09, 0x01 }; } public static Byte[] TriggerAlarmCancel() { return new Byte[] { 0x09, 0x02 }; } public static Byte[] AlarmStatus2() { return new Byte[] { 0x09, 0x03 }; } public static Byte[] AlarmStatus3() { return new Byte[] { 0x09, 0x04 }; } public static Byte[] AlarmStatus4() { return new Byte[] { 0x09, 0x05 }; } public static Byte[] AlarmStatus5() { return new Byte[] { 0x09, 0x06 }; } public static Byte[] AlarmStatus6() { return new Byte[] { 0x09, 0x07 }; } public static Byte[] AlarmStatus7() { return new Byte[] { 0x09, 0x08 }; } public static Byte[] AlarmEnableMask() { return new Byte[] { 0x09, 0x09 }; } public static Byte[] AlarmVisualAutoClearMask() { return new Byte[] { 0x09, 0x0A }; } public static Byte[] BatteryVoltage() { return new Byte[] { 0x01, 0x00 }; } public static Byte[] BatteryManufacturer() { return new Byte[] { 0x01, 0x01 }; } public static Byte[] Privilege() { return new Byte[] { 0x04, 0x00 }; } public static Byte[] Password() { return new Byte[] { 0x04, 0x01 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Samplerate")] public static Byte[] Samplerate() { return new Byte[] { 0x0F, 0x00 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lvl")] public static Byte[] FirstHitLvlUpPath0() { return new Byte[] { 0x0F, 0x01 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lvl")] public static Byte[] FirstHitLvlUpPath1() { return new Byte[] { 0x0F, 0x02 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lvl")] public static Byte[] FirstHitLvlUpPath2() { return new Byte[] { 0x0F, 0x03 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lvl")] public static Byte[] FirstHitLvlDownPath0() { return new Byte[] { 0x0F, 0x04 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lvl")] public static Byte[] FirstHitLvlDownPath1() { return new Byte[] { 0x0F, 0x05 }; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Lvl")] public static Byte[] FirstHitLvlDownPath2() { return new Byte[] { 0x0F, 0x06 }; } public static Byte[] StartHit() { return new Byte[] { 0x0F, 0x07 }; } public static Byte[] AmplitudePeakDetectEnd() { return new Byte[] { 0x0F, 0x08 }; } public static Byte[] NumberOfTXBursts() { return new Byte[] { 0x0F, 0x09 }; } public static Byte[] MeterSize() { return new Byte[] { 0x0F, 0x0C }; } public static Byte[] CalFactorPath0() { return new Byte[] { 0x0F, 0x0D }; } public static Byte[] CalFactorPath1() { return new Byte[] { 0x0F, 0x0E }; } public static Byte[] CalFactorPath2() { return new Byte[] { 0x0F, 0x0F }; } public static Byte[] ZeroOffsetPath0() { return new Byte[] { 0x0F, 0x10 }; } public static Byte[] ZeroOffsetPath1() { return new Byte[] { 0x0F, 0x11 }; } public static Byte[] ZeroOffsetPath2() { return new Byte[] { 0x0F, 0x12 }; } public static Byte[] ResetAccu() { return new Byte[] { 0x0F, 0x14 }; } public static Byte[] Arrow() { return new Byte[] { 0x0F, 0x15 }; } public static Byte[] LedMode() { return new Byte[] { 0x0F, 0x16 }; } public static Byte[] StoreCalibration() { return new Byte[] { 0x0F, 0x17 }; } public static Byte[] PercentagePath0() { return new Byte[] { 0x0F, 0x26 }; } public static Byte[] PercentagePath1() { return new Byte[] { 0x0F, 0x27 }; } public static Byte[] PercentagePath2() { return new Byte[] { 0x0F, 0x28 }; } public static Byte[] FirstHitShift() { return new Byte[] { 0x0F, 0x29 }; } public static Byte[] FirstHitMinimum() { return new Byte[] { 0x0F, 0x2A }; } public static Byte[] TofErrorLimit() { return new Byte[] { 0x0F, 0x2B }; } public static Byte[] FirstHitUpdatePeriod() { return new Byte[] { 0x0F, 0x2C }; } public static Byte[] ToFTempOffset1() { return new Byte[] { 0x0F, 0x2E }; } public static Byte[] ToFTempOffset2() { return new Byte[] { 0x0F, 0x2F }; } public static Byte[] ToFTempOffset3() { return new Byte[] { 0x0F, 0x30 }; } public static Byte[] ToFTempCalibrate() { return new Byte[] { 0x0F, 0x31 }; } } */ public static class GP30Payloads { public const Byte Base = 0x05; public const Byte SupportedBaudrates = 0x00; public const Byte SupportedPacketSizes = 0x01; public const Byte SupportedProtocolVersion = 0x02; public const Byte SetBaudrate = 0x03; public const Byte SetPacketsize = 0x04; public const Byte TrainingByte = 0x05; public const Byte TrainingTime = 0x06; public const Byte AttemptedBaudrate = 0x07; public const Byte ResetInter = 0x08; public const Byte AutosetLow = 0x09; public const Byte AutosetHigh = 0x09; } public static class GP30RequestType { public const Byte ReadRegister = 0x00; public const Byte WriteRegister = 0x01; public const Byte QueryCaps = 0x02; public const Byte MultipleWrite = 0x03; } public static class GP30Commands { public const Byte Startbyte = 0x5B; public const Byte Nop = 0x00; public const Byte QueryCaps = 0x01; public const Byte QueryCapsReply = 0x02; public const Byte SetCaps = 0x03; public const Byte SetCapsReply = 0x04; public const Byte Train = 0x05; public const Byte TrainReply = 0x06; public const Byte RepeatLast = 0x07; public const Byte RepeatLastReply = 0x08; public const Byte ReadData = 0x09; public const Byte ReadDataReply = 0x0A; public const Byte WriteData = 0x0B; public const Byte WriteDataReply = 0x0C; public const Byte MultipleReadData = 0x0D; public const Byte MultipleReadDataReply = 0x0E; public const Byte MultipleWriteData = 0x0F; public const Byte MultipleWriteDataReply = 0x10; public const Byte SetLevel = 0x11; public const Byte SetLevelReply = 0x12; public const Byte SetBitrateLsb = 0x03; public const Byte SetBitrateMsb = 0x05; public const Byte SetPacketSizesLsb = 0x04; public const Byte SetPacketSizesMsb = 0x05; public const Byte SetProtocolLsb = 0x02; public const Byte SetProtocolMsb = 0x05; } public static class GP30Payload { public const Byte GetBitrateLsb = 0x00; public const Byte GetBitrateMsb = 0x05; public const Byte GetPacketSizesLsb = 0x01; public const Byte GetPacketSizesMsb = 0x05; public const Byte GetProtocolLsb = 0x02; public const Byte GetProtocolMsb = 0x05; } public static class GP30BytePosition { public const Byte ErrCodeBase = 2;//1; public const Byte ErrCodeSubreason = 1;//2; public const Byte CrcLsb = 5; // not supported with the common solution public const Byte CrcMsb = 6; // not supported with the common solution public const Byte Cmd = 0; // previously 1 public const Byte Reply = 3;// previously 8 public const Byte ReplyMsb = 9; public const Byte CmdBitrateLsb = 12; public const Byte CmdBitrateMsb = 13; public const Byte BitrateLsb = 14; public const Byte BitrateMsb = 15; public const Byte CmdPacketSizeLsb = 18; public const Byte CmdPacketSizeMsb = 19; public const Byte PacketSizeLsb = 20; public const Byte PacketSizeMsb = 21; public const Byte CmdProtocolLsb = 24; public const Byte CmdProtocolMsb = 25; public const Byte ProtocolLsb = 26; public const Byte ProtocolMsb = 27; } public static class GP30ConfigExErrors { public const Byte BaseOk = 0x00; public const Byte Base = 0x04; public const Byte LockedOut = 0x00; public const Byte AuthenticationFail = 0x01; public const Byte AccessDenied = 0x02; public const Byte UnknownParameter = 0x03; public const Byte InUse = 0x04; public const Byte SizesDoNotMatch = 0x05; public const Byte CannotReadConfigfile = 0x06; public const Byte UserNotKnown = 0x07; public const Byte CannotCreateConfigFile = 0x08; public const Byte StoreDidNotStore = 0x09; public const Byte StoreCorrupt = 0x0A; public const Byte ExpectedWrite = 0x0B; public const Byte ExpectedRead = 0x0C; public const Byte StopCycling = 0x0D; public const Byte TooManyOpen = 0x0E; public const Byte NeverOpened = 0x0F; public const Byte FileProtected = 0x1F; public const Byte PartialRecall = 0x2F; public const Byte DefaultPasswordUsed = 0x3F; } public static class GP30HighLevelErrors { public const Byte BaseOk = 0x00; public const Byte Base = 0x05; public const Byte PayloadCount = 0x00; public const Byte InvalidSubreason = 0x01; public const Byte InvalidBaudrate = 0x02; public const Byte InvalidBuffersize = 0x03; public const Byte CrcFailure = 0x04; public const Byte UnrecognizedCmd = 0x05; public const Byte Framing = 0x06; public const Byte Overflow = 0x07; public const Byte PacketTimeout = 0x08; public const Byte InvalidEscape = 0x09; public const Byte UnknownParameter = 0x0A; public const Byte TrainingFailed = 0x0B; public const Byte NoBreak = 0x0C; public const Byte NoSubreason = 0xFF; } static class GP30LowLevelErrors { public const Int16 NoError = 0; public const Int16 SerialPortClosed = -2; public const Int16 SerialPortWriteFailure = -3; public const Int16 SerialPortReadFailure = -4; public const Int16 MaxDataLength = -5; public const Int16 Exception = -6; public const Int16 CrcCalcError = -7; public const Int16 Unknown = -8; public const Int16 Timeout = -9; } public static class GP30PrivilegeLevel { public const Byte Level1 = 0x01; public const Byte Level2 = 0x02; public const Byte Level3 = 0x03; public const Byte Level4 = 0x04; public const Byte Level5 = 0x05; public const Byte Level6 = 0x06; public const Byte Level7 = 0x07; public const Byte Level8 = 0x08; public const Byte LevelDefault = 0xFF; } public static class GP30ConfigRegister { public const Byte Base = 0x05; public const Byte Baudratecapabilities = 0x00; public const Byte Packetsizecapabilties = 0x01; public const Byte Protocolversion = 0x02; public const Byte Baudrateselected = 0x03; public const Byte Packetsizeselected = 0x04; public const Byte Testpulsecontrol = 0x05; } public static class GP30Parameters { public const Double FirstHitVoltageMin = 200; // [TBC] public const Double FirstHitVoltageMax = 1000; // [TBC] public const UInt16 Timeout = 5; public const UInt16 PasswordMaxlength = 12; public const UInt16 TXDataMaxlength = 8; } #endregion #region Graph stuff public class zedGraphParameters { public String Title = "default"; public String xAxis = "default"; public String yAxis = "default"; } #endregion #region Error logging public static class LogErrReason { public static String Exception() { return "exception"; } public const String Function = "function"; public const String Unknown = "unknown"; } #endregion }