提交 2d08b111 authored 作者: Serhij S's avatar Serhij S

rvideo feature

上级 6856dd47
[package]
name = "roboplc"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Serhij S. <div@altertech.com>"]
license = "Apache-2.0"
......@@ -27,7 +27,7 @@ oneshot = { version = "0.1.6", default-features = false, features = ["std"] }
pin-project = "1.1.5"
rmodbus = { version = "0.9.4", optional = true }
roboplc-derive = { version = "0.3" }
serde = { version = "1.0.197", features = ["derive", "rc"] }
serde = { version = "1.0", features = ["derive", "rc"] }
serial = "0.4.0"
sysinfo = "0.29"
thiserror = "1.0.57"
......@@ -45,14 +45,16 @@ metrics = { version = "0.22.3", optional = true }
parking_lot_rt = "0.12.1"
snmp = { version = "0.2.2", optional = true }
rtsc = "0.1.6"
rvideo = { version = "0.4", optional = true }
[features]
eapi = ["eva-common", "eva-sdk", "busrt", "tokio", "hostname"]
pipe = ["tokio/process", "tokio/io-util", "tokio/macros", "tokio/rt", "tokio/time"]
rvideo = ["dep:rvideo"]
modbus = ["rmodbus"]
openssl-vendored = ["busrt/openssl-vendored", "eva-common/openssl-vendored"]
metrics = ["dep:metrics", "metrics-exporter-prometheus"]
full = ["eapi", "modbus", "metrics", "pipe"]
full = ["eapi", "modbus", "metrics", "pipe", "rvideo"]
#default = ["modbus"]
[dev-dependencies]
......
......@@ -44,7 +44,6 @@ struct Variables {
input: Input,
}
#[allow(clippy::struct_field_names)]
#[derive(WorkerOpts)]
struct Worker1 {
// Modbus server context and controller variables/data hub are not synchronized automatically,
......
......@@ -533,7 +533,7 @@ dependencies = [
[[package]]
name = "roboplc-cli"
version = "0.1.20"
version = "0.1.21"
dependencies = [
"ansi_term",
"clap",
......
......@@ -158,7 +158,6 @@ pub type ActionResult = std::result::Result<(), Box<dyn std::error::Error>>;
type ActionHandlers<D, V> = Arc<BTreeMap<OID, ActionHandlerFn<D, V>>>;
type BulkActionHandlers<D, V> = Arc<Vec<(OIDMask, ActionHandlerFn<D, V>)>>;
#[allow(clippy::struct_field_names)]
struct Handlers<D, V>
where
D: DataDeliveryPolicy + Clone + Send + Sync + 'static,
......@@ -185,7 +184,8 @@ where
macro_rules! notify_running {
() => {
if let Ok(payload) = pack(&action.event_running()) {
let _ = tx.try_send(PushPayload::ActionState { topic, payload });
tx.try_send(PushPayload::ActionState { topic, payload })
.ok();
}
};
}
......@@ -476,7 +476,7 @@ where
self.inner
.tx
.try_send(PushPayload::DObj {
name: name.clone(),
name,
data: data.into_inner(),
})
.map_err(Into::into)
......
......@@ -9,11 +9,13 @@ use std::io::Cursor;
use crate::comm::{Client, Protocol};
use crate::{Error, Result};
use binrw::{BinRead, BinWrite};
#[allow(clippy::module_name_repetitions)]
#[allow(clippy::module_name_repetitions, clippy::useless_attribute)]
pub use regs::{Kind as ModbusRegisterKind, Register as ModbusRegister};
use rmodbus::guess_response_frame_len;
use rmodbus::{client::ModbusRequest as RModbusRequest, ModbusProto};
#[allow(clippy::module_name_repetitions)]
#[allow(clippy::module_name_repetitions, clippy::useless_attribute)]
pub use server::{
AllowFn as ModbusServerAllowFn, ModbusServer, ModbusServerMapping,
WritePermission as ModbusServerWritePermission,
......
......@@ -27,6 +27,7 @@ enum Server {
Serial(SystemPort),
}
#[allow(clippy::trivially_copy_pass_by_ref)]
fn handle_client<
T: Read + Write,
const C: usize,
......
......@@ -204,6 +204,14 @@ pub fn suicide(delay: Duration, warn: bool) {
};
}
#[cfg(feature = "rvideo")]
pub use rvideo;
#[cfg(feature = "rvideo")]
pub fn serve_rvideo() -> std::result::Result<(), rvideo::Error> {
rvideo::serve("0.0.0.0:3001").map_err(Into::into)
}
/// Returns [Prometheus metrics exporter
/// builder](https://docs.rs/metrics-exporter-prometheus/)
///
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论