summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/automate/grafcet.h
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buzz/src/automate/grafcet.h')
-rw-r--r--2003/i/buzz/src/automate/grafcet.h39
1 files changed, 15 insertions, 24 deletions
diff --git a/2003/i/buzz/src/automate/grafcet.h b/2003/i/buzz/src/automate/grafcet.h
index 09b87a1..ba86e87 100644
--- a/2003/i/buzz/src/automate/grafcet.h
+++ b/2003/i/buzz/src/automate/grafcet.h
@@ -17,14 +17,14 @@ class Grafcet
{
public:
// Type d'un élément du grafcet.
- enum GrafcetElemType
+ enum ElemType
{
etape, action, receptivite, transition
};
// Structure des éléments.
- struct GrafcetElem
+ struct Elem
{
- GrafcetElemType type;
+ ElemType type;
union
{
Etape *etape;
@@ -33,29 +33,17 @@ class Grafcet
Transition *transition;
} elem;
// Constructeurs.
- GrafcetElem (Etape *_etape)
- {
- type = etape;
- elem.etape = _etape;
- }
- GrafcetElem (Action *_action)
- {
- type = action;
- elem.action = _action;
- }
- GrafcetElem (Receptivite *_receptivite)
- {
- type = receptivite;
- elem.receptivite = _receptivite;
- }
- GrafcetElem (Transition *_transition)
- {
- type = transition;
- elem.transition = _transition;
- }
+ Elem (Etape *_etape)
+ { type = etape; elem.etape = _etape; }
+ Elem (Action *_action)
+ { type = action; elem.action = _action; }
+ Elem (Receptivite *_receptivite)
+ { type = receptivite; elem.receptivite = _receptivite; }
+ Elem (Transition *_transition)
+ { type = transition; elem.transition = _transition; }
};
// Contient le grafcet complet.
- vector<GrafcetElem> m_grafcet;
+ vector<Elem> m_grafcet;
// Etapes actives.
enum ActiveStep
{
@@ -72,6 +60,9 @@ class Grafcet
~Grafcet ();
// Retourne une référence vers l'instance.
static Grafcet &getInstance () { return *m_instance; }
+ // Lance l'execution d'un pas, c'est à dire, retourne le plus vite
+ // possible.
+ void run (void);
};
}