From ae6cd3aa774e0864fb96548d8e931840d41d64c6 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Wed, 11 Sep 2019 22:10:49 -0400 Subject: Refactoring. Lots of it. --- src/app/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/app') diff --git a/src/app/mod.rs b/src/app/mod.rs index c07b3884..bf2d3afd 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -11,6 +11,7 @@ pub struct App<'a> { pub process_sorting_type : processes::ProcessSorting, pub process_sorting_reverse : bool, pub to_be_resorted : bool, + pub current_selected_process_position : u64, } fn set_if_valid(result : &Result, value_to_set : &mut T) { @@ -32,7 +33,7 @@ pub struct Data { pub list_of_physical_io : Vec, pub memory : Vec, pub swap : Vec, - pub list_of_temperature : Vec, + pub list_of_temperature_sensor : Vec, pub network : Vec, pub list_of_processes : Vec, // Only need to keep a list of processes... pub list_of_disks : Vec, // Only need to keep a list of disks and their data @@ -90,7 +91,7 @@ impl DataState { set_if_valid(&disks::get_disk_usage_list().await, &mut self.data.list_of_disks); push_if_valid(&disks::get_io_usage_list(false).await, &mut self.data.list_of_io); push_if_valid(&disks::get_io_usage_list(true).await, &mut self.data.list_of_physical_io); - set_if_valid(&temperature::get_temperature_data().await, &mut self.data.list_of_temperature); + set_if_valid(&temperature::get_temperature_data().await, &mut self.data.list_of_temperature_sensor); // Filter out stale timed entries // TODO: ideally make this a generic function! @@ -155,6 +156,7 @@ impl<'a> App<'a> { should_quit : false, process_sorting_reverse : true, to_be_resorted : false, + current_selected_process_position : 0, } } -- cgit v1.2.3