Commit d2d7c636 authored by Andrey Filippov's avatar Andrey Filippov

Configuring tools for IVerilog & GTKWave + minor bug fixes

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