Commit d2d7c636 authored by Andrey Filippov's avatar Andrey Filippov

Configuring tools for IVerilog & GTKWave + minor bug fixes

parent ed18a78f
...@@ -17,10 +17,12 @@ ...@@ -17,10 +17,12 @@
*******************************************************************************/ *******************************************************************************/
package com.elphel.vdt.core.tools.generators; package com.elphel.vdt.core.tools.generators;
//import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
//import org.eclipse.core.resources.IResource; //import org.eclipse.core.resources.IResource;
//import org.eclipse.ui.IPageLayout; //import org.eclipse.ui.IPageLayout;
import org.eclipse.core.runtime.Path;
import com.elphel.vdt.VDT; import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager; import com.elphel.vdt.ui.variables.SelectedResourceManager;
...@@ -33,12 +35,10 @@ public class CurrentFileBaseGenerator extends AbstractGenerator { ...@@ -33,12 +35,10 @@ public class CurrentFileBaseGenerator extends AbstractGenerator {
protected String[] getStringValues() { protected String[] getStringValues() {
// IResource resource = SelectedResourceManager.getDefault().getSelectedResource(); // IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
String fullName=SelectedResourceManager.getDefault().getChosenTarget(); String name=SelectedResourceManager.getDefault().getChosenShort(); // last segment of the file name
// if((resource != null) && (resource.getType() == IResource.FILE)) { if (name!=null){
// String fullName=((IFile)resource).getLocation().toOSString(); int dot = name.lastIndexOf('.');
if (fullName!=null){ return new String[] { (dot>=0)? name.substring(0, dot): name };
int dot = fullName.lastIndexOf('.');
return new String[] { (dot <0) ? fullName : fullName.substring(0, dot) };
} }
return new String[] { "" }; return new String[] { "" };
} }
......
...@@ -346,9 +346,9 @@ public class Parameter implements Cloneable, Updateable { ...@@ -346,9 +346,9 @@ public class Parameter implements Cloneable, Updateable {
} }
public List<String> getCurrentValue() { public List<String> getCurrentValue() {
if (id.equals("SimulationTopFile")){ // Andrey // if (id.equals("SimulationTopFile")){ // Andrey
System.out.println("getCurrentValue() SimulationTopFile, value="+currentValue); // System.out.println("getCurrentValue() SimulationTopFile, value="+currentValue);
} // }
if(currentValue.isEmpty()) if(currentValue.isEmpty())
return null; return null;
......
...@@ -64,6 +64,7 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -64,6 +64,7 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
//Andrey //Andrey
private String fChosenTarget=null; // full path of the chosen (for action) resource or any string. Used to calculate CurrentFile, verilog file, ... private String fChosenTarget=null; // full path of the chosen (for action) resource or any string. Used to calculate CurrentFile, verilog file, ...
private String fChosenShort=null; // last segment of the chosen resource name
private IResource fChosenVerilogFile = null; // to keep fSelectedVerilogFile private IResource fChosenVerilogFile = null; // to keep fSelectedVerilogFile
private int fChosenAction=0; // Chosen variant of running the tool private int fChosenAction=0; // Chosen variant of running the tool
private long timestamp=0; private long timestamp=0;
...@@ -255,6 +256,11 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -255,6 +256,11 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
fChosenVerilogFile=file; fChosenVerilogFile=file;
else if (fChosenVerilogFile==null) else if (fChosenVerilogFile==null)
fChosenVerilogFile=fSelectedVerilogFile; fChosenVerilogFile=fSelectedVerilogFile;
if (file!=null){
fChosenShort=file.getName(); // last segment
} else {
fChosenShort=fChosenTarget; // whatever
}
} }
public String setBuildStamp(){ public String setBuildStamp(){
...@@ -270,6 +276,9 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -270,6 +276,9 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
public String getChosenTarget() { public String getChosenTarget() {
return fChosenTarget; return fChosenTarget;
} }
public String getChosenShort() {
return fChosenShort;
}
public IResource getChosenVerilogFile() { public IResource getChosenVerilogFile() {
return (fChosenVerilogFile!=null)?fChosenVerilogFile:fSelectedVerilogFile; return (fChosenVerilogFile!=null)?fChosenVerilogFile:fSelectedVerilogFile;
......
...@@ -522,7 +522,15 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -522,7 +522,15 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
enabled=(selectedItem != null); enabled=(selectedItem != null);
if (enabled && runFor[i].getCheckExistence()){ if (enabled && runFor[i].getCheckExistence()){
IPath path = new Path(name); IPath path = new Path(name);
IFile file = (path==null)?null:project.getFile(path); IFile file = null;
if (path!=null) {
try {
file = project.getFile(path);
} catch (IllegalArgumentException e) {
}
}
if (file==null){ if (file==null){
// System.out.println(name+" does not exist"); // System.out.println(name+" does not exist");
enabled=false; enabled=false;
......
This diff is collapsed.
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