Commit 90d69de0 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

- True north limited to modulo 360

- Correctly display safety status
- Add override status
parent e9c4f691
...@@ -101,6 +101,17 @@ var azimuth_software = new dt_ui_window_trace("azimuth_software", "Azimuth Softw ...@@ -101,6 +101,17 @@ var azimuth_software = new dt_ui_window_trace("azimuth_software", "Azimuth Softw
is_number: false, is_number: false,
highlight: false, highlight: false,
}, },
{
name: "Azimuth_Override",
frequency: 0,
label: "Override",
func: one,
is_bool: true,
true_color: "lightyellow",
false_color: "lightgreen",
is_number: false,
highlight: false,
},
{ {
name: "Azimuth_Position", name: "Azimuth_Position",
frequency: 4, frequency: 4,
...@@ -168,6 +179,17 @@ var elevation_software = new dt_ui_window_trace("elevation_software", "Elevation ...@@ -168,6 +179,17 @@ var elevation_software = new dt_ui_window_trace("elevation_software", "Elevation
is_number: false, is_number: false,
highlight: false, highlight: false,
}, },
{
name: "Elevation_Override",
frequency: 0,
label: "Override",
func: one,
is_bool: true,
true_color: "lightyellow",
false_color: "lightgreen",
is_number: false,
highlight: false,
},
{ {
name: "Elevation_Position", name: "Elevation_Position",
frequency: 4, frequency: 4,
......
...@@ -164,9 +164,11 @@ function dt_status(element_name) { ...@@ -164,9 +164,11 @@ function dt_status(element_name) {
val = rad2deg(val); val = rad2deg(val);
var val_n = val + 180; var val_n = val + 180;
if (val >= 360)
val -= 360;
if (val < 0)
val += 360;
val_nd = val_n.toFixed(4); val_nd = val_n.toFixed(4);
if (val_nd >= 0)
val_nd = " " + val_nd;
dt_status_this.val_az_north.value_set(val_nd); dt_status_this.val_az_north.value_set(val_nd);
......
...@@ -859,7 +859,9 @@ function dt_ui_window_trace(elementid, name, traces) ...@@ -859,7 +859,9 @@ function dt_ui_window_trace(elementid, name, traces)
dt_ui_window.prototype.add.call(this, this.traces_ui[i]); dt_ui_window.prototype.add.call(this, this.traces_ui[i]);
this.traces_ui[i].value_func = traces[i].func; this.traces_ui[i].value_func = traces[i].func;
this.traces_ui[i].number_set(traces[i].is_number, traces[i].decimals); this.traces_ui[i].number_set(traces[i].is_number, traces[i].decimals);
this.traces_ui[i].bool_set(traces[i].is_bool, traces[i].label, traces[i].label, "lightgreen", "red"); var true_color = traces[i].true_color ? traces[i].true_color : "lightgreen";
var false_color = trace[i].false_color ? traces[i].false_color : "red";
this.traces_ui[i].bool_set(traces[i].is_bool, traces[i].label, traces[i].label, true_color, false_color);
if (!traces[i].is_bool) { if (!traces[i].is_bool) {
this.traces_ui[i].suffix_set(traces[i].suffix); this.traces_ui[i].suffix_set(traces[i].suffix);
this.traces_ui[i].label_set(traces[i].label); this.traces_ui[i].label_set(traces[i].label);
......
...@@ -104,6 +104,7 @@ blocks ($(frequency), $(delay)) { ...@@ -104,6 +104,7 @@ blocks ($(frequency), $(delay)) {
{ "command_bool", "elevation_recover" } { "command_bool", "elevation_recover" }
{ "and2", "elevation_position_safe" } { "and2", "elevation_position_safe" }
{ "log", "elevation_position_range_log" } { "log", "elevation_position_range_log" }
{ "log", "elevation_torsion_range_log" }
{ "log", "elevation_position_safe_log" } { "log", "elevation_position_safe_log" }
{ "command_bool", "focusbox_plus" } { "command_bool", "focusbox_plus" }
...@@ -251,6 +252,7 @@ links { ...@@ -251,6 +252,7 @@ links {
{ "elevation_speed_range_negative", "valid", "elevation_range_limit_r", "enable_neg", true } { "elevation_speed_range_negative", "valid", "elevation_range_limit_r", "enable_neg", true }
{ "elevation_speed_range_positive", "valid", "elevation_range_limit_l", "enable_pos", true } { "elevation_speed_range_positive", "valid", "elevation_range_limit_l", "enable_pos", true }
{ "elevation_speed_range_negative", "valid", "elevation_range_limit_l", "enable_neg", true } { "elevation_speed_range_negative", "valid", "elevation_range_limit_l", "enable_neg", true }
{ "elevation_torsion_range", "valid", "elevation_torsion_range_log", "condition", true }
} }
...@@ -268,11 +270,12 @@ traces { ...@@ -268,11 +270,12 @@ traces {
{ "Azimuth_Position", "rad", $<Azimuth_Position> } { "Azimuth_Position", "rad", $<Azimuth_Position> }
{ "Azimuth_Speed", "rad/s", "dt_az", "speed" } { "Azimuth_Speed", "rad/s", "dt_az", "speed" }
{ "Azimuth_Torque", "Nm", "dt_az", "torque" } { "Azimuth_Torque", "Nm", "dt_az", "torque" }
{ "Azimuth_Safe", "Boolean", "azimuth_position_range", "q" } { "Azimuth_Safe", "Boolean", "azimuth_safe_and", "q" }
{ "Azimuth_Enabled", "Boolean", "dt_az", "enabled" } { "Azimuth_Enabled", "Boolean", "dt_az", "enabled" }
{ "Azimuth_Drive_Safety", "Boolean", "dt_az", "be1" } { "Azimuth_Drive_Safety", "Boolean", "dt_az", "be1" }
{ "Azimuth_Drive_Safety_p270", "Boolean", $<Azimuth_Drive_Safety_p270> } { "Azimuth_Drive_Safety_p270", "Boolean", $<Azimuth_Drive_Safety_p270> }
{ "Azimuth_Drive_Safety_m270", "Boolean", $<Azimuth_Drive_Safety_m270> } { "Azimuth_Drive_Safety_m270", "Boolean", $<Azimuth_Drive_Safety_m270> }
{ "Azimuth_Override", "Boolean", "azimuth_recover", "value" }
{ "Focusbox_Position", "Volt", "dt_az", "ae1" } { "Focusbox_Position", "Volt", "dt_az", "ae1" }
...@@ -296,12 +299,13 @@ traces { ...@@ -296,12 +299,13 @@ traces {
{ "Elevation_Torque_Right", "Nm", "dt_el_r", "torque" } { "Elevation_Torque_Right", "Nm", "dt_el_r", "torque" }
{ "Elevation_Torque_Left", "Nm", "dt_el_l", "torque" } { "Elevation_Torque_Left", "Nm", "dt_el_l", "torque" }
{ "Elevation_Torsion_Torque", "Nm", "elevation_torsion_torque_lp", "out" } { "Elevation_Torsion_Torque", "Nm", "elevation_torsion_torque_lp", "out" }
{ "Elevation_Safe", "Boolean", "elevation_position_range", "q" } { "Elevation_Safe", "Boolean", "elevation_safe_and", "q" }
{ "Elevation_Enabled", "Boolean", "dt_el_l", "enabled" } { "Elevation_Enabled", "Boolean", "dt_el_l", "enabled" }
{ "Elevation_Drive_Safety_Right", "Boolean", "dt_el_r", "be1" } { "Elevation_Drive_Safety_Right", "Boolean", "dt_el_r", "be1" }
{ "Elevation_Drive_Safety_Left", "Boolean", "dt_el_l", "be1" } { "Elevation_Drive_Safety_Left", "Boolean", "dt_el_l", "be1" }
{ "Elevation_Top_Safe", "Boolean", $<Elevation_Top_Safe> } { "Elevation_Top_Safe", "Boolean", $<Elevation_Top_Safe> }
{ "Elevation_Bottom_Safe", "Boolean", $<Elevation_Bottom_Safe> } { "Elevation_Bottom_Safe", "Boolean", $<Elevation_Bottom_Safe> }
{ "Elevation_Override", "Boolean", "elevation_recover", "value" }
} }
set azimuth_gear 15006.75 set azimuth_gear 15006.75
...@@ -452,6 +456,10 @@ params { ...@@ -452,6 +456,10 @@ params {
{ "elevation_position_safe_log", "msg_down", 1, "Elevation position left normal operating range and is in safe zone" } { "elevation_position_safe_log", "msg_down", 1, "Elevation position left normal operating range and is in safe zone" }
{ "elevation_position_safe_log", "init", true } { "elevation_position_safe_log", "init", true }
{ "elevation_torsion_range_log", "msg_up", 1, "Elevation torsion inside allowed range" }
{ "elevation_torsion_range_log", "msg_down", 0, "Elevation torsion outside allowed range" }
{ "elevation_torsion_range_log", "init", true }
{ "elevation_safety_hw_top", "msg_up", 2, "Elevation HW top safety switch is closed" } { "elevation_safety_hw_top", "msg_up", 2, "Elevation HW top safety switch is closed" }
{ "elevation_safety_hw_top", "msg_down", 0, "Elevation HW top safety switch is open" } { "elevation_safety_hw_top", "msg_down", 0, "Elevation HW top safety switch is open" }
{ "elevation_safety_hw_top", "init", true } { "elevation_safety_hw_top", "init", true }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment