Skip to content
Snippets Groups Projects
Commit 3d451420 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Adding Avatar methodology

parent 32979ab3
No related branches found
No related tags found
No related merge requests found
Showing with 138 additions and 37 deletions
SRCS = generated_src/main.c generated_src/MicroWaveOven.c generated_src/Bell.c generated_src/ControlPanel.c generated_src/Controller.c generated_src/Magnetron.c generated_src/Door.c SRCS = generated_src/main.c generated_src/B2.c generated_src/B1.c generated_src/B0.c
\ No newline at end of file \ No newline at end of file
...@@ -80,30 +80,69 @@ public class AvatarMethodologyPanel extends TURTLEPanel { ...@@ -80,30 +80,69 @@ public class AvatarMethodologyPanel extends TURTLEPanel {
public void initElements() { public void initElements() {
TGComponent tgc1 = dmd.addComponent(150, 100, TGComponentManager.AVATARMETHODOLOGY_REF_ASSUMPTIONS, false); TGComponent tgc1 = dmd.addComponent(150, 100, TGComponentManager.AVATARMETHODOLOGY_REF_ASSUMPTIONS, false);
TGComponent tgc2 = dmd.addComponent(250, 200, TGComponentManager.AVATARMETHODOLOGY_REF_REQUIREMENT, false); TGComponent tgc2 = dmd.addComponent(250, 200, TGComponentManager.AVATARMETHODOLOGY_REF_REQUIREMENT, false);
TGComponent tgc3 = dmd.addComponent(350, 300, TGComponentManager.AVATARMETHODOLOGY_REF_ANALYSIS, false); TGComponent tgc3 = dmd.addComponent(350, 300, TGComponentManager.AVATARMETHODOLOGY_REF_ANALYSIS, false);
TGComponent tgc4 = dmd.addComponent(450, 400, TGComponentManager.AVATARMETHODOLOGY_REF_DESIGN, false);
TGComponent tgc5 = dmd.addComponent(550, 500, TGComponentManager.AVATARMETHODOLOGY_REF_PROTOTYPE, false);
TGComponent tgc6 = dmd.addComponent(200, 400, TGComponentManager.AVATARMETHODOLOGY_REF_PROPERTIES, false);
//Connectors //Connectors
// App -> mapping // Assumptions -> reqs
/*TGConnectingPoint p1, p2; TGConnectingPoint p1, p2;
p1 = tgc1.getTGConnectingPointAtIndex(0); p1 = tgc1.getTGConnectingPointAtIndex(0);
p2 = tgc3.getTGConnectingPointAtIndex(0); p2 = tgc2.getTGConnectingPointAtIndex(0);
Vector listPoint = new Vector(); Vector listPoint = new Vector();
TGConnector tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.DIPLODOCUSMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint); Point p = new Point(210, 235);
listPoint.add(p);
TGConnector tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false); p1.setFree(false);
p2.setFree(false); p2.setFree(false);
dmd.getComponentList().add(0, tgco); dmd.getComponentList().add(0, tgco);
// Archi -> mapping // Reqs -> Analysis
p1 = tgc2.getTGConnectingPointAtIndex(0); p1 = tgc2.getTGConnectingPointAtIndex(1);
p2 = tgc3.getTGConnectingPointAtIndex(1); p2 = tgc3.getTGConnectingPointAtIndex(0);
listPoint = new Vector(); listPoint = new Vector();
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.DIPLODOCUSMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint); p = new Point(310, 335);
listPoint.add(p);
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false);
p2.setFree(false);
dmd.getComponentList().add(0, tgco);
// Analysis -> Design
p1 = tgc3.getTGConnectingPointAtIndex(1);
p2 = tgc4.getTGConnectingPointAtIndex(0);
listPoint = new Vector();
p = new Point(410, 435);
listPoint.add(p);
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false);
p2.setFree(false);
dmd.getComponentList().add(0, tgco);
// Design -> Prototyping
p1 = tgc4.getTGConnectingPointAtIndex(1);
p2 = tgc5.getTGConnectingPointAtIndex(0);
listPoint = new Vector();
p = new Point(510, 535);
listPoint.add(p);
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false);
p2.setFree(false);
dmd.getComponentList().add(0, tgco);
// Reqs -> Prop
p1 = tgc2.getTGConnectingPointAtIndex(2);
p2 = tgc6.getTGConnectingPointAtIndex(0);
listPoint = new Vector();
tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
p1.setFree(false); p1.setFree(false);
p2.setFree(false); p2.setFree(false);
dmd.getComponentList().add(0, tgco); dmd.getComponentList().add(0, tgco);
dmd.addComponent(50, 150, TGComponentManager.DIPLODODUSMETHODOLOGY_REF_REQUIREMENT, false);*/
} }
public void init() { public void init() {
......
...@@ -70,7 +70,7 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp ...@@ -70,7 +70,7 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp
protected final String[] SHORT_ACTION_NAMES = { protected final String[] SHORT_ACTION_NAMES = {
"simu", "upp", "proverif", "inv", "simu", "upp", "proverif", "inv",
"proto"}; "code-gen"};
protected final String[] LONG_ACTION_NAMES = { protected final String[] LONG_ACTION_NAMES = {
/*0*/ "Simulation and animate the model", /*0*/ "Simulation and animate the model",
...@@ -206,7 +206,7 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp ...@@ -206,7 +206,7 @@ public class AvatarMethodologyDiagramName extends TGCScalableWithoutInternalComp
} }
if (onMe) if (onMe)
g.drawRect(x-2, y-12, myWidth+4, 15); g.drawRect(x-2, y-12, myWidth+6, 15);
return; return;
......
...@@ -80,14 +80,14 @@ public abstract class AvatarMethodologyDiagramReference extends TGCScalableWithI ...@@ -80,14 +80,14 @@ public abstract class AvatarMethodologyDiagramReference extends TGCScalableWithI
protected int typeOfReference; protected int typeOfReference;
protected final static String[] TYPE_STR = {"Assumptions", "Requirements", "Analysis", "Design", "Properties", "Prototyping"}; protected final static String[] TYPE_STR = {"Assumptions", "Requirements", "Analysis", "Design", "Properties", "Prototyping"};
protected final static int NB_TYPE = 3; protected final static int NB_TYPE = 6;
protected final static int ASSUMPTIONS = 0; protected final static int ASSUMPTIONS = 0;
protected final static int REQUIREMENT = 1; protected final static int REQUIREMENT = 1;
protected final static int ANALYSIS = 2; protected final static int ANALYSIS = 2;
protected final static int DESIGN = 3; protected final static int DESIGN = 3;
protected final static int PROPERTY = 4; protected final static int PROPERTY = 4;
protected final static int PROTOTYPING = 4; protected final static int PROTOTYPING = 5;
protected JMenuItem diagramReference; protected JMenuItem diagramReference;
......
...@@ -64,11 +64,12 @@ public class AvatarMethodologyReferenceToAnalysis extends AvatarMethodologyDiagr ...@@ -64,11 +64,12 @@ public class AvatarMethodologyReferenceToAnalysis extends AvatarMethodologyDiagr
public AvatarMethodologyReferenceToAnalysis(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyReferenceToAnalysis(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120); initScaling(200, 70);
nbConnectingPoint = 1; nbConnectingPoint = 2;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.WEST); connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.0, 0.5, TGConnectingPoint.WEST);
connectingPoint[1] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 1.0, TGConnectingPoint.WEST);
typeOfReference = ANALYSIS; typeOfReference = ANALYSIS;
......
...@@ -64,11 +64,11 @@ public class AvatarMethodologyReferenceToAssumptions extends AvatarMethodologyDi ...@@ -64,11 +64,11 @@ public class AvatarMethodologyReferenceToAssumptions extends AvatarMethodologyDi
public AvatarMethodologyReferenceToAssumptions(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyReferenceToAssumptions(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120); initScaling(200, 70);
nbConnectingPoint = 1; nbConnectingPoint = 1;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.WEST); connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.30, 1.0, TGConnectingPoint.WEST);
typeOfReference = ASSUMPTIONS; typeOfReference = ASSUMPTIONS;
......
...@@ -64,13 +64,14 @@ public class AvatarMethodologyReferenceToDesign extends AvatarMethodologyDiagram ...@@ -64,13 +64,14 @@ public class AvatarMethodologyReferenceToDesign extends AvatarMethodologyDiagram
public AvatarMethodologyReferenceToDesign(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyReferenceToDesign(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120); initScaling(300, 70);
nbConnectingPoint = 1; nbConnectingPoint = 2;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.WEST); connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.0, 0.5, TGConnectingPoint.WEST);
connectingPoint[1] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.20, 1.0, TGConnectingPoint.WEST);
typeOfReference = PROTOTYPING; typeOfReference = DESIGN;
addTGConnectingPointsCommentTop(); addTGConnectingPointsCommentTop();
...@@ -81,7 +82,7 @@ public class AvatarMethodologyReferenceToDesign extends AvatarMethodologyDiagram ...@@ -81,7 +82,7 @@ public class AvatarMethodologyReferenceToDesign extends AvatarMethodologyDiagram
} }
public boolean isAValidPanelType(TURTLEPanel panel) { public boolean isAValidPanelType(TURTLEPanel panel) {
if (panel instanceof AvatarRequirementPanel) { if (panel instanceof AvatarDesignPanel) {
return true; return true;
} }
...@@ -97,7 +98,50 @@ public class AvatarMethodologyReferenceToDesign extends AvatarMethodologyDiagram ...@@ -97,7 +98,50 @@ public class AvatarMethodologyReferenceToDesign extends AvatarMethodologyDiagram
} }
public boolean makeCall(String diagramName, int index) { public boolean makeCall(String diagramName, int index) {
return true; String tmp;
switch(index) {
case 0:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarSimulation();
return true;
}
return false;
case 1:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarUPPAALVerification();
return true;
}
return false;
case 2:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarProVerifVerification();
return true;
}
return false;
case 3:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarStaticAnalysis();
return true;
}
return false;
default:
return false;
}
} }
} }
...@@ -64,13 +64,13 @@ public class AvatarMethodologyReferenceToProperties extends AvatarMethodologyDia ...@@ -64,13 +64,13 @@ public class AvatarMethodologyReferenceToProperties extends AvatarMethodologyDia
public AvatarMethodologyReferenceToProperties(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyReferenceToProperties(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120); initScaling(180, 70);
nbConnectingPoint = 1; nbConnectingPoint = 1;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.WEST); connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.2, 0.0, TGConnectingPoint.WEST);
typeOfReference = REQUIREMENT; typeOfReference = PROPERTY;
addTGConnectingPointsCommentTop(); addTGConnectingPointsCommentTop();
......
...@@ -64,11 +64,11 @@ public class AvatarMethodologyReferenceToPrototype extends AvatarMethodologyDiag ...@@ -64,11 +64,11 @@ public class AvatarMethodologyReferenceToPrototype extends AvatarMethodologyDiag
public AvatarMethodologyReferenceToPrototype(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyReferenceToPrototype(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120); initScaling(300, 70);
nbConnectingPoint = 1; nbConnectingPoint = 1;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.WEST); connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.0, 0.5, TGConnectingPoint.WEST);
typeOfReference = PROTOTYPING; typeOfReference = PROTOTYPING;
...@@ -81,7 +81,7 @@ public class AvatarMethodologyReferenceToPrototype extends AvatarMethodologyDiag ...@@ -81,7 +81,7 @@ public class AvatarMethodologyReferenceToPrototype extends AvatarMethodologyDiag
} }
public boolean isAValidPanelType(TURTLEPanel panel) { public boolean isAValidPanelType(TURTLEPanel panel) {
if (panel instanceof AvatarRequirementPanel) { if (panel instanceof AvatarDesignPanel) {
return true; return true;
} }
...@@ -89,11 +89,26 @@ public class AvatarMethodologyReferenceToPrototype extends AvatarMethodologyDiag ...@@ -89,11 +89,26 @@ public class AvatarMethodologyReferenceToPrototype extends AvatarMethodologyDiag
} }
public void makeValidationInfos(AvatarMethodologyDiagramName dn) { public void makeValidationInfos(AvatarMethodologyDiagramName dn) {
dn.setValidationsNumber(0); dn.setValidationsNumber(1);
dn.setValidationsInfo(0, AvatarMethodologyDiagramName.PROTO);
} }
public boolean makeCall(String diagramName, int index) { public boolean makeCall(String diagramName, int index) {
return true; switch(index) {
case 0:
if (!openDiagram(diagramName)) {
return false;
}
if (tdp.getMGUI().checkModelingSyntax(diagramName, true)) {
tdp.getMGUI().avatarExecutableCodeGeneration();
return true;
}
return false;
default:
return false;
}
} }
} }
...@@ -64,11 +64,13 @@ public class AvatarMethodologyReferenceToRequirement extends AvatarMethodologyDi ...@@ -64,11 +64,13 @@ public class AvatarMethodologyReferenceToRequirement extends AvatarMethodologyDi
public AvatarMethodologyReferenceToRequirement(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { public AvatarMethodologyReferenceToRequirement(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120); initScaling(200, 70);
nbConnectingPoint = 1; nbConnectingPoint = 3;
connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.WEST); connectingPoint[0] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.0, 0.5, TGConnectingPoint.WEST);
connectingPoint[1] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.3, 1.0, TGConnectingPoint.WEST);
connectingPoint[2] = new AvatarMethodologyConnectingPoint(this, 0, 0, false, true, 0.1, 1.0, TGConnectingPoint.WEST);
typeOfReference = REQUIREMENT; typeOfReference = REQUIREMENT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment