diff --git a/src/main.rs b/src/main.rs index 5fd0ed8..08715cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -224,7 +224,11 @@ fn get_smeter(comport: &str, rig_name: &str, frequency: u32) -> i32 { let value = &data[2..5]; let value_i = value.parse::().unwrap(); // return format!("{}", value); + if rig_name == "qmx" { + return (value_i as f32 / 6.0) as i32; + } else { return value_i; + } // return; } Err(_) => {} // lol that I can just not put a return in? @@ -331,8 +335,6 @@ fn main() { println!("Press Ctrl + C to quit"); - // Simple test loop to make sure we are getting values each time - //for _i in 1..11 { loop { // Get location let ll = get_loc(gps.clone()); @@ -340,23 +342,14 @@ fn main() { let date = Local::now(); // Get S-meter let s_val = get_smeter(&com, &rig, frequency); - //println!("{a}"); + // Print measurements and simple graph println!( - "{} {:#03} {}", - date.format("%Y-%m-%d %H:%M:%S").to_string(), - s_val, - "#".repeat(s_val.try_into().unwrap()) - ); - // match s_val { - // // Simple graph as we go. Eventually this will be replaced. - // Ok(n) => println!( - // "{} {} {}", - // date.format("%Y-%m-%d %H:%M:%S").to_string(), - // s_val, - // "#".repeat(n.try_into().unwrap()) - // ), - // Err(_e) => todo!(), - // } + "{} {:#03} {}", + date.format("%Y-%m-%d %H:%M:%S").to_string(), + s_val, + "#".repeat(s_val.try_into().unwrap()) + ); + // If they provided a file name if file_out != "no file" { if let Err(err) = write_row(