def write_comparator(canvas, t=I): width = GS t = I.move((0.5 * width, 0.0)).transform(t) Line(COMPARATOR_POINTS, I.scale(0.3, 0.3).transform(t)).write(canvas) Line(COMPARATOR_POINTS, I.scale(-0.3, -0.3).transform(t)).write(canvas) Line(EQ_TRIANGLE, I.scale(-1.3, 1.3).transform(t)).write(canvas) return t.move(t.transform_vector((0.5 * GS, 0.0)))
def write_pump(canvas, transf=I): symbol = Circle(transf) symbol.write(canvas) t = I.scale(-0.6, 0.6).transform(transf) symbol = Line(EQ_TRIANGLE, t) symbol.write(canvas) return transf.move(transf.transform_vector((1.5, 0.0)))
def write_arrow(canvas, t=I): width = GS Line(((0.3, 0.0), (width - 0.3, 0.0)), t).write(canvas) Line(EQ_TRIANGLE, I.scale(-0.3, 0.3).move( (width - 0.3, 0.0)).transform(t)).write(canvas) return t.move(t.transform_vector((width, 0.0)))
def write_pump(canvas, transf=I): if canvas is not None: symbol = Circle(transf) symbol.write(canvas) t = I.scale(-0.6, 0.6).transform(transf) symbol = Line(EQ_TRIANGLE, t) symbol.write(canvas) return transf.r_move(-0.5, 0.0), transf.r_move(0.5, 0.0)
def write_converter(labels, canvas, t=I): width = GS t = I.move((0.5 * width, 0.0)).transform(t) Square(I.scale(1.5, 1.5).transform(t)).write(canvas) Line(((-0.75, -0.75), (0.75, 0.75)), t).write(canvas) canvas.text(labels[0], t.transform_point((-0.35, 0.35))) canvas.text(labels[1], t.transform_point((0.35, -0.35))) return t.move(t.transform_vector((0.5 * width, 0.0)))
def write_temp_sensor(canvas, t = I): width = GS t = I.move((0.5 * width, 0.0)).transform(t) Square(I.scale(RESISTOR_RATIO, 1.0).move((0.0, 0.0)).transform(t)).write(canvas) Line(((0.4, 0.4), (-0.4, -0.4), (-0.7, -0.4)), t).write(canvas) # Square(I.scale(1.5, 1.5).transform(t)).write(canvas) canvas.text('$\\vartheta$', t.transform_point((-0.55, -0.4)), position='n') return I.move((0.2 * GS, 0.0)).transform(t)
def write_fork(canvas, t=I): width = GS Line(((0.3, 0.0), (width - 0.3, 0.0)), t).write(canvas) Line(((width - 0.3, 1.25 * GS), (0.5 * width, 1.25 * GS), (0.5 * width, -1.25 * GS), (width - 0.3, -1.25 * GS)), t).write(canvas) Line(EQ_TRIANGLE, I.scale(-0.3, 0.3).move( (width - 0.3, 1.25 * GS)).transform(t)).write(canvas) Line(EQ_TRIANGLE, I.scale(-0.3, 0.3).move( (width - 0.3, 0.0)).transform(t)).write(canvas) Line(EQ_TRIANGLE, I.scale(-0.3, 0.3).move( (width - 0.3, -1.25 * GS)).transform(t)).write(canvas) return [ I.move((width, 1.25 * GS)).transform(t), I.move((width, 0.0)).transform(t), I.move((width, -1.25 * GS)).transform(t) ]
def write_radiator(canvas, transf=I): if canvas is not None: symbol = Square(I.scale(2.0, 3.0).transform(transf)) symbol.write(canvas) return transf.r_move(-1.0, 0.0), transf.r_move(1.0, 0.0)
def write_heater(canvas, transf=I): if canvas is not None: t = I.scale(2.0, 3.0).transform(transf) symbol = Square(t) symbol.write(canvas) return transf.r_move(-1.0, 0.0), transf.r_move(1.0, 0.0)
def write_radiator(canvas, transf=I): symbol = Square(I.scale(3.0, 4.0).transform(transf)) symbol.write(canvas) return transf.move(transf.transform_vector((4.0, 0.0)))
def write_heater(canvas, transf=I): t = I.scale(3.0, 4.0).transform(transf) symbol = Square(t) symbol.write(canvas) return transf.move(transf.transform_vector((3.0, 0.0)))