History

Initial check-in of Unix based GSF.Identity.UserInfo (not tested)

ritchiecarroll committed 12 years ago

Commit 4e2d2361 parent 85f1ce230 files · +4691 −1446Browse files

Showing the changes to Source/Libraries/GSF.EMAX/ControlFileStructures.cs (1 of 30 files). Show all

Unified · Split

Source/Libraries/GSF.EMAX/ControlFileStructures.cs+34−6
@@ -66,6 +66,7 @@ namespace GSF.EMAX · 65 unmodified lines
66 SEQUENCE_CHANNELS = 0x0051,66 SEQUENCE_CHANNELS = 0x0051,
67 TPwrRcd = 0x0052,67 TPwrRcd = 0x0052,
68 BoardAnalogEventChannels = 0x0060,68 BoardAnalogEventChannels = 0x0060,
69 BREAKER_TRIP_TIMES = 0x0061,
69 Unknown = 0xFFFF70 Unknown = 0xFFFF
70 }71 }
71 72
@@ -73,13 +74,13 @@ namespace GSF.EMAX · 1 unmodified line
73 {74 {
74 public UInt24 id; // System ID75 public UInt24 id; // System ID
75 public uint time; // Time of CTL file creation76 public uint time; // Time of CTL file creation
76 public int num_of_structs; // Number of Structures in CTL file (not really)77 public ushort sp_offset; // System parameters offset
77 78
78 public CTL_HEADER(BinaryReader reader)79 public CTL_HEADER(BinaryReader reader)
79 {80 {
80 id = BigEndian.ToUInt24(reader.ReadBytes(3), 0);81 id = BigEndian.ToUInt24(reader.ReadBytes(3), 0);
81 time = BigEndian.ToUInt32(reader.ReadBytes(4), 0);82 time = BigEndian.ToUInt32(reader.ReadBytes(4), 0);
82 num_of_structs = (int)BinaryCodedDecimal.Decode((uint)BigEndian.ToUInt16(reader.ReadBytes(2), 0));83 sp_offset = BigEndian.ToUInt16(reader.ReadBytes(2), 0);
83 84
84 // Skip padding85 // Skip padding
85 reader.ReadBytes(2);86 reader.ReadBytes(2);
@@ -112,12 +113,10 @@ namespace GSF.EMAX · 26 unmodified lines
112 113
113 offset = reader.ReadUInt32() >> 8;114 offset = reader.ReadUInt32() >> 8;
114 115
115 //Debug.WriteLine("{0} [0x{1}] => Offset = 0x{2} [{3}]",116 //Debug.WriteLine("{0} [0x{1}] => Offset = 0x{2}",
116 // type,117 // type,
117 // ushortValue.ToString("X").PadLeft(4, '0'),118 // ushortValue.ToString("X").PadLeft(4, '0'),
118 // offset.ToString("X").PadLeft(8, '0'),119 // offset.ToString("X").PadLeft(8, '0'));
119 // offset < length && offset > 0 ? "Valid" : "Invalid"
120 // );
121 }120 }
122 }121 }
123 122
@@ -457,6 +456,35 @@ namespace GSF.EMAX · 333 unmodified lines
457 public string value;456 public string value;
458 }457 }
459 458
459 // Since this structure includes dynamically sized arrays, we manually parse structure
460 public struct BREAKER_TRIP_TIMES
461 {
462 public float[] breaker_trip_time;
463 public float[] accumulated_breaker_trip_time;
464 public float[] zero_trip_percent;
465 public float[] zero_trip_time;
466
467 public BREAKER_TRIP_TIMES(BinaryReader reader, int channels, int analogGroups)
468 {
469 breaker_trip_time = ReadArray(reader, channels, analogGroups);
470 accumulated_breaker_trip_time = ReadArray(reader, channels, analogGroups);
471 zero_trip_percent = ReadArray(reader, channels, analogGroups);
472 zero_trip_time = ReadArray(reader, channels, analogGroups);
473 }
474
475 private static float[] ReadArray(BinaryReader reader, int channels, int analogGroups)
476 {
477 float[] floats = new float[channels * analogGroups];
478
479 for (int i = 0; i < floats.Length; i++)
480 {
481 floats[i] = reader.ReadSingle();
482 }
483
484 return floats;
485 }
486 }
487
460 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]488 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
461 public struct ANLG_CHNL_NEW489 public struct ANLG_CHNL_NEW
462 {490 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t