UNPKG

@ekamjotsingh.ek/energy-management-system

Version:
18 lines (15 loc) 564 B
// Class to represent a data point in the system export default class DataPoint { dataPointID: string; timestamp: Date; energyUsage: number; constructor(dataPointID: string, timestamp: Date, energyUsage: number) { this.dataPointID = dataPointID; this.timestamp = timestamp; this.energyUsage = energyUsage; } // Simulate viewing data point information viewData(): void { console.log(`DataPoint ${this.dataPointID} at ${this.timestamp.toISOString()}: ${this.energyUsage} kWh.`); } }