dynamixel
Version:
Node.js library for controlling DYNAMIXEL servo motors via U2D2 interface with Protocol 2.0 support
77 lines (76 loc) • 2.04 kB
TypeScript
/**
* Enhanced alarm management for DYNAMIXEL devices
* Inspired by DynaNode's alarm system architecture
*/
export class AlarmManager extends EventEmitter<[never]> {
constructor();
alarmHistory: Map<any, any>;
activeAlarms: Map<any, any>;
alarmThresholds: Map<any, any>;
setupDefaultThresholds(): void;
/**
* Process hardware error flags from DYNAMIXEL device
*/
processHardwareError(deviceId: any, errorFlags: any): void;
/**
* Check sensor values against thresholds
*/
checkSensorAlarms(deviceId: any, sensorData: any): void;
/**
* Raise an alarm
*/
raiseAlarm(deviceId: any, alarm: any): void;
/**
* Clear an alarm
*/
clearAlarm(deviceId: any, alarmType: any): void;
/**
* Get active alarms for a device
*/
getActiveAlarms(deviceId: any): any[];
/**
* Get alarm history for a device
*/
getAlarmHistory(deviceId: any, limit?: number): any;
/**
* Get system-wide alarm summary
*/
getAlarmSummary(): {
totalActiveAlarms: number;
alarmsByType: {};
alarmsBySeverity: {
warning: number;
critical: number;
fatal: number;
};
devicesWithAlarms: number;
};
/**
* Update alarm thresholds
*/
setThresholds(type: any, thresholds: any): void;
/**
* Reset all alarms for a device
*/
resetAlarms(deviceId: any): void;
/**
* Get alarm statistics
*/
getStatistics(): {
totalDevices: number;
totalAlarms: number;
averageAlarmsPerDevice: number;
alarmTypes: {};
activeSummary: {
totalActiveAlarms: number;
alarmsByType: {};
alarmsBySeverity: {
warning: number;
critical: number;
fatal: number;
};
devicesWithAlarms: number;
};
};
}
import { EventEmitter } from 'events';