why unable to receive convertedvalue from here Apply conversion factors based on the…
- User
why unable to receive converted_value from here
Apply conversion factors based on the selected unit
if selected_unit == "kN": converted_value = data_value * 0.00980665 elif selected_unit == "T": converted_value = data_value * 0.001 elif selected_unit == "US tn": converted_value = data_value * 0.001102317 elif selected_unit == "kg": converted_value = data_value # No conversion needed else: converted_value = data_value # Default case, if no valid unit is foundto pass into here
if converted_value is not None: center_value = int(converted_value) # Convert to integer or float as needed # Set the Y-axis range centered around the extracted_value margin = 10 # Define the margin to add/subtract from the center value self.graphWidget.setYRange(center_value - margin, center_value + margin, padding=0)
- Assistant