mirror of https://gitlab.com/pamhyr/pamhyr2
debug
parent
80ae4c36ad
commit
e7b63fe270
|
|
@ -227,7 +227,10 @@ class TableModel(PamhyrTableModel):
|
|||
line.startswith("*") or
|
||||
line.startswith("$")):
|
||||
line = line.split()
|
||||
data0.append(float(line[0]) * mult)
|
||||
if bctype == "ZD":
|
||||
data0.append(float(line[0]))
|
||||
else:
|
||||
data0.append(old_pamhyr_date_to_timestamp(line[0]))
|
||||
data1.append(line[1])
|
||||
|
||||
self.replace_data(data0, data1)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
import logging
|
||||
import traceback
|
||||
|
||||
from tools import trace, timer
|
||||
from tools import trace, timer, old_pamhyr_date_to_timestamp
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
Qt, QVariant, QAbstractTableModel,
|
||||
|
|
@ -310,12 +310,17 @@ class TableModel(PamhyrTableModel):
|
|||
if line[0] == "$":
|
||||
current_reach = int(line[1]) - 1
|
||||
if (current_reach <= len(self._data.enable_edges()) and
|
||||
current_reach > 0) :
|
||||
current_reach >= 0) :
|
||||
data.append([self._data.enable_edges()[current_reach], float(line[2]), float(line[3])])
|
||||
else:
|
||||
if (current_reach <= len(self._data.enable_edges()) and
|
||||
current_reach > 0) :
|
||||
data[-1].append([float(line[0]), float(line[1])])
|
||||
current_reach >= 0) :
|
||||
data[-1].append(
|
||||
[
|
||||
old_pamhyr_date_to_timestamp(line[0]),
|
||||
float(line[1])
|
||||
]
|
||||
)
|
||||
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
|
||||
|
|
|
|||
|
|
@ -260,6 +260,9 @@ def date_dmy_to_timestamp(date: str):
|
|||
def old_pamhyr_date_to_timestamp(date: str):
|
||||
v = date.split(":")
|
||||
if len(v) != 4:
|
||||
if len(v) == 1: # minutes
|
||||
return int(float(v[0]) * 60) # Minute to sec
|
||||
else:
|
||||
return 0
|
||||
|
||||
m = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue