more lines

This commit is contained in:
2024-12-05 20:10:31 -08:00
parent e6a52f971b
commit a353585d47
9 changed files with 269 additions and 82 deletions

View File

@@ -122,6 +122,21 @@ async fn main() -> Result<(), Box<dyn Error>> {
let sin_tlm_handle = tlm.register("simple_producer/sin".into(), TelemetryDataType::Float32).await?;
let cos_tlm_handle = tlm.register("simple_producer/cos".into(), TelemetryDataType::Float64).await?;
let sin2_tlm_handle = tlm.register("simple_producer/sin2".into(), TelemetryDataType::Float32).await?;
let cos2_tlm_handle = tlm.register("simple_producer/cos2".into(), TelemetryDataType::Float64).await?;
let sin3_tlm_handle = tlm.register("simple_producer/sin3".into(), TelemetryDataType::Float32).await?;
let cos3_tlm_handle = tlm.register("simple_producer/cos3".into(), TelemetryDataType::Float64).await?;
let sin4_tlm_handle = tlm.register("simple_producer/sin4".into(), TelemetryDataType::Float32).await?;
let cos4_tlm_handle = tlm.register("simple_producer/cos4".into(), TelemetryDataType::Float64).await?;
let sin5_tlm_handle = tlm.register("simple_producer/sin5".into(), TelemetryDataType::Float32).await?;
let cos5_tlm_handle = tlm.register("simple_producer/cos5".into(), TelemetryDataType::Float64).await?;
let sin6_tlm_handle = tlm.register("simple_producer/sin6".into(), TelemetryDataType::Float32).await?;
let cos6_tlm_handle = tlm.register("simple_producer/cos6".into(), TelemetryDataType::Float64).await?;
let cancellation_token = CancellationToken::new();
{
let cancellation_token = cancellation_token.clone();
@@ -149,6 +164,66 @@ async fn main() -> Result<(), Box<dyn Error>> {
),
chrono::Utc::now(),
).await?;
sin2_tlm_handle.publish(
Value::Float32(
(f32::TAU() * (index as f32) / (500.0_f32)).sin()
),
chrono::Utc::now(),
).await?;
cos2_tlm_handle.publish(
Value::Float64(
(f64::TAU() * (index as f64) / (500.0_f64)).cos()
),
chrono::Utc::now(),
).await?;
sin3_tlm_handle.publish(
Value::Float32(
(f32::TAU() * (index as f32) / (333.0_f32)).sin()
),
chrono::Utc::now(),
).await?;
cos3_tlm_handle.publish(
Value::Float64(
(f64::TAU() * (index as f64) / (333.0_f64)).cos()
),
chrono::Utc::now(),
).await?;
sin4_tlm_handle.publish(
Value::Float32(
(f32::TAU() * (index as f32) / (250.0_f32)).sin()
),
chrono::Utc::now(),
).await?;
cos4_tlm_handle.publish(
Value::Float64(
(f64::TAU() * (index as f64) / (250.0_f64)).cos()
),
chrono::Utc::now(),
).await?;
sin5_tlm_handle.publish(
Value::Float32(
(f32::TAU() * (index as f32) / (200.0_f32)).sin()
),
chrono::Utc::now(),
).await?;
cos5_tlm_handle.publish(
Value::Float64(
(f64::TAU() * (index as f64) / (200.0_f64)).cos()
),
chrono::Utc::now(),
).await?;
sin6_tlm_handle.publish(
Value::Float32(
(f32::TAU() * (index as f32) / (166.0_f32)).sin()
),
chrono::Utc::now(),
).await?;
cos6_tlm_handle.publish(
Value::Float64(
(f64::TAU() * (index as f64) / (166.0_f64)).cos()
),
chrono::Utc::now(),
).await?;
}
Ok(())