-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_messages.rs
More file actions
63 lines (57 loc) · 1.81 KB
/
run_messages.rs
File metadata and controls
63 lines (57 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use crate::{
integrated::simulation_elements::{noise::NoiseSource, utils::TextConstant},
runs::{
alarm::SeverityLevel,
runlog::ValueType,
sample_environment::{LocationType, ValuesType},
},
};
use chrono::{DateTime, Utc};
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "run-command")]
pub(crate) struct SendRunStart {
pub(crate) name: TextConstant,
pub(crate) filename: TextConstant,
pub(crate) instrument: TextConstant,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "run-command")]
pub(crate) struct SendRunStop {
pub(crate) name: TextConstant,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "run-command")]
pub(crate) struct SendRunLogData {
pub(crate) source_name: TextConstant,
pub(crate) value_type: ValueType,
pub(crate) value: Vec<String>,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub(crate) struct SendSampleEnvLog {
pub(crate) name: TextConstant,
pub(crate) channel: Option<i32>,
pub(crate) time_delta: Option<f64>,
pub(crate) values_type: ValuesType,
pub(crate) message_counter: Option<i64>,
pub(crate) location: LocationType,
pub(crate) timestamps: Option<Vec<DateTime<Utc>>>,
pub(crate) values: SendSampleEnvLogValues,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub(crate) enum SendSampleEnvLogValues {
Literal(Vec<String>),
FromNoise {
length: usize,
noise: Vec<NoiseSource>,
},
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "run-command")]
pub(crate) struct SendAlarm {
pub(crate) source_name: TextConstant,
pub(crate) severity: SeverityLevel,
pub(crate) message: String,
}