using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; namespace IRIGCh10 { public enum SubFrameSyncTags { [Description("ISF1")] [MaxLength(32)] SubframeIDCounterName, [Description("ISF2")] [MaxLength(2)] SubframeSyncType } public enum SubframeSyncTypes { [Description("ID")] IDCounter, [Description("OT")] Other } public class SubframeSync { private TMATSectionNumberedArray _subframeSyncTags; public SubframeSync(int number=1) { _subframeSyncTags = new TMATSectionNumberedArray(AttributeIdentifiers.PCMFormatAttributes, number, "ISF\\N", 99); } public void SetSubframeIDCounterNamer(int number, string val) { _subframeSyncTags.SetValue(number, SubFrameSyncTags.SubframeIDCounterName, val); } public void SetSubframeSyncType(int number, SubframeSyncTypes syncType) { _subframeSyncTags.SetValue(number, SubFrameSyncTags.SubframeSyncType, DescriptionDecoder.GetDescription(syncType)); } public string Serialize() { return _subframeSyncTags.Serialize(); } } public enum StorageTags { [Description("ID")] [MaxLength(32)] DataSourceID, [MaxLength(32)] [Description("RID")] StorageId, [Description("R1")] [MaxLength(32)] StorageDescription } public enum TimeDataTags { [Description("TTF-")] TimeDataTypeFormat, [Description("TFMT-")] TimeFormat, [Description("TSRC-")] TimeSource } public enum TimeFormats { [Description("A")] IRIGA, [Description("B")] IRIGB, [Description("G")] IRIGG, [Description("I")] Internal, [Description("N")] NativeGPS, [Description("U")] UTCFromGPS, [Description("X")] None } public enum MessageDataTypeAttributes { [Description("R-@x\\MTF-@n")] [MaxLength(1)] MessageDataTypeFormat, [Description("R-@x\\NMS\\N-@n")] [MaxLength(5)] NumberOfMessageSubChannels, [Description("R-@x\\MSCN-n-m")] [MaxLength(5)] MessageSubChannelNumber, [Description("R-@x\\MCNM-@n-@m")] [MaxLength(32)] MessageSubChannelName } public class MessageDataType { private readonly int X; public MessageDataType(int x) { X = x; } private Dictionary _MessageTypeFormat = new Dictionary(); /// /// MESSAGE DATA TYPE FORMAT: FORMAT 0 (MESSAGE DATA) – ‘0’ /// /// /// public void SetMessageTypeFormat(int n, string value) { _MessageTypeFormat[n] = value; } private readonly Dictionary _NumberOfMessageSubChannels = new Dictionary(); /// /// SPECIFY THE NUMBER OF MESSAGE SUB-CHANNELS INCLUDED WITHIN /// THIS CHANNEL /// /// /// public void SetNumberOfMessageSubChannels(int n, int value) { _NumberOfMessageSubChannels[n] = value; } private Dictionary> _MessageSubChannelNumber = new Dictionary>(); /// /// SPECIFY THE MESSAGE SUB-CHANNEL NUMBER. /// /// /// /// public void SetMessageSubChannelNumber(int n, int m, int value) { if (!_MessageSubChannelNumber.ContainsKey(n)) { _MessageSubChannelNumber[n] = new Dictionary(); } _MessageSubChannelNumber[n][m] = value; } private Dictionary> _MessageSubChannelName = new Dictionary>(); public void SetMessageSubChannelName(int n, int m, string value) { if( !_MessageSubChannelName.ContainsKey(n)){ _MessageSubChannelName[n] = new Dictionary(); } if( !_MessageSubChannelName[n].ContainsKey(m) ){ _MessageSubChannelName[n][m] = value; } } public string Serialize() { var sb = new StringBuilder(); //R-1\MTF-4:0; using (var enumTypes = _MessageTypeFormat.GetEnumerator()) { while (enumTypes.MoveNext()) { sb.AppendLine($"R-{X}\\MTF-{enumTypes.Current.Key}:{enumTypes.Current.Value};"); } } //R-1\NMS\N-4:1; using (var enumSubChannelNums = _NumberOfMessageSubChannels.GetEnumerator()) { while (enumSubChannelNums.MoveNext()) { sb.AppendLine($"R-{X}\\NMS\\N-{enumSubChannelNums.Current.Key}:{enumSubChannelNums.Current.Value};"); } } //R-1\MSCN-4-1:1; using (var enumSubChannelNumber = _MessageSubChannelNumber.GetEnumerator()) { while (enumSubChannelNumber.MoveNext()) { using (var enumSubSub = enumSubChannelNumber.Current.Value.GetEnumerator()) { while (enumSubSub.MoveNext()) { sb.AppendLine( $"R-{X}\\MSCN-{enumSubChannelNumber.Current.Key}-{enumSubSub.Current.Key}:{enumSubSub.Current.Value};"); } } } } //R-1\MCNM-4-1:sio/0/in2-30; using (var enumSubChannelName = _MessageSubChannelName.GetEnumerator()) { while (enumSubChannelName.MoveNext()) { using (var enumSubSub = enumSubChannelName.Current.Value.GetEnumerator()) { while (enumSubSub.MoveNext()) { sb.AppendLine($"R-{X}\\MCNM-{enumSubChannelName.Current.Key}-{enumSubSub.Current.Key}:{enumSubSub.Current.Value};"); } } } } return sb.ToString(); } } public enum TimeSources { [Description("I")] Internal, [Description("E")] External, [Description("R")] ExternalFromRMM, [Description("X")] None } public class Storage : TMATSSection { /// /// DATA SOURCE ID CONSISTENT WITH GENERAL INFORMATION GROUP /// public string DataSourceID { get => GetValue(StorageTags.DataSourceID); set => SetValueWithLength(StorageTags.DataSourceID, value); } /// /// TAPE OR STORAGE IDENTIFICATION /// public string StorageID { get => GetValue(StorageTags.StorageId); set => SetValueWithLength(StorageTags.StorageId, value); } public string StorageDescription { get => GetValue(StorageTags.StorageDescription); set => SetValueWithLength(StorageTags.StorageDescription, value); } private StorageCharacteristics _storageCharacteristics = new StorageCharacteristics(1); private RecorderInformation _recorderInformation = new RecorderInformation(1); private RecorderData _recorderData = new RecorderData(1); private TMATSectionNumberedArray _pcmDataChannels = new TMATSectionNumberedArray(AttributeIdentifiers.StorageSourceAttributes, 1, null, ushort.MaxValue); private RecordingEventDefinitions _recordingEventDefinitions = new RecordingEventDefinitions(1); private TMATSectionNumberedArray _timeData = new TMATSectionNumberedArray(AttributeIdentifiers.StorageSourceAttributes, 1, null, 1); public void SetDataSourceID(int number, string value) { _recorderData.SetValue(number, DataTags.DataSourceID, value); } public void SetChannelDataType(int number, ChannelDataTypes dataType) { _recorderData.SetValue(number, DataTags.ChannelDataType, DescriptionDecoder.GetDescription(dataType)); } public void SetTrackNumber(int number, ushort trackNumber) { _recorderData.SetValue(number, DataTags.TrackNumber, trackNumber.ToString()); } /// /// INDICATES IF SOURCE IS ENABLED. SOURCE MUST BE ENABLED TO /// GENERATE DATA PACKETS. /// /// /// public void SetChannelEnabled(int number, bool bEnabled) { _recorderData.SetValue(number, DataTags.ChannelEnable, bEnabled ? "T" : "F"); } public void SetChannelDataLinkName(int number, string value) { _recorderData.SetValue(number, DataTags.ChannelDataLinkName, value); } public void SetPhysicalChannelNumber(int number, ushort channelNumber) { _recorderData.SetValue(number, DataTags.RecorderPhysicalChannelNumber, channelNumber.ToString()); } public void SetTimeChannelDataTypeFormat() { _timeData.SetValue(1, TimeDataTags.TimeDataTypeFormat, "1"); } public void SetTimeFormat(TimeFormats format) { _timeData.SetValue(1, TimeDataTags.TimeFormat, DescriptionDecoder.GetDescription(format)); } public void SetTimeSource(TimeSources source) { _timeData.SetValue(1, TimeDataTags.TimeSource, DescriptionDecoder.GetDescription(source)); } public void SetPCMDataTimeFormat(int number) { _pcmDataChannels.SetValue(number, PCMDataTypeTags.PCMDataTypeFormat, "1"); } public void SetPCMInputClockEdge(int number, InputClockEdges edge) { _pcmDataChannels.SetValue(number, PCMDataTypeTags.InputClockEdge, DescriptionDecoder.GetDescription(edge)); } public void SetPCMDataPackingOption(int number, DataPackingOptions option) { _pcmDataChannels.SetValue(number, PCMDataTypeTags.DataPackingOption, DescriptionDecoder.GetDescription(option)); } public void SetPCMInputSignalType(int number, InputSignalTypes signalType) { _pcmDataChannels.SetValue(number, PCMDataTypeTags.InputSignalType, DescriptionDecoder.GetDescription(signalType)); } public void SetPCMVideoTypeFormat(int number, VideoFormats format) { _pcmDataChannels.SetValue(number, PCMDataTypeTags.PCMVideoTypeFormat, DescriptionDecoder.GetDescription(format)); } public int NumberOfChannels { get => _recorderData.GetCount(); set => _recorderData.SetCount(value); } public bool OriginalStorage { get => _recorderInformation.OriginalStorage; set => _recorderInformation.OriginalStorage = value; } public DateTime? DateTimeCreated { get => _recorderInformation.DateAndTimeCreated; set => _recorderInformation.DateAndTimeCreated = value; } public int? NumberOfSourceBits { get => _storageCharacteristics.NumberOfSourceBits; set => _storageCharacteristics.NumberOfSourceBits = value; } /// /// INDICATES IF INDEX IS ENABLED. INDEX MUST BE ENABLED TO /// GENERATE INDEX PACKETS. /// public bool RecordingEventsEnabled { get => _recordingEventDefinitions.RecordingEventsEnabled; set => _recordingEventDefinitions.RecordingEventsEnabled = value; } private RecordingIndex _recordingIndex = new RecordingIndex(1); /// /// INDICATES IF INDEX IS ENABLED. INDEX MUST BE ENABLED TO /// GENERATE INDEX PACKETS. /// public bool RecordingIndexEnabled { get => _recordingIndex.RecordingIndexEnabled; set => _recordingIndex.RecordingIndexEnabled = value; } public RecordingIndexTypes RecordingIndexType { get => _recordingIndex.RecordingIndexType; set => _recordingIndex.RecordingIndexType = value; } /// /// IDENTIFY THE NUMBER OF MICROSECONDS FOR EACH INDEX /// ENTRY GENERATION /// public int RecordingIndexTimeValue { get => _recordingIndex.IndexTimeValue; set => _recordingIndex.IndexTimeValue = value; } /// /// IDENTIFY THE NUMBER OF PACKETS FOR EACH INDEX ENTRY /// GENERATION /// public int RecordingIndexCountValue { get => _recordingIndex.IndexCountValue; set => _recordingIndex.IndexCountValue = value; } public Storage(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } public override string Serialize() { var sb = new StringBuilder(); var s = base.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _storageCharacteristics.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _recorderInformation.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _recorderData.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _pcmDataChannels.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _recordingEventDefinitions.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _recordingIndex.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _timeData.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } return sb.ToString(); } } public class StorageCharacteristics : TMATSSection { /// /// SPECIFY THE TAPE OR STORAGE TYPE: ANALOG - ‘ANAL’ /// CASSETTE - ‘CASS’ HDDR - ‘HDDR’ PARALLEL - ‘PARA’ /// SOLID STATE RECORDER - ‘SSR’ OTHER - ‘OTHR’, DEFINE IN COMMENTS /// RECORD. /// public StorageTypes? StorageType { get { var s = GetValue(StorageCharactersticTags.StorageType); if (string.IsNullOrWhiteSpace(s)) { return null; } var types = Enum.GetValues(typeof(StorageTypes)).Cast().ToArray(); foreach (var storagetype in types) { if (DescriptionDecoder.GetDescription(storagetype) == s) { return storagetype; } } return null; } set { if (null == value) { SetValueWithLength(StorageCharactersticTags.StorageType, string.Empty); } else { var attr = DescriptionDecoder.GetDescription((StorageTypes) value); SetValueWithLength(StorageCharactersticTags.StorageType, attr); } } } /// /// NAME OF MANUFACTURER OF THE TAPE OR THE STORAGE MEDIA /// public string StorageManufacturer { get => GetValue(StorageCharactersticTags.StorageManufacturer); set => SetValueWithLength(StorageCharactersticTags.StorageManufacturer, value); } /// /// SPECIFY MANUFACTURER’S TAPE OR STORAGE MEDIA DESIGNATION CODE. /// public string StorageCode { get => GetValue(StorageCharactersticTags.StorageCode); set => SetValueWithLength(StorageCharactersticTags.StorageCode, value); } /// /// PHYSICAL DIMENSION OF TAPE WIDTH, IN INCHES /// public string TapeWidth { get => GetValue(StorageCharactersticTags.TapeWidth); set => SetValueWithLength(StorageCharactersticTags.TapeWidth, value); } /// /// STATE THE REEL SIZE, INCHES: /// public TapeHousings? TapeHousing { get { var s = GetValue(StorageCharactersticTags.TapeHousing); if( string.IsNullOrWhiteSpace(s)){ return null; } var housings = Enum.GetValues(typeof(TapeHousings)) .Cast().ToArray(); foreach (var housing in housings) { if( DescriptionDecoder.GetDescription(housing) == s ) { return housing; } } return null; } set { if (null == value) { SetValueWithLength(StorageCharactersticTags.TapeHousing, string.Empty); } else { SetValueWithLength(StorageCharactersticTags.TapeHousing, DescriptionDecoder.GetDescription((TapeHousings) value)); } } } /// /// STATE THE TYPE OF TRACKS ON THE TAPE: /// public TrackTypes? TypeOfTracks { get { var s = GetValue(StorageCharactersticTags.TypeOfTracks); if( string.IsNullOrWhiteSpace(s)){ return null; } var tracks = Enum.GetValues(typeof(TrackTypes)) .Cast().ToArray(); foreach (var track in tracks) { if (DescriptionDecoder.GetDescription(track) == s) { return track; } } return null; } set { if (null == value) { SetValueWithLength(StorageCharactersticTags.TypeOfTracks, string.Empty); } else { SetValueWithLength(StorageCharactersticTags.TypeOfTracks, DescriptionDecoder.GetDescription((TrackTypes)value)); } } } ///// ///// STATE THE NUMBER OF TRACKS ON THE TAPE OR THE NUMBER OF ///// CHANNELS ON THE STORAGE MEDIA. ///// //public string NumberOfTracks //{ // get => GetValue(StorageCharactersticTags.NumberOfTracks); // set => SetValue(StorageCharactersticTags.NumberOfTracks, value); //} /// /// STATE RECORD SPEED (inches/second). /// public string RecordSpeed { get => GetValue(StorageCharactersticTags.RecordSpeed); set => SetValueWithLength(StorageCharactersticTags.RecordSpeed, value); } public RecordingBandwidth? DataPackingDensity { get { var val = GetValue(StorageCharactersticTags.DataPackingDensity); if (string.IsNullOrWhiteSpace(val)) { return null; } var bandwidths = Enum.GetValues(typeof(RecordingBandwidth)) .Cast().ToArray(); foreach (var bandwidth in bandwidths) { if (DescriptionDecoder.GetDescription(bandwidth) == val) { return bandwidth; } } return null; } set { if (null == value) { SetValueWithLength(StorageCharactersticTags.DataPackingDensity , string.Empty); } else { SetValueWithLength(StorageCharactersticTags.DataPackingDensity, DescriptionDecoder.GetDescription((RecordingBandwidth) value)); } } } public bool? TapeRewound { get { var val = GetValue(StorageCharactersticTags.TapeRewound); if (string.IsNullOrWhiteSpace(val)) { return null; } if (val == "Y") { return true; } return false; } set { if (null == value) { SetValueWithLength(StorageCharactersticTags.TapeRewound, string.Empty); } else { SetValueWithLength(StorageCharactersticTags.TapeRewound, ((bool) value) ? "Y" : "N"); } } } /// /// NUMBER OF MOST SIGNIFICANT BITS OF THE CHANNEL ID USED FOR /// MULTIPLEXER SOURCE ID. DEFAULT IS ZERO (ONE SOURCE). /// public int? NumberOfSourceBits { get => GetIntOrNull(StorageCharactersticTags.NumberOfSourceBits); set => SetIntOrNull(StorageCharactersticTags.NumberOfSourceBits, value); } public StorageCharacteristics(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } } public enum RecordingBandwidth { [Description("IM")] IntermediateBand, [Description("WB")] WideBand, [Description("DD")] DoubleDensity, [Description("OT")] Other } public enum TrackTypes { [Description("LO")] Logitudinal, [Description("RO")] Rotary } public enum TapeHousings { [Description("10.5")] TenHalf, [Description("14.0")] Fourteen, [Description("15.0")] Fifteen, [Description("16.0")] Sixteen, [Description("OTHER")] Other } public enum StorageTypes { [Description("ANAL")] Analog, [Description("CASS")] Cassette, [Description("HDDR")] HDDR, [Description("PARA")] Parallel, [Description("SSR")] SolidStateRecorder, [Description("OTHR")] Other } public enum StorageCharactersticTags { [MaxLength(4)] [Description("TC1")] StorageType, [MaxLength(8)] [Description("TC2")] StorageManufacturer, [MaxLength(8)] [Description("TC3")] StorageCode, [MaxLength(4)] [Description("TC4")] TapeWidth, [MaxLength(5)] [Description("TC5")] TapeHousing, [MaxLength(2)] [Description("TT")] TypeOfTracks, //[MaxLength(2)] //[Description("N")] //NumberOfTracks, [Description("TC6")] [MaxLength(4)] RecordSpeed, [Description("TC7")] [MaxLength(2)] DataPackingDensity, [Description("TC8")] [MaxLength(1)] TapeRewound, [Description("NSB")] [MaxLength(2)] NumberOfSourceBits } public enum RecorderInformationTags { [Description("RI1")] [MaxLength(8)] StorageManufacturer, [Description("RI2")] [MaxLength(8)] StorgeModel, [Description("RI3")] [MaxLength(1)] OriginalStorage, [Description("RI4")] [MaxLength(19)] DateAndTimeCreated } public class RIPointOfContact : TMATSSection { public RIPointOfContact(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } } public enum DubbingOrganizationPOC { [Description("DPOC1")] [MaxLength(24)] Name, [Description("DPOC2")] [MaxLength(48)] Agency, [Description("DPOC3")] [MaxLength(48)] Address, [Description("DPOC4")] [MaxLength(20)] Telephone } public class DubbingOrganizationPersonOfContact : TMATSSection { public DubbingOrganizationPersonOfContact(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } } public class RecorderInformation : TMATSSection { /// /// NAME OF TAPE DRIVE OR STORAGE DEVICE MANUFACTURER /// public string StorageManufacturer { get => GetValue(RecorderInformationTags.StorageManufacturer); set => SetValueWithLength(RecorderInformationTags.StorageManufacturer, value); } /// /// MANUFACTURER’S MODEL NUMBER OF TAPE DRIVE OR STORAGE DEVICE USED /// TO CREATE THE TAPE OR STORAGE MEDIA /// public string StorageModel { get => GetValue(RecorderInformationTags.StorgeModel); set => SetValueWithLength(RecorderInformationTags.StorgeModel, value); } public bool OriginalStorage { get { var val = GetValue(RecorderInformationTags.OriginalStorage); if (string.IsNullOrWhiteSpace(val)) { return true; } return "Y" == val; } set { SetValueWithLength(RecorderInformationTags.OriginalStorage, value ? "Y" : "N"); } } /// /// DATE AND TIME TAPE OR STORAGE MEDIA WAS CREATED: /// public DateTime? DateAndTimeCreated { get { var val = GetValue(RecorderInformationTags.DateAndTimeCreated); if (string.IsNullOrWhiteSpace(val)) { return null; } if (DateTime.TryParseExact(val, "MM-dd-yyyy-HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out var dt)) { return dt; } return null; } set { if (null == value) { SetValueWithLength(RecorderInformationTags.DateAndTimeCreated, string.Empty); } else { var dt = (DateTime) value; //SetValueWithLength(RecorderInformationTags.DateAndTimeCreated, // $"{dt.Month:00}-{dt.Day:00}-{dt.Year:0000}-{dt.Hour:00}-{dt.Minute:00}-{dt.Second:00}"); //Example is only setting date?? SetValueWithLength(RecorderInformationTags.DateAndTimeCreated, $"{dt.Month:00}-{dt.Day:00}-{dt.Year:0000}"); } } } /// /// POINT OF CONTACT AT THE FACILITY CREATING THE TAPE OR STORAGE /// MEDIA:Name /// public string CreatingOrganizationPOCName { get => _pointOfContact.GetValue(GeneralInformationGroup.Information.PointOfContactTags.Name); set => _pointOfContact.SetValueWithLength( GeneralInformationGroup.Information.PointOfContactTags.Name, value); } /// /// POINT OF CONTACT AT THE FACILITY CREATING THE TAPE OR STORAGE /// MEDIA:Agency /// public string CreatingOrganizationPOCAgency { get => _pointOfContact.GetValue(GeneralInformationGroup.Information.PointOfContactTags.Agency); set => _pointOfContact.SetValueWithLength(GeneralInformationGroup.Information.PointOfContactTags.Agency, value); } /// /// POINT OF CONTACT AT THE FACILITY CREATING THE TAPE OR STORAGE /// MEDIA:Address /// public string CreatingOrganizationPOCAddress { get => _pointOfContact.GetValue(GeneralInformationGroup.Information.PointOfContactTags.Address); set => _pointOfContact.SetValueWithLength(GeneralInformationGroup.Information.PointOfContactTags.Address, value); } /// /// POINT OF CONTACT AT THE FACILITY CREATING THE TAPE OR STORAGE /// MEDIA:Telephone /// public string CreatingOrganizationPOCTelephone { get => _pointOfContact.GetValue(GeneralInformationGroup.Information.PointOfContactTags.Telephone); set => _pointOfContact.SetValueWithLength(GeneralInformationGroup.Information.PointOfContactTags.Telephone, value); } /// /// DATE THE DUB WAS MADE: /// public DateTime? DateOfDub { get { var val = _dateOfDubs.GetValue(DateOfDubTags.DateOfDub); if (string.IsNullOrWhiteSpace(val)) { return null; } if (DateTime.TryParseExact(val, "MM-dd-yyyy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out var dt)) { return dt; } return null; } set { if (null == value) { _dateOfDubs.SetValueWithLength(DateOfDubTags.DateOfDub, string.Empty); } else { var dt = (DateTime) value; _dateOfDubs.SetValueWithLength(DateOfDubTags.DateOfDub, $"{dt.Month:00}-{dt.Day:00}-{dt.Year:0000}"); } } } /// /// POINT OF CONTACT AT THE DUBBING AGENCY: NAME /// public string DubbingOrganizationPOCName { get => _dubbingPOC.GetValue(DubbingOrganizationPOC.Name); set => _dubbingPOC.SetValueWithLength(DubbingOrganizationPOC.Name, value); } /// /// POINT OF CONTACT AT THE DUBBING AGENCY: ADDRESS /// public string DubbingOrganizationPOCAddress { get => _dubbingPOC.GetValue(DubbingOrganizationPOC.Address); set => _dubbingPOC.SetValueWithLength(DubbingOrganizationPOC.Address, value); } /// /// POINT OF CONTACT AT THE DUBBING AGENCY: AGENCY /// public string DubbingOrganizationPOCAgency { get => _dubbingPOC.GetValue(DubbingOrganizationPOC.Agency); set => _dubbingPOC.SetValueWithLength(DubbingOrganizationPOC.Agency, value); } /// /// POINT OF CONTACT AT THE DUBBING AGENCY: TELEPHONE /// public string DubbingOrganizationTelephone { get => _dubbingPOC.GetValue(DubbingOrganizationPOC.Telephone); set => _dubbingPOC.SetValueWithLength(DubbingOrganizationPOC.Telephone, value); } private RIPointOfContact _pointOfContact = new RIPointOfContact(1); private DateOfDubs _dateOfDubs = new DateOfDubs(1); private DubbingOrganizationPersonOfContact _dubbingPOC = new DubbingOrganizationPersonOfContact(1); public RecorderInformation(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } public override string Serialize() { var sb = new StringBuilder(); var s = base.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _pointOfContact.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _dateOfDubs.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } s = _dubbingPOC.Serialize(); if (!string.IsNullOrWhiteSpace(s)) { sb.Append(s); } return sb.ToString(); } } public enum DateOfDubTags { [Description("RI5")] [MaxLength(10)] DateOfDub } public class DateOfDubs : TMATSSection { public DateOfDubs(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } } public enum NumberOfTracksTags { [Description("N")] [MaxLength(2)] NumberOfTracks } public class NumberOfTracks : TMATSSection { public NumberOfTracks(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } } public enum RecordingEventDefinitionsTags { [Description("EV\\E")] [MaxLength(1)] RecordingEventsEnabled } public class RecordingEventDefinitions : TMATSSection { /// /// INDICATES IF EVENTS ARE ENABLED. EVENTS MUST BE ENABLED TO /// GENERATE EVENT PACKETS /// public bool RecordingEventsEnabled { get { var val = GetValue(RecordingEventDefinitionsTags.RecordingEventsEnabled); if (string.IsNullOrWhiteSpace(val)) { return false; } if ("T" == val){ return true; } return false; } set { SetValueWithLength(RecordingEventDefinitionsTags.RecordingEventsEnabled, value ? "T" : "F"); } } private TMATSectionNumberedArray _events = new TMATSectionNumberedArray(AttributeIdentifiers.StorageSourceAttributes, 1, $"R-1\\EV\\N", 999); public RecordingEventDefinitions(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } public override string Serialize() { return _events.Serialize(); } } public enum NumberOfRecordingEventsTags { [Description("EV\\N")] NumberOfRecordingEvents } public class NumberOfRecordingEvents : TMATSSection { public NumberOfRecordingEvents(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number) { } } public enum EventTypes { [Description("E")] External, [Description("D")] MeasurementDiscrete, [Description("L")] MeasurementLimit, [Description("R")] Recorder, [Description("O")] Other } public enum EventPriorities { [Description("1")] Priority1, [Description("2")] Priority2, [Description("3")] Priority3, [Description("4")] Priority4, [Description("5")] Priority5 } public enum EventCaptureModes { [Description("1")] Mode1, [Description("2")] Mode2, [Description("3")] Mode3, [Description("4")] Mode4, [Description("5")] Mode5, [Description("6")] Mode6 } public enum RecordingEventTags { [Description("EV\\ID-")] [MaxLength(32)] EventID, [Description("EV\\D-")] [MaxLength(256)] EventDescription, [Description("EV\\T-")] [MaxLength(1)] EventType, [Description("EV\\P-")] [MaxLength(1)] EventPriority, [Description("EV\\CM-")] [MaxLength(1)] EventCaptureMode, [Description("EV\\IC-")] [MaxLength(1)] EventInitialCapture, [Description("EV\\LC-")] [MaxLength(8)] RecordingEventLimitCount, [Description("EV\\MS-")] [MaxLength(32)] EventMeasurementSource, [Description("EV\\MN-")] [MaxLength(32)] EventMeasurementName, } public enum RecordingIndexTags { [Description("IDX\\E")] [MaxLength(1)] RecordingIndexEnabled, [Description("IDX\\IT")] [MaxLength(1)] RecordingIndexType, [Description("IDX\\ITV")] [MaxLength(8)] IndexTimeValue, [Description("IDX\\ICV")] [MaxLength(4)] IndexCountValue } public enum RecordingIndexTypes { [Description("T")] Time, [Description("C")] Count } public class RecordingIndex : TMATSSection { /// /// INDICATES IF INDEX IS ENABLED. INDEX MUST BE ENABLED TO /// GENERATE INDEX PACKETS. /// public bool RecordingIndexEnabled { get { var val = GetValue(RecordingIndexTags.RecordingIndexEnabled); if (string.IsNullOrWhiteSpace(val)) { return false; } return val == "T"; } set => SetValueWithLength(RecordingIndexTags.RecordingIndexEnabled, value ? "T" : "F"); } public RecordingIndexTypes RecordingIndexType { get { var val = GetValue(RecordingIndexTags.RecordingIndexType); if (string.IsNullOrWhiteSpace(val)) { return RecordingIndexTypes.Time; } if (val == "C") { return RecordingIndexTypes.Count; } return RecordingIndexTypes.Time; } set => SetValueWithLength(RecordingIndexTags.RecordingIndexType, DescriptionDecoder.GetDescription(value)); } /// /// IDENTIFY THE NUMBER OF MICROSECONDS FOR EACH INDEX /// ENTRY GENERATION /// public int IndexTimeValue { get { var val = GetValue(RecordingIndexTags.IndexTimeValue); if (string.IsNullOrWhiteSpace(val)) { return 0; } if (int.TryParse(val, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out var iTemp)) { return iTemp; } return 0; } set { SetValueWithLength(RecordingIndexTags.IndexTimeValue, value.ToString(System.Globalization.CultureInfo.InvariantCulture)); SetValueWithLength(RecordingIndexTags.IndexCountValue, string.Empty); } } /// /// IDENTIFY THE NUMBER OF PACKETS FOR EACH INDEX ENTRY /// GENERATION /// public int IndexCountValue { get { var val = GetValue(RecordingIndexTags.IndexCountValue); if (string.IsNullOrWhiteSpace(val)) { return 0; } if (int.TryParse(val, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out var iTmp)) { return iTmp; } return 0; } set { SetValueWithLength(RecordingIndexTags.IndexCountValue, value.ToString(System.Globalization.CultureInfo.InvariantCulture)); SetValueWithLength(RecordingIndexTags.IndexTimeValue, string.Empty); } } public RecordingIndex(int number) : base(AttributeIdentifiers.StorageSourceAttributes, 1) { } } public enum DataDirections { [Description("FWD")] Forward, [Description("REV")] Reverse } public enum ChannelDataTypes { [Description("PCMIN")] PCMInput, [Description("ANAIN")] AnalogInput, [Description("DISIN")] DiscreteInput, [Description("TIMEIN")] IRIGTimeInput, [Description("VIDIN")] VideoInput, [Description("UARTIN")] UARTInput, [Description("1553IN")] Input1553, [Description("429IN")] ARINC429Input, [Description("MSGIN")] MessageDataInput, [Description("IMGIN")] ImageDataInput, [Description("1394IN")] IEEE1394Input, [Description("PARIN")] ParallelInput, [Description("ETHIN")] EthernetInput } public class RecorderData : TMATSectionNumberedArray { public RecorderData(int number) : base(AttributeIdentifiers.StorageSourceAttributes, number, "N", 99) { } } public enum DataTags { [Description("TK1-")] [MaxLength(5)]//max 2 bytes as an unsigned short, but it's //represented as a string .... TrackNumber, [Description("TK2-")] [MaxLength(6)] RecordingTechnique, [Description("DSI-")] [MaxLength(32)] DataSourceID, [Description("TK3-")] [MaxLength(3)] DataDirection, [Description("TK4-")] [MaxLength(5)] RecorderPhysicalChannelNumber, [Description("CHE-")] [MaxLength(1)] ChannelEnable, [Description("CDT-")] [MaxLength(6)] ChannelDataType, [Description("CDLN-")] [MaxLength(32)] ChannelDataLinkName } public enum DataPackingOptions { [Description("UN")] Unpacked, [Description("PFS")] PackedWithFrameSync, [Description("TM")] ThroughputMode } public enum InputClockEdges { [Description("0")] ZeroDegrees, [Description("180")] OneHundredEightyDegrees } public enum InputSignalTypes { [Description("SE")] SingleEnded, [Description("DIFF")] Differential, [Description("RS422")] RS422StandardDifferential, [Description("TTL")] SingleEndedWithTTL } public enum InputTerminations { [Description("LOW-Z")] LowZ, [Description("HIGH-Z")] HighZ } public enum VideoFormats { [Description("NONE")] None, [Description("MPEG1")] MPEG1, [Description("MPEG2")] MPEG2, [Description("H261")] H261, [Description("WAVE")] WAVE, [Description("OTHER")] OTHER } public enum PCMDataTypeTags { [Description("PDTF-")] [MaxLength(1)] PCMDataTypeFormat, [Description("PDP-")] [MaxLength(3)] DataPackingOption, [Description("ICE-")] [MaxLength(3)] InputClockEdge, [Description("IST-")] [MaxLength(5)] InputSignalType, [Description("ITH-")] [MaxLength(5)] InputThreshold, [Description("ITM-")] [MaxLength(6)] InputTermination, [Description("PTF-")] [MaxLength(5)] PCMVideoTypeFormat } }