50 lines
1014 B
Rust
50 lines
1014 B
Rust
use std::cell::Cell;
|
|
|
|
use crate::gtk;
|
|
|
|
use gtk::{
|
|
glib::{self, Properties},
|
|
prelude::*,
|
|
subclass::prelude::*,
|
|
};
|
|
|
|
#[repr(usize)]
|
|
#[derive(Clone)]
|
|
pub enum HammingMode {
|
|
Encrypt = 4,
|
|
Decrypt = 7,
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(Default, Copy, Clone, Debug)]
|
|
pub struct SignalReduce {
|
|
pub length: f64,
|
|
pub wire_resistance: f64,
|
|
pub wire_capacity: f64,
|
|
pub source_voltage: f64,
|
|
pub source_resistance: f64,
|
|
pub frequency: f64,
|
|
}
|
|
|
|
#[derive(Properties, Default)]
|
|
#[properties(wrapper_type = super::Frequency)]
|
|
pub struct Frequency {
|
|
#[property(get, set)]
|
|
frequency: Cell<f64>,
|
|
#[property(get, set)]
|
|
reactive_resist: Cell<f64>,
|
|
#[property(get, set)]
|
|
full_resistance: Cell<f64>,
|
|
#[property(get, set)]
|
|
signal_source_voltage: Cell<f64>,
|
|
}
|
|
|
|
#[glib::derived_properties]
|
|
impl ObjectImpl for Frequency {}
|
|
|
|
#[glib::object_subclass]
|
|
impl ObjectSubclass for Frequency {
|
|
const NAME: &'static str = "FrequencyValue";
|
|
type Type = super::Frequency;
|
|
}
|