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.

127 lines
4.2 KiB

  1. /*
  2. *
  3. * NOTES:
  4. *
  5. * REVISIONS:
  6. * rct11Dec92 Compiled w/o the managers
  7. * pcy27Dec92 Added the managers
  8. * pcy26Jan92: Added handling of dip switch changed/eeprom access
  9. * ane03Feb93: added destructor
  10. * jod05Apr93: Added changes for Deep Discharge
  11. * cad08Jan94: made firmrevsensor specific type
  12. * pcy08Apr94: Trim size, use static iterators, dead code removal
  13. * jps14Jul94: made ...TimerId LONG
  14. * djs14Mar95: Added OverloadSensor
  15. */
  16. #ifndef _INC__SMARTUPS_H_
  17. #define _INC__SMARTUPS_H_
  18. #include "backups.h"
  19. #include "sensor.h"
  20. #include "battmgr.h"
  21. #include "event.h"
  22. _CLASSDEF(FirmwareRevSensor)
  23. _CLASSDEF(SmartUps)
  24. //-------------------------------------------------------------------
  25. class SmartUps : public BackUps {
  26. public:
  27. SmartUps( PUpdateObj aDeviceController, PCommController aCommController );
  28. virtual ~SmartUps();
  29. virtual INT IsA() const { return SMARTUPS; };
  30. virtual INT Get( INT code, PCHAR value );
  31. virtual INT Set( INT code, const PCHAR value );
  32. virtual INT Update( PEvent event );
  33. virtual VOID GetAllowedValue(INT theSensorCode, CHAR *allowedValue);
  34. protected:
  35. //
  36. // required sensors
  37. //
  38. PSensor theLightsTestSensor;
  39. PFirmwareRevSensor theFirmwareRevSensor;
  40. PDecimalFirmwareRevSensor theDecimalFirmwareRevSensor;
  41. PSensor theUpsModelSensor;
  42. PSensor theUpsSerialNumberSensor;
  43. PSensor theManufactureDateSensor;
  44. PSensor thePutUpsToSleepSensor;
  45. PSensor theBatteryCapacitySensor;
  46. PSensor theSmartBoostSensor;
  47. PSensor theSmartTrimSensor;
  48. PSensor theCopyrightSensor;
  49. PSensor theRunTimeRemainingSensor;
  50. PSensor theNumberBatteryPacksSensor;
  51. PBatteryReplacementManager theBatteryReplacementManager;
  52. PSensor theTripRegisterSensor;
  53. PSensor theTurnOffWithDelaySensor;
  54. PSensor theLowBatteryDurationSensor;
  55. PSensor theShutdownDelaySensor;
  56. virtual VOID HandleLineConditionEvent( PEvent aEvent );
  57. virtual VOID HandleBatteryConditionEvent( PEvent aEvent );
  58. virtual VOID HandleSmartBoostEvent( PEvent aEvent );
  59. virtual VOID HandleSmartTrimEvent( PEvent aEvent );
  60. virtual VOID HandleOverloadConditionEvent( PEvent aEvent );
  61. virtual VOID HandleSelfTestEvent( PEvent aEvent );
  62. virtual VOID HandleBatteryCalibrationEvent( PEvent aEvent );
  63. virtual VOID HandleLightsTestEvent( PEvent aEvent );
  64. virtual INT MakeBatteryCapacitySensor( const PFirmwareRevSensor rev );
  65. virtual INT MakeSmartBoostSensor( const PFirmwareRevSensor rev );
  66. virtual INT MakeSmartTrimSensor( const PFirmwareRevSensor rev );
  67. virtual INT MakeCopyrightSensor( const PFirmwareRevSensor rev );
  68. virtual INT MakeRunTimeRemainingSensor( const PFirmwareRevSensor rev );
  69. virtual INT MakeManufactureDateSensor( const PFirmwareRevSensor rev );
  70. virtual INT MakeLowBatteryDurationSensor( const PFirmwareRevSensor rev );
  71. virtual INT MakeShutdownDelaySensor(const PFirmwareRevSensor rev);
  72. virtual INT MakeUpsSerialNumberSensor( const PFirmwareRevSensor rev );
  73. virtual INT MakeTurnOffWithDelaySensor( const PFirmwareRevSensor rev );
  74. virtual INT MakePutUpsToSleepSensor();
  75. LONG pendingEventTimerId;
  76. PEvent pendingEvent;
  77. virtual VOID registerForEvents();
  78. virtual VOID reinitialize();
  79. VOID setEepromAccess(INT anAccessCode);
  80. INT GetAllAllowedValues(PList ValueList);
  81. INT ParseValues(CHAR* string, PList ValueList);
  82. INT AllowedValuesAreGettable(PSensor theFirmwareRevSensor);
  83. VOID FindAllowedValues(INT code, CHAR *aValue, PFirmwareRevSensor theFirmwareRevSensor );
  84. };
  85. class AllowedValueItem : public Obj
  86. {
  87. protected:
  88. INT theCode;
  89. CHAR theUpsType;
  90. CHAR* theValue;
  91. public:
  92. AllowedValueItem(INT Code,CHAR Type, CHAR* Value);
  93. virtual ~AllowedValueItem();
  94. CHAR GetUpsType() {return theUpsType;}
  95. INT GetUpsCode() {return theCode;}
  96. CHAR* GetValue() {return theValue;}
  97. };
  98. #endif