From faedb8827d3cfc6f1f59b4b29da6c3556ffc5760 Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 14 Aug 2020 19:14:01 -0700 Subject: misc changes and improvements --- src/main.rs | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 4b54a3a..ce1c19e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ use crossbeam_channel::{Sender, Receiver}; use crossbeam_channel::unbounded; use std::time::Duration; +use std::time::Instant; use crate::asicam::ASICamera2::{ControlType, ImageType}; use crate::asicam::Camera; @@ -60,8 +61,8 @@ fn record_image(data: &[u8], dimensions: Dimensions, target: &'static str, image println!(".. writing raw"); let raw_path = format!("{}_{}.raw", target, image_id); let raw_dest = Path::new(&raw_path); - let mut file = File::create(raw_dest).unwrap(); - file.write(data); +// let mut file = File::create(raw_dest).unwrap(); +// file.write(data); } fn main() { @@ -99,7 +100,7 @@ fn main() { } }); - operate_qhy("ngc7635", None, free_frames, image_writer); + operate_qhy("settings", None, free_frames, image_writer); // println!("Doing asi..."); // operate_asi(test); } @@ -130,7 +131,7 @@ struct Properties { impl Properties { pub fn stringy(&self) -> String { - format!("{{\n device: \"{}\",\n exposure_ms: {}\n, gain: {}\n offset: {}\n gamma: {}\n temp: {}\n}}", + format!("{{\n \"device\": \"{}\",\n \"exposure_ms\": {},\n \"gain\": {},\n \"offset\": {},\n \"gamma\": {},\n \"temp\": {}\n}}", self.device, self.exposure_ms, self.gain, @@ -161,22 +162,51 @@ fn operate_qhy(target: &'static str, count: Option, free_frames: Receiver LAPSE_PERIOD { + println!("Lapsing!!"); + camera_tx.send(QHYMessage::BeginCapture(Some(1))).unwrap(); + capture_start = Instant::now(); + } + */ select! { recv(free_frames) -> msg => { match msg { @@ -205,7 +235,7 @@ fn operate_qhy(target: &'static str, count: Option, free_frames: Receiver { - image_writer.send(ImageInfo { data, dimensions, target, image_id, properties}).unwrap(); + image_writer.send(ImageInfo { data, dimensions, target, image_id: image_id, properties}).unwrap(); // images.log(target, image_id, settings_copy); image_id += 1; if Some(image_id) == count { -- cgit v1.1