Commit 0e706765 authored by Andrey Filippov's avatar Andrey Filippov

Debugging property inheritance (it was applied twice and did not work)

parent 07259d40
......@@ -19,6 +19,8 @@ package com.elphel.vdt;
import org.eclipse.core.runtime.QualifiedName;
import com.elphel.vdt.veditor.HdlNature;
/**
* Central access point for the VDT plug-in (id <code>"com.elphel.vdt.ui"</code>).
*
......@@ -44,7 +46,8 @@ public class VDT {
/** The identifier for the Verilog nature */
//??????????????????????????????
public static final String VERILOG_NATURE_ID = ID_VDT + ".VerilogNature";
// public static final String VERILOG_NATURE_ID = ID_VDT + ".VerilogNature";
public static final String VERILOG_NATURE_ID = HdlNature.NATURE_ID; // TODO
public static final String PREFERENCE_PAGE_ID = ID_VDT + ".ui.preferences.PreferencePage";
//-------------------------------------------------------------------------
......@@ -140,6 +143,7 @@ public class VDT {
public static final String GENERATOR_ID_TOP_MODULE = "TopModule";
public static final String GENERATOR_ID_TOP_MODULES = "TopModules";
public static final String GENERATOR_ID_CURRENT_FILE = "CurrentFile";
public static final String GENERATOR_ID_SELECTED_FILE = "SelectedFile";
public static final String GENERATOR_ID_CURRENT_BASE = "CurrentFileBase";
public static final String GENERATOR_ID_OS_NAME = "OS";
} // class VDT
......@@ -156,14 +156,14 @@ public class LaunchCore {
packageContext.setWorkingDirectory(project.getLocation().toOSString()); /* TODO - Modify for actual directory */
packageContext.buildParams();
}
Context context = tool.getParentProject();
Context context = tool.getParentProject(); // for iverilog - "project_settings"
if (context != null) {
OptionsCore.doLoadContextOptions(context, project);
OptionsCore.doLoadContextOptions(context, project); // stored values
context.setWorkingDirectory(project.getLocation().toOSString());
context.buildParams();
context.buildParams(); // correct context, but nothing got - Should it be? What the sense of the output - some control files?
}
OptionsCore.doLoadContextOptions(tool, project);
OptionsCore.doLoadLocation(tool);
OptionsCore.doLoadLocation(tool); // here it resolves condition with OS
} // updateContextOptions()
public static ILaunchConfiguration createLaunchConfiguration( Tool tool
......
......@@ -22,7 +22,7 @@ import java.util.*;
import com.elphel.vdt.core.tools.config.ConfigException;
public class EntityUtils {
// Updating tool context (to) from project context (from), items in to have now null context, in from - ProjectContext
public static <T extends Updateable> void update(List<T> from, List<T> to)
throws ConfigException
{
......@@ -34,7 +34,7 @@ public class EntityUtils {
T itemToUpdate = null;
for(T toItem : to) {
if(baseItem.matches(toItem)) {
if(baseItem.matches(toItem)) { // Did we miss redefined item here? (after I adding copying context to clone)? - no, just supposed to have no context
itemToUpdate = toItem;
break;
}
......
......@@ -33,4 +33,8 @@ public abstract class AbstractConditionNodeReader {
}
public abstract void readNode(Node node, Condition condition) throws ConfigException;
public String getConfigFileName(){
return config.getConfigFileName();
}
}
......@@ -60,10 +60,9 @@ public class ParamNodeReader extends AbstractConditionNodeReader {
String label = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_LABEL_ATTR);
String readOnly = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_READONLY_ATTR);
String visible = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_VISIBLE_ATTR);
if(id == null)
throw new ConfigException("Context '" + context.getName() + ": Parameter id is absent");
//getConfigFileName
return new Parameter(id,
outid,
typeName,
......@@ -73,6 +72,8 @@ public class ParamNodeReader extends AbstractConditionNodeReader {
omitValue,
readOnly,
visible,
condition);
condition,
getConfigFileName() //.getConfigFileName()
);
}
}
......@@ -156,6 +156,10 @@ public class XMLConfig extends Config {
}
}
public String getConfigFileName(){
return currentConfigFileName;
}
public void logError(Exception e) throws ConfigException {
if(errorCount++ < MAX_ERRORS_TO_SHOW) {
MessageUI.error("Error reading config file '" + currentConfigFileName + ". \n" +
......@@ -370,14 +374,12 @@ public class XMLConfig extends Config {
SAXException,
IOException
{
//System.out.println("Reading file '" + configFile + "'");
System.out.println("Reading file '" + configFile + "'");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(configFile);
currentConfigFileName = configFile.getAbsolutePath();
findRootNode(document);
// read and tie control interface list
......@@ -422,6 +424,8 @@ public class XMLConfig extends Config {
List<DesignMenu> menuComponents = readDesignMenu(document);
designMenuManager.addDesignMenuComponents(menuComponents);
System.out.println("Done reading file '" + configFile + "'");
}
private void addControlInterfaceList(List<ControlInterface> controlInterfaces)
......@@ -553,7 +557,6 @@ public class XMLConfig extends Config {
String toolWarnings = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_WARNINGS);
String toolInfo = getAttributeValue(contextNode, CONTEXT_TOOL_SYNTAX_INFO);
boolean isShell=false;
if (toolShell != null){
toolExe=toolShell;
......@@ -565,6 +568,15 @@ public class XMLConfig extends Config {
List<String> toolExtensionsList = readToolExtensionsList(contextNode, contextName);
System.out.println("contextNode.getNodeValue()="+contextNode.getNodeValue());
System.out.println("toolPackage="+toolPackage);
System.out.println("toolProject="+toolProject);
System.out.println("toolExe="+toolExe);
System.out.println("toolShell="+toolShell);
List<Tool.RunFor> toolRunfor= readToolRunForList(contextNode, contextName);
context = new Tool(contextName,
contextInterfaceName,
contextLabel,
......@@ -579,6 +591,7 @@ public class XMLConfig extends Config {
toolErrors,
toolWarnings,
toolInfo,
toolRunfor,
null,
null,
null);
......@@ -594,11 +607,14 @@ public class XMLConfig extends Config {
// creation routines really DO need to have a reference to the context
//
List<Parameter> contextParams = readParameters(contextNode, context);
List<CommandLinesBlock> contextCommandLinesBlocks = readCommandLinesBlocks(contextNode, context);
List<CommandLinesBlock> contextCommandLinesBlocks = readCommandLinesBlocks(contextNode, context); // Correct? for "project_parameters" in /vdt/tools/Verilog/IVerilog.xml
// Each of contextParams (3 total, correct) has null context. Probably OK, same for the tool context
ContextInputDefinition contextInputDefinition = readContextInputDefinition(contextNode, context);
if (contextKind==ContextKind.PROJECT){
System.out.println("processing project context");
}
context.setParams(contextParams);
context.setParamGroups(contextInputDefinition.getParamGroups());
context.setParamGroups(contextInputDefinition.getParamGroups()); // "Project Properties", "General"
context.setInputDialogLabel(contextInputDefinition.getLabel());
context.setCommandLinesBlocks(contextCommandLinesBlocks);
......@@ -926,6 +942,14 @@ public class XMLConfig extends Config {
return extList;
}
private List<Tool.RunFor> readToolRunForList(Node toolNode, String toolName){
if (toolNode.getNodeValue()==null) return null;
System.out.println("FIXME: readToolRunForList("+toolNode.getNodeName() +", "+toolName+")"+
" rootNode="+rootNode.getNodeName()+" filename="+currentConfigFileName);
return null;
}
private List<Parameter> readParameters(Node node, Context context)
throws ConfigException
{
......
......@@ -54,7 +54,7 @@ public abstract class Context {
private boolean initialized = false;
private String workingDirectory;
private String version;
private Context context=null;
protected Context(String name,
String controlInterfaceName,
String label,
......@@ -166,7 +166,8 @@ public abstract class Context {
// MessageUI.error(e);
// }
return visibleParamGroups;
return visibleParamGroups; // project foriverilog: [com.elphel.vdt.core.tools.params.ParamGroup@775b1885, null, null, null, null, null, null, null, null, null]
// ... label "Project properties", name="General"
}
public boolean isVisible() {
......@@ -191,7 +192,7 @@ public abstract class Context {
// that array is then returned
public String[] buildParams() throws ToolException {
List<String> commandLineParams = new ArrayList<String>();
Iterator<CommandLinesBlock> commandLinesBlockIter = commandLinesBlocks.iterator();
Iterator<CommandLinesBlock> commandLinesBlockIter = commandLinesBlocks.iterator(); // command lines block is empty (yes, there is nothing in project output)
createdControlFiles.clear();
......@@ -203,7 +204,7 @@ public abstract class Context {
String paramName = commandLinesBlock.getDestination();
String sep = commandLinesBlock.getSeparator();
List<String> lines = commandLinesBlock.getLines();
List<String> lines = commandLinesBlock.getLines(); // [%Param_Shell_Options, echo BuildDir=%BuildDir ;, echo SimulationTopFile=%SimulationTopFile ;, echo SimulationTopModule=%SimulationTopModule ;, echo BuildDir=%BuildDir;, %Param_PreExe, %Param_Exe, %Param_TopModule, %TopModulesOther, %ModuleLibrary, %LegacyModel, %NoSpecify, %v, %SourceList, %ExtraFiles, %Filter_String]
List<List<String>> commandSequence = new ArrayList<List<String>>();
for(Iterator<String> lineIter = lines.iterator(); lineIter.hasNext();) {
......@@ -211,7 +212,7 @@ public abstract class Context {
commandSequence.add(buildCommandString(line));
}
// Here - already resolved to empty
if(paramName != null) {
Parameter commandFileParam = findParam(paramName);
String controlFileName = commandFileParam != null?
......@@ -271,9 +272,10 @@ public abstract class Context {
}
protected void initParams() throws ConfigException {
paramContainer.init(config, this);
paramContainer.init(config, this); //??? label="iverilog project label", name="IVerilogProject", config.currentConfigFileName="/data/vdt/elphel-EclipseVDT/vdt/tools/XDS/XDS.xml"
// config.currentConfigFileName is just the last file processed for this context, OK
// do the first init to detect most errors
// This time got labelname="ModelSIMProject" (empty)
initParamGroups();
}
......@@ -281,7 +283,7 @@ public abstract class Context {
visibleParamGroups.clear();
List<StringPair> foundParams =
new ArrayList<StringPair>(paramContainer.getParams().size());
new ArrayList<StringPair>(paramContainer.getParams().size()); // [null, null, null, null, null, null, null, null, null, null]
for(ParamGroup group : paramGroups) {
List<String> paramIDs = group.getParams();
......
......@@ -35,11 +35,11 @@ public class ProjectContext extends Context {
String controlInterfaceName,
String label,
String iconName,
String inputDialogLabel,
String inputDialogLabel, // null
String parentPackageName,
List<Parameter> params,
List<ParamGroup> paramGroups,
List<CommandLinesBlock> commandLinesBlocks,
List<Parameter> params, // null
List<ParamGroup> paramGroups, // null
List<CommandLinesBlock> commandLinesBlocks, //null
String designMenuName)
throws ConfigException
{
......@@ -47,10 +47,10 @@ public class ProjectContext extends Context {
controlInterfaceName,
label,
iconName,
inputDialogLabel,
params,
paramGroups,
commandLinesBlocks);
inputDialogLabel, // null
params, // null
paramGroups, // null
commandLinesBlocks); // null
this.parentPackageName = parentPackageName;
this.designMenuName = designMenuName;
......
/*******************************************************************************
* Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.IPageLayout;
import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class ViewSelectedFileGenerator extends AbstractGenerator {
private static final String NAME = VDT.GENERATOR_ID_SELECTED_FILE;
public String getName() {
return NAME;
}
protected String[] getStringValues() {
IResource resource = SelectedResourceManager.getDefault().getViewSelectedResource(IPageLayout.ID_RES_NAV);
if((resource != null) && (resource.getType() == IResource.FILE))
return new String[] { ((IFile)resource).getLocation().toOSString() };
return new String[] { "" };
}
} //ViewSelectedFileGenerator
......@@ -55,7 +55,7 @@ public class FormatProcessor {
List<String> outputLines = null;
try {
outputLines = processTemplate(template);
outputLines = processTemplate(template); // echo %SimulationTopFile %%SelectedFile ; -> null
} finally {
callCount--;
}
......
......@@ -50,6 +50,31 @@ public class Parameter implements Cloneable, Updateable {
private boolean hasDependentParameters;
private boolean isChild; // Andrey: trying to resolve double inheritance - at configuration time and when generating output
private String sourceXML; // Andrey: For error reporting - individual to parameter
/*
public Parameter(String id,
String outid,
String typeName,
String syntaxName,
String defaultValue,
String label,
String omitValue,
String readonly,
String visible,
Condition relevant){
this(id,
outid,
typeName,
syntaxName,
defaultValue,
label,
omitValue,
readonly,
visible,
relevant,
null);
}
public Parameter(String id,
String outid,
String typeName,
......@@ -71,7 +96,7 @@ public class Parameter implements Cloneable, Updateable {
visible,
null);
}
*/
public Parameter(String id,
String outid,
String typeName,
......@@ -81,9 +106,11 @@ public class Parameter implements Cloneable, Updateable {
String omitValue,
String readonly,
String visible,
Condition relevant)
Condition relevant,
String sourceXML)
{
this.id = id;
this.isChild=false;
this.outid = outid != null? outid : id;
this.typeName = typeName;
this.syntaxName = syntaxName;
......@@ -94,8 +121,8 @@ public class Parameter implements Cloneable, Updateable {
this.visible = visible;
this.relevant = relevant;
this.hasDependentParameters = false;
this.sourceXML=sourceXML;
}
protected Parameter(Parameter param) {
this(param.id,
param.outid,
......@@ -106,16 +133,24 @@ public class Parameter implements Cloneable, Updateable {
param.omitValue,
param.readonly,
param.visible,
param.relevant);
param.relevant,
param.sourceXML);
this.type = param.type;
this.syntax = param.syntax;
this.context = param.context; // Added by Andrey - may break something else? Supposed not to clone, otherwise fails in Tools.initParams()
}
public Object clone() {
public Object clone() { // did not clone context (intentionally)
return new Parameter(this);
}
public boolean getIsChild(){
return isChild;
}
public void setIsChild(boolean isChild){
this.isChild=isChild;
}
public boolean matches(Updateable other) {
Parameter otherParam = (Parameter)other;
......@@ -124,13 +159,25 @@ public class Parameter implements Cloneable, Updateable {
}
public void init(Context context) throws ConfigException {
if(this.context != null)
/* if(this.context != null)
throw new ConfigException("Parameter ('" + id + "') cannot be re-initialized");
this.context = context;
String contextInfo = "Context '" + context.getName() + "'";
*/
// replacing:
if(this.context == context)
throw new ConfigException("Parameter ('" + id + "') cannot be re-initialized on the same context level"); // wrong file name, should be per-parameter
if(this.context == null) {
this.context = context;
} else {
System.out.println ("Andrey: Trying to use already defined context '"+this.context.getName()+
"' instead of the currently processed '"+context.getName()+"' for parameter '"+this.getID()+"'");
// Andrey: Not sure if initialization is still needed - it is probably done before cloning
// System.out.println("Skipping initialization - it is already done");
// return;
}
String contextInfo = "Context '" + context.getName() + "'";
if(typeName == null)
throw new ConfigException(contextInfo + ": Type name of parameter '" + id + "' is absent");
else if(syntaxName == null)
......@@ -155,18 +202,22 @@ public class Parameter implements Cloneable, Updateable {
BooleanUtils.VALUE_FALSE);
}
this.type = context.getControlInterface().findParamType(typeName);
// this.type = context.getControlInterface().findParamType(typeName);
this.type = this.context.getControlInterface().findParamType(typeName);
if(this.type == null)
throw new ConfigException(contextInfo + ": Parameter type '" + typeName +
"' doesn't exist in control interface '" + context.getControlInterface().getName() +
// "' doesn't exist in control interface '" + context.getControlInterface().getName() +
"' doesn't exist in control interface '" + this.context.getControlInterface().getName() +
"'");
this.syntax = context.getControlInterface().findSyntax(syntaxName);
// this.syntax = context.getControlInterface().findSyntax(syntaxName);
this.syntax = this.context.getControlInterface().findSyntax(syntaxName);
if(this.syntax == null)
throw new ConfigException(contextInfo + ": Syntax '" + syntaxName +
"' doesn't exist in control interface '" + context.getControlInterface().getName() +
// "' doesn't exist in control interface '" + context.getControlInterface().getName() +
"' doesn't exist in control interface '" + this.context.getControlInterface().getName() +
"'");
}
......
......@@ -39,6 +39,9 @@ public class Tool extends Context implements Cloneable, Inheritable {
private List<String> extensions;
private List<RunFor> runfor;
private Tool baseTool;
private PackageContext parentPackage;
private ProjectContext parentProject;
......@@ -48,7 +51,10 @@ public class Tool extends Context implements Cloneable, Inheritable {
private boolean isShell = false; /* Tool is a shell, preserve first argument, merge all others */
private String projectPath=null;
private boolean initialized = false;
public class RunFor{
String prompt;
String resource;
}
public Tool(String name,
String controlInterfaceName,
String label,
......@@ -63,6 +69,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
String toolErrors,
String toolWarnings,
String toolInfo,
List<RunFor> runfor,
/* never used ??? */
List<Parameter> params,
List<ParamGroup> paramGroups,
......@@ -76,7 +83,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
params,
paramGroups,
commandLinesBlocks);
this.runfor=runfor;
this.baseToolName = baseToolName;
this.label = label;
this.parentPackageName = parentPackageName;
......@@ -107,7 +114,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
initParentPackage();
initParentProject();
initParams();
initParams(); // *Inherits and sets up contexts? Also Error with copying context to items
initOtherAttributes();
initCommandLines();
......@@ -227,9 +234,10 @@ public class Tool extends Context implements Cloneable, Inheritable {
}
public Parameter findParam(String paramID) {
Parameter param = super.findParam(paramID);
Parameter param = super.findParam(paramID); //Andrey: happily finds ProjectContext parameter, thinks it is tool context
if(param != null)
// if(param != null)
if ((param != null) && !param.getIsChild())
return param;
if(baseTool != null) {
......@@ -288,8 +296,16 @@ public class Tool extends Context implements Cloneable, Inheritable {
//
protected void initParams() throws ConfigException {
/*
* Seems that inheritance is implemented twice - here and when generating output lines, and the parameters are cloned, so when say
* project parameters are modified, the changes are not propagated to the tool parameters. I'll try to disable inheritance here,
* see what happens (this intermediate inheritance may be still needed somewhere - exe name, extensions?). Another option would be to reference instead of cloning
* and skip initialization of the "alien" context parameters.
*
* Yes, exe name wants it
*/
if(parentProject != null)
inheritParams(parentProject);
inheritParams(parentProject); // Here inheriting project parameters
if(parentPackage != null)
inheritParams(parentPackage);
......@@ -308,9 +324,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
inheritParams(baseTool);
inheritParamGroups();
}
paramContainer.init(config, this);
paramContainer.init(config, this); // Error inside here when context is cloned in inheritance. Parameter ('SimulationTopFile') cannot be re-initialized
initParamGroups();
}
......@@ -390,7 +404,8 @@ public class Tool extends Context implements Cloneable, Inheritable {
}
private void inheritParams(Context context) throws ConfigException {
EntityUtils.update(context.getParams(), paramContainer.getParams());
// EntityUtils.update(context.getParams(), paramContainer.getParams());
EntityUtilsMarkChildren.update(context.getParams(), paramContainer.getParams());
}
private void inheritParamGroups() throws ConfigException {
......
......@@ -31,6 +31,7 @@ public class SimpleGeneratorRecognizer implements Recognizer {
new ProjectPathGenerator(),
new TopModuleNameGenerator(),
new CurrentFileGenerator(),
new ViewSelectedFileGenerator(),
new CurrentFileBaseGenerator()
};
......
......@@ -87,7 +87,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
private TreeViewer viewer;
private DrillDownAdapter drillDownAdapter;
private Action showLunchConfigAction;
private Action showLaunchConfigAction;
private Action launchAction;
private Action showInstallationPropertiesAction;
......@@ -237,7 +237,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
manager.add(showPackagePropertiesAction);
manager.add(showProjectAction);
manager.add(showPropertiesAction);
// manager.add(showLunchConfigAction);
// manager.add(showLaunchConfigAction);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
......@@ -250,7 +250,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
manager.add(showPackagePropertiesToolbarAction);
manager.add(showProjectPropertiesToolbarAction);
manager.add(showPropertiesAction);
// manager.add(showLunchConfigAction);
// manager.add(showLaunchConfigAction);
}
private void makeActions() {
......@@ -296,7 +296,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
showProjectPropertiesToolbarAction = new LocalContextsAction("Project Parameters");
showProjectPropertiesToolbarAction.setText("Project Parameters");
showProjectPropertiesToolbarAction.setToolTipText("Set project parameters");
showProjectPropertiesToolbarAction.setToolTipText("Set project parameters (toolbar)");
showProjectPropertiesToolbarAction.setImageDescriptor(VDTPluginImages.DESC_PROJECT_PROPERTIES);
showProjectAction = new Action() {
......@@ -307,7 +307,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
}
};
showProjectAction.setText("Project Parameters");
showProjectAction.setToolTipText("Set project parameters");
showProjectAction.setToolTipText("Set project parameters (context menue)");
showProjectAction.setImageDescriptor(VDTPluginImages.DESC_PROJECT_PROPERTIES);
clearProjectPropertiesAction = new ClearLocalContextAction("Do you wish to delete values of projects parameters?");
......@@ -341,7 +341,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
selectDesignMenuAction.setText("Change Design Menu");
selectDesignMenuAction.setImageDescriptor(VDTPluginImages.DESC_DESIGM_MENU);
showLunchConfigAction = new Action() {
showLaunchConfigAction = new Action() {
public void run() {
try {
openToolLaunchDialog(selectedItem);
......@@ -352,9 +352,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
}
}
};
showLunchConfigAction.setText("Launch configuration");
showLunchConfigAction.setToolTipText("Open launch configuration dialog for this tool");
showLunchConfigAction.setImageDescriptor(VDTPluginImages.DESC_LAUNCH_CONFIG);
showLaunchConfigAction.setText("Launch configuration");
showLaunchConfigAction.setToolTipText("Open launch configuration dialog for this tool");
showLaunchConfigAction.setImageDescriptor(VDTPluginImages.DESC_LAUNCH_CONFIG);
launchAction = new Action() {
public void run() {
......@@ -429,14 +429,24 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
showProjectPropertiesToolbarAction.setProject(project);
clearProjectPropertiesAction.setProject(project);
boolean enabled = (selectedItem != null)
&& (selectedResource != null)
boolean enabled = (selectedItem != null) // At startup null (twice went through this); Right Click - "Icarus Ver..."
&& (selectedResource != null) // at startup x353_1.tf; Right Click - "L/x353/x353_1.tf
&& (selectedItem.isEnabled(selectedResource));
launchAction.setEnabled(enabled);
//Just trying
if (enabled){
launchAction.setText(Txt.s("Action.ToolLounch.Caption", new String[]{selectedResource.getName()}));
launchAction.setToolTipText(Txt.s("Action.ToolLounch.ToolTip", new String[]{selectedItem.getLabel(), selectedResource.getName()}));
Tool tool = selectedItem.getTool();
if (tool!=null){
System.out.println("Tool:"+tool.getName()); // Not yet parsed
}
} else {
launchAction.setText(Txt.s("Action.ToolLounch.Caption.Default"));
launchAction.setToolTipText(Txt.s("Action.ToolLounch.ToolTip.Default"));
......@@ -522,22 +532,23 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
String newDesignMenuName = newDesignMenu == null ? null
: newDesignMenu.getName();
if (newDesignMenuName != null) {
try {
/* try {
Utils.addNature(VDT.VERILOG_NATURE_ID, project, null);
desigMenuName.setValue(newDesignMenuName);
} catch (CoreException e) {
MessageUI.error( "Cannot set " + VDT.VERILOG_NATURE_ID + "nature for " + project.getName()
, e);
}
*/
} else {
try {
/* try {
Utils.removeNature(VDT.VERILOG_NATURE_ID, project, null);
desigMenuName.doClear();
} catch (CoreException e) {
MessageUI.error( "Cannot remove " + VDT.VERILOG_NATURE_ID + "nature for " + project.getName()
, e);
}
}
*/ }
OptionsCore.doStoreOption(desigMenuName, project);
doLoadDesignMenu(newDesignMenuName);
}
......
......@@ -19,14 +19,27 @@
sensitivity="sensitive"
textkind="dir"/>
</typedef>
<typedef name="FileType">
<paramtype kind="string"
maxlength="256"
sensitivity="sensitive"
textkind="file"/>
</typedef>
<syntax name="ValueSyntax" format="%%ParamValue" />
</interface>
<!--
<project name="project_settings"
label="Project parameters"
label="Project parameters for project_settings"
interface="project_interface">
<parameter id = "SimulationTopFile"
label = "Project top simulation file"
type = "FileType"
default = ""
format = "ValueSyntax"
readonly= "false" />
<parameter id = "SimulationTopModule"
label = "Project top simulation module"
type = "StringType"
......@@ -43,6 +56,7 @@
<input>
<group name="General" label="Project properties">
"SimulationTopFile"
"SimulationTopModule"
"BuildDir"
</group>
......@@ -50,5 +64,5 @@
<output>
</output>
</project>
-->
</vdt-project>
......@@ -150,12 +150,10 @@
format = "%%ParamValue"></syntax>
</interface>
<project name="SampleProject"
label="Sample Project"
interface="MyControlInterface">
</project>
<!--
===========================================================
......
......@@ -116,16 +116,56 @@
-->
</interface>
<!--
<project name="IVerilogProject"
label="iverilog project"
label="iverilog project label"
interface="IVerilog">
</project>
-->
<project name="project_settings"
label="Project parameters for project_settings"
interface="project_interface">
<parameter id = "SimulationTopFile"
label = "Project top simulation file"
type = "FileType"
default = ""
format = "ValueSyntax"
readonly= "false" />
<parameter id = "SimulationTopModule"
label = "Project top simulation module"
type = "StringType"
default = ""
format = "ValueSyntax"
readonly= "false" />
<parameter id = "BuildDir"
label = "project build directory"
type = "DirType"
default = "build"
format = "ValueSyntax"
readonly= "false" />
<input>
<group name="General" label="Project properties">
"SimulationTopFile"
"SimulationTopModule"
"BuildDir"
</group>
</input>
<output>
</output>
</project>
<tool name = "iverilog"
project = "project_settings"
label = "Icarus Verilog compiler"
exe="iverilog"
shell = "bash"
exe = "iverilog"
shell = "?%%OS: Windows=shell:, Linux=/bin/bash"
interface = "IVerilog"
errors = "(.*):([0-9]+): [a-z_\- ]*error: (.*)"
warnings = "(.*):([0-9]+): [a-z_\- ]*warning: (.*)"
......@@ -136,6 +176,12 @@
<extension mask="tf"/>
</extensions-list>
<action-menu>
<option label="Simulate" resource="%SimulationTopFile" />
<option label="Simulate" resource="%%SelectedFile" />
<option label="Just try for" resource="%%OS" />
</action-menu>
<parameter id = "Param_Shell_Options"
label = "Param_Shell_Options"
......@@ -245,6 +291,14 @@
default = "2&gt;&amp;1 | tee iverilog.log | grep --line-buffered -E 'error|warning' | grep --line-buffered -v &quot;(null):0&quot;"
readonly = "false"
visible = "true"/>
<!-- intentional error below - duplicate -->
<parameter id = "BuildDir"
label = "project build directory"
type = "DirType"
default = "build1"
format = "ValueSyntax"
readonly= "false" />
<input>
<group name="files" label="Files">
......@@ -267,8 +321,12 @@
</input>
<output>
<line name = "command_line" sep = " ">
<line name="command_line" sep=" ">
"%Param_Shell_Options"
"echo BuildDir=%BuildDir ;"
"echo SimulationTopFile=%SimulationTopFile ;"
"echo SimulationTopModule=%SimulationTopModule ;"
"echo BuildDir=%BuildDir ;"
"%Param_PreExe"
"%Param_Exe"
"%Param_TopModule"
......@@ -282,14 +340,14 @@
<if ErrorsOnly="true">
"%Filter_String"
</if>
<!--
"-s counter_tb"
"%SourceList" -->
</line>
</output>
</tool>
<!-- "echo %SimulationTopFile %%SelectedFile ;" -->
<!--
"-s counter_tb"
"%SourceList" -->
......
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