0 modification mais ça se voit pas

This commit is contained in:
mpboyer 2025-01-15 08:37:07 +01:00
parent f06589562c
commit d67a33203b
2 changed files with 4 additions and 21 deletions

View file

@ -3,6 +3,7 @@ import socket
import GCode_Interpreterdc import GCode_Interpreterdc
from controller import DummyController from controller import DummyController
class Hardware: class Hardware:
def __init__(self, bind): def __init__(self, bind):
self.s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
@ -19,7 +20,6 @@ class SimuHardware(Hardware):
def __init__(self, bind): def __init__(self, bind):
Hardware.__init__(self, bind) Hardware.__init__(self, bind)
def probe(self, gtm): def probe(self, gtm):
self.s.send("request\n".encode()) self.s.send("request\n".encode())
encoder_x = int(socket.SocketIO(self.s, "rw").readline()) encoder_x = int(socket.SocketIO(self.s, "rw").readline())
@ -67,7 +67,6 @@ class SimuHardware(Hardware):
self.s.send(str(gtm.z_direction).encode() + b" " + str(gtm.FAST_Z_FEEDRATE / gtm.z_throttle).encode() + b"\n") self.s.send(str(gtm.z_direction).encode() + b" " + str(gtm.FAST_Z_FEEDRATE / gtm.z_throttle).encode() + b"\n")
if __name__ == '__main__': if __name__ == '__main__':
b = "socket.sock" b = "socket.sock"
sh = SimuHardware(b) sh = SimuHardware(b)

View file

@ -3,17 +3,6 @@ import os
import time import time
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
#from color import Color
#c1 = Color("#7d1dd3")
#c2 = Color("#ffe500")
#colors = list(c1.range_to(c2, 42))
def infinite_colors():
for x in iter(int, 1):
yield colors[x % 42]
def parse_speed(text): def parse_speed(text):
@ -99,11 +88,6 @@ class Simulator:
class Douche: class Douche:
colors = infinite_colors()
last_x = None
last_y = None
def __init__(self): def __init__(self):
# We will assume no points are `really` in 3D. # We will assume no points are `really` in 3D.
plt.ion() plt.ion()
@ -113,7 +97,7 @@ class Douche:
self.ys = [] self.ys = []
ax.set_xlim([0, 300]) ax.set_xlim([0, 300])
ax.set_ylim([0, 300]) ax.set_ylim([0, 300])
self.line, = ax.plot(self.xs, self.ys) self.line, = ax.plot(self.xs, self.ys, c="#7d1dd3")
def add_point(self, x, y): def add_point(self, x, y):
self.xs.append(x) self.xs.append(x)