Permit toggling well volume display
This commit is contained in:
parent
844bd14b4f
commit
c28ec328f9
|
|
@ -5,6 +5,7 @@ use plate_tool_lib::transfer_region::Region;
|
||||||
use plate_tool_lib::uuid::Uuid;
|
use plate_tool_lib::uuid::Uuid;
|
||||||
use plate_tool_lib::Well;
|
use plate_tool_lib::Well;
|
||||||
|
|
||||||
|
use crate::main_state;
|
||||||
use crate::transfer_menu::CurrentTransferState;
|
use crate::transfer_menu::CurrentTransferState;
|
||||||
|
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
|
|
@ -56,6 +57,7 @@ impl WellInfo {
|
||||||
#[derive(Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
|
#[derive(Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
|
||||||
pub struct PlateDisplayOptions {
|
pub struct PlateDisplayOptions {
|
||||||
pub show_transfer_hashes: bool,
|
pub show_transfer_hashes: bool,
|
||||||
|
pub show_well_volumes: bool,
|
||||||
pub show_volume_heatmap: bool,
|
pub show_volume_heatmap: bool,
|
||||||
pub show_coordinates: bool,
|
pub show_coordinates: bool,
|
||||||
}
|
}
|
||||||
|
|
@ -63,6 +65,7 @@ impl Default for PlateDisplayOptions {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
show_transfer_hashes: true,
|
show_transfer_hashes: true,
|
||||||
|
show_well_volumes: true,
|
||||||
show_volume_heatmap: false,
|
show_volume_heatmap: false,
|
||||||
show_coordinates: true,
|
show_coordinates: true,
|
||||||
}
|
}
|
||||||
|
|
@ -422,6 +425,7 @@ fn add_plate_sub(
|
||||||
|
|
||||||
// Draw volume text
|
// Draw volume text
|
||||||
|
|
||||||
|
if display_options.show_well_volumes {
|
||||||
if let Some(well_info) =
|
if let Some(well_info) =
|
||||||
well_infos[(c_row - 1) as usize * columns as usize + (c_column - 1) as usize]
|
well_infos[(c_row - 1) as usize * columns as usize + (c_column - 1) as usize]
|
||||||
{
|
{
|
||||||
|
|
@ -433,6 +437,7 @@ fn add_plate_sub(
|
||||||
egui::Color32::BLACK,
|
egui::Color32::BLACK,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw stroke on top
|
// Draw stroke on top
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,10 @@ fn render_export_menu(
|
||||||
};
|
};
|
||||||
if let Ok(data) = data {
|
if let Ok(data) = data {
|
||||||
let bytes: &[u8] = data.as_bytes();
|
let bytes: &[u8] = data.as_bytes();
|
||||||
log::info!("There are {} bytes to be written to chosen file", bytes.len());
|
log::info!(
|
||||||
|
"There are {} bytes to be written to chosen file",
|
||||||
|
bytes.len()
|
||||||
|
);
|
||||||
save_file(bytes, Some("transfers.csv"));
|
save_file(bytes, Some("transfers.csv"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +161,7 @@ fn render_import_menu(
|
||||||
Ok(new_main_state) => {
|
Ok(new_main_state) => {
|
||||||
log::info!("Loaded new main state from file.");
|
log::info!("Loaded new main state from file.");
|
||||||
*main_state = new_main_state
|
*main_state = new_main_state
|
||||||
},
|
}
|
||||||
Err(e) => log::error!("Failed loading imported state JSON: {}", e),
|
Err(e) => log::error!("Failed loading imported state JSON: {}", e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -176,7 +179,9 @@ fn render_import_menu(
|
||||||
if let Ok(data) = String::from_utf8(data.to_vec()) {
|
if let Ok(data) = String::from_utf8(data.to_vec()) {
|
||||||
let auto_output = plate_tool_lib::csv::read_csv_auto(&data);
|
let auto_output = plate_tool_lib::csv::read_csv_auto(&data);
|
||||||
main_state.source_plates.extend(auto_output.sources);
|
main_state.source_plates.extend(auto_output.sources);
|
||||||
main_state.destination_plates.extend(auto_output.destinations);
|
main_state
|
||||||
|
.destination_plates
|
||||||
|
.extend(auto_output.destinations);
|
||||||
main_state.transfers.extend(auto_output.transfers);
|
main_state.transfers.extend(auto_output.transfers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -197,6 +202,10 @@ fn render_options_menu(
|
||||||
&mut main_window_state.plate_display_options.show_transfer_hashes,
|
&mut main_window_state.plate_display_options.show_transfer_hashes,
|
||||||
"Toggle transfer hashes",
|
"Toggle transfer hashes",
|
||||||
);
|
);
|
||||||
|
ui.toggle_value(
|
||||||
|
&mut main_window_state.plate_display_options.show_well_volumes,
|
||||||
|
"Show volumes in wells",
|
||||||
|
);
|
||||||
ui.toggle_value(
|
ui.toggle_value(
|
||||||
&mut main_window_state.plate_display_options.show_volume_heatmap,
|
&mut main_window_state.plate_display_options.show_volume_heatmap,
|
||||||
"Toggle volume heatmap",
|
"Toggle volume heatmap",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue