Made it to compile without record feature

This commit is contained in:
Anne de Jong 2023-12-29 00:02:37 +01:00
parent b770c4d8fb
commit 21703321bd
3 changed files with 8 additions and 4 deletions

View File

@ -73,6 +73,8 @@ itertools = "0.12.0"
chrono = {version = "0.4.31", optional = true}
# For getting UUIDs in recording
uuid = { version = "1.6.1", features = ["v4"] , optional = true}
# Command line argument parser, for CLI apps
clap = { version = "4.4.11", features = ["derive", "color", "help", "suggestions"] }
[features]

View File

@ -1,8 +1,8 @@
use anyhow::Result;
use anyhow::{bail, Result};
use clap::{arg, command, Parser};
use crossbeam::channel::{unbounded, Receiver, TryRecvError};
#[cfg(feature = "record")]
use lasprs::daq::{StreamType,RecordSettings, RecordStatus, Recording, StreamMgr};
use lasprs::daq::{RecordSettings, RecordStatus, Recording, StreamMgr, StreamType};
use lasprs::Flt;
use std::{
io, thread,
@ -23,6 +23,10 @@ struct Cli {
#[arg(short, long = "config-file")]
config_file_daq: Option<String>,
}
#[cfg(not(feature = "record"))]
fn main() -> Result<()> {
bail!("Record feature not enabled. This executable is not working");
}
#[cfg(feature = "record")]
fn main() -> Result<()> {
@ -44,7 +48,6 @@ fn main() -> Result<()> {
let cfg = DaqConfig::deserialize_TOML_str(&file)?;
smgr.startStream(StreamType::Input, &cfg)?;
}
}
let mut r = Recording::new(settings, &mut smgr)?;

View File

@ -1,7 +1,6 @@
use std::{ops::Index, path::PathBuf};
use anyhow::Result;
use hdf5::File;
use super::api::StreamApiDescr;
use super::datatype::DataType;
use super::deviceinfo::DeviceInfo;