SQL: Fix save study after open.

dev-parouby
Pierre-Antoine 2025-03-26 15:27:42 +01:00
parent 57108455ce
commit 714be64915
3 changed files with 29 additions and 18 deletions

View File

@ -543,7 +543,8 @@ class CreateTableForSaveAs:
np.array(stg.X_exponent).tobytes(),
np.array(stg.alpha_s).tobytes(),
np.array(stg.zeta).tobytes(),
stg.FCB.tobytes(), stg.depth_real.tobytes(),
np.array(stg.FCB).tobytes(),
np.array(stg.depth_real).tobytes(),
np.array(stg.lin_reg).tobytes()
)
)

View File

@ -207,21 +207,29 @@ class UpdateTableForSave:
BS_mean)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(stg.acoustic_data[i], stg.time[i].tobytes(), stg.depth[i].tobytes(), stg.BS_raw_data[i].tobytes(),
stg.time_reshape[i].tobytes(), stg.depth_reshape[i].tobytes(), stg.BS_raw_data_reshape[i].tobytes(),
stg.time_cross_section[i].tobytes(), stg.depth_cross_section[i].tobytes(), stg.BS_cross_section[i].tobytes(),
stg.BS_stream_bed[i].tobytes(),
stg.depth_bottom[i].tobytes(), stg.val_bottom[i].tobytes(), np.array(stg.ind_bottom[i]).tobytes(),
stg.time_noise[i].tobytes(), stg.depth_noise[i].tobytes(),
stg.BS_noise_raw_data[i].tobytes(),
stg.SNR_raw_data[i].tobytes(), stg.SNR_cross_section[i].tobytes(),
stg.SNR_stream_bed[i].tobytes(),
stg.BS_raw_data_pre_process_SNR[i].tobytes(),
stg.BS_raw_data_pre_process_average[i].tobytes(),
stg.BS_cross_section_pre_process_SNR[i].tobytes(),
stg.BS_cross_section_pre_process_average[i].tobytes(),
stg.BS_stream_bed_pre_process_SNR[i].tobytes(),
stg.BS_stream_bed_pre_process_average[i].tobytes(),
stg.BS_mean[i].tobytes()
stg.time_reshape[i].tobytes(),
stg.depth_reshape[i].tobytes(),
stg.BS_raw_data_reshape[i].tobytes(),
stg.time_cross_section[i].tobytes(),
stg.depth_cross_section[i].tobytes(),
stg.BS_cross_section[i].tobytes(),
np.array(stg.BS_stream_bed[i]).tobytes(),
np.array(stg.depth_bottom[i]).tobytes(),
np.array(stg.val_bottom[i]).tobytes(),
np.array(stg.ind_bottom[i]).tobytes(),
np.array(stg.time_noise[i]).tobytes(),
np.array(stg.depth_noise[i]).tobytes(),
np.array(stg.BS_noise_raw_data[i]).tobytes(),
np.array(stg.SNR_raw_data[i]).tobytes(),
np.array(stg.SNR_cross_section[i]).tobytes(),
np.array(stg.SNR_stream_bed[i]).tobytes(),
np.array(stg.BS_raw_data_pre_process_SNR[i]).tobytes(),
np.array(stg.BS_raw_data_pre_process_average[i]).tobytes(),
np.array(stg.BS_cross_section_pre_process_SNR[i]).tobytes(),
np.array(stg.BS_cross_section_pre_process_average[i]).tobytes(),
np.array(stg.BS_stream_bed_pre_process_SNR[i]).tobytes(),
np.array(stg.BS_stream_bed_pre_process_average[i]).tobytes(),
np.array(stg.BS_mean[i]).tobytes()
)
)

View File

@ -469,7 +469,8 @@ class SampleDataTab(QWidget):
self.item_checkbox_fine.setCheckState(Qt.Checked)
self.tableWidget_fine.setItem(i, 1, self.item_checkbox_fine)
self.item_checkbox_fine.setText("F" + str(i + 1))
stg.sample_fine.append(("F" + str(i + 1), i))
if len(stg.sample_fine) <= i:
stg.sample_fine.append(("F" + str(i + 1), i))
# --- Fill table with data ---
for i in range(stg.frac_vol_fine.shape[0]):
@ -562,7 +563,8 @@ class SampleDataTab(QWidget):
self.item_checkbox_sand.setCheckState(Qt.Checked)
self.tableWidget_sand.setItem(i, 1, self.item_checkbox_sand)
self.item_checkbox_sand.setText("S" + str(i + 1))
stg.sample_sand.append(("S" + str(i + 1), i))
if len(stg.sample_sand) <= i:
stg.sample_sand.append(("S" + str(i + 1), i))
# --- Fill table with data ---
for i in range(stg.frac_vol_sand.shape[0]):