Exemplo n.º 1
0
    def plot_second_stage_line(self, stage2pos_samp):
        """
        Plot the second stage of labour

        :param stage2pos_samp:
        :return:
        """
        meanline = Qwt.QwtPlotMarker()
        meanline.setLineStyle(Qwt.QwtPlotMarker.VLine)
        meanline.setLinePen(Qt.QPen(Qt.Qt.darkBlue, 4))

        meanline.setXValue(stage2pos_samp)
        meanline.attach(self)
Exemplo n.º 2
0
    def plot_bith_line(self, pos_samp):
        """
        Plot line indicating birth time

        :param pos_samp:
        :return:
        """
        meanline = Qwt.QwtPlotMarker()
        meanline.setLineStyle(Qwt.QwtPlotMarker.VLine)
        meanline.setLinePen(Qt.QPen(Qt.Qt.green, 4))

        meanline.setXValue(pos_samp)
        meanline.attach(self)
Exemplo n.º 3
0
    def plot_first_stage_line(self, stage1pos_samp):
        """
        Plot the first stage of labour

        :param stage1pos_samp:
        :return:
        """
        meanline2 = Qwt.QwtPlotMarker()
        meanline2.setLineStyle(Qwt.QwtPlotMarker.VLine)
        meanline2.setLinePen(Qt.QPen(Qt.Qt.darkCyan, 4))

        meanline2.setXValue(stage1pos_samp)
        meanline2.attach(self)
Exemplo n.º 4
0
    def __init__(self, parent=None, name=''):
        Qwt.QwtPlot.__init__(self, parent)

        self._log = logging.getLogger(ConfigStatic.logger_name)
        self._log.info('passed')

        self.__name = name
        self._font_app = QtGui.QFont()

        dpi = 96
        # TODO test physicalDpi (funguje v MainWindow.py)
        self._dpi2px = dpi*(1/2.54)
        self._plotSpeed = EnumPlotSpeed.oneCmMin
        self._plotBpm = EnumPlotBpm.twentyBpmCm
        self._plotBpmMajorTick = self._plotBpm

        #: Doc comment for instance attribute qux.
        self._minView = 0
        self._maxView = 240
        self._min_view_paper_lim = 0
        self._max_view_paper_lim = 240
        self._paper_format = EnumPaperFormat.EU
        self._minTime = 0
        self._maxTime = 0
        self._centerPoint = 0
        self.__sampling_freq = 4

        self._x = np.zeros(1)
        self._y = np.zeros(1)
        self._timeString = list()

        self._define_paper()

        # self.__canvasXMap = self.canvasMap(Qwt.QwtPlot.xBottom)
        # self.__canvasYMap = self.canvasMap(Qwt.QwtPlot.yLeft)

        self.setCanvasBackground(Qt.Qt.white)
        self.setAxisTitle(Qwt.QwtPlot.xBottom, "Time [min]")
        self.setAxisTitle(Qwt.QwtPlot.yLeft, "")

        # curves
        self.curve1 = Qwt.QwtPlotCurve('signal')
        # #self.curve1.setRenderHint(Qwt.QwtPlotItem.RenderAntialiased)
        # self.curve1.setPen(QPen(Qt.Qt.black,0, Qt.Qt.SolidLine))
        # self.curve1.setYAxis(Qwt.QwtPlot.yLeft)
        # self.curve1.attach(self)
        self._baseline = Qwt.QwtPlotMarker()

        ''' annotations '''
        self.__d_ann_all_curves = dict()
        self.d_ann_all_curves_navplot = dict()
        self.__ann_action = 0
        self.caliper = Caliper(self, EnumAnnType.plot_fhr, EnumAnnType.caliper)
        # self.caliper.plot()

        # time scale - for string time scale
        self.timeScale = TimeScaleDraw(self)
        self.setAxisScaleDraw(Qwt.QwtPlot.xBottom, self.timeScale)

        # time scale - for Y axis
        self.yAxisScale = AxisYScaleDraw(self)
        self.setAxisScaleDraw(Qwt.QwtPlot.yLeft, self.yAxisScale)

        self._bPlotDatesXAxis = False
        self._time_tics_located = list()
        self._locator_min = 5
        self._locator_hour = 0

        # grid
        self.grid = Qwt.QwtPlotGrid()
        self.grid.enableYMin(True)
        self.grid.enableXMin(True)
        self.grid.setMajPen(QtGui.QPen(Qt.Qt.lightGray, 0, Qt.Qt.SolidLine))
        self.grid.setMinPen(QtGui.QPen(Qt.Qt.lightGray, 0, Qt.Qt.DotLine))
        self.grid.attach(self)

        self.__set_axis_app_font()