mirror of https://gitlab.com/pamhyr/pamhyr2
BC, LC: Fix axes scale for none time data.
parent
35ee6617ac
commit
bb56c92938
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from tools import timer, trace
|
from tools import timer, trace
|
||||||
|
|
@ -29,6 +31,8 @@ from View.BoundaryCondition.Edit.translate import *
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class Plot(APlot):
|
class Plot(APlot):
|
||||||
def __init__(self, canvas=None, data=None,
|
def __init__(self, canvas=None, data=None,
|
||||||
mode = "time", toolbar=None):
|
mode = "time", toolbar=None):
|
||||||
|
|
@ -41,6 +45,9 @@ class Plot(APlot):
|
||||||
self._mode = mode
|
self._mode = mode
|
||||||
|
|
||||||
def custom_ticks(self):
|
def custom_ticks(self):
|
||||||
|
if self.data.header[0] != "time":
|
||||||
|
return
|
||||||
|
|
||||||
t0 = datetime.fromtimestamp(0)
|
t0 = datetime.fromtimestamp(0)
|
||||||
nb = len(self.data.data)
|
nb = len(self.data.data)
|
||||||
mod = int(nb / 5)
|
mod = int(nb / 5)
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ class Plot(APlot):
|
||||||
self._mode = mode
|
self._mode = mode
|
||||||
|
|
||||||
def custom_ticks(self):
|
def custom_ticks(self):
|
||||||
|
if self.data.header[0] != "time":
|
||||||
|
return
|
||||||
|
|
||||||
t0 = datetime.fromtimestamp(0)
|
t0 = datetime.fromtimestamp(0)
|
||||||
nb = len(self.data.data)
|
nb = len(self.data.data)
|
||||||
mod = int(nb / 5)
|
mod = int(nb / 5)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue