Fixed naming in the host software
This commit is contained in:
parent
e0439791d9
commit
d12ad8fc13
|
@ -35,8 +35,8 @@ struct CheapsdoControl {
|
||||||
average_points: Vec<[f64; 2]>,
|
average_points: Vec<[f64; 2]>,
|
||||||
pwm_points: Vec<[f64; 2]>,
|
pwm_points: Vec<[f64; 2]>,
|
||||||
|
|
||||||
ms1_frequency_id: egui::Id,
|
pll_a_frequency_id: egui::Id,
|
||||||
ms2_frequency_id: egui::Id,
|
pll_b_frequency_id: egui::Id,
|
||||||
|
|
||||||
output_frequency_id: [egui::Id; 3],
|
output_frequency_id: [egui::Id; 3],
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ impl Default for CheapsdoControl {
|
||||||
average_points: Vec::new(),
|
average_points: Vec::new(),
|
||||||
pwm_points: Vec::new(),
|
pwm_points: Vec::new(),
|
||||||
|
|
||||||
ms1_frequency_id: egui::Id::new("ms1_frequency_id"),
|
pll_a_frequency_id: egui::Id::new("pll_a_frequency_id"),
|
||||||
ms2_frequency_id: egui::Id::new("ms2_frequency_id"),
|
pll_b_frequency_id: egui::Id::new("pll_b_frequency_id"),
|
||||||
output_frequency_id: [
|
output_frequency_id: [
|
||||||
egui::Id::new("output_frequency1_id"),
|
egui::Id::new("output_frequency1_id"),
|
||||||
egui::Id::new("output_frequency2_id"),
|
egui::Id::new("output_frequency2_id"),
|
||||||
|
|
|
@ -4,6 +4,7 @@ use eframe::egui::{self};
|
||||||
use crate::serial;
|
use crate::serial;
|
||||||
use crate::widgets;
|
use crate::widgets;
|
||||||
use crate::CheapsdoControl;
|
use crate::CheapsdoControl;
|
||||||
|
use cheapsdo_protocol::PLL;
|
||||||
|
|
||||||
const PLL_MIN_FREQ: u32 = 600_000_000;
|
const PLL_MIN_FREQ: u32 = 600_000_000;
|
||||||
const PLL_MAX_FREQ: u32 = 900_000_000;
|
const PLL_MAX_FREQ: u32 = 900_000_000;
|
||||||
|
@ -19,10 +20,10 @@ impl CheapsdoControl {
|
||||||
egui::Grid::new("output_pll_settings")
|
egui::Grid::new("output_pll_settings")
|
||||||
.spacing([20.0, 5.0])
|
.spacing([20.0, 5.0])
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
ui.label("MS1 Frequency [Hz]");
|
ui.label("PLL A Frequency [Hz]");
|
||||||
widgets::frequency_input(
|
widgets::frequency_input(
|
||||||
self.ms1_frequency_id,
|
self.pll_a_frequency_id,
|
||||||
&mut self.pll_settings.ms1_frequency,
|
&mut self.pll_settings.pll_a_frequency,
|
||||||
PLL_MIN_FREQ,
|
PLL_MIN_FREQ,
|
||||||
PLL_MAX_FREQ,
|
PLL_MAX_FREQ,
|
||||||
&ctx,
|
&ctx,
|
||||||
|
@ -30,10 +31,10 @@ impl CheapsdoControl {
|
||||||
);
|
);
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.label("MS2 Frequency [Hz]");
|
ui.label("PLL B Frequency [Hz]");
|
||||||
widgets::frequency_input(
|
widgets::frequency_input(
|
||||||
self.ms2_frequency_id,
|
self.pll_b_frequency_id,
|
||||||
&mut self.pll_settings.ms2_frequency,
|
&mut self.pll_settings.pll_b_frequency,
|
||||||
PLL_MIN_FREQ,
|
PLL_MIN_FREQ,
|
||||||
PLL_MAX_FREQ,
|
PLL_MAX_FREQ,
|
||||||
&ctx,
|
&ctx,
|
||||||
|
@ -48,11 +49,11 @@ impl CheapsdoControl {
|
||||||
egui::Grid::new(format!("output_clk{}_settings", i + 1))
|
egui::Grid::new(format!("output_clk{}_settings", i + 1))
|
||||||
.spacing([20.0, 5.0])
|
.spacing([20.0, 5.0])
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
ui.label(format!("CLK{} Multisynth", i + 1));
|
ui.label(format!("MS{} PLL", i));
|
||||||
widgets::multisynth_selector(&mut self.pll_settings.outputs[i].source, ui);
|
widgets::pll_selector(&mut self.pll_settings.outputs[i].source, ui);
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.label(format!("CLK{} Frequency [Hz]", i + 1));
|
ui.label(format!("MS{} Frequency [Hz]", i + 1));
|
||||||
widgets::frequency_input(
|
widgets::frequency_input(
|
||||||
self.output_frequency_id[i],
|
self.output_frequency_id[i],
|
||||||
&mut self.pll_settings.outputs[i].frequency,
|
&mut self.pll_settings.outputs[i].frequency,
|
||||||
|
@ -63,7 +64,7 @@ impl CheapsdoControl {
|
||||||
);
|
);
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.label(format!("CLK{} Enable", i + 1));
|
ui.label(format!("MS{} Enable", i + 1));
|
||||||
|
|
||||||
widgets::on_off_toggle(&mut self.pll_settings.outputs[i].enable, ui);
|
widgets::on_off_toggle(&mut self.pll_settings.outputs[i].enable, ui);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use cheapsdo_protocol::Multisynth;
|
use cheapsdo_protocol::PLL;
|
||||||
use eframe::egui::{self, Color32, RichText};
|
use eframe::egui::{self, Color32, RichText};
|
||||||
|
|
||||||
use crate::formatters;
|
use crate::formatters;
|
||||||
|
@ -41,13 +41,10 @@ pub fn frequency_input(
|
||||||
resp
|
resp
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn multisynth_selector(
|
pub fn pll_selector(selected_source: &mut PLL, ui: &mut egui::Ui) -> egui::InnerResponse<()> {
|
||||||
selected_source: &mut Multisynth,
|
|
||||||
ui: &mut egui::Ui,
|
|
||||||
) -> egui::InnerResponse<()> {
|
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.selectable_value(selected_source, Multisynth::MS1, "MS1");
|
ui.selectable_value(selected_source, PLL::A, "PLL A");
|
||||||
ui.selectable_value(selected_source, Multisynth::MS2, "MS2");
|
ui.selectable_value(selected_source, PLL::B, "PLL B");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue