Commit ee28e2de authored by Ludovic Apvrille's avatar Ludovic Apvrille

Update on modelname management for simulator

parent 4f2e3421
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -77,6 +77,8 @@ public class DiploSimulatorCodeGenerator implements IDiploSimulatorCodeGenerator
private String header, declaration, mainFile, src;
private ArrayList<MappedSystemCTask> tasks;
private String modelName = "LovelyModel";
//private ArrayList<EBRDD> ebrdds;
//private ArrayList<TEPE> tepes;
SystemCTEPE tepeTranslator;
......@@ -126,6 +128,10 @@ public class DiploSimulatorCodeGenerator implements IDiploSimulatorCodeGenerator
namesGen = NamesGenerationHelper.INSTANCE;
}
public void setModelName(String _modelName) {
modelName = _modelName;
}
public void saveFile(String path, String filename) throws FileException {
generateTaskFiles(path);
FileUtils.saveFile(path + filename + ".cpp", getFullCode());
......@@ -269,8 +275,8 @@ public class DiploSimulatorCodeGenerator implements IDiploSimulatorCodeGenerator
// Declaration of Model Name
declaration += "//Declaration of Model Name" + CR;
declaration += "std::string msg=" + "\"LovelyModel\"" + SCCR;
declaration += "addModelName(" + "\"LovelyModel\"" + ")" + SCCR;
declaration += "std::string msg=" + "\"" + modelName + "\"" + SCCR;
declaration += "addModelName(" + "\"" + modelName + "\"" + ")" + SCCR;
// Declaration of Buses
......
......@@ -51,4 +51,6 @@ public interface IDiploSimulatorCodeGenerator {
void saveFile(String path,
String filename)
throws FileException;
public void setModelName(String _name);
}
......@@ -114,6 +114,9 @@ public class TML2MappingSystemC implements IDiploSimulatorCodeGenerator {
//tepeTranslator.generateTEPEs();
}
public void setModelName(String _modelName) {
}
public void saveFile(String path, String filename) throws FileException {
generateTaskFiles(path);
FileUtils.saveFile(path + filename + ".cpp", getFullCode());
......
......@@ -47,6 +47,8 @@ import myutil.TraceManager;
import ui.*;
import ui.util.IconManager;
import ui.window.JDialogManageListOfString;
import verification.Property;
import verification.VerificationStorage;
import javax.swing.*;
import java.awt.*;
......@@ -62,7 +64,7 @@ import java.util.Vector;
* @version 1.0 26/01/2016
* @author Ludovic APVRILLE
*/
public abstract class VerificationPropertyGeneric extends TGCScalableWithInternalComponent {
public abstract class VerificationPropertyGeneric extends TGCScalableWithInternalComponent implements VerificationStorage {
public String oldValue;
protected int textX = 5;
protected int textY = 22;
......@@ -80,28 +82,16 @@ public abstract class VerificationPropertyGeneric extends TGCScalableWithInterna
protected int currentFontSize = -1;
protected boolean displayText = true;
protected int typeOfReference;
protected final static String[] TYPE_STR = {"Assumptions", "Requirements",
"Analysis", "Design", "Properties", "Prototyping", "Functional view",
"Architecture view", "Mapping", "Communication pattern", "Attacks", "Faults"};
protected final static int NB_TYPE = 6;
protected final static int ASSUMPTIONS = 0;
protected final static int REQUIREMENT = 1;
protected final static int ANALYSIS = 2;
protected final static int DESIGN = 3;
protected final static int PROPERTY = 4;
protected final static int PROTOTYPING = 5;
protected final static int FUNCTIONAL_VIEW = 6;
protected final static int ARCHITECTURE_VIEW = 7;
protected final static int MAPPING_VIEW = 8;
protected final static int CP_VIEW = 9;
protected final static int ATTACK = 10;
protected final static int FAULT = 11;
protected Vector<Property> properties;
protected JMenuItem diagramReference;
......@@ -143,6 +133,8 @@ public abstract class VerificationPropertyGeneric extends TGCScalableWithInterna
myImageIcon = IconManager.imgic5006;
properties = new Vector<>();
actionOnAdd();
}
......@@ -154,7 +146,6 @@ public abstract class VerificationPropertyGeneric extends TGCScalableWithInterna
// int w, c;
int size;
value = TYPE_STR[typeOfReference];
if (!tdp.isScaled()) {
graphics = g;
......@@ -290,7 +281,7 @@ public abstract class VerificationPropertyGeneric extends TGCScalableWithInterna
}
public boolean editOndoubleClick(JFrame frame, int _x, int _y) {
addDiagramReference(frame);
//addDiagramReference(frame);
return true;
// On the name ?
/*oldValue = value;
......@@ -367,9 +358,14 @@ public abstract class VerificationPropertyGeneric extends TGCScalableWithInterna
return null;
}
public boolean addProperty(Property p) {
properties.add(p);
return true;
}
public void addActionToPopupMenu(JPopupMenu componentMenu, ActionListener menuAL, int x, int y) {
/*public void addActionToPopupMenu(JPopupMenu componentMenu, ActionListener menuAL, int x, int y) {
componentMenu.addSeparator();
......@@ -389,11 +385,9 @@ public abstract class VerificationPropertyGeneric extends TGCScalableWithInterna
}
return true;
}
}*/
public void addDiagramReference(JFrame frame) {
}
/*spublic abstract void makeValidationInfos(SysmlsecMethodologyDiagramName dn);
......
......@@ -64,7 +64,6 @@ public class VerificationPropertySafety extends VerificationPropertyGeneric {
connectingPoint = new TGConnectingPoint[nbConnectingPoint];
//connectingPoint[0] = new SysmlsecMethodologyConnectingPoint(this, 0, 0, false, true, 0.5, 0, TGConnectingPoint.WEST);
typeOfReference = PROPERTY;
addTGConnectingPointsCommentTop();
......
......@@ -803,6 +803,7 @@ public class JDialogSystemCGeneration extends JDialog implements ActionListener,
}
try {
tml2systc.setModelName(mgui.getModelFileFullPath() + " / " + mgui.getCurrentJTabbedPane().getTitleAt(0));
tml2systc.generateSystemC(debugmode.isSelected(), optimizemode.isSelected());
testGo();
jta.append("Simulator code generation done\n");
......
......@@ -61,7 +61,7 @@ import java.util.List;
/**
* Class TIFTranslator
* Class TMLTranslator
* Linecommand application for translating TIF to other languages
* Creation: 29/06/2007
* @version 1.1 30/05/2014
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment