-
Notifications
You must be signed in to change notification settings - Fork 1
Array + linked list #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Guida per il Revisore di SourceryQuesta pull request refactorizza il sistema di gestione dei dispositivi per utilizzare una lista concatenata, migliora la gestione degli errori e aggiunge funzionalità per visualizzare le statistiche di consumo energetico. Diagramma di sequenza per la visualizzazione del consumo energetico del dispositivosequenceDiagram
participant Client
participant LinkedList
participant Node
participant Dispositivo
Client->>LinkedList: show(deviceName)
LinkedList->>LinkedList: isEmpty()
alt is empty
LinkedList-->>Client: throw out_of_range
else has devices
LinkedList->>LinkedList: searchDispositivoName(deviceName)
LinkedList->>Node: get device
Node->>Dispositivo: calcolaConsumoEnergetico()
Dispositivo-->>Client: return energy consumption
end
Diagramma delle classi per la gestione di LinkedList e DispositiviclassDiagram
class LinkedList {
-Node* head
+insert(Dispositivo)
+removeDispositivoName(string)
+removeAllDispositiviOff(int)
+removeTimer(string)
+removeAllTimers()
+isEmpty(): bool
+show(string): double
+showAll(): string
+~LinkedList()
}
class Node {
+Dispositivo* disp
+Node* next
}
class Dispositivo {
+getNome(): string
+getOrarioSpegnimento()
+calcolaConsumoEnergetico(): double
}
LinkedList "1" o-- "*" Node : contains
Node "1" --> "1" Dispositivo : has
note for LinkedList "Aggiunti nuovi metodi show() e showAll() per le statistiche di consumo energetico"
Modifiche a Livello di File
Suggerimenti e comandiInterazione con Sourcery
Personalizzazione della Tua EsperienzaAccedi alla tua dashboard per:
Ottenere Aiuto
Original review guide in EnglishReviewer's Guide by SourceryThis pull request refactors the device management system to use a linked list, improves error handling, and adds functionality to display energy consumption statistics. Sequence diagram for device energy consumption displaysequenceDiagram
participant Client
participant LinkedList
participant Node
participant Dispositivo
Client->>LinkedList: show(deviceName)
LinkedList->>LinkedList: isEmpty()
alt is empty
LinkedList-->>Client: throw out_of_range
else has devices
LinkedList->>LinkedList: searchDispositivoName(deviceName)
LinkedList->>Node: get device
Node->>Dispositivo: calcolaConsumoEnergetico()
Dispositivo-->>Client: return energy consumption
end
Class diagram for LinkedList and Device managementclassDiagram
class LinkedList {
-Node* head
+insert(Dispositivo)
+removeDispositivoName(string)
+removeAllDispositiviOff(int)
+removeTimer(string)
+removeAllTimers()
+isEmpty(): bool
+show(string): double
+showAll(): string
+~LinkedList()
}
class Node {
+Dispositivo* disp
+Node* next
}
class Dispositivo {
+getNome(): string
+getOrarioSpegnimento()
+calcolaConsumoEnergetico(): double
}
LinkedList "1" o-- "*" Node : contains
Node "1" --> "1" Dispositivo : has
note for LinkedList "Added new methods show() and showAll() for energy consumption stats"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Riepilogo di Sourcery
Aggiunta del supporto per il calcolo e la visualizzazione del consumo energetico dei singoli dispositivi e del consumo energetico totale di tutti i dispositivi.
Nuove Funzionalità:
showper visualizzare il consumo energetico di un dispositivo specifico.Test:
Original summary in English
Summary by Sourcery
Add support for calculating and displaying the energy consumption of individual devices and the total energy consumption of all devices.
New Features:
showfunction to display the energy consumption of a specific device.Tests: