merge stable version #2
|
@ -33,3 +33,19 @@ pub fn coef_of_signal_reduce(Vs: f64, V: f64) -> f64 {
|
||||||
Vs / V
|
Vs / V
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_default_values(model: &ListStore) {
|
||||||
|
for number in (0..=100).step_by(5) {
|
||||||
|
if number == 0 {
|
||||||
|
model.append(&Frequency::new(1.0));
|
||||||
|
} else if (number >= 70 && number % 10 == 0) || (number < 70 && number % 5 == 0) {
|
||||||
|
model.append(&Frequency::new(number as f64));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn find_by_frequency_value(model: &ListStore, new_elem: &Frequency) -> Option<u32> {
|
||||||
|
model.find_with_equal_func(|elem| {
|
||||||
|
elem.downcast_ref::<Frequency>().unwrap().frequency() == new_elem.frequency()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -66,13 +66,7 @@ pub fn signal_reducing_page(wrapper: &Box) {
|
||||||
|
|
||||||
let model_for_events = model.clone();
|
let model_for_events = model.clone();
|
||||||
|
|
||||||
for number in (0..=100).step_by(5) {
|
set_default_values(&model);
|
||||||
if number == 0 {
|
|
||||||
model.append(&Frequency::new(1.0));
|
|
||||||
} else if (number >= 70 && number % 10 == 0) || (number < 70 && number % 5 == 0) {
|
|
||||||
model.append(&Frequency::new(number as f64));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let numeric_sorter = CustomSorter::new(|a, b| {
|
let numeric_sorter = CustomSorter::new(|a, b| {
|
||||||
let a = a.downcast_ref::<Frequency>().unwrap().frequency();
|
let a = a.downcast_ref::<Frequency>().unwrap().frequency();
|
||||||
|
|
Loading…
Reference in New Issue