mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
debug
This commit is contained in:
1 parent
80ae4c36ad
commit
e7b63fe270
3 files changed
+16
-5
No files matched your search
@@ -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 = [
|
||||
|
||||
Reference in new issue
Block a user