implement fixes for project nautilus integration

This commit is contained in:
2026-01-02 15:26:52 -05:00
parent 09eeceb212
commit 994007418b
12 changed files with 43 additions and 38 deletions

View File

@@ -2,10 +2,17 @@
members = ["api", "api-core", "api-proc-macro", "server", "examples/simple_producer", "examples/simple_command"] members = ["api", "api-core", "api-proc-macro", "server", "examples/simple_producer", "examples/simple_command"]
resolver = "2" resolver = "2"
[workspace.package]
version = "0.1.0"
authors = ["Sergey <me@sergeysav.com>"]
[workspace.dependencies] [workspace.dependencies]
actix-web = "4.12.1" actix-web = "4.12.1"
actix-ws = "0.3.0" actix-ws = "0.3.0"
anyhow = "1.0.100" anyhow = "1.0.100"
api = { path = "./api" }
api-core = { path = "./api-core" }
api-proc-macro = { path = "./api-proc-macro" }
chrono = { version = "0.4.42" } chrono = { version = "0.4.42" }
derive_more = { version = "2.1.1" } derive_more = { version = "2.1.1" }
env_logger = "0.11.8" env_logger = "0.11.8"
@@ -22,8 +29,8 @@ sqlx = "0.8.6"
syn = "2.0.112" syn = "2.0.112"
thiserror = "2.0.17" thiserror = "2.0.17"
tokio = { version = "1.48.0" } tokio = { version = "1.48.0" }
tokio-test = "0.4.4"
tokio-stream = "0.1.17" tokio-stream = "0.1.17"
tokio-test = "0.4.4"
tokio-tungstenite = { version = "0.28.0" } tokio-tungstenite = { version = "0.28.0" }
tokio-util = "0.7.17" tokio-util = "0.7.17"
trybuild = "1.0.114" trybuild = "1.0.114"

View File

@@ -2,8 +2,8 @@
[package] [package]
name = "api-core" name = "api-core"
edition = "2021" edition = "2021"
version = "0.1.0" version.workspace = true
authors = ["Sergey <me@sergeysav.com>"] authors.workspace = true
[dependencies] [dependencies]
chrono = { workspace = true, features = ["serde"] } chrono = { workspace = true, features = ["serde"] }

View File

@@ -2,18 +2,18 @@
[package] [package]
name = "api-proc-macro" name = "api-proc-macro"
edition = "2021" edition = "2021"
version = "0.1.0" version.workspace = true
authors = ["Sergey <me@sergeysav.com>"] authors.workspace = true
[lib] [lib]
proc-macro = true proc-macro = true
[dependencies] [dependencies]
api-core = { path = "../api-core" } api-core = { workspace = true }
proc-macro-error = { workspace = true } proc-macro-error = { workspace = true }
quote = { workspace = true } quote = { workspace = true }
syn = { workspace = true } syn = { workspace = true }
[dev-dependencies] [dev-dependencies]
api = { path = "../api" } api = { workspace = true }
trybuild = { workspace = true } trybuild = { workspace = true }

View File

@@ -2,12 +2,12 @@
[package] [package]
name = "api" name = "api"
edition = "2021" edition = "2021"
version = "0.1.0" version.workspace = true
authors = ["Sergey <me@sergeysav.com>"] authors.workspace = true
[dependencies] [dependencies]
api-core = { path = "../api-core" } api-core = { workspace = true }
api-proc-macro = { path = "../api-proc-macro" } api-proc-macro = { workspace = true }
chrono = { workspace = true, features = ["serde"] } chrono = { workspace = true, features = ["serde"] }
derive_more = { workspace = true, features = ["from", "try_into"] } derive_more = { workspace = true, features = ["from", "try_into"] }
futures-util = { workspace = true } futures-util = { workspace = true }

View File

@@ -5,7 +5,7 @@ edition = "2021"
[dependencies] [dependencies]
anyhow = { workspace = true } anyhow = { workspace = true }
api = { path = "../../api" } api = { workspace = true }
env_logger = { workspace = true } env_logger = { workspace = true }
log = { workspace = true } log = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "signal"] } tokio = { workspace = true, features = ["rt-multi-thread", "signal"] }

View File

@@ -5,7 +5,7 @@ edition = "2021"
[dependencies] [dependencies]
anyhow = { workspace = true } anyhow = { workspace = true }
api = { path = "../../api" } api = { workspace = true }
chrono = { workspace = true } chrono = { workspace = true }
env_logger = { workspace = true } env_logger = { workspace = true }
futures-util = { workspace = true } futures-util = { workspace = true }

View File

@@ -23,11 +23,14 @@ const is_boolean = computed(() => {
// Initialize the parameter to some value: // Initialize the parameter to some value:
onMounted(() => { onMounted(() => {
if (model.value === undefined) {
if (is_numeric.value) { if (is_numeric.value) {
model.value = 0.0; model.value = 0.0;
} else if (is_boolean.value) { } else if (is_boolean.value) {
debugger;
model.value = false; model.value = false;
} }
}
}); });
</script> </script>

View File

@@ -56,7 +56,7 @@ watch([command_info], ([cmd_info]) => {
break; break;
} }
} }
if (!model_param_value) { if (model_param_value === undefined) {
let default_value: DynamicDataType = 0; let default_value: DynamicDataType = 0;
if (isNumericType(param.data_type)) { if (isNumericType(param.data_type)) {
default_value = 0; default_value = 0;

View File

@@ -6,6 +6,8 @@ import {
type WebsocketHandle, type WebsocketHandle,
} from '@/composables/websocket.ts'; } from '@/composables/websocket.ts';
import NumericText from '@/components/NumericText.vue'; import NumericText from '@/components/NumericText.vue';
import BooleanText from '@/components/BooleanText.vue';
import { isBooleanType, isNumericType } from '@/composables/dynamic.ts';
const max_update_rate = 50; // ms const max_update_rate = 50; // ms
const default_update_rate = 200; // ms const default_update_rate = 200; // ms
@@ -33,30 +35,23 @@ const value = websocket.value.listen_to_telemetry(
const is_data_present = computed(() => { const is_data_present = computed(() => {
return value.value != null; return value.value != null;
}); });
const numeric_data = computed(() => {
const val = value.value;
if (val) {
const type = telemetry_data.value!.data_type;
const item_val = val.value[type];
if (typeof item_val == 'number') {
return item_val;
}
}
return null;
});
</script> </script>
<template> <template>
<span v-if="!is_data_present" v-bind="$attrs"> No Data </span> <span v-if="!is_data_present" v-bind="$attrs"> No Data </span>
<template v-else> <template v-else>
<NumericText <NumericText
v-if="numeric_data" v-if="isNumericType(telemetry_data!.data_type)"
v-bind="$attrs" v-bind="$attrs"
:value="numeric_data" :value="value!.value[telemetry_data!.data_type]"
:max_width="10" :max_width="10"
include_span include_span
></NumericText> ></NumericText>
<BooleanText
v-else-if="isBooleanType(telemetry_data!.data_type)"
v-bind="$attrs"
:value="value!.value[telemetry_data!.data_type]"
></BooleanText>
<span v-else v-bind="$attrs"> <span v-else v-bind="$attrs">
Cannot Display Data of Type {{ telemetry_data!.data_type }} Cannot Display Data of Type {{ telemetry_data!.data_type }}
</span> </span>

View File

@@ -2,14 +2,14 @@
[package] [package]
name = "server" name = "server"
edition = "2021" edition = "2021"
version = "0.1.0" version.workspace = true
authors = ["Sergey <me@sergeysav.com>"] authors.workspace = true
[dependencies] [dependencies]
actix-web = { workspace = true, features = [ ] } actix-web = { workspace = true, features = [ ] }
actix-ws = { workspace = true } actix-ws = { workspace = true }
anyhow = { workspace = true } anyhow = { workspace = true }
api = { path = "../api" } api = { workspace = true }
chrono = { workspace = true } chrono = { workspace = true }
derive_more = { workspace = true, features = ["from"] } derive_more = { workspace = true, features = ["from"] }
fern = { workspace = true, features = ["colored"] } fern = { workspace = true, features = ["colored"] }

View File

@@ -3,7 +3,7 @@ use crate::http::error::HttpServerResultError;
use actix_web::{get, post, web, Responder}; use actix_web::{get, post, web, Responder};
use std::sync::Arc; use std::sync::Arc;
#[post("/cmd/{name:[\\w\\d/_-]+}")] #[post("/cmd/{name:[\\.\\w\\d/_-]+}")]
pub(super) async fn send_command( pub(super) async fn send_command(
command_service: web::Data<Arc<CommandManagementService>>, command_service: web::Data<Arc<CommandManagementService>>,
name: web::Path<String>, name: web::Path<String>,
@@ -23,7 +23,7 @@ pub(super) async fn get_all(
Ok(web::Json(command_service.get_commands()?)) Ok(web::Json(command_service.get_commands()?))
} }
#[get("/cmd/{name:[\\w\\d/_-]+}")] #[get("/cmd/{name:[\\.\\w\\d/_-]+}")]
pub(super) async fn get_one( pub(super) async fn get_one(
command_service: web::Data<Arc<CommandManagementService>>, command_service: web::Data<Arc<CommandManagementService>>,
name: web::Path<String>, name: web::Path<String>,

View File

@@ -9,7 +9,7 @@ use std::time::Duration;
use tokio::time::timeout; use tokio::time::timeout;
use uuid::Uuid; use uuid::Uuid;
#[get("/tlm/info/{name:[\\w\\d/_-]+}")] #[get("/tlm/info/{name:[\\.\\w\\d/_-]+}")]
pub(super) async fn get_tlm_definition( pub(super) async fn get_tlm_definition(
data: web::Data<Arc<TelemetryManagementService>>, data: web::Data<Arc<TelemetryManagementService>>,
name: web::Path<String>, name: web::Path<String>,