🐛 fix(data_processing.py): fix variable name for R_max from "Z (en mm)" to "rayon (en mm)"
🐛 fix(data_processing.py): fix formula for R_V_scan to include parentheses for correct order of operations 🐛 fix(output.py): add delta_z parameter to generate_headers function to correctly display the delta_z value in the output file ✨ feat(output.py): add delta_z value to output file headers if add_headers setting is enabled ✨ feat(MainWindow.py): add delta_z value to output file headers if add_headers setting is enabled ✨ feat(DiscreteDataWorker.py): add delta_z value to output file headers if add_headers setting is enabled ✨ feat(RawDataWorker.py): add delta_z value to output file headers if add_headers setting is enabled The changes in data_processing.py fix a variable name and a formula to correctly calculate the R_max and R_V_scan values.
This commit is contained in:
		
							parent
							
								
									1f35730fbd
								
							
						
					
					
						commit
						1c1a9bac94
					
				| @ -156,7 +156,8 @@ def get_advanced_data(discrete_data:dict, raw_data:dict, V_scan = 0, update_prog | ||||
|                         discrete_data["Y moy (en mm)"], | ||||
|                         discrete_data["Z moy (en mm)"])) | ||||
|     for index in range(len(vertices)-1): | ||||
|         l += de.get_distance_between_two_vertices(vertices[index], vertices[index+1]) | ||||
|         dist = de.get_distance_between_two_vertices(vertices[index], vertices[index+1]) | ||||
|         l += dist | ||||
|     l += discrete_data["Discretisation(en mm)"][-1] /2 + discrete_data["Discretisation(en mm)"][0] /2 | ||||
|     L = de.get_distance_between_two_vertices(vertices[0], vertices[-1]) + discrete_data["Discretisation(en mm)"][-1] /2 + discrete_data["Discretisation(en mm)"][0] /2 | ||||
|     T = l/L | ||||
| @ -179,12 +180,12 @@ def get_advanced_data(discrete_data:dict, raw_data:dict, V_scan = 0, update_prog | ||||
|     MI_l = R_mean_std/R_mean | ||||
|     MI_p = np.sqrt(mean_sigma_r_squared)/R_mean | ||||
| 
 | ||||
|     R_max = max(raw_data["Z (en mm)"]) | ||||
|     R_max = max(raw_data["rayon (en mm)"]) | ||||
|     R_in = 40 | ||||
|     MI_mR = R_max/R_mean | ||||
|     MI_mH = R_max/H | ||||
|     MI_mr_in = R_max/R_in | ||||
|     R_V_scan = np.sqrt(V_scan/np.pi*H) | ||||
|     R_V_scan = np.sqrt(V_scan/(np.pi*H)) | ||||
|     S_V_scan = 2 * np.sqrt(np.pi * H * V_scan) | ||||
|     R_h = R2_mean/ R_mean | ||||
|     HI = R_mean * R_V_scan / R2_mean | ||||
|  | ||||
| @ -8,7 +8,7 @@ Created on Mon Apr 17 2023 | ||||
| import datetime | ||||
| from utils.settings.SettingManager import SettingManager | ||||
| 
 | ||||
| def generate_headers(filename:str): | ||||
| def generate_headers(filename:str,delta_z:float) -> str: | ||||
|     """ | ||||
|     """ | ||||
|     headers = f"""############################## | ||||
| @ -18,6 +18,7 @@ version :{SettingManager.get_instance().get_setting("version")} | ||||
| filename : {filename} | ||||
| date : {datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")} | ||||
| discretisation : {SettingManager.get_instance().get_setting("discretisation_method")} | ||||
| delta_z : {delta_z} | ||||
| had been veticalised : {"yes" if SettingManager.get_instance().get_setting("should_verticalise") else "no"} | ||||
| ############################## | ||||
| """ | ||||
|  | ||||
| @ -10,7 +10,7 @@ from PyQt5 import QtWidgets | ||||
| from PyQt5.QtCore import QThread | ||||
| from PyQt5.QtWidgets import QFileDialog, QWidget | ||||
| from utils.files.input import ScannedObject | ||||
| from utils.files.output import format_data, save_output_file | ||||
| from utils.files.output import format_data, generate_headers, save_output_file | ||||
| from utils.gui.pyqt.main_window.Workers.AdvancedDataWorker import AdvancedDataWorker | ||||
| from utils.gui.pyqt.settings.Settings import Settings | ||||
| from utils.gui.pyqt.about.AboutThis import AboutThis | ||||
| @ -329,7 +329,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): | ||||
|         """ | ||||
|         Start the analyse, create the thread and connect the signals. | ||||
|         """ | ||||
|         self.process_advanced_data(self.discrete_data, True) | ||||
|         self.process_advanced_data(self.discrete_data,self.raw_data, True) | ||||
| 
 | ||||
|     def set_obj(self,obj:ScannedObject): | ||||
|         """ | ||||
| @ -391,7 +391,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): | ||||
|         if file_path[0] == "": | ||||
|             return | ||||
|         advanced_data = {key : [round(value,6),] for key,value in self.advanced_data.items()} | ||||
|         string_data = format_data(advanced_data,SettingManager.get_instance().get_setting("output_file_separator")) | ||||
|         string_data = "" | ||||
|         if SettingManager.get_instance().get_setting("add_headers"): | ||||
|             string_data += generate_headers(os.path.basename(self.input_file_path.toPlainText()),self.discretisation_value_selector.value()) | ||||
|         string_data += format_data(advanced_data,SettingManager.get_instance().get_setting("output_file_separator")) | ||||
|         save_output_file(file_path[0],string_data) | ||||
| 
 | ||||
|     def save_model(self): | ||||
|  | ||||
| @ -66,7 +66,7 @@ class DiscreteDataProcessWorker(Worker): | ||||
|         output = "" | ||||
|         add_headers = SettingManager.get_instance().get_setting("add_headers") | ||||
|         if add_headers: | ||||
|             output += generate_headers(self.obj.filename) | ||||
|             output += generate_headers(self.obj.filename,self.delta_z) | ||||
|         output += format_data(discrete_data, | ||||
|                             separator, | ||||
|                             ["X moy (en mm)", | ||||
|  | ||||
| @ -61,7 +61,7 @@ class RawDataProcessWorker(Worker): | ||||
|         output = "" | ||||
|         add_headers = SettingManager.get_instance().get_setting("add_headers") | ||||
|         if add_headers: | ||||
|             output += generate_headers(self.obj.filename) | ||||
|             output += generate_headers(self.obj.filename,self.delta_z) | ||||
|         output += format_data(raw_data, | ||||
|                             separator, | ||||
|                             ["X (en mm)", | ||||
|  | ||||
| @ -751,7 +751,7 @@ qt_resource_struct_v2 = b"\ | ||||
| \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ | ||||
| \x00\x00\x00\x00\x00\x00\x00\x00\ | ||||
| \x00\x00\x00\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ | ||||
| \x00\x00\x01\x87\xdc\x71\xcf\xb8\ | ||||
| \x00\x00\x01\x88\x43\x2d\x8b\x15\ | ||||
| " | ||||
| 
 | ||||
| qt_version = [int(v) for v in QtCore.qVersion().split('.')] | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user