Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
5.1 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: FileStructs.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of FileStructs.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __FILE__STRUCTS__
  15. #define __FILE__STRUCTS__
  16. #define STRING_MAX 31
  17. #define MAX_BITSENS 32
  18. #define NUMBEROFTAGS 20
  19. #define MAX_LINKS 20
  20. #ifdef _MSC_VER
  21. #define FILE_CHAR CHAR
  22. #define FILE_BYTE BYTE
  23. #define FILE_SHORT SHORT
  24. #define FILE_WORD WORD
  25. #define FILE_INT INT
  26. #define FILE_DWORD DWORD
  27. #define FILE_DOUBLE double
  28. #define FILE_BOOL FILE_BYTE
  29. #pragma pack(1)
  30. #else
  31. #define FILE_CHAR CHAR
  32. #define FILE_BYTE BYTE
  33. #define FILE_SHORT SHORT
  34. #define FILE_WORD WORD
  35. #define FILE_INT INT
  36. #define FILE_DWORD DWORD
  37. #define FILE_DOUBLE double
  38. #define FILE_BOOL FILE_BYTE
  39. #pragma pack(1)
  40. #endif
  41. #define TAG_ZONE "ZONES"
  42. #define TAG_GUARD "GUARDS"
  43. #define TAG_SUPER "SUPRES"
  44. #define TAG_SENSOR "SENSORS"
  45. #define TAG_DEVICE "DEVICES"
  46. #define TAG_LINE "LINES"
  47. #define TAG_BACKUP "BACKUP"
  48. #define TAG_SYNOPTIC "SYNOPTIC"
  49. #define TAG_ECS "ECS"
  50. #define TAG_CONDITION "CONDITIONS"
  51. #define TAG_FILTER "FILTERS"
  52. #define TAG_COMMAND "COMMANDS"
  53. #define TAG_OPTIONS "OPTIONS"
  54. #define TAG_PATROL "PATROL"
  55. struct FILE_ZONE
  56. {
  57. FILE_CHAR pName[STRING_MAX]; // name
  58. FILE_INT nPriority; // priority
  59. FILE_DOUBLE Pos[2]; //position
  60. };
  61. struct FILE_LINE
  62. {
  63. FILE_CHAR pPortName[STRING_MAX];
  64. };
  65. struct FILE_SENSOR
  66. {
  67. FILE_CHAR pName[STRING_MAX]; // name
  68. FILE_CHAR pAlarmMsg[STRING_MAX]; //
  69. FILE_INT nAddress; // address
  70. FILE_INT BitMask; // mask
  71. FILE_INT nPriority; // priority
  72. FILE_INT bEnable; // enable/disable
  73. FILE_INT iZone; // zone number (index in zones array)
  74. FILE_INT iLine; // line number (index in lines array)
  75. FILE_INT iType; // type of sensor (index in array of types)(bkgrnd etc.)
  76. FILE_DOUBLE Pos[2]; // position
  77. };
  78. struct FILE_DEVICE
  79. {
  80. FILE_CHAR pName[STRING_MAX];
  81. FILE_DOUBLE Pos[MAX_BITSENS][2]; //position on picture
  82. FILE_INT BitCount; //number of sensors, 0-7
  83. FILE_INT iBackground; //background index
  84. };
  85. struct FILE_TAG
  86. {
  87. FILE_CHAR pName[STRING_MAX]; //names: Devices, Zones, Sensors, etc..
  88. FILE_INT iStart; //offset
  89. };
  90. struct FILE_BACKUP
  91. {
  92. FILE_CHAR pPort[STRING_MAX];
  93. };
  94. struct FILE_SINOPTIC
  95. {
  96. FILE_CHAR pPort[STRING_MAX];
  97. };
  98. struct FILE_GUARD
  99. {
  100. FILE_CHAR pName[STRING_MAX];
  101. };
  102. struct FILE_SUPER
  103. {
  104. FILE_CHAR pName[STRING_MAX];
  105. FILE_CHAR pPassword[STRING_MAX];
  106. //general actions (GA)
  107. FILE_BYTE sys_shutdown;
  108. FILE_BYTE access_all;
  109. FILE_BYTE access;
  110. FILE_BYTE general_report;
  111. FILE_BYTE clock_updating;
  112. //system_check (SC)
  113. FILE_BYTE show_mal_sprus;
  114. FILE_BYTE show_non_comm_sprus;
  115. FILE_BYTE show_undef_sprus;
  116. FILE_BYTE show_statistics;
  117. FILE_BYTE prn_exceptional_sprus;
  118. FILE_BYTE selftest;
  119. FILE_BYTE comm_retry;
  120. //special_reports (SR)
  121. FILE_BYTE system;
  122. FILE_BYTE guard_control;
  123. FILE_BYTE wakeup;
  124. FILE_BYTE changing_guards;
  125. //SPRU REPORT (RR)
  126. FILE_BYTE alarms;
  127. FILE_BYTE comms;
  128. FILE_BYTE hardware_faults;
  129. FILE_BYTE acc_sec;
  130. //USER _DEFINE (UD)
  131. FILE_BYTE day_night;
  132. FILE_BYTE interlock;
  133. FILE_BYTE oper_option;
  134. FILE_BYTE access_lines_option;
  135. } ;
  136. enum FILE_SENSORSTATE
  137. {
  138. FILE_SS_UNKNOWN = 0x01,
  139. FILE_SS_NORMAL = 0x02,
  140. FILE_SS_DISABLE = 0x04,
  141. FILE_SS_TIMEOUT = 0x08,
  142. FILE_SS_POSTALARM = 0x10,
  143. FILE_SS_ALARM = 0x20
  144. };
  145. struct FILE_CONDITION
  146. {
  147. FILE_INT nSensor;
  148. FILE_INT nBitMask; //Selected Bits
  149. FILE_BOOL bAll; //True if all, false if anyone
  150. FILE_INT nDelay; //Timeout, second
  151. FILE_INT nState; //Bit mask: Alarm-0, Normal-1, etc...
  152. };
  153. struct FILE_FILTER
  154. {
  155. FILE_INT inputs[MAX_LINKS]; //links to index in "Inputs"
  156. FILE_INT nInputCount;
  157. FILE_INT commands[MAX_LINKS]; //links to index in "Commands"
  158. FILE_INT nCommandCount;
  159. };
  160. struct FILE_COMMAND
  161. {
  162. FILE_INT nCommand;
  163. FILE_INT nAddress;
  164. FILE_INT nLine;
  165. };
  166. struct FILE_OPTIONS
  167. {
  168. FILE_INT nZoomFactor;
  169. FILE_BOOL bNeedAutorization;
  170. };
  171. struct FILE_PATROL_HEADER
  172. {
  173. FILE_CHAR pName[STRING_MAX];
  174. FILE_INT nCount;
  175. };
  176. struct FILE_PATROL_POINT
  177. {
  178. FILE_INT nAddress;
  179. FILE_INT nBitMask;
  180. FILE_INT nTime;
  181. FILE_INT nTolerance;
  182. };
  183. /**************************************
  184. struct FILE
  185. {
  186. int line_count
  187. FILE_LINE lines[line_count]
  188. int device_count
  189. FILE_DEVICE devices[device_count]
  190. int sensor_count
  191. FILE_SENSOR sensors[sensor_count]
  192. int zone_count
  193. FILE_ZONE zones[zone_count]
  194. };
  195. **************************************/
  196. #ifdef _MSC_VER
  197. #pragma pack()
  198. #else
  199. #pragma pack()
  200. #endif
  201. #endif