Source code of Windows XP (NT5)
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.

1085 lines
33 KiB

  1. /*
  2. * pcy29Nov92: Changed object.h to apcobj.h
  3. * jod28Jan93: Added new Pollparams to support the Q command
  4. * ane03Feb93: Added destructors
  5. * jod05Apr93: Added changes for Deep Discharge
  6. * jod14May93: Added Matrix changes.
  7. * pcy14May93: Removed SIMPLE_SET, it's in types.h
  8. * cad10Jun93: Added mups parms
  9. * cad28Sep93: Made sure destructor(s) virtual
  10. * cad07Oct93: Plugging Memory Leaks
  11. * pcy08Apr94: Trim size, use static iterators, dead code removal
  12. * jps28aug94: shorted EepromAllowedValues and BattCalibrationCond for os2 1.3,
  13. * was causing link problems due to compiler truncation
  14. * djs22Feb96: added smart trim and increment poll params
  15. * djs07May96: Added Dark Star parameters
  16. * tjg03Dec97: Added CurrentLoadCapabilityPollParam and fixed bitmasks for
  17. * INPUT_BREAKER_TRIPPED, SYSTEM_FAN_FAILED and RIM_IN_CONTROL
  18. * mholly12May1999: add TurnOffSmartModePollParam support
  19. */
  20. #ifndef __POLLPARAM_H
  21. #define __POLLPARAM_H
  22. #include "_defs.h"
  23. _CLASSDEF(List)
  24. #include "apcobj.h"
  25. #include "message.h"
  26. #include "err.h"
  27. #define NO_POLL 0
  28. #define POLL 1
  29. #define UPS_STATE_SET 3
  30. #define REPLACEBATTERYMASK 128
  31. #define LOWBATTERYMASK 64
  32. #define OVERLOADMASK 32
  33. #define ONBATTERYMASK 16
  34. #define ONLINEMASK 8
  35. #define SMARTBOOSTMASK 4
  36. #define SMARTTRIMMASK 2
  37. #define BATTERYCALIBRATIONMASK 1
  38. #define ARMEDRECPSTANDBYMASK 128
  39. #define RECEPTIVESTANDBYMASK 64
  40. #define SWITCHEDBYPASSMASK 32
  41. #define RETURNINGFROMBYPASSMASK 16
  42. #define COMPSELECTBYPASSMASK 8
  43. #define ENTERINGBYPASSMASK 4
  44. #define UNDEFINEDMASK 2
  45. #define WAKEUPMASK 1
  46. #define OVERTEMPMASK 128
  47. #define BYPASSRELAYMASK 64
  48. #define BATTERYCHARGERMASK 32
  49. #define BYPASSDCIMBALANCEMASK 16
  50. #define BYPASSOUTPUTLIMITSMASK 8
  51. #define BYPASSPOWERSUPPLYMASK 4
  52. #define BOTTOMFANFAILUREMASK 2
  53. #define TOPFANFAILUREMASK 1
  54. #define VARIABLE_LENGTH_RESPONSE 0
  55. // Abnormal condition masks
  56. const int FAILED_UPS_MASK = 1;
  57. const int IM_FAILED_MASK = 2;
  58. const int RIM_FAILED_MASK = 4;
  59. const int REDUNDANCY_FAILED_MASK = 64;
  60. const int BYPASS_STUCK_IN_BYPASS_MASK = 256;
  61. const int BYPASS_STUCK_IN_ONLINE_MASK = 512;
  62. const int BYPASS_STUCK_MASK = BYPASS_STUCK_IN_BYPASS_MASK + BYPASS_STUCK_IN_ONLINE_MASK;
  63. const int INPUT_BREAKER_TRIPPED_MASK = 8192;
  64. const int SYSTEM_FAN_FAILED_MASK = 16384;
  65. const int RIM_IN_CONTROL_MASK = 32768;
  66. _CLASSDEF(PollParam)
  67. class PollParam : public Obj {
  68. protected:
  69. PCHAR Command;
  70. INT RequestTime;
  71. Type SetType;
  72. INT ID;
  73. INT Pollable;
  74. public:
  75. PollParam(INT id, CHAR* query, INT time, INT poll, Type type=(Type)NULL);
  76. virtual ~PollParam();
  77. virtual INT ProcessValue(PMessage value, List* events=(List*)NULL) = 0;
  78. PCHAR Query();
  79. INT GetTime() {return RequestTime;}
  80. INT GetID() {return ID;}
  81. Type GetSetType() {return SetType;}
  82. INT isPollable() {return Pollable;}
  83. VOID SetSetType(Type type) {SetType = type;}
  84. INT Equal( RObj item) const;
  85. virtual INT IsA() const {return POLLPARAM;}
  86. virtual INT IsPollSet() {return ErrNO_ERROR;};
  87. };
  88. class SimplePollParam : public PollParam {
  89. public:
  90. SimplePollParam(INT id, CHAR* query, INT time, INT poll,
  91. Type type=(Type)NULL) :
  92. PollParam(id,query,time,poll,type) {};
  93. INT ProcessValue(PMessage , List* ) {return 0;} // This function is empty
  94. };
  95. class SmartPollParam : public PollParam {
  96. protected:
  97. USHORT theCurrentState;
  98. INT theResponseLength;
  99. INT ResponseLength();
  100. public:
  101. SmartPollParam(INT id, CHAR* query, INT time, INT poll,
  102. Type type=(Type)NULL, INT aResponseLength = 0) :
  103. PollParam(id,query,time,poll,type),
  104. theCurrentState(0), theResponseLength(aResponseLength) {};
  105. INT ProcessValue(PMessage, PList);
  106. INT NullTest(CHAR* value);
  107. };
  108. class SmartModePollParam : public SmartPollParam
  109. {
  110. public:
  111. SmartModePollParam(INT id, CHAR* query, INT time, INT poll,
  112. Type type=(Type)NULL) :
  113. SmartPollParam(id,query, time, poll, type, 2) {}
  114. INT ProcessValue(PMessage value, List* events);
  115. };
  116. class TurnOffSmartModePollParam : public SmartPollParam
  117. {
  118. public:
  119. TurnOffSmartModePollParam(INT id, CHAR* query, INT time, INT poll,
  120. Type type=(Type)NULL) :
  121. SmartPollParam(id,query, time, poll, type, 3) {};
  122. INT ProcessValue(PMessage value, List* events);
  123. };
  124. class LightsTestPollParam : public SmartPollParam
  125. {
  126. public:
  127. LightsTestPollParam(INT id, CHAR* query, INT time, INT poll,
  128. Type type=(Type)NULL) :
  129. SmartPollParam(id,query, time, poll, type, 2) {}
  130. INT ProcessValue(PMessage value, List* events);
  131. };
  132. class TurnOffAfterDelayPollParam : public SmartPollParam
  133. {
  134. public:
  135. TurnOffAfterDelayPollParam(INT id, CHAR* query, INT time, INT poll,
  136. Type type=(Type)NULL) :
  137. SmartPollParam(id,query, time, poll, type, 2) {}
  138. INT ProcessValue(PMessage value, List* events);
  139. };
  140. class ShutdownPollParam : public SmartPollParam
  141. {
  142. public:
  143. ShutdownPollParam(INT id, CHAR* query, INT time, INT poll,
  144. Type type=(Type)NULL) :
  145. SmartPollParam(id,query, time, poll, type, 2) {}
  146. INT ProcessValue(PMessage value, List* events);
  147. };
  148. class SimulatePowerFailurePollParam : public SmartPollParam
  149. {
  150. public:
  151. SimulatePowerFailurePollParam(INT id, CHAR* query, INT time, INT poll,
  152. Type type=(Type)NULL) :
  153. SmartPollParam(id,query, time, poll, type, 2) {}
  154. INT ProcessValue(PMessage value, List* events);
  155. };
  156. class BatteryTestPollParam : public SmartPollParam
  157. {
  158. public:
  159. BatteryTestPollParam(INT id, CHAR* query, INT time, INT poll,
  160. Type type=(Type)NULL) :
  161. SmartPollParam(id,query, time, poll, type, 2) {}
  162. INT ProcessValue(PMessage value, List* events);
  163. };
  164. class TurnOffUpsPollParam : public SmartPollParam
  165. {
  166. public:
  167. TurnOffUpsPollParam(INT id, CHAR* query, INT time, INT poll,
  168. Type type=(Type)NULL) :
  169. SmartPollParam(id,query, time, poll, type, 2) {}
  170. INT ProcessValue(PMessage value, List* events);
  171. };
  172. class ShutdownWakeupPollParam : public SmartPollParam
  173. {
  174. public:
  175. ShutdownWakeupPollParam(INT id, CHAR* query, INT time, INT poll,
  176. Type type=(Type)NULL) :
  177. SmartPollParam(id,query, time, poll, type, 2) {}
  178. INT ProcessValue(PMessage value, List* events);
  179. };
  180. class BatteryCalibrationPollParam : public SmartPollParam
  181. {
  182. public:
  183. BatteryCalibrationPollParam(INT id, CHAR* query, INT time, INT poll,
  184. Type type=(Type)NULL) :
  185. SmartPollParam(id,query, time, poll, type, 2) {}
  186. INT ProcessValue(PMessage value, List* events);
  187. };
  188. class BatteryTestResultsPollParam : public SmartPollParam
  189. {
  190. public:
  191. BatteryTestResultsPollParam(INT id, CHAR* query, INT time, INT poll,
  192. Type type=(Type)NULL) :
  193. SmartPollParam(id,query, time, poll, type, 2) {}
  194. INT ProcessValue(PMessage value, List* events);
  195. };
  196. class TransferCausePollParam : public SmartPollParam
  197. {
  198. public:
  199. TransferCausePollParam(INT id, CHAR* query, INT time, INT poll,
  200. Type type=(Type)NULL) :
  201. SmartPollParam(id,query, time, poll, type, 1) {}
  202. INT ProcessValue(PMessage value, List* events);
  203. };
  204. class FirmwareVersionPollParam : public SmartPollParam
  205. {
  206. public:
  207. FirmwareVersionPollParam(INT id, CHAR* query, INT time, INT poll,
  208. Type type=(Type)NULL) :
  209. SmartPollParam(id,query, time, poll, type, VARIABLE_LENGTH_RESPONSE) {}
  210. };
  211. class RunTimeAfterLowBatteryPollParam : public SmartPollParam
  212. {
  213. public:
  214. RunTimeAfterLowBatteryPollParam(INT id, CHAR* query, INT time, INT poll,
  215. Type type=(Type)NULL) :
  216. SmartPollParam(id,query, time, poll, type, 2) {}
  217. };
  218. class FrontPanelPasswordPollParam : public SmartPollParam
  219. {
  220. public:
  221. FrontPanelPasswordPollParam(INT id, CHAR* query, INT time, INT poll,
  222. Type type=(Type)NULL) :
  223. SmartPollParam(id,query, time, poll, type, 4) {}
  224. };
  225. class BatteryTypePollParam : public SmartPollParam
  226. {
  227. public:
  228. BatteryTypePollParam(INT id, CHAR* query, INT time, INT poll,
  229. Type type=(Type)NULL) :
  230. SmartPollParam(id,query, time, poll, type, 3) {}
  231. };
  232. class LineConditionPollParam : public SmartPollParam
  233. {
  234. public:
  235. LineConditionPollParam(INT id, CHAR* query, INT time, INT poll,
  236. Type type=(Type)NULL) :
  237. SmartPollParam(id,query, time, poll, type) {}
  238. INT ProcessValue(PMessage value, List* events);
  239. };
  240. class BatteryCapacityPollParam : public SmartPollParam
  241. {
  242. public:
  243. BatteryCapacityPollParam(INT id, CHAR* query, INT time, INT poll,
  244. Type type=(Type)NULL) :
  245. SmartPollParam(id,query, time, poll, type, 5) {}
  246. INT ProcessValue(PMessage value, List* events);
  247. };
  248. class TripRegisterPollParam : public SmartPollParam
  249. {
  250. protected:
  251. static USHORT thePollSet;
  252. public:
  253. TripRegisterPollParam(INT id, CHAR* query, INT time, INT poll,
  254. Type type=(Type)NULL) :
  255. SmartPollParam(id,query, time, poll, type, 2)
  256. { theCurrentState = 0;}
  257. virtual ~TripRegisterPollParam() { thePollSet = FALSE; }
  258. INT ProcessValue(PMessage value, List* events);
  259. virtual INT IsPollSet();
  260. };
  261. class Trip1RegisterPollParam : public SmartPollParam
  262. {
  263. protected:
  264. static USHORT thePollSet;
  265. public:
  266. Trip1RegisterPollParam(INT id, CHAR* query, INT time, INT poll,
  267. Type type=(Type)NULL) :
  268. SmartPollParam(id,query, time, poll, type, 2)
  269. { theCurrentState = 0;}
  270. virtual ~Trip1RegisterPollParam() { thePollSet = FALSE; }
  271. INT ProcessValue(PMessage value, List* events);
  272. virtual INT IsPollSet();
  273. };
  274. class StateRegisterPollParam : public SmartPollParam
  275. {
  276. protected:
  277. static USHORT thePollSet;
  278. public:
  279. StateRegisterPollParam(INT id, CHAR* query, INT time, INT poll,
  280. Type type=(Type)NULL) :
  281. SmartPollParam(id,query, time, poll, type, 2)
  282. { theCurrentState = 0;}
  283. virtual ~StateRegisterPollParam() { thePollSet = FALSE; }
  284. INT ProcessValue(PMessage value, List* events);
  285. virtual INT IsPollSet();
  286. };
  287. class DipSwitchPollParam : public SmartPollParam
  288. {
  289. public:
  290. DipSwitchPollParam(INT id, CHAR* query, INT time, INT poll,
  291. Type type=(Type)NULL) :
  292. SmartPollParam(id,query, time, poll, type, 2) {}
  293. INT ProcessValue(PMessage value, List* events);
  294. };
  295. class RuntimeRemainingPollParam : public SmartPollParam
  296. {
  297. public:
  298. RuntimeRemainingPollParam(INT id, CHAR* query, INT time, INT poll,
  299. Type type=(Type)NULL) :
  300. SmartPollParam(id,query, time, poll, type, 5) {}
  301. INT ProcessValue(PMessage value, List* events);
  302. };
  303. class CopyrightPollParam : public SmartPollParam
  304. {
  305. public:
  306. CopyrightPollParam(INT id, CHAR* query, INT time, INT poll,
  307. Type type=(Type)NULL) :
  308. SmartPollParam(id,query, time, poll, type, 8) {}
  309. INT ProcessValue(PMessage value, List* events);
  310. };
  311. class BatteryVoltagePollParam : public SmartPollParam
  312. {
  313. public:
  314. BatteryVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  315. Type type=(Type)NULL) :
  316. SmartPollParam(id,query, time, poll, type, 5) {}
  317. INT ProcessValue(PMessage value, List* events);
  318. };
  319. class InternalTempPollParam : public SmartPollParam
  320. {
  321. public:
  322. InternalTempPollParam(INT id, CHAR* query, INT time, INT poll,
  323. Type type=(Type)NULL) :
  324. SmartPollParam(id,query, time, poll, type, 5) {}
  325. INT ProcessValue(PMessage value, List* events);
  326. };
  327. class OutputFreqPollParam : public SmartPollParam
  328. {
  329. public:
  330. OutputFreqPollParam(INT id, CHAR* query, INT time, INT poll,
  331. Type type=(Type)NULL) :
  332. SmartPollParam(id,query, time, poll, type, 5) {}
  333. INT ProcessValue(PMessage value, List* events);
  334. };
  335. class LineVoltagePollParam : public SmartPollParam
  336. {
  337. public:
  338. LineVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  339. Type type=(Type)NULL) :
  340. SmartPollParam(id,query, time, poll, type, 5) {}
  341. INT ProcessValue(PMessage value, List* events);
  342. };
  343. class MaxVoltagePollParam : public SmartPollParam
  344. {
  345. public:
  346. MaxVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  347. Type type=(Type)NULL) :
  348. SmartPollParam(id,query, time, poll, type, 5) {}
  349. INT ProcessValue(PMessage value, List* events);
  350. };
  351. class MinVoltagePollParam : public SmartPollParam
  352. {
  353. public:
  354. MinVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  355. Type type=(Type)NULL) :
  356. SmartPollParam(id,query, time, poll, type, 5) {}
  357. INT ProcessValue(PMessage value, List* events);
  358. };
  359. class OutputVoltagePollParam : public SmartPollParam
  360. {
  361. public:
  362. OutputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  363. Type type=(Type)NULL) :
  364. SmartPollParam(id,query, time, poll, type, 5) {}
  365. INT ProcessValue(PMessage value, List* events);
  366. };
  367. class LoadPowerPollParam : public SmartPollParam
  368. {
  369. public:
  370. LoadPowerPollParam(INT id, CHAR* query, INT time, INT poll,
  371. Type type=(Type)NULL) :
  372. SmartPollParam(id,query, time, poll, type, 5) {}
  373. INT ProcessValue(PMessage value, List* events);
  374. };
  375. #if (C_OS & C_OS2)
  376. class EepromAllowedValsPollParam : public SmartPollParam
  377. #else
  378. class EepromAllowedValuesPollParam : public SmartPollParam
  379. #endif
  380. {
  381. public:
  382. #if (C_OS & C_OS2)
  383. EepromAllowedValsPollParam(INT id, CHAR* query, INT time, INT poll,
  384. #else
  385. EepromAllowedValuesPollParam(INT id, CHAR* query, INT time, INT poll,
  386. #endif
  387. Type type=(Type)NULL) :
  388. SmartPollParam(id,query, time, poll, type) {}
  389. INT ProcessValue(PMessage value, List* events);
  390. };
  391. class DecrementPollParam : public SmartPollParam
  392. {
  393. public:
  394. DecrementPollParam(INT id, CHAR* query, INT time, INT poll,
  395. Type type=(Type)NULL) :
  396. SmartPollParam(id,query, time, poll, type) {}
  397. INT ProcessValue(PMessage value, List* events);
  398. };
  399. class IncrementPollParam : public SmartPollParam
  400. {
  401. public:
  402. IncrementPollParam(INT id, CHAR* query, INT time, INT poll,
  403. Type type=(Type)NULL) :
  404. SmartPollParam(id,query, time, poll, type) {}
  405. INT ProcessValue(PMessage value, List* events);
  406. };
  407. class DataDecrementPollParam : public SmartPollParam
  408. {
  409. public:
  410. DataDecrementPollParam(INT id, CHAR* query, INT time, INT poll,
  411. Type type=(Type)NULL) :
  412. SmartPollParam(id,query, time, poll, type, 2) {}
  413. };
  414. class AutoSelfTestPollParam : public SmartPollParam
  415. {
  416. public:
  417. AutoSelfTestPollParam(INT id, CHAR* query, INT time, INT poll,
  418. Type type=(Type)NULL) :
  419. SmartPollParam(id,query, time, poll, type, 3) {}
  420. };
  421. class UpsIdPollParam : public SmartPollParam
  422. {
  423. public:
  424. UpsIdPollParam(INT id, CHAR* query, INT time, INT poll,
  425. Type type=(Type)NULL) :
  426. SmartPollParam(id,query, time, poll, type, 8) {}
  427. INT ProcessValue(PMessage value, PList events);
  428. };
  429. class SerialNumberPollParam : public SmartPollParam
  430. {
  431. public:
  432. SerialNumberPollParam(INT id, CHAR* query, INT time, INT poll,
  433. Type type=(Type)NULL) :
  434. SmartPollParam(id,query, time, poll, type, VARIABLE_LENGTH_RESPONSE) {}
  435. };
  436. class ManufactureDatePollParam : public SmartPollParam
  437. {
  438. public:
  439. ManufactureDatePollParam(INT id, CHAR* query, INT time, INT poll,
  440. Type type=(Type)NULL) :
  441. SmartPollParam(id,query, time, poll, type, 8) {}
  442. };
  443. class UpsModelPollParam : public SmartPollParam
  444. {
  445. public:
  446. UpsModelPollParam(INT id, CHAR* query, INT time, INT poll,
  447. Type type=(Type)NULL) :
  448. SmartPollParam(id,query, time, poll, type,
  449. VARIABLE_LENGTH_RESPONSE) {}
  450. };
  451. class UpsNewFirmwareRev : public SmartPollParam
  452. {
  453. public:
  454. UpsNewFirmwareRev(INT id, CHAR* query, INT time, INT poll,
  455. Type type=(Type)NULL) :
  456. SmartPollParam(id,query, time, poll, type,
  457. VARIABLE_LENGTH_RESPONSE) {}
  458. };
  459. class BatteryReplaceDatePollParam : public SmartPollParam
  460. {
  461. public:
  462. BatteryReplaceDatePollParam(INT id, CHAR* query, INT time, INT poll,
  463. Type type=(Type)NULL) :
  464. SmartPollParam(id,query, time, poll, type, 8) {}
  465. INT ProcessValue(PMessage value, PList events);
  466. };
  467. class HighTransferPollParam : public SmartPollParam
  468. {
  469. public:
  470. HighTransferPollParam(INT id, CHAR* query, INT time, INT poll,
  471. Type type=(Type)NULL) :
  472. SmartPollParam(id,query, time, poll, type, 3) {}
  473. };
  474. class LowTransferPollParam : public SmartPollParam
  475. {
  476. public:
  477. LowTransferPollParam(INT id, CHAR* query, INT time, INT poll,
  478. Type type=(Type)NULL) :
  479. SmartPollParam(id,query, time, poll, type, 3) {}
  480. };
  481. class MinCapacityPollParam : public SmartPollParam
  482. {
  483. public:
  484. MinCapacityPollParam(INT id, CHAR* query, INT time, INT poll,
  485. Type type=(Type)NULL) :
  486. SmartPollParam(id,query, time, poll, type, 2) {}
  487. };
  488. class RatedOutputVoltagePollParam : public SmartPollParam
  489. {
  490. public:
  491. RatedOutputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  492. Type type=(Type)NULL) :
  493. SmartPollParam(id,query, time, poll, type, 3) {}
  494. };
  495. class SensitivityPollParam : public SmartPollParam
  496. {
  497. public:
  498. SensitivityPollParam(INT id, CHAR* query, INT time, INT poll,
  499. Type type=(Type)NULL) :
  500. SmartPollParam(id,query, time, poll, type, 1) {}
  501. };
  502. class LowBattDurationPollParam : public SmartPollParam
  503. {
  504. public:
  505. LowBattDurationPollParam(INT id, CHAR* query, INT time, INT poll,
  506. Type type=(Type)NULL) :
  507. SmartPollParam(id,query, time, poll, type, 2) {}
  508. };
  509. class AlarmDelayPollParam : public SmartPollParam
  510. {
  511. public:
  512. AlarmDelayPollParam(INT id, CHAR* query, INT time, INT poll,
  513. Type type=(Type)NULL) :
  514. SmartPollParam(id,query, time, poll, type, 1) {}
  515. };
  516. class ShutdownDelayPollParam : public SmartPollParam
  517. {
  518. public:
  519. ShutdownDelayPollParam(INT id, CHAR* query, INT time, INT poll,
  520. Type type=(Type)NULL) :
  521. SmartPollParam(id,query, time, poll, type, 3) {}
  522. };
  523. class TurnBackOnDelayPollParam : public SmartPollParam
  524. {
  525. public:
  526. TurnBackOnDelayPollParam(INT id, CHAR* query, INT time, INT poll,
  527. Type type=(Type)NULL) :
  528. SmartPollParam(id,query, time, poll, type, 3) {}
  529. };
  530. class EarlyTurnOffPollParam : public SmartPollParam
  531. {
  532. public:
  533. EarlyTurnOffPollParam(INT id, CHAR* query, INT time, INT poll,
  534. Type type=(Type)NULL) :
  535. SmartPollParam(id,query, time, poll, type, 2) {}
  536. };
  537. class UPSStatePollParam : public SmartPollParam
  538. {
  539. protected:
  540. static USHORT thePollSet;
  541. public:
  542. UPSStatePollParam(INT id, CHAR* query, INT time, INT poll,
  543. Type type=(Type)NULL) :
  544. SmartPollParam(id,query, time, poll, type, 2)
  545. { theCurrentState = ONLINEMASK;}
  546. virtual ~UPSStatePollParam() { thePollSet = FALSE; }
  547. INT ProcessValue(PMessage value, List* events);
  548. virtual INT IsPollSet();
  549. };
  550. class UtilLineCondPollParam : public UPSStatePollParam
  551. {
  552. public:
  553. UtilLineCondPollParam(INT id, CHAR* query, INT time, INT poll,
  554. Type type=(Type)NULL) :
  555. UPSStatePollParam(id,query, time, poll, type)
  556. { theCurrentState = ONLINEMASK; }
  557. INT ProcessValue(PMessage value, List* events);
  558. };
  559. class ReplaceBattCondPollParam : public UPSStatePollParam
  560. {
  561. public:
  562. ReplaceBattCondPollParam(INT id, CHAR* query, INT time, INT poll,
  563. Type type=(Type)NULL) :
  564. UPSStatePollParam(id,query, time, poll, type)
  565. { theCurrentState = REPLACEBATTERYMASK; }
  566. INT ProcessValue(PMessage value, List* events);
  567. };
  568. class BatteryCondPollParam : public UPSStatePollParam
  569. {
  570. public:
  571. BatteryCondPollParam(INT id, CHAR* query, INT time, INT poll,
  572. Type type=(Type)NULL) :
  573. UPSStatePollParam(id,query, time, poll, type)
  574. { theCurrentState = ONBATTERYMASK; }
  575. INT ProcessValue(PMessage value, List* events);
  576. };
  577. class OverLoadCondPollParam : public UPSStatePollParam
  578. {
  579. public:
  580. OverLoadCondPollParam(INT id, CHAR* query, INT time, INT poll,
  581. Type type=(Type)NULL) :
  582. UPSStatePollParam(id,query, time, poll, type)
  583. { theCurrentState = OVERLOADMASK; }
  584. INT ProcessValue(PMessage value, List* events);
  585. };
  586. class SmartBoostCondPollParam : public UPSStatePollParam
  587. {
  588. public:
  589. SmartBoostCondPollParam(INT id, CHAR* query, INT time, INT poll,
  590. Type type=(Type)NULL) :
  591. UPSStatePollParam(id,query, time, poll, type)
  592. { theCurrentState = SMARTBOOSTMASK; }
  593. INT ProcessValue(PMessage value, List* events);
  594. };
  595. class SmartTrimCondPollParam : public UPSStatePollParam
  596. {
  597. public:
  598. SmartTrimCondPollParam(INT id, CHAR* query, INT time, INT poll,
  599. Type type=(Type)NULL) :
  600. UPSStatePollParam(id,query, time, poll, type)
  601. { theCurrentState = SMARTTRIMMASK; }
  602. INT ProcessValue(PMessage value, List* events);
  603. };
  604. #if (C_OS & C_OS2)
  605. class BattCalibrateCondPollParam : public UPSStatePollParam
  606. #else
  607. class BattCalibrationCondPollParam : public UPSStatePollParam
  608. #endif
  609. {
  610. public:
  611. #if (C_OS & C_OS2)
  612. BattCalibrateCondPollParam(INT id, CHAR* query, INT time, INT poll,
  613. #else
  614. BattCalibrationCondPollParam(INT id, CHAR* query, INT time, INT poll,
  615. #endif
  616. Type type=(Type)NULL) :
  617. UPSStatePollParam(id,query, time, poll, type)
  618. { theCurrentState = BATTERYCALIBRATIONMASK; }
  619. INT ProcessValue(PMessage value, List* events);
  620. };
  621. class AbnormalCondPollParam : public SmartPollParam
  622. {
  623. protected:
  624. static USHORT thePollSet;
  625. public:
  626. AbnormalCondPollParam(INT id, CHAR* query, INT time, INT poll,
  627. Type type=(Type)NULL) :
  628. SmartPollParam(id,query, time, poll, type, 2)
  629. { theCurrentState = FAILED_UPS_MASK;}
  630. virtual ~AbnormalCondPollParam() { thePollSet = FALSE; }
  631. INT ProcessValue(PMessage value, List* events);
  632. virtual INT IsPollSet();
  633. };
  634. class UPSModuleStatusPollParam : public AbnormalCondPollParam {
  635. public:
  636. UPSModuleStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  637. Type type=(Type)NULL) :
  638. AbnormalCondPollParam(id,query, time, poll, type)
  639. { theCurrentState = FAILED_UPS_MASK; }
  640. INT ProcessValue(PMessage value, List* events);
  641. };
  642. class IMStatusPollParam : public AbnormalCondPollParam {
  643. public:
  644. IMStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  645. Type type=(Type)NULL) :
  646. AbnormalCondPollParam(id,query, time, poll, type)
  647. { theCurrentState = IM_FAILED_MASK; }
  648. INT ProcessValue(PMessage value, List* events);
  649. };
  650. class IMInstallationStatusPollParam : public AbnormalCondPollParam {
  651. public:
  652. IMInstallationStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  653. Type type=(Type)NULL) :
  654. AbnormalCondPollParam(id,query, time, poll, type)
  655. { theCurrentState = IM_FAILED_MASK; }
  656. INT ProcessValue(PMessage value, List* events);
  657. };
  658. class RIMStatusPollParam : public AbnormalCondPollParam {
  659. public:
  660. RIMStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  661. Type type=(Type)NULL) :
  662. AbnormalCondPollParam(id,query, time, poll, type)
  663. { theCurrentState = RIM_FAILED_MASK; }
  664. INT ProcessValue(PMessage value, List* events);
  665. };
  666. class RedundancyConditionPollParam : public AbnormalCondPollParam {
  667. public:
  668. RedundancyConditionPollParam(INT id, CHAR* query, INT time, INT poll,
  669. Type type=(Type)NULL) :
  670. AbnormalCondPollParam(id,query, time, poll, type)
  671. { theCurrentState = REDUNDANCY_FAILED_MASK; }
  672. INT ProcessValue(PMessage value, List* events);
  673. };
  674. class BypassContactorStatusPollParam : public AbnormalCondPollParam {
  675. public:
  676. BypassContactorStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  677. Type type=(Type)NULL) :
  678. AbnormalCondPollParam(id,query, time, poll, type)
  679. { theCurrentState = BYPASS_STUCK_MASK; }
  680. INT ProcessValue(PMessage value, List* events);
  681. };
  682. class InputBreakerTrippedStatusPollParam : public AbnormalCondPollParam {
  683. public:
  684. InputBreakerTrippedStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  685. Type type=(Type)NULL) :
  686. AbnormalCondPollParam(id,query, time, poll, type)
  687. { theCurrentState = INPUT_BREAKER_TRIPPED_MASK; }
  688. INT ProcessValue(PMessage value, List* events);
  689. };
  690. class SystemFanStatusPollParam : public AbnormalCondPollParam {
  691. public:
  692. SystemFanStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  693. Type type=(Type)NULL) :
  694. AbnormalCondPollParam(id,query, time, poll, type)
  695. { theCurrentState = SYSTEM_FAN_FAILED_MASK; }
  696. INT ProcessValue(PMessage value, List* events);
  697. };
  698. class ModuleCountsStatusPollParam : public SmartPollParam
  699. {
  700. protected:
  701. static USHORT thePollSet;
  702. public:
  703. ModuleCountsStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  704. Type type=(Type)NULL) :
  705. SmartPollParam(id,query, time, poll, type, 2)
  706. { theCurrentState = 0;}
  707. virtual ~ModuleCountsStatusPollParam() { thePollSet = FALSE; }
  708. INT ProcessValue(PMessage value, List* events);
  709. virtual INT IsPollSet();
  710. };
  711. class NumberInstalledInvertersPollParam : public ModuleCountsStatusPollParam {
  712. public:
  713. NumberInstalledInvertersPollParam(INT id, CHAR* query, INT time, INT poll,
  714. Type type=(Type)NULL) :
  715. ModuleCountsStatusPollParam (id,query, time, poll, type)
  716. { theCurrentState = 0; }
  717. INT ProcessValue(PMessage value, List* events);
  718. };
  719. class NumberBadInvertersPollParam : public ModuleCountsStatusPollParam {
  720. public:
  721. NumberBadInvertersPollParam(INT id, CHAR* query, INT time, INT poll,
  722. Type type=(Type)NULL) :
  723. ModuleCountsStatusPollParam (id,query, time, poll, type)
  724. { theCurrentState = 0; }
  725. INT ProcessValue(PMessage value, List* events);
  726. };
  727. class RedundancyLevelPollParam : public ModuleCountsStatusPollParam {
  728. public:
  729. RedundancyLevelPollParam(INT id, CHAR* query, INT time, INT poll,
  730. Type type=(Type)NULL) :
  731. ModuleCountsStatusPollParam (id,query, time, poll, type)
  732. { theCurrentState = 0; }
  733. INT ProcessValue(PMessage value, List* events);
  734. };
  735. class MinimumRedundancyPollParam : public ModuleCountsStatusPollParam {
  736. public:
  737. MinimumRedundancyPollParam (INT id, CHAR* query, INT time, INT poll,
  738. Type type=(Type)NULL) :
  739. ModuleCountsStatusPollParam (id,query, time, poll, type)
  740. { theCurrentState = 0; }
  741. INT ProcessValue(PMessage value, List* events);
  742. };
  743. class CurrentLoadCapabilityPollParam : public ModuleCountsStatusPollParam {
  744. public:
  745. CurrentLoadCapabilityPollParam(INT id, CHAR* query, INT time, INT poll,
  746. Type type=(Type)NULL) :
  747. ModuleCountsStatusPollParam(id,query, time, poll, type)
  748. { theCurrentState = 0; }
  749. INT ProcessValue(PMessage value, List* events);
  750. };
  751. class MaximumLoadCapabilityPollParam : public ModuleCountsStatusPollParam {
  752. public:
  753. MaximumLoadCapabilityPollParam(INT id, CHAR* query, INT time, INT poll,
  754. Type type=(Type)NULL) :
  755. ModuleCountsStatusPollParam(id,query, time, poll, type)
  756. { theCurrentState = 0; }
  757. INT ProcessValue(PMessage value, List* events);
  758. };
  759. class RIMInstallationStatusPollParam : public ModuleCountsStatusPollParam {
  760. public:
  761. RIMInstallationStatusPollParam(INT id, CHAR* query, INT time, INT poll,
  762. Type type=(Type)NULL) :
  763. ModuleCountsStatusPollParam (id,query, time, poll, type)
  764. { theCurrentState = 0; }
  765. INT ProcessValue(PMessage value, List* events);
  766. };
  767. class InputVoltageFrequencyPollParam : public SmartPollParam
  768. {
  769. protected:
  770. static USHORT thePollSet;
  771. public:
  772. InputVoltageFrequencyPollParam(INT id, CHAR* query, INT time, INT poll,
  773. Type type=(Type)NULL) :
  774. SmartPollParam(id,query, time, poll, type, 2)
  775. { theCurrentState = 0;}
  776. virtual ~InputVoltageFrequencyPollParam() { thePollSet = FALSE; }
  777. INT ProcessValue(PMessage value, List* events);
  778. virtual INT IsPollSet();
  779. };
  780. class PhaseAInputVoltagePollParam : public InputVoltageFrequencyPollParam{
  781. public:
  782. PhaseAInputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  783. Type type=(Type)NULL) :
  784. InputVoltageFrequencyPollParam(id,query, time, poll, type)
  785. { theCurrentState = 0; }
  786. INT ProcessValue(PMessage value, List* events);
  787. };
  788. class PhaseBInputVoltagePollParam : public InputVoltageFrequencyPollParam{
  789. public:
  790. PhaseBInputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  791. Type type=(Type)NULL) :
  792. InputVoltageFrequencyPollParam(id,query, time, poll, type)
  793. { theCurrentState = 0; }
  794. INT ProcessValue(PMessage value, List* events);
  795. };
  796. class PhaseCInputVoltagePollParam : public InputVoltageFrequencyPollParam{
  797. public:
  798. PhaseCInputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  799. Type type=(Type)NULL) :
  800. InputVoltageFrequencyPollParam(id,query, time, poll, type)
  801. { theCurrentState = 0; }
  802. INT ProcessValue(PMessage value, List* events);
  803. };
  804. class InputFrequencyPollParam : public InputVoltageFrequencyPollParam{
  805. public:
  806. InputFrequencyPollParam(INT id, CHAR* query, INT time, INT poll,
  807. Type type=(Type)NULL) :
  808. InputVoltageFrequencyPollParam(id,query, time, poll, type)
  809. { theCurrentState = 0; }
  810. INT ProcessValue(PMessage value, List* events);
  811. };
  812. class NumberOfInputPhasesPollParam : public InputVoltageFrequencyPollParam{
  813. public:
  814. NumberOfInputPhasesPollParam(INT id, CHAR* query, INT time, INT poll,
  815. Type type=(Type)NULL) :
  816. InputVoltageFrequencyPollParam (id,query, time, poll, type)
  817. { theCurrentState = 0; }
  818. INT ProcessValue(PMessage value, List* events);
  819. };
  820. class OutputVoltageCurrentsPollParam : public SmartPollParam
  821. {
  822. protected:
  823. static USHORT thePollSet;
  824. public:
  825. OutputVoltageCurrentsPollParam(INT id, CHAR* query, INT time, INT poll,
  826. Type type=(Type)NULL) :
  827. SmartPollParam(id,query, time, poll, type, 2)
  828. { theCurrentState = 0;}
  829. virtual ~OutputVoltageCurrentsPollParam() { thePollSet = FALSE; }
  830. INT ProcessValue(PMessage value, List* events);
  831. virtual INT IsPollSet();
  832. };
  833. class PhaseAOutputVoltagePollParam : public OutputVoltageCurrentsPollParam {
  834. public:
  835. PhaseAOutputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  836. Type type=(Type)NULL) :
  837. OutputVoltageCurrentsPollParam (id,query, time, poll, type)
  838. { theCurrentState = 0; }
  839. INT ProcessValue(PMessage value, List* events);
  840. };
  841. class PhaseBOutputVoltagePollParam : public OutputVoltageCurrentsPollParam{
  842. public:
  843. PhaseBOutputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  844. Type type=(Type)NULL) :
  845. OutputVoltageCurrentsPollParam(id,query, time, poll, type)
  846. { theCurrentState = 0; }
  847. INT ProcessValue(PMessage value, List* events);
  848. };
  849. class PhaseCOutputVoltagePollParam : public OutputVoltageCurrentsPollParam {
  850. public:
  851. PhaseCOutputVoltagePollParam(INT id, CHAR* query, INT time, INT poll,
  852. Type type=(Type)NULL) :
  853. OutputVoltageCurrentsPollParam(id,query, time, poll, type)
  854. { theCurrentState = 0; }
  855. INT ProcessValue(PMessage value, List* events);
  856. };
  857. class NumberOfOutputPhasesPollParam : public OutputVoltageCurrentsPollParam {
  858. public:
  859. NumberOfOutputPhasesPollParam(INT id, CHAR* query, INT time, INT poll,
  860. Type type=(Type)NULL) :
  861. OutputVoltageCurrentsPollParam(id,query, time, poll, type)
  862. { theCurrentState = 0; }
  863. INT ProcessValue(PMessage value, List* events);
  864. };
  865. class NumberBatteryPacksPollParam : public SmartPollParam
  866. {
  867. public:
  868. NumberBatteryPacksPollParam(INT id, CHAR* query, INT time, INT poll,
  869. Type type=(Type)NULL) :
  870. SmartPollParam(id,query, time, poll, type, 3) {}
  871. };
  872. class NumberBadBatteryPacksPollParam : public SmartPollParam
  873. {
  874. public:
  875. NumberBadBatteryPacksPollParam(INT id, CHAR* query, INT time, INT poll,
  876. Type type=(Type)NULL) :
  877. SmartPollParam(id,query, time, poll, type, 3) {}
  878. };
  879. class FanFailurePollParam : public Trip1RegisterPollParam
  880. {
  881. public:
  882. FanFailurePollParam(INT id, CHAR* query, INT time, INT poll,
  883. Type type=(Type)NULL) :
  884. Trip1RegisterPollParam(id,query, time, poll, type) {}
  885. INT ProcessValue(PMessage value, List* events);
  886. };
  887. class BypassPowerSupplyPollParam : public Trip1RegisterPollParam
  888. {
  889. public:
  890. BypassPowerSupplyPollParam(INT id, CHAR* query, INT time, INT poll,
  891. Type type=(Type)NULL) :
  892. Trip1RegisterPollParam(id,query, time, poll, type) {}
  893. INT ProcessValue(PMessage value, List* events);
  894. };
  895. class BypassModePollParam : public TripRegisterPollParam
  896. {
  897. public:
  898. BypassModePollParam(INT id, CHAR* query, INT time, INT poll,
  899. Type type=(Type)NULL) :
  900. TripRegisterPollParam(id,query, time, poll, type) {}
  901. INT ProcessValue(PMessage value, List* events);
  902. };
  903. class MUpsTempPollParam : public SmartPollParam
  904. {
  905. public:
  906. MUpsTempPollParam(INT id, CHAR* query, INT time, INT poll,
  907. Type type=(Type)NULL) :
  908. SmartPollParam(id,query, time, poll, type, 5) {}
  909. INT ProcessValue(PMessage value, List* events);
  910. };
  911. class MUpsHumidityPollParam: public SmartPollParam
  912. {
  913. public:
  914. MUpsHumidityPollParam(INT id, CHAR* query, INT time, INT poll,
  915. Type type=(Type)NULL) :
  916. SmartPollParam(id,query, time, poll, type, 5) {}
  917. INT ProcessValue(PMessage value, List* events);
  918. };
  919. class MUpsContactPosPollParam: public SmartPollParam
  920. {
  921. public:
  922. MUpsContactPosPollParam(INT id, CHAR* query, INT time, INT poll,
  923. Type type=(Type)NULL) :
  924. SmartPollParam(id,query, time, poll, type, 2) {}
  925. INT ProcessValue(PMessage value, List* events);
  926. };
  927. class MUpsFirmwareRevPollParam: public SmartPollParam
  928. {
  929. public:
  930. MUpsFirmwareRevPollParam(INT id, CHAR* query, INT time, INT poll,
  931. Type type=(Type)NULL) :
  932. SmartPollParam(id,query, time, poll, type, 3) {}
  933. INT ProcessValue(PMessage value, List* events);
  934. };
  935. #endif