Init function now saves the Processor state

State enum created as a public property
This commit is contained in:
2025-09-29 14:58:35 +02:00
parent 48aae720a9
commit 55688f88d3
6 changed files with 26 additions and 5 deletions

View File

@@ -30,31 +30,41 @@ namespace artis::factory {
void Processor::dint(const Time & /* t */) { void Processor::dint(const Time & /* t */) {
// TODO // TODO
// Fonction que gère les évolutions internes de ce modèle
} }
void Processor::dext(const Time & /* t */, const Time & /* e */, const Bag &bag) { void Processor::dext(const Time & /* t */, const Time & /* e */, const Bag &bag) {
std::for_each(bag.begin(), bag.end(), [](const ExternalEvent & /* event */) { std::for_each(bag.begin(), bag.end(), [](const ExternalEvent & /* event */) {
// TODO // TODO
// Fonction gérant les réponses du système aux évents passés via event()
}); });
} }
void Processor::start(const Time & /* t */) { void Processor::start(const Time &t) {
// TODO // Démarrage et initialisation
this->currentState = this->ProcessorState::INIT; // ID de la phase d'état du modèle
this->startTime = t;
} }
Time Processor::ta(const Time & /* t */) const { Time Processor::ta(const Time & /* t */) const {
// TODO // TODO
// Temps passé dans l'état actuel
return artis::common::DoubleTime::infinity; return artis::common::DoubleTime::infinity;
} }
Bag Processor::lambda(const Time & /* t */) const { Bag Processor::lambda(const Time & /* t */) const {
Bag bag; Bag bag;
// L'ensemble des sorties de cet objet
// TODO // TODO
return bag; return bag;
} }
artis::common::event::Value Processor::observe(const Time & /* t */, unsigned int /* index */) const { artis::common::event::Value Processor::observe(const Time & /* t */, unsigned int /* index */) const {
// Print de l'état actuel ?
return {}; return {};
} }

View File

@@ -78,8 +78,19 @@ public:
artis::common::event::Value observe(const Time &t, unsigned int index) const override; artis::common::event::Value observe(const Time &t, unsigned int index) const override;
enum ProcessorState{
INIT,
WAIT,
LOADING,
PROCESSING,
UNLOADING,
READY
};
private: private:
// TODO (state) // TODO (state)
ProcessorState currentState;
Time startTime;
}; };
} // namespace artis::factory } // namespace artis::factory

Binary file not shown.

Binary file not shown.