Exemplo n.º 1
0
    def __init__(self, callback=None, t_double_click=def_t_double_click,
                 t_long_click=def_t_long_click):
        self.callback = callback

        self.t_double_click = t_double_click
        self.t_long_click = t_long_click

        self.timer = QtCore.QTimer()
        self.timer   .setSingleShot(True)
        self.timer   .timeout.connect(self.timer_slot)
        self.info = self.MouseClickInfo()
Exemplo n.º 2
0
    def setDay(self, day: datetime.date):
        """Setting the day acts as a global initializator
        """
        self.mstime = None

        # TODO: set mintime and maxtime according to the day
        # Global time limits.  Any time outside this range is invisible

        assert (isinstance(day, datetime.date))
        t = day.timetuple()
        self.mintime = round(time.mktime(t) * 1000)
        self.maxtime = self.mintime + 24 * 3600 * 1000

        # currently zoomed-in time
        self.t0 = self.mintime
        self.t1 = self.maxtime

        self.logger.debug("setDay t0=%s, t1=%s", self.t0, self.t1)

        self.mouse_press_x = 0
        self.mouse_press_y = 0

        self.mouse_press_t = 0
        self.mouse_press_old_t = 0

        self.mouse_click_ctx = MouseClickContext(self.postMouseRelease)

        self.set_time_timer = QtCore.QTimer(self)
        self.set_time_timer.setSingleShot(True)

        self.struct_times_major = []
        self.struct_times_minor = []
        self.mstimestamps_major = []
        self.mstimestamps_minor = []

        self.makeTickMarks()
        self.reScale()
        self.repaint()
Exemplo n.º 3
0
 def __init__(self, callback=None):
     self.timer = QtCore.QTimer()
     self.timer.setSingleShot(True)
     self.callback = callback
     self.timer.timeout.connect(self.timer_slot)