IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Eclipse Modeling Discussion :

Outils Eclipse de transformation texte vers modèle


Sujet :

Eclipse Modeling

  1. #1
    Candidat au Club
    Femme Profil pro
    Enseignant
    Inscrit en
    janvier 2016
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : Algérie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : janvier 2016
    Messages : 3
    Points : 4
    Points
    4
    Par défaut Outils Eclipse de transformation texte vers modèle
    Bonjour,

    J'ai un mémoire à réaliser concernant la transformation d'une spécification B vers un fichier XMI puis vers un diagramme UML.

    Quelqu'un saurait-il me guider un peu dans ce processus ?

    Quels outils Eclipse puis-je utiliser ?

    Merci d'avance pour votre aide.

  2. #2
    Membre expérimenté
    Avatar de azerr
    Homme Profil pro
    Ingénieur Etude JEE/Eclipse RCP
    Inscrit en
    avril 2006
    Messages
    942
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Drôme (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur Etude JEE/Eclipse RCP
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : avril 2006
    Messages : 942
    Points : 1 464
    Points
    1 464
    Par défaut
    Bonjour,

    Essaie de regarder vers https://eclipse.org/MoDisco/ mais ca va demander beaucoup d'investissement.

    Bon courage

    Angelo

  3. #3
    Candidat au Club
    Femme Profil pro
    Enseignant
    Inscrit en
    janvier 2016
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : Algérie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : janvier 2016
    Messages : 3
    Points : 4
    Points
    4
    Par défaut
    Désolée, je veux faire cette transformation avec des outils standards comme Xtext et Xtend sous Eclipse.

    J'ai commencé avec le développement de la grammaire du DSL (Domain Specific Language) sous Xtext, concernant la méthode B, mais quand je veux faire l'exécution du projet et test de saisie d'un programme, ça ne fonctionne pas. Il y a un problème dans mon test.

    Voilà mon DSL :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    grammar org.xtext.memoire.bmethod.Bmethod with org.eclipse.xtext.common.Terminals
     
    generate bmethod "http://www.xtext.org/memoire/bmethod/Bmethod"
     
    BMethod:
    name=ID
    (compose+=MACHINE)+
    (herite+= REFINEMENT)*
    (types+= Types)?
    ;
    MACHINE:
    REFINES|INCLUDES|EXTENDES|USES|SEES|
    (operation+=OPERATION)*
    (predicat+=PREDICAT)*
    (initialisation+=INITIALISATION)?
    (donnes+=DATA)+
    (define+=DEFINITION)?
    ;
    REFINES:'rafines' name=ID;
    INCLUDES: 'includes' name=ID;
    EXTENDES:'extendes' name=ID;
    USES:'uses'name=ID;
    SEES:'sees'name=ID;
    Types:(sets+=SETS)*;
    SETS: 'sets'name=STRING ';'|name=STRING'=''{'(valeur+=CONSTANTS)+'}'';'
    ;
    CONSTANTS:'constants' val=STRING;
    DATA:CONSTANTS|SETS;
    REFINEMENT:'REFINEMENT' name=ID (refine=REFINES);
    PREDICAT:Expression=STRING (ExpressionPrd+=EXPRESSION)+|VARIABLES|INVARIANT|PROPERTTIES;
    PROPERTTIES:'PROPERTTIES'Expression=STRING;
    VARIABLES:'VARIABLES'Expression=STRING valvariables=STRING;
    INVARIANT:'INVARIANT'Expression=STRING ;
    INITIALISATION:'INITIALISATION'ExpressionINITIALISATION=STRING (ExpIN=EXPRESSION)+|ANY;
    DEFINITION:'DEFINITION'(def+=VARIABLES)+'==''('defconstant=CONSTANTS '..'defconstant=CONSTANTS')';
    OPERATION:'OERATION' Expression=STRING
     
    (syntoperation+=SYNTAXE)+;
    ANY :'ANY' var=STRING (varAny+=VARIABLES)+|WHERE|THEN 'END';
    WHERE:'WHERE' syntaxewhere=STRING (expwhere+=EXPRESSION)+;
    THEN:'THEN'synthen=STRING (expTHEN+=EXPRESSION);
    SELECT:'SELECT' synselect=STRING (expSELECT+=EXPRESSION)+|THEN|ELSE|ANY;
    ELSE:'ELSE' synELES=STRING 'SKIP' 'END';
    PRE:'PRE' syntaxePre=STRING (ExpPre+=EXPRESSION)+|THEN'END'|THEN|SELECT 'END'|ANY'END'|WHEN 'END';
    WHEN:'WHEN' syntaxeWhen=STRING (Expwhen+=EXPRESSION)+|THEN|ELSE;
    IF:'IF'syntaxeIf=STRING (ExpIf=EXPRESSION)+|THEN'END'|ELSE 'END'|BEGIN 'END'|ELSIF 'END'|VAR 'END';
    BEGIN:'BEGIN'syntaxeBEGIN=STRING (ExpBegin+=EXPRESSION)+ 'END'|ELSIF|ELSE;
    ELSIF:'ELSIF' syntaxeElsif=STRING (ExpElsif+=EXPRESSION)+|ELSE;
    VAR:'VAR'syntaxeVar=STRING (ExpVar+=VARIABLES)+|IN|'IF' syntaxeIf=STRING (ExpIff+=EXPRESSION)+|THEN'END' ;
    IN:'IN' syntaxeIn=STRING (ExpIn+=EXPRESSION)+;
    SYNTAXE:IF|THEN|ELSE|ELSIF|ANY|WHERE|WHEN|VAR|IN|PRE|SELECT|BEGIN;
    EXPRESSION: CONSTANTS|VARIABLES|SETS|OPERATEUR;
    OPERATEUR:name='<:'|name='*'|name=':='|name='{'|name='}'|name='=='|name='='|name='('|name=')'|name=','|name=';'|name='&'|name='|->'|name='-'|name='-->'|name='=>'|name='~'|name='['|name=']'|name='!';
    et voila mon test:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    /* Aggregat
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Aggregat
    SEES
    Types
    USES
    Clutch,
    Gun,
    Holster,
    Motor,
    Pump,
    Display
    VARIABLES
    clutchPump,
    gunPump,
    holsterPump,
    motorPump,
    displayPump
    INVARIANT
    clutchPump&#8712; pump >->> clutch &#8743;
    gunPump&#8712; pump >->> gun &#8743;
    holsterPump&#8712; pump >->> holster &#8743;
    motorPump&#8712; pump >->> motor &#8743;
    displayPump&#8712; pump >->> display
    INITIALISATION
    ANY cp,gp,hp,mp,dp WHERE
    cp&#8712; pump >->> clutch &#8743;
    gp&#8712; pump >->> gun &#8743;
    hp&#8712; pump >->> holster &#8743;
    mp&#8712; pump >->> motor &#8743;
    dp&#8712; pump >->> display
    THEN
    clutchPump := cp ||
    gunPump := gp ||
    holsterPump := hp ||
    motorPump := mp ||
    displayPump := dp
    END
    OPERATIONS
    cc &#8592;clutchOfPump(pp) =
    PRE
    pp &#8712; pump
    THEN
    cc :=clutchPump(pp)
    END;
    dd&#8592;displayOfPump(pp) =
    PRE
    pp &#8712; pump
    THEN
    dd := displayPump(pp)
    END;
    gg&#8592;gunOfPump(pp) =
    PRE
    pp &#8712; pump
    THEN
    gg := gunPump(pp)
    END;
    mm&#8592;motorOfPump(pp) =
    PRE
    pp &#8712; pump
    THEN
    mm := motorPump(pp)
    END;
    pp &#8592;pumpOfGun(gg) =
    PRE
    gg&#8712; gun
    THEN
    pp := gunPump&#8315(gg)
    END;
    pp &#8592;pumpOfHolster(hh) =
    PRE
    hh&#8712; holster
    THEN
    pp := holsterPump&#8315(hh)
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    /* BasicMachine
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    BasicMachine
    SEES
    Types
    INCLUDES
    Pump,
    Clutch,
    Gun,
    Holster,
    Motor,
    Display,
    Aggregat,
    Delivery
    PROMOTES
    clutch_free,
    clutch_engage,
    gun_enable,
    gun_disable,
    gun_is_Enabled,
    gun_depress_Trigger_Local,
    gun_release_Trigger_Local,
    holster_depress,
    holster_release,
    motor_start,
    motor_stop,
    pump_idOfPump,
    pump_pumpOfId,
    pump_is_Enabled,
    pump_is_Disabled,
    pump_enable_Local,
    pump_disable_Local,
    display_reset,
    display_read_Display,
    display_pulse,
    delivery_create_Delivery,
    clutchOfPump,
    displayOfPump,
    gunOfPump,
    motorOfPump,
    pumpOfGun,
    pumpOfHolster
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    /* Clutch
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Clutch
    SEES
    Types
    VARIABLES
    clutch, clutch_status
    INVARIANT
    clutch&#8838; CLUTCH &#8743;
    clutch_status&#8712; clutch &#8594; C_STATUS
    INITIALISATION
    ANY cc WHERE
    cc &#8838; CLUTCH &#8743;
    card(cc) = 5
    THEN
    clutch := cc ||
    clutch_status := cc * {c_status_free}
    END
    OPERATIONS
    clutch_free(cc) =
    PRE
    cc &#8712; clutch
    THEN
    clutch_status(cc) := c_status_free
    END;
    clutch_engage(cc) =
    PRE
    cc &#8712; clutch
    THEN
    clutch_status(cc) := c_status_engaged
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    /* Delivery
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Delivery
    SEES
    Types
    USES
    Pump
    VARIABLES
    delivery,
    delivery_cost,
    delivery_volume,
    delivery_grade,
    delivery_pump_Id,
    delivery_veh_Id
    INVARIANT
    delivery&#8838; DELIVERY &#8743;
    delivery_cost&#8712; delivery &#8594; COST &#8743;
    delivery_volume&#8712; delivery &#8594; NAT &#8743;
    delivery_grade&#8712; delivery &#8594; GRADE &#8743;
    &#8704; deli.(deli &#8712; delivery &#8658;delivery_grade(deli) &#8614;delivery_cost(deli) &#8712;
    costOfGrade) &#8743;delivery_pump_Id&#8712; delivery &#8594; PU_ID &#8743;
    delivery_veh_Id&#8712; delivery &#8594; VEH_ID
    INITIALISATION
    delivery,
    delivery_cost,
    delivery_volume,
    delivery_grade,
    delivery_pump_Id,
    delivery_veh_Id := &#8709;,&#8709;,&#8709;,&#8709;,&#8709;,&#8709;
    OPERATIONS
    new&#8592;delivery_create_Delivery(cc,vv,gg,pi,vi) =
    PRE
    cc &#8712; COST &#8743;
    vv&#8712; NAT &#8743;
    gg&#8712; GRADE &#8743;
    gg&#8614; cc &#8712;costOfGrade&#8743;
    pi&#8712; ran(pump_pump_Id) &#8743;
    vi&#8712; VEH_ID
    THEN
    ANY dd WHERE
    dd&#8712; DELIVERY
    THEN
    delivery := delivery &#8746; {dd} ||
    delivery_cost(dd) := cc ||
    delivery_grade(dd) := gg ||
    delivery_volume(dd) := vv ||
    delivery_pump_Id(dd) := pi ||
    delivery_veh_Id(dd) := vi ||
    new := dd
    END
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    /* Display
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Display
    SEES
    Types
    VARIABLES
    display,
    display_cost,
    display_volume,
    display_grade,
    display_veh_Id
    INVARIANT
    display&#8838; DISPLAY &#8743;
    display_cost&#8712; display &#8594; COST &#8743;
    display_volume&#8712; display &#8594; NAT &#8743;
    display_grade&#8712; display &#8594; GRADE &#8743;
    &#8704; disp.(disp&#8712; display
    &#8658;display_grade(disp) &#8614;display_cost(disp) &#8712;costOfGrade) &#8743;
    display_veh_Id&#8712; display &#8594; VEH_ID
    INITIALISATION
    ANY dd,vi WHERE
    dd&#8838; DISPLAY &#8743;
    card(dd) = 5 &#8743;
    vi&#8712; VEH_ID
    THEN
    display := dd ||
    display_cost := dd * {cost1} ||
    display_volume := dd * {0} ||
    display_grade := dd * {grade1} ||
    display_veh_Id := dd * {vi}
    END
    OPERATIONS
    display_reset(dd,gg,vi) =
    PRE
    dd&#8712; display &#8743;
    gg&#8712; GRADE &#8743;
    vi&#8712; VEH_ID
    THEN
    display_grade(dd) := gg ||
    display_volume(dd) := 0 ||
    display_cost(dd) := costOfGrade(gg)||
    display_veh_Id(dd) := vi
    END;
    display_pulse(dd) =
    PRE
    dd&#8712; display
    THEN
    IF display_volume(dd) < MAXINT THEN
    display_volume(dd) := display_volume(dd) + 1
    ELSE
    skip
    END
    END;
    cc,vv,gg,vi&#8592;display_read_Display(dd) =
    PRE
    dd&#8712; display
    THEN
    cc :=display_cost(dd) ||
    vv := display_volume(dd) ||
    gg := display_grade(dd)||
    vi := display_veh_Id(dd)
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
     
    /* Gun
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Gun
    SEES
    Types
    VARIABLES
    gun,gun_status,gun_trigger
    INVARIANT
    gun&#8838; GUN &#8743;
    gun_status&#8712; gun &#8594; PG_STATUS &#8743;
    gun_trigger&#8712; gun &#8594; TH_STATUS
    INITIALISATION
    ANY gg WHERE
    gg&#8838; GUN &#8743;
    card(gg) =5
    THEN
    gun := gg ||
    gun_status := gg * {pg_status_disabled} ||
    gun_trigger := gg * {th_status_released}
    END
    OPERATIONS
    gun_enable(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_status(gg) := pg_status_enabled
    END;
    gun_disable(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_status(gg) := pg_status_disabled
    END;
    en&#8592;gun_is_Enabled(gg) =
    PRE
    gg&#8712; gun
    THEN
    en := bool(gun_status(gg) = pg_status_enabled)
    END;
    gun_depress_Trigger_Local(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_trigger(gg) := th_status_depressed
    END;
    gun_release_Trigger_Local(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_trigger(gg) := th_status_released
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    /* Holster
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Holster
    SEES
    Types
    VARIABLES
    holster,holster_switch
    INVARIANT
    holster&#8838; HOLSTER &#8743;
    holster_switch&#8712; holster &#8594; TH_STATUS
    INITIALISATION
    ANY hh WHERE
    hh&#8838; HOLSTER &#8743;
    card(hh) = 5
    THEN
    holster := hh ||
    holster_switch := hh * {th_status_released}
    END
    OPERATIONS
    holster_release(hh) =
    PRE
    hh&#8712; holster &#8743;
    holster_switch(hh) = th_status_depressed
    THEN
    holster_switch(hh) := th_status_released
    END;
    holster_depress(hh) =
    PRE
    hh&#8712; holster &#8743;
    holster_switch(hh) = th_status_released
    THEN
    holster_switch(hh) := th_status_depressed
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    /* IntermediateMachine
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    IntermediateMachine
    SEES
    Types
    VARIABLES
    clutch,
    clutch_status,
    gun,
    gun_status,
    gun_trigger,
    holster,
    holster_switch,
    motor,
    motor_status,
    pump,
    pump_pump_Id,
    pump_status,
    delivery,
    delivery_cost,
    delivery_volume,
    delivery_grade,
    delivery_pump_Id,
    delivery_veh_Id,
    display,
    display_cost,
    display_volume,
    display_grade,
    display_veh_Id,
    clutchPump,
    gunPump,
    holsterPump,
    motorPump,
    displayPump
    INVARIANT
    clutch&#8838; CLUTCH &#8743;
    clutch_status&#8712; clutch &#8594; C_STATUS &#8743;
    gun&#8838; GUN &#8743;
    gun_status&#8712; gun &#8594; PG_STATUS &#8743;
    gun_trigger&#8712; gun &#8594; TH_STATUS &#8743;
    holster&#8838; HOLSTER &#8743;
    holster_switch&#8712; holster &#8594; TH_STATUS &#8743;
    motor&#8838; MOTOR &#8743;
    motor_status&#8712; motor &#8594; M_STATUS &#8743;
    pump&#8838; PUMP &#8743;
    pump_pump_Id&#8712; pump &#8611; PU_ID &#8743;
    pump_status&#8712; pump &#8594; PG_STATUS &#8743;
    delivery&#8838; DELIVERY &#8743;
    delivery_cost&#8712; delivery &#8594; COST &#8743;
    delivery_volume&#8712; delivery &#8594; NAT &#8743;
    delivery_grade&#8712; delivery &#8594; GRADE &#8743;
    &#8704; deli.(deli &#8712; delivery &#8658;delivery_grade(deli) &#8614;delivery_cost(deli)
    &#8712;costOfGrade) &#8743;
    delivery_pump_Id&#8712; delivery &#8594; PU_ID &#8743;
    delivery_veh_Id&#8712; delivery &#8594; VEH_ID &#8743;
    display&#8838; DISPLAY &#8743;
    display_cost&#8712; display &#8594; COST &#8743;
    display_volume&#8712; display &#8594; NAT &#8743;
    display_grade&#8712; display &#8594; GRADE &#8743;
    &#8704; disp.(disp&#8712; display &#8658;display_grade(disp) &#8614;display_cost(disp) &#8712;costOfGrade) &#8743;
    display_veh_Id&#8712; display &#8594; VEH_ID &#8743;
    clutchPump&#8712; pump >->> clutch &#8743;
    gunPump&#8712; pump >->> gun &#8743;
    holsterPump&#8712; pump >->> holster &#8743;
    motorPump&#8712; pump >->> motor &#8743;
    displayPump&#8712; pump >->> display
    INITIALISATION
    ANY cc,dd,gg,hh,mm,pp,vi WHERE
    cc &#8838; CLUTCH &#8743;
    card(cc) = 5 &#8743;
    dd&#8838; DISPLAY &#8743;
    card(dd) = 5 &#8743;
    gg&#8838; GUN &#8743;
    card(dd) = 5 &#8743;
    hh&#8838; HOLSTER &#8743;
    card(hh) = 5 &#8743;
    mm&#8838; MOTOR &#8743;
    card(mm) = 5 &#8743;
    pp &#8838; PUMP &#8743;
    card(pp) = 5 &#8743;
    vi&#8712; VEH_ID
    THEN
    clutch := cc ||
    clutch_status := cc * {c_status_free}||
    gun := gg||
    gun_status := gg * {pg_status_disabled} ||
    gun_trigger := gg * {th_status_released}||
    holster := hh ||
    holster_switch := hh * {th_status_released} ||
    motor := mm ||
    motor_status := mm * {m_status_off} ||
    ANY pi WHERE
    pi&#8712; pp &#8611; PU_ID
    THEN
    pump := pp ||
    pump_pump_Id := pi ||
    pump_status := pp * {pg_status_disabled}
    END ||
    display := dd ||
    display_cost := dd * {cost1} ||
    display_volume := dd * {0} ||
    display_grade := dd * {grade1} ||
    display_veh_Id := dd * {vi} ||
    ANY cp,gp,hp,mp,dp WHERE
    cp&#8712; pp >->> cc &#8743;
    gp&#8712; pp >->>gg&#8743;
    hp&#8712; pp >->>hh&#8743;
    mp&#8712; pp >->> mm &#8743;
    dp&#8712; pp >->>dd
    THEN
    clutchPump := cp ||
    gunPump := gp ||
    holsterPump := hp ||
    motorPump := mp ||
    displayPump := dp
    END
    END ||
     
     
    delivery,
    delivery_cost,
    delivery_volume,
    delivery_grade,
    delivery_pump_Id,
    delivery_veh_Id := &#8709;,&#8709;,&#8709;,&#8709;,&#8709;,&#8709;
    OPERATIONS
    pump_enable(pp,gg,vi) =
    PRE
    pp &#8712; pump &#8743;
    gg&#8712; GRADE &#8743;
    vi&#8712; VEH_ID
    THEN
    IF pump_status(pp) = pg_status_disabled THEN
    pump_status(pp) := pg_status_enabled ||
    display_grade(displayPump(pp)) := gg ||
    display_cost(displayPump(pp)) := costOfGrade(gg) ||
    display_volume(displayPump(pp)) := 0 ||
    display_veh_Id(displayPump(pp)) := vi ||
    motor_status(motorPump(pp)) := m_status_on ||
    clutch_status(clutchPump(pp)) := c_status_free
    ELSE
    skip
    END
    END;
    pump_delivery_Complete(pp) =
    PRE
    pp &#8712; pump &#8743;
    pump_status(pp) = pg_status_enabled
    THEN
    pump_status(pp) := pg_status_disabled ||
    ANY dd WHERE
    dd&#8712; DELIVERY
    THEN
    delivery := delivery &#8746; {dd} ||
    delivery_cost(dd) := display_cost(displayPump(pp)) ||
    delivery_grade(dd) := display_grade(displayPump(pp)) ||
    delivery_volume(dd) := display_volume(displayPump(pp)) ||
    delivery_pump_Id(dd) := pump_pump_Id(pp) ||
    delivery_veh_Id(dd) := display_veh_Id(displayPump(pp)) ||
    motor_status(motorPump(pp)) := m_status_off
    END
    END;
    pp &#8592;pump_pumpOfId_Dum(pi) =
    PRE
    pi&#8712; PU_ID &#8743;
    pi&#8712; ran(pump_pump_Id)
    THEN
    pp := pump_pump_Id&#8315(pi)
    END;
    bb&#8592;pump_is_Enabled_Dum(pp) =
    PRE
    pp &#8712; pump
    THEN
    bb := bool(pump_status(pp) = pg_status_enabled)
    END;
    gun_enable_Dum(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_status(gg) := pg_status_enabled
    END;
    gun_disable_Dum(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_status(gg) := pg_status_disabled
    END;
    en&#8592;gun_is_Enabled_Dum(gg) =
    PRE
    gg&#8712; gun
    THEN
    en := bool(gun_status(gg) = pg_status_enabled)
    END;
    gun_depress_Trigger_Local_Dum(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_trigger(gg) := th_status_depressed
    END;
    gun_release_Trigger_Local_Dum(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_trigger(gg) := th_status_released
    END;
    clutch_free_Dum(cc) =
    PRE
    cc &#8712; clutch
    THEN
    clutch_status(cc) := c_status_free
    END;
    clutch_engage_Dum(cc) =
    PRE
    cc &#8712; clutch
    THEN
    clutch_status(cc) := c_status_engaged
    END;
    holster_release_Dum(hh) =
    PRE
    hh&#8712; holster &#8743;
    holster_switch(hh) = th_status_depressed
    THEN
    holster_switch(hh) := th_status_released
    END;
    holster_depress_Dum(hh) =
    PRE
    hh&#8712; holster &#8743;
    holster_switch(hh) = th_status_released
    THEN
    holster_switch(hh) := th_status_depressed
    END;
    cc &#8592;clutchOfPump_Dum(pp) =
    PRE
    pp &#8712; pump
    THEN
    cc :=clutchPump(pp)
    END;
    gg&#8592;gunOfPump_Dum(pp) =
    PRE
    pp&#8712;pump
    THEN
    gg :=gunPump(pp)
    END;
    pp &#8592;pumpOfGun_Dum(gg) =
    PRE
    gg&#8712; gun
    THEN
    pp := gunPump&#8315(gg)
    END;
    pp &#8592;pumpOfHolster_Dum(hh) =
    PRE
    hh&#8712; holster
    THEN
    pp := holsterPump&#8315(hh)
    END;
    display_pulse_Dum(disp) =
    PRE
    disp&#8712; display
    THEN
    IF display_volume(disp) < MAXINT THEN
    display_volume(disp) := display_volume(disp) + 1
    ELSE
    skip
    END
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    /* IntermediateMachine_imp
    * Author: siat555
    * Creation date: 19/12/2015
    */
     
    IMPLEMENTATION IntermediateMachine_imp
    REFINES IntermediateMachine
     
    SEES
    Types
    IMPORTS
    BasicMachine
    OPERATIONS
    pump_enable(pp,gg,vi) =
    VAR
    pe,dd,mm,cc
    IN
    pe&#8592;pump_is_Disabled(pp);
    IF
    pe = TRUE THEN
    pump_enable_Local(pp);
    dd&#8592;displayOfPump(pp);
    display_reset(dd,gg,vi);
    mm&#8592;motorOfPump(pp);
    motor_start(mm);
    cc &#8592;clutchOfPump(pp);
    clutch_free(cc)
    ELSE
    skip
    END
    END;
    pump_delivery_Complete(pp) =
    VAR
    disp,cc,vv,gg,pi,dd,mm,vi
    IN
    pump_disable_Local(pp);
    disp&#8592;displayOfPump(pp);
    cc,vv,gg,vi&#8592;display_read_Display(disp);
    pi&#8592;pump_idOfPump(pp);
    dd&#8592;delivery_create_Delivery(cc,vv,gg,pi,vi);
    mm&#8592;motorOfPump(pp);
    motor_stop(mm)
    END;
    pp &#8592;pump_pumpOfId_Dum(pi) =
    pp &#8592;pump_pumpOfId(pi);
    bb&#8592;pump_is_Enabled_Dum(pp) =
    bb&#8592;pump_is_Enabled(pp);
    gun_enable_Dum(gg) =
    gun_enable(gg);
    gun_disable_Dum(gg) =
    gun_disable(gg);
    en&#8592;gun_is_Enabled_Dum(gg) =
    en&#8592;gun_is_Enabled(gg);
    gun_depress_Trigger_Local_Dum(gg) =
    gun_depress_Trigger_Local(gg);
    gun_release_Trigger_Local_Dum(gg) =
    gun_release_Trigger_Local(gg);
    clutch_free_Dum(cc) =
    clutch_free(cc);
    clutch_engage_Dum(cc) =
    clutch_engage(cc);
    holster_release_Dum(hh) =
    holster_release(hh);
    holster_depress_Dum(hh) =
    holster_depress(hh);
    cc &#8592;clutchOfPump_Dum(pp) =
    cc &#8592;clutchOfPump(pp);
    gg&#8592;gunOfPump_Dum(pp) =
    gg&#8592;gunOfPump(pp);
    pp &#8592;pumpOfGun_Dum(gg) =
    pp &#8592;pumpOfGun(gg);
    pp &#8592;pumpOfHolster_Dum(hh) =
    pp &#8592;pumpOfHolster(hh);
    display_pulse_Dum(disp) =
    display_pulse(disp)
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    /* Motor
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Motor
    SEES
    Types
    VARIABLES
    motor,motor_status
    INVARIANT
    motor&#8838; MOTOR &#8743;
    motor_status&#8712; motor &#8594; M_STATUS
    INITIALISATION
    ANY mm WHERE
    mm&#8838; MOTOR &#8743;
    card(mm) = 5
    THEN
    motor := mm ||
    motor_status := mm * {m_status_off}
    END
    OPERATIONS
    motor_start(mm) =
    PRE
    mm&#8712; motor
    THEN
    motor_status(mm) := m_status_on
    END;
    motor_stop(mm) =
    PRE
    mm&#8712; motor
    THEN
    motor_status(mm) := m_status_off
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /* Pump
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Pump
    SEES
    Types
    VARIABLES
    pump,
    pump_pump_Id,
    pump_status
    INVARIANT
    pump&#8838; PUMP &#8743;
    pump_pump_Id&#8712; pump &#8611; PU_ID &#8743;
    pump_status&#8712; pump &#8594; PG_STATUS
    INITIALISATION
    ANY pp,pi WHERE
    pp &#8838; PUMP &#8743;
    card(pp) = 5 &#8743;
    pi&#8712; pp &#8611; PU_ID
    THEN
    pump := pp ||
    pump_pump_Id := pi ||
    pump_status := pp * {pg_status_disabled}
    END
    OPERATIONS
    pp &#8592;pump_pumpOfId(pi) =
    PRE
    pi&#8712; PU_ID &#8743;
    pi&#8712; ran(pump_pump_Id)
    THEN
    pp := pump_pump_Id&#8315(pi)
    END;
    ip&#8592;pump_idOfPump(pp) =
    PRE
    pp &#8712; pump
    THEN
    ip := pump_pump_Id(pp)
    END;
    bb&#8592;pump_is_Enabled(pp) =
    PRE
    pp &#8712; pump
    THEN
    bb := bool(pump_status(pp) = pg_status_enabled)
    END;
    bb&#8592;pump_is_Disabled(pp) =
    PRE
    pp &#8712; pump
    THEN
    bb := bool(pump_status(pp) = pg_status_disabled)
    END;
    pump_enable_Local(pp) =
    PRE
    pp &#8712; pump &#8743;
    pump_status(pp) = pg_status_disabled
    THEN
    pump_status(pp) := pg_status_enabled
    END;
    pump_disable_Local(pp) =
    PRE
    pp &#8712; pump
    THEN
    pump_status(pp) := pg_status_disabled
    END
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    /* SystemMachine
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    SystemMachine
    SEES
    Types
    VARIABLES
    clutch,
    clutch_status,
    gun,
    gun_status,
    gun_trigger,
    holster,
    holster_switch,
    motor,
    motor_status,
    pump,
    pump_pump_Id,
    pump_status,
    delivery,
    delivery_cost,
    delivery_volume,
    delivery_grade,
    delivery_pump_Id,
    delivery_veh_Id,
    display,
    display_cost,
    display_volume,
    display_grade,
    display_veh_Id,
    clutchPump,
    gunPump,
    holsterPump,
    motorPump,
    displayPump
    INVARIANT
    clutch&#8838; CLUTCH &#8743;
    clutch_status&#8712; clutch &#8594; C_STATUS &#8743;
    gun&#8838; GUN &#8743;
    gun_status&#8712; gun &#8594; PG_STATUS &#8743;
    gun_trigger&#8712; gun &#8594; TH_STATUS &#8743;
    holster&#8838; HOLSTER &#8743;
    holster_switch&#8712; holster &#8594; TH_STATUS &#8743;
    motor&#8838; MOTOR &#8743;
    motor_status&#8712; motor &#8594; M_STATUS &#8743;
    pump&#8838; PUMP &#8743;
    pump_pump_Id&#8712; pump &#8611; PU_ID &#8743;
    pump_status&#8712; pump &#8594; PG_STATUS &#8743;
    delivery&#8838; DELIVERY &#8743;
    delivery_cost&#8712; delivery &#8594; COST &#8743;
    delivery_volume&#8712; delivery &#8594; NAT &#8743;
    delivery_grade&#8712; delivery &#8594; GRADE &#8743;
    &#8704; deli.(deli &#8712; delivery &#8658;delivery_grade(deli) &#8614;delivery_cost(deli) &#8712;costOfGrade) &#8743;
    delivery_pump_Id&#8712; delivery &#8594; PU_ID &#8743;
    delivery_veh_Id&#8712; delivery &#8594; VEH_ID &#8743;
    display&#8838; DISPLAY &#8743;
    display_cost&#8712; display &#8594; COST &#8743;
    display_volume&#8712; display &#8594; NAT &#8743;
    display_grade&#8712; display &#8594; GRADE &#8743;
    &#8704; disp.(disp&#8712; display &#8658;display_grade(disp) &#8614;display_cost(disp) &#8712;costOfGrade) &#8743;
    display_veh_Id&#8712; display &#8594; VEH_ID &#8743;
    clutchPump&#8712; pump >->> clutch &#8743;
    gunPump&#8712; pump >->> gun &#8743;
    holsterPump&#8712; pump >->> holster &#8743;
    motorPump&#8712; pump >->> motor &#8743;
    displayPump&#8712; pump >->> display
    INITIALISATION
    ANY cc,dd,gg,hh,mm,pp,vi WHERE
    cc &#8838; CLUTCH &#8743;
    card(cc) = 5 &#8743;
    dd&#8838; DISPLAY &#8743;
    card(dd) = 5 &#8743;
    gg&#8838; GUN &#8743;
    card(dd) = 5 &#8743;
    hh&#8838; HOLSTER &#8743;
    card(hh) = 5 &#8743;
    mm&#8838; MOTOR &#8743;
    card(mm) = 5 &#8743;
    pp &#8838; PUMP &#8743;
    card(pp) = 5 &#8743;
    vi&#8712; VEH_ID
    THEN
    clutch := cc ||
    clutch_status := cc * {c_status_free} ||
    gun := gg ||
    gun_status := gg * {pg_status_disabled} ||
    gun_trigger := gg * {th_status_released} ||
    holster := hh ||
    holster_switch := hh * {th_status_released} ||
    motor := mm ||
    motor_status := mm * {m_status_off} ||
    ANY pi WHERE
    pi&#8712; pp &#8611; PU_ID
    THEN
    pump := pp ||
    pump_pump_Id := pi ||
    pump_status := pp * {pg_status_disabled}
    END||
    display := dd ||
    display_cost := dd * {cost1} ||
    display_volume := dd * {0} ||
    display_grade := dd * {grade1} ||
    display_veh_Id := dd * {vi} ||
    ANY cp,gp,hp,mp,dp WHERE
    cp&#8712; pp >->> cc &#8743;
    gp&#8712; pp >->>gg&#8743;
    hp&#8712; pp >->>hh&#8743;
    mp&#8712; pp >->> mm &#8743;
    dp&#8712; pp >->>dd
    THEN
    clutchPump := cp ||
    gunPump := gp ||
    holsterPump := hp ||
    motorPump := mp ||
    displayPump := dp
    END
    END||
    delivery,
    delivery_cost,
    delivery_volume,
    delivery_grade,
    delivery_pump_Id,
    delivery_veh_Id := &#8709;,&#8709;,&#8709;,&#8709;,&#8709;,&#8709;
    OPERATIONS
    pump_enable_Pump(pi,gg,vi) =
    PRE
    pi&#8712; PU_ID &#8743;
    pi&#8712; ran(pump_pump_Id) &#8743;
    gg&#8712; GRADE &#8743;
    vi&#8712; VEH_ID
    THEN
    IF pump_status(pump_pump_Id&#8315(pi)) = pg_status_disabled THEN
    pump_status(pump_pump_Id&#8315(pi)) := pg_status_enabled ||
    display_grade(displayPump(pump_pump_Id&#8315(pi))) := gg ||
    display_cost(displayPump(pump_pump_Id&#8315(pi))) := costOfGrade(gg) ||
    display_volume(displayPump(pump_pump_Id&#8315(pi))) := 0 ||
    display_veh_Id(displayPump(pump_pump_Id&#8315(pi))) := vi ||
    motor_status(motorPump(pump_pump_Id&#8315(pi))) := m_status_on ||
    clutch_status(clutchPump(pump_pump_Id&#8315(pi))) := c_status_free
    ELSE
    skip
    END
    END;
    holster_remove_Gun(hh) =
    PRE
    hh&#8712; holster &#8743;
    holster_switch(hh) = th_status_depressed
    THEN
    holster_switch(hh) := th_status_released ||
    gun_status(gunPump(holsterPump&#8315(hh))) := pg_status_enabled
    END;
    gun_depress_Trigger(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_trigger(gg) := th_status_depressed ||
    IF
    pump_status(gunPump&#8315(gg)) = pg_status_enabled&#8743;
    gun_status(gg) = pg_status_enabled
    THEN
    clutch_status(clutchPump(gunPump&#8315(gg))) := c_status_engaged
    ELSE
    skip
    END
    END;
    gun_release_Trigger(gg) =
    PRE
    gg&#8712; gun
    THEN
    gun_trigger(gg) := th_status_released ||
    IF pump_status(gunPump&#8315(gg)) = pg_status_enabled&#8743;
    gun_status(gg) = pg_status_enabled
    THEN
    clutch_status(clutchPump(gunPump&#8315(gg))) := c_status_free
    ELSE
    skip
    END
    END;
    holster_replace_Gun(hh) =
    PRE
    hh&#8712; holster &#8743;
    holster_switch(hh) = th_status_released
    THEN
    holster_switch(hh) := th_status_depressed ||
    gun_status(gunPump(holsterPump&#8315(hh))) :=pg_status_disabled ||
    IF
    pump_status(holsterPump&#8315(hh)) = pg_status_enabled
    THEN
    pump_status(holsterPump&#8315(hh)) := pg_status_disabled ||
    ANY dd WHERE
    dd&#8712; DELIVERY
    THEN
    delivery := delivery &#8746; {dd} ||
    delivery_cost(dd) := display_cost(displayPump(holsterPump&#8315(hh))) ||
    delivery_grade(dd) := display_grade(displayPump(holsterPump&#8315(hh))) ||
    delivery_volume(dd):= display_volume(displayPump(holsterPump&#8315(hh))) ||
    delivery_pump_Id(dd) := pump_pump_Id(holsterPump&#8315(hh)) ||
    delivery_veh_Id(dd) := display_veh_Id(displayPump(holsterPump&#8315(hh))) ||
    motor_status(motorPump(holsterPump&#8315(hh))) := m_status_off
    END
    END
    END;
    display_pulse_Dum_Dum(disp) =
    PRE
    disp&#8712; display
    THEN
    IF display_volume(disp) < MAXINT THEN
    display_volume(disp) := display_volume(disp) + 1
    ELSE
    skip
    END
    END
     
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    /* System_imp
    * Author: siat555
    * Creation date: 19/12/2015
    */
     
    IMPLEMENTATION System_imp
    REFINES SystemMachine
     
    SEES
    Types
    IMPORTS
    IntermediateMachine
    OPERATIONS
    pump_enable_Pump(pi,gg,vi) =
    VAR
    pp
    IN
    pp &#8592;pump_pumpOfId_Dum(pi);
    pump_enable(pp,gg,vi)
    END;
    holster_remove_Gun(hh) =
    VAR
    pp,gg
    IN
    pp &#8592;pumpOfHolster_Dum(hh);
    gg&#8592;gunOfPump_Dum(pp);
    holster_release_Dum(hh);
    gun_enable_Dum(gg)
    END;
     
     
    gun_depress_Trigger(gg) =
    VAR
    pp,ge,pe,cc
    IN
    gun_depress_Trigger_Local_Dum(gg);
    pp &#8592;pumpOfGun_Dum(gg);
    pe&#8592;pump_is_Enabled_Dum(pp);
    ge&#8592;gun_is_Enabled_Dum(gg);
    IF
    pe = TRUE &#8743;ge = TRUE
    THEN
    cc &#8592;clutchOfPump_Dum(pp);
    clutch_engage_Dum(cc)
    END
    END;
     
     
    gun_release_Trigger(gg) =
    VAR
    pp,ge,pe,cc
    IN
    gun_release_Trigger_Local_Dum(gg);
    pp &#8592;pumpOfGun_Dum(gg);
    pe&#8592;pump_is_Enabled_Dum(pp);
    ge&#8592;gun_is_Enabled_Dum(gg);
    IF
    pe = TRUE &#8743;ge = TRUE
    THEN
    cc &#8592;clutchOfPump_Dum(pp);
    clutch_free_Dum(cc)
    END
    END;
     
    holster_replace_Gun(hh) =
    VAR
    pp,gg,pe
    IN
    holster_depress_Dum(hh);
    pp &#8592;pumpOfHolster_Dum(hh);
    gg&#8592;gunOfPump_Dum(pp);
    gun_disable_Dum(gg);
    pe&#8592;pump_is_Enabled_Dum(pp);
    IF pe = TRUE THEN
    pump_delivery_Complete(pp)
    ELSE
    skip
    END
    END;
    display_pulse_Dum_Dum(disp) =
    display_pulse_Dum(disp)
     
    END
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    /* Types
    * Author: siat555
    * Creation date: 19/12/2015
    */
    MACHINE
    Types
    SETS
    OBJECTS;
    GRADE = {grade1,grade2};
    COST = {cost1,cost2};
    PU_ID;
    PG_STATUS = {pg_status_enabled,pg_status_disabled};
    TH_STATUS = {th_status_depressed,th_status_released};
    M_STATUS = {m_status_on,m_status_off};
    C_STATUS = {c_status_engaged,c_status_free};
    VEH_ID
    CONSTANTS
    costOfGrade,PUMP,DELIVERY,GUN,DISPLAY,HOLSTER,CLUTCH,MOTOR
    PROPERTIES
    costOfGrade&#8712; GRADE >->> COST &#8743;
    costOfGrade(grade1) = cost1 &#8743;
    costOfGrade(grade2) = cost2 &#8743;
    PUMP &#8838; OBJECTS &#8743;
    DELIVERY &#8838; OBJECTS &#8743;
    GUN &#8838; OBJECTS &#8743;
    DISPLAY &#8838; OBJECTS &#8743;
    HOLSTER &#8838; OBJECTS &#8743;
    CLUTCH &#8838; OBJECTS &#8743;
    MOTOR &#8838; OBJECTS
     
     
    END

  4. #4
    Membre du Club
    Homme Profil pro
    Eclipse Dev
    Inscrit en
    mai 2015
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Eclipse Dev

    Informations forums :
    Inscription : mai 2015
    Messages : 33
    Points : 53
    Points
    53
    Par défaut
    Si tu veux faire plus simple que xtend pour du text to model, une petite transformation xslt est très bien, enfin ça dépend de ton fichier d'entré, ensuite tu peux utilisé qvto pour un model to model

  5. #5
    Candidat au Club
    Femme Profil pro
    Enseignant
    Inscrit en
    janvier 2016
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : Algérie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : janvier 2016
    Messages : 3
    Points : 4
    Points
    4
    Par défaut
    Merci pour votre aide.

    Auriez-vous des règles de transformation d'une méthode B vers xmi ?

  6. #6
    Nouveau Candidat au Club
    Femme Profil pro
    Architecte de système d'information
    Inscrit en
    mars 2020
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 35
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : mars 2020
    Messages : 1
    Points : 1
    Points
    1
    Par défaut
    Il a toujours fallu que quelqu'un le dise et répète ... Excellent commentaire et reconnaissant pour votre temps land et vos conseils

Discussions similaires

  1. [XSLT] transformation xml vers fichier .text !
    Par kader78190 dans le forum XSL/XSLT/XPATH
    Réponses: 1
    Dernier message: 03/11/2006, 12h45
  2. [XHTML] Outil de transformation html vers xhtml
    Par noarno dans le forum Balisage (X)HTML et validation W3C
    Réponses: 1
    Dernier message: 14/04/2006, 12h14
  3. conversion text vers integer
    Par jawad.t dans le forum Connexion aux bases de données
    Réponses: 3
    Dernier message: 10/06/2005, 20h35
  4. [Rave5] Comment envoyer un text ver un label
    Par pacs dans le forum Rave
    Réponses: 2
    Dernier message: 03/03/2005, 14h55
  5. importation d'un fichier texte vers excel
    Par darkpocket dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 07/01/2005, 11h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo