Skip to content
Snippets Groups Projects
Commit 0ff245c1 authored by Letitia Li's avatar Letitia Li
Browse files

Temporary fix for UPPAAL

parent 3bd03ece
No related branches found
No related tags found
1 merge request!19Quick UPPAAL Fix
......@@ -55,9 +55,10 @@ import java.awt.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.Pattern;
import java.util.LinkedList;
import java.util.Map;
import java.util.regex.Matcher;
/**
* Class Pragma
* Like a Note but with Pragma
......@@ -225,11 +226,12 @@ public class AvatarBDSafetyPragma extends TGCScalableWithoutInternalComponent {
}
public void makeValue() {
values = Conversion.wrapText(value);
properties.clear();
for (String s: values){
if (s.isEmpty() || (s.split(" ").length < 1) ){
//Ignore
if (s.isEmpty() ){
//Ignore
}
else if (Arrays.asList(pPragma).contains(s.split(" ")[0])){
properties.add(s);
......
......@@ -81,6 +81,8 @@ import ui.TURTLEPanel;
import ui.util.IconManager;
import uppaaldesc.UPPAALSpec;
import uppaaldesc.UPPAALTemplate;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
/**
* Class JDialogUPPAALValidation
......@@ -683,13 +685,32 @@ public class JDialogUPPAALValidation extends javax.swing.JDialog implements Acti
}
java.util.List<AvatarBlock> blocks = avspec.getListOfBlocks();
java.util.List<String> matches = new java.util.ArrayList<String>();
for (AvatarBlock block:blocks){
UPPAALTemplate temp = spec.getTemplateByName(block.getName());
if (temp !=null){
int index = avatar2uppaal.getIndexOfTranslatedTemplate(temp);
finQuery = finQuery.replaceAll(block.getName(), block.getName()+"__"+index);
if (finQuery.contains(block.getName()+".")){
matches.add(block.getName());
}
}
}
for (String match: matches){
boolean ignore=false;
for (String posStrings: matches){
if (!posStrings.equals(match) && posStrings.contains(match)){
ignore=true;
}
}
if (!ignore){
UPPAALTemplate temp = spec.getTemplateByName(match);
int index = avatar2uppaal.getIndexOfTranslatedTemplate(temp);
finQuery = finQuery.replaceAll(match, match+"__"+index);
}
}
//translatedText.setText(finQuery);
return finQuery;
}
......
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