From bd47b87e15ca9a143037a6e8c75d9323a7128017 Mon Sep 17 00:00:00 2001 From: aaumar25 Date: Tue, 13 Jan 2026 10:57:01 +0900 Subject: [PATCH 1/4] fix: Wrong metadata placement --- src/Log.zig | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Log.zig b/src/Log.zig index c800402..956429c 100644 --- a/src/Log.zig +++ b/src/Log.zig @@ -66,11 +66,6 @@ pub const Info = struct { config: struct { // Driver log. driver: struct { - driver: Meta = .{ - .description = - \\Driver properties to be logged. - , - }, cycle: []const u8 = "bool", cycle_time: []const u8 = "bool", vdc: []const u8 = "bool", @@ -81,14 +76,14 @@ pub const Info = struct { com_bwd_sent_cycles: []const u8 = "bool", com_fwd_sent_cycles: []const u8 = "bool", } = .{}, + __driver: Meta = .{ + .description = + \\Driver properties to be logged. + , + }, // Sensor log. sensor: struct { - __sensor: Meta = .{ - .description = - \\Sensor properties to be logged. - , - }, alarm: []const u8 = "bool", valid: []const u8 = "bool", active: []const u8 = "bool", @@ -97,14 +92,14 @@ pub const Info = struct { distance: []const u8 = "bool", velocity: []const u8 = "bool", } = .{}, + __sensor: Meta = .{ + .description = + \\Sensor properties to be logged. + , + }, // Axis log. axis: struct { - __axis: Meta = .{ - .description = - \\Axis properties to be logged. - , - }, current_d: []const u8 = "bool", current_q: []const u8 = "bool", reference_current_d: []const u8 = "bool", @@ -117,6 +112,11 @@ pub const Info = struct { carrier_velocity: []const u8 = "bool", } = .{}, _: []const u8 = "u6", + __axis: Meta = .{ + .description = + \\Axis properties to be logged. + , + }, } = .{}, axis: [3][]const u8 = .{"bool"} ** 3, From 2fdc6f1d3e0413703e3d5ac7bab04acc1e26e21e Mon Sep 17 00:00:00 2001 From: aaumar25 Date: Tue, 13 Jan 2026 14:53:23 +0900 Subject: [PATCH 2/4] refactor: Change field descriptions --- src/Log.zig | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Log.zig b/src/Log.zig index 956429c..ea75145 100644 --- a/src/Log.zig +++ b/src/Log.zig @@ -59,8 +59,7 @@ pub const Info = struct { cycles: []const u8 = "u32", __cycles: Meta = .{ .description = - \\Duration of logging process. - \\15000 cycles per second. + \\Duration of logging process (15000 cycles per second). , }, config: struct { @@ -143,26 +142,25 @@ pub const Info = struct { kind: []const u8 = "enum", __kind: Meta = .{ .description = - \\Conditions to start logging process. + \\Event to trigger logging process. , }, combinator: []const u8 = "enum", __combinator: Meta = .{ .description = - \\How conditions are combined. + \\Specifies if one or all conditions must be met to trigger logging. , }, hall_sensor: [6][]const u8 = .{"bool"} ** 6, __hall_sensor: Meta = .{ .description = - \\Hall Sensors state to start logging. + \\Hall Sensors used to trigger logging. , }, carrier: [4][]const u8 = .{"u12"} ** 4, __carrier: Meta = .{ - .hidden = true, .description = - \\Carrier state to start logging. + \\Carriers used to trigger logging. , }, } = .{}, From 726ea36d7578bcf376a232e275fb4b4319949f8f Mon Sep 17 00:00:00 2001 From: aaumar25 Date: Tue, 13 Jan 2026 14:54:01 +0900 Subject: [PATCH 3/4] feat: Add child field description --- src/Log.zig | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/src/Log.zig b/src/Log.zig index ea75145..f5605e3 100644 --- a/src/Log.zig +++ b/src/Log.zig @@ -66,14 +66,59 @@ pub const Info = struct { // Driver log. driver: struct { cycle: []const u8 = "bool", + __cycle: Meta = .{ + .description = + \\Number of performed internal loop (resets every 15000 cycles). + , + }, cycle_time: []const u8 = "bool", + __cycle_time: Meta = .{ + .description = + \\Number of performed internal loop per one control loop. + , + }, vdc: []const u8 = "bool", + __vdc: Meta = .{ + .description = + \\Supplied voltage to Driver. + , + }, com_bwd_sent: []const u8 = "bool", + __com_bwd_sent: Meta = .{ + .description = + \\Sent Driver state to backward Driver + , + }, com_bwd_arrived: []const u8 = "bool", + __com_bwd_arrived: Meta = .{ + .description = + \\Driver state of backward Driver. + , + }, com_fwd_sent: []const u8 = "bool", + __com_fwd_sent: Meta = .{ + .description = + \\Sent Driver state to forward Driver. + , + }, com_fwd_arrived: []const u8 = "bool", + __com_fwd_arrived: Meta = .{ + .description = + \\Driver state of forward Driver. + , + }, com_bwd_sent_cycles: []const u8 = "bool", + __com_bwd_sent_cycles: Meta = .{ + .description = + \\Elapsed cycles since last Driver state sent to backward Driver. + , + }, com_fwd_sent_cycles: []const u8 = "bool", + __com_fwd_sent_cycles: Meta = .{ + .description = + \\Elapsed cycles since last Driver state sent to forward Driver. + , + }, } = .{}, __driver: Meta = .{ .description = @@ -84,12 +129,48 @@ pub const Info = struct { // Sensor log. sensor: struct { alarm: []const u8 = "bool", + __alarm: Meta = .{ + .description = + \\Magnet is detected by Sensor. + , + }, valid: []const u8 = "bool", + __valid: Meta = .{ + .description = + \\Sensor value is valid to be used. + , + }, active: []const u8 = "bool", + __active: Meta = .{ + .description = + \\Sensor value is actively used for carrier state. + , + }, angle: []const u8 = "bool", + __angle: Meta = .{ + .description = + \\Detected magnet angle by Sensor. + , + }, average_angle: []const u8 = "bool", + __average_angle: Meta = .{ + .description = + \\Detected average magnet angle by Sensor, + , + .hidden = true, + }, distance: []const u8 = "bool", + __distance: Meta = .{ + .description = + \\Distance traveled by detected magnet on Sensor. + , + }, velocity: []const u8 = "bool", + __velocity: Meta = .{ + .description = + \\Velocity of traveling magnet on Sensor. + , + }, } = .{}, __sensor: Meta = .{ .description = @@ -100,15 +181,65 @@ pub const Info = struct { // Axis log. axis: struct { current_d: []const u8 = "bool", + __current_d: Meta = .{ + .description = + \\Supplied d current to Axis' motor. + , + }, current_q: []const u8 = "bool", + __current_q: Meta = .{ + .description = + \\Supplied q current to Axis' motor. + , + }, reference_current_d: []const u8 = "bool", + __reference_current_d: Meta = .{ + .description = + \\Reference value for d current to Axis' motor. + , + }, reference_current_q: []const u8 = "bool", + __reference_current_q: Meta = .{ + .description = + \\Reference value for q current to Axis' motor. + , + }, carrier_id: []const u8 = "bool", + __carrier_id: Meta = .{ + .description = + \\Detected Carrier ID on Axis. + , + }, carrier_position: []const u8 = "bool", + __carrier_position: Meta = .{ + .description = + \\Carrier position relative to Line's zero position. + , + }, carrier_state: []const u8 = "bool", + __carrier_state: Meta = .{ + .description = + \\State of detected Carrier on Axis. + , + }, average_angle_diff: []const u8 = "bool", + __average_angle_diff: Meta = .{ + .description = + \\Average angle difference between two Sensors of Axis. + , + }, carrier_reference_velocity: []const u8 = "bool", + __carrier_reference_velocity: Meta = .{ + .description = + \\Reference value for Carrier velocity. + , + }, carrier_velocity: []const u8 = "bool", + __carrier_velocity: Meta = .{ + .description = + \\Velocity of detected Carrier on Axis. + , + }, } = .{}, _: []const u8 = "u6", __axis: Meta = .{ From 2e4b64527427e0917b6ab0a8ebf40f588bab3c95 Mon Sep 17 00:00:00 2001 From: aaumar25 Date: Tue, 13 Jan 2026 15:00:27 +0900 Subject: [PATCH 4/4] refactor: Ending description with --- src/Log.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Log.zig b/src/Log.zig index f5605e3..e8ef328 100644 --- a/src/Log.zig +++ b/src/Log.zig @@ -86,7 +86,7 @@ pub const Info = struct { com_bwd_sent: []const u8 = "bool", __com_bwd_sent: Meta = .{ .description = - \\Sent Driver state to backward Driver + \\Sent Driver state to backward Driver. , }, com_bwd_arrived: []const u8 = "bool", @@ -155,7 +155,7 @@ pub const Info = struct { average_angle: []const u8 = "bool", __average_angle: Meta = .{ .description = - \\Detected average magnet angle by Sensor, + \\Detected average magnet angle by Sensor. , .hidden = true, },