Skip to content

Commit ea00aa8

Browse files
committed
Merge branch 'main' of https://github.com/Timoite/GF2
2 parents 11846c6 + f5cbaed commit ea00aa8

16 files changed

Lines changed: 83 additions & 24 deletions

__pycache__/parse.cpython-310.pyc

1.69 KB
Binary file not shown.
5.52 KB
Binary file not shown.
-2.97 KB
Binary file not shown.
1.34 KB
Binary file not shown.
1.03 KB
Binary file not shown.

gui.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class MyGLCanvas(wxcanvas.GLCanvas):
4242
operations.
4343
"""
4444

45-
# Keep a record of all canvases
4645
instances = []
4746

4847
def __init__(self, parent, monitor_name):
@@ -57,7 +56,7 @@ def __init__(self, parent, monitor_name):
5756

5857
self.monitor_name = monitor_name
5958
self.parent = parent
60-
MyGLCanvas.instances.append(self)
59+
MyGLCanvas.instances.append(self) # Keep a record of all canvases
6160

6261
# Bind events to the canvas
6362
self.Bind(wx.EVT_PAINT, self.on_paint)
@@ -100,8 +99,8 @@ def render(self):
10099
self.devices.get_signal_ids(self.monitor_name)
101100
signal_list = self.monitors_dictionary[(device_id, output_id)]
102101

103-
# Draw signal trace
104-
GL.glColor3f(1.0, 0.0, 0.0)
102+
# Draw a sample signal trace
103+
GL.glColor3f(0.0, 0.0, 1.0) # signal trace is blue
105104
GL.glBegin(GL.GL_LINE_STRIP)
106105
i = 0
107106
y_HIGH = 40
@@ -128,7 +127,7 @@ def render(self):
128127
GL.glVertex2f(x_next, y_next)
129128
i += 1
130129
GL.glEnd()
131-
except (AttributeError): # TODO this is the wrong error to catch
130+
except (AttributeError): # this is the wrong error to catch
132131
pass
133132

134133
# We have been drawing to the back buffer, flush the graphics pipeline
@@ -186,7 +185,7 @@ def on_run(self, cycles_completed):
186185

187186
def on_resize(self, event):
188187
"""Refresh scroll position when resized."""
189-
virtual_size = [max(self.parent.GetSize()[0]-216,
188+
virtual_size = [max(self.parent.GetSize()[0]-196,
190189
(self.cycles_completed+2)*20), 60]
191190
self.canvas.SetSize(virtual_size)
192191
self.SetScrollbars(1, 1, virtual_size[0], virtual_size[1])
@@ -214,8 +213,8 @@ def __init__(self, title):
214213
self.main_sizer = wx.StaticBoxSizer(wx.VERTICAL, self)
215214
self.upper_sizer = wx.BoxSizer(wx.HORIZONTAL)
216215
self.lower_sizer = wx.StaticBoxSizer(wx.VERTICAL, self)
217-
self.main_sizer.Add(self.upper_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
218-
self.main_sizer.Add(self.lower_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 10)
216+
self.main_sizer.Add(self.upper_sizer, 0, wx.EXPAND, 0)
217+
self.main_sizer.Add(self.lower_sizer, 0, wx.EXPAND | wx.TOP, 10)
219218

220219
self.io_sizer = wx.StaticBoxSizer(wx.VERTICAL, self)
221220
self.switches_sizer = wx.StaticBoxSizer(wx.VERTICAL, self)
@@ -228,8 +227,8 @@ def __init__(self, title):
228227
total_sizer = wx.BoxSizer(wx.HORIZONTAL)
229228
self.io_sizer.Add(fileio_sizer, 0, wx.ALL | wx.CENTER, 5)
230229
self.io_sizer.Add(cycles_sizer, 0, wx.TOP | wx.CENTER, 15)
231-
self.io_sizer.Add(run_cont_sizer, 0, wx.ALL | wx.CENTER, 20)
232-
self.io_sizer.Add(total_sizer, 0, wx.BOTTOM | wx.CENTER, 20)
230+
self.io_sizer.Add(run_cont_sizer, 0, wx.ALL | wx.CENTER, 10)
231+
self.io_sizer.Add(total_sizer, 0, wx.TOP | wx.CENTER, 15)
233232

234233
# Configure the widgets
235234

@@ -255,7 +254,7 @@ def __init__(self, title):
255254

256255
# Total cycles widgets
257256
text = wx.StaticText(self, wx.ID_ANY, "Total Cycles: ")
258-
total_sizer.Add(text, 0, wx.CENTER | wx.RIGHT, 15)
257+
total_sizer.Add(text, 0, wx.CENTER | wx.RIGHT, 5)
259258
self.total_cycles_text = \
260259
wx.StaticText(self, wx.ID_ANY, str(self.cycles_completed))
261260
total_sizer.Add(self.total_cycles_text, 0, wx.CENTER)
@@ -294,7 +293,7 @@ def __init__(self, title):
294293
self.SetSizeHints(500, 500)
295294
self.SetSize(600, 600)
296295
self.SetSizer(self.main_sizer)
297-
self.SetPosition((100, 100))
296+
self.SetPosition((0, 39))
298297

299298
def AddSwitch(self, switch_id, switch_state):
300299
"""Add a switch to GUI."""

scanner.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
31
"""Read the circuit definition file and translate the characters into symbols.
42
53
Used in the Logic Simulator project to read the characters in the definition
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)