Commit cf2d0868 authored by Andrey Filippov's avatar Andrey Filippov

Got rid of static variables and methods in FormatProcessor, continue

debugging.
parent d8bf8483
......@@ -129,9 +129,9 @@ public class LaunchCore {
String valueAttrName = LaunchCore.getValueAttributeName(param);
if(param.getType().isList())
workingCopy.setAttribute(valueAttrName, param.getValue());
workingCopy.setAttribute(valueAttrName, param.getValue(null)); // null for topFormatProcessor
else
workingCopy.setAttribute(valueAttrName, param.getValue().get(0));
workingCopy.setAttribute(valueAttrName, param.getValue(null).get(0)); // null for topFormatProcessor
}
setToolToLaunch(workingCopy, tool);
......@@ -227,6 +227,8 @@ public class LaunchCore {
IProject project,
String resource,
String logBuildStamp) throws CoreException {
// System.out.println("1.DebugUITools.launch() tool="+tool+" project="+project+" resource="+resource+" logBuildStamp="+logBuildStamp);
// System.out.println("2.DebugUITools.launch() tool="+tool.getName()+" project="+project.getName()+" resource="+resource.toString()+" logBuildStamp="+logBuildStamp); //Unhandled event loop exception
if (!saveAllEditors(true)) return; // Andrey: added it here
try {
......@@ -236,13 +238,18 @@ public class LaunchCore {
resource,
logBuildStamp);
if (VDTLaunchUtil.getRunner().getRunningBuilds().isAlreadyOpen(tool.getName())){
return;
// System.out.println("LaunchCore:launch() tool="+tool.getName()+" was already open! Ignoring... ");
// return;
}
// System.out.println("DebugUITools.launch() tool="+tool.getName()+" project="+project.getName()+" resource="+resource.toString()+" logBuildStamp="+logBuildStamp);
DebugUITools.launch(launchConfig, ILaunchManager.RUN_MODE);
} catch (CoreException e) {
IStatus status = e.getStatus();
if (status.getSeverity() != IStatus.CANCEL)
throw e;
} finally {
// System.out.println("3.DebugUITools.launch() tool="+tool.getName()+" project="+project.getName()+" resource="+resource.toString()+" logBuildStamp="+logBuildStamp);
}
} // launch()
......@@ -378,7 +385,8 @@ public class LaunchCore {
*/
protected static boolean saveAllEditors(boolean confirm) {
if (VerilogPlugin.getActiveWorkbenchWindow() == null) {
return false;
System.out.println("VerilogPlugin.getActiveWorkbenchWindow() == null");
return true; // false;
}
return PlatformUI.getWorkbench().saveAllEditors(confirm);
}
......
......@@ -186,17 +186,19 @@ public class RunningBuilds {
}
public void removeConfiguration(String consoleName){
System.out.println("VDTRunnerConfiguration#removeConfiguration("+consoleName+")");
unfinishedBuilds.remove(consoleName);
System.out.println("Running consoles:");
listConfigurations();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("VDTRunnerConfiguration#removeConfiguration("+consoleName+"), running consoles:");
listConfigurations();
}
}
public void saveUnfinished(String consoleName, VDTRunnerConfiguration configuration ){
System.out.println("VDTRunnerConfiguration#saveUnfinished("+consoleName+", configuration)");
unfinishedBuilds.put(consoleName, configuration);
System.out.println("Running consoles:");
listConfigurations();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("VDTRunnerConfiguration#saveUnfinished("+consoleName+", configuration), running consoles:");
listConfigurations();
}
}
public void listConfigurations(){
......
......@@ -279,7 +279,7 @@ public class VDTConsoleRunner{
for (int i=0;i<fArguments.length;i++){
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.LOCAL_ECHO)) {
fOutStream.write(fArguments[i]+"\n"); // writes to console itself
System.out.println("--->"+fArguments[i]+"\n");
// System.out.println("--->"+fArguments[i]+"\n");
}
consoleInStreamProxy.write(fArguments[i]+"\n");
}
......
......@@ -144,10 +144,10 @@ public class VDTLaunchUtil {
try {
if(param.getType().isList()) {
List<String> value =
configuration.getAttribute(valueAttrName, param.getDefaultValue());
configuration.getAttribute(valueAttrName, param.getDefaultValue(null)); // null for topFormatProcessor
param.setCurrentValue(value);
} else {
String value = configuration.getAttribute(valueAttrName, param.getDefaultValue().get(0));
String value = configuration.getAttribute(valueAttrName, param.getDefaultValue(null).get(0)); // null for topFormatProcessor
param.setCurrentValue(value);
}
} catch(ToolException e) {
......
......@@ -59,7 +59,7 @@ public class ParamBasedListOption extends ParamBasedOption {
}
public List<String> getValueList() {
return param.getValue();
return param.getValue(null); // null for topFormatProcessor
}
public List<String> doLoadList() {
......@@ -83,7 +83,7 @@ public class ParamBasedListOption extends ParamBasedOption {
}
public List<String> doLoadDefaultList() {
List<String> list = param.getDefaultValue();
List<String> list = param.getDefaultValue(null); // null for topFormatProcessor
doClear();
return list;
}
......@@ -109,7 +109,7 @@ public class ParamBasedListOption extends ParamBasedOption {
super.doClear();
return true;
} else
return super.doStore(OptionsUtils.convertListToString(param.getValue()));
return super.doStore(OptionsUtils.convertListToString(param.getValue(null))); // null for topFormatProcessor
}
} // class ParamBasedOption
......@@ -49,7 +49,7 @@ public class ParamBasedOption extends Option {
}
public String getValue() {
return param.getValue().get(0);
return param.getValue(null).get(0); // null for topFormatProcessor
}
public Parameter getParam() {
......@@ -73,13 +73,13 @@ public class ParamBasedOption extends Option {
}
public String doLoadDefault() {
String value = param.getDefaultValue(true).get(0); // Andrey: ignore faults in TopModuleName generator
String value = param.getDefaultValue(true, null).get(0); // Andrey: ignore faults in TopModuleName generator // null for topFormatProcessor
doClear();
return value;
}
public String doLoadDefault(boolean menuMode) {
String value = param.getDefaultValue(menuMode).get(0);
String value = param.getDefaultValue(menuMode,null).get(0);
doClear();
return value;
}
......
......@@ -224,7 +224,7 @@ public abstract class Context {
CommandLinesBlock commandLinesBlock = (CommandLinesBlock)commandLinesBlockIter.next();
if (commandLinesBlock.isConsoleKind()){
Parameter parName = findParam(commandLinesBlock.getDestination()); // command file or console name
String consoleName = (parName != null)? parName.getValue().get(0).trim() : null;
String consoleName = (parName != null)? parName.getValue(null).get(0).trim() : null;
if (consoleName!=null) consoleList.add(consoleName);
}
}
......@@ -282,8 +282,9 @@ public abstract class Context {
String toolInfo= subsitutePattern(commandLinesBlock.getInfo());
String stderr=commandLinesBlock.getStderr();
String stdout=commandLinesBlock.getStdout();
String prompt= buildSimpleString(commandLinesBlock.getPrompt()); // evaluate string
String sTimeout=buildSimpleString(commandLinesBlock.getTimeout());
// the result will not be used as some other parameter value, so topProcessor is null in the next 2 lines /Andrey
String prompt= buildSimpleString(commandLinesBlock.getPrompt(), null); // evaluate string
String sTimeout=buildSimpleString(commandLinesBlock.getTimeout(),null);
int timeout=0;
try{
timeout=Integer.parseInt(sTimeout);
......@@ -307,7 +308,8 @@ public abstract class Context {
List<List<String>> commandSequence = new ArrayList<List<String>>();
for(Iterator<String> lineIter = lines.iterator(); lineIter.hasNext();) {
String line = (String)lineIter.next();
commandSequence.add(buildCommandString(line)); // TODO: parses them here? VERIFY
// the result will not be used as some other parameter value, so topProcessor is null in the next line /Andrey
commandSequence.add(buildCommandString(line,null)); // TODO: parses them here? VERIFY
}
// Here - already resolved to empty
......@@ -315,7 +317,7 @@ public abstract class Context {
if(destName != null) {
Parameter parName = findParam(destName); // command file or console name
String controlFileName = parName != null?
parName.getValue().get(0).trim() : null;
parName.getValue(null).get(0).trim() : null;
if (isConsoleName) {
// System.out.println("TODO: Enable console command generation here");
printStringsToConsoleLine(commandLineParams, commandSequence,sep,mark);
......@@ -427,7 +429,7 @@ public abstract class Context {
return (BuildParamsItem[])buildParamItems.toArray(new BuildParamsItem[buildParamItems.size()]);
}
protected List<String> buildCommandString(String paramStringTemplate)
protected List<String> buildCommandString(String paramStringTemplate, FormatProcessor topProcessor)
throws ToolException
{
FormatProcessor processor = new FormatProcessor(new Recognizer[] {
......@@ -435,26 +437,26 @@ public abstract class Context {
new RepeaterRecognizer()
// new ContextParamRecognizer(this),
// new ContextParamRepeaterRecognizer(this)
});
},topProcessor);
return processor.process(paramStringTemplate);
}
// recognizes parameter name (just %name), or simple generators
protected String buildSimpleString(String stringTemplate)
protected String buildSimpleString(String stringTemplate, FormatProcessor topProcessor)
throws ToolException
{
if (stringTemplate==null) return null;
Parameter parName=findParam(stringTemplate);
if (parName!=null){
return parName.getValue().get(0).trim(); // get parameter
return parName.getValue(topProcessor).get(0).trim(); // get parameter
}
FormatProcessor processor = new FormatProcessor(new Recognizer[] {
new SimpleGeneratorRecognizer(),
new RepeaterRecognizer()
// new ContextParamRecognizer(this),
// new ContextParamRepeaterRecognizer(this)
});
},topProcessor);
List<String> result= processor.process(stringTemplate);
if (result.size()==0) return "";
......
......@@ -18,6 +18,7 @@
package com.elphel.vdt.core.tools.generators;
import com.elphel.vdt.core.Utils;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.ui.MessageUI;
......@@ -34,26 +35,29 @@ public abstract class AbstractGenerator {
private final boolean forcedMultiline;
private boolean menuMode=false; // managing menu items, not running tool. Ignore Generator errors
protected Tool tool0; // "tool" was already used in ToolParamRecognizer / Andrey
protected FormatProcessor topProcessor; // to protect from cycles in recursion, replacing static in FormatProcessor / Andrey
public AbstractGenerator() {
this(false);
public AbstractGenerator(FormatProcessor processor) {
this(false, processor);
}
public AbstractGenerator(String prefix,
String suffix,
String separator)
String separator,
FormatProcessor processor)
{
this(prefix, suffix, separator, false);
this(prefix, suffix, separator, false,processor);
}
protected AbstractGenerator(boolean forcedMultiline) {
this("", "", "", forcedMultiline);
protected AbstractGenerator(boolean forcedMultiline, FormatProcessor processor) {
this("", "", "", forcedMultiline, processor);
}
protected AbstractGenerator(String prefix,
String suffix,
String sep,
boolean forcedMultiline)
boolean forcedMultiline,
FormatProcessor processor)
{
this.prefix = prefix;
this.suffix = suffix;
......@@ -63,6 +67,7 @@ public abstract class AbstractGenerator {
separator = separator.replace("\\n", "\n");
separator = separator.replace("\\t", "\t");
}
topProcessor=processor;
}
public void setMenuMode(boolean menuMode){
this.menuMode=menuMode;
......@@ -73,6 +78,7 @@ public abstract class AbstractGenerator {
public void setTool(Tool tool){
this.tool0=tool;
}
protected FormatProcessor getTopProcessor(){return topProcessor;}
public abstract String getName();
......
......@@ -26,6 +26,11 @@ public class BuildStampGenerator extends AbstractGenerator {
return NAME;
}
public BuildStampGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
// if ( return new String[] {(tool0!=null)?tool0.getStateFile(): ""};
// System.out.println("#### BuildStampGenerator(): tool0="+
......
......@@ -25,7 +25,11 @@ public class ChosenActionGenerator extends AbstractGenerator {
public String getName() {
return NAME;
}
public ChosenActionGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
int choice=SelectedResourceManager.getDefault().getChosenAction();
return new String[] { ""+choice };
......
......@@ -26,7 +26,11 @@ public class CurrentFileBaseGenerator extends AbstractGenerator {
public String getName() {
return NAME;
}
public CurrentFileBaseGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
String name=SelectedResourceManager.getDefault().getChosenShort(); // last segment of the file name
if (name!=null){
......
......@@ -29,6 +29,11 @@ public class CurrentFileGenerator extends AbstractGenerator {
public String getName() {
return NAME;
}
public CurrentFileGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
IResource resource;
if (getMenuMode()) {
......
......@@ -36,7 +36,7 @@ public class FileListGenerator extends AbstractGenerator {
String suffix,
String separator)
{
super(prefix, suffix, separator);
super(prefix, suffix, separator,null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
......
......@@ -54,7 +54,7 @@ public class FilteredSourceListGenerator extends AbstractGenerator {
String suffix,
String separator)
{
super(prefix, suffix, separator);
super(prefix, suffix, separator, null ); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
......
......@@ -30,9 +30,13 @@ public class OSNameGenerator extends AbstractGenerator {
public String getName() {
return NAME;
}
public OSNameGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
String osName = System.getProperty("os.name");
String osName = System.getProperty("os.name");
if(osName.indexOf(OS_WINDOWS) >= 0) {
return new String[] { OS_WINDOWS };
......
......@@ -37,6 +37,11 @@ public class ProjectNameGenerator extends AbstractGenerator {
return NAME;
}
public ProjectNameGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
String[] value = null;
IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
......
......@@ -34,6 +34,10 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class ProjectPathGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_PROJECT_PATH;
public ProjectPathGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
......
......@@ -27,6 +27,10 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class SelectedFileGenerator extends AbstractGenerator {
private static final String NAME = VDT.GENERATOR_ID_SELECTED_FILE;
// private boolean menuMode=false; // managing menu items, not running tool
public SelectedFileGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
......
......@@ -43,7 +43,7 @@ public class SourceListGenerator extends AbstractGenerator {
String suffix,
String separator)
{
super(prefix, suffix, separator);
super(prefix, suffix, separator,null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
......
......@@ -22,11 +22,16 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
/**
* Generates name of teh sate file without extension
* Generates name of the sate file without extension
*
*/
public class StateBaseGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_STATE_FILE;
public StateBaseGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
}
......
......@@ -21,6 +21,10 @@ import com.elphel.vdt.VDT;
public class StateDirGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_STATE_DIR;
public StateDirGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
}
......
......@@ -22,6 +22,11 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class StateFileGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_STATE_FILE;
public StateFileGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
}
......
......@@ -17,11 +17,13 @@
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public abstract class StringsGenerator extends AbstractGenerator {
private final String[] paramStrings;
public StringsGenerator(String[] paramStrings) {
super(true);
public StringsGenerator(String[] paramStrings, FormatProcessor topProcessor) {
super(true, topProcessor);
this.paramStrings = paramStrings;
}
......
......@@ -32,7 +32,11 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class TopModuleNameGenerator extends AbstractGenerator {
private static final String NAME = VDT.GENERATOR_ID_TOP_MODULE;
public TopModuleNameGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
}
......
......@@ -38,7 +38,7 @@ public class TopModulesNameGenerator extends AbstractGenerator {
String suffix,
String separator)
{
super(prefix, suffix, separator);
super(prefix, suffix, separator,null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
......
......@@ -20,12 +20,17 @@ package com.elphel.vdt.core.tools.generators;
import com.elphel.vdt.VDT;
public class UserNameGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_USERNAME;
public String getName() {
return NAME;
}
protected String[] getStringValues() {
return new String[] {System.getProperty("user.name")};
}
public static final String NAME = VDT.GENERATOR_ID_USERNAME;
public UserNameGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
}
protected String[] getStringValues() {
return new String[] {System.getProperty("user.name")};
}
} //UserNameGenerator
......@@ -19,6 +19,7 @@ package com.elphel.vdt.core.tools.generators;
import java.util.*;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
public class ValueGenerator extends AbstractGenerator {
......@@ -27,9 +28,10 @@ public class ValueGenerator extends AbstractGenerator {
public ValueGenerator(Parameter param,
String prefix,
String suffix,
String separator)
String separator,
FormatProcessor topProcessor)
{
super(prefix, suffix, separator);
super(prefix, suffix, separator, topProcessor);
this.param = param;
}
......@@ -41,14 +43,22 @@ public class ValueGenerator extends AbstractGenerator {
}
protected String[] getStringValues() {
List<String> values = param.getValue();
List<String> values = param.getValue(topProcessor);
return values.toArray(new String[values.size()]);
}
public String[] generate() {
if (!param.getType().isList())
return new String[]{prefix + param.getValue().get(0) + suffix};
if (!param.getType().isList()) {
List<String> rslt=param.getValue(topProcessor);
if (rslt.isEmpty()){
System.out.println("BUG in ValueGenerator.java#generate: param.getValue() isEmpty for "+param.getID());
return new String[]{prefix + "" + suffix};
} else {
return new String[]{prefix + rslt.get(0) + suffix};
}
// return new String[]{prefix + param.getValue(topProcessor).get(0) + suffix};
}
else
return super.generate();
}
......
......@@ -26,6 +26,10 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class ViewSelectedFileGenerator extends AbstractGenerator {
private static final String NAME = VDT.GENERATOR_ID_SELECTED_FILE;
public ViewSelectedFileGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
public String getName() {
return NAME;
......
......@@ -44,7 +44,7 @@ public class CommandLinesBlock extends UpdateableStringsContainer
// for commands being sent to opened remote console:
private String prompt; // relevant for commands sent to remote console - double prompt means "done" (extra separator on input)
private String stderr; // name of the command to (command line block) to launch in a separate process/console
// and connect to stderr of the terminakl session
// and connect to stderr of the terminal session
private String stdout; // name of the command to (command line block) to launch in a separate process/console
// and connect to stderr of the terminal session
// If both are specified and pointing to the same command block - two instances/consoles will be launched.
......@@ -229,7 +229,7 @@ public class CommandLinesBlock extends UpdateableStringsContainer
return !destination.equals("");
}
public void update(Updateable from) throws ConfigException {
public void update(Updateable from, FormatProcessor topProcessor) throws ConfigException {
CommandLinesBlock block = (CommandLinesBlock)from;
if(name == null)
......@@ -241,6 +241,11 @@ public class CommandLinesBlock extends UpdateableStringsContainer
if(separator == null)
separator = block.separator;
super.update(from);
super.update(from, topProcessor);
}
public void update(Updateable from) throws ConfigException {
update(from,null);
System.out.println("CommandLinesBlock#update(from,null)");
}
}
......@@ -18,6 +18,7 @@
package com.elphel.vdt.core.tools.params;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
import com.elphel.vdt.core.tools.params.recognizers.Recognizer;
......@@ -28,26 +29,40 @@ public class FormatProcessor {
private static final String CONTROL_SEQ = "%";
private static final int CONTROL_SEQ_LEN = CONTROL_SEQ.length();
private static List<String> expandedGenerators = new ArrayList<String>();
private static int callCount = 0;
// private static List<String> expandedGenerators = new ArrayList<String>();
// TODO: Get rid of this static list used to verify cycles - does not work in multi-threaded environment
// private static List<String> expandedGenerators = new CopyOnWriteArrayList<String>();
private List<String> expandedGenerators = null;
private final boolean recursive = true;
private final boolean multiline;
private final Recognizer[] recognizers;
private String initialTemplate;
private FormatProcessor topProcessor=null;
// private static int callCount = 0;
private int callCount = 0; // only valid for topProcessor
public FormatProcessor(Recognizer[] recognizers, boolean multiline) {
public FormatProcessor(Recognizer[] recognizers, boolean multiline, FormatProcessor processor) {
this.recognizers = recognizers;
this.multiline = multiline;
this.topProcessor=processor;
if (topProcessor==null){
topProcessor=this;
expandedGenerators=new ArrayList<String>();
} else {
expandedGenerators=topProcessor.expandedGenerators;
}
}
public FormatProcessor(Recognizer[] recognizers) {
this(recognizers, true);
public FormatProcessor(Recognizer[] recognizers,FormatProcessor processor) {
this(recognizers, true, processor);
}
public List<String> process(String template) throws ToolException {
if(callCount++ == 0)
if(topProcessor.callCount++ == 0)
expandedGenerators.clear();
initialTemplate = template;
......@@ -57,7 +72,7 @@ public class FormatProcessor {
try {
outputLines = processTemplate(template); // echo %SimulationTopFile %%SelectedFile ; -> null
} finally {
callCount--;
topProcessor.callCount--;
}
if(!multiline) {
......@@ -80,7 +95,7 @@ public class FormatProcessor {
if(template.startsWith(CONTROL_SEQ, pos)) {
pos += CONTROL_SEQ_LEN;
// got different instance of ToolParamRecognizer with tool==null
RecognizerResult result = recognize(template, pos); // Already skipped blank lines (and spaces in each line, added separators - no, on deifferent level
RecognizerResult result = recognize(template, pos, topProcessor); // Already skipped blank lines (and spaces in each line, added separators - no, on different level
if(result != null && result.getGenerator() != null) {
assert result.getNewPos() > pos;
......@@ -111,9 +126,9 @@ public class FormatProcessor {
return outputLines;
}
private RecognizerResult recognize(String template, int pos) throws ToolException {
private RecognizerResult recognize(String template, int pos, FormatProcessor topProcessor) throws ToolException {
for(int i = 0; i < recognizers.length; i++) {
RecognizerResult result = recognizers[i].recognize(template, pos);
RecognizerResult result = recognizers[i].recognize(template, pos, topProcessor);
assert result != null;
......@@ -215,11 +230,19 @@ public class FormatProcessor {
"and try to detect the cyclic dependency by successively removing them.");
}
private static void pushGen(String genName) {
// private static void pushGen(String genName) {
private void pushGen(String genName) {
if (expandedGenerators.size()>5) System.out.println(">>PushGen("+genName+"):"+expandedGenerators.size());
expandedGenerators.add(genName);
}
private static void popGen() {
expandedGenerators.remove(expandedGenerators.size()-1);
// private static void popGen() {
private void popGen() {
try {
if (expandedGenerators.size()>6) System.out.println(">>PopGen():"+expandedGenerators.size());
expandedGenerators.remove(expandedGenerators.size()-1); // got -1
} catch (Exception e){
System.out.println("Failed to expandedGenerators.remove(expandedGenerators.size()-1), e="+e); // Andrey where does this concurrency come from? SOLVED: got rid of static
}
}
}
......@@ -95,7 +95,7 @@ public class ParamGroup extends UpdateableStringsContainer
}
public boolean isRelevant() {
return relevant == null || relevant.isTrue();
return relevant == null || relevant.isTrue(null); // null for topFormatProcessor (this value will not be used for other parameter value)
}
public List<String> getParams() {
......@@ -111,7 +111,7 @@ public class ParamGroup extends UpdateableStringsContainer
if(label == null)
label = paramGroup.label;
super.update(from);
super.update(from,null);// null for topFormatProcessor (this value will not be used for other parameter value)
}
}
......@@ -229,18 +229,18 @@ public class Parameter implements Cloneable, Updateable {
}
public boolean isVisible() {
return resolveBooleanFieldValue(visible, "visible");
return resolveBooleanFieldValue(visible, "visible", null); // the value will not be used in other parameters, null is OK
}
public boolean isReadOnly() {
return resolveBooleanFieldValue(readonly, "readonly");
return resolveBooleanFieldValue(readonly, "readonly", null); // the value will not be used in other parameters, null is OK
}
// checks whether the passed id belongs to this param's id
// it is only proper way to resolve parameter relevantness!
public boolean isSame(String paramID) {
if(paramID.equals(id)) {
if(relevant == null || relevant.isTrue())
if(relevant == null || relevant.isTrue(null))
return true;
}
......@@ -335,24 +335,24 @@ public class Parameter implements Cloneable, Updateable {
return currentValue;
}
public List<String> getDefaultValue() {
return getDefaultValue(false);
public List<String> getDefaultValue(FormatProcessor topProcessor) {
return getDefaultValue(false,topProcessor);
}
public List<String> getDefaultValue(boolean menuMode) {
String resolvedDefaultValue = ConditionUtils.resolveContextCondition(context, defaultValue);
public List<String> getDefaultValue(boolean menuMode,FormatProcessor topProcessor) {
String resolvedDefaultValue = ConditionUtils.resolveContextCondition(context, defaultValue, topProcessor);
String errmsg = "Parameter '" + id +
"' of context '" + context.getName() +
"' - error processing default value: ";
List<String> processedDefaultValue = null;
if (topProcessor==null) topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(new Recognizer[] {
//new RepeaterRecognizer(),
new SimpleGeneratorRecognizer(menuMode),
new ContextParamListRecognizer(context) // Andrey: returning list as the source parameter
new ContextParamListRecognizer(context, topProcessor) // Andrey: returning list as the source parameter
// new ContextParamRecognizer(context)
});
}, topProcessor);
try {
processedDefaultValue = processor.process(resolvedDefaultValue);
......@@ -482,19 +482,19 @@ public class Parameter implements Cloneable, Updateable {
// returns current value if it is set
// otherwise returns default value
public List<String> getValue() {
public List<String> getValue(FormatProcessor topProcessor) {
if(!currentValue.isEmpty())
return currentValue;
return getDefaultValue();
return getDefaultValue(topProcessor);
}
// returns external form of the current value unless it equals null;
// otherwise returns external form of the default value
public List<String> getExternalValueForm() {
public List<String> getExternalValueForm(FormatProcessor topProcessor) {
List<String> externalFormValue = new ArrayList<String>();
for(Iterator<String> i = getValue().iterator(); i.hasNext();) {
for(Iterator<String> i = getValue(topProcessor).iterator(); i.hasNext();) {
String elem = type.toExternalForm((String)i.next());
if(elem == null)
......@@ -514,9 +514,9 @@ public class Parameter implements Cloneable, Updateable {
currentValue.clear();
}
public String[] getCommandLine() throws ToolException {
String omit = getOmitValue();
List<String> value = getValue();
public String[] getCommandLine(FormatProcessor topProcessor) throws ToolException {
String omit = getOmitValue(topProcessor);
List<String> value = getValue(topProcessor);
if(value.size() == 1) {
if(omit != null && type.equal(omit, value.get(0)))
......@@ -524,13 +524,13 @@ public class Parameter implements Cloneable, Updateable {
}
String format = syntax.getFormat();
if (topProcessor==null) topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(new Recognizer[] {
new ParamFormatRecognizer(this),
new ParamRepeaterRecognizer(this),
new SimpleGeneratorRecognizer(),
new RepeaterRecognizer(),
});
},topProcessor);
List<String> commandLine = processor.process(format);
......@@ -628,14 +628,14 @@ public class Parameter implements Cloneable, Updateable {
// private stuff below
//
private String getOmitValue() {
private String getOmitValue(FormatProcessor topProcessor) {
if (topProcessor==null) topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(new Recognizer[] {
new ContextParamRecognizer(context),
new ContextParamRecognizer(context, topProcessor),
new SimpleGeneratorRecognizer()
},
false);
}, false,topProcessor);
String resolvedOmitValue = ConditionUtils.resolveContextCondition(context, omitValue);
String resolvedOmitValue = ConditionUtils.resolveContextCondition(context, omitValue, topProcessor);
String result = null;
if(resolvedOmitValue != null) {
......@@ -649,8 +649,8 @@ public class Parameter implements Cloneable, Updateable {
return result;
}
private boolean resolveBooleanFieldValue(String field, String fieldName) {
String fieldValue = ConditionUtils.resolveContextCondition(context, field);
private boolean resolveBooleanFieldValue(String field, String fieldName, FormatProcessor topProcessor) {
String fieldValue = ConditionUtils.resolveContextCondition(context, field, topProcessor);
if(!field.equals(fieldValue)) {
try {
......
......@@ -118,7 +118,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
private String resultFile; // used to overwrite name of the default result file that normally
// is calculated from result and timestamp;
private String openState=null; // (only for open sessions) - last successful result ran in this session
private String [] openState=null; // (only for open sessions) - last successful [name,result] ran in this session
private Tool openTool=null; // (only for open sessions) - tool last successful result ran in this session (null if none/failed)
private Tool restoreMaster; // Tool, for which this one is restore (or null if for none). Same restore for
// multiple masters is not allowed
......@@ -294,7 +294,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
public List<String> getDependStateNames() { return dependStateNames; }
public List<String> getDependFileNames() { return dependFileNames; }
public boolean isDirty() { return dirty || !hashMatch(); }
public boolean isDirty() { return dirty; }
public boolean isDirtyOrChanged() {
return isDirty() || !hashMatch();
}
......@@ -313,8 +313,14 @@ public class Tool extends Context implements Cloneable, Inheritable {
public TOOL_STATE getState() { return state; }
public boolean isPinned() { return pinned; }
public String getOpenState() { return openState; }
public void setOpenState(String stateName) { openState=stateName;}
public String getOpenStateName() { return (openState!=null)?openState[0]:null; }
public String getOpenStateFile() { return (openState!=null)?openState[1]:null; }
public void setOpenState(String stateName, String stateFile) {
if ((stateName!=null) && (stateFile!=null)) {
String [] pair={stateName, stateFile};
openState=pair;
}
}
public Tool getOpenTool() { return openTool; }
public void setOpenTool(Tool openTool) { this.openTool=openTool;}
......@@ -323,7 +329,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
public void setDirty(boolean dirty) {
this.dirty=dirty;
// toolFinished();
System.out.println("SetDirty("+dirty+")");
System.out.println("SetDirty("+dirty+") tool:"+getName());
}
public void setPinned(boolean pinned) {
this.pinned=pinned;
......@@ -333,10 +339,28 @@ public class Tool extends Context implements Cloneable, Inheritable {
}
}
public void setModeWait(
TOOL_MODE mode,
int choice,
String fullPath,
String ignoreFilter) {
setModeWait(new ToolWaitingArguments(
mode,
choice,
fullPath,
ignoreFilter));
}
public void setModeWait(ToolWaitingArguments toolWaitingArguments) {
this.toolWaitingArguments = toolWaitingArguments;
setMode(TOOL_MODE.WAIT);
}
public ToolWaitingArguments getToolWaitingArguments(){
return toolWaitingArguments;
}
public void setMode(TOOL_MODE mode) {
if (mode !=TOOL_MODE.WAIT) this.toolWaitingArguments = null;
......@@ -352,7 +376,10 @@ public class Tool extends Context implements Cloneable, Inheritable {
setTimeStamp(); // copy current time to tool timestamp
restoreTimeStamp=null;
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println(":::: Tool "+name+": setTimeStamp="+timeStamp);
System.out.println("::::: Tool "+name+": setTimeStamp="+timeStamp);
if (name.equals("VivadoTimingReportSynthesis")){
System.out.println("Tool.setMode()");
}
}
} else if (mode == TOOL_MODE.RESTORE){
if (restoreMaster!=null){
......@@ -381,7 +408,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
this.state=state;
// toolFinished();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("SetState("+state+")");
System.out.println("SetState("+state+") for tool "+getName());
}
}
......@@ -512,7 +539,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
public boolean isDisabled(){
if (abstractTool) return true; // abstract are always disabled
if (disabled==null) return false;
List<String> values=disabled.getValue();
List<String> values=disabled.getValue(null); // null for topFormatProcessor
if ((values==null) || (values.size()==0)) return false;
return (!values.get(0).equals("true"));
}
......@@ -582,7 +609,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
if ((dependFiles == null) || (dependFiles.size()==0)) return null;
List<String> list = new ArrayList<String>();
for (Iterator<Parameter> iter= dependFiles.iterator(); iter.hasNext();) {
List<String> vList=iter.next().getValue();
List<String> vList=iter.next().getValue(null); // null for topFormatProcessor
if (vList!=null) {
for (String item:vList){
if ((item!=null) && (item.trim().length()>0)){
......@@ -599,7 +626,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
if ((dependStates == null) || (dependStates.size()==0)) return null;
List<String> list = new ArrayList<String>();
for (Iterator<Parameter> iter= dependStates.iterator(); iter.hasNext();) {
List<String> vList=iter.next().getValue();
List<String> vList=iter.next().getValue(null); // null for topFormatProcessor
for (String item:vList){
if ((item!=null) && (item.trim().length()>0)){
list.add(item.trim());
......@@ -647,7 +674,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
"' is absent");
} else if(!(autoSave.getType() instanceof ParamTypeBool)) {
throw new ConfigException("Parameter autoSave='" + autoSaveString +
"' defined in "+result.getSourceXML()+" used for tool '" + name +
"' defined in "+autoSave.getSourceXML()+" used for tool '" + name +
"' must be of type '" + ParamTypeBool.NAME +
"'");
}
......@@ -655,14 +682,14 @@ public class Tool extends Context implements Cloneable, Inheritable {
public boolean getAutoSave(){
if (autoSave==null) return false;
List<String>result=autoSave.getValue();
List<String>result=autoSave.getValue(null); // null for topFormatProcessor
if (!result.isEmpty()) return result.get(0).equals("true");
return false;
}
public List<String> getResultNames(){
if (result==null) return null;
return result.getValue();
return result.getValue(null); // null for topFormatProcessor
}
public void initRestore() throws ConfigException{
......@@ -716,9 +743,9 @@ public class Tool extends Context implements Cloneable, Inheritable {
return saveTool;
}
public Tool getSaveMaster(){
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("getSaveMaster("+name+")-> "+((saveMaster==null)?"null":"NOT null"));
}
// if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
// System.out.println("getSaveMaster("+name+")-> "+((saveMaster==null)?"null":"NOT null"));
// }
return saveMaster;
}
......@@ -775,7 +802,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
public String getLogDir() {return getLogDir(true); }
public String getLogDir(boolean first) {
if (logDir!=null) { // has logDir specified, but may be empty
List<String> value=logDir.getValue();
List<String> value=logDir.getValue(null); // null for topFormatProcessor
if (value.size()==0) return null; // overwrites with empty
return value.get(0);
}
......@@ -788,7 +815,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
public String getStateDir() {return getStateDir(true); }
public String getStateDir(boolean first) {
if (stateDir!=null) { // has stateDir specified, but may be empty
List<String> value=stateDir.getValue();
List<String> value=stateDir.getValue(null); // null for topFormatProcessor
if (value.size()==0) return null; // overwrites with empty
return value.get(0);
}
......@@ -1021,12 +1048,12 @@ public class Tool extends Context implements Cloneable, Inheritable {
public String[] getExtensions() {
if(extensions == null)
return null;
FormatProcessor topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(
new Recognizer[] {
new ContextParamRecognizer(this),
new ContextParamRecognizer(this,topProcessor),
// new SimpleGeneratorRecognizer() // Andrey: Trying
});
},topProcessor); // null for topFormatProcessor - this generator can not reference other parameters
String[] actualExtensions = new String[extensions.size()];
......@@ -1054,13 +1081,13 @@ public class Tool extends Context implements Cloneable, Inheritable {
// Can be two different processors for labels and resources
//SimpleGeneratorRecognizer(true) may be not needed, as current file is already set here
FormatProcessor topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(
new Recognizer[] {
new ContextParamRecognizer(this),
new ContextParamRecognizer(this,topProcessor),
new SimpleGeneratorRecognizer(true) // in menuMode
// new SimpleGeneratorRecognizer(false) // in menuMode
});
},topProcessor); // null for topFormatProcessor - this generator can not reference other parameters
RunFor[] actualActions = new RunFor[runfor.size()];
......@@ -1095,12 +1122,13 @@ public class Tool extends Context implements Cloneable, Inheritable {
// Should be called after getMenuActions to have updateContextOptions() already ran
public String getIgnoreFilter(){ // calculate and get
if (ignoreFilter==null) return null;
FormatProcessor topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(
new Recognizer[] {
new ContextParamRecognizer(this),
new ContextParamRecognizer(this,topProcessor),
new SimpleGeneratorRecognizer(true) // in menuMode
// new SimpleGeneratorRecognizer(false) // in menuMode
});
},topProcessor); // null for topFormatProcessor - this generator can not reference other parameters
List<String> results=null;
try {
results=processor.process(ignoreFilter);
......@@ -1223,7 +1251,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
public BuildParamsItem[] buildParams(boolean dryRun) throws ToolException {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("tool "+getName()+" state="+getState()+" dirty="+isDirty()+" pinned="+isPinned()+" dryRun="+dryRun);
System.out.println("buildParams("+dryRun+"): tool "+getName()+" state="+getState()+" dirty="+isDirty()+" hashMatch()="+hashMatch()+" pinned="+isPinned());
}
if(parentPackage != null)
......@@ -1241,17 +1269,18 @@ public class Tool extends Context implements Cloneable, Inheritable {
}
protected List<String> buildCommandString(String paramStringTemplate)
protected List<String> buildCommandString(String paramStringTemplate, FormatProcessor topProcessor)
throws ToolException
{
if (topProcessor==null) topProcessor=new FormatProcessor(null,null);
FormatProcessor processor = new FormatProcessor(new Recognizer[] {
new ToolParamRecognizer(this),
new ToolParamRecognizer(this,topProcessor),
// new SimpleGeneratorRecognizer(),
new SimpleGeneratorRecognizer(this),
new RepeaterRecognizer(),
new ContextParamRecognizer(this),
new ContextParamRecognizer(this,topProcessor),
new ContextParamRepeaterRecognizer(this)
});
}, topProcessor); // topFormatProcessor=null: this value will not be used as other parameter value
return processor.process(paramStringTemplate);
}
......@@ -1397,7 +1426,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
//
private String getResolvedExeName() {
return ConditionUtils.resolveContextCondition(this, exeName);
return ConditionUtils.resolveContextCondition(this, exeName, null); // null for topFormatProcessor
}
/*
private String getResolvedShellName() {
......
......@@ -22,7 +22,6 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IActionBars;
......@@ -30,12 +29,12 @@ import org.eclipse.ui.IMemento;
import com.elphel.vdt.Txt;
import com.elphel.vdt.VDT;
import com.elphel.vdt.VerilogUtils;
import com.elphel.vdt.core.launching.LaunchCore;
import com.elphel.vdt.core.launching.ToolLogFile;
import com.elphel.vdt.core.tools.ToolsCore;
import com.elphel.vdt.core.tools.params.Tool.TOOL_MODE;
import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE;
import com.elphel.vdt.core.tools.params.Tool.ToolWaitingArguments;
import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.ui.options.FilteredFileSelector;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
......@@ -45,10 +44,12 @@ import com.elphel.vdt.veditor.preference.PreferenceStrings;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class ToolSequence {
......@@ -64,12 +65,13 @@ public class ToolSequence {
private static final String TAG_CURRENTSTATE_STATEFILE = ".currentState.stateFile.";
private static final String TAG_CURRENTSTATE_TOOLSTAMP = ".currentState.toolStamp.";
// private static final int MAX_TOOLS_TO_RUN=100;
private boolean shiftPressed=false;
private DesignFlowView designFlowView;
private boolean stopOn; // Stop button is pressed
private boolean saveOn; // save button is on
private Map<String,Tool> stateProvides;
private Map<String,Set<Tool>> stateProviders;
private Map<String,ToolStateStamp> currentStates;
private IMemento unfinishedMemento=null;
private String menuName=null;
......@@ -100,8 +102,6 @@ public class ToolSequence {
designFlowView.finalizeAfterVEditorDB(unfinishedMemento);
}
}
public void toolFinished(Tool tool){
doToolFinished(tool);
......@@ -121,7 +121,7 @@ public class ToolSequence {
}
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
System.out.println("\nTool "+tool.getName()+" FINISHED , state="+tool.getState()+", mode="+tool.getLastMode());
if (tool.getState()==TOOL_STATE.SUCCESS){
if ((tool.getState()==TOOL_STATE.SUCCESS) || (tool.getState()==TOOL_STATE.KEPT_OPEN)){
// Update state of the session(s) - should be done after run or restore
if ((tool.getLastMode()==TOOL_MODE.RUN) || (tool.getLastMode()==TOOL_MODE.RESTORE)){
boolean sessionUpdated=updateSessionTools(tool); // Update state
......@@ -132,7 +132,7 @@ public class ToolSequence {
restoreToolProperties(tool);// set last run hashcode and timestamp for the tool just restored
if (tool.getRestoreMaster()!=null) tool.setPinned(true);
else {
System.out.println("Pribably a bug - tool.getRestoreMaster()==null for "+tool.getName()+", while state is "+tool.getState());
System.out.println("Probably a bug - tool.getRestoreMaster()==null for "+tool.getName()+", while state is "+tool.getState());
tool.setPinned(true); // restored state should be pinned?
}
}
......@@ -142,7 +142,16 @@ public class ToolSequence {
if (tool.getLastMode()==TOOL_MODE.RUN) {
setDependState(tool);
}
setToolsDirtyFlag(false); // no need to recalculate all parameters here
setToolsDirtyFlag(false); // no need to recalculate all parameters here
// if (SelectedResourceManager.getDefault().isToolsLinked()) {
// System.out.println("===Propagating 'dirty' flags to dependent non-pinned tools");
// propagateDirty();
// }
if (isStop()){
releaseStop();
System.out.println("Stop was ctivated");
return; // do nothing more
}
// Check for stop here
if ((tool.getLastMode()==TOOL_MODE.RUN) || (tool.getLastMode()==TOOL_MODE.SAVE)){
......@@ -150,44 +159,269 @@ public class ToolSequence {
}
getToolsToSave(); // find if there are any sessions in unsaved state - returns list (not yet processed)
if (tryAutoSave(tool)) return; // started autoSave that will trigger "toolFinished" again
} else if (tool.getState()==TOOL_STATE.KEPT_OPEN){ // Got here after launching a session
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
System.out.println("\nTool "+tool.getName()+" kept open , state="+tool.getState()+", mode="+tool.getLastMode());
if (continueRunningTools()) return; // started next needed tool
// will get here if no more tools to run or failed to find one
Tool waitingTool=findWaitingTool();
if (waitingTool==null){
System.out.println("No tool is waiting to run, all done.");
return;
} else {
waitingTool.setState(TOOL_STATE.FAILURE); // should state be set to FAILURE?
waitingTool.setMode(TOOL_MODE.STOP);
String msg="Failed to find a tool to run for "+waitingTool.getName();
System.out.println(msg);
MessageUI.error(msg);
}
// } else if (tool.getState()==TOOL_STATE.KEPT_OPEN){ // Got here after launching a session
// if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
// System.out.println("\nTool "+tool.getName()+" kept open , state="+tool.getState()+", mode="+tool.getLastMode());
} else { // Process failures here
//Turn off any Waiting tool
Tool waitingTool=findWaitingTool();
if (waitingTool!=null){
waitingTool.setState(TOOL_STATE.FAILURE); // should state be set to FAILURE?
waitingTool.setMode(TOOL_MODE.STOP);
}
}
}
private boolean continueRunningTools(){
if (SelectedResourceManager.getDefault().isToolsLinked()){
Tool reportTool=findReportTool();
if (reportTool!=null){
// Launch report tool that can be ran from the current state
try {
launchNextTool(reportTool);
} catch (CoreException e) {
String msg="Failed to launch reportTool "+reportTool.getName()+" e="+e;
System.out.println(msg);
MessageUI.error(msg);
return false;
}
return true; // launched report tool
}
Tool waitingTool=findWaitingTool();
if (waitingTool!=null){
// prevent recursion - limit number of steps to the total number of tools (each should run once at most ?)
Tool nextTool=findToolToLaunch(waitingTool,ToolsCore.getConfig().getContextManager().getToolList().size());
if (nextTool!=null){
try {
launchNextTool(nextTool);
} catch (CoreException e) {
String msg="Failed to launch next tool "+nextTool.getName()+" e="+e;
System.out.println(msg);
MessageUI.error(msg);
return false;
}
return true; // launched next tool
}
return false; // failed to find tool to launch
}
return false; // nothing to do - no tool was waiting
} else {
return false; // tools are not linked
}
}
public void launchNextTool(Tool tool) throws CoreException {
// if (!okToRun()) return;
// setStateProvides(); // just testing
tool.setDesignFlowView(designFlowView); // maybe will not be needed with ToolSequencing class
if (tool.isWaiting()){
ToolWaitingArguments twa=tool.getToolWaitingArguments();
if (twa!=null){
SelectedResourceManager.getDefault().updateActionChoice(
twa.getFullPath(), //fullPath,
twa.getChoice(), // choice,
twa.getIgnoreFilter()); //ignoreFilter);
tool.setMode(twa.getMode()) ; //TOOL_MODE.RUN);
tool.setChoice(twa.getChoice());
LaunchCore.launch( tool,
SelectedResourceManager.getDefault().getSelectedProject(),
twa.getFullPath(),
null); // run, not playback
return;
}
}
tool.setMode(TOOL_MODE.RUN) ; //TOOL_MODE.RUN);
// tool.toolFinished();
tool.setChoice(0);
// SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice, ignoreFilter); // Andrey
// SelectedResourceManager.getDefault().setBuildStamp(); // Andrey
// apply designFlowView to the tool itself
LaunchCore.launch( tool,
SelectedResourceManager.getDefault().getSelectedProject(),
SelectedResourceManager.getDefault().getChosenTarget(),
null); // run, not playback
} // launchTool()
/**
* Find which tool to run to satisfy dependency of the specified tool (may be recursive - make sure no loops)
* @param tool tool to satisfy dependency for
* @param numSteps Maximal number of tools to run automatically (to prevent recursion)
* @return tool to run or null - failed to find any
*/
private Tool findToolToLaunch(Tool tool, boolean launchSessions){
// TODO: support session-less states
private Tool findToolToLaunch(Tool tool, int numSteps){
if (numSteps<0){
MessageUI.error("Maximal number of tool steps exceeded");
return null;
}
// get list of states of the open sessions
List<Tool> sessions=getOpenSessions();
Map<String,String> openStates=new ConcurrentHashMap<String,String>();
for (Tool session:sessions){
if (session.getOpenStateName() != null) openStates.put(session.getOpenStateName(),session.getOpenStateFile());
}
// First see if all the state dependencies are met
List<String> depStates=tool.getDependStates();
// restore tools should not have any dependencies but console, check it here just in case
if (!tool.isPinned() && (depStates!=null) && (tool.getRestoreMaster()==null)) for (String state:depStates){
// see if the state is available, good and not dirty
System.out.println("findToolToLaunch("+tool.getName()+" state= "+state);
ToolStateStamp tss=currentStates.get(state);
// Check that this state provider
if (tss!=null){
System.out.println("State "+state+" tss.toolName="+tss.toolName+" tss.toolStateFile="+tss.toolStateFile+" tss.toolStamp="+tss.toolStamp );
if ((tss.getToolName()!=null) ){
Tool depTool=ToolsCore.getContextManager().findTool(tss.getToolName());
if ((depTool.getState()==TOOL_STATE.SUCCESS) &&
(depTool.isPinned() || !depTool.isDirtyOrChanged())){
System.out.println("depTool= "+depTool.getName());
// dependency satisfied, but is this state current for some session?
for (String osn:openStates.keySet()){
System.out.println("-- openStateName="+osn+" state="+state); // openState - with ts, state - link
}
if (openStates.keySet().contains(state)){
continue; // dependency satisfied and the state is open
} else {
// The state was achieved, but it is not current. Try restore tool if possible
System.out.println("State "+state+" was previously achieved, but it is not current - will need to restore/re-run");
// just do nothing here and fall through to tss be set to null ?
}
}
}
tss=null; // missing or dirty tool - will need to re-run
}
if (tss==null){
System.out.println("State "+state+" is not available");
if (stateProviders.containsKey(state)){
Set<Tool> providersSet=stateProviders.get(state);
for (Tool provider:providersSet){
if (!provider.isDisabled()){
System.out.println("For wanted tool "+tool.getName()+
" using tool "+provider.getName()+
" to get needed state "+state);
return findToolToLaunch(provider, numSteps-1);
}
}
MessageUI.error("Could not find enabled tool to provide state "+state);
System.out.println("Could not find enabled tool to provide state "+state);
return null;
} else {
MessageUI.error("No tool provide state "+state);
System.out.println("No tool provide state "+state);
return null;
}
}
}
// Got here if all state dependencies are met (or there are none)
// Does the tool need a console that needs to be started?
List<Tool> consoleTools= getUsedConsoles(tool);
if (launchSessions) for (Tool consoleTool:consoleTools){ // or maybe do it after other dependencies?
for (Tool consoleTool:consoleTools){ // or maybe do it after other dependencies?
if (consoleTool.getState()!=TOOL_STATE.KEPT_OPEN) {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
System.out.println("Need to launch tool"+consoleTool.getName()+" to satisfy dependencies of tool "+tool.getName());
}
return consoleTool;
return consoleTool; // start the console session
}
}
// All session tools are running
return null;
// everything is met to run this tool. Can we just restore it instead (only if it is not in WAIT state)
if (tool.isWaiting()){
System.out.println("OK to run waiting tool "+tool.getName());
return tool;
}
if ((tool.getRestore()!=null) &&
(tool.isPinned() || !tool.isDirtyOrChanged()) &&
(tool.getState() == TOOL_STATE.SUCCESS)){
System.out.println("Try to restore tool "+tool.getName()+" using "+tool.getRestore());
return tool.getRestore();
}
System.out.println("All cleared to run "+tool.getName());
return tool;
}
/**
* Find enabled tool that can be ran from the current state without changing it (such as various reports)
* and is "dirty" or never ran
* @return found tool to launch or null
*/
private Tool findReportTool(){
// get open session(s)
List<Tool> sessions=getOpenSessions();
if (sessions.size()==0) return null;
Map<String,String> openStates=new ConcurrentHashMap<String,String>();
for (Tool session:sessions){
if (session.getOpenStateName() != null) openStates.put(session.getOpenStateName(),session.getOpenStateFile());
}
if (openStates.size()==0) return null;
for (Tool tool:ToolsCore.getConfig().getContextManager().getToolList()){
if (
tool.isDisabled() || // disabled tool (or abstract)
(tool.getSaveMaster()!=null) || // Is Save tool
(tool.getRestoreMaster()!=null) || // or is Restore tool
(tool.getStateLink()!=null)) { // or changes output state(s)
continue;
}
// already good and nothing changed?
if (
(tool.getState()==TOOL_STATE.SUCCESS) && !tool.isDirtyOrChanged()){
continue;
}
// dependencies met (and do exist)?
List<String> depStates=tool.getDependStates();
if ((depStates==null) || (depStates.size()==0)){
continue; // no dependencies at all;
}
boolean met=true;
for (String state:depStates){
if (!openStates.keySet().contains(state)){
met=false;
break;
}
}
if (!met) {
continue; // dependencies not among open session states (TODO: what about non-session states?
}
return tool; // All checks passed, return this tool
}
return null; // Nothing found
}
/**
* Setup what tools can provide needed states
*/
public void setStateProvides(){
stateProvides=new ConcurrentHashMap<String,Tool>();
stateProviders=new ConcurrentHashMap<String,Set<Tool>>();
for (Tool tool : ToolsCore.getConfig().getContextManager().getToolList()){
System.out.println("Looking for all states defined, tool= "+tool.getName());
if (!tool.isDisabled()){
String state=tool.getStateLink(); // some tools (like reports) do not change states
if (state!=null) stateProvides.put(state,tool);
if (state!=null) {
// stateProviders.putIfAbsent(state,(Set<Tool>) new HashSet<Tool>());
if (!stateProviders.containsKey(state)){
stateProviders.put(state,(Set<Tool>) new HashSet<Tool>());
}
stateProviders.get(state).add(tool);
}
}
}
// Verify that each dependent state has a provider
......@@ -197,7 +431,7 @@ public class ToolSequence {
List<String> dependStates=tool.getDependStates();
if ((dependStates!=null) && (dependStates.size()>0)){
for (String state:dependStates){
if (!stateProvides.containsKey(state)){
if (!stateProviders.containsKey(state)){
MessageUI.error("No tool provide output state '"+state+"' needed to satisfy dependency of the tool "+tool.getName());
System.out.println("No tool provide output state '"+state+"' needed to satisfy dependency of the tool "+tool.getName());
}
......@@ -207,7 +441,7 @@ public class ToolSequence {
}
// List<String> list = new ArrayList<String>(hashset);
System.out.println("Got "+stateProvides.keySet().size()+" different states, number of mappings="+stateProvides.keySet().size());
System.out.println("Got "+stateProviders.keySet().size()+" different states, number of mappings="+stateProviders.keySet().size());
// For each state - find latest tool that made it
......@@ -230,11 +464,21 @@ public class ToolSequence {
tool.setChoice(0);
SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice, ignoreFilter); // Andrey
SelectedResourceManager.getDefault().setBuildStamp(); // Andrey
// apply designFlowView to the tool itself
LaunchCore.launch( tool,
SelectedResourceManager.getDefault().getSelectedProject(),
fullPath,
null); // run, not playback
if (((mode==TOOL_MODE.RUN) || (mode==TOOL_MODE.RESTORE)) && SelectedResourceManager.getDefault().isToolsLinked()){
tool.setModeWait(
mode,
choice,
fullPath,
ignoreFilter);
if (!continueRunningTools()){
System.out.println("Failed to initiate continueRunningTools() for tool="+tool.getName());
}
} else {
LaunchCore.launch( tool,
SelectedResourceManager.getDefault().getSelectedProject(),
fullPath,
null); // run, not playback
}
} // launchTool()
// TODO: restore "working copy" functionality here to be able to play back logs while tools are running
......@@ -296,9 +540,30 @@ public class ToolSequence {
stopAllRunnig();
}
}
public void releaseStop(){
this.stopOn=false;
designFlowView.setToggleStopTools(false);
}
public void setSave(boolean pressed){
this.saveOn=pressed;
if (saveOn){
List<Tool> toolsToSave=getToolsToSave(); // find if there are any sessions in unsaved state - returns list (not yet processed)
if ((toolsToSave==null) || (toolsToSave.size()==0)){
System.out.println("Nothing to save - how was the button pressed?");
releaseSave();
return;
}
tryAutoSave(toolsToSave.get(0)); // launch autosave and trigger toolFinished() when done
}
}
public void releaseSave(){
this.saveOn=false;
designFlowView.setToggleSaveTools(false);
}
public boolean isStop(){
return stopOn;
}
......@@ -313,12 +578,11 @@ public class ToolSequence {
IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
List<Tool> sessionList=new ArrayList<Tool>();
for (Tool tool : ToolsCore.getConfig().getContextManager().getToolList()){
System.out.println("Looking for open console: "+tool.getName()+
" state="+tool.getState());
// System.out.println("Looking for open console: "+tool.getName()+ " state="+tool.getState());
if (
(tool.getState()==TOOL_STATE.KEPT_OPEN) &&
(tool.getOpenTool()!=null) &&
(tool.getOpenState()!=null)){
(tool.getOpenStateFile()!=null)){
// See if state file is not saved
Tool ranTool=tool.getOpenTool();
String stateDirString=ranTool.getStateDir();
......@@ -333,9 +597,20 @@ public class ToolSequence {
}
IFolder stateDir= project.getFolder((stateDirString==null)?"":stateDirString);
IFile link= stateDir.getFile(linkString); // null
IFile target= stateDir.getFile(tool.getOpenState());
System.out.println("****link.getRawLocation()= "+link.getRawLocation().toString());
System.out.println("****target.getLocation()= "+target.getLocation().toString());
IFile target= stateDir.getFile(tool.getOpenStateFile());
System.out.println("*****link.getRawLocation()= "+link.getRawLocation().toString());
System.out.println("******target.getLocation()= "+target.getLocation().toString());
// Debug
try {
Map<QualifiedName,String> allPP= target.getPersistentProperties();
System.out.println("1. Getting persistent properties from properties from "+target.getLocation().toOSString()+" / "+tool.getOpenStateFile());
for (QualifiedName qn:allPP.keySet()){
System.out.println("... "+qn.toString()+": "+allPP.get(qn));
}
} catch (CoreException e2) {
System.out.println("Failed to get persistent properties from "+target.getLocation().toOSString());
}
sessionList.add(tool);
}
}
......@@ -361,7 +636,7 @@ public class ToolSequence {
if (
(tool.getState()==TOOL_STATE.KEPT_OPEN) &&
(tool.getOpenTool()!=null) &&
(tool.getOpenState()!=null)){
(tool.getOpenStateFile()!=null)){
// See if state file is not saved
Tool ranTool=tool.getOpenTool();
String stateDirString=ranTool.getStateDir();
......@@ -376,13 +651,24 @@ public class ToolSequence {
}
IFolder stateDir= project.getFolder((stateDirString==null)?"":stateDirString);
IFile link= stateDir.getFile(linkString); // null
IFile target= stateDir.getFile(tool.getOpenState());
System.out.println("****link.getRawLocation()= "+link.getRawLocation().toString());
System.out.println("****target.getLocation()= "+target.getLocation().toString());
IFile target= stateDir.getFile(tool.getOpenStateFile());
System.out.println("**link.getRawLocation()= "+link.getRawLocation().toString());
System.out.println("***target.getLocation()= "+target.getLocation().toString());
if (!link.getRawLocation().toString().equals(target.getLocation().toString())){
saveToolsList.add(ranTool);
System.out.println("****Adding= "+ranTool.getName());
}
// Debug
try {
Map<QualifiedName,String> allPP= target.getPersistentProperties();
System.out.println("2. Getting persistent properties from properties from "+target.getLocation().toOSString()+" / "+tool.getOpenStateFile());
for (QualifiedName qn:allPP.keySet()){
System.out.println("... "+qn.toString()+": "+allPP.get(qn));
}
} catch (CoreException e2) {
System.out.println("Failed to get persistent properties from "+target.getLocation().toOSString());
}
}
}
return saveToolsList;
......@@ -390,20 +676,29 @@ public class ToolSequence {
//TODO: make possible to run multiple tools async if they do not share common session
public boolean isAnyToolRunnigOrWaiting(){
IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
List<Tool> saveToolsList=new ArrayList<Tool>();
// IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
// List<Tool> saveToolsList=new ArrayList<Tool>();
for (Tool tool : ToolsCore.getConfig().getContextManager().getToolList()){
if (tool.isRunning() || tool.isWaiting()) return true;
}
return false;
}
private Tool findWaitingTool(){
for (Tool tool : ToolsCore.getConfig().getContextManager().getToolList()){
if (tool.isWaiting()) return tool;
}
return null;
}
// call when double-click on stop?
public void stopAllRunnig(){ // does not actually stop - just marks as if stopped for debug purposes
IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
List<Tool> saveToolsList=new ArrayList<Tool>();
// IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
// List<Tool> saveToolsList=new ArrayList<Tool>();
for (Tool tool : ToolsCore.getConfig().getContextManager().getToolList()){
if (tool.isRunning()) {
if (tool.isRunning() || tool.isWaiting()) {
tool.setState(TOOL_STATE.FAILURE);
tool.setMode(TOOL_MODE.STOP);
}
......@@ -413,22 +708,40 @@ public class ToolSequence {
public boolean restoreToolProperties(Tool tool){
if (tool.getLastMode()!=TOOL_MODE.RESTORE) return false;
if (tool.getRestoreMaster()!=null) tool=tool.getRestoreMaster();
String targetString=tool.getStateFile(); // With timestamp or specifically set through selection
if (tool.getRestoreMaster()!=null) {
// System.out.println("restoreToolProperties("+tool.getName()+") tool.getRestoreMaster()="+tool.getRestoreMaster().getName()+" tool.getStateFile()="+tool.getStateFile());
// System.out.println("tool.getRestoreMaster().getStateFile()="+tool.getRestoreMaster().getStateFile());
// targetString=tool.getResultName(); // after restore this is the actual file name
targetString=tool.getStateFile();
System.out.println("targetString="+targetString+" tool.getName()="+tool.getName()+"tool.getRestoreMaster().getName()="+tool.getRestoreMaster().getName());
tool=tool.getRestoreMaster();
}
else {
System.out.println("Tool "+tool.getName()+" does not have restoreMaster, but it came with getLastMode()!=TOOL_MODE.RESTORE");
}
String stateDirString=tool.getStateDir();
// String linkString=tool.getStateLink();
String targetString=tool.getStateFile(); // With timestamp or specifically set through selection
System.out.println("Tool "+tool.getName()+" getStateDir()="+tool.getStateDir());
IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
IFolder stateDir= project.getFolder((stateDirString==null)?"":stateDirString);
// Create file for target and see if it actually exists
IFile target= stateDir.getFile(targetString);
IFile target= stateDir.getFile(targetString); //null po
if (!target.exists()){
System.out.println("BUG: file that was just restored does not exist: "+
target.getLocation().toOSString());
return false;
}
// Debug
try {
Map<QualifiedName,String> allPP= target.getPersistentProperties();
System.out.println("3. Getting persistent properties from properties from "+target.getLocation().toOSString()+" / "+targetString);
for (QualifiedName qn:allPP.keySet()){
System.out.println("... "+qn.toString()+": "+allPP.get(qn));
}
} catch (CoreException e2) {
System.out.println("Failed to get persistent properties from "+target.getLocation().toOSString());
}
String timestamp=null;
String sHashCode=null;
int hashCode=0;
......@@ -444,6 +757,8 @@ public class ToolSequence {
System.out.println("Got hashcode="+hashCode+" ("+sHashCode+") in "+target.getLocation().toOSString());
} catch (CoreException e) {
System.out.println("No hashcode in "+target.getLocation().toOSString());
} catch (NumberFormatException e1){
System.out.println("Bad hashcode "+sHashCode+" in "+target.getLocation().toOSString());
}
if (timestamp!=null) {
tool.setTimeStamp(timestamp);
......@@ -465,7 +780,7 @@ public class ToolSequence {
}
if ((stateToolName==null) || !tool.getName().equals(stateToolName)){
System.out.println("State file "+target.getLocation().toOSString()+" was saved for tool "+stateToolName+
", while restoring tool is "+tool.getName()+" - ivalidating all dependencies timestamps.");
", while restoring tool is "+tool.getName()+" - invalidating all dependencies timestamps.");
tool.clearDependStamps();
return false;
}
......@@ -495,7 +810,7 @@ public class ToolSequence {
private boolean tryAutoSave(Tool tool){
if ((tool.getSave()!=null) && // save tool exists
tool.getAutoSave() && // autosave enabled
(tool.getAutoSave() || isSave())&& // autosave enabled or save button pressed
(designFlowView!=null) && // not needed anymore?
(tool.getLastMode()==TOOL_MODE.RUN)) { // it was not playback of logs
final Tool fTool=tool.getSave();
......@@ -530,8 +845,21 @@ public class ToolSequence {
tool=tool.getSaveMaster();
tool.setMode(TOOL_MODE.STOP);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("Finished autosave tool "+tool.getName()+" for "+tool.getName());
System.out.println("Finished (auto)save tool "+tool.getName()+" for "+tool.getName());
}
if (isSave()) { // more to save?
List<Tool> toolsToSave=getToolsToSave(); // find if there are any sessions in unsaved state - returns list (not yet processed)
if ((toolsToSave!=null) && (toolsToSave.size()>=0)){
if (toolsToSave.get(0).getSaveMaster()!=null){
System.out.println("Seems to be a BUG that might cause infinite attempts to save while processing tool "+
tool.getName()+", first save tool "+toolsToSave.get(0).getName()+
", saveMaster()="+toolsToSave.get(0).getSaveMaster().getName());
return false;
}
if (tryAutoSave(toolsToSave.get(0))) return true;
}
}
releaseSave();
}
return false;
}
......@@ -551,7 +879,7 @@ public class ToolSequence {
String linkString=tool.getStateLink();
String targetString=tool.getStateFile(); // With timestamp or specifically set through selection
System.out.println("Tool:"+tool.getName()+
System.out.println("updateLinkLatest("+tool.getName()+")"+
" stateDirString="+stateDirString+
" linkString ="+linkString+
" targetString="+targetString);
......@@ -577,11 +905,17 @@ public class ToolSequence {
" in "+stateDirString+": "+target.getLocation());
return; // No link created as there was no snapshot, but the console state is valid.
}
if (linkString==null){
System.out.println("No link name available for "+tool.getName());
return;
}
// Debug
try {
Map<QualifiedName,String> allPP= target.getPersistentProperties();
System.out.println("4. Getting persistent properties from properties from "+target.getLocation().toOSString());
for (QualifiedName qn:allPP.keySet()){
System.out.println("... "+qn.toString()+": "+allPP.get(qn));
}
} catch (CoreException e2) {
System.out.println("Failed to get persistent properties from "+target.getLocation().toOSString());
}
IFile link= stateDir.getFile(linkString);
try {
......@@ -662,6 +996,24 @@ public class ToolSequence {
" on "+target.getLocation().toOSString());
}
}
// debug - readback:
try {
target.refreshLocal(0, null); // long-running
} catch (CoreException e1) {
System.out.println("Failed to refreshLocal "+target.getLocation().toOSString()+" e="+e1.toString());
}
try {
Map<QualifiedName,String> allPP= target.getPersistentProperties();
System.out.println("5. Getting persistent properties from properties from "+target.getLocation().toOSString());
for (QualifiedName qn:allPP.keySet()){
System.out.println("... "+qn.toString()+": "+allPP.get(qn));
}
} catch (CoreException e2) {
System.out.println("Failed to get persistent properties from "+target.getLocation().toOSString());
}
}
/**
......@@ -671,6 +1023,8 @@ public class ToolSequence {
*/
private boolean updateSessionTools(Tool tool){
String targetString=tool.getStateFile();
String linkString= tool.getStateLink();
// after restore this may be a non-timestamp file - use current timestamp instead of the restored?
if (targetString==null){
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
......@@ -684,7 +1038,7 @@ public class ToolSequence {
if (sessionList.size()>0){
for(Iterator<Tool> iter = sessionList.iterator(); iter.hasNext();) {
Tool consoleTool=iter.next();
consoleTool.setOpenState(targetString);
consoleTool.setOpenState(linkString,targetString);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
System.out.println("Set openState of "+consoleTool.getName()+" to "+targetString);
if (tool.getRestoreMaster()!=null) { // after restore save master tool
......@@ -841,7 +1195,7 @@ public class ToolSequence {
}
setStateProvides(); // Can be called just once - during initialization?
for (String state:stateProvides.keySet()){
for (String state:stateProviders.keySet()){
if ( mementoKeysMap.containsKey(state+TAG_CURRENTSTATE_TOOLNAME)) {
currentStates.put(state,new ToolStateStamp(
memento.getString(state+TAG_CURRENTSTATE_TOOLNAME),
......@@ -864,6 +1218,8 @@ public class ToolSequence {
}
public void putCurrentState(Tool tool){
if (tool.getRestoreMaster()!=null) tool.getRestoreMaster();
else if (tool.getSaveMaster()!=null) tool.getSaveMaster();
String linkString=tool.getStateLink(); // name of the state file w/o timestamp
if (linkString!=null) currentStates.put(linkString, new ToolStateStamp(tool));
}
......@@ -889,6 +1245,63 @@ public class ToolSequence {
tool.setDirty(!matchDependState(tool));
}
}
// why did it fail?
if (SelectedResourceManager.getDefault().isToolsLinked()) {
System.out.println("====Propagating 'dirty' flags to dependent non-pinned tools");
propagateDirty();
}
}
private void propagateDirty(){
boolean newDirty=false;
// private Map<String,ToolStateStamp> currentStates;
for (Tool tool : ToolsCore.getConfig().getContextManager().getToolList()){
if (
tool.isDisabled() || // disabled tool (or abstract)
(tool.getSaveMaster()!=null) || // Is Save tool
(tool.getRestoreMaster()!=null)){ // or is Restore tool
continue;
}
if (!tool.isDirty()){
List<String> depStates=tool.getDependStates();
if ((depStates==null) || (depStates.size()==0)){
continue; // no dependencies at all;
}
boolean met=true;
if (currentStates!=null) for (String state:depStates){
Tool provider=(currentStates.get(state)==null)?null: ToolsCore.getTool(currentStates.get(state).getToolName());
if (provider==null){
met=false;
System.out.println("No providers for depend state "+state);
break;
}
if (provider.getRestoreMaster()!=null){
System.out.println("propagateDirty(): should not happen: tool "+
provider.getName()+".getRestoreMaster()="+
provider.getRestoreMaster().getName());
provider=provider.getRestoreMaster();
} else if (provider.getSaveMaster()!=null){
System.out.println("propagateDirty(): should not happen: tool "+
provider.getName()+".getSaveMaster()="+
provider.getSaveMaster().getName());
provider=provider.getSaveMaster();
}
if (provider.isDirty() && !provider.isPinned()){
met=false;
System.out.println("Provider for depend state "+state+" - "+provider.getName()+" : isDirty()="+
provider.isDirty()+", provider.isPinned()="+provider.isPinned());
break;
}
}
if (!met) {
tool.setDirty(true);
newDirty=true;
}
}
}
if (newDirty) propagateDirty(); // recursive call until no more new tools are marked dirty
}
/**
......
......@@ -19,7 +19,9 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.List;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public interface AbstractConditonValue {
public abstract String getValue();
public abstract String getValue(FormatProcessor topProcessor);
public abstract List<String> getDependencies();
}
......@@ -19,6 +19,8 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.List;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public abstract class Comparison extends Condition {
protected COMPARE_OP op;
......@@ -41,6 +43,6 @@ public abstract class Comparison extends Condition {
}
public abstract boolean equals(Object other);
public abstract boolean isTrue();
public abstract boolean isTrue(FormatProcessor topProcessor);
public abstract List<String> getDependencies();
}
......@@ -19,6 +19,8 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.*;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public class Condition {
private Condition left, right;
private BOOL_OP op;
......@@ -60,8 +62,8 @@ public class Condition {
right.equals(otherCondition.right);
}
public boolean isTrue() {
return op.isTrue(left.isTrue(), right.isTrue());
public boolean isTrue(FormatProcessor topProcessor) {
return op.isTrue(left.isTrue(topProcessor), right.isTrue(topProcessor));
}
public List<String> getDependencies() {
......
......@@ -19,6 +19,8 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.*;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public class ConditionString extends ConditionValue {
private String value;
......@@ -28,8 +30,8 @@ public class ConditionString extends ConditionValue {
this.value = value;
}
public String getValue() {
return condition.isTrue()? value : null;
public String getValue(FormatProcessor topProcessor) {
return condition.isTrue(topProcessor)? value : null;
}
public List<String> getDependencies() {
......
......@@ -20,6 +20,7 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.*;
import com.elphel.vdt.core.tools.contexts.Context;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.ui.MessageUI;
public class ConditionUtils {
......@@ -33,7 +34,7 @@ public class ConditionUtils {
Condition relevant = entry.getCondition();
List<String> strings = entry.getStrings();
if(relevant == null || relevant.isTrue())
if(relevant == null || relevant.isTrue(null))
relevantStrings.addAll(strings);
}
......@@ -68,11 +69,11 @@ public class ConditionUtils {
return condValue;
}
public static String resolveContextCondition(Context context, String condString) {
public static String resolveContextCondition(Context context, String condString, FormatProcessor topProcessor) {
MultiConditionValue condValue = getContextCondition(context, condString);
if(condValue != null)
return condValue.getValue();
return condValue.getValue(topProcessor);
return condString;
}
......
......@@ -19,6 +19,8 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.List;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public abstract class ConditionValue implements AbstractConditonValue {
protected Condition condition;
......@@ -26,6 +28,6 @@ public abstract class ConditionValue implements AbstractConditonValue {
this.condition = condition;
}
public abstract String getValue();
public abstract String getValue(FormatProcessor topProcessor);
public abstract List<String> getDependencies();
}
......@@ -19,6 +19,8 @@ package com.elphel.vdt.core.tools.params.conditions;
import java.util.*;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public class MultiConditionValue implements AbstractConditonValue {
private List<ConditionValue> conditionValues;
private String defaultString;
......@@ -33,9 +35,9 @@ public class MultiConditionValue implements AbstractConditonValue {
this.defaultString = defaultString;
}
public String getValue() {
public String getValue(FormatProcessor topProcessor) {
for(Iterator<ConditionValue> i = conditionValues.iterator(); i.hasNext();) {
String value = ((ConditionValue)i.next()).getValue();
String value = ((ConditionValue)i.next()).getValue(topProcessor);
if(value != null)
return value;
......
......@@ -31,7 +31,9 @@ import com.elphel.vdt.ui.MessageUI;
public class StringComparison extends Comparison {
private Context context;
private String left, right;
private FormatProcessor topProcessor;
// constructor should not reference topProcessor (it is only used at startup)
public StringComparison(COMPARE_OP op, String left, String right) {
this(op, null, left, right);
}
......@@ -59,16 +61,17 @@ public class StringComparison extends Comparison {
right.equals(otherComparison.right);
}
public boolean isTrue() {
public boolean isTrue(FormatProcessor topProcessor) {
String actualLeft = left;
String actualRight = right;
if(context != null) {
if (topProcessor==null) topProcessor=new FormatProcessor(null,null);
FormatProcessor processor =
new FormatProcessor(new Recognizer[] {
new ContextParamRecognizer(context),
new ContextParamRecognizer(context,topProcessor),
new SimpleGeneratorRecognizer()
});
},topProcessor);
try {
actualLeft = processor.process(left).get(0);
......
......@@ -22,6 +22,7 @@ import java.util.List;
import com.elphel.vdt.core.tools.Updateable;
import com.elphel.vdt.core.tools.config.ConfigException;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public abstract class UpdateableStringsContainer implements Updateable {
private final static String FIRST_MARK = "first";
......@@ -42,7 +43,7 @@ public abstract class UpdateableStringsContainer implements Updateable {
public abstract boolean matches(Updateable other);
public abstract Object clone();
public void update(Updateable from) throws ConfigException {
public void update(Updateable from, FormatProcessor topProcessor) throws ConfigException {
UpdateableStringsContainer container = (UpdateableStringsContainer)from;
ConditionalStringsList oldStrings =
......@@ -53,11 +54,11 @@ public abstract class UpdateableStringsContainer implements Updateable {
strings = oldStrings;
insertSpecifiedStrings();
insertSpecifiedStrings(topProcessor);
deleteSpecifiedStrings();
}
private void insertSpecifiedStrings() throws ConfigException {
private void insertSpecifiedStrings(FormatProcessor topProcessor) throws ConfigException {
if(insertStrings == null)
return;
......@@ -83,7 +84,7 @@ public abstract class UpdateableStringsContainer implements Updateable {
Condition cond = entry.getCondition();
if(cond != null && !cond.isTrue())
if(cond != null && !cond.isTrue(topProcessor))
continue;
// okay, entry found, and the condition is met
......
......@@ -17,6 +17,7 @@
*******************************************************************************/
package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
import com.elphel.vdt.core.tools.params.ToolException;
import com.elphel.vdt.core.tools.contexts.Context;
......@@ -27,8 +28,9 @@ import com.elphel.vdt.core.tools.generators.ValueGenerator;
public class ContextParamListRecognizer extends ParamRecognizer {
private Context context;
public ContextParamListRecognizer(Context context) {
public ContextParamListRecognizer(Context context,FormatProcessor topProcessor) {
this.context = context;
this.topProcessor=topProcessor;
}
protected Parameter findParam(String paramID) {
......@@ -36,6 +38,6 @@ public class ContextParamListRecognizer extends ParamRecognizer {
}
protected AbstractGenerator getGenerator(Parameter param) throws ToolException {
return new ValueGenerator(param, "", "", null); // will return list value of the parameter
return new ValueGenerator(param, "", "", null, topProcessor); // will return list value of the parameter
}
}
......@@ -17,6 +17,7 @@
*******************************************************************************/
package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
import com.elphel.vdt.core.tools.params.ToolException;
import com.elphel.vdt.core.tools.contexts.Context;
......@@ -27,8 +28,9 @@ import com.elphel.vdt.core.tools.generators.ValueGenerator;
public class ContextParamRecognizer extends ParamRecognizer {
private Context context;
public ContextParamRecognizer(Context context) {
public ContextParamRecognizer(Context context, FormatProcessor topProcessor) {
this.context = context;
this.topProcessor=topProcessor;
}
protected Parameter findParam(String paramID) {
......@@ -36,6 +38,6 @@ public class ContextParamRecognizer extends ParamRecognizer {
}
protected AbstractGenerator getGenerator(Parameter param) throws ToolException {
return new ValueGenerator(param, "", "", "");
return new ValueGenerator(param, "", "", "",topProcessor);
}
}
......@@ -20,6 +20,7 @@ package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.tools.contexts.Context;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
import com.elphel.vdt.core.tools.generators.ValueGenerator;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
......@@ -33,12 +34,13 @@ public class ContextParamRepeaterRecognizer extends RepeaterRecognizer {
protected AbstractGenerator findGenerator(String paramID,
String repPrefix,
String repSuffix,
String separator)
String separator,
FormatProcessor topProcessor)
{
Parameter param = context.findParam(paramID);
if(param != null)
return new ValueGenerator(param, repPrefix, repSuffix, separator);
return new ValueGenerator(param, repPrefix, repSuffix, separator,topProcessor);
return null;
}
......
......@@ -18,6 +18,7 @@
package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.Utils;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
......@@ -40,7 +41,7 @@ public class ParamFormatRecognizer implements Recognizer {
this.param = param;
}
public RecognizerResult recognize(String template, int startPos) {
public RecognizerResult recognize(String template, int startPos, FormatProcessor topProcessor) {
RecognizerResult result = new RecognizerResult();
String genName;
int newPos = -1;
......@@ -67,7 +68,7 @@ public class ParamFormatRecognizer implements Recognizer {
assert newPos >= 0;
if(genName.equals(FORMAT_PARAM_NAME_MARK)) {
result.set(new AbstractGenerator() {
result.set(new AbstractGenerator(topProcessor) {
public String getName() {
return "ParamName (parameter '" + param.getID() +
"' of context '" + param.getContext().getName() +
......@@ -79,9 +80,9 @@ public class ParamFormatRecognizer implements Recognizer {
}
},
newPos);
newPos, topProcessor);
} else if(genName.equals(FORMAT_PARAM_VALUE_MARK)) {
result.set(new AbstractGenerator() {
result.set(new AbstractGenerator(topProcessor) {
public String getName() {
return "ParamValue (parameter '" + param.getID() +
"' of context '" + param.getContext().getName() +
......@@ -89,11 +90,11 @@ public class ParamFormatRecognizer implements Recognizer {
}
protected String[] getStringValues() {
return new String[]{param.getExternalValueForm().get(0)};
return new String[]{param.getExternalValueForm(topProcessor).get(0)};
}
},
newPos);
newPos, topProcessor);
}
return result;
......
......@@ -19,12 +19,15 @@ package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.Utils;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
import com.elphel.vdt.core.tools.params.ToolException;
public abstract class ParamRecognizer implements Recognizer {
public RecognizerResult recognize(String template, int startPos) throws ToolException {
//, FormatProcessor topProcessor - not yet used?
protected FormatProcessor topProcessor=null;
public RecognizerResult recognize(String template, int startPos, FormatProcessor topProcessor) throws ToolException {
RecognizerResult result = new RecognizerResult();
int newPos = Utils.findBoundary(template, startPos);
......@@ -33,7 +36,8 @@ public abstract class ParamRecognizer implements Recognizer {
Parameter param = findParam(paramID);
if(param != null)
result.set(getGenerator(param), newPos);
result.set(getGenerator(param), newPos,topProcessor);
this.topProcessor=topProcessor;
return result;
}
......
......@@ -23,6 +23,7 @@ import com.elphel.vdt.core.tools.generators.FilteredSourceListGenerator;
import com.elphel.vdt.core.tools.generators.SourceListGenerator;
import com.elphel.vdt.core.tools.generators.TopModulesNameGenerator;
import com.elphel.vdt.core.tools.generators.ValueGenerator;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Parameter;
......@@ -36,7 +37,8 @@ public class ParamRepeaterRecognizer extends RepeaterRecognizer {
protected AbstractGenerator findGenerator(String genName,
String repPrefix,
String repSuffix,
String separator)
String separator,
FormatProcessor topProcessor)
{
// TODO make repetitor to accept several pattern generators with only one generating a list
/*
......@@ -55,7 +57,7 @@ public class ParamRepeaterRecognizer extends RepeaterRecognizer {
}
*/
if(genName.equals(ParamFormatRecognizer.FORMAT_PARAM_VALUE_MARK))
return new ValueGenerator(param, repPrefix, repSuffix, separator);
return new ValueGenerator(param, repPrefix, repSuffix, separator, topProcessor);
/* Trying to put these here */
if(genName.equals(FilteredSourceListGenerator.NAME))
return new FilteredSourceListGenerator(repPrefix, repSuffix, separator);
......
......@@ -17,9 +17,10 @@
*******************************************************************************/
package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.ToolException;
public interface Recognizer {
public RecognizerResult recognize(String template, int startPos) throws ToolException;
public RecognizerResult recognize(String template, int startPos, FormatProcessor topProcessor) throws ToolException;
}
......@@ -18,14 +18,17 @@
package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
import com.elphel.vdt.core.tools.params.FormatProcessor;
public class RecognizerResult {
private AbstractGenerator generator = null;
private int newPos = -1;
private FormatProcessor topProcessor=null;
public void set(AbstractGenerator generator, int newPos) {
public void set(AbstractGenerator generator, int newPos, FormatProcessor topProcessor) {
this.generator = generator;
this.newPos = newPos;
this.topProcessor=topProcessor;
}
public AbstractGenerator getGenerator() {
......@@ -38,4 +41,5 @@ public class RecognizerResult {
return newPos;
}
public FormatProcessor getTopProcessor() {return topProcessor;}
}
......@@ -18,6 +18,7 @@
package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.Utils;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.ToolException;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
import com.elphel.vdt.core.tools.generators.FileListGenerator;
......@@ -39,7 +40,7 @@ public class RepeaterRecognizer implements Recognizer {
private static final int FORMAT_REPEATER_SEP_LEN = FORMAT_REPEATER_SEP.length();
private static final int FORMAT_REPEATER_CLOSE_LEN = FORMAT_REPEATER_CLOSE.length();
public RecognizerResult recognize(String template, int startPos)
public RecognizerResult recognize(String template, int startPos, FormatProcessor topProcessor)
throws ToolException
{
RecognizerResult result = new RecognizerResult();
......@@ -88,8 +89,8 @@ public class RepeaterRecognizer implements Recognizer {
// "', sepBody: '" + sepBody +
// "'");
result.set(findGenerator(genName, repPrefix, repSuffix, sepBody), /* Why did it miss FileListGenerator here? */
closePos + FORMAT_REPEATER_CLOSE_LEN);
result.set(findGenerator(genName, repPrefix, repSuffix, sepBody, topProcessor), /* Why did it miss FileListGenerator here? */
closePos + FORMAT_REPEATER_CLOSE_LEN, topProcessor);
if(result.getGenerator() == null)
throw new ToolException("Unknown generator '" + genName + "'");
......@@ -100,7 +101,8 @@ public class RepeaterRecognizer implements Recognizer {
protected AbstractGenerator findGenerator(String genName,
String repPrefix,
String repSuffix,
String separator)
String separator,
FormatProcessor topProcessor)
{
System.out.println("Ever get here? RepeaterRecognizer.java:findGenerator()"); // yes, sure
AbstractGenerator gen=new FilteredSourceListGenerator(repPrefix, repSuffix, separator);
......
......@@ -19,6 +19,7 @@ package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.Utils;
import com.elphel.vdt.core.tools.generators.*;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Tool;
......@@ -66,7 +67,7 @@ public class SimpleGeneratorRecognizer implements Recognizer {
generators[i].setTool(tool);
}
}
public RecognizerResult recognize(String template, int startPos) {
public RecognizerResult recognize(String template, int startPos, FormatProcessor topProcessor) {
RecognizerResult result = new RecognizerResult();
// first see if there is the control sequence
......@@ -78,7 +79,7 @@ public class SimpleGeneratorRecognizer implements Recognizer {
String genName = template.substring(startPos, newPos);
result.set(findGenerator(genName), newPos);
result.set(findGenerator(genName), newPos, topProcessor);
}
return result;
......
......@@ -19,6 +19,7 @@ package com.elphel.vdt.core.tools.params.recognizers;
import com.elphel.vdt.core.tools.generators.AbstractGenerator;
import com.elphel.vdt.core.tools.generators.StringsGenerator;
import com.elphel.vdt.core.tools.params.FormatProcessor;
import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.core.tools.params.Parameter;
import com.elphel.vdt.core.tools.params.ToolException;
......@@ -27,8 +28,9 @@ import com.elphel.vdt.core.tools.params.ToolException;
public class ToolParamRecognizer extends ParamRecognizer {
private Tool tool;
public ToolParamRecognizer(Tool tool) {
public ToolParamRecognizer(Tool tool, FormatProcessor topProcessor) {
this.tool = tool;
this.topProcessor=topProcessor;
}
protected Parameter findParam(String paramID) {
......@@ -36,7 +38,7 @@ public class ToolParamRecognizer extends ParamRecognizer {
}
protected AbstractGenerator getGenerator(final Parameter param) throws ToolException {
return new StringsGenerator(param.getCommandLine()) {
return new StringsGenerator(param.getCommandLine(topProcessor),topProcessor) {
String toolName=(tool==null)?"<null>":tool.getName();
public String getName() {
return "Param '" + param +
......
......@@ -84,7 +84,7 @@ public class ComboComponent extends GeneralComponent {
public void setSelection(String value) {
ParamTypeEnum type = (ParamTypeEnum)param.getType();
int pos = type.getValueIndex(param.getValue().get(0));
int pos = type.getValueIndex(param.getValue(null).get(0)); // null for topFormatProcessor
if(pos < 0)
pos = 0;
......@@ -96,7 +96,7 @@ public class ComboComponent extends GeneralComponent {
String item = comboField.getText();
if (item.length() == 0)
item = param.getDefaultValue().get(0);
item = param.getDefaultValue(null).get(0); // null for topFormatProcessor
ParamTypeEnum type = (ParamTypeEnum)param.getType();
int pos = type.getLabelIndex(item);
......
......@@ -62,7 +62,7 @@ public abstract class GeneralComponent extends Component {
value = null;
} else if (isDefault) {
option.doClear();
value = param.getDefaultValue().get(0);
value = param.getDefaultValue(null).get(0); // null for topFormatProcessor
} else {
value = getSelection();
option.doStore(value);
......@@ -84,7 +84,7 @@ public abstract class GeneralComponent extends Component {
super.setDefault(defaulted);
if (defaulted) {
param.setToDefault();
setSelection(param.getDefaultValue().get(0));
setSelection(param.getDefaultValue(null).get(0)); // null for topFormatProcessor
}
// switchState(defaulted);
addListeners();
......
......@@ -107,7 +107,7 @@ public abstract class ListComponent extends Component {
super.setDefault(defaulted);
if (defaulted) {
param.setToDefault();
promptField.setList(param.getDefaultValue());
promptField.setList(param.getDefaultValue(null)); // null for topFormatProcessor
}
// switchState(defaulted);
addListeners();
......
......@@ -83,7 +83,7 @@ public abstract class AbstractTabComponent implements ITabComponent {
* component.
*/
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
setAttributes(configuration, component.getParam().getDefaultValue().get(0));
setAttributes(configuration, component.getParam().getDefaultValue(null).get(0)); // null for topFormatProcessor
}
/**
......
......@@ -382,6 +382,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
} else {
toggleLinkedTools.setImageDescriptor(VDTPluginImages.DESC_TOOLS_LINKED);
}
toolSequence.setToolsDirtyFlag(false); //boolean update) - recalculate dirty flags
}
};
toggleLinkedTools.setToolTipText("Toggle tool dependency");
......
......@@ -84,6 +84,9 @@
<parameter id="ConstraintsFiles" type="Filelist" format="ParamListSyntax"
default="" label="Constraints files" tooltip="Select constraint files to load to Vivado" readonly="false"
visible="true" />
<parameter id="ConstraintsFiles" type="Filelist" format="ParamListSyntax"
default="%" label="Constraints files" tooltip="Select constraint files to load to Vivado" readonly="false"
visible="true" />
<parameter id="SkipSnapshotSynth" label="Skip snapshot" tooltip="Do not create snapshot after synthesis"
......@@ -206,9 +209,19 @@
visible="false" type="Boolean" format="None"/>
<parameter id="condConstraintsFiles" default="?%%ChosenActionIndex=0 : %ConstraintsFiles, "
visible="false" type="Filelist" format="None"/>
<!--
<parameter id="blabla1" label="blabla1" tooltip= "blabla1"
default="%blabla2"
visible="true" type="String" format="CopyValue"/>
<parameter id="blabla2" label="blabla2" tooltip= "blabla2"
default="%blabla1"
visible="true" type="String" format="CopyValue"/>
-->
<input>
<group name="General">
<!--"blabla1"
"blabla2" -->
"ConstraintsFiles"
"SkipSnapshotSynth"
"SnapshotSynth" <!-- same as in project -->
......
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