merge stable version #2

Merged
doryan merged 97 commits from experimental into main 2024-08-28 18:54:00 +03:00
2 changed files with 19 additions and 28 deletions
Showing only changes of commit 11ba24d7ed - Show all commits

View File

@ -1,28 +0,0 @@
pub fn parse_fields(all_inputs: Vec<Input>) -> Result<SignalReduce> {
let mut values: [f64; 6] = [0.0; 6];
for (i, input) in all_inputs.iter().enumerate() {
let input_text_buffer: TextBuffer = input.clone().get_input().buffer();
let extracted_value = f64::from_str(
input_text_buffer
.text(
&input_text_buffer.start_iter(),
&input_text_buffer.end_iter(),
false,
)
.as_str()
.trim(),
)?;
values[i] = extracted_value;
}
Ok(SignalReduce {
length: values[0],
wire_resistance: values[1],
wire_capacity: values[2],
source_resistance: values[3],
source_voltage: values[4],
frequency: values[5],
})
}

View File

@ -21,3 +21,22 @@ pub fn get_error_message(error: Error) -> Option<&'static str> {
}
}
pub fn parse_fields(all_inputs: Vec<Input<Entry>>) -> Result<SignalReduce> {
let mut values: [f64; 6] = [0.0; 6];
for (i, input) in all_inputs.iter().enumerate() {
let input_text_buffer = input.get_input();
let extracted_value = f64::from_str(input_text_buffer.text().as_str().trim())?;
values[i] = extracted_value;
}
Ok(SignalReduce {
length: values[0],
wire_resistance: values[1],
wire_capacity: values[2],
source_resistance: values[3],
source_voltage: values[4],
frequency: values[5],
})
}