summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-03-15 19:09:40 -0700
committeriximeow <me@iximeow.net>2019-03-15 19:09:40 -0700
commitebed5f55375c2e42a2bcdcf7abd10c46882a1c85 (patch)
tree1f930ccde1ebadf8dc13e8c17ddd373bff887757 /src
parent1e720ec89ac03c5ed8534461c2f5340ac4dafa7d (diff)
parentbf0d3d4dce2127e714e0115214f468ed8b3614ec (diff)
Merge branch 'master' of 192.168.1.6:/toy/c/asi/calibration_collector
Diffstat (limited to 'src')
-rw-r--r--src/main.rs11
-rw-r--r--src/qhyccd/QHYCCDCam.rs1
-rw-r--r--src/qhyccd/mod.rs1
3 files changed, 9 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index eeb816d..368a7d4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -11,14 +11,17 @@ use crate::asicam::ASICamera2::{ControlType, ImageType};
use crate::asicam::Camera;
fn main() {
+ println!("Doing qhy...");
operate_qhy();
+ println!("Doing asi...");
+ operate_asi();
}
fn operate_qhy() {
use crate::qhyccd::Control;
println!("Operating on qhy camera ... or i'll die trying");
let mut camera = qhyccd::acquire(0).unwrap();
- camera.set_exposure_ms(4500).unwrap();
+ camera.set_exposure_ms(2500).unwrap();
camera.set_param(Control::Gain, 100.0).unwrap();
camera.set_param(Control::Offset, 000.0).unwrap();
camera.set_param(Control::USBTraffic, 50.0).unwrap();
@@ -55,9 +58,9 @@ fn operate_asi() {
let mut camera = asicam::acquire(0).unwrap();
println!("{:?}", camera);
- camera.set_control_value(ControlType::TargetTemp, -100).unwrap();
- camera.set_control_value(ControlType::CoolerOn, 1).unwrap();
- std::thread::sleep(std::time::Duration::from_millis(500));
+// camera.set_control_value(ControlType::TargetTemp, -100).unwrap();
+// camera.set_control_value(ControlType::CoolerOn, 1).unwrap();
+// std::thread::sleep(std::time::Duration::from_millis(500));
println!("Camera temperature is currently {:?}", camera.get_control_value(ControlType::Temperature).unwrap());
/*
diff --git a/src/qhyccd/QHYCCDCam.rs b/src/qhyccd/QHYCCDCam.rs
index 9988791..8419bb7 100644
--- a/src/qhyccd/QHYCCDCam.rs
+++ b/src/qhyccd/QHYCCDCam.rs
@@ -116,6 +116,7 @@ extern "C" {
imagew: *mut os::raw::c_int, imageh: *mut os::raw::c_int,
pixelw: *mut os::raw::c_double, pixelh: *mut os::raw::c_double,
bpp: *mut os::raw::c_int) -> os::raw::c_int;
+ pub fn CancelQHYCCDExposingAndReadout(handle: *mut os::raw::c_void) -> os::raw::c_int;
pub fn ControlQHYCCDTemp(handle: *mut os::raw::c_void, target: os::raw::c_double) -> os::raw::c_int;
pub fn SetQHYCCDDebayerOnOff(handle: *mut os::raw::c_void, onoff: os::raw::c_int) -> os::raw::c_int;
pub fn SetQHYCCDBinMode(handle: *mut os::raw::c_void, wbin: os::raw::c_int, hbin: os::raw::c_int) -> os::raw::c_int;
diff --git a/src/qhyccd/mod.rs b/src/qhyccd/mod.rs
index 4404ddb..a7fb784 100644
--- a/src/qhyccd/mod.rs
+++ b/src/qhyccd/mod.rs
@@ -64,6 +64,7 @@ pub fn acquire(camera_idx: i32) -> Result<Camera> {
}
check(QHYCCDCam::SetQHYCCDStreamMode(handle, 0))?; // 0 means single frame mode...
check(QHYCCDCam::InitQHYCCD(handle))?;
+ check(QHYCCDCam::CancelQHYCCDExposingAndReadout(handle))?;
Ok(Camera {
handle: handle
})