def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_rectangle(x + w / 8, y + h / 8, w - w / 4, h / 3)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 3 - 10, y + h * 3 / 5, 'R2D', 16)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 6, y + h / 2, 'SetVar', 9)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 10, y + h / 2 + h / 5, "Hi!", int(min(h * 2 / 3, w * 2 / 3)))
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) painter.draw_text(x + self.width / 3, y + self.height / 2, self.variable, self.font)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 10, y + h * 3 / 5, '1/s^2', 12)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 3, y + h * 4 / 5, '*', 25)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 6, y + h * 1 / 2, 'Const', int(min(h * 2 / 3, w * 1 / 5)))
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) painter.draw_text(x + self.width / 3, y + self.height * 1 / 2, str(self.value), int(min(self.height * 2 / 3, self.font)))
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): # общее рисование painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.set_pen_width(3) painter.draw_line(x + w / 2, y + h / 5, x + w / 2, y + h * 4 / 5) painter.draw_line(x + w / 5, y + h / 2, x + w * 4 / 5, y + h / 2)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_line(x + w / 5, y + h / 2, x + w * 4 / 5, y + h / 2) painter.draw_line(x + w / 5, y + h / 7, x + w / 5, y + h * 6 / 7) painter.set_pen_width(2) painter.draw_line(x + w / 5, y + h * 4 / 5, x + w * 4 / 5, y + h / 5)
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) for i, sign in enumerate(self.signs): painter.draw_text(x + self.inputs[i].x_in_parent + 14, y + self.inputs[i].y_in_parent + 10, sign, self.font)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_line(x + 5, y + h / 2, x + w - 5, y + h / 2) painter.draw_line(x + w / 5, y + 5, x + w / 5, y + h - 5) painter.set_pen_width(2) painter.draw_curve(x + w / 5, y + h / 2, x + 1.5 * w / 5, y + 5, x + 2.5 * w / 5, y + 5, x + 3 * w / 5, y + h / 2) painter.draw_curve(x + 3 * w / 5, y + h / 2, x + 3.5 * w / 5, y + h - 10, x + 4.5 * w / 5, y + h - 10, x + w - 2, y + h / 2)
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) painter.draw_line(x + self.width / 5, y + self.height / 2, x + self.width * 4 / 5, y + self.height / 2) painter.draw_line(x + self.width / 5, y + self.height / 7, x + self.width / 5, y + self.height * 6 / 7) painter.set_pen_width(2) painter.draw_line(x + self.width / 5, y + self.height * 4 / 5, x + self.width * 4 / 5, y + self.height / 5)
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) painter.draw_text(x + self.width / 2 - 25, y + self.height * 3 / 5, '1/s^2', self.font) painter.draw_text(x + self.u_socket.x_in_parent + 14, y + self.u_socket.y_in_parent + 10, 'u', self.font) painter.draw_text(x + self.x_socket.x_in_parent - 14, y + self.x_socket.y_in_parent + 10, 'x', self.font) painter.draw_text(x + self.dx_socket.x_in_parent - 14, y + self.dx_socket.y_in_parent + 10, 'dx', self.font)
def paint_base(painter: SimPainter, x: float = 0, y: float = 0, w: float = 32, h: float = 32): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, w - 2, h - 2) painter.draw_text(x + w / 2 - 10, y + h / 2 + 10, 'sin', 15)
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.set_pen_width(1) painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2) painter.draw_text(x + self.width / 2 - 10, y + self.height / 2 + 10, 'sin', 15)
def paint(self, painter: SimPainter, x: float = 0, y: float = 0, scale: float = 1): painter.draw_rectangle(x + 1, y + 1, self.width - 2, self.height - 2)