Implement Fixes for Project Nautilus Integration #12

Merged
sergeysav merged 1 commits from sergeysav/fixes_for_project_nautilus into main 2026-01-02 12:29:35 -08:00
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"]
resolver = "2"
[workspace.package]
version = "0.1.0"
authors = ["Sergey <me@sergeysav.com>"]
[workspace.dependencies]
actix-web = "4.12.1"
actix-ws = "0.3.0"
anyhow = "1.0.100"
api = { path = "./api" }
api-core = { path = "./api-core" }
api-proc-macro = { path = "./api-proc-macro" }
chrono = { version = "0.4.42" }
derive_more = { version = "2.1.1" }
env_logger = "0.11.8"
@@ -22,8 +29,8 @@ sqlx = "0.8.6"
syn = "2.0.112"
thiserror = "2.0.17"
tokio = { version = "1.48.0" }
tokio-test = "0.4.4"
tokio-stream = "0.1.17"
tokio-test = "0.4.4"
tokio-tungstenite = { version = "0.28.0" }
tokio-util = "0.7.17"
trybuild = "1.0.114"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,6 +6,8 @@ import {
type WebsocketHandle,
} from '@/composables/websocket.ts';
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 default_update_rate = 200; // ms
@@ -33,30 +35,23 @@ const value = websocket.value.listen_to_telemetry(
const is_data_present = computed(() => {
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>
<template>
<span v-if="!is_data_present" v-bind="$attrs"> No Data </span>
<template v-else>
<NumericText
v-if="numeric_data"
v-if="isNumericType(telemetry_data!.data_type)"
v-bind="$attrs"
:value="numeric_data"
:value="value!.value[telemetry_data!.data_type]"
:max_width="10"
include_span
></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">
Cannot Display Data of Type {{ telemetry_data!.data_type }}
</span>

View File

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

View File

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

View File

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