Init function now saves the Processor state
State enum created as a public property
This commit is contained in:
Binary file not shown.
@@ -30,31 +30,41 @@ namespace artis::factory {
|
||||
|
||||
void Processor::dint(const Time & /* t */) {
|
||||
// TODO
|
||||
// Fonction que gère les évolutions internes de ce modèle
|
||||
}
|
||||
|
||||
void Processor::dext(const Time & /* t */, const Time & /* e */, const Bag &bag) {
|
||||
std::for_each(bag.begin(), bag.end(), [](const ExternalEvent & /* event */) {
|
||||
// TODO
|
||||
// Fonction gérant les réponses du système aux évents passés via event()
|
||||
});
|
||||
}
|
||||
|
||||
void Processor::start(const Time & /* t */) {
|
||||
// TODO
|
||||
void Processor::start(const Time &t) {
|
||||
// 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 {
|
||||
// TODO
|
||||
// Temps passé dans l'état actuel
|
||||
return artis::common::DoubleTime::infinity;
|
||||
}
|
||||
|
||||
Bag Processor::lambda(const Time & /* t */) const {
|
||||
Bag bag;
|
||||
Bag bag;
|
||||
// L'ensemble des sorties de cet objet
|
||||
|
||||
// TODO
|
||||
return bag;
|
||||
}
|
||||
|
||||
artis::common::event::Value Processor::observe(const Time & /* t */, unsigned int /* index */) const {
|
||||
// Print de l'état actuel ?
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +78,19 @@ public:
|
||||
|
||||
artis::common::event::Value observe(const Time &t, unsigned int index) const override;
|
||||
|
||||
enum ProcessorState{
|
||||
INIT,
|
||||
WAIT,
|
||||
LOADING,
|
||||
PROCESSING,
|
||||
UNLOADING,
|
||||
READY
|
||||
};
|
||||
|
||||
private:
|
||||
// TODO (state)
|
||||
ProcessorState currentState;
|
||||
Time startTime;
|
||||
};
|
||||
|
||||
} // namespace artis::factory
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
test/test_simple
BIN
test/test_simple
Binary file not shown.
Reference in New Issue
Block a user