|
|
@@ -1,9 +1,6 @@
|
|
|
###################
|
|
|
# Gui Data Types
|
|
|
###################
|
|
|
-# from GuiType import (_GuiForm,_GuiFormMulti,_GuiTreeRow,_GuiTree,_GuiWinText,
|
|
|
-# _GuiWinLinedText,_GuiWinForm,_GuiWinFormMulti,_GuiWinTree,_GuiSideBar,
|
|
|
-# _GuiMessage, _GuiMessages,)
|
|
|
__all__ = ["_GuiForm","_GuiFormMulti","_GuiTreeRow","_GuiTree","_GuiWinText",
|
|
|
"_GuiWinLinedText","_GuiWinForm","_GuiWinFormMulti","_GuiWinTree","_GuiSideBar",
|
|
|
"_GuiMessage", "_GuiMessages",]
|
|
|
@@ -77,17 +74,48 @@ class _GuiWinLinedText():
|
|
|
self.LinedText = lined_text
|
|
|
self.GotoLine = line
|
|
|
|
|
|
-
|
|
|
class _GuiWinForm():
|
|
|
- def __init__(self, title, form):
|
|
|
- self.Title = title
|
|
|
- self.Form = form
|
|
|
-
|
|
|
+ def __init__(self, title, form, formtype):
|
|
|
+ assert isinstance(title, str)
|
|
|
+ assert isinstance(form, _GuiForm)
|
|
|
+ assert formtype in {"Property", "Timing", "Clock"}
|
|
|
+ self.Title = title
|
|
|
+ self.Form = form
|
|
|
+ self.Type = formtype
|
|
|
+ self._hasCrossProbeMenu = self.Type != "Property" # property does not support crossprobe
|
|
|
+ self._hasReportVirtualTimingButton = self.Type != "Property" # property does not has RVT button
|
|
|
+
|
|
|
+ def CrossProbe(self, formrow):
|
|
|
+ assert isinstance(formrow, list)
|
|
|
+ line = 1000
|
|
|
+ return _GuiWinLinedText(str(formrow), ("Text Start\n\n"+'\n'.join(['generated line '+str(x) for x in range(3, line*2)])+"\n\nText End").split("\n"), line)
|
|
|
+
|
|
|
+ def ReportVirtualTiming(self, formrow, _GUI):
|
|
|
+ assert isinstance(formrow, list)
|
|
|
+ if self.Type == "Timing":
|
|
|
+ return _GUI.ReportVirtualTiming("Pins", formrow[0], "", "", "Pins", formrow[1], False, 1)
|
|
|
+ else: # Clocks
|
|
|
+ return _GUI.ReportVirtualTiming("Clocks", formrow[0], "", "", "Clocks", formrow[1], False, 1)
|
|
|
|
|
|
class _GuiWinFormMulti():
|
|
|
- def __init__(self, title, forms):
|
|
|
- self.Title = title
|
|
|
- self.Forms = forms
|
|
|
+ def __init__(self, title, forms, formtype):
|
|
|
+ assert isinstance(title, str)
|
|
|
+ assert isinstance(forms, _GuiFormMulti)
|
|
|
+ assert formtype in {"Timing", "Clock"}
|
|
|
+ self.Title = title
|
|
|
+ self.Forms = forms
|
|
|
+ self.Type = formtype
|
|
|
+
|
|
|
+ def CrossProbe(self, formname, formrow):
|
|
|
+ assert isinstance(formname, str)
|
|
|
+ assert isinstance(formrow, list)
|
|
|
+ line = 1000
|
|
|
+ return _GuiWinLinedText(str(formrow), ("Text Start\n\n"+'\n'.join(['generated line '+str(x) for x in range(3, line*2)])+"\n"+formname+"\n\nText End").split("\n"), line)
|
|
|
+
|
|
|
+ def ReportVirtualTiming(self, formname, formrow, _GUI):
|
|
|
+ assert isinstance(formname, str)
|
|
|
+ assert isinstance(formrow, list)
|
|
|
+ return _GUI.ReportVirtualTiming("Pins", formrow[0], "", "", "Pins", formrow[1], False, 1)
|
|
|
|
|
|
|
|
|
class _GuiWinTree():
|
|
|
@@ -115,7 +143,7 @@ class _GuiSideBar():
|
|
|
assert isinstance(treenames, list)
|
|
|
assert isinstance(formname, (str, type(None)))
|
|
|
assert isinstance(formrow, list)
|
|
|
- return _GuiWinForm(str(formname)+" Properties", _GuiForm(["Name", "Property"], [[x, "property"] for x in treenames+formrow]))
|
|
|
+ return _GuiWinForm(str(formname)+" Properties", _GuiForm(["Name", "Property"], [[x, "property"] for x in treenames+formrow]), "Property")
|
|
|
|
|
|
class _GuiMessage(): # _GuiMessage("This is an error!!!", 100, "/x/xx.v")
|
|
|
def __init__(self, text, line, filepath):
|
|
|
@@ -127,7 +155,7 @@ class _GuiMessage(): # _GuiMessage("This is an error!!!", 100, "/x/xx.v")
|
|
|
def CrossProbe(self):
|
|
|
return _GuiWinLinedText(self.FilePath, ("Text Start\n\n"+'\n'.join(['generated line '+str(x) for x in range(3, self.Line*2)])+"\n\nText End").split("\n"), self.Line)
|
|
|
def Properties(self):
|
|
|
- return _GuiWinForm("Message Properties", _GuiForm(["Name", "Property"], [["File", self.FilePath], ["Line", str(self.Line)]]))
|
|
|
+ return _GuiWinForm("Message Properties", _GuiForm(["Name", "Property"], [["File", self.FilePath], ["Line", str(self.Line)]]), "Property")
|
|
|
|
|
|
class _GuiMessages(): # _GuiMessages([["Err-123","This is an error",[_GuiMessage("This is an error!", 100, "/x/x.v"),_GuiMessage("This is an error!!", 200, "/xx/xx.v")]]])
|
|
|
def __init__(self, id_messages):
|