Skip to content

Commit

Permalink
Better variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeling committed Nov 7, 2024
1 parent ff1b8e3 commit f37939e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion data/data_group_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"groups": [
{
"group_name": "Frame 1",
"cycle_time_ms": 10,
"cycle_time_microseconds": 1000,
"signals": [
{
"path": "Vehicle.Speed"
Expand Down
20 changes: 10 additions & 10 deletions data/data_group_10.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"groups": [
{
"group_name": "Frame 1",
"cycle_time_ms": 10,
"cycle_time_microseconds": 1000,
"signals": [
{
"path": "Vehicle.Speed"
Expand All @@ -11,7 +11,7 @@
},
{
"group_name": "Frame 2",
"cycle_time_ms": 20,
"cycle_time_microseconds": 2000,
"signals": [
{
"path": "Vehicle.IsBrokenDown"
Expand All @@ -26,7 +26,7 @@
},
{
"group_name": "Frame 3",
"cycle_time_ms": 30,
"cycle_time_microseconds": 30,
"signals": [
{
"path": "Vehicle.Powertrain.CombustionEngine.MAP"
Expand All @@ -44,7 +44,7 @@
},
{
"group_name": "Frame 4",
"cycle_time_ms": 40,
"cycle_time_microseconds": 40,
"signals": [
{
"path": "Vehicle.Body.Windshield.Front.Wiping.System.IsWiping"
Expand All @@ -62,7 +62,7 @@
},
{
"group_name": "Frame 5",
"cycle_time_ms": 50,
"cycle_time_microseconds": 50,
"signals": [
{
"path": "Vehicle.Body.Windshield.Front.Wiping.System.IsBlocked"
Expand All @@ -80,7 +80,7 @@
},
{
"group_name": "Frame 6",
"cycle_time_ms": 60,
"cycle_time_microseconds": 60,
"signals": [
{
"path": "Vehicle.Body.Windshield.Front.WasherFluid.Level"
Expand All @@ -101,7 +101,7 @@
},
{
"group_name": "Frame 7",
"cycle_time_ms": 70,
"cycle_time_microseconds": 70,
"signals": [
{
"path": "Vehicle.Body.Windshield.Rear.Wiping.System.IsPositionReached"
Expand All @@ -122,7 +122,7 @@
},
{
"group_name": "Frame 8",
"cycle_time_ms": 80,
"cycle_time_microseconds": 80,
"signals": [
{
"path": "Vehicle.Body.Windshield.Front.Wiping.System.TargetPosition"
Expand All @@ -143,7 +143,7 @@
},
{
"group_name": "Frame 9",
"cycle_time_ms": 90,
"cycle_time_microseconds": 90,
"signals": [
{
"path": "Vehicle.Body.Windshield.Rear.Wiping.System.TargetPosition"
Expand All @@ -170,7 +170,7 @@
},
{
"group_name": "Frame 10",
"cycle_time_ms": 100,
"cycle_time_microseconds": 100,
"signals": [
{
"path": "Vehicle.Body.Lights.Backup.IsOn"
Expand Down
4 changes: 2 additions & 2 deletions data/data_group_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"groups": [
{
"group_name": "Frame 1",
"cycle_time_ms": 10,
"cycle_time_microseconds": 10,
"signals": [
{
"path": "Vehicle.Speed"
Expand All @@ -11,7 +11,7 @@
},
{
"group_name": "Frame 2",
"cycle_time_ms": 20,
"cycle_time_microseconds": 20,
"signals": [
{
"path": "Vehicle.IsBrokenDown"
Expand Down
6 changes: 3 additions & 3 deletions data/data_group_3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"groups": [
{
"group_name": "Frame 1",
"cycle_time_ms": 10,
"cycle_time_microseconds": 1000,
"signals": [
{
"path": "Vehicle.Speed"
Expand All @@ -11,7 +11,7 @@
},
{
"group_name": "Frame 2",
"cycle_time_ms": 20,
"cycle_time_microseconds": 2000,
"signals": [
{
"path": "Vehicle.IsBrokenDown"
Expand All @@ -26,7 +26,7 @@
},
{
"group_name": "Frame 3",
"cycle_time_ms": 30,
"cycle_time_microseconds": 3000,
"signals": [
{
"path": "Vehicle.Powertrain.CombustionEngine.MAP"
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct Config {
#[derive(Deserialize, Clone)]
pub struct Group {
pub group_name: String,
pub cycle_time_μs: u32,
pub cycle_time_microseconds: u32,
pub signals: Vec<Signal>,
}
#[derive(Deserialize, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion src/measure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub async fn perform_measurement(
// Create MeasurmentContext for each group
let mut measurement_config = measurement_config.clone();

measurement_config.interval = group.cycle_time_μs;
measurement_config.interval = group.cycle_time_microseconds;

let hist = Histogram::<u64>::new_with_bounds(1, 60 * 60 * 1000 * 1000, 3)?;
let running_hist = Histogram::<u64>::new_with_bounds(1, 60 * 60 * 1000 * 1000, 3)?;
Expand Down
6 changes: 3 additions & 3 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ pub fn read_config(config_file: Option<&String>) -> Result<Vec<Group>> {
Ok(vec![
Group {
group_name: String::from("Group A"),
cycle_time_μs: 0,
cycle_time_microseconds: 0,
signals: vec![Signal {
path: String::from("Vehicle.Speed"),
}],
},
Group {
group_name: String::from("Group B"),
cycle_time_μs: 0,
cycle_time_microseconds: 0,
signals: vec![Signal {
path: String::from("Vehicle.IsBrokenDown"),
}],
},
Group {
group_name: String::from("Group C"),
cycle_time_μs: 0,
cycle_time_microseconds: 0,
signals: vec![
Signal {
path: String::from("Vehicle.Body.Windshield.Front.Wiping.Intensity"),
Expand Down

0 comments on commit f37939e

Please sign in to comment.