merge stable version #2
|
@ -1,3 +1,4 @@
|
|||
use gio::glib::Object;
|
||||
use gtk4 as gtk;
|
||||
|
||||
use std::str::FromStr;
|
||||
|
@ -9,7 +10,7 @@ use crate::{
|
|||
};
|
||||
|
||||
use gtk::{
|
||||
prelude::{Cast, CastNone, EditableExt, ListItemExt, ObjectExt, WidgetExt},
|
||||
prelude::{Cast, CastNone, EditableExt, ListItemExt, WidgetExt},
|
||||
ColumnView, Entry, Label, ListItem, SignalListItemFactory,
|
||||
};
|
||||
|
||||
|
@ -47,7 +48,7 @@ pub fn update_column_view(column_view: &ColumnView) {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn column_view_setup_factory(_factory: &SignalListItemFactory, list_item: &ListItem) {
|
||||
pub fn column_view_setup_factory(_factory: &SignalListItemFactory, list_item: &Object) {
|
||||
list_item
|
||||
.downcast_ref::<ListItem>()
|
||||
.expect("Needs to be ListItem")
|
||||
|
@ -56,7 +57,7 @@ pub fn column_view_setup_factory(_factory: &SignalListItemFactory, list_item: &L
|
|||
|
||||
pub fn column_view_bind_factory(
|
||||
_factory: &SignalListItemFactory,
|
||||
list_item: &ListItem,
|
||||
list_item: &Object,
|
||||
values: SignalReduce,
|
||||
label: &str,
|
||||
) {
|
||||
|
@ -74,37 +75,26 @@ pub fn column_view_bind_factory(
|
|||
.and_downcast::<Label>()
|
||||
.expect("The child has to be a `Label`.");
|
||||
|
||||
cell_value
|
||||
.bind_property("frequency", &cell_label, "label")
|
||||
.sync_create()
|
||||
.build();
|
||||
cell_value.set_reactive_resist(reactive_resistance_of_capacitor(
|
||||
values.wire_capacity * 10f64.powi(-12),
|
||||
values.length,
|
||||
cell_value.frequency() * 10f64.powi(6),
|
||||
));
|
||||
|
||||
if cell_value.reactive_resist() == 0.0 {
|
||||
cell_value.set_reactive_resist(reactive_resistance_of_capacitor(
|
||||
values.wire_capacity * 10f64.powi(-12),
|
||||
values.length,
|
||||
cell_value.frequency() * 10f64.powi(6),
|
||||
));
|
||||
}
|
||||
cell_value.set_full_resistance(full_resistance_of_capacitor(
|
||||
cell_value.reactive_resist(),
|
||||
values.source_resistance,
|
||||
values.wire_resistance,
|
||||
values.length,
|
||||
));
|
||||
|
||||
if cell_value.full_resistance() == 0.0 {
|
||||
cell_value.set_full_resistance(full_resistance_of_capacitor(
|
||||
cell_value.set_signal_source_voltage(
|
||||
voltage_from_signal_source(
|
||||
values.source_voltage * 10f64.powi(-3),
|
||||
cell_value.reactive_resist(),
|
||||
values.source_resistance,
|
||||
values.wire_resistance,
|
||||
values.length,
|
||||
));
|
||||
}
|
||||
|
||||
if cell_value.signal_source_voltage() == 0.0 {
|
||||
cell_value.set_signal_source_voltage(
|
||||
voltage_from_signal_source(
|
||||
values.source_voltage * 10f64.powi(-3),
|
||||
cell_value.reactive_resist(),
|
||||
cell_value.full_resistance(),
|
||||
) * 1000.0,
|
||||
);
|
||||
}
|
||||
cell_value.full_resistance(),
|
||||
) * 1000.0,
|
||||
);
|
||||
|
||||
match label {
|
||||
"f, МГц" => {
|
||||
|
|
Loading…
Reference in New Issue