Merge remote-tracking branch 'origin/v0.0.8'

setup.py
Pierre-Antoine Rouby 2024-05-17 12:01:17 +02:00
commit 4e0c671f68
4 changed files with 36 additions and 28 deletions

View File

@ -125,14 +125,6 @@ class MeshingDialog(PamhyrDialog):
def lplan(self): def lplan(self):
return self._lplan return self._lplan
@property
def origin(self):
return self._origin
@property
def lm(self):
return int(self._lm)
@property @property
def linear(self): def linear(self):
return self._linear return self._linear
@ -165,15 +157,9 @@ class MeshingDialog(PamhyrDialog):
self._begin_cs = self.profiles.index(p1) self._begin_cs = self.profiles.index(p1)
self._end_cs = self.profiles.index(p2) self._end_cs = self.profiles.index(p2)
origin = self.get_combobox_text("comboBox_origin")
self._origin = self.profiles.index(origin)
self._begin_dir = self.get_combobox_text("comboBox_begin_gl") self._begin_dir = self.get_combobox_text("comboBox_begin_gl")
self._end_dir = self.get_combobox_text("comboBox_end_gl") self._end_dir = self.get_combobox_text("comboBox_end_gl")
r_lm_dict = self._trad.get_dict("r_lm_dict")
self._lm = r_lm_dict[self.get_combobox_text("comboBox_lm")]
super().accept() super().accept()
def reject(self): def reject(self):

View File

@ -82,12 +82,14 @@ class PlotAC(PamhyrPlot):
label=self.label_previous_plot_selected, label=self.label_previous_plot_selected,
lw=1.5, linestyle='--', color=self.color_plot_previous lw=1.5, linestyle='--', color=self.color_plot_previous
) )
#self.previous_plot_selected.set_visible(False)
self.plot_selected, = self.canvas.axes.plot( self.plot_selected, = self.canvas.axes.plot(
station, elevation, station, elevation,
label=self.label_plot_selected, label=self.label_plot_selected,
color=self.color_plot_current, lw=1.5 color=self.color_plot_current, lw=1.5
) )
#self.plot_selected.set_visible(False)
next_id = profile_id + 1 next_id = profile_id + 1
station_next = self.data.profile(next_id).get_station() station_next = self.data.profile(next_id).get_station()
@ -98,6 +100,8 @@ class PlotAC(PamhyrPlot):
label=self.label_next_plot_selected, label=self.label_next_plot_selected,
color=self.color_plot_next, lw=1.6, linestyle='--' color=self.color_plot_next, lw=1.6, linestyle='--'
) )
#self.next_plot_selected.set_visible(False)
self.canvas.axes.set_visible(False)
def draw_gl(self): def draw_gl(self):
if self._current_data_update: if self._current_data_update:
@ -106,6 +110,7 @@ class PlotAC(PamhyrPlot):
profile_id = 0 profile_id = 0
profile = self.data.profile(profile_id) profile = self.data.profile(profile_id)
if profile == None: return
station = profile.get_station() station = profile.get_station()
elevation = profile.z() elevation = profile.z()
gl = profile.names() gl = profile.names()
@ -160,6 +165,9 @@ class PlotAC(PamhyrPlot):
self.draw() self.draw()
return return
if self.data is None:
return
self.update_current() self.update_current()
self.update_gl() self.update_gl()
@ -171,6 +179,10 @@ class PlotAC(PamhyrPlot):
previous_id = profile_id - 1 previous_id = profile_id - 1
next_id = profile_id + 1 next_id = profile_id + 1
self.previous_plot_selected.set_visible(False)
self.plot_selected.set_visible(False)
self.next_plot_selected.set_visible(False)
self.previous_plot_selected.set_data([], []) self.previous_plot_selected.set_data([], [])
self.plot_selected.set_data([], []) self.plot_selected.set_data([], [])
self.next_plot_selected.set_data([], []) self.next_plot_selected.set_data([], [])
@ -180,18 +192,25 @@ class PlotAC(PamhyrPlot):
self.data.profile(previous_id).get_station(), self.data.profile(previous_id).get_station(),
self.data.profile(previous_id).z() self.data.profile(previous_id).z()
) )
self.previous_plot_selected.set_visible(True)
#self.canvas.axes.legend()
if 0 <= profile_id < self.data.number_profiles: if 0 <= profile_id < self.data.number_profiles:
self.plot_selected.set_data( self.plot_selected.set_data(
self.data.profile(profile_id).get_station(), self.data.profile(profile_id).get_station(),
self.data.profile(profile_id).z() self.data.profile(profile_id).z()
) )
self.plot_selected.set_visible(True)
#self.canvas.axes.legend()
if 0 <= next_id < self.data.number_profiles: if 0 <= next_id < self.data.number_profiles:
self.next_plot_selected.set_data( self.next_plot_selected.set_data(
self.data.profile(next_id).get_station(), self.data.profile(next_id).get_station(),
self.data.profile(next_id).z() self.data.profile(next_id).z()
) )
self.next_plot_selected.set_visible(True)
#self.canvas.axes.legend()
self.canvas.axes.set_visible(True)
def update_full(self): def update_full(self):
self.draw() self.draw()

View File

@ -157,6 +157,7 @@ class GeometryWindow(PamhyrWindow):
def _compute_status_label(self): def _compute_status_label(self):
row = self.index_selected_row() row = self.index_selected_row()
if row == None: return
profile = self._reach.profile(row) profile = self._reach.profile(row)
name = profile.name + " " + str(profile.kp) name = profile.name + " " + str(profile.kp)
@ -298,10 +299,8 @@ class GeometryWindow(PamhyrWindow):
data = { data = {
"step": dlg.space_step, "step": dlg.space_step,
"limites": [dlg.begin_cs, dlg.end_cs], "limites": [dlg.begin_cs, dlg.end_cs],
"origin": dlg.origin,
"directrices": [dlg.begin_dir, dlg.end_dir], "directrices": [dlg.begin_dir, dlg.end_dir],
"lplan": dlg.lplan, "lplan": dlg.lplan,
"lm": dlg.lm,
"linear": dlg.linear, "linear": dlg.linear,
} }
self._edit_meshing(data) self._edit_meshing(data)
@ -405,7 +404,7 @@ class GeometryWindow(PamhyrWindow):
def update_plot_ac(self, ind: int): def update_plot_ac(self, ind: int):
self.tableView.model().blockSignals(True) self.tableView.model().blockSignals(True)
self._plot_ac.current = ind #self._plot_ac.current = ind
self._plot_ac.update() self._plot_ac.update()
self.tableView.model().blockSignals(False) self.tableView.model().blockSignals(False)
@ -449,10 +448,8 @@ class GeometryWindow(PamhyrWindow):
def select_current_profile(self): def select_current_profile(self):
self.tableView.model().blockSignals(True) self.tableView.model().blockSignals(True)
row = self.index_selected_row()
if len(self.tableView.selectedIndexes()) > 0: if row != None:
row = self.index_selected_row()
self.find(QSlider, "verticalSlider").setValue(row) self.find(QSlider, "verticalSlider").setValue(row)
self.select_plot_xy(row) self.select_plot_xy(row)
self.select_plot_kpc(row) self.select_plot_kpc(row)
@ -511,10 +508,14 @@ class GeometryWindow(PamhyrWindow):
self._table.delete(rows) self._table.delete(rows)
def index_selected_row(self): def index_selected_row(self):
return self.tableView\ r = self.tableView\
.selectionModel()\ .selectionModel()\
.selectedRows()[0]\ .selectedRows()
.row()
if len(r) > 0:
return r[0].row()
else:
return None
def sort_ascending(self): def sort_ascending(self):
self._table.sort_profiles(False) self._table.sort_profiles(False)
@ -529,11 +530,13 @@ class GeometryWindow(PamhyrWindow):
def move_up(self): def move_up(self):
row = self.index_selected_row() row = self.index_selected_row()
if row == None: return
self._table.move_up(row) self._table.move_up(row)
self.select_current_profile() self.select_current_profile()
def move_down(self): def move_down(self):
row = self.index_selected_row() row = self.index_selected_row()
if row == None: return
self._table.move_down(row) self._table.move_down(row)
self.select_current_profile() self.select_current_profile()

View File

@ -22,7 +22,7 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QWidget" name=""> <widget class="QWidget" name="layoutWidget">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="label_d50"> <widget class="QLabel" name="label_d50">
@ -37,13 +37,13 @@
<locale language="English" country="Europe"/> <locale language="English" country="Europe"/>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>4</number> <number>8</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name=""> <widget class="QWidget" name="layoutWidget">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLabel" name="label_sigma"> <widget class="QLabel" name="label_sigma">