Commit d8bf8483 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Tool dependency, sequencing, wait for VEditor database

parent e166573a
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -158,5 +158,7 @@ public class VDT {
    public static final String GENERATOR_ID_STATE_DIR     = "StateDir"; 
    public static final String GENERATOR_ID_STATE_DIR     = "StateDir"; 
    public static final String GENERATOR_ID_STATE_FILE    = "StateFile"; 
    public static final String GENERATOR_ID_STATE_FILE    = "StateFile"; 


    public static final String TIME_STAMP_FORMAT          = "yyyyMMddHHmmssSSS";



} // class VDT
} // class VDT
+5 −1
Original line number Original line Diff line number Diff line
@@ -24,8 +24,10 @@ import java.util.Iterator;
import java.util.Set;
import java.util.Set;
import java.util.Vector;
import java.util.Vector;


import com.elphel.vdt.ui.variables.SelectedResourceManager;
import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.document.HdlDocument;
import com.elphel.vdt.veditor.document.HdlDocument;
import com.elphel.vdt.veditor.document.VerilogDocument;
import com.elphel.vdt.veditor.parser.OutlineContainer;
import com.elphel.vdt.veditor.parser.OutlineContainer;
import com.elphel.vdt.veditor.parser.OutlineDatabase;
import com.elphel.vdt.veditor.parser.OutlineDatabase;
//import com.elphel.vdt.veditor.parser.vhdl.VhdlOutlineElementFactory.PackageDeclElement;
//import com.elphel.vdt.veditor.parser.vhdl.VhdlOutlineElementFactory.PackageDeclElement;
@@ -67,7 +69,9 @@ public class VerilogUtils {
			e.printStackTrace();
			e.printStackTrace();
		}
		}
		if (hdlDocument!=null) return hdlDocument.getOutlineDatabase(); /* will create a new one if does not exist */
		if (hdlDocument!=null) return hdlDocument.getOutlineDatabase(); /* will create a new one if does not exist */
		return null;
		// Create HdlDocument from selected/restored HDLfile
		hdlDocument=new VerilogDocument(project, (IFile) SelectedResourceManager.getDefault().getChosenVerilogFile());
		return hdlDocument.getOutlineDatabase(); /* will create a new one if does not exist */
	}
	}
	
	
	public static String [] getExtList(String str){
	public static String [] getExtList(String str){
+1 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ public class ParamBasedListOption extends ParamBasedOption {
    /**
    /**
     * Set the option value
     * Set the option value
     * 
     * 
     * @param value the sequnce of the list items separated by SEPARATOR.
     * @param value the sequence of the list items separated by SEPARATOR.
     */
     */
    public void setValue(String value) {
    public void setValue(String value) {
        List<String> list = OptionsUtils.convertStringToList(value);
        List<String> list = OptionsUtils.convertStringToList(value);
+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ public class ValueBasedListOption extends Option {
    /**
    /**
     * Set the option value
     * Set the option value
     * 
     * 
     * @param value the sequnce of the list items separated by SEPARATOR.
     * @param value the sequence of the list items separated by SEPARATOR.
     */
     */
    public void setValue(String value) {
    public void setValue(String value) {
        List<String> list = OptionsUtils.convertStringToList(value);
        List<String> list = OptionsUtils.convertStringToList(value);
+17 −7
Original line number Original line Diff line number Diff line
@@ -114,6 +114,7 @@ public class XMLConfig extends Config {
    static final String CONTEXT_TOOL_DEPENDS_LIST_TAG =  "depends-list";
    static final String CONTEXT_TOOL_DEPENDS_LIST_TAG =  "depends-list";
    static final String CONTEXT_TOOL_DEPENDS_TAG =       "depends";
    static final String CONTEXT_TOOL_DEPENDS_TAG =       "depends";
    static final String CONTEXT_TOOL_DEPENDS_STATE_TAG = "state";
    static final String CONTEXT_TOOL_DEPENDS_STATE_TAG = "state";
    static final String CONTEXT_TOOL_DEPENDS_FILES_TAG = "files";
// TODO: May add other types of dependencies 
// TODO: May add other types of dependencies 
    
    
    static final String CONTEXT_TOOL_DFLT_ACTION_LABEL = "Run for";
    static final String CONTEXT_TOOL_DFLT_ACTION_LABEL = "Run for";
@@ -663,7 +664,8 @@ public class XMLConfig extends Config {
                    
                    
                List<String> toolExtensionsList = readToolExtensionsList(contextNode, contextName);
                List<String> toolExtensionsList = readToolExtensionsList(contextNode, contextName);
                List<RunFor> toolRunfor=  readToolRunForList(contextNode, contextName);
                List<RunFor> toolRunfor=  readToolRunForList(contextNode, contextName);
                List<String> toolDepends= readToolDependsList(contextNode, contextName);
                List<String> toolDependsStates= readToolDependsList(contextNode, contextName,false);
                List<String> toolDependsFiles=  readToolDependsList(contextNode, contextName,true);
                
                
                if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
                if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
                	System.out.println("contextNode.getNodeValue()="+contextNode.getNodeValue());
                	System.out.println("contextNode.getNodeValue()="+contextNode.getNodeValue());
@@ -692,7 +694,8 @@ public class XMLConfig extends Config {
                                   toolInfo,
                                   toolInfo,
                                   toolRunfor,
                                   toolRunfor,
                                   ignoreFilter,
                                   ignoreFilter,
                                   toolDepends,
                                   toolDependsStates,
                                   toolDependsFiles,
                                   logDir,
                                   logDir,
                                   stateDir,
                                   stateDir,
                                   disabled,
                                   disabled,
@@ -1045,9 +1048,12 @@ public class XMLConfig extends Config {
        return extList;
        return extList;
    }
    }
    
    
    private List<String> readToolDependsList(Node toolNode, String toolName)
    private List<String> readToolDependsList(Node toolNode, String toolName, boolean filesNotStates)
            throws ConfigException 
            throws ConfigException 
        {
        {
    	    String filesStateTag=   filesNotStates?CONTEXT_TOOL_DEPENDS_FILES_TAG:CONTEXT_TOOL_DEPENDS_STATE_TAG;
    	    String otherTag=     (!filesNotStates)?CONTEXT_TOOL_DEPENDS_FILES_TAG:CONTEXT_TOOL_DEPENDS_STATE_TAG;
    	
            String toolInfo = "Tool '" + toolName + "'";
            String toolInfo = "Tool '" + toolName + "'";
            
            
            List<String> depList = new ArrayList<String>();
            List<String> depList = new ArrayList<String>();
@@ -1066,10 +1072,14 @@ public class XMLConfig extends Config {
// TODO: allow here other types of dependencies (conditionals(source files)            
// TODO: allow here other types of dependencies (conditionals(source files)            
            for(Iterator<Node> n = depNodes.iterator(); n.hasNext();) {
            for(Iterator<Node> n = depNodes.iterator(); n.hasNext();) {
                Node node = (Node)n.next();
                Node node = (Node)n.next();
                String dep = getAttributeValue(node, CONTEXT_TOOL_DEPENDS_STATE_TAG);
                String dep = getAttributeValue(node, filesStateTag);
                if(dep == null)
                if (dep != null) {
                    throw new ConfigException(toolInfo + ": Attribute '" + CONTEXT_TOOL_DEPENDS_STATE_TAG + "' is absent");
                	depList.add(dep);
                	depList.add(dep);
                } else if (getAttributeValue(node, otherTag)==null){
                    throw new ConfigException(toolInfo + ": Both alternative attributes '" + CONTEXT_TOOL_DEPENDS_FILES_TAG +
                    		" and '"+CONTEXT_TOOL_DEPENDS_STATE_TAG +"' are absent");
                	
                }
            }
            }
            return depList;
            return depList;
        }
        }
Loading