Commit bb56c929 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

BC, LC: Fix axes scale for none time data.

Showing with 10 additions and 0 deletions
+10 -0
...@@ -16,6 +16,8 @@ ...@@ -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 * ...@@ -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): ...@@ -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): ...@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment