diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-09-16 13:09:46 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-09-16 13:09:49 -0400 |
| commit | 5e9cb83a9375a2b6312f390e84e4ac8e778d04cb (patch) | |
| tree | a90595950f5d2fcd0e53a3af5e8bc6cddfd4216b /lib/simulator.py | |
| parent | fa125ff27ef2682f78faf307b3de29456c263ad3 (diff) | |
remove code style exemption for params.py and simulator.py
Diffstat (limited to 'lib/simulator.py')
| -rw-r--r-- | lib/simulator.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/simulator.py b/lib/simulator.py index 4408adb8..5855264d 100644 --- a/lib/simulator.py +++ b/lib/simulator.py @@ -20,6 +20,7 @@ COLOR_CHANGE = 4 class ControlPanel(wx.Panel): """""" + def __init__(self, parent, *args, **kwargs): """""" self.parent = parent @@ -150,8 +151,6 @@ class ControlPanel(wx.Panel): self.update_speed_text() def on_direction_button(self, event): - evtObj = event.GetEventObject() - lbl = evtObj.GetLabel() if self.direction == 1: self.animation_forward() else: @@ -168,7 +167,6 @@ class ControlPanel(wx.Panel): self.speedST.SetLabel(_('Speed: %d stitches/sec') % (self.speed * self.direction)) self.hbSizer2.Layout() - def on_slider(self, event): stitch = event.GetEventObject().GetValue() self.stitchBox.SetValue(stitch) @@ -229,6 +227,7 @@ class ControlPanel(wx.Panel): def animation_restart(self, event): self.drawing_panel.restart() + class DrawingPanel(wx.Panel): """""" @@ -305,8 +304,6 @@ class DrawingPanel(wx.Panel): stitch_increment = int(self.speed * frame_time) - #print >> sys.stderr, time.time(), "animate", self.current_stitch, stitch_increment, self.last_frame_duration, frame_time - self.set_current_stitch(self.current_stitch + self.direction * stitch_increment) wx.CallLater(int(1000 * frame_time), self.animate) @@ -320,7 +317,6 @@ class DrawingPanel(wx.Panel): transform = canvas.GetTransform() transform.Translate(*self.pan) transform.Scale(self.zoom / self.PIXEL_DENSITY, self.zoom / self.PIXEL_DENSITY) - #transform.Translate(self.pan[0] * self.PIXEL_DENSITY, self.pan[1] * self.PIXEL_DENSITY) canvas.SetTransform(transform) stitch = 0 @@ -535,15 +531,14 @@ class DrawingPanel(wx.Panel): # Finally, compensate for that change in position: self.pan = (self.pan[0] - x_delta, self.pan[1] - y_delta) - self.zoom *= zoom_delta - self.Refresh() class SimulatorPanel(wx.Panel): """""" + def __init__(self, parent, *args, **kwargs): """""" self.parent = parent @@ -618,6 +613,7 @@ class EmbroiderySimulator(wx.Frame): def clear(self): self.simulator_panel.clear() + def show_simulator(stitch_plan): app = wx.App() current_screen = wx.Display.GetFromPoint(wx.GetMousePosition()) |
