fix compile error
This commit is contained in:
parent
d2ca715eeb
commit
62d6f38bc5
@ -10,9 +10,10 @@ pub use opencv::OpenCVCamera;
|
||||
use anyhow::Result;
|
||||
use chrono::DateTime;
|
||||
use chrono::Utc;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Camera resolution options
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq,Serialize,Deserialize)]
|
||||
pub enum Resolution {
|
||||
/// 1920x1080 (1080p)
|
||||
HD1080p,
|
||||
@ -40,7 +41,7 @@ impl Resolution {
|
||||
}
|
||||
|
||||
/// Camera exposure mode
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq,Serialize,Deserialize)]
|
||||
pub enum ExposureMode {
|
||||
/// Automatic exposure control
|
||||
Auto,
|
||||
|
||||
11
src/main.rs
11
src/main.rs
@ -13,7 +13,7 @@ mod monitoring;
|
||||
use anyhow::{Context, Result};
|
||||
use log::{info, error};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use std::sync::{Arc,Mutex as StdMutex};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
pub use config::Config;
|
||||
@ -63,8 +63,8 @@ async fn main() -> Result<()> {
|
||||
|
||||
overlay::watermark::Watermark::new(
|
||||
config.watermark.clone(),
|
||||
Arc::new(Mutex::new(env_data)),
|
||||
Arc::new(Mutex::new(gps_status)),
|
||||
Arc::new(StdMutex::new(env_data)),
|
||||
Arc::new(StdMutex::new(gps_status)),
|
||||
)
|
||||
};
|
||||
let watermark = Arc::new(Mutex::new(watermark));
|
||||
@ -80,8 +80,9 @@ async fn main() -> Result<()> {
|
||||
// Initialize detection pipeline
|
||||
let detection_pipeline = detection::DetectionPipeline::new(
|
||||
camera_controller.clone(),
|
||||
&config
|
||||
).await.context("Failed to initialize detection pipeline")?;
|
||||
&config,
|
||||
config.detection.pipeline
|
||||
).context("Failed to initialize detection pipeline")?;
|
||||
|
||||
// Initialize storage system
|
||||
let storage_manager = storage::StorageManager::new(&config)
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
mod watermark;
|
||||
pub(crate) mod watermark;
|
||||
|
||||
pub use watermark::{WatermarkOptions, WatermarkPosition, Watermark, WatermarkContent};
|
||||
|
||||
@ -344,7 +344,7 @@ impl SensorController {
|
||||
camera_sensor.update_brightness(brightness);
|
||||
|
||||
// Update the current data
|
||||
let mut data = self.current_data.lock().unwrap();
|
||||
let mut data = self.current_data.lock()?;
|
||||
data.sky_brightness = brightness;
|
||||
data.timestamp = Utc::now();
|
||||
|
||||
@ -376,8 +376,4 @@ impl LightSensor for Box<dyn LightSensor> {
|
||||
}
|
||||
}
|
||||
|
||||
impl LightSensorExt for Box<dyn LightSensor> {
|
||||
fn as_any(&self) -> &dyn std::any::Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use chrono::Utc;
|
||||
use log::{debug, error, info, warn};
|
||||
use opencv::{core, imgproc, prelude::*};
|
||||
use opencv::{prelude::*};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::process::{Child, Command, Stdio};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user