Commit 06b222bd authored by Andrey Filippov's avatar Andrey Filippov

Debug/bug fix

parent 703c6d5c
......@@ -21,14 +21,15 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Stack;
import com.elphel.vdt.VDT;
import com.elphel.vdt.VerilogUtils;
import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.core.tools.params.ToolSequence;
import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.preference.PreferenceStrings;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
......@@ -366,7 +367,26 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
}
// Used when restoring from memento
public void setChosenVerilogFile(IResource file) {
public void setChosenVerilogFile(IResource file) {
if (file != null){
if (file.getType() != IResource.FILE) {
String msg="Tried to use "+file+" as HDL file";
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
MessageUI.error(msg);
}
System.out.println(msg);
return;
}
if (!VerilogUtils.isHhdlFile((IFile)file)){
String msg="Tried to use non-HDL "+file+" as HDL file";
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
MessageUI.error(msg);
}
System.out.println(msg);
return;
}
}
fChosenVerilogFile=file;
IProject project=getSelectedProject();
IProject newProject= (file == null)? null: file.getProject();
......
......@@ -276,7 +276,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("Initiating DB rebuild HDLFile="+HDLFile);
toolSequence.setUnfinishedBoot(null,true);
VerilogUtils.getTopModuleNames((IFile) HDLFile); // will initiate DB rebuild, updateDirty and call doLoadDesignMenu();
VerilogUtils.getTopModuleNames((IFile) HDLFile); // will initiate DB rebuild, updateDirty and call doLoadDesignMenu();
// java.lang.ClassCastException: org.eclipse.core.internal.resources.Project cannot be cast to org.eclipse.core.resources.IFile
// at com.elphel.vdt.ui.views.DesignFlowView.doLoadDesignMenu(DesignFlowView.java:279)
}
return;
}
......@@ -1265,7 +1267,10 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
toolSequence.setUnfinishedBoot(memento,true);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("Initiating DB rebuild HDLFile="+HDLFile);
VerilogUtils.getTopModuleNames((IFile) HDLFile);
VerilogUtils.getTopModuleNames((IFile) HDLFile);
// java.lang.ClassCastException: org.eclipse.core.internal.resources.Project cannot be cast to org.eclipse.core.resources.IFile
// at com.elphel.vdt.ui.views.DesignFlowView.restoreState(DesignFlowView.java:1270)
// at com.elphel.vdt.ui.views.DesignFlowView.createPartControl(DesignFlowView.java:237)
} else {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("Skipping DB rebuild HDLFile=NULL");
......
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