refactor: 将 PointValueChange 重命名为 PointNewValue
This commit is contained in:
parent
cc7142e556
commit
8127d04855
|
|
@ -261,7 +261,7 @@ impl ConnectionManager {
|
||||||
.map(crate::telemetry::PointQuality::from_status_code)
|
.map(crate::telemetry::PointQuality::from_status_code)
|
||||||
.unwrap_or(crate::telemetry::PointQuality::Unknown);
|
.unwrap_or(crate::telemetry::PointQuality::Unknown);
|
||||||
|
|
||||||
let _ = event_manager.send(crate::event::ReloadEvent::PointValueChange(
|
let _ = event_manager.send(crate::event::ReloadEvent::PointNewValue(
|
||||||
crate::telemetry::PointNewValue {
|
crate::telemetry::PointNewValue {
|
||||||
source_id,
|
source_id,
|
||||||
point_id: Some(point_id),
|
point_id: Some(point_id),
|
||||||
|
|
@ -758,7 +758,7 @@ impl ConnectionManager {
|
||||||
// Emit local updates only when the full batch succeeds.
|
// Emit local updates only when the full batch succeeds.
|
||||||
if let Some(event_manager) = &self.event_manager {
|
if let Some(event_manager) = &self.event_manager {
|
||||||
for (source_id, point_id, variant) in success_events {
|
for (source_id, point_id, variant) in success_events {
|
||||||
if let Err(e) = event_manager.send(crate::event::ReloadEvent::PointValueChange(
|
if let Err(e) = event_manager.send(crate::event::ReloadEvent::PointNewValue(
|
||||||
crate::telemetry::PointNewValue {
|
crate::telemetry::PointNewValue {
|
||||||
source_id,
|
source_id,
|
||||||
point_id: Some(point_id),
|
point_id: Some(point_id),
|
||||||
|
|
@ -883,7 +883,7 @@ impl ConnectionManager {
|
||||||
.unwrap_or(crate::telemetry::PointQuality::Unknown);
|
.unwrap_or(crate::telemetry::PointQuality::Unknown);
|
||||||
|
|
||||||
if let Some(event_manager) = &manager.event_manager {
|
if let Some(event_manager) = &manager.event_manager {
|
||||||
let _ = event_manager.send(crate::event::ReloadEvent::PointValueChange(
|
let _ = event_manager.send(crate::event::ReloadEvent::PointNewValue(
|
||||||
crate::telemetry::PointNewValue {
|
crate::telemetry::PointNewValue {
|
||||||
source_id: current_source_id,
|
source_id: current_source_id,
|
||||||
point_id: None,
|
point_id: None,
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ pub enum ReloadEvent {
|
||||||
source_id: Uuid,
|
source_id: Uuid,
|
||||||
point_ids: Vec<Uuid>,
|
point_ids: Vec<Uuid>,
|
||||||
},
|
},
|
||||||
PointValueChange(crate::telemetry::PointNewValue),
|
PointNewValue(crate::telemetry::PointNewValue),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct EventManager {
|
pub struct EventManager {
|
||||||
|
|
@ -118,7 +118,7 @@ impl EventManager {
|
||||||
tracing::error!("Failed to unsubscribe points: {}", e);
|
tracing::error!("Failed to unsubscribe points: {}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ReloadEvent::PointValueChange(payload) => {
|
ReloadEvent::PointNewValue(payload) => {
|
||||||
let source_id = payload.source_id;
|
let source_id = payload.source_id;
|
||||||
let client_handle = payload.client_handle;
|
let client_handle = payload.client_handle;
|
||||||
let point_id = if let Some(point_id) = payload.point_id {
|
let point_id = if let Some(point_id) = payload.point_id {
|
||||||
|
|
@ -149,7 +149,7 @@ impl EventManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(ws_manager) = &ws_manager_clone {
|
if let Some(ws_manager) = &ws_manager_clone {
|
||||||
let ws_message = crate::websocket::WsMessage::PointValueChange(
|
let ws_message = crate::websocket::WsMessage::PointNewValue(
|
||||||
monitor.clone(),
|
monitor.clone(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use uuid::Uuid;
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
#[serde(tag = "type", content = "data")]
|
#[serde(tag = "type", content = "data")]
|
||||||
pub enum WsMessage {
|
pub enum WsMessage {
|
||||||
PointValueChange(crate::telemetry::PointMonitorInfo),
|
PointNewValue(crate::telemetry::PointMonitorInfo),
|
||||||
PointSetValueBatchResult(crate::connection::BatchSetPointValueRes),
|
PointSetValueBatchResult(crate::connection::BatchSetPointValueRes),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue