mirror of https://gitlab.com/pamhyr/pamhyr2
work on import data in result window
parent
57a80d00aa
commit
bf95b7f7e6
|
|
@ -44,7 +44,7 @@ from PyQt5.QtWidgets import (
|
|||
QFileDialog, QTableView, QAbstractItemView,
|
||||
QUndoStack, QShortcut, QAction, QItemDelegate,
|
||||
QComboBox, QVBoxLayout, QHeaderView, QTabWidget,
|
||||
QSlider, QLabel, QWidget, QGridLayout, QTabBar
|
||||
QSlider, QLabel, QWidget, QGridLayout, QTabBar, QInputDialog
|
||||
)
|
||||
|
||||
from View.Tools.Plot.PamhyrCanvas import MplCanvas
|
||||
|
|
@ -1231,6 +1231,9 @@ class ResultsWindow(PamhyrWindow):
|
|||
)
|
||||
|
||||
def read_csv_file(self, filename):
|
||||
if filename == "":
|
||||
return
|
||||
|
||||
with open(filename, 'r', newline='') as f:
|
||||
lines=f.readlines()
|
||||
x = []
|
||||
|
|
@ -1242,7 +1245,18 @@ class ResultsWindow(PamhyrWindow):
|
|||
if len(row) > 1:
|
||||
x.append(float(row[0]))
|
||||
y.append(float(row[1]))
|
||||
data_type_lst =['Q(t)', 'Z(x)']
|
||||
data_type, ok = QInputDialog.getItem(
|
||||
self, 'Data type', 'Chose the type of data:', data_type_lst)
|
||||
|
||||
if not ok:
|
||||
return
|
||||
|
||||
print(x)
|
||||
print(y)
|
||||
self.canvas_2.axes.scatter(x, y, marker="+")
|
||||
self.plot_rkc.idle()
|
||||
if data_type == 'Z(x)':
|
||||
self.canvas_2.axes.scatter(x, y, marker="+")
|
||||
self.plot_rkc.idle()
|
||||
if data_type == 'Q(t)':
|
||||
self.canvas_4.axes.scatter(x, y, marker="+")
|
||||
self.plot_h.idle()
|
||||
|
|
|
|||
Loading…
Reference in New Issue