diff --git a/configs/apps/gladevcp/class-callback/class_callback.py b/configs/apps/gladevcp/class-callback/class_callback.py
index b0b6c2156d5..1be1e711b9d 100644
--- a/configs/apps/gladevcp/class-callback/class_callback.py
+++ b/configs/apps/gladevcp/class-callback/class_callback.py
@@ -65,7 +65,7 @@ def __init__(self, halcomp,builder,useropts):
self.halcomp = halcomp
self.builder = builder
- self.halcomp.newpin("value", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("value", hal.Type.REAL, hal.Dir.OUT)
self.start = time.time()
self.nhits = 0
self.ticks = 0
diff --git a/configs/apps/gladevcp/complex/complex.py b/configs/apps/gladevcp/complex/complex.py
index 67b2693f69b..98dd9a449af 100644
--- a/configs/apps/gladevcp/complex/complex.py
+++ b/configs/apps/gladevcp/complex/complex.py
@@ -123,12 +123,12 @@ def _hal_setup(self,halcomp, builder):
self.led1 = self.builder.get_object("hal_led1")
# standard hal pins not associated with any widget
- self.halcomp.newpin("example-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("example-in", hal.HAL_S32, hal.HAL_IN)
+ self.halcomp.newpin("example-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("example-in", hal.Type.SINT, hal.Dir.IN)
# hal pins with change callback. Also unrelated to any HAL widget.
# When the pin's value changes the callback is executed.
- self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.HAL_BIT, hal.HAL_IN))
+ self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.Type.BOOL, hal.Dir.IN))
self.example_trigger.connect('value-changed', self._on_example_trigger_change)
def __init__(self, halcomp,builder,useropts):
diff --git a/configs/attic/demo_mazak/demo_mazak.hal b/configs/attic/demo_mazak/demo_mazak.hal
index 1992c48980a..cb75231ae98 100644
--- a/configs/attic/demo_mazak/demo_mazak.hal
+++ b/configs/attic/demo_mazak/demo_mazak.hal
@@ -91,7 +91,7 @@ loadrt modmath mod_dir=2
loadrt charge_pump
loadrt tristate_bit
loadrt tristate_float count=3
-loadrt conv_s32_float
+loadrt conv_sint_real
# Software encoder counter, for the jogwheel, and possibly a future
# small manual encoder for a feedrate override knob.
@@ -164,7 +164,7 @@ addf tristate-bit.0 servo-thread
addf tristate-float.0 servo-thread
addf tristate-float.1 servo-thread
addf tristate-float.2 servo-thread
-addf conv-s32-float.0 servo-thread
+addf conv-sint-real.0 servo-thread
# output drivers are loaded last
addf motenc.3.dac-write servo-thread
diff --git a/configs/attic/unclaimed/plasma-thc/mp1000A.hal b/configs/attic/unclaimed/plasma-thc/mp1000A.hal
index c4935bdc3a5..59e72834910 100644
--- a/configs/attic/unclaimed/plasma-thc/mp1000A.hal
+++ b/configs/attic/unclaimed/plasma-thc/mp1000A.hal
@@ -16,7 +16,7 @@ loadrt or2 count=9
loadrt scale
loadrt sum2 count=5
loadrt xor2 count=4
-loadrt conv_s32_float
+loadrt conv_sint_real
loadrt edge count=2
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
-addf conv-s32-float.0 servo-thread
+addf conv-sint-real.0 servo-thread
addf edge.0 servo-thread
addf edge.1 servo-thread
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
net CHLSwitched xor2.2.out => and2.1.in1
net ArcOKTimer oneshot.2.out => xor2.1.in0
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
-net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
-net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
+net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
+net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
net TorchOff not.2.out => flipflop.1.reset
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
diff --git a/configs/attic/unclaimed/plasma-thc/mp1000B.hal b/configs/attic/unclaimed/plasma-thc/mp1000B.hal
index a65f06ebe11..94bfbbf2a10 100644
--- a/configs/attic/unclaimed/plasma-thc/mp1000B.hal
+++ b/configs/attic/unclaimed/plasma-thc/mp1000B.hal
@@ -16,7 +16,7 @@ loadrt or2 count=9
loadrt scale
loadrt sum2 count=5
loadrt xor2 count=4
-loadrt conv_s32_float
+loadrt conv_sint_real
loadrt edge count=2
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
-addf conv-s32-float.0 servo-thread
+addf conv-sint-real.0 servo-thread
addf edge.0 servo-thread
addf edge.1 servo-thread
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
net CHLSwitched xor2.2.out => and2.1.in1
net ArcOKTimer oneshot.2.out => xor2.1.in0
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
-net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
-net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
+net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
+net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
net TorchOff not.2.out => flipflop.1.reset
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
diff --git a/configs/attic/unclaimed/plasma-thc/thc300.hal b/configs/attic/unclaimed/plasma-thc/thc300.hal
index 8a3d838e509..37950d48b61 100644
--- a/configs/attic/unclaimed/plasma-thc/thc300.hal
+++ b/configs/attic/unclaimed/plasma-thc/thc300.hal
@@ -16,7 +16,7 @@ loadrt or2 count=9
loadrt scale
loadrt sum2 count=5
loadrt xor2 count=4
-loadrt conv_s32_float
+loadrt conv_sint_real
loadrt edge count=2
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
-addf conv-s32-float.0 servo-thread
+addf conv-sint-real.0 servo-thread
addf edge.0 servo-thread
addf edge.1 servo-thread
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
net CHLSwitched xor2.2.out => and2.1.in1
net ArcOKTimer oneshot.2.out => xor2.1.in0
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
-net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
-net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
+net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
+net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
net TorchOff not.2.out => flipflop.1.reset
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
diff --git a/configs/by_interface/mesa/hm2-modbus/bldc_and_wavebox.mbccs b/configs/by_interface/mesa/hm2-modbus/bldc_and_wavebox.mbccs
index 389e7818c71..60d8de8b2d5 100644
--- a/configs/by_interface/mesa/hm2-modbus/bldc_and_wavebox.mbccs
+++ b/configs/by_interface/mesa/hm2-modbus/bldc_and_wavebox.mbccs
@@ -58,9 +58,9 @@
diff --git a/configs/by_interface/mesa/hm2-modbus/rs485io.mbccs b/configs/by_interface/mesa/hm2-modbus/rs485io.mbccs
index b34a5780fb5..f8777a01762 100644
--- a/configs/by_interface/mesa/hm2-modbus/rs485io.mbccs
+++ b/configs/by_interface/mesa/hm2-modbus/rs485io.mbccs
@@ -6,10 +6,10 @@
-
-
-
-
+
+
+
+
diff --git a/configs/by_interface/mesa/hm2-modbus/waveshare-modbus-rtu-relay-d.mbccs b/configs/by_interface/mesa/hm2-modbus/waveshare-modbus-rtu-relay-d.mbccs
index e12e388402b..877180c15f0 100644
--- a/configs/by_interface/mesa/hm2-modbus/waveshare-modbus-rtu-relay-d.mbccs
+++ b/configs/by_interface/mesa/hm2-modbus/waveshare-modbus-rtu-relay-d.mbccs
@@ -41,9 +41,9 @@
diff --git a/configs/by_interface/parport/plasma-thc-sim/thc.hal b/configs/by_interface/parport/plasma-thc-sim/thc.hal
index d7c397a38e7..6b644223cc6 100644
--- a/configs/by_interface/parport/plasma-thc-sim/thc.hal
+++ b/configs/by_interface/parport/plasma-thc-sim/thc.hal
@@ -19,7 +19,7 @@ loadrt or2 count=10
loadrt scale
loadrt sum2 count=5
loadrt xor2 count=4
-loadrt conv_s32_float
+loadrt conv_sint_real
loadrt edge count=2
# Attach realtime hal components to a realtime thread
@@ -35,7 +35,7 @@ addf and2.8 servo-thread
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
-addf conv-s32-float.0 servo-thread
+addf conv-sint-real.0 servo-thread
addf edge.0 servo-thread
addf edge.1 servo-thread
addf flipflop.0 servo-thread
@@ -186,8 +186,8 @@ net FeedHold xor2.0.out => motion.feed-hold
net CHLSwitched xor2.2.out => and2.1.in1
net ArcOKTimer oneshot.2.out => xor2.1.in0
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
-net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
-net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
+net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
+net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
net TorchOff not.2.out => flipflop.1.reset
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
diff --git a/configs/by_interface/pico/univpwmv/univpwm_load.hal b/configs/by_interface/pico/univpwmv/univpwm_load.hal
index 524a756c062..01c926ed99c 100644
--- a/configs/by_interface/pico/univpwmv/univpwm_load.hal
+++ b/configs/by_interface/pico/univpwmv/univpwm_load.hal
@@ -30,7 +30,7 @@ loadrt not count=1
loadrt estop_latch count=1
loadrt and2 count=1
loadrt or2 count=1
-loadrt conv_s32_float count=1
+loadrt conv_sint_real count=1
loadrt mult2 count=2
loadrt lowpass count=1
@@ -50,7 +50,7 @@ addf pid.2.do-pid-calcs servo-thread
addf pid.3.do-pid-calcs servo-thread
# for spindle
addf or2.0 servo-thread
-addf conv-s32-float.0 servo-thread
+addf conv-sint-real.0 servo-thread
addf mult2.0 servo-thread
addf mult2.1 servo-thread
addf lowpass.0 servo-thread
diff --git a/configs/by_machine/scorbot-er-3/pyvcp.xml b/configs/by_machine/scorbot-er-3/pyvcp.xml
index efc643fff0a..38af8ea7437 100644
--- a/configs/by_machine/scorbot-er-3/pyvcp.xml
+++ b/configs/by_machine/scorbot-er-3/pyvcp.xml
@@ -2,7 +2,7 @@
-
+
@@ -11,7 +11,7 @@
-
+
@@ -29,7 +29,7 @@
-
+
@@ -48,7 +48,7 @@
-
+
diff --git a/configs/sim/axis/external_offsets/dynamic_offsets_panel.hal b/configs/sim/axis/external_offsets/dynamic_offsets_panel.hal
index 2595ac3d9dd..d8fb312d375 100644
--- a/configs/sim/axis/external_offsets/dynamic_offsets_panel.hal
+++ b/configs/sim/axis/external_offsets/dynamic_offsets_panel.hal
@@ -1,6 +1,6 @@
loadrt siggen names=gen
loadrt scale names=scalea
-loadrt conv_float_s32 names=cvt
+loadrt conv_real_sint names=cvt
loadrt not names=nota
loadrt or2 names=or2a
diff --git a/configs/sim/axis/gantry/gantry_panel.hal b/configs/sim/axis/gantry/gantry_panel.hal
index cbc2d78412a..178ddd5e615 100644
--- a/configs/sim/axis/gantry/gantry_panel.hal
+++ b/configs/sim/axis/gantry/gantry_panel.hal
@@ -22,7 +22,7 @@
# factor (machine-units per count).
loadrt mux2 names=home_sequence_mux,jjog_counts_mux
-loadrt conv_float_s32 names=home_sequence_s32
+loadrt conv_real_sint names=home_sequence_sint
loadrt oneshot names=pulse_on_jjdisable
# synchronized homing, no joint1,3 jogging:
@@ -46,15 +46,15 @@ setp pulse_on_jjdisable.width 0.1
addf home_sequence_mux servo-thread
addf jjog_counts_mux servo-thread
-addf home_sequence_s32 servo-thread
+addf home_sequence_sint servo-thread
addf pulse_on_jjdisable servo-thread
net home_seq_float <= home_sequence_mux.out
-net home_seq_float => home_sequence_s32.in
+net home_seq_float => home_sequence_sint.in
-net home_seq_s32 <= home_sequence_s32.out
-net home_seq_s32 => ini.1.home_sequence
-net home_seq_s32 => ini.3.home_sequence
+net home_seq_sint <= home_sequence_sint.out
+net home_seq_sint => ini.1.home_sequence
+net home_seq_sint => ini.3.home_sequence
# set counts to zero using param_pin upon disable:
net jjog_counts_value <= jjog_counts_mux.out
diff --git a/configs/sim/axis/gladevcp/meter_scale.py b/configs/sim/axis/gladevcp/meter_scale.py
index dddd8d95708..f586ba50695 100644
--- a/configs/sim/axis/gladevcp/meter_scale.py
+++ b/configs/sim/axis/gladevcp/meter_scale.py
@@ -14,7 +14,7 @@ def __init__(self, halcomp,builder,useropts):
# hal pin with change callback.
# When the pin's value changes the callback is executed.
- self.max_value = hal_glib.GPin(halcomp.newpin('max-value', hal.HAL_FLOAT, hal.HAL_IN))
+ self.max_value = hal_glib.GPin(halcomp.newpin('max-value', hal.Type.REAL, hal.Dir.IN))
self.max_value.connect('value-changed', self._on_max_value_change)
inifile = linuxcnc.ini(os.getenv("INI_FILE_NAME"))
diff --git a/configs/sim/axis/laser/laser.hal b/configs/sim/axis/laser/laser.hal
index b19bbb358ed..8d8bffe10bf 100644
--- a/configs/sim/axis/laser/laser.hal
+++ b/configs/sim/axis/laser/laser.hal
@@ -1,4 +1,4 @@
-loadrt conv_s32_u32 names=laser.motion.type-conv
+loadrt conv_sint_uint names=laser.motion.type-conv
loadrt bitslice names=laser.motion.type-slice personality=2
loadrt limit1 names=laser.power.min.limit,laser.power.max.limit,laser.power.cmd.limit
loadrt laserpower names=laser.control
diff --git a/configs/sim/axis/plasma/plasmac2/lib/conversational.py b/configs/sim/axis/plasma/plasmac2/lib/conversational.py
index 5d340c0e60a..2814b3d774b 100644
--- a/configs/sim/axis/plasma/plasmac2/lib/conversational.py
+++ b/configs/sim/axis/plasma/plasmac2/lib/conversational.py
@@ -373,7 +373,7 @@ def send_pressed(self):
def block_request(self):
# may need to add this halpin for wcs rotation on abort etc.
-# self.convBlockLoaded = self.h.newpin('conv_block_loaded', hal.HAL_BIT, hal.HAL_IN)
+# self.convBlockLoaded = self.h.newpin('conv_block_loaded', hal.Type.BOOL, hal.Dir.IN)
if not self.settingsExited:
if self.previewActive and self.active_shape():
return True
diff --git a/configs/sim/axis/plasma/plasmac2/lib/custom/user_hal.py b/configs/sim/axis/plasma/plasmac2/lib/custom/user_hal.py
index 7798482d467..70e4c7d5c26 100644
--- a/configs/sim/axis/plasma/plasmac2/lib/custom/user_hal.py
+++ b/configs/sim/axis/plasma/plasmac2/lib/custom/user_hal.py
@@ -1,4 +1,4 @@
# CUSTOM HAL PINS, RUNS ONCE AT STARTUP
# example hal pin named my-halpin
-#comp.newpin('my-halpin', hal.HAL_FLOAT, hal.HAL_IN)
+#comp.newpin('my-halpin', hal.Type.REAL, hal.Dir.IN)
diff --git a/configs/sim/axis/plasma/plasmac2/lib/sim/sim_panel.py b/configs/sim/axis/plasma/plasmac2/lib/sim/sim_panel.py
index e759a497fe9..a5ec946f9a7 100755
--- a/configs/sim/axis/plasma/plasmac2/lib/sim/sim_panel.py
+++ b/configs/sim/axis/plasma/plasmac2/lib/sim/sim_panel.py
@@ -133,7 +133,7 @@ def estop_pressed(event):
I = linuxcnc.ini(S.ini_filename)
# create new hal component
H = hal.component('plasmac-sim')
- H.newpin('z-position', hal.HAL_FLOAT, hal.HAL_IN)
+ H.newpin('z-position', hal.Type.REAL, hal.Dir.IN)
H.ready()
# disconnect any conflicting hal pins
if hal.pin_has_writer('db_arc-ok.in'):
diff --git a/configs/sim/axis/plasma/plasmac2/plasmac2.py b/configs/sim/axis/plasma/plasmac2/plasmac2.py
index f9a71b2271b..6fab69da369 100644
--- a/configs/sim/axis/plasma/plasmac2/plasmac2.py
+++ b/configs/sim/axis/plasma/plasmac2/plasmac2.py
@@ -3503,17 +3503,17 @@ def ext_hal_create():
global extHalPins
for pin in ['abort', 'power', 'run', 'pause', 'run-pause', 'touchoff',
'probe','pulse', 'frame-job']:
- comp.newpin(f"ext.{pin}", hal.HAL_BIT, hal.HAL_IN)
+ comp.newpin(f"ext.{pin}", hal.Type.BOOL, hal.Dir.IN)
extHalPins[pin] = {'state': False, 'last': False}
# external pins for user button toggle and pulse
for pin in range(3):
- comp.newpin(f"ext.out_{pin}", hal.HAL_BIT, hal.HAL_OUT)
+ comp.newpin(f"ext.out_{pin}", hal.Type.BOOL, hal.Dir.OUT)
# pins for pierce only offsets
for pin in 'xy':
- comp.newpin(f"{pin}-pierce-offset", hal.HAL_FLOAT, hal.HAL_OUT)
+ comp.newpin(f"{pin}-pierce-offset", hal.Type.REAL, hal.Dir.OUT)
# pins for pierce coordinate extents
for pin in ['x_min', 'y_min', 'x_max', 'y_max']:
- comp.newpin(f"{pin}_pierce_extent", hal.HAL_FLOAT, hal.HAL_IN)
+ comp.newpin(f"{pin}_pierce_extent", hal.Type.REAL, hal.Dir.IN)
# called every cycle by user_live_update
def ext_hal_watch():
@@ -5674,33 +5674,33 @@ def user_hal_pins():
if firstRun == 'invalid':
return
# create new hal pins
- comp.newpin('arc-voltage', hal.HAL_FLOAT, hal.HAL_IN)
- comp.newpin('led-arc-ok', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-torch', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-thc-enabled', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-ohmic', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-float', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-breakaway', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-thc-active', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-up', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-down', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-corner-locked', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('led-void-locked', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('refresh', hal.HAL_S32, hal.HAL_IN)
- comp.newpin('material-change-number', hal.HAL_S32, hal.HAL_IN)
- comp.newpin('material-change', hal.HAL_S32, hal.HAL_IN)
- comp.newpin('material-change-timeout', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('material-reload', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('material-temp', hal.HAL_S32, hal.HAL_IN)
- comp.newpin('cut-type', hal.HAL_S32, hal.HAL_IN)
- comp.newpin('thc-enable-out', hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin('program-is-idle', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('laser-on', hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin('preview-tab', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('development', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('conv-block-loaded', hal.HAL_BIT, hal.HAL_IN)
- comp.newpin('offset-set-probe', hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin('offset-set-scribe', hal.HAL_BIT, hal.HAL_OUT)
+ comp.newpin('arc-voltage', hal.Type.REAL, hal.Dir.IN)
+ comp.newpin('led-arc-ok', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-torch', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-thc-enabled', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-ohmic', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-float', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-breakaway', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-thc-active', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-up', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-down', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-corner-locked', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('led-void-locked', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('refresh', hal.Type.SINT, hal.Dir.IN)
+ comp.newpin('material-change-number', hal.Type.SINT, hal.Dir.IN)
+ comp.newpin('material-change', hal.Type.SINT, hal.Dir.IN)
+ comp.newpin('material-change-timeout', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('material-reload', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('material-temp', hal.Type.SINT, hal.Dir.IN)
+ comp.newpin('cut-type', hal.Type.SINT, hal.Dir.IN)
+ comp.newpin('thc-enable-out', hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin('program-is-idle', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('laser-on', hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin('preview-tab', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('development', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('conv-block-loaded', hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin('offset-set-probe', hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin('offset-set-scribe', hal.Type.BOOL, hal.Dir.OUT)
ext_hal_create()
# create some new signals and connect pins
hal_data = [[0,'plasmac:arc-voltage-out','plasmac.arc-voltage-out','axisui.arc-voltage'],\
@@ -5722,9 +5722,9 @@ def user_hal_pins():
]
for line in hal_data:
if line[0] < 7:
- hal.new_sig(line[1],hal.HAL_FLOAT)
+ hal.new_sig(line[1],hal.Type.REAL)
else:
- hal.new_sig(line[1],hal.HAL_BIT)
+ hal.new_sig(line[1],hal.Type.BOOL)
hal.connect(line[2],line[1])
hal.connect(line[3],line[1])
# connect pins to some existing signals
diff --git a/configs/sim/axis/plasma/user_hal.py b/configs/sim/axis/plasma/user_hal.py
index a4d708d39b8..8ce00e31a5d 100644
--- a/configs/sim/axis/plasma/user_hal.py
+++ b/configs/sim/axis/plasma/user_hal.py
@@ -2,5 +2,5 @@
# see the file customizing.html for some tips
# example to create a HAL floating point input pin and a HAL bit input pin
-#comp.newpin('my-halfloat', hal.HAL_FLOAT, hal.HAL_IN)
-#comp.newpin('my-halbit', hal.HAL_BIT, hal.HAL_IN)
+#comp.newpin('my-halfloat', hal.Type.REAL, hal.Dir.IN)
+#comp.newpin('my-halbit', hal.Type.BOOL, hal.Dir.IN)
diff --git a/configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/python/gladevcp-handler.py b/configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/python/gladevcp-handler.py
index 29441e50478..6f006bced42 100644
--- a/configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/python/gladevcp-handler.py
+++ b/configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/python/gladevcp-handler.py
@@ -19,7 +19,7 @@ def on_led_change(self,hal_led,data=None):
def __init__(self, halcomp,builder,useropts):
self.halcomp = halcomp
self.change_text = builder.get_object("change-text")
- self.halcomp.newpin("number", hal.HAL_FLOAT, hal.HAL_IN)
+ self.halcomp.newpin("number", hal.Type.REAL, hal.Dir.IN)
def get_handlers(halcomp,builder,useropts):
return [HandlerClass(halcomp,builder,useropts)]
diff --git a/configs/sim/axis/vismach/3axis-tutorial/3axis-tutorial b/configs/sim/axis/vismach/3axis-tutorial/3axis-tutorial
index 2b374b9bd12..1e349eb2947 100755
--- a/configs/sim/axis/vismach/3axis-tutorial/3axis-tutorial
+++ b/configs/sim/axis/vismach/3axis-tutorial/3axis-tutorial
@@ -24,13 +24,13 @@ s.poll()
# in this file, and uncomment last line in HAL file.
# add joints. Mill has 3.
c = hal.component("3axis-tutorial")
-c.newpin("jointX", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointY", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointZ", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("jointX", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointY", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointZ", hal.Type.REAL, hal.Dir.IN)
# tool length and diameter pins?
-c.newpin("toollength", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tooldiameter", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("toollength", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tooldiameter", hal.Type.REAL, hal.Dir.IN)
# tells loadusr pins is ready
c.ready()
diff --git a/configs/sim/axis/vismach/5axis/bridgemill/5axisgui.py b/configs/sim/axis/vismach/5axis/bridgemill/5axisgui.py
index 40fc0475126..5c70b420ce2 100755
--- a/configs/sim/axis/vismach/5axis/bridgemill/5axisgui.py
+++ b/configs/sim/axis/vismach/5axis/bridgemill/5axisgui.py
@@ -45,14 +45,14 @@ def coords(self):
return -self.comp.tool_length, r, 0, r
c = hal.component("5axisgui")
-c.newpin("jx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jb", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jc", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diam", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pivot_len", hal.HAL_FLOAT, hal.HAL_OUT)
+c.newpin("jx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jb", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jc", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diam", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pivot_len", hal.Type.REAL, hal.Dir.OUT)
c["pivot_len"] = pivot_len
c.ready()
diff --git a/configs/sim/axis/vismach/5axis/max5/max5gui.py b/configs/sim/axis/vismach/5axis/max5/max5gui.py
index 23c92cf2ef3..8200145565e 100755
--- a/configs/sim/axis/vismach/5axis/max5/max5gui.py
+++ b/configs/sim/axis/vismach/5axis/max5/max5gui.py
@@ -37,18 +37,18 @@ def coords(self):
c = hal.component("max5gui")
# table
-c.newpin("table", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table", hal.Type.REAL, hal.Dir.IN)
# saddle
-c.newpin("saddle", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("head", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("head", hal.Type.REAL, hal.Dir.IN)
# head tilt
-c.newpin("tilt", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt", hal.Type.REAL, hal.Dir.IN)
# rotary table
-c.newpin("rotate", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate", hal.Type.REAL, hal.Dir.IN)
-c.newpin("tool-length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-radius", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool-length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-radius", hal.Type.REAL, hal.Dir.IN)
c.ready()
pivot_len=100
diff --git a/configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr-gui.py b/configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr-gui.py
index 21f55a2bdd6..2f27c07f8f2 100644
--- a/configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr-gui.py
+++ b/configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr-gui.py
@@ -33,26 +33,26 @@
c = hal.component("xyzab-tdr-gui")
# axis-x
-c.newpin("axis-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis-x", hal.Type.REAL, hal.Dir.IN)
# axis-y
-c.newpin("axis-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis-y", hal.Type.REAL, hal.Dir.IN)
# axis-z
-c.newpin("axis-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis-z", hal.Type.REAL, hal.Dir.IN)
# rotary_a
-c.newpin("rotary-a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary-a", hal.Type.REAL, hal.Dir.IN)
# rotary_b
-c.newpin("rotary-b", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary-b", hal.Type.REAL, hal.Dir.IN)
# geometric offsets between A and B axes
-c.newpin("x_offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z_offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("x_offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z_offset", hal.Type.REAL, hal.Dir.IN)
# rot-point offsets
-c.newpin("x-rot-point", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("y-rot-point", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-rot-point", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("x-rot-point", hal.Type.REAL, hal.Dir.IN)
+c.newpin("y-rot-point", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-rot-point", hal.Type.REAL, hal.Dir.IN)
# tool-length offset
# tool offsets
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diameter", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diameter", hal.Type.REAL, hal.Dir.IN)
c.ready()
# These values are arbitrary and are meant to simulate an absolute
diff --git a/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzac-trt-gui.py b/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzac-trt-gui.py
index 98f267355d1..2283299ea80 100755
--- a/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzac-trt-gui.py
+++ b/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzac-trt-gui.py
@@ -30,19 +30,19 @@
c = hal.component("xyzac-trt-gui")
# table-x
-c.newpin("table-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table-x", hal.Type.REAL, hal.Dir.IN)
# saddle-y
-c.newpin("saddle-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle-y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("spindle-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("spindle-z", hal.Type.REAL, hal.Dir.IN)
# table-x tilt-b
-c.newpin("tilt-a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt-a", hal.Type.REAL, hal.Dir.IN)
# rotary table-x
-c.newpin("rotate-c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate-c", hal.Type.REAL, hal.Dir.IN)
# offsets
-c.newpin("y-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("y-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-offset", hal.Type.REAL, hal.Dir.IN)
c.ready()
for setting in sys.argv[1:]: exec(setting)
diff --git a/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt-gui.py b/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt-gui.py
index 5a652511b38..725cdd29fbd 100755
--- a/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt-gui.py
+++ b/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt-gui.py
@@ -30,18 +30,18 @@
c = hal.component("xyzbc-trt-gui")
# table-x
-c.newpin("table-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table-x", hal.Type.REAL, hal.Dir.IN)
# saddle-y
-c.newpin("saddle-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle-y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("spindle-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("spindle-z", hal.Type.REAL, hal.Dir.IN)
# table-x tilt-b
-c.newpin("tilt-b", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt-b", hal.Type.REAL, hal.Dir.IN)
# rotary table-x
-c.newpin("rotate-c", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("x-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate-c", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("x-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-offset", hal.Type.REAL, hal.Dir.IN)
c.ready()
for setting in sys.argv[1:]: exec(setting)
diff --git a/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/python/twp-helper-comp.py b/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/python/twp-helper-comp.py
index e2139aab13a..44748312c4e 100755
--- a/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/python/twp-helper-comp.py
+++ b/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/python/twp-helper-comp.py
@@ -7,40 +7,40 @@
# this pin reflects the machine.analog pin used for the
# twp-status
-h.newpin("twp-status", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("twp-status", hal.Type.REAL, hal.Dir.IN)
# these pins are created here from 'twp-status''
-h.newpin("twp-is-redefined", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("twp-is-defined", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("twp-is-active", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("twp-is-redefined", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("twp-is-defined", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("twp-is-active", hal.Type.BOOL, hal.Dir.OUT)
# twp origin vector
-h.newpin("twp-ox-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-oy-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-oz-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-ox", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-oy", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-oz", hal.HAL_FLOAT, hal.HAL_OUT)
+h.newpin("twp-ox-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-oy-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-oz-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-ox", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-oy", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-oz", hal.Type.REAL, hal.Dir.OUT)
# twp x-orientation vector
-h.newpin("twp-xx-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-xy-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-xz-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-xx", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-xy", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-xz", hal.HAL_FLOAT, hal.HAL_OUT)
+h.newpin("twp-xx-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-xy-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-xz-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-xx", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-xy", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-xz", hal.Type.REAL, hal.Dir.OUT)
# twp z-orientation vector
-h.newpin("twp-zx-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-zy-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-zz-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-zx", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-zy", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-zz", hal.HAL_FLOAT, hal.HAL_OUT)
+h.newpin("twp-zx-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-zy-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-zz-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-zx", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-zy", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-zz", hal.Type.REAL, hal.Dir.OUT)
# twp origin vector in machine coordinate system
-h.newpin("twp-ox-world-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-oy-world-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-oz-world-in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("twp-ox-world", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-oy-world", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("twp-oz-world", hal.HAL_FLOAT, hal.HAL_OUT)
+h.newpin("twp-ox-world-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-oy-world-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-oz-world-in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("twp-ox-world", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-oy-world", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("twp-oz-world", hal.Type.REAL, hal.Dir.OUT)
h.ready()
diff --git a/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzacb-trsrn-gui.py b/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzacb-trsrn-gui.py
index 89720d695da..1209d973693 100755
--- a/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzacb-trsrn-gui.py
+++ b/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzacb-trsrn-gui.py
@@ -43,61 +43,61 @@
c = hal.component("xyzacb-trsrn-gui")
# axis_x
-c.newpin("axis_x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis_x", hal.Type.REAL, hal.Dir.IN)
# axis_y
-c.newpin("axis_y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis_y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("axis_z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis_z", hal.Type.REAL, hal.Dir.IN)
# rotary_a
-c.newpin("rotary_a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary_a", hal.Type.REAL, hal.Dir.IN)
# rotary_b
-c.newpin("rotary_b", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary_b", hal.Type.REAL, hal.Dir.IN)
# rotary_c
-c.newpin("rotary_c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary_c", hal.Type.REAL, hal.Dir.IN)
# nutation-angle
-c.newpin("nutation_angle", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("nutation_angle", hal.Type.REAL, hal.Dir.IN)
# tool offsets
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diameter", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diameter", hal.Type.REAL, hal.Dir.IN)
# geometric offsets in the spindle-rotary-assembly
-c.newpin("pivot_y", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pivot_z", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("offset_x", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("offset_y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("pivot_y", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pivot_z", hal.Type.REAL, hal.Dir.IN)
+c.newpin("offset_x", hal.Type.REAL, hal.Dir.IN)
+c.newpin("offset_y", hal.Type.REAL, hal.Dir.IN)
# rot-point offsets distances from pivot point ( spindle AB)
# to rotation axis ( table C)
-c.newpin("rot_axis_y", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("rot_axis_z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rot_axis_y", hal.Type.REAL, hal.Dir.IN)
+c.newpin("rot_axis_z", hal.Type.REAL, hal.Dir.IN)
# selected kinematics
-c.newpin("kinstype_select", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("kinstype_select", hal.Type.REAL, hal.Dir.IN)
# work piece show/hide
-c.newpin("hide_work_piece_1", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("hide_work_piece_1", hal.Type.BOOL, hal.Dir.IN)
# spindle body show/hide
-c.newpin("hide_spindle_body", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("hide_spindle_body", hal.Type.BOOL, hal.Dir.IN)
# work piece show/hide
-c.newpin("hide_somethingelse", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("hide_somethingelse", hal.Type.BOOL, hal.Dir.IN)
# scale coordinate system indicators
-c.newpin("scale_coords", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("scale_coords", hal.Type.REAL, hal.Dir.IN)
# twp pins
-c.newpin("twp_status", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_defined", hal.HAL_BIT, hal.HAL_IN)
-c.newpin("twp_active", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("twp_status", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_defined", hal.Type.BOOL, hal.Dir.IN)
+c.newpin("twp_active", hal.Type.BOOL, hal.Dir.IN)
# the origin of the twp plane display needs to be independent of the work offsets
# because those offsets change as the kinematic switches between world and tool
-c.newpin("twp_ox_world", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oy_world", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oz_world", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("twp_ox_world", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oy_world", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oz_world", hal.Type.REAL, hal.Dir.IN)
# origin of the twp
-c.newpin("twp_ox", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oz", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("twp_ox", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oz", hal.Type.REAL, hal.Dir.IN)
# normal vector defining the temporary work plane as set by user with G68.2
-c.newpin("twp_zx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_zy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_zz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_xx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_xy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_xz", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("twp_zx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_zy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_zz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_xx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_xy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_xz", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzbca-trsrn-gui.py b/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzbca-trsrn-gui.py
index 1c54ddbd1b2..871c0aa6921 100755
--- a/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzbca-trsrn-gui.py
+++ b/configs/sim/axis/vismach/5axis/table-rotary_spindle-rotary-nutating/vismach/xyzbca-trsrn-gui.py
@@ -42,61 +42,61 @@
c = hal.component("xyzbca-trsrn-gui")
# axis_x
-c.newpin("axis_x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis_x", hal.Type.REAL, hal.Dir.IN)
# axis_y
-c.newpin("axis_y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis_y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("axis_z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis_z", hal.Type.REAL, hal.Dir.IN)
# rotary_a
-c.newpin("rotary_a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary_a", hal.Type.REAL, hal.Dir.IN)
# rotary_b
-c.newpin("rotary_b", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary_b", hal.Type.REAL, hal.Dir.IN)
# rotary_c
-c.newpin("rotary_c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary_c", hal.Type.REAL, hal.Dir.IN)
# nutation-angle
-c.newpin("nutation_angle", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("nutation_angle", hal.Type.REAL, hal.Dir.IN)
# tool offsets
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diameter", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diameter", hal.Type.REAL, hal.Dir.IN)
# geometric offsets in the spindle-rotary-assembly
-c.newpin("pivot_x", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pivot_z", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("offset_x", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("offset_y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("pivot_x", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pivot_z", hal.Type.REAL, hal.Dir.IN)
+c.newpin("offset_x", hal.Type.REAL, hal.Dir.IN)
+c.newpin("offset_y", hal.Type.REAL, hal.Dir.IN)
# rot-point offsets distances from pivot point ( spindle AB)
# to rotation axis ( table C)
-c.newpin("rot_axis_x", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("rot_axis_z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rot_axis_x", hal.Type.REAL, hal.Dir.IN)
+c.newpin("rot_axis_z", hal.Type.REAL, hal.Dir.IN)
# selected kinematics
-c.newpin("kinstype_select", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("kinstype_select", hal.Type.REAL, hal.Dir.IN)
# work piece show/hide
-c.newpin("hide_work_piece_1", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("hide_work_piece_1", hal.Type.BOOL, hal.Dir.IN)
# spindle body show/hide
-c.newpin("hide_spindle_body", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("hide_spindle_body", hal.Type.BOOL, hal.Dir.IN)
# work piece show/hide
-c.newpin("hide_somethingelse", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("hide_somethingelse", hal.Type.BOOL, hal.Dir.IN)
# scale coordinate system indicators
-c.newpin("scale_coords", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("scale_coords", hal.Type.REAL, hal.Dir.IN)
# twp pins
-c.newpin("twp_status", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_defined", hal.HAL_BIT, hal.HAL_IN)
-c.newpin("twp_active", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("twp_status", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_defined", hal.Type.BOOL, hal.Dir.IN)
+c.newpin("twp_active", hal.Type.BOOL, hal.Dir.IN)
# the origin of the twp plane display needs to be independent of the work offsets
# because those offsets change as the kinematic switches between world and tool
-c.newpin("twp_ox_world", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oy_world", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oz_world", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("twp_ox_world", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oy_world", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oz_world", hal.Type.REAL, hal.Dir.IN)
# origin of the twp
-c.newpin("twp_ox", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_oz", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("twp_ox", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_oz", hal.Type.REAL, hal.Dir.IN)
# normal vector defining the temporary work plane as set by user with G68.2
-c.newpin("twp_zx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_zy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_zz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_xx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_xy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("twp_xz", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("twp_zx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_zy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_zz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_xx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_xy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("twp_xz", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/configs/sim/axis/vismach/VMC_toolchange/sim_vmc.hal b/configs/sim/axis/vismach/VMC_toolchange/sim_vmc.hal
index 5c20572f0dc..46b5ccbc628 100644
--- a/configs/sim/axis/vismach/VMC_toolchange/sim_vmc.hal
+++ b/configs/sim/axis/vismach/VMC_toolchange/sim_vmc.hal
@@ -59,12 +59,12 @@ setp carlim.maxv 0.01
net car-vel carlim.in
net car-vel-lim carlim.out carpos.in0
net car-pos carpos.out carpos.in1 vmcgui.carousel
-loadrt conv_float_u32
-addf conv-float-u32.0 servo-thread
-net car-pos conv-float-u32.0.in
+loadrt conv_real_uint
+addf conv-real-uint.0 servo-thread
+net car-pos conv-real-uint.0.in
loadrt bin2gray
addf bin2gray.0 servo-thread
-net sim-pocket-u conv-float-u32.0.out bin2gray.0.in
+net sim-pocket-u conv-real-uint.0.out bin2gray.0.in
loadrt bitslice personality=5
addf bitslice.0 servo-thread
net graycode bin2gray.0.out bitslice.0.in
@@ -76,29 +76,29 @@ net bit3 bitslice.0.out-03
net bit4 bitslice.0.out-04
# pulse and index output variant (untidy modmaths)
-loadrt conv_s32_float count=2
-loadrt conv_float_s32 count=3
+loadrt conv_sint_real count=2
+loadrt conv_real_sint count=3
loadrt near count=3
loadrt scale
-addf conv-s32-float.0 servo-thread
-addf conv-float-s32.0 servo-thread
-addf conv-s32-float.1 servo-thread
-addf conv-float-s32.1 servo-thread
+addf conv-sint-real.0 servo-thread
+addf conv-real-sint.0 servo-thread
+addf conv-sint-real.1 servo-thread
+addf conv-real-sint.1 servo-thread
addf scale.0 servo-thread
addf near.1 servo-thread
addf near.2 servo-thread
-net car-pos conv-float-s32.0.in
-net car-pos-int conv-float-s32.0.out conv-s32-float.0.in
-net car-pos-float conv-s32-float.0.out near.1.in2
+net car-pos conv-real-sint.0.in
+net car-pos-int conv-real-sint.0.out conv-sint-real.0.in
+net car-pos-float conv-sint-real.0.out near.1.in2
net car-pos near.1.in1
net pulse near.1.out
setp near.1.difference 0.01
setp scale.0.gain 0.1
setp scale.0.offset -1 # to show-off index homing
net car-pos scale.0.in
-net car-pos-div10 scale.0.out conv-float-s32.1.in
-net car-pos-div10-int conv-float-s32.1.out conv-s32-float.1.in
-net car-pos-div10-float conv-s32-float.1.out near.2.in2
+net car-pos-div10 scale.0.out conv-real-sint.1.in
+net car-pos-div10-int conv-real-sint.1.out conv-sint-real.1.in
+net car-pos-div10-float conv-sint-real.1.out near.2.in2
net car-pos-div10 near.2.in1
net index near.2.out
setp near.2.difference 0.009
diff --git a/configs/sim/axis/vismach/VMC_toolchange/toolchange_gray.hal b/configs/sim/axis/vismach/VMC_toolchange/toolchange_gray.hal
index bcd57e38856..5d49eccfe67 100644
--- a/configs/sim/axis/vismach/VMC_toolchange/toolchange_gray.hal
+++ b/configs/sim/axis/vismach/VMC_toolchange/toolchange_gray.hal
@@ -1,14 +1,14 @@
loadrt carousel pockets=10 dir=1 encoding=gray num_sense=4
-#loadrt conv_float_s32 (Already loaded in sim_vmc.hal)
+#loadrt conv_real_sint (Already loaded in sim_vmc.hal)
addf carousel.0 servo-thread
-addf conv-float-s32.2 servo-thread # G-code analogue outputs are float-type
+addf conv-real-sint.2 servo-thread # G-code analogue outputs are float-type
setp carousel.0.fwd-dc 0.002
net car-enable motion.digital-out-00 carousel.0.enable
net car-ready carousel.0.ready motion.digital-in-00
net car-vel carousel.0.motor-vel
-net car-pos-req motion.analog-out-00 conv-float-s32.2.in
-net car-pos-s32 conv-float-s32.2.out carousel.0.pocket-number
+net car-pos-req motion.analog-out-00 conv-real-sint.2.in
+net car-pos-s32 conv-real-sint.2.out carousel.0.pocket-number
net bit0 carousel.0.sense-0
net bit1 carousel.0.sense-1
net bit2 carousel.0.sense-2
diff --git a/configs/sim/axis/vismach/VMC_toolchange/toolchange_index.hal b/configs/sim/axis/vismach/VMC_toolchange/toolchange_index.hal
index fe22f8d054c..013f637c185 100644
--- a/configs/sim/axis/vismach/VMC_toolchange/toolchange_index.hal
+++ b/configs/sim/axis/vismach/VMC_toolchange/toolchange_index.hal
@@ -1,7 +1,7 @@
loadrt carousel pockets=10 dir=2 encoding=index
-#loadrt conv_float_s32 (already loaded in sim_vmc.hal)
+#loadrt conv_real_sint (already loaded in sim_vmc.hal)
addf carousel.0 servo-thread
-addf conv-float-s32.2 servo-thread # G-code analogue outputs are float-type
+addf conv-real-sint.2 servo-thread # G-code analogue outputs are float-type
setp carousel.0.fwd-dc 0.002
setp carousel.0.rev-dc -0.002
@@ -10,8 +10,8 @@ setp carousel.0.align-dc 0.0001
net car-enable motion.digital-out-00 carousel.0.enable
net car-ready carousel.0.ready motion.digital-in-00
net car-vel carousel.0.motor-vel
-net car-pos-req motion.analog-out-00 conv-float-s32.2.in
-net car-pos-s32 conv-float-s32.2.out carousel.0.pocket-number
+net car-pos-req motion.analog-out-00 conv-real-sint.2.in
+net car-pos-s32 conv-real-sint.2.out carousel.0.pocket-number
net index carousel.0.sense-0
net pulse carousel.0.sense-1
diff --git a/configs/sim/axis/vismach/VMC_toolchange/vmcgui b/configs/sim/axis/vismach/VMC_toolchange/vmcgui
index 1344cfc1ac1..a471d96e66c 100755
--- a/configs/sim/axis/vismach/VMC_toolchange/vmcgui
+++ b/configs/sim/axis/vismach/VMC_toolchange/vmcgui
@@ -19,14 +19,14 @@ from vismach import *
import hal
c = hal.component("vmcgui")
-c.newpin("X", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("Y", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("Z", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("arm", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("carousel", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("spindle", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("drawbar", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("lock", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("X", hal.Type.REAL, hal.Dir.IN)
+c.newpin("Y", hal.Type.REAL, hal.Dir.IN)
+c.newpin("Z", hal.Type.REAL, hal.Dir.IN)
+c.newpin("arm", hal.Type.REAL, hal.Dir.IN)
+c.newpin("carousel", hal.Type.REAL, hal.Dir.IN)
+c.newpin("spindle", hal.Type.REAL, hal.Dir.IN)
+c.newpin("drawbar", hal.Type.REAL, hal.Dir.IN)
+c.newpin("lock", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/configs/sim/axis/vismach/delta/lineardelta.py b/configs/sim/axis/vismach/delta/lineardelta.py
index d8116b1a895..82b27967400 100755
--- a/configs/sim/axis/vismach/delta/lineardelta.py
+++ b/configs/sim/axis/vismach/delta/lineardelta.py
@@ -26,12 +26,12 @@
for setting in sys.argv[1:]: exec(setting)
c = hal.component("lineardelta")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("R", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("L", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("R", hal.Type.REAL, hal.Dir.IN)
+c.newpin("L", hal.Type.REAL, hal.Dir.IN)
c['R'], c['L'] = lineardeltakins.get_geometry()
c.ready()
diff --git a/configs/sim/axis/vismach/delta/rotarydelta.py b/configs/sim/axis/vismach/delta/rotarydelta.py
index 36d5088f584..b6032be6613 100755
--- a/configs/sim/axis/vismach/delta/rotarydelta.py
+++ b/configs/sim/axis/vismach/delta/rotarydelta.py
@@ -25,13 +25,13 @@
for setting in sys.argv[1:]: exec(setting)
c = hal.component("rotarydelta")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pfr", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tl", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("sl", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("fr", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pfr", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tl", hal.Type.REAL, hal.Dir.IN)
+c.newpin("sl", hal.Type.REAL, hal.Dir.IN)
+c.newpin("fr", hal.Type.REAL, hal.Dir.IN)
c['pfr'], c['tl'], c['sl'], c['fr'] = rotarydeltakins.get_geometry()
c.ready()
diff --git a/configs/sim/axis/vismach/hbm/hbmgui.py b/configs/sim/axis/vismach/hbm/hbmgui.py
index f79862940fa..9d0592d9252 100755
--- a/configs/sim/axis/vismach/hbm/hbmgui.py
+++ b/configs/sim/axis/vismach/hbm/hbmgui.py
@@ -42,13 +42,13 @@ def coords(self):
c = hal.component("hbmgui")
# HAL pins
-c.newpin("table", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("saddle", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("head", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("quill", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table", hal.Type.REAL, hal.Dir.IN)
+c.newpin("saddle", hal.Type.REAL, hal.Dir.IN)
+c.newpin("head", hal.Type.REAL, hal.Dir.IN)
+c.newpin("quill", hal.Type.REAL, hal.Dir.IN)
-c.newpin("tool-length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-radius", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool-length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-radius", hal.Type.REAL, hal.Dir.IN)
c.ready()
tool_radius=0.5
diff --git a/configs/sim/axis/vismach/hexapod-sim/hexagui.py b/configs/sim/axis/vismach/hexapod-sim/hexagui.py
index 82ce7717fcd..3ab256bff5f 100755
--- a/configs/sim/axis/vismach/hexapod-sim/hexagui.py
+++ b/configs/sim/axis/vismach/hexapod-sim/hexagui.py
@@ -19,20 +19,20 @@
#if(randomize): compname += str(random.randrange(0,10000))
c = hal.component(compname)
#declare hal pins here
-c.newpin("joint.0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.5", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint.0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.5", hal.Type.REAL, hal.Dir.IN)
#get the tool tip position in cartesian coordinates from emc
#so we dont have to do kinematics
-c.newpin("axis.x", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.y", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.z", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.a", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.b", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis.x", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.y", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.z", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.a", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.b", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.c", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/configs/sim/axis/vismach/melfa-sim/melfagui.py b/configs/sim/axis/vismach/melfa-sim/melfagui.py
index 0471a87e287..5bfe568d3dd 100755
--- a/configs/sim/axis/vismach/melfa-sim/melfagui.py
+++ b/configs/sim/axis/vismach/melfa-sim/melfagui.py
@@ -9,15 +9,15 @@
import hal
c = hal.component("melfagui")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("lnkdx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("lnkdz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("grip", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
+c.newpin("lnkdx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("lnkdz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("grip", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/configs/sim/axis/vismach/millturn/millturngui.py b/configs/sim/axis/vismach/millturn/millturngui.py
index 865b99f18eb..bed3bd0dd23 100755
--- a/configs/sim/axis/vismach/millturn/millturngui.py
+++ b/configs/sim/axis/vismach/millturn/millturngui.py
@@ -24,18 +24,18 @@
# in this file, and uncomment last line in HAL file.
# add joints. Mill has 3.
c = hal.component("millturngui")
-c.newpin("jointX", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointY", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointZ", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointA", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("jointX", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointY", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointZ", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointA", hal.Type.REAL, hal.Dir.IN)
# kinematics pins
-c.newpin("millkins", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("millkins", hal.Type.BOOL, hal.Dir.IN)
# tool length and diameter pins?
-c.newpin("toollength", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tooldiameter", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-x-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("toollength", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tooldiameter", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-x-offset", hal.Type.REAL, hal.Dir.IN)
# tells loadusr pins is ready
c.ready()
diff --git a/configs/sim/axis/vismach/orphaned models/maho600gui.py b/configs/sim/axis/vismach/orphaned models/maho600gui.py
index 285ee079d49..a94094bc024 100755
--- a/configs/sim/axis/vismach/orphaned models/maho600gui.py
+++ b/configs/sim/axis/vismach/orphaned models/maho600gui.py
@@ -37,19 +37,19 @@ def coords(self):
c = hal.component("maho600gui")
# table
-c.newpin("table", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table", hal.Type.REAL, hal.Dir.IN)
# full width ways that table rides one
# this assembly moves up and down for Y
-c.newpin("tableway", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tableway", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("head", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("head", hal.Type.REAL, hal.Dir.IN)
# head tilt
-c.newpin("arotate", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("arotate", hal.Type.REAL, hal.Dir.IN)
# rotary table
-c.newpin("brotate", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("brotate", hal.Type.REAL, hal.Dir.IN)
-c.newpin("tool-length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-radius", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool-length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-radius", hal.Type.REAL, hal.Dir.IN)
c.ready()
pivot_len=100
diff --git a/configs/sim/axis/vismach/puma/puma560gui.py b/configs/sim/axis/vismach/puma/puma560gui.py
index d07848e914d..bccd2fadcac 100755
--- a/configs/sim/axis/vismach/puma/puma560gui.py
+++ b/configs/sim/axis/vismach/puma/puma560gui.py
@@ -23,13 +23,13 @@
import hal
c = hal.component("puma560gui")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("grip", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
+c.newpin("grip", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/configs/sim/axis/vismach/puma/pumagui.py b/configs/sim/axis/vismach/puma/pumagui.py
index 7ae1d682b91..d43916f21e8 100755
--- a/configs/sim/axis/vismach/puma/pumagui.py
+++ b/configs/sim/axis/vismach/puma/pumagui.py
@@ -45,12 +45,12 @@
import hal
c = hal.component("pumagui")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
c.ready()
###################
diff --git a/configs/sim/axis/vismach/scara/scaragui.py b/configs/sim/axis/vismach/scara/scaragui.py
index d9998c4b56a..482bab168b5 100755
--- a/configs/sim/axis/vismach/scara/scaragui.py
+++ b/configs/sim/axis/vismach/scara/scaragui.py
@@ -22,12 +22,12 @@
import sys
c = hal.component("scaragui")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
c.ready()
# parameters that define the geometry see scarakins.c for definitions these
diff --git a/configs/sim/gmoccapy/lathe_configs/lathehandler.py b/configs/sim/gmoccapy/lathe_configs/lathehandler.py
index 6e3fcdadb9e..b8ae574d4b0 100755
--- a/configs/sim/gmoccapy/lathe_configs/lathehandler.py
+++ b/configs/sim/gmoccapy/lathe_configs/lathehandler.py
@@ -102,7 +102,7 @@ def __init__(self, halcomp,builder,useropts):
self.ini.restore_state(self)
# A pin to use a physical switch to start the cycle
- self.cycle_start = hal_glib.GPin(halcomp.newpin('cycle-start', hal.HAL_BIT, hal.HAL_IN))
+ self.cycle_start = hal_glib.GPin(halcomp.newpin('cycle-start', hal.Type.BOOL, hal.Dir.IN))
self.cycle_start.connect('value-changed', self.cycle_pin)
# This catches the signal from Touchy to say that the tab is exposed
diff --git a/configs/sim/gmoccapy/non_trivial_kinematics/scara/scaragui.py b/configs/sim/gmoccapy/non_trivial_kinematics/scara/scaragui.py
index d9998c4b56a..482bab168b5 100755
--- a/configs/sim/gmoccapy/non_trivial_kinematics/scara/scaragui.py
+++ b/configs/sim/gmoccapy/non_trivial_kinematics/scara/scaragui.py
@@ -22,12 +22,12 @@
import sys
c = hal.component("scaragui")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
c.ready()
# parameters that define the geometry see scarakins.c for definitions these
diff --git a/configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt-gui.py b/configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt-gui.py
index 98f267355d1..2283299ea80 100755
--- a/configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt-gui.py
+++ b/configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt-gui.py
@@ -30,19 +30,19 @@
c = hal.component("xyzac-trt-gui")
# table-x
-c.newpin("table-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table-x", hal.Type.REAL, hal.Dir.IN)
# saddle-y
-c.newpin("saddle-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle-y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("spindle-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("spindle-z", hal.Type.REAL, hal.Dir.IN)
# table-x tilt-b
-c.newpin("tilt-a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt-a", hal.Type.REAL, hal.Dir.IN)
# rotary table-x
-c.newpin("rotate-c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate-c", hal.Type.REAL, hal.Dir.IN)
# offsets
-c.newpin("y-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("y-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-offset", hal.Type.REAL, hal.Dir.IN)
c.ready()
for setting in sys.argv[1:]: exec(setting)
diff --git a/configs/sim/gmoccapy/plasma_config/plasma.py b/configs/sim/gmoccapy/plasma_config/plasma.py
index 1b798492367..a213d71388d 100644
--- a/configs/sim/gmoccapy/plasma_config/plasma.py
+++ b/configs/sim/gmoccapy/plasma_config/plasma.py
@@ -94,12 +94,12 @@ def __init__(self, halcomp, builder, useropts):
self.ini.restore_state(self)
# lets make our pins
- self.THC_speed = hal_glib.GPin(halcomp.newpin("THC-Speed", hal.HAL_FLOAT, hal.HAL_OUT))
- self.cut_gap = hal_glib.GPin(halcomp.newpin("Cut-Gap", hal.HAL_FLOAT, hal.HAL_OUT))
- self.g0_gap = hal_glib.GPin(halcomp.newpin("G0-Gap", hal.HAL_FLOAT, hal.HAL_OUT))
- self.pierce_deley = hal_glib.GPin(halcomp.newpin("Pierce-Delay", hal.HAL_FLOAT, hal.HAL_OUT))
- self.pierce_gap = hal_glib.GPin(halcomp.newpin("Pierce-Gap", hal.HAL_FLOAT, hal.HAL_OUT))
- self.target_voltage = hal_glib.GPin(halcomp.newpin("Target-Voltage", hal.HAL_FLOAT, hal.HAL_OUT))
+ self.THC_speed = hal_glib.GPin(halcomp.newpin("THC-Speed", hal.Type.REAL, hal.Dir.OUT))
+ self.cut_gap = hal_glib.GPin(halcomp.newpin("Cut-Gap", hal.Type.REAL, hal.Dir.OUT))
+ self.g0_gap = hal_glib.GPin(halcomp.newpin("G0-Gap", hal.Type.REAL, hal.Dir.OUT))
+ self.pierce_deley = hal_glib.GPin(halcomp.newpin("Pierce-Delay", hal.Type.REAL, hal.Dir.OUT))
+ self.pierce_gap = hal_glib.GPin(halcomp.newpin("Pierce-Gap", hal.Type.REAL, hal.Dir.OUT))
+ self.target_voltage = hal_glib.GPin(halcomp.newpin("Target-Voltage", hal.Type.REAL, hal.Dir.OUT))
# get all widgets and connect them
self.lbl_prog_volt = self.builder.get_object("lbl_prog_volt")
diff --git a/configs/sim/pyvcp_demo.xml b/configs/sim/pyvcp_demo.xml
index 4b986647a7a..561531e3707 100644
--- a/configs/sim/pyvcp_demo.xml
+++ b/configs/sim/pyvcp_demo.xml
@@ -6,7 +6,7 @@
-
+
@@ -15,7 +15,7 @@
-
+
@@ -33,7 +33,7 @@
-
+
@@ -52,7 +52,7 @@
-
+
diff --git a/configs/sim/qtvcp_screens/qtvcp_experimental/lathehandler.py b/configs/sim/qtvcp_screens/qtvcp_experimental/lathehandler.py
index 3533b4b167b..4997894099e 100644
--- a/configs/sim/qtvcp_screens/qtvcp_experimental/lathehandler.py
+++ b/configs/sim/qtvcp_screens/qtvcp_experimental/lathehandler.py
@@ -88,11 +88,11 @@ def __init__(self, halcomp,builder,useropts):
self.ini.restore_state(self)
# A pin to use a physical switch to start the cycle
- self.cycle_start = hal_glib.GPin(halcomp.newpin('cycle-start', hal.HAL_BIT, hal.HAL_IN))
+ self.cycle_start = hal_glib.GPin(halcomp.newpin('cycle-start', hal.Type.BOOL, hal.Dir.IN))
self.cycle_start.connect('value-changed', self.cycle_pin)
# A pin to mask cycle-start so that Touchy doesn't run auto.
- self.visible = hal_glib.GPin(halcomp.newpin('visible', hal.HAL_BIT, hal.HAL_OUT))
+ self.visible = hal_glib.GPin(halcomp.newpin('visible', hal.Type.BOOL, hal.Dir.OUT))
# This catches the signal from Touchy to say that the tab is exposed
t = self.builder.get_object('eventbox1')
diff --git a/configs/sim/woodpecker/1280x1024_5axis/woodpecker_handler.py b/configs/sim/woodpecker/1280x1024_5axis/woodpecker_handler.py
index 4efd28be1c6..49733bed371 100644
--- a/configs/sim/woodpecker/1280x1024_5axis/woodpecker_handler.py
+++ b/configs/sim/woodpecker/1280x1024_5axis/woodpecker_handler.py
@@ -297,14 +297,14 @@ def init_pins(self):
pin.value_changed.connect(self.map_ready_changed)
QHAL.newpin("comp-on", Qhal.HAL_BIT, Qhal.HAL_OUT)
- self.pin_mpg_in = self.h.newpin('mpg-in',hal.HAL_S32, hal.HAL_IN)
+ self.pin_mpg_in = self.h.newpin('mpg-in',hal.Type.SINT, hal.Dir.IN)
self.pin_mpg_in.value_changed.connect(lambda s: self.external_mpg(s))
- self.wheel_x = self.h.newpin('jog.wheel.x',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_y = self.h.newpin('jog.wheel.y',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_z = self.h.newpin('jog.wheel.z',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_a = self.h.newpin('jog.wheel.a',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_b = self.h.newpin('jog.wheel.b',hal.HAL_BIT, hal.HAL_OUT)
- self.jog_increment = self.h.newpin('jog.wheel.incement',hal.HAL_FLOAT, hal.HAL_OUT)
+ self.wheel_x = self.h.newpin('jog.wheel.x',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_y = self.h.newpin('jog.wheel.y',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_z = self.h.newpin('jog.wheel.z',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_a = self.h.newpin('jog.wheel.a',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_b = self.h.newpin('jog.wheel.b',hal.Type.BOOL, hal.Dir.OUT)
+ self.jog_increment = self.h.newpin('jog.wheel.incement',hal.Type.REAL, hal.Dir.OUT)
# MPG axis select pins
pin = QHAL.newpin("axis-select-x", Qhal.HAL_BIT, Qhal.HAL_IN)
diff --git a/configs/sim/woodpecker/compensate.py b/configs/sim/woodpecker/compensate.py
index 1c3bdbe3f5a..06cd082a320 100755
--- a/configs/sim/woodpecker/compensate.py
+++ b/configs/sim/woodpecker/compensate.py
@@ -119,15 +119,15 @@ def compensate(self):
def run(self):
self.h = hal.component("compensate")
- self.h.newpin("enable-in", hal.HAL_BIT, hal.HAL_IN)
- self.h.newpin("map-ready", hal.HAL_BIT, hal.HAL_OUT)
- self.h.newpin("scale", hal.HAL_FLOAT, hal.HAL_OUT)
- self.h.newpin("counts", hal.HAL_S32, hal.HAL_OUT)
- self.h.newpin("clear", hal.HAL_BIT, hal.HAL_IN)
- self.h.newpin("x-pos", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("y-pos", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("z-pos", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("fade-height", hal.HAL_FLOAT, hal.HAL_IN)
+ self.h.newpin("enable-in", hal.Type.BOOL, hal.Dir.IN)
+ self.h.newpin("map-ready", hal.Type.BOOL, hal.Dir.OUT)
+ self.h.newpin("scale", hal.Type.REAL, hal.Dir.OUT)
+ self.h.newpin("counts", hal.Type.SINT, hal.Dir.OUT)
+ self.h.newpin("clear", hal.Type.BOOL, hal.Dir.IN)
+ self.h.newpin("x-pos", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("y-pos", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("z-pos", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("fade-height", hal.Type.REAL, hal.Dir.IN)
self.h.ready()
self.stat = linuxcnc.stat()
diff --git a/configs/sim/woodpecker/numstr.py b/configs/sim/woodpecker/numstr.py
index 5ebaeeb32d4..77fa59a0f7e 100644
--- a/configs/sim/woodpecker/numstr.py
+++ b/configs/sim/woodpecker/numstr.py
@@ -2,7 +2,7 @@
import hal
import time
h = hal.component("numstr")
-h.newpin("in", hal.HAL_S32, hal.HAL_IN)
+h.newpin("in", hal.Type.SINT, hal.Dir.IN)
h.ready()
tmp = 0
try:
diff --git a/configs/sim/woodpecker/python/stdglue.py b/configs/sim/woodpecker/python/stdglue.py
index ea32910bece..12cf833a7ec 100644
--- a/configs/sim/woodpecker/python/stdglue.py
+++ b/configs/sim/woodpecker/python/stdglue.py
@@ -33,8 +33,8 @@ def build_hal(self):
import hal
try:
h=hal.component('remapStat')
- h.newpin("tool", hal.HAL_S32, hal.HAL_OUT)
- h.newpin("wear", hal.HAL_S32, hal.HAL_OUT)
+ h.newpin("tool", hal.Type.SINT, hal.Dir.OUT)
+ h.newpin("wear", hal.Type.SINT, hal.Dir.OUT)
h.ready()
self.hal_tool_comp = h
except Exception as e:
diff --git a/configs/sim/woodpecker/woodpecker_/woodpecker_handler.py b/configs/sim/woodpecker/woodpecker_/woodpecker_handler.py
index d0d343a8ddd..ee580b11499 100644
--- a/configs/sim/woodpecker/woodpecker_/woodpecker_handler.py
+++ b/configs/sim/woodpecker/woodpecker_/woodpecker_handler.py
@@ -151,29 +151,29 @@ def initialized__(self):
#############################
def init_pins(self):
# spindle control pins
- pin = self.h.newpin("spindle_amps", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.h.newpin("spindle_amps", hal.Type.REAL, hal.Dir.IN)
pin.value_changed.connect(self.spindle_pwr_changed)
- pin = self.h.newpin("spindle_volts", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.h.newpin("spindle_volts", hal.Type.REAL, hal.Dir.IN)
pin.value_changed.connect(self.spindle_pwr_changed)
- pin = self.h.newpin("spindle_fault", hal.HAL_U32, hal.HAL_IN)
+ pin = self.h.newpin("spindle_fault", hal.Type.UINT, hal.Dir.IN)
pin.value_changed.connect(self.spindle_fault_changed)
- pin = self.h.newpin("modbus-errors", hal.HAL_U32, hal.HAL_IN)
+ pin = self.h.newpin("modbus-errors", hal.Type.UINT, hal.Dir.IN)
pin.value_changed.connect(self.mb_errors_changed)
- # self.h.newpin("spindle_pause", hal.HAL_BIT, hal.HAL_OUT)
+ # self.h.newpin("spindle_pause", hal.Type.BOOL, hal.Dir.OUT)
# external offset control pins
- self.h.newpin("eoffset_enable", hal.HAL_BIT, hal.HAL_OUT)
- self.h.newpin("eoffset_clear", hal.HAL_BIT, hal.HAL_OUT)
- self.h.newpin("eoffset_count", hal.HAL_S32, hal.HAL_OUT)
- pin = self.h.newpin("eoffset_value", hal.HAL_FLOAT, hal.HAL_IN)
+ self.h.newpin("eoffset_enable", hal.Type.BOOL, hal.Dir.OUT)
+ self.h.newpin("eoffset_clear", hal.Type.BOOL, hal.Dir.OUT)
+ self.h.newpin("eoffset_count", hal.Type.SINT, hal.Dir.OUT)
+ pin = self.h.newpin("eoffset_value", hal.Type.REAL, hal.Dir.IN)
pin.value_changed.connect(self.eoffset_changed)
- self.pin_mpg_in = self.h.newpin('mpg-in',hal.HAL_S32, hal.HAL_IN)
+ self.pin_mpg_in = self.h.newpin('mpg-in',hal.Type.SINT, hal.Dir.IN)
self.pin_mpg_in.value_changed.connect(lambda s: self.external_mpg(s))
- self.wheel_x = self.h.newpin('jog.wheel.x',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_y = self.h.newpin('jog.wheel.y',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_z = self.h.newpin('jog.wheel.z',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_a = self.h.newpin('jog.wheel.a',hal.HAL_BIT, hal.HAL_OUT)
- self.jog_increment = self.h.newpin('jog.wheel.incement',hal.HAL_FLOAT, hal.HAL_OUT)
+ self.wheel_x = self.h.newpin('jog.wheel.x',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_y = self.h.newpin('jog.wheel.y',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_z = self.h.newpin('jog.wheel.z',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_a = self.h.newpin('jog.wheel.a',hal.Type.BOOL, hal.Dir.OUT)
+ self.jog_increment = self.h.newpin('jog.wheel.incement',hal.Type.REAL, hal.Dir.OUT)
def init_preferences(self):
if not self.w.PREFS_:
diff --git a/debian/tests/linuxcnc-test-ui.py b/debian/tests/linuxcnc-test-ui.py
index 57e3871c667..c08d729ffd4 100755
--- a/debian/tests/linuxcnc-test-ui.py
+++ b/debian/tests/linuxcnc-test-ui.py
@@ -21,10 +21,10 @@
# Create and connect test feedback comp
#
h = hal.component("test-ui")
-h.newpin("Xpos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("Ypos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("Zpos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("counter", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("Xpos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("Ypos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("Zpos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("counter", hal.Type.REAL, hal.Dir.IN)
h.ready()
os.system("halcmd source ./linuxcnc-test.hal")
diff --git a/docs/po4a.cfg b/docs/po4a.cfg
index 85f3cf55eef..0ec43a54a0d 100644
--- a/docs/po4a.cfg
+++ b/docs/po4a.cfg
@@ -415,17 +415,17 @@
[type: man_def] build/man/man9/clarke3.9 $lang:build/man/$lang/man9/clarke3.9
[type: man_def] build/man/man9/clarkeinv.9 $lang:build/man/$lang/man9/clarkeinv.9
[type: man_def] build/man/man9/comp.9 $lang:build/man/$lang/man9/comp.9
-[type: man_def] build/man/man9/conv_bit_float.9 $lang:build/man/$lang/man9/conv_bit_float.9
-[type: man_def] build/man/man9/conv_bit_s32.9 $lang:build/man/$lang/man9/conv_bit_s32.9
-[type: man_def] build/man/man9/conv_bit_u32.9 $lang:build/man/$lang/man9/conv_bit_u32.9
-[type: man_def] build/man/man9/conv_float_s32.9 $lang:build/man/$lang/man9/conv_float_s32.9
-[type: man_def] build/man/man9/conv_float_u32.9 $lang:build/man/$lang/man9/conv_float_u32.9
-[type: man_def] build/man/man9/conv_s32_bit.9 $lang:build/man/$lang/man9/conv_s32_bit.9
-[type: man_def] build/man/man9/conv_s32_float.9 $lang:build/man/$lang/man9/conv_s32_float.9
-[type: man_def] build/man/man9/conv_s32_u32.9 $lang:build/man/$lang/man9/conv_s32_u32.9
-[type: man_def] build/man/man9/conv_u32_bit.9 $lang:build/man/$lang/man9/conv_u32_bit.9
-[type: man_def] build/man/man9/conv_u32_float.9 $lang:build/man/$lang/man9/conv_u32_float.9
-[type: man_def] build/man/man9/conv_u32_s32.9 $lang:build/man/$lang/man9/conv_u32_s32.9
+[type: man_def] build/man/man9/conv_bool_real.9 $lang:build/man/$lang/man9/conv_bool_real.9
+[type: man_def] build/man/man9/conv_bool_sint.9 $lang:build/man/$lang/man9/conv_bool_sint.9
+[type: man_def] build/man/man9/conv_bool_uint.9 $lang:build/man/$lang/man9/conv_bool_uint.9
+[type: man_def] build/man/man9/conv_real_sint.9 $lang:build/man/$lang/man9/conv_real_sint.9
+[type: man_def] build/man/man9/conv_real_uint.9 $lang:build/man/$lang/man9/conv_real_uint.9
+[type: man_def] build/man/man9/conv_sint_bool.9 $lang:build/man/$lang/man9/conv_sint_bool.9
+[type: man_def] build/man/man9/conv_sint_real.9 $lang:build/man/$lang/man9/conv_sint_real.9
+[type: man_def] build/man/man9/conv_sint_uint.9 $lang:build/man/$lang/man9/conv_sint_uint.9
+[type: man_def] build/man/man9/conv_uint_bool.9 $lang:build/man/$lang/man9/conv_uint_bool.9
+[type: man_def] build/man/man9/conv_uint_real.9 $lang:build/man/$lang/man9/conv_uint_real.9
+[type: man_def] build/man/man9/conv_uint_sint.9 $lang:build/man/$lang/man9/conv_uint_sint.9
[type: man_def] build/man/man9/corexy_by_hal.9 $lang:build/man/$lang/man9/corexy_by_hal.9
[type: man_def] build/man/man9/dbounce.9 $lang:build/man/$lang/man9/dbounce.9
[type: man_def] build/man/man9/ddt.9 $lang:build/man/$lang/man9/ddt.9
diff --git a/docs/src/config/ini-homing.adoc b/docs/src/config/ini-homing.adoc
index 7f99d8552de..b55b332bf73 100644
--- a/docs/src/config/ini-homing.adoc
+++ b/docs/src/config/ini-homing.adoc
@@ -358,17 +358,17 @@ Example: Synced joints 0,1 using negative sequence (-1) for synchronized homing
[source,hal]
----
loadrt mux2 names=home_sequence_mux
-loadrt conv_float_s32 names=home_sequence_s32
+loadrt conv_real_sint names=home_sequence_sint
setp home_sequence_mux.in0 -1
setp home_sequence_mux.in1 1
addf home_sequence_mux servo-thread
-addf home_sequence_s32 servo-thread
+addf home_sequence_sint servo-thread
...
net home_seq_float <= home_sequence_mux.out
-net home_seq_float => home_sequence_s32.in
-net home_seq_s32 <= home_sequence_s32.out
-net home_seq_s32 => ini.0.home_sequence
-net home_seq_s32 => ini.1.home_sequence
+net home_seq_float => home_sequence_sint.in
+net home_seq_sint <= home_sequence_sint.out
+net home_seq_sint => ini.0.home_sequence
+net home_seq_sint => ini.1.home_sequence
...
# allow_jjog: pin created by a virtual panel or hardware switch
net hsequence_select <= allow_jjog
diff --git a/docs/src/config/python-hal-interface.adoc b/docs/src/config/python-hal-interface.adoc
index 00ec2cf878e..57b98942156 100644
--- a/docs/src/config/python-hal-interface.adoc
+++ b/docs/src/config/python-hal-interface.adoc
@@ -71,8 +71,6 @@ The `hal.Type` enum is used to specify the type of pin, parameter and signal:
* `hal.Type.UINT` - An unsigned quantity with range 0...+2^64^-1
* `hal.Type.REAL` - A floating point quantity of range ±1.80×10^308^
* `hal.Type.PORT` - An opaque quantity representing a communication channel (pins only)
-* `hal.Type.S32` - A signed quantity with range -2^31^...+2^31^-1 (see notes below)
-* `hal.Type.U32` - An unsigned quantity with range 0...+2^32^-1 (see notes below)
There are aliases in the `hal.Type` enum for all types with the `HAL_` prefix (e.g. `hal.Type.HAL_BOOL`, etc.).
@@ -82,13 +80,6 @@ The constants previously used (`hal.HAL_BIT`, `hal.HAL_FLOAT`, etc.) are still a
You should upgrade your code to use the enumerated types with the new names instead.
====
-[IMPORTANT]
-====
-The 32-bit types will soon be replaced by 64-bit types.
-The names will remain for some time, but they will map to the larger type automatically.
-The `S32` and `U32` names will then no longer be unique and the range will be larger.
-====
-
==== HAL direction
Just like types, `hal.Dir` enum is the enumeration to specify direction of pins and parameters.
@@ -105,7 +96,7 @@ Also the direction enums are available with the `HAL_` prefix (like `hal.Dir.HAL
==== Old style HAL constants (deprecated)
Old style constants (deprecated):
-`hal.HAL_BIT`, `hal.HAL_S32`, `hal.HAL_U32`, `hal.HAL_S64`, `hal.HAL_U64`, `hal.HAL_FLOAT`, `hal.HAL_PORT`.
+`hal.HAL_BIT`, `hal.HAL_S64`, `hal.HAL_U64`, `hal.HAL_FLOAT`, `hal.HAL_PORT`.
Old style deprecated pin direction constants (deprecated):
`hal.HAL_IN`, `hal.HAL_OUT`, `hal.HAL_IO`.
diff --git a/docs/src/drivers/mesa_modbus.adoc b/docs/src/drivers/mesa_modbus.adoc
index 8e118b49883..4040b5cfb5a 100644
--- a/docs/src/drivers/mesa_modbus.adoc
+++ b/docs/src/drivers/mesa_modbus.adoc
@@ -103,10 +103,10 @@ from HAL and pass them to the Modbus device.
Modbus *read* commands will read data from the device and pass that to
HAL *output* pins for use by other components.
-HAL_BIT, HAL_U32 and HAL_S32 pins will present the (16 bit) Modbus
+HAL_BOOL, HAL_UINT and HAL_SINT pins will present the (16 bit) Modbus
registers exactly as the bits are delivered from the device and will
send them to the device as 16 bit values according to standard C type
-conversion standards. HAL_FLOAT values are treated differently. When a
+conversion standards. HAL_REAL values are treated differently. When a
float pin is specified then two extra HAL pins are created with the
same name but suffixed with -scale and offset. The value from the
modbus register will be interpreted as a sighed-16 bit number. It will
@@ -118,7 +118,7 @@ The reverse transformation is performed when writing to the device.
All Modbus registers are 16 bits. It is possible that in some applications
this might be used to represent encoder counts or some other number that
-will wrap-around. To circumvent this problem in the case of the HAL_S32
+will wrap-around. To circumvent this problem in the case of the HAL_SINT
pin type the registers will be promoted to signed 64-bit internally then
multiplied by the "scale" pin value and presented as a floating point
value on a HAL pin with the suffix "scaled".
@@ -193,7 +193,7 @@ The format of the channel descriptors is:
{TYPE, FUNC, ADDR, COUNT, pin_name}
-TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32
+TYPE is one of HAL_BOOL, HAL_REAL, HAL_SINT, HAL_UINT
FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands
COUNT = number of coils/registers to read
*/
@@ -203,21 +203,21 @@ COUNT = number of coils/registers to read
static const hm2_modbus_chan_descriptor_t channels[] = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
// Create 8 HAL bit pins coil-00 .. -07 supplying the values of coils at 0x0000
- {HAL_BIT, 1, 0x0000, 8, "coil"},
+ {HAL_BOOL, 1, 0x0000, 8, "coil"},
// Create 8 HAL bit pins input-00 .. -07 supplying the values of inputs at 0x0000
- {HAL_BIT, 2, 0x0000, 8, "input"},
+ {HAL_BOOL, 2, 0x0000, 8, "input"},
// Create a HAL pin to set the coil at address 0x0010
- {HAL_BIT, 5, 0x0010, 1, "coil-0"},
+ {HAL_BOOL, 5, 0x0010, 1, "coil-0"},
// Create 8 HAL pins to set the coils at 0x0020
- {HAL_BIT, 15, 0x0020, 8, "more_coils"},
+ {HAL_BOOL, 15, 0x0020, 8, "more_coils"},
// Create a scaled floating point pin calculated from input register 0x0100
- {HAL_FLOAT, 4, 0x0100, 1, "float"},
+ {HAL_REAL, 4, 0x0100, 1, "float"},
// Create 4 unsigned integer HAL pins from the holding registers at 0x0200-0x203
- {HAL_S32, 3, 0x0003, 4, "holding"},
+ {HAL_SINT, 3, 0x0003, 4, "holding"},
// Create a single signed int HAL pin to control the register at 0x0300
- {HAL_S32, 6, 0x0300, 1, "relay-3"},
+ {HAL_SINT, 6, 0x0300, 1, "relay-3"},
// Create 7 scaled FP HAL pins to control holfing registers at 0x400-0x406
- {HAL_FLOAT, 16, 0x0300, 1, "more_floats"},
+ {HAL_REAL, 16, 0x0300, 1, "more_floats"},
};
----
@@ -252,12 +252,12 @@ would suffice
----
static const hm2_modbus_chan_descriptor_t channels[] = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
- {HAL_FLOAT, 3, 0x0000, 1, "volts"},
+ {HAL_REAL, 3, 0x0000, 1, "volts"},
};
----
-The valid HAL pin types supported are HAL_BIT, HAL_FLOAT, HAL_U32 and
-HAL_S32.
+The valid HAL pin types supported are HAL_BOOL, HAL_REAL, HAL_UINT and
+HAL_SINT.
The supported Modbus command types are:
diff --git a/docs/src/gui/axis.adoc b/docs/src/gui/axis.adoc
index 81c50d8e6d5..6a49bf32d26 100644
--- a/docs/src/gui/axis.adoc
+++ b/docs/src/gui/axis.adoc
@@ -1194,7 +1194,7 @@ commands.set_view_z()
[source,python]
----
def user_hal_pins():
- comp.newpin('my-new-in-pin', hal.HAL_BIT, hal.HAL_IN)
+ comp.newpin('my-new-in-pin', hal.Type.BOOL, hal.Dir.IN)
comp.ready()
----
@@ -1205,13 +1205,13 @@ def user_hal_pins():
# create a component
mycomp = hal.component('my_component')
-mycomp.newpin('idle-led',hal.HAL_BIT,hal.HAL_IN)
-mycomp.newpin('pause-led',hal.HAL_BIT,hal.HAL_IN)
+mycomp.newpin('idle-led', hal.Type.BOOL, hal.Dir.IN)
+mycomp.newpin('pause-led', hal.Type.BOOL, hal.Dir.IN)
mycomp.ready()
# connect pins
-hal.new_sig('idle-led',hal.HAL_BIT)
+hal.new_sig('idle-led', hal.Type.BOOL)
hal.connect('halui.program.is-idle','idle-led')
hal.connect('my_component.idle-led','idle-led')
diff --git a/docs/src/gui/gladevcp.adoc b/docs/src/gui/gladevcp.adoc
index b6a085afd49..9ed0faf49d8 100644
--- a/docs/src/gui/gladevcp.adoc
+++ b/docs/src/gui/gladevcp.adoc
@@ -2618,7 +2618,7 @@ If you need HAL pins which are not associated with a specific HAL widget, add th
import hal_glib
...
# in your handler class __init__():
-self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.HAL_BIT, hal.HAL_IN))
+self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.Type.BOOL, hal.Dir.IN))
----
To get a callback when this pin's value changes, associate a `value-change` callback with this pin, add:
@@ -2681,7 +2681,7 @@ class HandlerClass:
# HAL pin with change callback.
# When the pin's value changes the callback is executed.
- self.max_value = hal_glib.GPin(halcomp.newpin('max-value', hal.HAL_FLOAT, hal.HAL_IN))
+ self.max_value = hal_glib.GPin(halcomp.newpin('max-value', hal.Type.REAL, hal.Dir.IN))
self.max_value.connect('value-changed', self._on_max_value_change)
inifile = linuxcnc.ini(os.getenv("INI_FILE_NAME"))
@@ -2713,7 +2713,7 @@ Then make a pin and connect a 'value-changed' (the watcher) signal to a function
----
class HandlerClass:
def __init__(self, halcomp,builder,useropts):
- self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.HAL_BIT, hal.HAL_IN))
+ self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.Type.BOOL, hal.Dir.IN))
self.example_trigger.connect('value-changed', self._on_example_trigger_change)
----
diff --git a/docs/src/gui/gstat.adoc b/docs/src/gui/gstat.adoc
index 11b558d0193..c4455ec6aaa 100644
--- a/docs/src/gui/gstat.adoc
+++ b/docs/src/gui/gstat.adoc
@@ -68,8 +68,8 @@ def mode_changed(obj, data):
# Make a component and pins
h = hal.component("metric_status")
-h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("g20", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("g21", hal.Type.BOOL, hal.Dir.OUT)
h.ready()
# connect a GSTAT message to a callback function
diff --git a/docs/src/gui/qtdragon.adoc b/docs/src/gui/qtdragon.adoc
index 692eac20a5d..f56c36309c7 100644
--- a/docs/src/gui/qtdragon.adoc
+++ b/docs/src/gui/qtdragon.adoc
@@ -945,13 +945,13 @@ Currently the probe tool number is only editable in the preference file: +
ps_probe_tool = 1
----
-`qtversaprobe.enable` (HAL_BIT):: Measurement enabled or not tool. Reflects screen button state.
-`qtversaprobe.blockheight` (HAL_FLOAT):: The measured height of the top face of the workpiece. Reflects screen entry.
-`qtversaprobe.probeheight` (HAL_FLOAT):: The toolsetter probe switch height. Reflects screen entry.
-`qtversaprobe.searchvel` (HAL_FLOAT):: The velocity to search for the tool probe switch
-`qtversaprobe.probevel` (HAL_FLOAT):: The velocity to probe tool length. Reflects screen entry.
-`qtversaprobe.backoffdist` (HAL_FLOAT):: The distance the probe backs off after triggering. Reflects screen entry.
-`qtversaprobe.probe-loaded` (HAL_BIT):: Reflect if the current tool is equal to the preference file probe number.
+`qtversaprobe.enable` (HAL_BOOL):: Measurement enabled or not tool. Reflects screen button state.
+`qtversaprobe.blockheight` (HAL_REAL):: The measured height of the top face of the workpiece. Reflects screen entry.
+`qtversaprobe.probeheight` (HAL_REAL):: The toolsetter probe switch height. Reflects screen entry.
+`qtversaprobe.searchvel` (HAL_REAL):: The velocity to search for the tool probe switch
+`qtversaprobe.probevel` (HAL_REAL):: The velocity to probe tool length. Reflects screen entry.
+`qtversaprobe.backoffdist` (HAL_REAL):: The distance the probe backs off after triggering. Reflects screen entry.
+`qtversaprobe.probe-loaded` (HAL_BOOL):: Reflect if the current tool is equal to the preference file probe number.
=== Basic probe
@@ -1242,12 +1242,12 @@ Initial testing with no tool and safe heights is recommended.
Versaprobe offers 5 output pins for tool measurement purpose.
The pins are used to be read from a remap G-code subroutine, so the code can react to different values.
-`qtversaprobe.enable` (HAL_BIT):: Measurement enabled or not tool. Reflects screen button state.
-`qtversaprobe.blockheight` (HAL_FLOAT):: The measured height of the top face of the workpiece. Reflects screen entry.
-`qtversaprobe.probeheight` (HAL_FLOAT):: The toolsetter probe switch height. Reflects screen entry.
-`qtversaprobe.searchvel` (HAL_FLOAT):: The velocity to search for the tool probe switch
-`qtversaprobe.probevel` (HAL_FLOAT):: The velocity to probe tool length. Reflects screen entry.
-`qtversaprobe.backoffdist` (HAL_FLOAT):: The distance the probe backs off after triggering. Reflects screen entry.
+`qtversaprobe.enable` (HAL_BOOL):: Measurement enabled or not tool. Reflects screen button state.
+`qtversaprobe.blockheight` (HAL_REAL):: The measured height of the top face of the workpiece. Reflects screen entry.
+`qtversaprobe.probeheight` (HAL_REAL):: The toolsetter probe switch height. Reflects screen entry.
+`qtversaprobe.searchvel` (HAL_REAL):: The velocity to search for the tool probe switch
+`qtversaprobe.probevel` (HAL_REAL):: The velocity to probe tool length. Reflects screen entry.
+`qtversaprobe.backoffdist` (HAL_REAL):: The distance the probe backs off after triggering. Reflects screen entry.
=== Tool Measurement INI File Modifications
diff --git a/docs/src/gui/qtvcp-vismach.adoc b/docs/src/gui/qtvcp-vismach.adoc
index 472cbc817db..345f17ce0eb 100644
--- a/docs/src/gui/qtvcp-vismach.adoc
+++ b/docs/src/gui/qtvcp-vismach.adoc
@@ -128,8 +128,8 @@ Originally the vismach library required creating a component and connecting HAL
[source,python]
----
c = hal.component("samplegui")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
c.ready()
----
@@ -470,7 +470,7 @@ Some of the available HalHUD function: +
[source,python]
----
-comp.newpin("hide-chuck", hal.HAL_BIT, hal.HAL_IN)
+comp.newpin("hide-chuck", hal.Type.BOOL, hal.Dir.IN)
#
chuckassembly = HideCollection([chuckassembly],comp,'hide-chuck')
# also can be used like this
@@ -569,7 +569,7 @@ STATUS = Status()
# create HAL pins here if needed
#c = hal.component("samplegui")
-#c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
+#c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
# create the floor, tool and work
floor = Box(-50, -50, -3, 50, 50, 0)
diff --git a/docs/src/gui/vismach.adoc b/docs/src/gui/vismach.adoc
index 559e59d16f0..f67066b08a7 100644
--- a/docs/src/gui/vismach.adoc
+++ b/docs/src/gui/vismach.adoc
@@ -58,8 +58,8 @@ the Vismach model.
[source,python]
----
c = hal.component("samplegui")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
c.ready()
----
@@ -285,7 +285,7 @@ from vismach import *
import hal
#create the HAL component and pins
comp = hal.component("compname")
-comp.newpin("pin_name", hal.HAL_FLOAT, hal.HAL_IN)
+comp.newpin("pin_name", hal.Type.REAL, hal.Dir.IN)
...
#create the floor, tool and work
floor = Box(-50, -50, -3, 50, 50, 0)
diff --git a/docs/src/hal/comp.adoc b/docs/src/hal/comp.adoc
index aa6d5816bb5..7f2cdff4a73 100644
--- a/docs/src/hal/comp.adoc
+++ b/docs/src/hal/comp.adoc
@@ -24,15 +24,14 @@ The equivalent component is very short when written using the 'halcompile' prepr
.Simple Component Example
----
component ddt "Compute the derivative of the input function";
-pin in float in;
-pin out float out;
-variable double old;
-option period no;
+pin in real in;
+pin out real out;
+variable rtapi_real old;
function _;
license "GPL"; // indicates GPL v2 or later
;;
-float tmp = in;
-out = (tmp - old) / fperiod;
+rtapi_real tmp = in;
+out_set((tmp - old) / fperiod);
old = tmp;
----
@@ -75,7 +74,7 @@ placing `rtexample.ko` in the LinuxCNC realtime module directory:
sudo (for root permission) is needed when using LinuxCNC from a deb package install.
When using a Run-In-Place (RIP) build, root privileges should not be needed.
-Or, it can process and compile in one step, leaving `example.ko` (or `example.so` for the simulator) in the current directory:
+Or, it can process and compile in one step, leaving `example.ko` (or `example.so` for uspace) in the current directory:
----
halcompile --compile rtexample.comp
@@ -181,6 +180,7 @@ Declarations include:
* 'component HALNAME (DOC);'
* 'pin PINDIRECTION TYPE HALNAME ([SIZE]|[MAXSIZE: CONDSIZE]) (if CONDITION) (= STARTVALUE) (DOC) ;'
* 'param PARAMDIRECTION TYPE HALNAME ([SIZE]|[MAXSIZE: CONDSIZE]) (if CONDITION) (= STARTVALUE) (DOC) ;'
+* 'alias HALNAME HALNAME ;'
* 'function HALNAME (fp | nofp) (DOC);'
* 'option OPT (VALUE);'
* 'variable CTYPE STARREDNAME ([SIZE]);'
@@ -253,37 +253,37 @@ better."""
+
Or a string may be preceded by the literal character 'r', in which case the string is interpreted like a Python raw-string.
+
-The documentation string is in "groff -man" format.
-For more information on this markup format, see 'groff_man(7)'.
-Remember that 'halcompile' interprets backslash escapes in strings, so for instance to set the italic font for the word 'example', write:
-+
-----
-"\\fIexample\\fB"
-----
-+
-In this case, r-strings are particularly useful, because the backslashes in an r-string need not be doubled:
-+
-----
-r"\fIexample\fB"
-----
+The documentation string is in "asciidoc" format.
+For more information on this markup format, see 'ascidoctor(1)' and https://asciidoctor.org.
-* 'TYPE' - One of the HAL types: 'bit', 's32', 'u32', 's64', 'u64' or 'float'.
- The names 'signed' and 'unsigned' may also be used for 's32' and 'u32' but 's32' and 'u32' are preferred.
-* 'PINDIRECTION' - One of the following: 'in', 'out', or 'io'.
- A component sets a value for an 'out' pin, it reads a value from an 'in' pin, and it may read or set the value of an 'io' pin.
-* 'PARAMDIRECTION' - One of the following: 'r' or 'rw'. A component sets a value for a 'r' parameter, and it may read or set the value of a 'rw' parameter.
+* 'TYPE' - One of the HAL types: `bool`, `sint`, `uint` or `real`.
+* 'PINDIRECTION' - One of the following: `in`, `out`, or `io`.
+ A component sets a value for an 'out' pin, it reads a value from an `in` pin, and it may read or set the value of an `io` pin.
+* 'PARAMDIRECTION' - One of the following: `r` or `rw`. A component sets a value for a 'r' parameter, and it may read or set the value of a 'rw' parameter.
* 'STARTVALUE' - Specifies the initial value of a pin or parameter.
- If it is not specified, then the default is '0' or 'FALSE', depending on the type of the item.
+ If it is not specified, then the default is `0` or `FALSE`, depending on the type of the item.
* 'HEADERFILE' - The name of a header file, either in double-quotes (`include "myfile.h";`) or in angle brackets (`include ;`).
The header file will be included (using C's #include) at the top of the file, before pin and parameter declarations.
-=== HAL functions
+[NOTE]
+====
+Transitionally, `si32` and `ui32` are supported as pin and param types.
+These read the lower 32-bit value (truncating!) and write 32-bit (sign-extended).
+The underlying values are always correct.
+
+You should retire all 32-bit pins and params and upgrade to 'sint' and 'uint'.
+Please beware of local variable truncation in the upgrade process.
+The proper variable types matching for all HAL types are:
-* 'fp' - Indicates that the function performs floating-point calculations.
-* 'nofp' - Indicates that it only performs integer calculations.
- If neither is specified, 'fp' is assumed.
- Neither 'halcompile' nor gcc can detect the use of floating-point calculations in functions that are tagged 'nofp',
- but the use of such operations results in undefined behavior.
+[options="header"]
+|===
+| HAL type | C type | Description
+| `bool` | `rtapi_bool` | Boolean value
+| `real` | `rtapi_real` | Floating point value
+| `sint` | `rtapi_sint` | Signed integer value
+| `uint` | `rtaip_uint` | Unsigned integer value
+|===
+====
=== Options
@@ -318,7 +318,7 @@ The currently defined options are:
When implementing your own `rtapi_app_main()`, call the function `int export(char *prefix, long extra_arg)` to register the pins, parameters, and functions for `prefix`.
* 'option data TYPE' - (default: none) *deprecated* +
- If specified, each instance of the component will have an associated data block of type 'TYPE' (which can be a simple type like 'float' or the name of a type created with 'typedef').
+ If specified, each instance of the component will have an associated data block of type 'TYPE' (which can be a simple type like 'real' or the name of a type created with 'typedef').
In new components, 'variable' should be used instead.
* 'option extra_setup yes' - (default: no) +
@@ -403,7 +403,7 @@ This declaration is *required*.
Declare a per-instance variable 'STARREDNAME' of type 'CTYPE',
optionally as an array of 'SIZE' items, and optionally with a default value 'DEFAULT'.
Items with no 'DEFAULT' are initialized to all-bits-zero.
-'CTYPE' is a simple one-word C type, such as `float`, `u32`, `s32`, `int`, etc.
+'CTYPE' is a simple one-word C type, such as `rtapi_real`, `rtapi_uint`, `rtapi_sint`, `int`, etc.
Access to array variables uses square brackets.
If a variable is to be of a pointer type, there may not be any space between the "*" and the variable name.
@@ -444,7 +444,7 @@ Variable and function names that can not be used or are likely to cause problems
== Convenience Macros
Based on the items in the declaration section, 'halcompile' creates a C structure called `struct __comp_state`.
-However, instead of referring to the members of this structure (e.g., `*(inst->name)`),
+However, instead of referring to the members of this structure (e.g., `*(inst\->name)`),
they will generally be referred to using the macros below.
The details of `struct __comp_state` and these macros may change from one version of 'halcompile' to the next.
@@ -554,13 +554,13 @@ The file name must match the component name.
[source,c]
----
component constant;
-pin out float out;
-param r float value = 1.0;
+pin out real out;
+param r real value = 1.0;
option period no;
function _;
license "GPL"; // indicates GPL v2 or later
;;
-FUNCTION(_) { out = value; }
+FUNCTION(_) { out_set(value); }
----
=== sincos
@@ -575,71 +575,77 @@ The HAL pins are still called 'sincos..sin'.
[source,c]
----
component sincos;
-pin out float sin_;
-pin out float cos_;
-pin in float theta;
+pin out real sin_;
+pin out real cos_;
+pin in real theta;
option period no;
function _;
license "GPL"; // indicates GPL v2 or later
;;
#include
-FUNCTION(_) { sin_ = sin(theta); cos_ = cos(theta); }
+FUNCTION(_) {
+ sin__set(sin(theta));
+ cos__set(cos(theta));
+}
----
=== out8
This component is a driver for a 'fictional' card called "out8", which has 8 pins of digital output which are treated as a single 8-bit value.
There can be a varying number of such cards in the system, and they can be at various addresses.
-The pin is called 'out_' because 'out' is an identifier used in ''.
-It illustrates the use of 'EXTRA_SETUP' and 'EXTRA_CLEANUP' to request an I/O region and then free it in case of error or when the module is unloaded.
+The pin is called 'out_' because 'out' is an identifier used in ''.
+It illustrates the use of 'POST_EXPORT' and 'EXTRA_CLEANUP' to request an I/O region and then free it in case of error or when the module is unloaded.
[source,c]
----
component out8;
-pin out unsigned out_ "Output value; only low 8 bits are used";
-param r unsigned ioaddr;
+pin out uint out_ "Output value; only low 8 bits are used";
+param r uint ioaddr;
function _;
option period no;
option count_function;
-option extra_setup;
+option post_export yes;
option extra_cleanup;
option constructable no;
license "GPL"; // indicates GPL v2 or later
;;
-#include
+#include
-#define MAX 8
-int io[MAX] = {0,};
-RTAPI_MP_ARRAY_INT(io, MAX, "I/O addresses of out8 boards");
+#define MAXOUT 8
+int io[MAXOUT] = {};
+RTAPI_MP_ARRAY_INT(io, MAXOUT, "I/O addresses of out8 boards");
int get_count(void) {
int i = 0;
- for(i=0; i0; i--) out(i) = out(i-1);
-out(0) = in;
+for(int i = 3; i > 0; i--) {
+ out_set(i, out(i-1));
+}
+out_set(0, in);
----
=== rand
@@ -685,7 +692,7 @@ This non-realtime component changes the value on its output pin to a new random
component rand;
option userspace;
-pin out float out;
+pin out real out;
license "GPL"; // indicates GPL v2 or later
;;
#include
@@ -693,7 +700,7 @@ license "GPL"; // indicates GPL v2 or later
void user_mainloop(void) {
while(1) {
usleep(1000);
- FOR_ALL_INSTS() out = drand48();
+ FOR_ALL_INSTS() out_set(drand48());
}
}
----
@@ -705,35 +712,40 @@ This realtime component shows how to use "personality" to create variable-size a
[source,c]
----
component logic "LinuxCNC HAL component providing experimental logic functions";
-pin in bit in-##[16 : personality & 0xff];
-pin out bit and if personality & 0x100;
-pin out bit or if personality & 0x200;
-pin out bit xor if personality & 0x400;
+pin in bool in-##[16 : personality & 0xff];
+pin out bool and if personality & 0x100;
+pin out bool or if personality & 0x200;
+pin out bool xor if personality & 0x400;
option period no;
-function _ nofp;
+function _;
description """
Experimental general 'logic function' component. Can perform 'and', 'or'
and 'xor' of up to 16 inputs. Determine the proper value for 'personality'
by adding:
-.IP \\(bu 4
-The number of input pins, usually from 2 to 16
-.IP \\(bu
-256 (0x100) if the 'and' output is desired
-.IP \\(bu
-512 (0x200) if the 'or' output is desired
-.IP \\(bu
-1024 (0x400) if the 'xor' (exclusive or) output is desired""";
+
+* 4 - The number of input pins, usually from 2 to 16
+* 256 (0x100) - if the 'and' output is desired
+* 512 (0x200) - if the 'or' output is desired
+* 1024 (0x400) - if the 'xor' (exclusive or) output is desired
+
+""";
license "GPL"; // indicates GPL v2 or later
;;
FUNCTION(_) {
- int i, a=1, o=0, x=0;
- for(i=0; i < (personality & 0xff); i++) {
- if(in(i)) { o = 1; x = !x; }
- else { a = 0; }
+ rtapi_bool a = 1;
+ rtapi_bool o = 0;
+ rtapi_bool x = 0;
+ for(int i = 0; i < (personality & 0xff); i++) {
+ if(in(i)) {
+ o = 1;
+ x = !x;
+ } else {
+ a = 0;
+ }
}
- if(personality & 0x100) and = a;
- if(personality & 0x200) or = o;
- if(personality & 0x400) xor = x;
+ if(personality & 0x100) and_set(a);
+ if(personality & 0x200) or_set(o);
+ if(personality & 0x400) xor_set(x);
}
----
@@ -758,9 +770,9 @@ It also shows how to pass reference of HAL pins to those functions.
[source,c]
----
component example;
-pin in s32 in;
-pin out bit out1;
-pin out bit out2;
+pin in sint in;
+pin out bool out1;
+pin out bool out2;
option period no;
function _;
@@ -768,31 +780,32 @@ license "GPL";
;;
// general pin set true function
-void set(hal_bit_t *p){
- *p = 1;
+void doset(hal_bool_t p) {
+ hal_set_bool(p, 1);
}
// general pin set false function
-void unset(hal_bit_t *p){
- *p = 0;
+void unset(hal_bool_t p) {
+ hal_set_bool(p, 0);
}
//main function
FUNCTION(_) {
- if (in < 0){
- set(&out1);
- unset(&out2);
- }else if (in >0){
- unset(&out2);
- set(&out2);
- }else{
- unset(&out1);
- unset(&out2);
+ rtapi_sint inval = in;
+ if (inval < 0) {
+ doset(out1_ptr);
+ unset(out2_ptr);
+ } else if (inval > 0) {
+ unset(out1_ptr);
+ doset(out2_ptr);
+ } else {
+ unset(out1_ptr);
+ unset(out2_ptr);
}
}
----
-This component uses two general function to manipulate a HAL bit pin referenced to it.
+This component uses two general function to manipulate a HAL bool pin referenced to it.
== Command Line Usage
diff --git a/docs/src/hal/components.adoc b/docs/src/hal/components.adoc
index e613c18749c..381dd8a71c8 100644
--- a/docs/src/hal/components.adoc
+++ b/docs/src/hal/components.adoc
@@ -286,35 +286,17 @@ Limit its slew rate to less than maxv per second. Limit its second derivative to
| link:../man/man9/bin2gray.9.html[bin2gray] |Converts a number to the gray-code representation ||
| link:../man/man9/bitmerge.9.html[bitmerge] |Converts individual input bits into an unsigned-32 ||
| link:../man/man9/bitslice.9.html[bitslice] |Converts an unsigned-32 input into individual bits ||
-| link:../man/man9/conv_bit_float.9.html[conv_bit_float] |Converts from bit to float ||
-| link:../man/man9/conv_bit_s32.9.html[conv_bit_s32] |Converts from bit to s32 ||
-| link:../man/man9/conv_bit_u32.9.html[conv_bit_u32] |Converts from bit to u32 ||
-| link:../man/man9/conv_float_s32.9.html[conv_float_s32] |Converts from float to s32 ||
-| link:../man/man9/conv_float_u32.9.html[conv_float_u32] |Converts from float to u32 ||
-| link:../man/man9/conv_s32_bit.9.html[conv_s32_bit] |Converts from s32 to bit ||
-| link:../man/man9/conv_s32_float.9.html[conv_s32_float] |Converts from s32 to float ||
-| link:../man/man9/conv_s32_u32.9.html[conv_s32_u32] |Converts from s32 to u32 ||
-| link:../man/man9/conv_u32_bit.9.html[conv_u32_bit] |Converts from u32 to bit ||
-| link:../man/man9/conv_u32_float.9.html[conv_u32_float] |Converts from u32 to float ||
-| link:../man/man9/conv_u32_s32.9.html[conv_u32_s32] |Converts from u32 to s32 ||
-| link:../man/man9/conv_bit_s64.9.html[conv_bit_s64] |Convert a value from bit to s64 ||
-| link:../man/man9/conv_bit_u64.9.html[conv_bit_u64] |Convert a value from bit to u64 ||
-| link:../man/man9/conv_float_s64.9.html[conv_float_s64] |Convert a value from float to s64 ||
-| link:../man/man9/conv_float_u64.9.html[conv_float_u64] |Convert a value from float to u64 ||
-| link:../man/man9/conv_s32_s64.9.html[conv_s32_s64] |Convert a value from s32 to s64 ||
-| link:../man/man9/conv_s32_u64.9.html[conv_s32_u64] |Convert a value from s32 to u64 ||
-| link:../man/man9/conv_s64_bit.9.html[conv_s64_bit] |Convert a value from s64 to bit ||
-| link:../man/man9/conv_s64_float.9.html[conv_s64_float] |Convert a value from s64 to float ||
-| link:../man/man9/conv_s64_s32.9.html[conv_s64_s32] |Convert a value from s64 to s32 ||
-| link:../man/man9/conv_s64_u32.9.html[conv_s64_u32] |Convert a value from s64 to u32 ||
-| link:../man/man9/conv_s64_u64.9.html[conv_s64_u64] |Convert a value from s64 to u64 ||
-| link:../man/man9/conv_u32_s64.9.html[conv_u32_s64] |Convert a value from u32 to s64 ||
-| link:../man/man9/conv_u32_u64.9.html[conv_u32_u64] |Convert a value from u32 to u64 ||
-| link:../man/man9/conv_u64_bit.9.html[conv_u64_bit] |Convert a value from u64 to bit ||
-| link:../man/man9/conv_u64_float.9.html[conv_u64_float] |Convert a value from u64 to float ||
-| link:../man/man9/conv_u64_s32.9.html[conv_u64_s32] |Convert a value from u64 to s32 ||
-| link:../man/man9/conv_u64_s64.9.html[conv_u64_s64] |Convert a value from u64 to s64 ||
-| link:../man/man9/conv_u64_u32.9.html[conv_u64_u32] |Convert a value from u64 to u32 ||
+| link:../man/man9/conv_bool_real.9.html[conv_bool_real] |Converts from bool to real ||
+| link:../man/man9/conv_bool_sint.9.html[conv_bool_sint] |Convert a value from bool to sint ||
+| link:../man/man9/conv_bool_uint.9.html[conv_bool_uint] |Convert a value from bool to uint ||
+| link:../man/man9/conv_real_sint.9.html[conv_real_sint] |Convert a value from real to sint ||
+| link:../man/man9/conv_real_uint.9.html[conv_real_uint] |Convert a value from real to uint ||
+| link:../man/man9/conv_sint_bool.9.html[conv_sint_bool] |Convert a value from sint to bool ||
+| link:../man/man9/conv_sint_real.9.html[conv_sint_real] |Convert a value from sint to real ||
+| link:../man/man9/conv_sint_uint.9.html[conv_sint_uint] |Convert a value from sint to uint ||
+| link:../man/man9/conv_uint_bool.9.html[conv_uint_bool] |Convert a value from uint to bool ||
+| link:../man/man9/conv_uint_real.9.html[conv_uint_real] |Convert a value from uint to real ||
+| link:../man/man9/conv_uint_sint.9.html[conv_uint_sint] |Convert a value from uint to sint ||
| link:../man/man9/gray2bin.9.html[gray2bin] |Converts gray-code input to binary ||
|===
diff --git a/docs/src/hal/halmodule.adoc b/docs/src/hal/halmodule.adoc
index df71e342335..086cc5a5fe8 100644
--- a/docs/src/hal/halmodule.adoc
+++ b/docs/src/hal/halmodule.adoc
@@ -18,8 +18,8 @@ The following component copies the value seen on its input pin ('passthrough.in'
import hal
import time
h = hal.component("passthrough")
-h.newpin("in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("out", hal.HAL_FLOAT, hal.HAL_OUT)
+h.newpin("in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("out", hal.Type.REAL, hal.Dir.OUT)
h.ready()
try:
while True:
@@ -80,8 +80,8 @@ If the prefix is not specified, the component name is used.
.Create a HAL pin or parameter
[source,python]
----
-mycomp.newpin("in", hal.HAL_FLOAT, hal.HAL_IN)
-mycomp.newparam("has-feature-rotate", hal.HAL_BIT, hal.HAL_RO)
+mycomp.newpin("in", hal.Type.REAL, hal.Dir.IN)
+mycomp.newparam("has-feature-rotate", hal.Type.BOOL, hal.Dir.RO)
----
Then pins are created by calls to methods on the component object.
@@ -91,14 +91,14 @@ For parameters, the arguments are: parameter name suffix, parameter type, and pa
.HAL Option Names
[width="100%",cols="<3s,7*<"]
|===
-|Pin and Parameter Types:|`HAL_BIT`|`HAL_FLOAT`|`HAL_S32`|`HAL_U32`|`HAL_S64`|`HAL_U64`|`HAL_PORT`
-|Pin Directions: |`HAL_IN` |`HAL_OUT` |`HAL_IO` | | | |
-|Parameter Directions: |`HAL_RO` |`HAL_RW` | | | | |
+|Pin and Parameter Types:|`hal.Type.BOOL`|`hal.Type.REAL`|`hal.Type.SINT`|`hal.Type.UINT`|`hal.Type.PORT`
+|Pin Directions: |`hal.Dir.IN` |`hal.Dir.OUT` |`hal.Dir.IO` | |
+|Parameter Directions: |`hal.Dir.RO` |`hal.Dir.RW` | | |
|===
[NOTE]
====
-Only pins and signals can use the `HAL_PORT` type.
+Only pins and signals can use the `hal.Type.PORT` type.
====
The full pin or parameter name is formed by joining the prefix and the
@@ -145,7 +145,7 @@ mycomp.getpins()
=== Driving output (HAL_OUT) pins
-Periodically, usually in response to a timer, all `HAL_OUT` pins should be "driven" by assigning them a new value.
+Periodically, usually in response to a timer, all `hal.Dir.OUT` pins should be "driven" by assigning them a new value.
This should be done whether or not the value is different than the last one assigned.
When a pin is connected to a signal, its old output value is not copied into the signal.
The proper value will only appear on the signal once the component assigns a new value.
@@ -175,12 +175,10 @@ See <> for an overview and descr
Use these to specify details rather then the value they hold.
* Pin, parameter and signal types:
-** `HAL_BIT`
-** `HAL_FLOAT`
-** `HAL_S32`
-** `HAL_U32`
-** `HAL_S64`
-** `HAL_U64`
+** `HAL_BOOL`
+** `HAL_REAL`
+** `HAL_SINT`
+** `HAL_UINT`
* Pin direction:
** `HAL_IN`
** `HAL_OUT`
diff --git a/docs/src/man/man1/halcompile.1.adoc b/docs/src/man/man1/halcompile.1.adoc
index c06cd1b8688..a2d45589cc4 100644
--- a/docs/src/man/man1/halcompile.1.adoc
+++ b/docs/src/man/man1/halcompile.1.adoc
@@ -73,6 +73,8 @@ components.
Extra arguments passed to the C-compiler.
*--extra-link-args*=_args_::
Extra arguments passed to the linker.
+*-w*,*--werror*::
+Treat warnings as errors.
== DESCRIPTION
diff --git a/docs/src/man/man1/mesambccc.1.adoc b/docs/src/man/man1/mesambccc.1.adoc
index 04790753bbf..a5867515f4e 100644
--- a/docs/src/man/man1/mesambccc.1.adoc
+++ b/docs/src/man/man1/mesambccc.1.adoc
@@ -65,19 +65,19 @@ clamped to the acceptable range.
A subset of the Modbus functions is supported (with function number in parentheses):
* `R_COILS` (`1`):
- Maps to 1..2000 HAL output pins of type 'HAL_BIT'.
+ Maps to 1..2000 HAL output pins of type 'HAL_BOOL'.
* `R_INPUTS` (`2`):
- Maps to 1..2000 HAL output pins of type 'HAL_BIT'.
+ Maps to 1..2000 HAL output pins of type 'HAL_BOOL'.
* `R_REGISTERS` (`3`):
Maps to 1..125 HAL output pins depending 'haltype' and 'scale' attributes.
* `R_INPUTREGS` (`4`):
Maps to 1..125 HAL output pins depending 'haltype' and 'scale' attributes.
* `W_COIL` (`5`):
- Maps to single HAL input pin of type 'HAL_BIT'.
+ Maps to single HAL input pin of type 'HAL_BOOL'.
* `W_REGISTER` (`6`):
Maps to single HAL input pins depending 'haltype' and 'scale' attributes.
* `W_COILS` (`15`):
- Maps to 1..2000 HAL input pins of type 'HAL_BIT'.
+ Maps to 1..2000 HAL input pins of type 'HAL_BOOL'.
* `W_REGISTERS` (`16`):
Maps to 1..125 HAL input pins depending 'haltype' and 'scale' attributes.
@@ -395,20 +395,18 @@ Recognized '//' attributes:
A '' in the '' section maps to one or more HAL pins with
specific type using the 'haltype' attribute. Recognized are:
-* 'HAL_BIT'
-* 'HAL_FLOAT'
-* 'HAL_S32'
-* 'HAL_U32'
-* 'HAL_S64'
-* 'HAL_U64'
+* 'BOOL', 'HAL_BOOL'
+* 'REAL', 'HAL_REAL'
+* 'SINT', 'HAL_SINT'
+* 'UINT', 'HAL_UINT'
The types are also recognized without the HAL_ prefix. Note that coil and
binary input functions `R_COILS` (`1`), `R_INPUTS` (`2`), `W_COIL` (`5`)
-and `W_COILS` (`15`) can only map to 'HAL_BIT' and do so implicitly.
+and `W_COILS` (`15`) can only map to 'HAL_BOOL' and do so implicitly.
-The 'HAL_BIT', 'HAL_U32' and 'HAL_U64' types always map to one single HAL pin.
+The 'HAL_BOOL' and 'HAL_UINT' types always map to one single HAL pin.
-The 'HAL_FLOAT', 'HAL_S32' and 'HAL_S64' types can generate one single pin or
+The 'HAL_REAL' and 'HAL_SINT' types can generate one single pin or
can generate multiple pins with 'offset' and 'scale'. Output pins
with `R_REGISTERS` (`3`) and `R_INPUTREGS` (`4`) can add a 'scaled' pin to
the set.
@@ -416,10 +414,18 @@ the set.
Mapping HAL pins to commands requires a 'modbustype' attribute to encode the
format and necessary conversions. Register functions `R_REGISTERS` (`3`),
`R_INPUTREGS` (`4`), `W_REGISTER` (`6`) and `W_REGISTERS` (`16`) may map
-to 'HAL_BIT' only when using unsigned 'modbustype' where a value of zero (0)
+to 'HAL_BOOL' only when using unsigned 'modbustype' where a value of zero (0)
is _false_ and any other value is _true_ for write functions or one (1) for
read functions.
+[NOTE]
+====
+The old 'haltype' values 'HAL_BIT', 'HAL_FLOAT', 'HAL_S32', 'HAL_U32',
+ 'HAL_S64' and 'HAL_U64' are still recognized for compatibility. They map to
+ 'HAL_BOOL', 'HAL_REAL', 'HAL_SINT', 'HAL_UINT', 'HAL_SINT' and 'HAL_UINT'
+respectively.
+====
+
===
The '' section defines one or more '' tags to describe the
Modbus function(s) to execute in a periodical way. Each '' tag maps to
@@ -448,14 +454,14 @@ writes at the specified interval.
----
- Type is implicit HAL_BIT, will become HAL pins:
+ Type is implicit HAL_BOOL, will become HAL pins:
- (out) hm2_modbus.0.wavebox.state-00
- (out) hm2_modbus.0.wavebox.state-01
- (out) hm2_modbus.0.wavebox.state-02
- (out) hm2_modbus.0.wavebox.state-03
-
Too much will kill you...
@@ -469,7 +475,7 @@ writes at the specified interval.
- Will create HAL_BIT pins:
+ Will create HAL_BOOL pins:
- (in) hm2_modbus.0.anyandall-00
- (in) hm2_modbus.0.anyandall-01
The bcanswer flag signifies that a device erroneously sends a reply on
@@ -478,10 +484,10 @@ writes at the specified interval.
-
- Will create a HAL_U32 pin
+ Will create a HAL_UINT pin
- (in) hm2_modbus.0.watcher
The 'count' is implicit 1. The data is mapped to U_AB and is clamped.
The data is sent every time (resend=1), regardless whether the HAL pin
@@ -533,7 +539,7 @@ Recognized '/' attributes:
The HAL pin type for interactions. You do not need to specify this attribute
for the Modbus functions read/write coil(s) or inputs, `R_COILS` (`1`),
`R_INPUTS` (`2`), `W_COIL` (`5`) and `W_COILS` (`15`), as these always use
- the 'HAL_BIT' type.
+ the 'HAL_BOOL' type.
*interval* [once,0..3600000000]::
The command repeat interval in micro-seconds. This is the time between
repeating this ''. An interval shorter than the time it takes to work
@@ -564,12 +570,12 @@ Recognized '/' attributes:
*scale* [Boolean]::
Add scaling HAL pins. Modbus read functions `R_REGISTERS` (`3`) and `R_INPUTREGS` (`4`)
add extra HAL pins *pin.name.offset* (in, 64-bit 'haltype'), *pin.name.scale*
- (in, 'HAL_FLOAT') and *pin.name.scaled* (out, 'HAL_FLOAT'). +
+ (in, 'HAL_REAL') and *pin.name.scaled* (out, 'HAL_REAL'). +
The Modbus write functions `W_REGISTER` (`6`) and `W_REGISTERS` (`16`) create
extra HAL pins *pin.name.offset* (in, 64-bit 'haltype') and *pin.name.scale*
- (in, 'HAL_FLOAT'). +
- The 'scale' attribute is only supported for 'HAL_FLOAT', 'HAL_S32' and 'HAL_S64'.
- Default is true for 'HAL_FLOAT' and false for others. The *scale* pin is
+ (in, 'HAL_REAL'). +
+ The 'scale' attribute is only supported for 'HAL_REAL' and 'HAL_SINT'.
+ Default is true for 'HAL_REAL' and false for others. The *scale* pin is
initialized to one (1.0) and the *offset* pin is initialized to zero (0). +
Scaling is always multiplicative to prevent division-by-zero. The offset is
always subtracted before scaling. The scaling action performed and subject to
@@ -621,25 +627,25 @@ attributes and can be overridden by adding them to the '' tag.
-
+
----
diff --git a/lib/python/gladevcp/builtin-panels/gtk_little_probe/gtk_little_probe.py b/lib/python/gladevcp/builtin-panels/gtk_little_probe/gtk_little_probe.py
index 918d63a08b2..7f790cf2d7b 100644
--- a/lib/python/gladevcp/builtin-panels/gtk_little_probe/gtk_little_probe.py
+++ b/lib/python/gladevcp/builtin-panels/gtk_little_probe/gtk_little_probe.py
@@ -149,27 +149,27 @@ def __init__(self, halcomp,builder,useropts):
self.halcomp = hal.component("probe")
- self.halcomp.newpin( "ps_searchvel", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probevel", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_z_clearance", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probe_max", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probe_latch", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probe_diam", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_xy_clearance", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_edge_lenght", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_x", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_y", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_z", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_angle", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "set_zero", hal.HAL_BIT, hal.HAL_OUT )
+ self.halcomp.newpin( "ps_searchvel", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probevel", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_z_clearance", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probe_max", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probe_latch", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probe_diam", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_xy_clearance", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_edge_lenght", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_x", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_y", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_z", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_angle", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "set_zero", hal.Type.BOOL, hal.Dir.OUT )
if self.chk_set_zero.get_active():
self.halcomp["set_zero"] = True
self.hal_led_set_zero.hal_pin.set(1)
- self.halcomp.newpin( "auto_rott", hal.HAL_BIT, hal.HAL_OUT )
+ self.halcomp.newpin( "auto_rott", hal.Type.BOOL, hal.Dir.OUT )
if self.chk_auto_rott.get_active():
self.halcomp["auto_rott"] = True
self.hal_led_auto_rott.hal_pin.set(1)
- self.halcomp.newpin( "ps_error", hal.HAL_FLOAT, hal.HAL_OUT )
+ self.halcomp.newpin( "ps_error", hal.Type.REAL, hal.Dir.OUT )
self.spbtn1_search_vel.set_value( self.prefs.getpref( "ps_searchvel", 300.0, float ) )
self.spbtn1_probe_vel.set_value( self.prefs.getpref( "ps_probevel", 10.0, float ) )
self.spbtn1_z_clearance.set_value( self.prefs.getpref( "ps_z_clearance", 3.0, float ) )
diff --git a/lib/python/gladevcp/builtin-panels/gtk_verser_probe/gtk_verser_probe.py b/lib/python/gladevcp/builtin-panels/gtk_verser_probe/gtk_verser_probe.py
index ff3bfdf9700..b538e0b26d2 100644
--- a/lib/python/gladevcp/builtin-panels/gtk_verser_probe/gtk_verser_probe.py
+++ b/lib/python/gladevcp/builtin-panels/gtk_verser_probe/gtk_verser_probe.py
@@ -151,27 +151,27 @@ def __init__(self, halcomp,builder,useropts):
self.halcomp = hal.component("probe")
- self.halcomp.newpin( "ps_searchvel", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probevel", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_z_clearance", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probe_max", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probe_latch", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_probe_diam", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_xy_clearance", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_edge_lenght", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_x", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_y", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_z", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "ps_offs_angle", hal.HAL_FLOAT, hal.HAL_OUT )
- self.halcomp.newpin( "set_zero", hal.HAL_BIT, hal.HAL_OUT )
+ self.halcomp.newpin( "ps_searchvel", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probevel", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_z_clearance", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probe_max", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probe_latch", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_probe_diam", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_xy_clearance", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_edge_lenght", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_x", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_y", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_z", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "ps_offs_angle", hal.Type.REAL, hal.Dir.OUT )
+ self.halcomp.newpin( "set_zero", hal.Type.BOOL, hal.Dir.OUT )
if self.chk_set_zero.get_active():
self.halcomp["set_zero"] = True
self.hal_led_set_zero.hal_pin.set(1)
- self.halcomp.newpin( "auto_rott", hal.HAL_BIT, hal.HAL_OUT )
+ self.halcomp.newpin( "auto_rott", hal.Type.BOOL, hal.Dir.OUT )
if self.chk_auto_rott.get_active():
self.halcomp["auto_rott"] = True
self.hal_led_auto_rott.hal_pin.set(1)
- self.halcomp.newpin( "ps_error", hal.HAL_FLOAT, hal.HAL_OUT )
+ self.halcomp.newpin( "ps_error", hal.Type.REAL, hal.Dir.OUT )
self.spbtn1_search_vel.set_value( self.prefs.getpref( "ps_searchvel", 300.0, float ) )
self.spbtn1_probe_vel.set_value( self.prefs.getpref( "ps_probevel", 10.0, float ) )
self.spbtn1_z_clearance.set_value( self.prefs.getpref( "ps_z_clearance", 3.0, float ) )
diff --git a/lib/python/gladevcp/hal_bar.py b/lib/python/gladevcp/hal_bar.py
index db83c789f15..2040e4efc89 100644
--- a/lib/python/gladevcp/hal_bar.py
+++ b/lib/python/gladevcp/hal_bar.py
@@ -221,7 +221,7 @@ def get_value_diff(self, value):
def _hal_init(self):
_HalWidgetBase._hal_init(self)
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.REAL, hal.Dir.IN)
self.hal_pin.connect('value-changed', lambda p: self.set_value(p.value))
self.hal_pin.connect('value-changed', lambda s: self.emit('hal-pin-changed', s))
diff --git a/lib/python/gladevcp/hal_graph.py b/lib/python/gladevcp/hal_graph.py
index 70eab5f2812..661f4afacc4 100644
--- a/lib/python/gladevcp/hal_graph.py
+++ b/lib/python/gladevcp/hal_graph.py
@@ -111,7 +111,7 @@ def __init__(self):
def _hal_init(self):
_HalWidgetBase._hal_init(self)
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.REAL, hal.Dir.IN)
def tick_poll(self, idx):
if self.tick_idx != idx:
diff --git a/lib/python/gladevcp/hal_lightbutton.py b/lib/python/gladevcp/hal_lightbutton.py
index b83ddff4087..f9ede93e68d 100644
--- a/lib/python/gladevcp/hal_lightbutton.py
+++ b/lib/python/gladevcp/hal_lightbutton.py
@@ -375,16 +375,16 @@ def _hal_init(self):
self.set_active(False)
if (self.button_halio_pin):
- self.button_pin = self.hal.newpin(self.hal_name+'-button', hal.HAL_BIT, hal.HAL_IO)
+ self.button_pin = self.hal.newpin(self.hal_name+'-button', hal.Type.BOOL, hal.Dir.IO)
self.button_pin.connect('value-changed', self.button_pin_update)
else:
- self.button_pin = self.hal.newpin(self.hal_name+'-button', hal.HAL_BIT, hal.HAL_OUT)
- self.button_pin_not = self.hal.newpin(self.hal_name+'-button-not', hal.HAL_BIT, hal.HAL_OUT)
+ self.button_pin = self.hal.newpin(self.hal_name+'-button', hal.Type.BOOL, hal.Dir.OUT)
+ self.button_pin_not = self.hal.newpin(self.hal_name+'-button-not', hal.Type.BOOL, hal.Dir.OUT)
if (self.create_enable_pin):
- self.enable_pin = self.hal.newpin(self.hal_name+'-enable', hal.HAL_BIT, hal.HAL_IN)
+ self.enable_pin = self.hal.newpin(self.hal_name+'-enable', hal.Type.BOOL, hal.Dir.IN)
self.enable_pin.connect('value-changed', self.enable_pin_update)
- self.light_pin = self.hal.newpin(self.hal_name+'-light', hal.HAL_BIT, hal.HAL_IN)
+ self.light_pin = self.hal.newpin(self.hal_name+'-light', hal.Type.BOOL, hal.Dir.IN)
self.light_pin.connect('value-changed', self.light_pin_update)
def button_pin_update(self, hal_pin, data=None):
diff --git a/lib/python/gladevcp/hal_meter.py b/lib/python/gladevcp/hal_meter.py
index 017743fc163..8744058a6c6 100644
--- a/lib/python/gladevcp/hal_meter.py
+++ b/lib/python/gladevcp/hal_meter.py
@@ -87,7 +87,7 @@ def __init__(self):
def _hal_init(self):
_HalWidgetBase._hal_init(self)
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.REAL, hal.Dir.IN)
self.hal_pin.connect('value-changed', lambda p: self.set_value(p.value))
self.hal_pin.connect('value-changed', lambda s: self.emit('hal-pin-changed', s))
diff --git a/lib/python/gladevcp/hal_widgets.py b/lib/python/gladevcp/hal_widgets.py
index fa33745f03c..ddb18f0a9e9 100644
--- a/lib/python/gladevcp/hal_widgets.py
+++ b/lib/python/gladevcp/hal_widgets.py
@@ -41,8 +41,8 @@ def hal_update(self):
class _HalToggleBase(_HalWidgetBase):
def _hal_init(self):
self.set_active(False)
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_BIT, hal.HAL_OUT)
- self.hal_pin_not = self.hal.newpin(self.hal_name + "-not", hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.BOOL, hal.Dir.OUT)
+ self.hal_pin_not = self.hal.newpin(self.hal_name + "-not", hal.Type.BOOL, hal.Dir.OUT)
self.connect("toggled", self.hal_update)
def hal_update(self, *a):
@@ -52,8 +52,8 @@ def hal_update(self, *a):
class _HalScaleBase(_HalWidgetBase):
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_s = self.hal.newpin(self.hal_name+"-s", hal.HAL_S32, hal.HAL_OUT)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_s = self.hal.newpin(self.hal_name+"-s", hal.Type.SINT, hal.Dir.OUT)
self.connect("value-changed", self.hal_update)
def hal_update(self, *a):
@@ -62,7 +62,7 @@ def hal_update(self, *a):
class _HalIOScaleBase(_HalWidgetBase):
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IO)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.REAL, hal.Dir.IO)
self.connect("value-changed", self.hal_update)
self.hal_pin.connect('value-changed', lambda s: self.emit('hal-pin-changed', s))
self.hal_current = self.hal_pin.get()
@@ -80,21 +80,21 @@ def hal_update(self, *a):
class _HalSensitiveBase(_HalWidgetBase):
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.connect('value-changed', lambda s: self.set_sensitive(s.value))
self.hal_pin.connect('value-changed', lambda s: self.emit('hal-pin-changed', s))
class _HalJogWheelBase(_HalWidgetBase):
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_S32, hal.HAL_OUT)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.SINT, hal.Dir.OUT)
try:
self.get_scaled_value()
- self.hal_pin_scaled = self.hal.newpin(self.hal_name+'-scaled', hal.HAL_FLOAT, hal.HAL_OUT)
+ self.hal_pin_scaled = self.hal.newpin(self.hal_name+'-scaled', hal.Type.REAL, hal.Dir.OUT)
except:
pass
try:
self.get_delta_scaled_value()
- self.hal_pin_delta_scaled = self.hal.newpin(self.hal_name+'-delta-scaled', hal.HAL_FLOAT, hal.HAL_OUT)
+ self.hal_pin_delta_scaled = self.hal.newpin(self.hal_name+'-delta-scaled', hal.Type.REAL, hal.Dir.OUT)
except:
pass
@@ -114,7 +114,7 @@ def hal_update(self, *a):
class _HalSpeedControlBase(_HalWidgetBase):
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name + '.value', hal.HAL_FLOAT, hal.HAL_OUT)
+ self.hal_pin = self.hal.newpin(self.hal_name + '.value', hal.Type.REAL, hal.Dir.OUT)
self.connect("value-changed", self.hal_update)
def hal_update(self, *a):
@@ -134,7 +134,7 @@ class HAL_HideTable(Gtk.Grid, _HalWidgetBase):
__gsignals__ = dict([hal_pin_changed_signal])
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.connect('value-changed',self.update)
def update(self,*a):
@@ -166,8 +166,8 @@ def do_set_property(self, property, value):
raise AttributeError('unknown property %s' % property.name)
def _hal_init(self):
- self.hal_pin_f = self.hal.newpin(self.hal_name+"-f", hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_s = self.hal.newpin(self.hal_name+"-s", hal.HAL_S32, hal.HAL_OUT)
+ self.hal_pin_f = self.hal.newpin(self.hal_name+"-f", hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_s = self.hal.newpin(self.hal_name+"-s", hal.Type.SINT, hal.Dir.OUT)
self.connect("changed", self.hal_update)
def hal_update(self, *a):
@@ -184,7 +184,7 @@ class HAL_Button(Gtk.Button, _HalWidgetBase):
__gtype_name__ = "HAL_Button"
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.BOOL, hal.Dir.OUT)
def _f(w, data):
self.hal_pin.set(data)
self.connect("pressed", _f, True)
@@ -196,7 +196,7 @@ class HALIO_Button(Gtk.ToggleButton, _HalWidgetBase):
def _hal_init(self):
self.set_active(False)
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_BIT, hal.HAL_IO)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.BOOL, hal.Dir.IO)
def _f(w, data):
self.set_active(True)
self.hal_pin.set(data)
@@ -219,8 +219,8 @@ def hal_update(self, *a):
self.hal_pin_s.set(int(data))
def _hal_init(self):
- self.hal_pin_f = self.hal.newpin(self.hal_name+"-f", hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_s = self.hal.newpin(self.hal_name+"-s", hal.HAL_S32, hal.HAL_OUT)
+ self.hal_pin_f = self.hal.newpin(self.hal_name+"-f", hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_s = self.hal.newpin(self.hal_name+"-s", hal.Type.SINT, hal.Dir.OUT)
self.connect("value-changed", self.hal_update)
self.emit("value-changed")
@@ -278,8 +278,8 @@ def do_set_property(self, property, value):
raise AttributeError('unknown property %s' % property.name)
def _hal_init(self):
- self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN)
- self.hal_pin_scale = self.hal.newpin(self.hal_name+".scale", hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, hal.Type.REAL, hal.Dir.IN)
+ self.hal_pin_scale = self.hal.newpin(self.hal_name+".scale", hal.Type.REAL, hal.Dir.IN)
if self.yellow_limit or self.red_limit:
self.set_fraction(0)
self.modify_bg(Gtk.STATE_PRELIGHT, Gdk.Color.parse('#0f0')[1])
@@ -349,14 +349,14 @@ def do_set_property(self, property, value):
def _hal_init(self):
- types = {0:hal.HAL_S32
- ,1:hal.HAL_FLOAT
- ,2:hal.HAL_U32
+ types = {0:hal.Type.SINT
+ ,1:hal.Type.REAL
+ ,2:hal.Type.UINT
}
pin_type = types.get(self.label_pin_type, None)
if pin_type is None:
raise TypeError("%s: Invalid pin type: %s" % (self.hal_name, self.label_pin_type))
- self.hal_pin = self.hal.newpin(self.hal_name, pin_type, hal.HAL_IN)
+ self.hal_pin = self.hal.newpin(self.hal_name, pin_type, hal.Dir.IN)
self.hal_pin.connect('value-changed',
lambda p: self.set_text(self.text_template % p.value))
self.hal_pin.connect('value-changed', lambda s: self.emit('hal-pin-changed', s))
diff --git a/lib/python/gladevcp/jogwheel.py b/lib/python/gladevcp/jogwheel.py
index 1b762226bb3..e1ccebc5679 100644
--- a/lib/python/gladevcp/jogwheel.py
+++ b/lib/python/gladevcp/jogwheel.py
@@ -96,7 +96,7 @@ def __init__(self, size = 200, cpr = 40):
# init the hal pin management
def _hal_init(self):
_HalJogWheelBase._hal_init(self)
- self.hal_pin_scale = self.hal.newpin(self.hal_name+".scale", hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin_scale = self.hal.newpin(self.hal_name+".scale", hal.Type.REAL, hal.Dir.IN)
self.hal_pin_scale.set(1.0)
# This function is called from hal_widgets.py
diff --git a/lib/python/gladevcp/speedcontrol.py b/lib/python/gladevcp/speedcontrol.py
index 332f025ab0d..61db15711db 100755
--- a/lib/python/gladevcp/speedcontrol.py
+++ b/lib/python/gladevcp/speedcontrol.py
@@ -162,17 +162,17 @@ def _update_widget(self):
def _hal_init(self):
_HalSpeedControlBase._hal_init(self)
# the scale, as the widget may show units per minute, but linuxcnc expects units per second
- self.hal_pin_scale = self.hal.newpin(self.hal_name+".scale", hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin_scale = self.hal.newpin(self.hal_name+".scale", hal.Type.REAL, hal.Dir.IN)
self.hal_pin_scale.connect("value-changed", self._on_scale_changed)
self.hal_pin_scale.set(60.0)
# the scaled value to be handled in hal
- self.hal_pin_scaled_value = self.hal.newpin(self.hal_name+".scaled-value", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.hal_pin_scaled_value = self.hal.newpin(self.hal_name+".scaled-value", hal.Type.REAL, hal.Dir.OUT)
# pins to allow hardware button to be connected to the software button
- self.hal_pin_increase = self.hal.newpin(self.hal_name+".increase", hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin_increase = self.hal.newpin(self.hal_name+".increase", hal.Type.BOOL, hal.Dir.IN)
self.hal_pin_increase.connect("value-changed", self._on_plus_changed)
- self.hal_pin_decrease = self.hal.newpin(self.hal_name+".decrease", hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin_decrease = self.hal.newpin(self.hal_name+".decrease", hal.Type.BOOL, hal.Dir.IN)
self.hal_pin_decrease.connect("value-changed", self._on_minus_changed)
# this draws our widget on the screen
diff --git a/lib/python/hal.py b/lib/python/hal.py
index 68fa796eebc..0fa81b63991 100644
--- a/lib/python/hal.py
+++ b/lib/python/hal.py
@@ -11,8 +11,8 @@
import hal, time
h = hal.component("component-name")
# create pins and parameters with calls to h.newpin and h.newparam
-h.newpin("in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("out", hal.HAL_FLOAT, hal.HAL_OUT)
+h.newpin("in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("out", hal.Type.REAL, hal.Dir.OUT)
h.ready() # mark the component as 'ready'
try:
@@ -48,6 +48,22 @@ def __getattr__(name):
warnings.warn(f"{name} is deprecated, use lcnc_realtime.verify() instead", FutureWarning, stacklevel=2)
return not lcnc_realtime.verify()
+ oldnames = {
+ 'HAL_BIT' : (_hal.Type.BOOL, 'BOOL'),
+ 'HAL_FLOAT': (_hal.Type.REAL, 'REAL'),
+ 'HAL_S32' : (_hal.Type.SINT, 'SINT'),
+ 'HAL_U32' : (_hal.Type.UINT, 'UINT'),
+ 'HAL_S64' : (_hal.Type.SINT, 'SINT'),
+ 'HAL_U64' : (_hal.Type.UINT, 'UINT')
+ }
+ if name in oldnames:
+ nt, nn = oldnames[name]
+ if name in ('HAL_S32', 'HAL_U32'):
+ warnings.warn(f"{name} is no longer supported and replaced by hal.Type.{nn}", FutureWarning, stacklevel=2)
+ else:
+ warnings.warn(f"{name} has been deprecated. Please use the IntEnum type hal.Type.{nn}", FutureWarning, stacklevel=2)
+ return nt
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
class _ItemWrap(object):
diff --git a/lib/python/pyvcp_widgets.py b/lib/python/pyvcp_widgets.py
index 46dba0388bb..189a3ed86b1 100644
--- a/lib/python/pyvcp_widgets.py
+++ b/lib/python/pyvcp_widgets.py
@@ -59,7 +59,7 @@
class pyvcp_dial(Canvas):
# Dial widget by tomp
- """ A dial that outputs a HAL_FLOAT
+ """ A dial that outputs a HAL_REAL
reacts to both mouse-wheel and mouse dragging
[ 376 ]
@@ -202,11 +202,11 @@ def __init__(self,root,pycomp,halpin=None,halparam=None,param_pin=0,size=200,cpr
if halparam == None:
halparam = "dial." + str(pyvcp_dial.n) + ".param_pin"
self.halparam=halparam
- pycomp.newpin(halparam, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(halparam, Type.REAL, Dir.IN)
pyvcp_dial.n += 1
self.pycomp=pycomp
- pycomp.newpin(halpin, HAL_FLOAT, HAL_OUT)
+ pycomp.newpin(halpin, Type.REAL, Dir.OUT)
pycomp[self.halparam] = self.origValue
self.oldValue = self.origValue
@@ -402,7 +402,7 @@ def __init__(self,root,pycomp,halpin=None, size=200,text=None,subtext=None,min_=
if halpin == None:
self.halpin = "meter."+str(pyvcp_meter.n)+".value"
pyvcp_meter.n += 1
- pycomp.newpin(self.halpin, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(self.halpin, Type.REAL, Dir.IN)
self.value = pycomp[self.halpin]
def rad2deg(self, rad): return rad*180/math.pi
@@ -464,7 +464,7 @@ def draw_ticks(self):
# -------------------------------------------
class pyvcp_jogwheel(Canvas):
- """" A jogwheel that outputs a HAL_FLOAT count
+ """" A jogwheel that outputs a HAL_REAL count
reacts to both mouse-wheel and mouse dragging
[ 33 ] (counts per revolution)
@@ -550,7 +550,7 @@ def __init__(self,root,pycomp,halpin=None,text=None,clear_pin=0,scale_pin=0,
halpin = "jogwheel."+str(pyvcp_jogwheel.n) + name
pyvcp_jogwheel.n += 1
self.halpin=halpin
- pycomp.newpin(halpin, HAL_FLOAT, HAL_OUT)
+ pycomp.newpin(halpin, Type.REAL, Dir.OUT)
pycomp[self.halpin] = self.count
self.pycomp=pycomp
@@ -561,13 +561,13 @@ def __init__(self,root,pycomp,halpin=None,text=None,clear_pin=0,scale_pin=0,
name = ".reset"
clear_pin = halpin + name
self.clear_pin = clear_pin
- pycomp.newpin(clear_pin, HAL_BIT, HAL_IN)
+ pycomp.newpin(clear_pin, Type.BOOL, Dir.IN)
if scale_pin!=0:
name = ".scale"
scale_pin = halpin + name
self.scale_pin = scale_pin
- pycomp.newpin(scale_pin, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(scale_pin, Type.REAL, Dir.IN)
def update_jogscale(self):
if self.scale_pin:
@@ -694,7 +694,7 @@ def __init__(self,master,pycomp,halpin=None,initval=0,orient=None,choices=[],**k
if n==initval:
b.select()
c_halpin=halpin+"."+str(c)
- pycomp.newpin(c_halpin, HAL_BIT, HAL_OUT)
+ pycomp.newpin(c_halpin, Type.BOOL, Dir.OUT)
self.halpins.append(c_halpin)
n+=1
@@ -743,7 +743,7 @@ def __init__(self,master,pycomp,halpin=None,disable_pin=False,**kw):
pyvcp_label.n += 1
halpin_disable = halpin+".disable"
self.halpin_disable = halpin_disable
- pycomp.newpin(halpin_disable, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin_disable, Type.BOOL, Dir.IN)
def update(self,pycomp):
if self.disable_pin:
@@ -783,7 +783,7 @@ def __init__(self,master,pycomp,halpin=None,disable_pin=False,legends=[],initval
n=0
for c in legends:
c_halpin=halpin+".legend"+str(n)
- pycomp.newpin(c_halpin, HAL_BIT, HAL_IN)
+ pycomp.newpin(c_halpin, Type.BOOL, Dir.IN)
self.halpins.append(c_halpin)
n+=1
#limit to 6 legends
@@ -795,7 +795,7 @@ def __init__(self,master,pycomp,halpin=None,disable_pin=False,legends=[],initval
if disable_pin:
halpin_disable = halpin+".disable"
self.halpin_disable = halpin_disable
- pycomp.newpin(halpin_disable, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin_disable, Type.BOOL, Dir.IN)
# test for out of range initval number
if initval >= 0 and initval <= self.num_pins :
@@ -983,7 +983,7 @@ def __init__(self,master,pycomp,halpin=None, halparam=None,param_pin=0,
if halparam == None:
halparam = "spinbox." + str(pyvcp_spinbox.n) + ".param_pin"
self.halparam=halparam
- pycomp.newpin(halparam, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(halparam, Type.REAL, Dir.IN)
pyvcp_spinbox.n += 1
@@ -1005,7 +1005,7 @@ def __init__(self,master,pycomp,halpin=None, halparam=None,param_pin=0,
self.min_=min_
self.resolution=resolution
self.v.set( str( self.format % {'b':self.value} ) )
- pycomp.newpin(halpin, HAL_FLOAT, HAL_OUT)
+ pycomp.newpin(halpin, Type.REAL, Dir.OUT)
self.bind('',self.wheel_up)
self.bind('',self.wheel_down)
@@ -1064,7 +1064,7 @@ def __init__(self,master,pycomp,halpin=None,format="2.1f",**kw):
self.value=0.0
dummy = "%(b)"+self.format
self.v.set( str( dummy % {'b':self.value} ) )
- pycomp.newpin(halpin, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(halpin, Type.REAL, Dir.IN)
def update(self,pycomp):
newvalue = pycomp[self.halpin]
@@ -1088,7 +1088,7 @@ def __init__(self,master,pycomp,halpin=None,format="d",**kw):
self.value=int(0.0)
dummy = "%(b)"+self.format
self.v.set( str( dummy % {'b':self.value} ) )
- pycomp.newpin(halpin, HAL_U32, HAL_IN)
+ pycomp.newpin(halpin, Type.U32, Dir.IN)
def update(self,pycomp):
newvalue = pycomp[self.halpin]
@@ -1112,7 +1112,7 @@ def __init__(self,master,pycomp,halpin=None,format="d",**kw):
self.value=int(0.0)
dummy = "%(b)"+self.format
self.v.set( str( dummy % {'b':self.value} ) )
- pycomp.newpin(halpin, HAL_S32, HAL_IN)
+ pycomp.newpin(halpin, Type.S32, Dir.IN)
def update(self,pycomp):
newvalue = pycomp[self.halpin]
@@ -1137,10 +1137,10 @@ def __init__(self,master,pycomp,halpin=None,**kw):
pyvcp_timer.n += 1
self.halpins=[]
c_halpin=halpin+".reset"
- pycomp.newpin(c_halpin, HAL_BIT, HAL_IN)
+ pycomp.newpin(c_halpin, Type.BOOL, Dir.IN)
self.halpins.append(c_halpin)
c_halpin=halpin+".run"
- pycomp.newpin(c_halpin, HAL_BIT, HAL_IN)
+ pycomp.newpin(c_halpin, Type.BOOL, Dir.IN)
self.halpins.append(c_halpin)
self.resetvalue=0
@@ -1231,7 +1231,7 @@ def __init__(self,master,pycomp,fillcolor="green",bgcolor="grey",
self.startval=min_
self.format = "%" + format
- pycomp.newpin(halpin, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(halpin, Type.REAL, Dir.IN)
self.value=0.0 # some dummy value to start with
@@ -1346,11 +1346,11 @@ def __init__(self,master,pycomp, halpin=None,disable_pin=False,
halpin = "led."+str(pyvcp_led.n)
pyvcp_led.n+=1
self.halpin=halpin
- pycomp.newpin(halpin, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin, Type.BOOL, Dir.IN)
if disable_pin:
halpin_disable = halpin+".disable"
self.halpin_disable = halpin_disable
- pycomp.newpin(halpin_disable, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin_disable, Type.BOOL, Dir.IN)
def update(self,pycomp):
@@ -1396,11 +1396,11 @@ def __init__(self,master,pycomp, halpin=None,disable_pin=False,
halpin = "led."+str(pyvcp_led.n)
pyvcp_led.n+=1
self.halpin=halpin
- pycomp.newpin(halpin, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin, Type.BOOL, Dir.IN)
if disable_pin:
halpin_disable = halpin+".disable"
self.halpin_disable = halpin_disable
- pycomp.newpin(halpin_disable, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin_disable, Type.BOOL, Dir.IN)
def update(self,pycomp):
@@ -1441,10 +1441,10 @@ def __init__(self,master,pycomp,halpin=None,initval=0,**kw):
if halpin == None:
halpin = "checkbutton."+str(pyvcp_checkbutton.n)
self.halpin=halpin
- pycomp.newpin(halpin, HAL_BIT, HAL_OUT)
+ pycomp.newpin(halpin, Type.BOOL, Dir.OUT)
changepin = halpin + ".changepin"
self.changepin=changepin
- pycomp.newpin(changepin, HAL_BIT, HAL_IN)
+ pycomp.newpin(changepin, Type.BOOL, Dir.IN)
pycomp[self.changepin] = 0
pyvcp_checkbutton.n += 1
@@ -1493,11 +1493,11 @@ def __init__(self,master,pycomp,halpin=None,disable_pin=False,**kw):
halpin = "button."+str(pyvcp_button.n)
pyvcp_button.n += 1
self.halpin=halpin
- pycomp.newpin(halpin, HAL_BIT, HAL_OUT)
+ pycomp.newpin(halpin, Type.BOOL, Dir.OUT)
self.disable_pin = disable_pin
if not disable_pin == False:
halpin_disable = halpin + ".disable"
- pycomp.newpin(halpin_disable, HAL_BIT, HAL_IN)
+ pycomp.newpin(halpin_disable, Type.BOOL, Dir.IN)
self.halpin_disable=halpin_disable
self.state=0;
self.bind("", self.pressed)
@@ -1564,12 +1564,12 @@ def __init__(self,master,pycomp,
if halparam == None:
halparam = "scale."+str(pyvcp_scale.n)+".param_pin"
self.halparam=halparam
- pycomp.newpin(halparam, HAL_FLOAT, HAL_IN)
+ pycomp.newpin(halparam, Type.REAL, Dir.IN)
pyvcp_scale.n += 1
- pycomp.newpin(halpin+"-i", HAL_S32, HAL_OUT)
- pycomp.newpin(halpin+"-f", HAL_FLOAT, HAL_OUT)
+ pycomp.newpin(halpin+"-i", Type.S32, Dir.OUT)
+ pycomp.newpin(halpin+"-f", Type.REAL, Dir.OUT)
self.bind('',self.wheel_up)
self.bind('',self.wheel_down)
@@ -1764,7 +1764,7 @@ def __init__(self, master, pycomp, images, halpin=None, **kw):
self.halpin = halpin
self.value = 0
self.last = None
- pycomp.newpin(halpin, self.pintype, HAL_IN)
+ pycomp.newpin(halpin, self.pintype, Dir.IN)
def update(self, pycomp):
l = pycomp[self.halpin]
@@ -1776,9 +1776,9 @@ def update(self, pycomp):
self.last = l
class pyvcp_image_bit(_pyvcp_image):
- pintype = HAL_BIT
+ pintype = Type.BOOL
class pyvcp_image_u32(_pyvcp_image):
- pintype = HAL_U32
+ pintype = Type.U32
# This must come after all the pyvcp_xxx classes
elements = []
diff --git a/lib/python/qtvcp/lib/message.py b/lib/python/qtvcp/lib/message.py
index 3cc844b7034..825552a3153 100644
--- a/lib/python/qtvcp/lib/message.py
+++ b/lib/python/qtvcp/lib/message.py
@@ -65,18 +65,18 @@ def message_setup(self, hal_comp, window=None, notify=None):
# this is how we make a pin that can be connected to a callback
if ("none" in details):
- D._halpin = self.HAL_GCOMP_.newpin(name, hal.HAL_BIT, hal.HAL_IN)
+ D._halpin = self.HAL_GCOMP_.newpin(name, hal.Type.BOOL, hal.Dir.IN)
else:
- D._halpin = self.HAL_GCOMP_.newpin(name, hal.HAL_BIT, hal.HAL_IO)
+ D._halpin = self.HAL_GCOMP_.newpin(name, hal.Type.BOOL, hal.Dir.IO)
D._halpin.value_changed.connect(self.messageCallback(self['dialog-{}'.format(name)],
D._halpin, name, boldtext, text, pinname, details, icon))
if ("dialog" in details) and not ("nonedialog" in details):
- self.HAL_GCOMP_.newpin(name + "-waiting", hal.HAL_BIT, hal.HAL_OUT)
+ self.HAL_GCOMP_.newpin(name + "-waiting", hal.Type.BOOL, hal.Dir.OUT)
if not ("ok" in details):
- self.HAL_GCOMP_.newpin(name + "-response", hal.HAL_BIT, hal.HAL_OUT)
- self.HAL_GCOMP_.newpin(name + "-response-s32", hal.HAL_S32, hal.HAL_OUT)
+ self.HAL_GCOMP_.newpin(name + "-response", hal.Type.BOOL, hal.Dir.OUT)
+ self.HAL_GCOMP_.newpin(name + "-response-s32", hal.Type.SINT, hal.Dir.OUT)
self.HAL_GCOMP_[name + "-response-s32"] = -1 # undetermined
if not INFO.USRMULTIMESS_ID is None:
@@ -88,13 +88,13 @@ def message_setup(self, hal_comp, window=None, notify=None):
D.hal_init(HAL_NAME=name)
D.pinname = name
- D._halpin = self.HAL_GCOMP_.newpin(name, hal.HAL_S32, hal.HAL_IN)
+ D._halpin = self.HAL_GCOMP_.newpin(name, hal.Type.SINT, hal.Dir.IN)
D._halpin.value_changed.connect(self.multiMessageCallback(D,
D._halpin, name, mess, ))
if ("dialog" in details) and not ("nonedialog" in details):
- self.HAL_GCOMP_.newpin(name + "-waiting", hal.HAL_BIT, hal.HAL_OUT)
+ self.HAL_GCOMP_.newpin(name + "-waiting", hal.Type.BOOL, hal.Dir.OUT)
# This weird code is so we can get access to proper variables.
# using clicked.connect( self.on_printmessage(pin,name,bt,t,c) ) apparently doesn't easily
diff --git a/lib/python/qtvcp/lib/qt_vismach/fanuc_200f.py b/lib/python/qtvcp/lib/qt_vismach/fanuc_200f.py
index bc540a84763..ae22fdb0bc7 100755
--- a/lib/python/qtvcp/lib/qt_vismach/fanuc_200f.py
+++ b/lib/python/qtvcp/lib/qt_vismach/fanuc_200f.py
@@ -27,14 +27,14 @@
BASEPATH = os.path.join(os.path.dirname(__file__), 'fanuc_200f_obj')
c = hal.component("fanuc_200f")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("grip", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("plotclear", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
+c.newpin("grip", hal.Type.REAL, hal.Dir.IN)
+c.newpin("plotclear", hal.Type.BOOL, hal.Dir.IN)
c.ready()
diff --git a/lib/python/qtvcp/lib/qt_vismach/gantry_5axis.py b/lib/python/qtvcp/lib/qt_vismach/gantry_5axis.py
index dd290e695c1..aee2fad223b 100755
--- a/lib/python/qtvcp/lib/qt_vismach/gantry_5axis.py
+++ b/lib/python/qtvcp/lib/qt_vismach/gantry_5axis.py
@@ -41,14 +41,14 @@ def coords(self):
return -self.comp.tool_length, r, 0, r
c = hal.component("5axisgui")
-c.newpin("jx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jb", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jc", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diam", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pivot_len", hal.HAL_FLOAT, hal.HAL_OUT)
+c.newpin("jx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jb", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jc", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diam", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pivot_len", hal.Type.REAL, hal.Dir.OUT)
c["pivot_len"] = pivot_len
c.ready()
diff --git a/lib/python/qtvcp/lib/qt_vismach/millturn.py b/lib/python/qtvcp/lib/qt_vismach/millturn.py
index 438755e61d4..b5211ed749f 100755
--- a/lib/python/qtvcp/lib/qt_vismach/millturn.py
+++ b/lib/python/qtvcp/lib/qt_vismach/millturn.py
@@ -19,18 +19,18 @@
# add joints. Mill has 3.
c = hal.component("millturngui")
# follow ZYX directly
-#c.newpin("jointX", hal.HAL_FLOAT, hal.HAL_IN)
-#c.newpin("jointY", hal.HAL_FLOAT, hal.HAL_IN)
-#c.newpin("jointZ", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointA", hal.HAL_FLOAT, hal.HAL_IN)
+#c.newpin("jointX", hal.Type.REAL, hal.Dir.IN)
+#c.newpin("jointY", hal.Type.REAL, hal.Dir.IN)
+#c.newpin("jointZ", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointA", hal.Type.REAL, hal.Dir.IN)
# kinematics pins
-c.newpin("millkins", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("millkins", hal.Type.BOOL, hal.Dir.IN)
# tool length and diameter pins?
-c.newpin("toollength", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tooldiameter", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-x-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("toollength", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tooldiameter", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-x-offset", hal.Type.REAL, hal.Dir.IN)
# tells loadusr pins is ready
c.ready()
diff --git a/lib/python/qtvcp/qt_halobjects.py b/lib/python/qtvcp/qt_halobjects.py
index 64b5bb0d28e..c8007dd0e69 100644
--- a/lib/python/qtvcp/qt_halobjects.py
+++ b/lib/python/qtvcp/qt_halobjects.py
@@ -114,16 +114,18 @@ def get_name(self):
return self._a[0]
class _QHal(object):
- HAL_BIT = hal.HAL_BIT
- HAL_FLOAT = hal.HAL_FLOAT
- HAL_S32 = hal.HAL_S32
- HAL_U32 = hal.HAL_U32
-
- HAL_IN = hal.HAL_IN
- HAL_OUT = hal.HAL_OUT
- HAL_IO = hal.HAL_IO
- HAL_RO = hal.HAL_RO
- HAL_RW = hal.HAL_RW
+ HAL_BIT = hal.Type.BOOL
+ HAL_FLOAT = hal.Type.REAL
+ HAL_SINT = hal.Type.SINT
+ HAL_UINT = hal.Type.UINT
+ HAL_S32 = hal.Type.SINT
+ HAL_U32 = hal.Type.UINT
+
+ HAL_IN = hal.Dir.IN
+ HAL_OUT = hal.Dir.OUT
+ HAL_IO = hal.Dir.IO
+ HAL_RO = hal.Dir.RO
+ HAL_RW = hal.Dir.RW
def __new__(cls, *a, **kw):
instance = super(_QHal, cls).__new__(cls)
diff --git a/lib/python/qtvcp/widgets/axis_tool_button.py b/lib/python/qtvcp/widgets/axis_tool_button.py
index d2c58f7a55b..20411a62bdc 100644
--- a/lib/python/qtvcp/widgets/axis_tool_button.py
+++ b/lib/python/qtvcp/widgets/axis_tool_button.py
@@ -131,8 +131,8 @@ def homed_on_test():
else:
pname = self._pin_name_
- self.hal_pin_joint = self.HAL_GCOMP_.newpin(str(pname + '-joint'), hal.HAL_BIT, hal.HAL_OUT)
- self.hal_pin_axis = self.HAL_GCOMP_.newpin(str(pname + '-axis'), hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_pin_joint = self.HAL_GCOMP_.newpin(str(pname + '-joint'), hal.Type.BOOL, hal.Dir.OUT)
+ self.hal_pin_axis = self.HAL_GCOMP_.newpin(str(pname + '-axis'), hal.Type.BOOL, hal.Dir.OUT)
STATUS.connect('general',self.return_value)
def _enableGroup(self, state,bstate):
diff --git a/lib/python/qtvcp/widgets/bar.py b/lib/python/qtvcp/widgets/bar.py
index 36a1a83020a..6c861674a8f 100644
--- a/lib/python/qtvcp/widgets/bar.py
+++ b/lib/python/qtvcp/widgets/bar.py
@@ -408,8 +408,8 @@ def resetVert(self):
class HALPinType(enum.IntEnum):
NONE = 0
- S32 = hal.HAL_S32
- FLOAT = hal.HAL_FLOAT
+ S32 = hal.Type.SINT
+ FLOAT = hal.Type.REAL
class HalBar(Bar, _HalWidgetBase):
@@ -418,8 +418,8 @@ class HalBar(Bar, _HalWidgetBase):
# older version of pyqt5 need this as well as QEnum
NONE = 0
- S32 = hal.HAL_S32
- FLOAT = hal.HAL_FLOAT
+ S32 = hal.Type.SINT
+ FLOAT = hal.Type.REAL
def __init__(self, *args, **kwargs):
super(). __init__( *args, **kwargs)
@@ -437,10 +437,10 @@ def _hal_init(self):
self._superOpposite = self._opposite
if self._pin_type == HALPinType.FLOAT:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.REAL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.updateDisplay(data))
elif self._pin_type == HALPinType.S32:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_S32, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.SINT, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.updateDisplay(data))
def updateDisplay(self, data):
diff --git a/lib/python/qtvcp/widgets/basic_probe.py b/lib/python/qtvcp/widgets/basic_probe.py
index 74f93959ad6..1e9a2bddce9 100644
--- a/lib/python/qtvcp/widgets/basic_probe.py
+++ b/lib/python/qtvcp/widgets/basic_probe.py
@@ -198,7 +198,7 @@ def homed_on_status():
# make pins available for tool measure remaps
oldname = self.HAL_GCOMP_.comp.getprefix()
self.HAL_GCOMP_.comp.setprefix('qtbasicprobe')
- self.probe_loaded = self.HAL_GCOMP_.newpin("probe-loaded", hal.HAL_BIT, hal.HAL_OUT)
+ self.probe_loaded = self.HAL_GCOMP_.newpin("probe-loaded", hal.Type.BOOL, hal.Dir.OUT)
self.HAL_GCOMP_.comp.setprefix(oldname)
# get current style of the line input
diff --git a/lib/python/qtvcp/widgets/camview_widget.py b/lib/python/qtvcp/widgets/camview_widget.py
index 5e11ef65437..0e0fe25e539 100644
--- a/lib/python/qtvcp/widgets/camview_widget.py
+++ b/lib/python/qtvcp/widgets/camview_widget.py
@@ -98,7 +98,7 @@ def __init__(self, parent=None):
def _hal_init(self):
try:
- self.pin_ = self.HAL_GCOMP_.newpin('cam-rotation',hal.HAL_FLOAT, hal.HAL_OUT)
+ self.pin_ = self.HAL_GCOMP_.newpin('cam-rotation',hal.Type.REAL, hal.Dir.OUT)
except:
pass
if LIB_GOOD:
diff --git a/lib/python/qtvcp/widgets/dialog_widget.py b/lib/python/qtvcp/widgets/dialog_widget.py
index c281869bfcb..bbe9a05e167 100644
--- a/lib/python/qtvcp/widgets/dialog_widget.py
+++ b/lib/python/qtvcp/widgets/dialog_widget.py
@@ -441,11 +441,11 @@ def _hal_init(self):
if not hal.component_exists('hal_manualtoolchange'):
oldname = self.HAL_GCOMP_.comp.getprefix()
self.HAL_GCOMP_.comp.setprefix('hal_manualtoolchange')
- self.hal_pin = self.HAL_GCOMP_.newpin('change', hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin('change', hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.value_changed.connect(self.tool_change)
- self.tool_number = self.HAL_GCOMP_.newpin('number', hal.HAL_S32, hal.HAL_IN)
- self.changed = self.HAL_GCOMP_.newpin('changed', hal.HAL_BIT, hal.HAL_OUT)
- self.ext_ack = self.HAL_GCOMP_.newpin(self.HAL_NAME_ + 'change_button', hal.HAL_BIT, hal.HAL_IN)
+ self.tool_number = self.HAL_GCOMP_.newpin('number', hal.Type.SINT, hal.Dir.IN)
+ self.changed = self.HAL_GCOMP_.newpin('changed', hal.Type.BOOL, hal.Dir.OUT)
+ self.ext_ack = self.HAL_GCOMP_.newpin(self.HAL_NAME_ + 'change_button', hal.Type.BOOL, hal.Dir.IN)
self.ext_ack.value_changed.connect(self.external_acknowledge)
self.HAL_GCOMP_.comp.setprefix(oldname)
else:
diff --git a/lib/python/qtvcp/widgets/general_hal_input.py b/lib/python/qtvcp/widgets/general_hal_input.py
index 2da821acc0d..3f8cd3be73e 100644
--- a/lib/python/qtvcp/widgets/general_hal_input.py
+++ b/lib/python/qtvcp/widgets/general_hal_input.py
@@ -48,14 +48,14 @@ def _hal_init(self):
else:
pname = self._pin_name
if self._bit_pin_type:
- ptype = hal.HAL_BIT
- self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_, hal.HAL_BIT, hal.HAL_IN)
+ ptype = hal.Type.BOOL
+ self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.pin_update(data))
elif self._float_pin_type:
- self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_, hal.Type.REAL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.pin_update(data))
else:
- self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_, hal.HAL_S32, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_, hal.Type.SINT, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.pin_update(data))
def pin_update(self, *a):
diff --git a/lib/python/qtvcp/widgets/general_hal_output.py b/lib/python/qtvcp/widgets/general_hal_output.py
index 4133cd6979e..bf555cf3d6d 100644
--- a/lib/python/qtvcp/widgets/general_hal_output.py
+++ b/lib/python/qtvcp/widgets/general_hal_output.py
@@ -47,16 +47,16 @@ def _hal_init(self):
else:
pname = self._pin_name
if self._bit_pin_type:
- ptype = hal.HAL_BIT
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, ptype, hal.HAL_OUT)
- self.hal_pin_2 = self.HAL_GCOMP_.newpin(pname + "-not", ptype, hal.HAL_OUT)
+ ptype = hal.Type.BOOL
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, ptype, hal.Dir.OUT)
+ self.hal_pin_2 = self.HAL_GCOMP_.newpin(pname + "-not", ptype, hal.Dir.OUT)
if self.istate:
self._pin_bit_update(self._initial_float)
else:
- ptype = hal.HAL_S32
- ptype2 = hal.HAL_FLOAT
- self.hal_pin = self.HAL_GCOMP_.newpin(pname + '-s32', ptype, hal.HAL_OUT)
- self.hal_pin_2 = self.HAL_GCOMP_.newpin(pname + "-float", ptype2, hal.HAL_OUT)
+ ptype = hal.Type.SINT
+ ptype2 = hal.Type.REAL
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname + '-s32', ptype, hal.Dir.OUT)
+ self.hal_pin_2 = self.HAL_GCOMP_.newpin(pname + "-float", ptype2, hal.Dir.OUT)
if self.istate:
self._pin_value_update(self._initial_float)
diff --git a/lib/python/qtvcp/widgets/hal_label.py b/lib/python/qtvcp/widgets/hal_label.py
index c35ac341d75..add3f4fc664 100644
--- a/lib/python/qtvcp/widgets/hal_label.py
+++ b/lib/python/qtvcp/widgets/hal_label.py
@@ -49,13 +49,13 @@ def _hal_init(self):
else:
pname = self._pin_name
if self._bit_pin_type:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self._setText(data))
elif self._float_pin_type:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.REAL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self._setText(data))
elif self._s32_pin_type or self._use_multi_label:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_S32, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.SINT, hal.Dir.IN)
if self._s32_pin_type:
self.hal_pin.value_changed.connect(lambda data: self._setText(data))
else:
diff --git a/lib/python/qtvcp/widgets/hal_selectionbox.py b/lib/python/qtvcp/widgets/hal_selectionbox.py
index 3bb466ed9e9..6ad6fdb0b0a 100644
--- a/lib/python/qtvcp/widgets/hal_selectionbox.py
+++ b/lib/python/qtvcp/widgets/hal_selectionbox.py
@@ -106,16 +106,16 @@ def selected(self,index):
################################################################
class HALSelectionBox(TreeComboBox, _HalWidgetBase):
- HAL_BIT = hal.HAL_BIT
- HAL_FLOAT = hal.HAL_FLOAT
- HAL_S32 = hal.HAL_S32
- HAL_U32 = hal.HAL_U32
-
- HAL_IN = hal.HAL_IN
- HAL_OUT = hal.HAL_OUT
- HAL_IO = hal.HAL_IO
- HAL_RO = hal.HAL_RO
- HAL_RW = hal.HAL_RW
+ HAL_BIT = hal.Type.BOOL
+ HAL_FLOAT = hal.Type.REAL
+ HAL_S32 = hal.Type.SINT
+ HAL_U32 = hal.Type.UINT
+
+ HAL_IN = hal.Dir.IN
+ HAL_OUT = hal.Dir.OUT
+ HAL_IO = hal.Dir.IO
+ HAL_RO = hal.Dir.RO
+ HAL_RW = hal.Dir.RW
PINS = 1
SIGS = SIGNALS = 2
diff --git a/lib/python/qtvcp/widgets/indicatorMixIn.py b/lib/python/qtvcp/widgets/indicatorMixIn.py
index bda4fd8172e..89db9755b97 100644
--- a/lib/python/qtvcp/widgets/indicatorMixIn.py
+++ b/lib/python/qtvcp/widgets/indicatorMixIn.py
@@ -116,10 +116,10 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin_led = self.HAL_GCOMP_.newpin(pname + '-led', hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin_led = self.HAL_GCOMP_.newpin(pname + '-led', hal.Type.BOOL, hal.Dir.IN)
self.hal_pin_led.value_changed.connect(lambda data: self.indicator_update(data))
if self._doubleIndicator:
- self.hal_pin_led2 = self.HAL_GCOMP_.newpin(pname + '-led2', hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin_led2 = self.HAL_GCOMP_.newpin(pname + '-led2', hal.Type.BOOL, hal.Dir.IN)
self.hal_pin_led2.value_changed.connect(lambda data: self.indicator2_update(data))
elif self._ind_status:
diff --git a/lib/python/qtvcp/widgets/jog_increments.py b/lib/python/qtvcp/widgets/jog_increments.py
index c54caa3ba93..05a079d6a56 100644
--- a/lib/python/qtvcp/widgets/jog_increments.py
+++ b/lib/python/qtvcp/widgets/jog_increments.py
@@ -51,7 +51,7 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_FLOAT, hal.HAL_OUT)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.REAL, hal.Dir.OUT)
if self.linear:
for item in (INFO.JOG_INCREMENTS):
self.addItem(item)
diff --git a/lib/python/qtvcp/widgets/joypad.py b/lib/python/qtvcp/widgets/joypad.py
index fd35549ebc2..3a7824c82ff 100644
--- a/lib/python/qtvcp/widgets/joypad.py
+++ b/lib/python/qtvcp/widgets/joypad.py
@@ -539,9 +539,9 @@ def __setitem__(self, item, value):
class HALPinType(enum.IntEnum):
NONE = 0
- BIT = hal.HAL_BIT
- S32 = hal.HAL_S32
- FLOAT = hal.HAL_FLOAT
+ BIT = hal.Type.BOOL
+ S32 = hal.Type.SINT
+ FLOAT = hal.Type.REAL
class HALPad(JoyPad, _HalWidgetBase):
HALPinType = HALPinType
@@ -549,9 +549,9 @@ class HALPad(JoyPad, _HalWidgetBase):
# older version of pyqt5 need this as well as QEnum
NONE = 0
- BIT = hal.HAL_BIT
- S32 = hal.HAL_S32
- FLOAT = hal.HAL_FLOAT
+ BIT = hal.Type.BOOL
+ S32 = hal.Type.SINT
+ FLOAT = hal.Type.REAL
def __init__(self, parent=None):
super(HALPad, self).__init__(parent)
@@ -579,13 +579,13 @@ def _hal_init(self):
pname = self._pin_name
if not self._pin_type == HALPinType.NONE:
ptype = self._pin_type
- self.halPinR = self.HAL_GCOMP_.newpin(pname + '.right', ptype, hal.HAL_OUT)
- self.halPinL = self.HAL_GCOMP_.newpin(pname + '.left', ptype, hal.HAL_OUT)
- self.halPinT = self.HAL_GCOMP_.newpin(pname + '.top', ptype, hal.HAL_OUT)
- self.halPinB = self.HAL_GCOMP_.newpin(pname + '.bottom', ptype, hal.HAL_OUT)
- self.halPinC = self.HAL_GCOMP_.newpin(pname + '.center', ptype, hal.HAL_OUT)
+ self.halPinR = self.HAL_GCOMP_.newpin(pname + '.right', ptype, hal.Dir.OUT)
+ self.halPinL = self.HAL_GCOMP_.newpin(pname + '.left', ptype, hal.Dir.OUT)
+ self.halPinT = self.HAL_GCOMP_.newpin(pname + '.top', ptype, hal.Dir.OUT)
+ self.halPinB = self.HAL_GCOMP_.newpin(pname + '.bottom', ptype, hal.Dir.OUT)
+ self.halPinC = self.HAL_GCOMP_.newpin(pname + '.center', ptype, hal.Dir.OUT)
if not self._highlightPosition == IndicatorPosition.NONE:
- self.halPinLightCenter = self.HAL_GCOMP_.newpin(pname + '.light.center', hal.HAL_BIT, hal.HAL_IN)
+ self.halPinLightCenter = self.HAL_GCOMP_.newpin(pname + '.light.center', hal.Type.BOOL, hal.Dir.IN)
self.halPinLightCenter.value_changed.connect(lambda data: self.setLight(data))
def _pressedOutput(self, btncode):
diff --git a/lib/python/qtvcp/widgets/led_widget.py b/lib/python/qtvcp/widgets/led_widget.py
index 6c55ee8b1aa..bc4409f7074 100644
--- a/lib/python/qtvcp/widgets/led_widget.py
+++ b/lib/python/qtvcp/widgets/led_widget.py
@@ -64,7 +64,7 @@ def _hal_init(self):
else:
pname = self._pin_name_
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda s: self.change_state(s))
@Slot(bool)
diff --git a/lib/python/qtvcp/widgets/round_gauge.py b/lib/python/qtvcp/widgets/round_gauge.py
index 04f3ed64187..f0268f083f2 100644
--- a/lib/python/qtvcp/widgets/round_gauge.py
+++ b/lib/python/qtvcp/widgets/round_gauge.py
@@ -37,9 +37,9 @@ def __init__(self, parent=None):
def _hal_init(self):
if (self._halpin_option):
- self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_ + "_value", hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_ + "_value", hal.Type.REAL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda value: self.update_value(value))
- self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_ + "_setpoint", hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(self.HAL_NAME_ + "_setpoint", hal.Type.REAL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda value: self.set_setpoint(value))
def create_unit_array(self):
diff --git a/lib/python/qtvcp/widgets/simple_widgets.py b/lib/python/qtvcp/widgets/simple_widgets.py
index 8af83620e10..d5d341c69bd 100644
--- a/lib/python/qtvcp/widgets/simple_widgets.py
+++ b/lib/python/qtvcp/widgets/simple_widgets.py
@@ -45,9 +45,9 @@
class HALPinType(enum.IntEnum):
NONE = 0
- BIT = hal.HAL_BIT
- S32 = hal.HAL_S32
- FLOAT = hal.HAL_FLOAT
+ BIT = hal.Type.BOOL
+ S32 = hal.Type.SINT
+ FLOAT = hal.Type.REAL
# reacts to HAL pin changes
class LCDNumber(QtWidgets.QLCDNumber, _HalWidgetBase):
@@ -64,13 +64,13 @@ def _hal_init(self):
else:
pname = self._pin_name_
if self._bit_pin_type:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.updateDisplay(data))
elif self._float_pin_type:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.REAL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.updateFloatDisplay(data))
elif self._s32_pin_type:
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_S32, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.SINT, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda data: self.updateDisplay(data))
def updateDisplay(self, data):
@@ -177,9 +177,9 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin_s = self.HAL_GCOMP_.newpin(str(pname +'-s'), hal.HAL_S32, hal.HAL_OUT)
- self.hal_pin_f = self.HAL_GCOMP_.newpin(pname +'-f', hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_scale = self.HAL_GCOMP_.newpin(pname +'-scale', hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin_s = self.HAL_GCOMP_.newpin(str(pname +'-s'), hal.Type.SINT, hal.Dir.OUT)
+ self.hal_pin_f = self.HAL_GCOMP_.newpin(pname +'-f', hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_scale = self.HAL_GCOMP_.newpin(pname +'-scale', hal.Type.REAL, hal.Dir.IN)
self.hal_pin_scale.set(1)
self.updateValue(self.value())
self.valueChanged.connect(lambda data:self.updateValue(data))
@@ -212,10 +212,10 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin_s = self.HAL_GCOMP_.newpin(str(pname +'-s'), hal.HAL_S32, hal.HAL_OUT)
- self.hal_pin_f = self.HAL_GCOMP_.newpin(pname +'-f', hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_d = self.HAL_GCOMP_.newpin(pname +'-d', hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_scale = self.HAL_GCOMP_.newpin(pname +'-scale', hal.HAL_FLOAT, hal.HAL_IN)
+ self.hal_pin_s = self.HAL_GCOMP_.newpin(str(pname +'-s'), hal.Type.SINT, hal.Dir.OUT)
+ self.hal_pin_f = self.HAL_GCOMP_.newpin(pname +'-f', hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_d = self.HAL_GCOMP_.newpin(pname +'-d', hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_scale = self.HAL_GCOMP_.newpin(pname +'-scale', hal.Type.REAL, hal.Dir.IN)
self.hal_pin_scale.value_changed.connect(lambda data: self.updateScale(data))
self.hal_pin_scale.set(1)
self.updateCount(self.value())
@@ -359,9 +359,9 @@ class PushButton(QtWidgets.QPushButton, IndicatedMixIn):
# older version of pyqt5 need this as well as QEnum
NONE = 0
- BIT = hal.HAL_BIT
- S32 = hal.HAL_S32
- FLOAT = hal.HAL_FLOAT
+ BIT = hal.Type.BOOL
+ S32 = hal.Type.SINT
+ FLOAT = hal.Type.REAL
def __init__(self, parent=None):
super(PushButton, self).__init__(parent)
@@ -397,7 +397,7 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin = self.HAL_GCOMP_.newpin(str(pname), hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_pin = self.HAL_GCOMP_.newpin(str(pname), hal.Type.BOOL, hal.Dir.OUT)
super(PushButton, self)._hal_init()
@@ -434,7 +434,7 @@ def makeGroupPin(self):
pname = self.HAL_NAME_ + '.exclusive'+name
else:
pname = self._groupPinName
- self.halPinGroup = self.HAL_GCOMP_.newpin(pname , ptype, hal.HAL_OUT)
+ self.halPinGroup = self.HAL_GCOMP_.newpin(pname , ptype, hal.Dir.OUT)
break
break
diff --git a/lib/python/qtvcp/widgets/state_led.py b/lib/python/qtvcp/widgets/state_led.py
index ab6b9c2668a..6a1bddd24fd 100644
--- a/lib/python/qtvcp/widgets/state_led.py
+++ b/lib/python/qtvcp/widgets/state_led.py
@@ -83,7 +83,7 @@ def only_false(data):
pname = self.HAL_NAME_
else:
pname = self._halpin_name
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.BOOL, hal.Dir.OUT)
if self.is_estopped:
STATUS.connect('state-estop', lambda w: self._flip_state(True))
STATUS.connect('state-estop-reset', lambda w: self._flip_state(False))
diff --git a/lib/python/qtvcp/widgets/status_slider.py b/lib/python/qtvcp/widgets/status_slider.py
index fa1b93571e8..6daa2fad754 100644
--- a/lib/python/qtvcp/widgets/status_slider.py
+++ b/lib/python/qtvcp/widgets/status_slider.py
@@ -121,7 +121,7 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin = self.HAL_GCOMP_.newpin(str(pname), hal.HAL_FLOAT, hal.HAL_OUT)
+ self.hal_pin = self.HAL_GCOMP_.newpin(str(pname), hal.Type.REAL, hal.Dir.OUT)
# connect a signal and callback function to the button
self.doubleValueChanged.connect(self._action)
diff --git a/lib/python/qtvcp/widgets/versa_probe.py b/lib/python/qtvcp/widgets/versa_probe.py
index efa18563d06..8528226a3a3 100644
--- a/lib/python/qtvcp/widgets/versa_probe.py
+++ b/lib/python/qtvcp/widgets/versa_probe.py
@@ -234,17 +234,17 @@ def homed_on_test():
# make pins available for tool measure remaps
oldname = self.HAL_GCOMP_.comp.getprefix()
self.HAL_GCOMP_.comp.setprefix('qtversaprobe')
- self.pin_svel = self.HAL_GCOMP_.newpin("searchvel", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.pin_svel = self.HAL_GCOMP_.newpin("searchvel", hal.Type.REAL, hal.Dir.OUT)
self.pin_svel.set(float(self.input_search_vel.text()))
- self.pin_pvel = self.HAL_GCOMP_.newpin("probevel", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.pin_pvel = self.HAL_GCOMP_.newpin("probevel", hal.Type.REAL, hal.Dir.OUT)
self.pin_pvel.set(float(self.input_probe_vel.text()))
- self.pin_pheight = self.HAL_GCOMP_.newpin("probeheight", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.pin_pheight = self.HAL_GCOMP_.newpin("probeheight", hal.Type.REAL, hal.Dir.OUT)
self.pin_pheight.set(float(self.input_tool_probe_height.text()))
- self.pin_bheight = self.HAL_GCOMP_.newpin("blockheight", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.pin_bheight = self.HAL_GCOMP_.newpin("blockheight", hal.Type.REAL, hal.Dir.OUT)
self.pin_bheight.set(float(self.input_tool_block_height.text()))
- self.pin_latch_rtn = self.HAL_GCOMP_.newpin("backoffdist", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.pin_latch_rtn = self.HAL_GCOMP_.newpin("backoffdist", hal.Type.REAL, hal.Dir.OUT)
self.pin_latch_rtn.set(float(self.input_latch_return_dist.text()))
- self.probe_loaded = self.HAL_GCOMP_.newpin("probe-loaded", hal.HAL_BIT, hal.HAL_OUT)
+ self.probe_loaded = self.HAL_GCOMP_.newpin("probe-loaded", hal.Type.BOOL, hal.Dir.OUT)
self.HAL_GCOMP_.comp.setprefix(oldname)
# install callbacks to update HAL pins
diff --git a/lib/python/qtvcp/widgets/widget_baseclass.py b/lib/python/qtvcp/widgets/widget_baseclass.py
index 23bfa396f45..67f048285bd 100644
--- a/lib/python/qtvcp/widgets/widget_baseclass.py
+++ b/lib/python/qtvcp/widgets/widget_baseclass.py
@@ -120,8 +120,8 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_BIT, hal.HAL_OUT)
- self.hal_pin_not = self.HAL_GCOMP_.newpin(pname + "-not", hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.BOOL, hal.Dir.OUT)
+ self.hal_pin_not = self.HAL_GCOMP_.newpin(pname + "-not", hal.Type.BOOL, hal.Dir.OUT)
self.toggled.connect(lambda data: self._pin_update(data))
def _pin_update(self, state):
@@ -142,8 +142,8 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin_f = self.HAL_GCOMP_.newpin(pname + "-f", hal.HAL_FLOAT, hal.HAL_OUT)
- self.hal_pin_s = self.HAL_GCOMP_.newpin(pname + "-s", hal.HAL_S32, hal.HAL_OUT)
+ self.hal_pin_f = self.HAL_GCOMP_.newpin(pname + "-f", hal.Type.REAL, hal.Dir.OUT)
+ self.hal_pin_s = self.HAL_GCOMP_.newpin(pname + "-s", hal.Type.SINT, hal.Dir.OUT)
self.valueChanged.connect(lambda data: self._pin_update(data))
# default scale
self.input = 1
@@ -169,7 +169,7 @@ def _hal_init(self):
pname = self.HAL_NAME_
else:
pname = self._pin_name_
- self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.HAL_BIT, hal.HAL_IN)
+ self.hal_pin = self.HAL_GCOMP_.newpin(pname, hal.Type.BOOL, hal.Dir.IN)
self.hal_pin.value_changed.connect(lambda s: self.setEnabled(s))
def set_pin_name(self, value):
diff --git a/lib/python/raster.py b/lib/python/raster.py
index 4e87095c3bb..37676dd5756 100644
--- a/lib/python/raster.py
+++ b/lib/python/raster.py
@@ -54,10 +54,10 @@ def __init__(self, name):
"""
self.__timeout = 5.0
self.component = hal.component(name)
- self.port = self.component.newpin("program", hal.HAL_PORT, hal.HAL_OUT)
- self.faultCode = self.component.newpin("fault-code", hal.HAL_S32, hal.HAL_IN)
- self.enabled = self.component.newpin("enabled", hal.HAL_BIT, hal.HAL_IN)
- self.run = self.component.newpin("run", hal.HAL_BIT, hal.HAL_OUT)
+ self.port = self.component.newpin("program", hal.Type.PORT, hal.Dir.OUT)
+ self.faultCode = self.component.newpin("fault-code", hal.Type.SINT, hal.Dir.IN)
+ self.enabled = self.component.newpin("enabled", hal.Type.BOOL, hal.Dir.IN)
+ self.run = self.component.newpin("run", hal.Type.BOOL, hal.Dir.OUT)
self.component.ready()
self.run.value = False
diff --git a/lib/python/vismach.py b/lib/python/vismach.py
index a35f2b2ee5a..009103df62a 100644
--- a/lib/python/vismach.py
+++ b/lib/python/vismach.py
@@ -1558,7 +1558,7 @@ def main(model, tool, work, size=10, hud=0, rotation_vectors=None, lat=0, lon=0)
t.after(100, lambda: t.set_viewangle(lat, lon, forcerotate=1))
vcomp = hal.component("vismach")
- vcomp.newpin("plotclear",hal.HAL_BIT,hal.HAL_IN)
+ vcomp.newpin("plotclear",hal.Type.BOOL,hal.Dir.IN)
vcomp.ready()
#there's probably a better way of doing this
diff --git a/nc_files/remap_lib/python-stdglue/stdglue.py b/nc_files/remap_lib/python-stdglue/stdglue.py
index a3b93019afa..8457e400f38 100644
--- a/nc_files/remap_lib/python-stdglue/stdglue.py
+++ b/nc_files/remap_lib/python-stdglue/stdglue.py
@@ -33,8 +33,8 @@ def build_hal(self):
import hal
try:
h=hal.component('remapStat')
- h.newpin("tool", hal.HAL_S32, hal.HAL_OUT)
- h.newpin("wear", hal.HAL_S32, hal.HAL_OUT)
+ h.newpin("tool", hal.Type.SINT, hal.Dir.OUT)
+ h.newpin("wear", hal.Type.SINT, hal.Dir.OUT)
h.ready()
self.hal_tool_comp = h
except Exception as e:
diff --git a/share/gscreen/skins/silverdragon/silverdragon_handler.py b/share/gscreen/skins/silverdragon/silverdragon_handler.py
index 3d08239aee7..e78c1a1db8c 100644
--- a/share/gscreen/skins/silverdragon/silverdragon_handler.py
+++ b/share/gscreen/skins/silverdragon/silverdragon_handler.py
@@ -326,18 +326,18 @@ def init_sensitive_all_homed(self):
def initialize_pins(self):
# pins for block height
- self.halcomp.newpin("sensor_height", hal.HAL_FLOAT, hal.HAL_OUT)
- pin = self.halcomp.newpin("block_height", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("sensor_height", hal.Type.REAL, hal.Dir.OUT)
+ pin = self.halcomp.newpin("block_height", hal.Type.REAL, hal.Dir.OUT)
hal_glib.GPin(pin).connect("value_changed", self.on_blockheight_changed)
self.halcomp["block_height"] = self.gscreen.prefs.getpref("blockheight", 0.0, float)
# pins for probing
- self.halcomp.newpin("search_vel", hal.HAL_FLOAT, hal.HAL_OUT)
- self.halcomp.newpin("probe_vel", hal.HAL_FLOAT, hal.HAL_OUT)
- self.halcomp.newpin("maxprobe", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("search_vel", hal.Type.REAL, hal.Dir.OUT)
+ self.halcomp.newpin("probe_vel", hal.Type.REAL, hal.Dir.OUT)
+ self.halcomp.newpin("maxprobe", hal.Type.REAL, hal.Dir.OUT)
# pins for clear_mdi button
- self.halcomp.newpin("clear_mdi", hal.HAL_BIT, hal.HAL_OUT)
- pin = self.halcomp.newpin("clear_mdi-waiting", hal.HAL_BIT, hal.HAL_OUT)
- pin = self.halcomp.newpin("clear_mdi-response", hal.HAL_BIT, hal.HAL_OUT)
+ self.halcomp.newpin("clear_mdi", hal.Type.BOOL, hal.Dir.OUT)
+ pin = self.halcomp.newpin("clear_mdi-waiting", hal.Type.BOOL, hal.Dir.OUT)
+ pin = self.halcomp.newpin("clear_mdi-response", hal.Type.BOOL, hal.Dir.OUT)
hal_glib.GPin(pin).connect("value_changed", self.on_clear_mdi_changed)
# every 100 milli seconds this gets called
diff --git a/share/gscreen/skins/spartan/spartan_handler.py b/share/gscreen/skins/spartan/spartan_handler.py
index a681cbf108f..258f986308d 100644
--- a/share/gscreen/skins/spartan/spartan_handler.py
+++ b/share/gscreen/skins/spartan/spartan_handler.py
@@ -110,16 +110,16 @@ def initialize_pins(self):
self.gscreen.init_jog_pins()
self.gscreen.init_override_pins()
self.gscreen.init_control_pins()
- self.gscreen.halcomp.newpin("spindle-spd-disp", hal.HAL_FLOAT, hal.HAL_IN)
- self.gscreen.halcomp.newpin("jog-spd-out", hal.HAL_FLOAT, hal.HAL_OUT)
- self.gscreen.halcomp.newpin("jog-inc-out", hal.HAL_FLOAT, hal.HAL_OUT)
- self.data['ext-estop'] = hal_glib.GPin(self.gscreen.halcomp.newpin('ext-estop', hal.HAL_BIT, hal.HAL_IN))
+ self.gscreen.halcomp.newpin("spindle-spd-disp", hal.Type.REAL, hal.Dir.IN)
+ self.gscreen.halcomp.newpin("jog-spd-out", hal.Type.REAL, hal.Dir.OUT)
+ self.gscreen.halcomp.newpin("jog-inc-out", hal.Type.REAL, hal.Dir.OUT)
+ self.data['ext-estop'] = hal_glib.GPin(self.gscreen.halcomp.newpin('ext-estop', hal.Type.BOOL, hal.Dir.IN))
self.data['ext-estop'].connect('value-changed', self.on_estop_in)
- self.data['enc-fault-x'] = hal_glib.GPin(self.gscreen.halcomp.newpin('enc-fault-x', hal.HAL_BIT, hal.HAL_IN))
+ self.data['enc-fault-x'] = hal_glib.GPin(self.gscreen.halcomp.newpin('enc-fault-x', hal.Type.BOOL, hal.Dir.IN))
self.data['enc-fault-x'].connect('value-changed', self.on_x_enc_fault)
- self.data['enc-fault-y'] = hal_glib.GPin(self.gscreen.halcomp.newpin('enc-fault-y', hal.HAL_BIT, hal.HAL_IN))
+ self.data['enc-fault-y'] = hal_glib.GPin(self.gscreen.halcomp.newpin('enc-fault-y', hal.Type.BOOL, hal.Dir.IN))
self.data['enc-fault-y'].connect('value-changed', self.on_y_enc_fault)
- self.data['enc-fault-x'] = hal_glib.GPin(self.gscreen.halcomp.newpin('enc-fault-z', hal.HAL_BIT, hal.HAL_IN))
+ self.data['enc-fault-x'] = hal_glib.GPin(self.gscreen.halcomp.newpin('enc-fault-z', hal.Type.BOOL, hal.Dir.IN))
self.data['enc-fault-x'].connect('value-changed', self.on_z_enc_fault)
def on_emc_off(self,*args):
diff --git a/share/qtvcp/panels/qtplasmac_sim/qtplasmac_sim_handler.py b/share/qtvcp/panels/qtplasmac_sim/qtplasmac_sim_handler.py
index 8e6ea7632fb..9214601d5ed 100644
--- a/share/qtvcp/panels/qtplasmac_sim/qtplasmac_sim_handler.py
+++ b/share/qtvcp/panels/qtplasmac_sim/qtplasmac_sim_handler.py
@@ -53,15 +53,15 @@ def initialized__(self):
appPath = os.path.realpath(os.path.dirname(sys.argv[0]))
self.iconBase = '/usr' if appPath == '/usr/bin' else appPath.replace('/bin', '/debian/extras/usr')
self.w.setWindowIcon(QIcon(os.path.join(self.iconBase, self.iconPath)))
- self.arcVoltsOffsetPin = self.hal.newpin('arc_voltage_offset-f', hal.HAL_FLOAT, hal.HAL_OUT)
- self.breakPin = self.hal.newpin('sensor_breakaway', hal.HAL_BIT, hal.HAL_OUT)
- self.floatPin = self.hal.newpin('sensor_float', hal.HAL_BIT, hal.HAL_OUT)
- self.materialPin = self.hal.newpin('material_height', hal.HAL_FLOAT, hal.HAL_IN)
- self.ohmicPin = self.hal.newpin('sensor_ohmic', hal.HAL_BIT, hal.HAL_OUT)
- self.torchPin = self.hal.newpin('torch_on', hal.HAL_BIT, hal.HAL_IN)
- self.statePin = self.hal.newpin('state', hal.HAL_S32, hal.HAL_IN)
- self.stylePin = self.hal.newpin('style_update', hal.HAL_BIT, hal.HAL_IN)
- self.zPosPin = self.hal.newpin('z_position', hal.HAL_FLOAT, hal.HAL_IN)
+ self.arcVoltsOffsetPin = self.hal.newpin('arc_voltage_offset-f', hal.Type.REAL, hal.Dir.OUT)
+ self.breakPin = self.hal.newpin('sensor_breakaway', hal.Type.BOOL, hal.Dir.OUT)
+ self.floatPin = self.hal.newpin('sensor_float', hal.Type.BOOL, hal.Dir.OUT)
+ self.materialPin = self.hal.newpin('material_height', hal.Type.REAL, hal.Dir.IN)
+ self.ohmicPin = self.hal.newpin('sensor_ohmic', hal.Type.BOOL, hal.Dir.OUT)
+ self.torchPin = self.hal.newpin('torch_on', hal.Type.BOOL, hal.Dir.IN)
+ self.statePin = self.hal.newpin('state', hal.Type.SINT, hal.Dir.IN)
+ self.stylePin = self.hal.newpin('style_update', hal.Type.BOOL, hal.Dir.IN)
+ self.zPosPin = self.hal.newpin('z_position', hal.Type.REAL, hal.Dir.IN)
simStepconf = False
for sig in hal.get_info_signals():
if sig['NAME'] == 'Zjoint-pos-fb':
diff --git a/share/qtvcp/panels/vismach_router_atc/vismach_router_atc_handler.py b/share/qtvcp/panels/vismach_router_atc/vismach_router_atc_handler.py
index 20f62320160..9f5d3821b58 100644
--- a/share/qtvcp/panels/vismach_router_atc/vismach_router_atc_handler.py
+++ b/share/qtvcp/panels/vismach_router_atc/vismach_router_atc_handler.py
@@ -23,9 +23,9 @@
#import hal
#c = hal.component("router_atc")
-#c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-#c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-#c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
+#c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+#c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+#c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
#c.ready()
diff --git a/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py b/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
index dfdaeab8c85..dc922774bb9 100644
--- a/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
+++ b/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
@@ -839,97 +839,97 @@ def new_process_error(self, w, kind, text):
#########################################################################################################################
def make_hal_pins(self):
- self.consChangePin = self.h.newpin('consumable_changing', hal.HAL_BIT, hal.HAL_IN)
- self.convTabDisable = self.h.newpin('conv_disable', hal.HAL_BIT, hal.HAL_IN)
- self.cutTypePin = self.h.newpin('cut_type', hal.HAL_S32, hal.HAL_IN)
- self.developmentPin = self.h.newpin('development', hal.HAL_BIT, hal.HAL_IN)
- self.extAbortPin = self.h.newpin('ext_abort', hal.HAL_BIT, hal.HAL_IN)
- self.extAutoVoltsEnablePin = self.h.newpin('ext_auto_volts_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extChangeConsPin = self.h.newpin('ext_consumables', hal.HAL_BIT, hal.HAL_IN)
- self.extCornerLockEnablePin = self.h.newpin('ext_cornerlock_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecCancelPin = self.h.newpin('ext_cutrec_cancel', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecRevPin = self.h.newpin('ext_cutrec_rev', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecFwdPin = self.h.newpin('ext_cutrec_fwd', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecNPin = self.h.newpin('ext_cutrec_n', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecNEPin = self.h.newpin('ext_cutrec_ne', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecEPin = self.h.newpin('ext_cutrec_e', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecSEPin = self.h.newpin('ext_cutrec_se', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecSPin = self.h.newpin('ext_cutrec_s', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecSWPin = self.h.newpin('ext_cutrec_sw', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecWPin = self.h.newpin('ext_cutrec_w', hal.HAL_BIT, hal.HAL_IN)
- self.extCutRecNWPin = self.h.newpin('ext_cutrec_nw', hal.HAL_BIT, hal.HAL_IN)
- self.extFramingPin = self.h.newpin('ext_frame_job', hal.HAL_BIT, hal.HAL_IN)
- self.extHeightOvrCountsPin = self.h.newpin('ext_height_ovr_counts', hal.HAL_S32, hal.HAL_IN)
- self.extHeightOvrCountEnablePin = self.h.newpin('ext_height_ovr_count_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extHeightOvrMinusPin = self.h.newpin('ext_height_ovr_minus', hal.HAL_BIT, hal.HAL_IN)
- self.extHeightOvrPlusPin = self.h.newpin('ext_height_ovr_plus', hal.HAL_BIT, hal.HAL_IN)
- self.extHeightOvrResetPin = self.h.newpin('ext_height_ovr_reset', hal.HAL_BIT, hal.HAL_IN)
- self.extHeightOvrScalePin = self.h.newpin('ext_height_ovr_scale', hal.HAL_FLOAT, hal.HAL_IN)
- self.extIgnoreArcOkPin = self.h.newpin('ext_ignore_arc_ok', hal.HAL_BIT, hal.HAL_IN)
- self.extJogSlowPin = self.h.newpin('ext_jog_slow', hal.HAL_BIT, hal.HAL_IN)
-# self.extKerfCrossEnablePin = self.h.newpin('ext_kerfcross_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extLaserTouchOffPin = self.h.newpin('ext_laser_touchoff', hal.HAL_BIT, hal.HAL_IN)
- self.extLaserTogglePin = self.h.newpin('ext_laser_toggle', hal.HAL_BIT, hal.HAL_IN)
- self.extMeshModePin = self.h.newpin('ext_mesh_mode', hal.HAL_BIT, hal.HAL_IN)
- self.extOhmicPin = self.h.newpin('ext_ohmic', hal.HAL_BIT, hal.HAL_IN)
- self.extOhmicProbeEnablePin = self.h.newpin('ext_ohmic_probe_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extPausePin = self.h.newpin('ext_pause', hal.HAL_BIT, hal.HAL_IN)
- self.extPauseOnlyPin = self.h.newpin('ext_pause_only', hal.HAL_BIT, hal.HAL_IN)
- self.extPowerPin = self.h.newpin('ext_power', hal.HAL_BIT, hal.HAL_IN)
- self.extProbePin = self.h.newpin('ext_probe', hal.HAL_BIT, hal.HAL_IN)
- self.extPulsePin = self.h.newpin('ext_pulse', hal.HAL_BIT, hal.HAL_IN)
- self.extResumePin = self.h.newpin('ext_resume', hal.HAL_BIT, hal.HAL_IN)
- self.extRunPausePin = self.h.newpin('ext_run_pause', hal.HAL_BIT, hal.HAL_IN)
- self.extRunPin = self.h.newpin('ext_run', hal.HAL_BIT, hal.HAL_IN)
- self.extThcEnablePin = self.h.newpin('ext_thc_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extTorchEnablePin = self.h.newpin('ext_torch_enable', hal.HAL_BIT, hal.HAL_IN)
- self.extTouchOffPin = self.h.newpin('ext_touchoff', hal.HAL_BIT, hal.HAL_IN)
- self.extVoidLockEnablePin = self.h.newpin('ext_voidlock_enable', hal.HAL_BIT, hal.HAL_IN)
- self.gcodeScalePin = self.h.newpin('gcode_scale', hal.HAL_FLOAT, hal.HAL_OUT)
- self.heightOverridePin = self.h.newpin('height_override', hal.HAL_FLOAT, hal.HAL_OUT)
- self.jogInhibited = self.h.newpin('jog_inhibited', hal.HAL_BIT, hal.HAL_IN)
- self.laserOnPin = self.h.newpin('laser_on', hal.HAL_BIT, hal.HAL_OUT)
- self.offsetSetProbePin = self.h.newpin('offset_set_probe', hal.HAL_BIT, hal.HAL_OUT)
- self.offsetSetScribePin = self.h.newpin('offset_set_scribe', hal.HAL_BIT, hal.HAL_OUT)
- self.laserRecStatePin = self.h.newpin('laser_recovery_state', hal.HAL_S32, hal.HAL_IN)
- self.materialChangePin = self.h.newpin('material_change', hal.HAL_S32, hal.HAL_IN)
- self.materialChangeNumberPin = self.h.newpin('material_change_number', hal.HAL_S32, hal.HAL_IN)
- self.materialChangeTimeoutPin = self.h.newpin('material_change_timeout', hal.HAL_BIT, hal.HAL_IN)
- self.materialReloadPin = self.h.newpin('material_reload', hal.HAL_BIT, hal.HAL_IN)
- self.materialTempPin = self.h.newpin('material_temp', hal.HAL_S32, hal.HAL_IN)
- self.offsetsActivePin = self.h.newpin('offsets_active', hal.HAL_BIT, hal.HAL_IN)
- self.ohmicLedInPin = self.h.newpin('ohmic_led_in', hal.HAL_BIT, hal.HAL_IN)
- self.paramTabDisable = self.h.newpin('param_disable', hal.HAL_BIT, hal.HAL_IN)
- self.settingsTabDisable = self.h.newpin('settings_disable', hal.HAL_BIT, hal.HAL_IN)
- self.simStyleUpdate = self.h.newpin('sim_style_update', hal.HAL_BIT, hal.HAL_OUT)
- self.plasmacStatePin = self.h.newpin('plasmac_state', hal.HAL_S32, hal.HAL_IN)
- self.plasmacStopPin = self.h.newpin('plasmac_stop', hal.HAL_S32, hal.HAL_IN)
- self.pmx485CurrentPin = self.h.newpin('pmx485_current', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485CurrentMaxPin = self.h.newpin('pmx485_current_max', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485CurrentMinPin = self.h.newpin('pmx485_current_min', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485FaultPin = self.h.newpin('pmx485_fault', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485ModePin = self.h.newpin('pmx485_mode', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485PressurePin = self.h.newpin('pmx485_pressure', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485PressureMaxPin = self.h.newpin('pmx485_pressure_max', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485PressureMinPin = self.h.newpin('pmx485_pressure_min', hal.HAL_FLOAT, hal.HAL_IN)
- self.pmx485StatusPin = self.h.newpin('pmx485_status', hal.HAL_BIT, hal.HAL_IN)
- self.pmx485ArcTimePin = self.h.newpin('pmx485_arc_time', hal.HAL_FLOAT, hal.HAL_IN)
- self.probeTestErrorPin = self.h.newpin('probe_test_error', hal.HAL_BIT, hal.HAL_IN)
- self.out0Pin = self.h.newpin('ext_out_0', hal.HAL_BIT, hal.HAL_OUT)
- self.out1Pin = self.h.newpin('ext_out_1', hal.HAL_BIT, hal.HAL_OUT)
- self.out2Pin = self.h.newpin('ext_out_2', hal.HAL_BIT, hal.HAL_OUT)
- self.sensorActive = self.h.newpin('sensor_active', hal.HAL_BIT, hal.HAL_IN)
- self.tabsAlwaysEnabled = self.h.newpin('tabs_always_enabled', hal.HAL_BIT, hal.HAL_IN)
- self.thcFeedRatePin = self.h.newpin('thc_feed_rate', hal.HAL_FLOAT, hal.HAL_OUT)
- self.velReduct = self.h.newpin('vel_reduct', hal.HAL_FLOAT, hal.HAL_IN)
- self.xOffsetPin = self.h.newpin('x_offset', hal.HAL_FLOAT, hal.HAL_IN)
- self.yOffsetPin = self.h.newpin('y_offset', hal.HAL_FLOAT, hal.HAL_IN)
- self.zHeightPin = self.h.newpin('z_height', hal.HAL_FLOAT, hal.HAL_IN)
- self.zOffsetPin = self.h.newpin('z_offset_counts', hal.HAL_S32, hal.HAL_IN)
- self.xMinPierceExtentPin = self.h.newpin('x_min_pierce_extent', hal.HAL_FLOAT, hal.HAL_IN)
- self.xMaxPierceExtentPin = self.h.newpin('x_max_pierce_extent', hal.HAL_FLOAT, hal.HAL_IN)
- self.yMinPierceExtentPin = self.h.newpin('y_min_pierce_extent', hal.HAL_FLOAT, hal.HAL_IN)
- self.yMaxPierceExtentPin = self.h.newpin('y_max_pierce_extent', hal.HAL_FLOAT, hal.HAL_IN)
+ self.consChangePin = self.h.newpin('consumable_changing', hal.Type.BOOL, hal.Dir.IN)
+ self.convTabDisable = self.h.newpin('conv_disable', hal.Type.BOOL, hal.Dir.IN)
+ self.cutTypePin = self.h.newpin('cut_type', hal.Type.SINT, hal.Dir.IN)
+ self.developmentPin = self.h.newpin('development', hal.Type.BOOL, hal.Dir.IN)
+ self.extAbortPin = self.h.newpin('ext_abort', hal.Type.BOOL, hal.Dir.IN)
+ self.extAutoVoltsEnablePin = self.h.newpin('ext_auto_volts_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extChangeConsPin = self.h.newpin('ext_consumables', hal.Type.BOOL, hal.Dir.IN)
+ self.extCornerLockEnablePin = self.h.newpin('ext_cornerlock_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecCancelPin = self.h.newpin('ext_cutrec_cancel', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecRevPin = self.h.newpin('ext_cutrec_rev', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecFwdPin = self.h.newpin('ext_cutrec_fwd', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecNPin = self.h.newpin('ext_cutrec_n', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecNEPin = self.h.newpin('ext_cutrec_ne', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecEPin = self.h.newpin('ext_cutrec_e', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecSEPin = self.h.newpin('ext_cutrec_se', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecSPin = self.h.newpin('ext_cutrec_s', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecSWPin = self.h.newpin('ext_cutrec_sw', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecWPin = self.h.newpin('ext_cutrec_w', hal.Type.BOOL, hal.Dir.IN)
+ self.extCutRecNWPin = self.h.newpin('ext_cutrec_nw', hal.Type.BOOL, hal.Dir.IN)
+ self.extFramingPin = self.h.newpin('ext_frame_job', hal.Type.BOOL, hal.Dir.IN)
+ self.extHeightOvrCountsPin = self.h.newpin('ext_height_ovr_counts', hal.Type.SINT, hal.Dir.IN)
+ self.extHeightOvrCountEnablePin = self.h.newpin('ext_height_ovr_count_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extHeightOvrMinusPin = self.h.newpin('ext_height_ovr_minus', hal.Type.BOOL, hal.Dir.IN)
+ self.extHeightOvrPlusPin = self.h.newpin('ext_height_ovr_plus', hal.Type.BOOL, hal.Dir.IN)
+ self.extHeightOvrResetPin = self.h.newpin('ext_height_ovr_reset', hal.Type.BOOL, hal.Dir.IN)
+ self.extHeightOvrScalePin = self.h.newpin('ext_height_ovr_scale', hal.Type.REAL, hal.Dir.IN)
+ self.extIgnoreArcOkPin = self.h.newpin('ext_ignore_arc_ok', hal.Type.BOOL, hal.Dir.IN)
+ self.extJogSlowPin = self.h.newpin('ext_jog_slow', hal.Type.BOOL, hal.Dir.IN)
+# self.extKerfCrossEnablePin = self.h.newpin('ext_kerfcross_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extLaserTouchOffPin = self.h.newpin('ext_laser_touchoff', hal.Type.BOOL, hal.Dir.IN)
+ self.extLaserTogglePin = self.h.newpin('ext_laser_toggle', hal.Type.BOOL, hal.Dir.IN)
+ self.extMeshModePin = self.h.newpin('ext_mesh_mode', hal.Type.BOOL, hal.Dir.IN)
+ self.extOhmicPin = self.h.newpin('ext_ohmic', hal.Type.BOOL, hal.Dir.IN)
+ self.extOhmicProbeEnablePin = self.h.newpin('ext_ohmic_probe_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extPausePin = self.h.newpin('ext_pause', hal.Type.BOOL, hal.Dir.IN)
+ self.extPauseOnlyPin = self.h.newpin('ext_pause_only', hal.Type.BOOL, hal.Dir.IN)
+ self.extPowerPin = self.h.newpin('ext_power', hal.Type.BOOL, hal.Dir.IN)
+ self.extProbePin = self.h.newpin('ext_probe', hal.Type.BOOL, hal.Dir.IN)
+ self.extPulsePin = self.h.newpin('ext_pulse', hal.Type.BOOL, hal.Dir.IN)
+ self.extResumePin = self.h.newpin('ext_resume', hal.Type.BOOL, hal.Dir.IN)
+ self.extRunPausePin = self.h.newpin('ext_run_pause', hal.Type.BOOL, hal.Dir.IN)
+ self.extRunPin = self.h.newpin('ext_run', hal.Type.BOOL, hal.Dir.IN)
+ self.extThcEnablePin = self.h.newpin('ext_thc_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extTorchEnablePin = self.h.newpin('ext_torch_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.extTouchOffPin = self.h.newpin('ext_touchoff', hal.Type.BOOL, hal.Dir.IN)
+ self.extVoidLockEnablePin = self.h.newpin('ext_voidlock_enable', hal.Type.BOOL, hal.Dir.IN)
+ self.gcodeScalePin = self.h.newpin('gcode_scale', hal.Type.REAL, hal.Dir.OUT)
+ self.heightOverridePin = self.h.newpin('height_override', hal.Type.REAL, hal.Dir.OUT)
+ self.jogInhibited = self.h.newpin('jog_inhibited', hal.Type.BOOL, hal.Dir.IN)
+ self.laserOnPin = self.h.newpin('laser_on', hal.Type.BOOL, hal.Dir.OUT)
+ self.offsetSetProbePin = self.h.newpin('offset_set_probe', hal.Type.BOOL, hal.Dir.OUT)
+ self.offsetSetScribePin = self.h.newpin('offset_set_scribe', hal.Type.BOOL, hal.Dir.OUT)
+ self.laserRecStatePin = self.h.newpin('laser_recovery_state', hal.Type.SINT, hal.Dir.IN)
+ self.materialChangePin = self.h.newpin('material_change', hal.Type.SINT, hal.Dir.IN)
+ self.materialChangeNumberPin = self.h.newpin('material_change_number', hal.Type.SINT, hal.Dir.IN)
+ self.materialChangeTimeoutPin = self.h.newpin('material_change_timeout', hal.Type.BOOL, hal.Dir.IN)
+ self.materialReloadPin = self.h.newpin('material_reload', hal.Type.BOOL, hal.Dir.IN)
+ self.materialTempPin = self.h.newpin('material_temp', hal.Type.SINT, hal.Dir.IN)
+ self.offsetsActivePin = self.h.newpin('offsets_active', hal.Type.BOOL, hal.Dir.IN)
+ self.ohmicLedInPin = self.h.newpin('ohmic_led_in', hal.Type.BOOL, hal.Dir.IN)
+ self.paramTabDisable = self.h.newpin('param_disable', hal.Type.BOOL, hal.Dir.IN)
+ self.settingsTabDisable = self.h.newpin('settings_disable', hal.Type.BOOL, hal.Dir.IN)
+ self.simStyleUpdate = self.h.newpin('sim_style_update', hal.Type.BOOL, hal.Dir.OUT)
+ self.plasmacStatePin = self.h.newpin('plasmac_state', hal.Type.SINT, hal.Dir.IN)
+ self.plasmacStopPin = self.h.newpin('plasmac_stop', hal.Type.SINT, hal.Dir.IN)
+ self.pmx485CurrentPin = self.h.newpin('pmx485_current', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485CurrentMaxPin = self.h.newpin('pmx485_current_max', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485CurrentMinPin = self.h.newpin('pmx485_current_min', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485FaultPin = self.h.newpin('pmx485_fault', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485ModePin = self.h.newpin('pmx485_mode', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485PressurePin = self.h.newpin('pmx485_pressure', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485PressureMaxPin = self.h.newpin('pmx485_pressure_max', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485PressureMinPin = self.h.newpin('pmx485_pressure_min', hal.Type.REAL, hal.Dir.IN)
+ self.pmx485StatusPin = self.h.newpin('pmx485_status', hal.Type.BOOL, hal.Dir.IN)
+ self.pmx485ArcTimePin = self.h.newpin('pmx485_arc_time', hal.Type.REAL, hal.Dir.IN)
+ self.probeTestErrorPin = self.h.newpin('probe_test_error', hal.Type.BOOL, hal.Dir.IN)
+ self.out0Pin = self.h.newpin('ext_out_0', hal.Type.BOOL, hal.Dir.OUT)
+ self.out1Pin = self.h.newpin('ext_out_1', hal.Type.BOOL, hal.Dir.OUT)
+ self.out2Pin = self.h.newpin('ext_out_2', hal.Type.BOOL, hal.Dir.OUT)
+ self.sensorActive = self.h.newpin('sensor_active', hal.Type.BOOL, hal.Dir.IN)
+ self.tabsAlwaysEnabled = self.h.newpin('tabs_always_enabled', hal.Type.BOOL, hal.Dir.IN)
+ self.thcFeedRatePin = self.h.newpin('thc_feed_rate', hal.Type.REAL, hal.Dir.OUT)
+ self.velReduct = self.h.newpin('vel_reduct', hal.Type.REAL, hal.Dir.IN)
+ self.xOffsetPin = self.h.newpin('x_offset', hal.Type.REAL, hal.Dir.IN)
+ self.yOffsetPin = self.h.newpin('y_offset', hal.Type.REAL, hal.Dir.IN)
+ self.zHeightPin = self.h.newpin('z_height', hal.Type.REAL, hal.Dir.IN)
+ self.zOffsetPin = self.h.newpin('z_offset_counts', hal.Type.SINT, hal.Dir.IN)
+ self.xMinPierceExtentPin = self.h.newpin('x_min_pierce_extent', hal.Type.REAL, hal.Dir.IN)
+ self.xMaxPierceExtentPin = self.h.newpin('x_max_pierce_extent', hal.Type.REAL, hal.Dir.IN)
+ self.yMinPierceExtentPin = self.h.newpin('y_min_pierce_extent', hal.Type.REAL, hal.Dir.IN)
+ self.yMaxPierceExtentPin = self.h.newpin('y_max_pierce_extent', hal.Type.REAL, hal.Dir.IN)
def link_hal_pins(self):
# arc parameters
@@ -5656,10 +5656,10 @@ def pmx485_setup(self):
'cut_mode-f', 'pmx485_mode',
'cut_amps-f', 'pmx485_current', 'pmx485_current_min', 'pmx485_current_max',
'gas_pressure-f', 'pmx485_pressure', 'pmx485_pressure_min', 'pmx485_pressure_max', 'pmx485_arc_time']
- pinType = [hal.HAL_BIT, hal.HAL_BIT, hal.HAL_FLOAT,
- hal.HAL_FLOAT, hal.HAL_FLOAT,
- hal.HAL_FLOAT, hal.HAL_FLOAT, hal.HAL_FLOAT, hal.HAL_FLOAT,
- hal.HAL_FLOAT, hal.HAL_FLOAT, hal.HAL_FLOAT, hal.HAL_FLOAT, hal.HAL_FLOAT]
+ pinType = [hal.Type.BOOL, hal.Type.BOOL, hal.Type.REAL,
+ hal.Type.REAL, hal.Type.REAL,
+ hal.Type.REAL, hal.Type.REAL, hal.Type.REAL, hal.Type.REAL,
+ hal.Type.REAL, hal.Type.REAL, hal.Type.REAL, hal.Type.REAL, hal.Type.REAL]
for pin in self.pins485Comp:
hal.new_sig(f'plasmac:{pin.replace("pmx485.", "pmx485_")}', pinType[self.pins485Comp.index(pin)])
hal.connect(pin, f'plasmac:{pin.replace("pmx485.", "pmx485_")}')
diff --git a/share/qtvcp/screens/woodpecker/woodpecker_handler.py b/share/qtvcp/screens/woodpecker/woodpecker_handler.py
index c1c9126ab70..7bb8644ad44 100644
--- a/share/qtvcp/screens/woodpecker/woodpecker_handler.py
+++ b/share/qtvcp/screens/woodpecker/woodpecker_handler.py
@@ -261,13 +261,13 @@ def init_pins(self):
QHAL.newpin("eoffset-count", QHAL.HAL_S32, QHAL.HAL_OUT)
pin = QHAL.newpin("eoffset-value", QHAL.HAL_FLOAT, QHAL.HAL_IN)
- self.pin_mpg_in = self.h.newpin('mpg-in',hal.HAL_S32, hal.HAL_IN)
+ self.pin_mpg_in = self.h.newpin('mpg-in',hal.Type.SINT, hal.Dir.IN)
self.pin_mpg_in.value_changed.connect(lambda s: self.external_mpg(s))
- self.wheel_x = self.h.newpin('jog.wheel.x',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_y = self.h.newpin('jog.wheel.y',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_z = self.h.newpin('jog.wheel.z',hal.HAL_BIT, hal.HAL_OUT)
- self.wheel_a = self.h.newpin('jog.wheel.a',hal.HAL_BIT, hal.HAL_OUT)
- self.jog_increment = self.h.newpin('jog.wheel.increment',hal.HAL_FLOAT, hal.HAL_OUT)
+ self.wheel_x = self.h.newpin('jog.wheel.x',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_y = self.h.newpin('jog.wheel.y',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_z = self.h.newpin('jog.wheel.z',hal.Type.BOOL, hal.Dir.OUT)
+ self.wheel_a = self.h.newpin('jog.wheel.a',hal.Type.BOOL, hal.Dir.OUT)
+ self.jog_increment = self.h.newpin('jog.wheel.increment',hal.Type.REAL, hal.Dir.OUT)
def init_preferences(self):
if not self.w.PREFS_:
diff --git a/src/emc/rs274ngc/interp_namedparams.cc b/src/emc/rs274ngc/interp_namedparams.cc
index d0f2d4b8b63..a5c3a3a6913 100644
--- a/src/emc/rs274ngc/interp_namedparams.cc
+++ b/src/emc/rs274ngc/interp_namedparams.cc
@@ -326,8 +326,6 @@ int Interp::fetch_hal_param( const char *nameBuf, int *status, double *value)
assign:
switch (type) {
case HAL_BOOL: *value = (double)qval.b; break;
- case HAL_U32: *value = (double)qval.u; break;
- case HAL_S32: *value = (double)qval.s; break;
case HAL_UINT: *value = (double)qval.u; break;
case HAL_SINT: *value = (double)qval.s; break;
case HAL_REAL: *value = (double)qval.r; break;
diff --git a/src/emc/usr_intf/axis/scripts/axis.py b/src/emc/usr_intf/axis/scripts/axis.py
index f9f04cc72a5..350e1dab87d 100755
--- a/src/emc/usr_intf/axis/scripts/axis.py
+++ b/src/emc/usr_intf/axis/scripts/axis.py
@@ -3942,22 +3942,22 @@ def select_run_from(e):
if hal_present == 1 :
comp = hal.component("axisui")
- comp.newpin("jog.x", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.y", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.z", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.a", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.b", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.c", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.u", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.v", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.w", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT)
- comp.newpin("notifications-clear",hal.HAL_BIT,hal.HAL_IN)
- comp.newpin("notifications-clear-info",hal.HAL_BIT,hal.HAL_IN)
- comp.newpin("notifications-clear-error",hal.HAL_BIT,hal.HAL_IN)
- comp.newpin("resume-inhibit",hal.HAL_BIT,hal.HAL_IN)
- comp.newpin("error", hal.HAL_BIT, hal.HAL_OUT)
- comp.newpin("abort", hal.HAL_BIT, hal.HAL_OUT)
+ comp.newpin("jog.x", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.y", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.z", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.a", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.b", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.c", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.u", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.v", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.w", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("jog.increment", hal.Type.REAL, hal.Dir.OUT)
+ comp.newpin("notifications-clear",hal.Type.BOOL,hal.Dir.IN)
+ comp.newpin("notifications-clear-info",hal.Type.BOOL,hal.Dir.IN)
+ comp.newpin("notifications-clear-error",hal.Type.BOOL,hal.Dir.IN)
+ comp.newpin("resume-inhibit",hal.Type.BOOL,hal.Dir.IN)
+ comp.newpin("error", hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("abort", hal.Type.BOOL, hal.Dir.OUT)
vars.has_ladder.set(hal.component_exists('classicladder_rt'))
diff --git a/src/emc/usr_intf/axis/scripts/hal_manualtoolchange.py b/src/emc/usr_intf/axis/scripts/hal_manualtoolchange.py
index 6308fb73865..65ec28150ec 100644
--- a/src/emc/usr_intf/axis/scripts/hal_manualtoolchange.py
+++ b/src/emc/usr_intf/axis/scripts/hal_manualtoolchange.py
@@ -78,10 +78,10 @@ def get_tool_change_message(n):
h = hal.component("hal_manualtoolchange")
-h.newpin("number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("change_button", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("change_button", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("changed", hal.Type.BOOL, hal.Dir.OUT)
h.ready()
import nf, rs274.options
diff --git a/src/emc/usr_intf/axis/scripts/haltest.py b/src/emc/usr_intf/axis/scripts/haltest.py
deleted file mode 100644
index 4d64f3e229f..00000000000
--- a/src/emc/usr_intf/axis/scripts/haltest.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from hal import *; import time
-h = component("test");
-h.newpin("i", HAL_S32, HAL_OUT);
-h.newpin("f", HAL_FLOAT, HAL_OUT);
-h.newpin("u32", HAL_U32, HAL_OUT);
-while 1:
- h.i += 1;
- h.f = h.i * .3125
- h.u32 = (7*h.i) % 256
- time.sleep(.1)
diff --git a/src/emc/usr_intf/axis/scripts/tracking-test.py b/src/emc/usr_intf/axis/scripts/tracking-test.py
index 0fbc7695a80..d7e0d2244a5 100755
--- a/src/emc/usr_intf/axis/scripts/tracking-test.py
+++ b/src/emc/usr_intf/axis/scripts/tracking-test.py
@@ -15,18 +15,18 @@
compname = "tracking-test"
c = hal.component(compname)
#declare hal pins here
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis5", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis5", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py
index 1e6852dcc90..77ac9aae0fe 100644
--- a/src/emc/usr_intf/gmoccapy/gmoccapy.py
+++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py
@@ -2627,20 +2627,20 @@ def _init_user_messages(self):
return
for message in user_messages:
if message[1] == "status":
- pin = hal_glib.GPin(self.halcomp.newpin("messages." + message[2], hal.HAL_BIT, hal.HAL_IN))
+ pin = hal_glib.GPin(self.halcomp.newpin("messages." + message[2], hal.Type.BOOL, hal.Dir.IN))
pin.connect("value_changed", self._show_user_message, message)
elif message[1] == "okdialog":
- pin = hal_glib.GPin(self.halcomp.newpin("messages." + message[2], hal.HAL_BIT, hal.HAL_IN))
+ pin = hal_glib.GPin(self.halcomp.newpin("messages." + message[2], hal.Type.BOOL, hal.Dir.IN))
pin.connect("value_changed", self._show_user_message, message)
pin = hal_glib.GPin(
- self.halcomp.newpin("messages." + message[2] + "-waiting", hal.HAL_BIT, hal.HAL_OUT))
+ self.halcomp.newpin("messages." + message[2] + "-waiting", hal.Type.BOOL, hal.Dir.OUT))
elif message[1] == "yesnodialog":
- pin = hal_glib.GPin(self.halcomp.newpin("messages." + message[2], hal.HAL_BIT, hal.HAL_IN))
+ pin = hal_glib.GPin(self.halcomp.newpin("messages." + message[2], hal.Type.BOOL, hal.Dir.IN))
pin.connect("value_changed", self._show_user_message, message)
pin = hal_glib.GPin(
- self.halcomp.newpin("messages." + message[2] + "-waiting", hal.HAL_BIT, hal.HAL_OUT))
+ self.halcomp.newpin("messages." + message[2] + "-waiting", hal.Type.BOOL, hal.Dir.OUT))
pin = hal_glib.GPin(
- self.halcomp.newpin("messages." + message[2] + "-response", hal.HAL_BIT, hal.HAL_OUT))
+ self.halcomp.newpin("messages." + message[2] + "-response", hal.Type.BOOL, hal.Dir.OUT))
else:
LOG.error(_("Message type {0} not supported").format(message[1]))
@@ -6386,135 +6386,135 @@ def _get_child_button(self, location, number = None):
def _make_hal_pins(self):
# generate the horizontal button pins
for h_button in range(0, 10):
- pin = self.halcomp.newpin("h-button.button-{0}".format(h_button), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("h-button.button-{0}".format(h_button), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._button_pin_changed)
# generate the vertical button pins
for v_button in range(0, 7):
- pin = self.halcomp.newpin("v-button.button-{0}".format(v_button), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("v-button.button-{0}".format(v_button), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._button_pin_changed)
# buttons for jogging the axis
for jog_button in self.axis_list:
- pin = self.halcomp.newpin("jog.axis.jog-{0}-plus".format(jog_button), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.axis.jog-{0}-plus".format(jog_button), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_pin_jog_changed, "{0}+".format(jog_button))
- pin = self.halcomp.newpin("jog.axis.jog-{0}-minus".format(jog_button), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.axis.jog-{0}-minus".format(jog_button), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_pin_jog_changed, "{0}-".format(jog_button))
if self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY:
for joint_button in range(0, self.stat.joints):
- pin = self.halcomp.newpin("jog.joint.jog-{0}-plus".format(joint_button), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.joint.jog-{0}-plus".format(joint_button), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_pin_jog_changed, "{0}+".format(joint_button))
- pin = self.halcomp.newpin("jog.joint.jog-{0}-minus".format(joint_button), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.joint.jog-{0}-minus".format(joint_button), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_pin_jog_changed, "{0}+".format(joint_button))
# jog_increment out pin
- self.halcomp.newpin("jog.jog-increment", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("jog.jog-increment", hal.Type.REAL, hal.Dir.OUT)
# generate the pins to set the increments
for buttonnumber in range(0, len(self.jog_increments)):
- pin = self.halcomp.newpin("jog.jog-inc-{0}".format(buttonnumber), hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.jog-inc-{0}".format(buttonnumber), hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_pin_incr_changed, buttonnumber)
# make the pin for unlocking settings page
- pin = self.halcomp.newpin("unlock-settings", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("unlock-settings", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_unlock_settings_changed)
# generate the pins to connect encoders to the sliders
- pin = self.halcomp.newpin("feed.feed-override.counts", hal.HAL_S32, hal.HAL_IN)
+ pin = self.halcomp.newpin("feed.feed-override.counts", hal.Type.SINT, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_counts_changed, "spc_feed")
- pin = self.halcomp.newpin("spindle.spindle-override.counts", hal.HAL_S32, hal.HAL_IN)
+ pin = self.halcomp.newpin("spindle.spindle-override.counts", hal.Type.SINT, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_counts_changed, "spc_spindle")
- pin = self.halcomp.newpin("jog.jog-velocity.counts", hal.HAL_S32, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.jog-velocity.counts", hal.Type.SINT, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_counts_changed, "spc_lin_jog_vel")
- pin = self.halcomp.newpin("rapid.rapid-override.counts", hal.HAL_S32, hal.HAL_IN)
+ pin = self.halcomp.newpin("rapid.rapid-override.counts", hal.Type.SINT, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_counts_changed, "spc_rapid")
- self.halcomp.newpin("feed.feed-override.count-enable", hal.HAL_BIT, hal.HAL_IN)
- self.halcomp.newpin("spindle.spindle-override.count-enable", hal.HAL_BIT, hal.HAL_IN)
- self.halcomp.newpin("jog.jog-velocity.count-enable", hal.HAL_BIT, hal.HAL_IN)
- self.halcomp.newpin("rapid.rapid-override.count-enable", hal.HAL_BIT, hal.HAL_IN)
+ self.halcomp.newpin("feed.feed-override.count-enable", hal.Type.BOOL, hal.Dir.IN)
+ self.halcomp.newpin("spindle.spindle-override.count-enable", hal.Type.BOOL, hal.Dir.IN)
+ self.halcomp.newpin("jog.jog-velocity.count-enable", hal.Type.BOOL, hal.Dir.IN)
+ self.halcomp.newpin("rapid.rapid-override.count-enable", hal.Type.BOOL, hal.Dir.IN)
# generate the pins to connect analog inputs for sliders
- pin = self.halcomp.newpin("feed.feed-override.analog-enable", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("feed.feed-override.analog-enable", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_enable_changed, "spc_feed")
- pin = self.halcomp.newpin("spindle.spindle-override.analog-enable", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("spindle.spindle-override.analog-enable", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_enable_changed, "spc_spindle")
- pin = self.halcomp.newpin("jog.jog-velocity.analog-enable", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.jog-velocity.analog-enable", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_enable_changed, "spc_lin_jog_vel")
- pin = self.halcomp.newpin("rapid.rapid-override.analog-enable", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("rapid.rapid-override.analog-enable", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_enable_changed, "spc_rapid")
- pin = self.halcomp.newpin("feed.feed-override.direct-value", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.halcomp.newpin("feed.feed-override.direct-value", hal.Type.REAL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_value_changed, "spc_feed")
- pin = self.halcomp.newpin("spindle.spindle-override.direct-value", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.halcomp.newpin("spindle.spindle-override.direct-value", hal.Type.REAL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_value_changed, "spc_spindle")
- pin = self.halcomp.newpin("jog.jog-velocity.direct-value", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.jog-velocity.direct-value", hal.Type.REAL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_value_changed, "spc_lin_jog_vel")
- pin = self.halcomp.newpin("rapid.rapid-override.direct-value", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.halcomp.newpin("rapid.rapid-override.direct-value", hal.Type.REAL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_analog_value_changed, "spc_rapid")
# make a pin to set turtle jog vel
- pin = self.halcomp.newpin("jog.turtle-jog", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("jog.turtle-jog", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._on_pin_turtle_jog)
# make the pins for tool measurement
- self.halcomp.newpin("probeheight", hal.HAL_FLOAT, hal.HAL_OUT)
- pin = self.halcomp.newpin("blockheight", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("probeheight", hal.Type.REAL, hal.Dir.OUT)
+ pin = self.halcomp.newpin("blockheight", hal.Type.REAL, hal.Dir.OUT)
hal_glib.GPin(pin).connect("value_changed", self._on_blockheight_value_changed)
preset = self.prefs.getpref("blockheight", 0.0, float)
self.halcomp["blockheight"] = preset
- self.halcomp.newpin("toolmeasurement", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("searchvel", hal.HAL_FLOAT, hal.HAL_OUT)
- self.halcomp.newpin("probevel", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("toolmeasurement", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("searchvel", hal.Type.REAL, hal.Dir.OUT)
+ self.halcomp.newpin("probevel", hal.Type.REAL, hal.Dir.OUT)
# make pins to react to tool_offset changes
- pin = self.halcomp.newpin("tooloffset-x", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.halcomp.newpin("tooloffset-x", hal.Type.REAL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._offset_changed, "tooloffset-x")
- pin = self.halcomp.newpin("tooloffset-z", hal.HAL_FLOAT, hal.HAL_IN)
+ pin = self.halcomp.newpin("tooloffset-z", hal.Type.REAL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._offset_changed, "tooloffset-z")
- self.halcomp.newpin("tool-diameter", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("tool-diameter", hal.Type.REAL, hal.Dir.OUT)
# make a pin to delete a notification message
- pin = self.halcomp.newpin("delete-message", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("delete-message", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._del_message_changed)
# for manual tool change dialog
- self.halcomp.newpin("toolchange-number", hal.HAL_S32, hal.HAL_IN)
- self.halcomp.newpin("toolchange-changed", hal.HAL_BIT, hal.HAL_OUT)
- pin = self.halcomp.newpin('toolchange-change', hal.HAL_BIT, hal.HAL_IN)
+ self.halcomp.newpin("toolchange-number", hal.Type.SINT, hal.Dir.IN)
+ self.halcomp.newpin("toolchange-changed", hal.Type.BOOL, hal.Dir.OUT)
+ pin = self.halcomp.newpin('toolchange-change', hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect('value_changed', self.on_tool_change)
- self.halcomp.newpin('toolchange-confirm', hal.HAL_BIT, hal.HAL_IN)
+ self.halcomp.newpin('toolchange-confirm', hal.Type.BOOL, hal.Dir.IN)
# make a pin to confirm a warning dialog
- self.halcomp.newpin('warning-confirm', hal.HAL_BIT, hal.HAL_IN)
+ self.halcomp.newpin('warning-confirm', hal.Type.BOOL, hal.Dir.IN)
# make a pin to reset feed override to 100 %
- pin = self.halcomp.newpin("feed.reset-feed-override", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("feed.reset-feed-override", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._reset_override, "feed")
# make a pin to reset rapid override to 100 %
- pin = self.halcomp.newpin("rapid.reset-rapid-override", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("rapid.reset-rapid-override", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._reset_override, "rapid")
# make a pin to reset spindle override to 100 %
- pin = self.halcomp.newpin("spindle.reset-spindle-override", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("spindle.reset-spindle-override", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._reset_override, "spindle")
# make an error pin to indicate a error to hardware
- self.halcomp.newpin("error", hal.HAL_BIT, hal.HAL_OUT)
+ self.halcomp.newpin("error", hal.Type.BOOL, hal.Dir.OUT)
# make pins to indicate program progress information
- self.halcomp.newpin("program.length", hal.HAL_S32, hal.HAL_OUT)
- self.halcomp.newpin("program.current-line", hal.HAL_S32, hal.HAL_OUT)
- self.halcomp.newpin("program.progress", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.halcomp.newpin("program.length", hal.Type.SINT, hal.Dir.OUT)
+ self.halcomp.newpin("program.current-line", hal.Type.SINT, hal.Dir.OUT)
+ self.halcomp.newpin("program.progress", hal.Type.REAL, hal.Dir.OUT)
# make a pin to set ignore limits
- pin = self.halcomp.newpin("ignore-limits", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("ignore-limits", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._ignore_limits)
# make pins to set optional stops and block delete
- pin = self.halcomp.newpin("optional-stop", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("optional-stop", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._optional_blocks)
- pin = self.halcomp.newpin("blockdelete", hal.HAL_BIT, hal.HAL_IN)
+ pin = self.halcomp.newpin("blockdelete", hal.Type.BOOL, hal.Dir.IN)
hal_glib.GPin(pin).connect("value_changed", self._blockdelete)
diff --git a/src/emc/usr_intf/gscreen/gscreen.py b/src/emc/usr_intf/gscreen/gscreen.py
index a8d10ca6058..42ca2ec21e1 100755
--- a/src/emc/usr_intf/gscreen/gscreen.py
+++ b/src/emc/usr_intf/gscreen/gscreen.py
@@ -1652,49 +1652,49 @@ def initialize_pins(self):
def init_spindle_pins(self):
"""creates a HAL float in pin for control the spindle readout meter
"""
- self.halcomp.newpin("spindle-readout-in", hal.HAL_FLOAT, hal.HAL_IN)
+ self.halcomp.newpin("spindle-readout-in", hal.Type.REAL, hal.Dir.IN)
def init_coolant_pins(self):
- """create HAL BIT out pins to control coolant
+ """create HAL BOOL out pins to control coolant
"""
- self.halcomp.newpin("aux-coolant-m7-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("aux-coolant-m8-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("mist-coolant-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("flood-coolant-out", hal.HAL_BIT, hal.HAL_OUT)
+ self.halcomp.newpin("aux-coolant-m7-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("aux-coolant-m8-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("mist-coolant-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("flood-coolant-out", hal.Type.BOOL, hal.Dir.OUT)
def init_jog_pins(self):
- """create HAL BIT out pins for all axis jog enable
- create HAL BIT out for jog mode enabled
- create HAL FLOAT out pin for current jog increment
+ """create HAL BOOL out pins for all axis jog enable
+ create HAL BOOL out for jog mode enabled
+ create HAL REAL out pin for current jog increment
These could be used for MPG selecting
"""
for axis in self.data.axis_list:
- self.halcomp.newpin("jog-enable-%s-out"% (axis), hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("jog-enable-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("jog-increment-out", hal.HAL_FLOAT, hal.HAL_OUT)
- #self.data['jog-increment-in'] = hal_glib.GPin(self.halcomp.newpin('jog-increment-in', hal.HAL_S32, hal.HAL_IN))
+ self.halcomp.newpin("jog-enable-%s-out"% (axis), hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("jog-enable-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("jog-increment-out", hal.Type.REAL, hal.Dir.OUT)
+ #self.data['jog-increment-in'] = hal_glib.GPin(self.halcomp.newpin('jog-increment-in', hal.Type.SINT, hal.Dir.IN))
#self.data['jog-increment-in'].connect('value-changed', self.on_hal_jog_increments_changed)
- #self.data['jog-rate-in'] = hal_glib.GPin(self.halcomp.newpin('jog-rate-in', hal.HAL_S32, hal.HAL_IN))
+ #self.data['jog-rate-in'] = hal_glib.GPin(self.halcomp.newpin('jog-rate-in', hal.Type.SINT, hal.Dir.IN))
#self.data['jog-rate-in'].connect('value-changed', self.on_hal_jog_rate_changed)
# pins used for selecting an encoder to adjust overrides
def init_override_pins(self):
- """creates HAL BIT pins for spindle,feed and Max velocity overrides.
+ """creates HAL BOOL pins for spindle,feed and Max velocity overrides.
used as selection pins for an encoder to set values
"""
- self.halcomp.newpin("s-override-enable-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("f-override-enable-out", hal.HAL_BIT, hal.HAL_OUT)
- self.halcomp.newpin("mv-override-enable-out", hal.HAL_BIT, hal.HAL_OUT)
+ self.halcomp.newpin("s-override-enable-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("f-override-enable-out", hal.Type.BOOL, hal.Dir.OUT)
+ self.halcomp.newpin("mv-override-enable-out", hal.Type.BOOL, hal.Dir.OUT)
def init_control_pins(self):
"""Creates and registers function calls for start,abort and feed_hold pins
calls self.on_cycle_start_changed, self.on_abort_changed, self.on_feed_hold_changed
"""
- self.data['cycle_start'] = hal_glib.GPin(self.halcomp.newpin('cycle-start', hal.HAL_BIT, hal.HAL_IN))
+ self.data['cycle_start'] = hal_glib.GPin(self.halcomp.newpin('cycle-start', hal.Type.BOOL, hal.Dir.IN))
self.data['cycle_start'].connect('value-changed', self.on_cycle_start_changed)
- self.data['abort'] = hal_glib.GPin(self.halcomp.newpin('abort', hal.HAL_BIT, hal.HAL_IN))
+ self.data['abort'] = hal_glib.GPin(self.halcomp.newpin('abort', hal.Type.BOOL, hal.Dir.IN))
self.data['abort'].connect('value-changed', self.on_abort_changed)
- self.data['feed_hold'] = hal_glib.GPin(self.halcomp.newpin('feed-hold', hal.HAL_BIT, hal.HAL_IN))
+ self.data['feed_hold'] = hal_glib.GPin(self.halcomp.newpin('feed-hold', hal.Type.BOOL, hal.Dir.IN))
self.data['feed_hold'].connect('value-changed', self.on_feed_hold_changed)
def initialize_manual_toolchange(self):
@@ -1706,9 +1706,9 @@ def initialize_manual_toolchange(self):
or the default function
"""
# for manual tool change dialog
- self.halcomp.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
- self.halcomp.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
- self.data['change-tool'] = hal_glib.GPin(self.halcomp.newpin('change-tool', hal.HAL_BIT, hal.HAL_IN))
+ self.halcomp.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+ self.halcomp.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
+ self.data['change-tool'] = hal_glib.GPin(self.halcomp.newpin('change-tool', hal.Type.BOOL, hal.Dir.IN))
# you can override manual tool change
if "on_tool_change" in dir(self.handler_instance):
self.data['change-tool'].connect('value-changed', self.handler_instance.on_tool_change)
@@ -3808,12 +3808,12 @@ def message_setup(self):
continue
if not name == None:
# this is how we make a pin that can be connected to a callback
- self.data['name'] = hal_glib.GPin(self.halcomp.newpin(name, hal.HAL_BIT, hal.HAL_IN))
+ self.data['name'] = hal_glib.GPin(self.halcomp.newpin(name, hal.Type.BOOL, hal.Dir.IN))
self.data['name'].connect('value-changed', self.on_printmessage,name,bt,t,c)
if ("dialog" in c):
- self.halcomp.newpin(name+"-waiting", hal.HAL_BIT, hal.HAL_OUT)
+ self.halcomp.newpin(name+"-waiting", hal.Type.BOOL, hal.Dir.OUT)
if not ("ok" in c):
- self.halcomp.newpin(name+"-response", hal.HAL_BIT, hal.HAL_OUT)
+ self.halcomp.newpin(name+"-response", hal.Type.BOOL, hal.Dir.OUT)
# display dialog
def warning_dialog(self,message, displaytype, secondary=None,pinname=None):
diff --git a/src/emc/usr_intf/mdro/mdro.py b/src/emc/usr_intf/mdro/mdro.py
index e1ac9c3a635..f0848ca4136 100755
--- a/src/emc/usr_intf/mdro/mdro.py
+++ b/src/emc/usr_intf/mdro/mdro.py
@@ -34,10 +34,10 @@ def __init__(self):
self.h = hal.component("mdro")
self.pins = ["axis."+str(p) for p in range(params["naxes"])]
for pin in self.pins:
- self.h.newpin(pin, hal.HAL_FLOAT, hal.HAL_IN)
+ self.h.newpin(pin, hal.Type.REAL, hal.Dir.IN)
self.indexes = ["index-enable."+str(p) for p in range(params["naxes"])]
for pin in self.indexes:
- self.h.newpin(pin, hal.HAL_BIT, hal.HAL_IO)
+ self.h.newpin(pin, hal.Type.BOOL, hal.Dir.IO)
self.h.ready()
if params["verbose"]:
print("Linuxcnc interface up")
diff --git a/src/emc/usr_intf/pncconf/options.glade b/src/emc/usr_intf/pncconf/options.glade
index caab2c39f70..4788efe0990 100644
--- a/src/emc/usr_intf/pncconf/options.glade
+++ b/src/emc/usr_intf/pncconf/options.glade
@@ -602,7 +602,7 @@
True
False
5
- Number of digital (bit) in pins:
+ Number of digital (bool) in pins:
True
digitsin
0.019999999552965164
@@ -619,7 +619,7 @@
True
False
3
- Number of digital (bit) out pins:
+ Number of digital (bool) out pins:
True
digitsout
0.039999999105930328
@@ -635,7 +635,7 @@
True
False
6
- Number of analog (s32) in pins:
+ Number of analog (sint) in pins:
True
word-char
s32in
@@ -652,7 +652,7 @@
True
False
5
- Number of analog (s32) out pins:
+ Number of analog (sint) out pins:
True
s32out
0
@@ -668,7 +668,7 @@
True
False
5
- Number of analog (float) in pins:
+ Number of analog (real) in pins:
True
s32out
0
@@ -684,7 +684,7 @@
True
False
5
- Number of analog (float) out pins:
+ Number of analog (real) out pins:
True
s32out
0
diff --git a/src/emc/usr_intf/pncconf/tests.py b/src/emc/usr_intf/pncconf/tests.py
index 10f411ef3d9..5723ecb5e4f 100644
--- a/src/emc/usr_intf/pncconf/tests.py
+++ b/src/emc/usr_intf/pncconf/tests.py
@@ -1415,7 +1415,7 @@ def update(self):
def make_blank(self,container,boardnum,number):
#blankname = "enc-%d" % (number)
#self.data2["brd%denc%d" % (boardnum,number)]= Gtk.Button("Reset-%d"% number)
- #self.hal.c.newpin(encname, hal.HAL_S32, hal.HAL_IN)
+ #self.hal.c.newpin(encname, hal.Type.SINT, hal.Dir.IN)
label = Gtk.Label(" ")
container.pack_start(label, False, False, 10)
label = Gtk.Label(" ")
@@ -1425,15 +1425,15 @@ def make_blank(self,container,boardnum,number):
def make_enc(self,container,boardnum,number):
encname = "brd.%d.enc.%d.reset" % (boardnum,number)
print("making HAL pin enc bit Brd %d,num %d"%(boardnum,number))
- self.hal.c.newpin(encname, hal.HAL_BIT, hal.HAL_OUT)
- hal.new_sig(encname+"-signal",hal.HAL_BIT)
+ self.hal.c.newpin(encname, hal.Type.BOOL, hal.Dir.OUT)
+ hal.new_sig(encname+"-signal",hal.Type.BOOL)
hal.connect("testpanel."+encname,encname+"-signal")
self.data2["brd%denc%dreset" % (boardnum,number)]= Gtk.Button("Reset-%d"% number)
container.pack_start(self.data2["brd%denc%dreset" % (boardnum,number)], False, False, 10)
encname = "brd.%d.enc.%d.count" % (boardnum,number)
print("making HAL pin enc s32 brd %d num %d"%(boardnum,number))
- self.hal.c.newpin(encname, hal.HAL_S32, hal.HAL_IN)
- hal.new_sig(encname+"-signal",hal.HAL_S32)
+ self.hal.c.newpin(encname, hal.Type.SINT, hal.Dir.IN)
+ hal.new_sig(encname+"-signal",hal.Type.SINT)
hal.connect("testpanel."+encname,encname+"-signal")
label = self.data2["brd%denc%dcount" % (boardnum,number)] = Gtk.Label("Encoder-%d"% (number))
label.set_size_request(100, -1)
@@ -1442,12 +1442,12 @@ def make_enc(self,container,boardnum,number):
# This creates widgets and HAL pins for stepper controls
def make_stp(self,container,boardnum,number):
stpname = "brd.%d.stp.%d.position-cmd" % (boardnum,number)
- self.hal.c.newpin(stpname, hal.HAL_FLOAT, hal.HAL_OUT)
- hal.new_sig(stpname+"-signal",hal.HAL_FLOAT)
+ self.hal.c.newpin(stpname, hal.Type.REAL, hal.Dir.OUT)
+ hal.new_sig(stpname+"-signal",hal.Type.REAL)
hal.connect("testpanel."+stpname,stpname+"-signal")
stpname = "brd.%d.stp.%d.enable" % (boardnum,number)
- self.hal.c.newpin(stpname, hal.HAL_BIT, hal.HAL_OUT)
- hal.new_sig(stpname+"-signal",hal.HAL_BIT)
+ self.hal.c.newpin(stpname, hal.Type.BOOL, hal.Dir.OUT)
+ hal.new_sig(stpname+"-signal",hal.Type.BOOL)
hal.connect("testpanel."+stpname,stpname+"-signal")
adj = Gtk.Adjustment(0.0, -1000.0, 1000.0, 1.0, 5.0, 0.0)
spin = self.data2["brd%dstp%dcmd" % (boardnum,number)]= Gtk.SpinButton(adj, 0, 1)
@@ -1462,13 +1462,13 @@ def make_stp(self,container,boardnum,number):
def make_pwm(self,container,boardnum,number):
pwmname = "brd.%d.pwm.%d.value" % (boardnum,number)
print("making HAL pin pwm float brd%d num %d"%(boardnum,number))
- self.hal.c.newpin(pwmname, hal.HAL_FLOAT, hal.HAL_OUT)
- hal.new_sig(pwmname+"-signal",hal.HAL_FLOAT)
+ self.hal.c.newpin(pwmname, hal.Type.REAL, hal.Dir.OUT)
+ hal.new_sig(pwmname+"-signal",hal.Type.REAL)
hal.connect("testpanel."+pwmname,pwmname+"-signal")
pwmname = "brd.%d.pwm.%d.enable" % (boardnum,number)
print("making HAL pin pwm bit brd %d num %d"%(boardnum,number))
- self.hal.c.newpin(pwmname, hal.HAL_BIT, hal.HAL_OUT)
- hal.new_sig(pwmname+"-signal",hal.HAL_BIT)
+ self.hal.c.newpin(pwmname, hal.Type.BOOL, hal.Dir.OUT)
+ hal.new_sig(pwmname+"-signal",hal.Type.BOOL)
hal.connect("testpanel."+pwmname,pwmname+"-signal")
adj = self.data2["brd%dpwm%dadj" % (boardnum,number)] = Gtk.Adjustment(0.0, -10.0, 10.0, 0.1, 0.5, 0.0)
adj.connect("value_changed", self.pwm_callback,"pwm",boardnum,number,None)
@@ -1486,8 +1486,8 @@ def make_pwm(self,container,boardnum,number):
def make_led(self,container,boardnum,number):
ledname = "brd.%d.led.%d" % (boardnum,number)
print("making HAL pin led bit brd %d num %d"%(boardnum,number))
- self.hal.c.newpin(ledname, hal.HAL_BIT, hal.HAL_IN)
- hal.new_sig(ledname+"-signal",hal.HAL_BIT)
+ self.hal.c.newpin(ledname, hal.Type.BOOL, hal.Dir.IN)
+ hal.new_sig(ledname+"-signal",hal.Type.BOOL)
hal.connect("testpanel."+ledname,ledname+"-signal")
led = self.data2["brd%dled%d" % (boardnum,number)] = LED(self)
led.set_color("off",[1,0,0]) # red
@@ -1503,8 +1503,8 @@ def make_switch(self,container,boardnum,number):
# make a HAL pin
switchname = "brd.%d.switch.%d" % (boardnum,number)
print("making HAL pin switch bit brd %d num %d"%(boardnum,number))
- self.hal.c.newpin(switchname, hal.HAL_BIT, hal.HAL_OUT)
- hal.new_sig(switchname+"-signal",hal.HAL_BIT)
+ self.hal.c.newpin(switchname, hal.Type.BOOL, hal.Dir.OUT)
+ hal.new_sig(switchname+"-signal",hal.Type.BOOL)
hal.connect("testpanel."+switchname,switchname+"-signal")
# add button to container using boarnum and number as a reference
button = self.data2["brd%dswch%d" % (boardnum,number)]= Gtk.Button("OUT-%d"% number)
diff --git a/src/emc/usr_intf/pyui/widgets.py b/src/emc/usr_intf/pyui/widgets.py
index 0a037ea216b..bb63b98452a 100644
--- a/src/emc/usr_intf/pyui/widgets.py
+++ b/src/emc/usr_intf/pyui/widgets.py
@@ -30,19 +30,19 @@ def hal_init(self, master, comp, name,metadata,command,widgets,dbg):
# convert and set pintype and states based on metadata types
if self.metadata['OUTPUT'] == 'S32':
- self.pintype=hal.HAL_S32
+ self.pintype=hal.Type.SINT
self.true_state = int(self.metadata['TRUE_STATE'])
self.false_state = int(self.metadata['FALSE_STATE'])
elif self.metadata['OUTPUT'] == 'U32':
- self.pintype=hal.HAL_U32
+ self.pintype=hal.Type.UINT
self.true_state = int(self.metadata['TRUE_STATE'])
self.false_state = int(self.metadata['FALSE_STATE'])
elif self.metadata['OUTPUT'] == 'FLOAT':
- self.pintype=hal.HAL_FLOAT
+ self.pintype=hal.Type.REAL
self.true_state = float(self.metadata['TRUE_STATE'])
self.false_state = float(self.metadata['FALSE_STATE'])
elif self.metadata['OUTPUT'] == 'BIT':
- self.pintype=hal.HAL_BIT
+ self.pintype=hal.Type.BOOL
self.true_state = True#self.metadata['TRUE_STATE']
self.false_state = False#self.metadata['FALSE_STATE']
elif self.metadata['OUTPUT'] == 'COMMAND':
@@ -104,12 +104,12 @@ def _hal_init(self):
pass
# If not a command output requested make the pins
if pintype not in(None,'COMMAND','ZMQ'):
- self.hal_pin = self.hal.newpin(self.hal_name, pintype, hal.HAL_OUT)
- self.hal_pin_not = self.hal.newpin(self.hal_name + "-not", pintype, hal.HAL_OUT)
+ self.hal_pin = self.hal.newpin(self.hal_name, pintype, hal.Dir.OUT)
+ self.hal_pin_not = self.hal.newpin(self.hal_name + "-not", pintype, hal.Dir.OUT)
# If there is a status requested make there pins
if self.status_pin:
- self.hal_status_pin = self.hal.newpin(self.hal_name+ "-state", hal.HAL_BIT, hal.HAL_OUT)
- self.hal_status_pin_not = self.hal.newpin(self.hal_name+ "-state-not", hal.HAL_BIT, hal.HAL_OUT)
+ self.hal_status_pin = self.hal.newpin(self.hal_name+ "-state", hal.Type.BOOL, hal.Dir.OUT)
+ self.hal_status_pin_not = self.hal.newpin(self.hal_name+ "-state-not", hal.Type.BOOL, hal.Dir.OUT)
# Update the pin to the proper state, but don't print debug for this
if pintype not in ('COMMAND','ZMQ'):
DBG_suppress = True
diff --git a/src/emc/usr_intf/touchy/hal_interface.py b/src/emc/usr_intf/touchy/hal_interface.py
index f53808f3683..18802297492 100644
--- a/src/emc/usr_intf/touchy/hal_interface.py
+++ b/src/emc/usr_intf/touchy/hal_interface.py
@@ -22,67 +22,67 @@ def __init__(self, gui, emc_control, mdi_control, emc):
self.emc_stat = self.emc.stat()
self.mdi_control = mdi_control
self.c = hal.component("touchy")
- self.c.newpin("status-indicator", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.active", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.x", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.y", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.z", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.a", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.b", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.c", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.u", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.v", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.w", hal.HAL_BIT, hal.HAL_OUT)
- self.c.newpin("jog.wheel.increment", hal.HAL_FLOAT, hal.HAL_OUT)
-
- self.c.newpin("jog.continuous.x.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("status-indicator", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.active", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.x", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.y", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.z", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.a", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.b", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.c", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.u", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.v", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.w", hal.Type.BOOL, hal.Dir.OUT)
+ self.c.newpin("jog.wheel.increment", hal.Type.REAL, hal.Dir.OUT)
+
+ self.c.newpin("jog.continuous.x.positive", hal.Type.BOOL, hal.Dir.IN)
self.xp = 0
- self.c.newpin("jog.continuous.x.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.x.negative", hal.Type.BOOL, hal.Dir.IN)
self.xn = 0
- self.c.newpin("jog.continuous.y.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.y.positive", hal.Type.BOOL, hal.Dir.IN)
self.yp = 0
- self.c.newpin("jog.continuous.y.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.y.negative", hal.Type.BOOL, hal.Dir.IN)
self.yn = 0
- self.c.newpin("jog.continuous.z.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.z.positive", hal.Type.BOOL, hal.Dir.IN)
self.zp = 0
- self.c.newpin("jog.continuous.z.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.z.negative", hal.Type.BOOL, hal.Dir.IN)
self.zn = 0
- self.c.newpin("jog.continuous.a.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.a.positive", hal.Type.BOOL, hal.Dir.IN)
self.ap = 0
- self.c.newpin("jog.continuous.a.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.a.negative", hal.Type.BOOL, hal.Dir.IN)
self.an = 0
- self.c.newpin("jog.continuous.b.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.b.positive", hal.Type.BOOL, hal.Dir.IN)
self.bp = 0
- self.c.newpin("jog.continuous.b.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.b.negative", hal.Type.BOOL, hal.Dir.IN)
self.bn = 0
- self.c.newpin("jog.continuous.c.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.c.positive", hal.Type.BOOL, hal.Dir.IN)
self.cp = 0
- self.c.newpin("jog.continuous.c.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.c.negative", hal.Type.BOOL, hal.Dir.IN)
self.cn = 0
- self.c.newpin("jog.continuous.u.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.u.positive", hal.Type.BOOL, hal.Dir.IN)
self.up = 0
- self.c.newpin("jog.continuous.u.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.u.negative", hal.Type.BOOL, hal.Dir.IN)
self.un = 0
- self.c.newpin("jog.continuous.v.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.v.positive", hal.Type.BOOL, hal.Dir.IN)
self.vp = 0
- self.c.newpin("jog.continuous.v.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.v.negative", hal.Type.BOOL, hal.Dir.IN)
self.vn = 0
- self.c.newpin("jog.continuous.w.positive", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.w.positive", hal.Type.BOOL, hal.Dir.IN)
self.wp = 0
- self.c.newpin("jog.continuous.w.negative", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("jog.continuous.w.negative", hal.Type.BOOL, hal.Dir.IN)
self.wn = 0
- self.c.newpin("quill-up", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("quill-up", hal.Type.BOOL, hal.Dir.IN)
self.quillup = 0
- self.c.newpin("cycle-start", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("cycle-start", hal.Type.BOOL, hal.Dir.IN)
self.cyclestart = 0
- self.c.newpin("abort", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("abort", hal.Type.BOOL, hal.Dir.IN)
self.abort = 0
- self.c.newpin("single-block", hal.HAL_BIT, hal.HAL_IN)
+ self.c.newpin("single-block", hal.Type.BOOL, hal.Dir.IN)
self.singleblock = 0
- self.c.newpin("wheel-counts", hal.HAL_S32, hal.HAL_IN)
+ self.c.newpin("wheel-counts", hal.Type.SINT, hal.Dir.IN)
self.counts = 0
self.jog_velocity = 1
self.c.ready()
diff --git a/src/hal/components/.gitignore b/src/hal/components/.gitignore
index 01a447a5a38..c18fb61471b 100644
--- a/src/hal/components/.gitignore
+++ b/src/hal/components/.gitignore
@@ -1 +1,2 @@
conv_*.comp
+!conv_real_bool.comp
diff --git a/src/hal/components/Submakefile b/src/hal/components/Submakefile
index 62c9940cfbb..6c6ed4850de 100644
--- a/src/hal/components/Submakefile
+++ b/src/hal/components/Submakefile
@@ -3,35 +3,17 @@ COMPS := $(filter-out %/tpcomp.comp, $(patsubst $(BASEPWD)/%,%,$(wildcard $(BASE
include $(patsubst %.comp, $(BASEPWD)/objects/%.mak, $(COMPS))
else
CONVERTERS := \
- conv_bit_float.comp \
- conv_bit_s32.comp \
- conv_bit_u32.comp \
- conv_bit_s64.comp \
- conv_bit_u64.comp \
- conv_float_s32.comp \
- conv_float_u32.comp \
- conv_float_s64.comp \
- conv_float_u64.comp \
- conv_s32_bit.comp \
- conv_s32_float.comp \
- conv_s32_u32.comp \
- conv_s32_s64.comp \
- conv_s32_u64.comp \
- conv_s64_bit.comp \
- conv_s64_float.comp \
- conv_s64_s32.comp \
- conv_s64_u32.comp \
- conv_s64_u64.comp \
- conv_u32_bit.comp \
- conv_u32_float.comp \
- conv_u32_s32.comp \
- conv_u32_s64.comp \
- conv_u32_u64.comp \
- conv_u64_bit.comp \
- conv_u64_float.comp \
- conv_u64_s32.comp \
- conv_u64_u32.comp \
- conv_u64_s64.comp
+ conv_bool_real.comp \
+ conv_bool_sint.comp \
+ conv_bool_uint.comp \
+ conv_real_sint.comp \
+ conv_real_uint.comp \
+ conv_sint_bool.comp \
+ conv_sint_real.comp \
+ conv_sint_uint.comp \
+ conv_uint_bool.comp \
+ conv_uint_real.comp \
+ conv_uint_sint.comp
COMPS := $(filter-out hal/components/tpcomp.comp, $(sort $(wildcard hal/components/*.comp) $(addprefix hal/components/, $(CONVERTERS))))
COMP_MANPAGES := $(patsubst hal/components/%.comp, ../docs/build/man/man9/%.9, $(COMPS)) ../docs/build/man/man9/tpcomp.9
ifeq ($(BUILD_SYS),uspace)
@@ -136,118 +118,46 @@ PYFLAGS := $(PYTHON_EXTRA_LDFLAGS) $(BOOST_PYTHON_LIB) $(PYTHON_LIBS) $(PYTHON_E
$(Q)$(CC) -Wl,-z,relro -o $@ $^ $(PYFLAGS)
TARGETS += ../bin/panelui
-hal/components/conv_float_s32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_real_sint.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh float s32 < $< > $@
+ $(Q)sh hal/components/mkconv.sh real sint < $< > $@
-hal/components/conv_float_u32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_real_uint.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh float u32 < $< > $@
+ $(Q)sh hal/components/mkconv.sh real uint < $< > $@
-hal/components/conv_float_s64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_bool_sint.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh float s64 < $< > $@
+ $(Q)sh hal/components/mkconv.sh bool sint < $< > $@
-hal/components/conv_float_u64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_bool_uint.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh float u64 < $< > $@
+ $(Q)sh hal/components/mkconv.sh bool uint < $< > $@
-hal/components/conv_bit_s32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_bool_real.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh bit s32 < $< > $@
+ $(Q)sh hal/components/mkconv.sh bool real < $< > $@
-hal/components/conv_bit_u32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_sint_real.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh bit u32 < $< > $@
+ $(Q)sh hal/components/mkconv.sh sint real < $< > $@
-hal/components/conv_bit_s64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_sint_bool.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh bit s64 < $< > $@
+ $(Q)sh hal/components/mkconv.sh sint bool < $< > $@
-hal/components/conv_bit_u64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_sint_uint.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh bit u64 < $< > $@
+ $(Q)sh hal/components/mkconv.sh sint uint < $< > $@
-hal/components/conv_bit_float.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_uint_real.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh bit float < $< > $@
+ $(Q)sh hal/components/mkconv.sh uint real < $< > $@
-hal/components/conv_s32_float.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_uint_bool.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s32 float < $< > $@
+ $(Q)sh hal/components/mkconv.sh uint bool < $< > $@
-hal/components/conv_s32_bit.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
+hal/components/conv_uint_sint.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
$(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s32 bit < $< > $@
-
-hal/components/conv_s32_u32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s32 u32 < $< > $@
-
-hal/components/conv_s32_u64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s32 u64 < $< > $@
-
-hal/components/conv_s32_s64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s32 s64 < $< > $@
-
-hal/components/conv_u32_float.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u32 float < $< > $@
-
-hal/components/conv_u32_bit.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u32 bit < $< > $@
-
-hal/components/conv_u32_s32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u32 s32 < $< > $@
-
-hal/components/conv_u32_u64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u32 u64 < $< > $@
-
-hal/components/conv_u32_s64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u32 s64 < $< > $@
-
-hal/components/conv_s64_float.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s64 float < $< > $@
-
-hal/components/conv_s64_bit.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s64 bit < $< > $@
-
-hal/components/conv_s64_u32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s64 u32 < $< > $@
-
-hal/components/conv_s64_s32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s64 s32 < $< > $@
-
-hal/components/conv_s64_u64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh s64 u64 < $< > $@
-
-hal/components/conv_u64_float.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u64 float < $< > $@
-
-hal/components/conv_u64_bit.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u64 bit < $< > $@
-
-hal/components/conv_u64_u32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u64 u32 < $< > $@
-
-hal/components/conv_u64_s32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u64 s32 < $< > $@
-
-hal/components/conv_u64_s64.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile
- $(ECHO) converting conv for $(notdir $@)
- $(Q)sh hal/components/mkconv.sh u64 s64 < $< > $@
+ $(Q)sh hal/components/mkconv.sh uint sint < $< > $@
diff --git a/src/hal/components/conv_real_bool.comp b/src/hal/components/conv_real_bool.comp
new file mode 100644
index 00000000000..6dca20b3eaa
--- /dev/null
+++ b/src/hal/components/conv_real_bool.comp
@@ -0,0 +1,22 @@
+component conv_real_bool """Convert a value from real to bool
+
+The output value `out` is False when `in` is within `±eps` of zero.
+The `out` pin is set to True once the `in` value reaches beyond.
+
+* `in` < `-eps` -> `out` = True
+* `in` > `+eps` -> `out` = True
+* `-eps` ≤ `in` ≤ `+eps` -> `out` = False
+
+In effect: `out = |in| > |eps|`
+
+""";
+pin in real in "Input value to convert.";
+pin out bool out "Output value is False when input is within ±eps.";
+param rw real eps = 1e-8 "Epsilon value to determine the input to be zero.";
+option period no;
+function _ "Update 'out' based on 'in' to be within 'eps' or not.";
+license "GPL";
+author "LinuxCNC authors";
+include ;
+;;
+out_set(fabs(in) > fabs(eps));
diff --git a/src/hal/components/demux.comp b/src/hal/components/demux.comp
index 7d4c8d19067..47cbd6b2f31 100644
--- a/src/hal/components/demux.comp
+++ b/src/hal/components/demux.comp
@@ -11,7 +11,7 @@ parameter to true, in this case all bits up to the selected bit will be
set, as might be required for an LED bargraph display.""";
pin in bool sel-bit-## [5] "Binary-number bit selectors";
-pin in ui32 sel-u32 "Integer selection input";
+pin in uint sel-uint "Integer selection input";
pin out bool out-## [32:personality] "The set of output bits";
option default_personality 32;
@@ -29,7 +29,7 @@ function _;
FUNCTION(_){
int i, bit;
- bit = sel_u32 + sel_bit(0) + (sel_bit(1) << 1) + (sel_bit(2) << 2)
+ bit = sel_uint + sel_bit(0) + (sel_bit(1) << 1) + (sel_bit(2) << 2)
+ (sel_bit(3) << 3) + (sel_bit(4) << 4);
if (bit >= personality) bit = personality - 1;
rtapi_bool bg = bargraph;
diff --git a/src/hal/components/demux_generic.c b/src/hal/components/demux_generic.c
index 7ce13958b44..9f682106d18 100644
--- a/src/hal/components/demux_generic.c
+++ b/src/hal/components/demux_generic.c
@@ -62,8 +62,8 @@ RTAPI_MP_ARRAY_STRING(config, MAX_CHAN, "demux specifiers inNUMout");
int rtapi_app_main(void){
int retval;
int i, f;
- char hal_name[HAL_NAME_LEN];
- char *types[5] = {"invalid", "bit", "float", "s32", "u32"};
+ char hal_name[HAL_NAME_LEN+1];
+ static const char *types[HAL_TYPE_MAX] = {"invalid", "bool", "real", "sint", "uint", "port"};
if (!config[0]) {
rtapi_print_msg(RTAPI_MSG_ERR, "The demux_generic component requires at least"
" one valid format string\n");
@@ -122,11 +122,11 @@ int rtapi_app_main(void){
break;
case 's':
case 'S':
- type = HAL_S32;
+ type = HAL_SINT;
break;
case 'u':
case 'U':
- type = HAL_U32;
+ type = HAL_UINT;
break;
default:
rtapi_print_msg(RTAPI_MSG_ERR, "demux_generic: invalid character in "
@@ -198,17 +198,14 @@ int rtapi_app_main(void){
goto fail0;
}
- retval = rtapi_snprintf(hal_name, HAL_NAME_LEN,
- "demux-gen.%02i.in-%s", i, types[inst->in_type]);
- if (retval >= HAL_NAME_LEN) {
+ retval = rtapi_snprintf(hal_name, sizeof(hal_name),
+ "demux-gen.%02i.in-%s", i, types[inst->in_type]);
+ if (retval > HAL_NAME_LEN) {
goto fail0;
}
switch(inst->in_type) {
case HAL_BOOL: retval = hal_pin_new_bool(comp_id, HAL_IN, &inst->input.b, 0, "%s", hal_name); break;
case HAL_REAL: retval = hal_pin_new_real(comp_id, HAL_IN, &inst->input.r, 0, "%s", hal_name); break;
- case HAL_S32: retval = hal_pin_new_si32(comp_id, HAL_IN, &inst->input.s, 0, "%s", hal_name); break;
- case HAL_U32: retval = hal_pin_new_ui32(comp_id, HAL_IN, &inst->input.u, 0, "%s", hal_name); break;
- // FIXME: Future...when we switch types
case HAL_SINT: retval = hal_pin_new_sint(comp_id, HAL_IN, &inst->input.s, 0, "%s", hal_name); break;
case HAL_UINT: retval = hal_pin_new_uint(comp_id, HAL_IN, &inst->input.u, 0, "%s", hal_name); break;
default: retval = -ENOENT; break;
@@ -242,17 +239,14 @@ int rtapi_app_main(void){
//output pins
inst->outputs = hal_malloc(inst->size * sizeof(*inst->outputs));
for (p = 0; p < inst->size; p++) {
- retval = rtapi_snprintf(hal_name, HAL_NAME_LEN,
- "demux-gen.%02i.out-%s-%02i", i, types[inst->out_type], p);
- if (retval >= HAL_NAME_LEN) {
+ retval = rtapi_snprintf(hal_name, sizeof(hal_name),
+ "demux-gen.%02i.out-%s-%02i", i, types[inst->out_type], p);
+ if (retval > HAL_NAME_LEN) {
goto fail0;
}
switch(inst->out_type) {
case HAL_BOOL: retval = hal_pin_new_bool(comp_id, HAL_OUT, &inst->outputs[p].b, 0, "%s", hal_name); break;
case HAL_REAL: retval = hal_pin_new_real(comp_id, HAL_OUT, &inst->outputs[p].r, 0, "%s", hal_name); break;
- case HAL_S32: retval = hal_pin_new_si32(comp_id, HAL_OUT, &inst->outputs[p].s, 0, "%s", hal_name); break;
- case HAL_U32: retval = hal_pin_new_ui32(comp_id, HAL_OUT, &inst->outputs[p].u, 0, "%s", hal_name); break;
- // FIXME: Future...when we switch types
case HAL_SINT: retval = hal_pin_new_sint(comp_id, HAL_OUT, &inst->outputs[p].s, 0, "%s", hal_name); break;
case HAL_UINT: retval = hal_pin_new_uint(comp_id, HAL_OUT, &inst->outputs[p].u, 0, "%s", hal_name); break;
default: retval = -ENOENT; break;
@@ -261,7 +255,6 @@ int rtapi_app_main(void){
goto fail0;
}
}
-
}
hal_ready(comp_id);
@@ -307,15 +300,15 @@ void write_fp(void *arg, long period) {
case FT(HAL_BOOL, HAL_BOOL):
hal_set_bool(inst->outputs[s].b, hal_get_bool(inst->input.b));
break;
- case FT(HAL_BOOL, HAL_S32):
- hal_set_si32(inst->outputs[s].s, hal_get_bool(inst->input.b));
- break;
- case FT(HAL_BOOL, HAL_U32):
- hal_set_ui32(inst->outputs[s].u, hal_get_bool(inst->input.b));
- break;
case FT(HAL_BOOL, HAL_REAL):
hal_set_real(inst->outputs[s].r, hal_get_bool(inst->input.b) ? 1.0 : 0.0);
break;
+ case FT(HAL_BOOL, HAL_SINT):
+ hal_set_sint(inst->outputs[s].s, hal_get_bool(inst->input.b));
+ break;
+ case FT(HAL_BOOL, HAL_UINT):
+ hal_set_uint(inst->outputs[s].u, hal_get_bool(inst->input.b));
+ break;
case FT(HAL_REAL, HAL_BOOL):
hal_set_bool(inst->outputs[s].b, fabs(hal_get_real(inst->input.r)) > EPS);
@@ -323,53 +316,53 @@ void write_fp(void *arg, long period) {
case FT(HAL_REAL, HAL_REAL):
hal_set_real(inst->outputs[s].r, hal_get_real(inst->input.r));
break;
- case FT(HAL_REAL, HAL_S32): {
+ case FT(HAL_REAL, HAL_SINT): {
rtapi_real v = hal_get_real(inst->input.r);
- if (v > RTAPI_INT32_MAX) {
- hal_set_si32(inst->outputs[s].s, RTAPI_INT32_MAX);
- } else if (v < RTAPI_INT32_MIN) {
- hal_set_si32(inst->outputs[s].s, RTAPI_INT32_MIN);
+ if (v > (rtapi_real)RTAPI_SINT_MAX) {
+ hal_set_sint(inst->outputs[s].s, RTAPI_SINT_MAX);
+ } else if (v < (rtapi_real)RTAPI_SINT_MIN) {
+ hal_set_sint(inst->outputs[s].s, RTAPI_SINT_MIN);
} else {
- hal_set_si32(inst->outputs[s].s, v);
+ hal_set_sint(inst->outputs[s].s, v);
}
break; }
- case FT(HAL_REAL, HAL_U32): {
+ case FT(HAL_REAL, HAL_UINT): {
rtapi_real v = hal_get_real(inst->input.r);
- if (v > RTAPI_UINT32_MAX) {
- hal_set_ui32(inst->outputs[s].u, RTAPI_UINT32_MAX);
- } else if (v < 0) {
- hal_set_ui32(inst->outputs[s].u, 0);
+ if (v > (rtapi_real)RTAPI_UINT_MAX) {
+ hal_set_uint(inst->outputs[s].u, RTAPI_UINT_MAX);
+ } else if (v < 0.0) {
+ hal_set_uint(inst->outputs[s].u, 0);
} else {
- hal_set_ui32(inst->outputs[s].u, v);
+ hal_set_uint(inst->outputs[s].u, v);
}
break; }
- case FT(HAL_S32, HAL_BOOL):
- hal_set_bool(inst->outputs[s].b, hal_get_si32(inst->input.s) != 0);
+ case FT(HAL_SINT, HAL_BOOL):
+ hal_set_bool(inst->outputs[s].b, hal_get_sint(inst->input.s) != 0);
break;
- case FT(HAL_S32, HAL_S32):
- hal_set_si32(inst->outputs[s].s, hal_get_si32(inst->input.s));
+ case FT(HAL_SINT, HAL_REAL):
+ hal_set_real(inst->outputs[s].r, hal_get_sint(inst->input.s));
break;
- case FT(HAL_S32, HAL_U32): {
- rtapi_s32 v = hal_get_si32(inst->input.s);
- hal_set_ui32(inst->outputs[s].u, v > 0 ? v : 0);
- break; }
- case FT(HAL_S32, HAL_REAL):
- hal_set_real(inst->outputs[s].r, hal_get_si32(inst->input.s));
+ case FT(HAL_SINT, HAL_SINT):
+ hal_set_sint(inst->outputs[s].s, hal_get_sint(inst->input.s));
break;
+ case FT(HAL_SINT, HAL_UINT): {
+ rtapi_sint v = hal_get_sint(inst->input.s);
+ hal_set_uint(inst->outputs[s].u, v > 0 ? v : 0);
+ break; }
- case FT(HAL_U32, HAL_BIT):
- hal_set_bool(inst->outputs[s].b, hal_get_ui32(inst->input.u) != 0);
+ case FT(HAL_UINT, HAL_BOOL):
+ hal_set_bool(inst->outputs[s].b, hal_get_uint(inst->input.u) != 0);
break;
- case FT(HAL_U32, HAL_S32): {
- rtapi_u32 v = hal_get_ui32(inst->input.u);
- hal_set_si32(inst->outputs[s].s, v > (rtapi_u32)RTAPI_INT32_MAX ? RTAPI_INT32_MAX : (rtapi_s32)v);
- break; }
- case FT(HAL_U32, HAL_U32):
- hal_set_ui32(inst->outputs[s].u, hal_get_ui32(inst->input.u));
+ case FT(HAL_UINT, HAL_REAL):
+ hal_set_real(inst->outputs[s].r, hal_get_uint(inst->input.u));
break;
- case FT(HAL_U32, HAL_REAL):
- hal_set_real(inst->outputs[s].r, hal_get_ui32(inst->input.u));
+ case FT(HAL_UINT, HAL_SINT): {
+ rtapi_uint v = hal_get_uint(inst->input.u);
+ hal_set_sint(inst->outputs[s].s, v > RTAPI_SINT_MAX ? RTAPI_SINT_MAX : v);
+ break; }
+ case FT(HAL_UINT, HAL_UINT):
+ hal_set_uint(inst->outputs[s].u, hal_get_uint(inst->input.u));
break;
}
}
diff --git a/src/hal/components/enum.c b/src/hal/components/enum.c
index e6ecf728779..65de5e0fb50 100644
--- a/src/hal/components/enum.c
+++ b/src/hal/components/enum.c
@@ -30,7 +30,7 @@
/* module information */
MODULE_AUTHOR("Andy Pugh");
-MODULE_DESCRIPTION("convert enumerated types to HAL_BIT pins");
+MODULE_DESCRIPTION("convert enumerated types to HAL_BOOL pins");
MODULE_LICENSE("GPL");
#define MAX_CHAN 256
diff --git a/src/hal/components/mkconv.sh b/src/hal/components/mkconv.sh
index b61e2f3dd2a..038aa257c81 100644
--- a/src/hal/components/mkconv.sh
+++ b/src/hal/components/mkconv.sh
@@ -9,12 +9,10 @@ fi
# Convert the hal type into the underlying type
utype() {
case "$1" in
- "bit") echo "rtapi_bool" ;;
- "s32") echo "rtapi_s32" ;;
- "u32") echo "rtapi_u32" ;;
- "s64") echo "rtapi_sint" ;;
- "u64") echo "rtapi_uint" ;;
- "float") echo "rtapi_real" ;;
+ "bool") echo "rtapi_bool" ;;
+ "sint") echo "rtapi_sint" ;;
+ "uint") echo "rtapi_uint" ;;
+ "real") echo "rtapi_real" ;;
*) echo "This_Will_Generate_An_Error" ;;
esac
}
@@ -22,12 +20,10 @@ utype() {
# Return the maximum value supported by a type
maxval() {
case "$1" in
- "bit") echo "1" ;;
- "s32") echo "RTAPI_INT32_MAX" ;;
- "u32") echo "RTAPI_UINT32_MAX" ;;
- "s64") echo "RTAPI_INT64_MAX" ;;
- "u64") echo "RTAPI_UINT64_MAX" ;;
- "float") echo "Never_Used" ;;
+ "bool") echo "1" ;;
+ "sint") echo "RTAPI_SINT_MAX" ;;
+ "uint") echo "RTAPI_UINT_MAX" ;;
+ "real") echo "Never_Used" ;;
*) echo "This_Will_Generate_An_Error" ;;
esac
}
@@ -35,12 +31,10 @@ maxval() {
# Return the minimum value supported by a type
minval() {
case "$1" in
- "bit") echo "0" ;;
- "s32") echo "RTAPI_INT32_MIN" ;;
- "u32") echo "0" ;;
- "s64") echo "RTAPI_INT64_MIN" ;;
- "u64") echo "0" ;;
- "float") echo "Never_Used" ;;
+ "bool") echo "0" ;;
+ "sint") echo "RTAPI_SINT_MIN" ;;
+ "uint") echo "0" ;;
+ "real") echo "Never_Used" ;;
*) echo "This_Will_Generate_An_Error" ;;
esac
}
@@ -48,12 +42,10 @@ minval() {
# New HAL types
_newtype() {
case "$1" in
- "bit") echo "bool" ;;
- "s32") echo "si32" ;;
- "u32") echo "ui32" ;;
- "s64") echo "sint" ;;
- "u64") echo "uint" ;;
- "float") echo "real" ;;
+ "bool") echo "bool" ;;
+ "sint") echo "sint" ;;
+ "uint") echo "uint" ;;
+ "real") echo "real" ;;
*) echo "This_Will_Generate_An_Error" ;;
esac
}
@@ -64,48 +56,42 @@ _newtype() {
# + = max side bound needed
# - = min side bound needed
# (table: vertical=from ($1); horizontal=to ($2))
-# | flt | u32 | s32 | u64 | s64 | bit
-# ----+-----+-----+-----+-----+-----+-----
-# flt | xxx | +- | +- | +- | +- | xxx
-# u32 | o | xxx | + | o | o | +
-# s32 | o | - | xxx | - | o | +-
-# u64 | o | + | + | xxx | + | +
-# s64 | o | +- | +- | - | xxx | +-
-# bit | o | o | o | o | o | xxx
+# | real | uint | sint | bool
+# -----+------+------+------+------
+# real | xxx | +- | +- | xxx
+# uint | o | xxx | + | +
+# sint | o | - | xxx | +-
+# bool | o | o | o | xxx
#
# Boolean implementation of the above table:
-# | flt | u32 | s32 | u64 | s64 | bit
-# ----+-----+-----+-----+-----+-----+-----
-# flt | o+- | +- | +- | +- | +- | x+-
-# u32 | o | xxx | + | o | o | +
-# s32 | o | - | x+x | - | o | +-
-# u64 | o | + | + | x+x | + | +
-# s64 | o | +- | +- | - | xx- | +-
-# bit | o | o | o | o | o | o+x
+# | real | uint | sint | bool
+# -----+------+------+------+------
+# real | o+- | +- | +- | x+-
+# uint | o | x+x | + | +
+# sint | o | - | xx- | +-
+# bool | o | o | o | o+x
#
# Enable (val > MAX) test
V=1
-test "$1" = 'float' -o \
- "$2" = 'bit' -o \
- \( "$2" = 's32' -a "$1" != 'bit' \) -o \
- \( "$1" = 'u64' -a "$2" != 'float' \) -o \
- \( "$1" = 's64' -a "$2" = 'u32' \) && V=0
+test "$1" = 'real' -o \
+ "$2" = 'bool' -o \
+ \( "$1" = 'uint' -a "$2" != 'real' \) && V=0
MAXEN="s,@MAXEN@,$V,g"
# Enable (val < MIN) test
V=1
-test "$1" = 'float' -o \
- \( "$1" = 's64' -a "$2" != 'float' \) -o \
- \( "$1" = 's32' -a \( "$2" = 'u32' -o "$2" = 'u64' -o "$2" = 'bit' \) \) && V=0
+test "$1" = 'real' -o \
+ \( "$1" = 'sint' -a "$2" != 'real' \) && V=0
MINEN="s,@MINEN@,$V,g"
# Disable clamp code
-if test "$2" = 'float' -o \
- "$1" = 'bit' -o \
- \( "$1" = 'u32' -a \( "$2" = 'u64' -o "$2" = 's64' \) \) -o \
- \( "$1" = 's32' -a "$2" = 's64' \)
-then CC="s,@CC@,//,g"; else CC="s,@CC@,,g"; fi
+if test "$2" = 'real' -o \
+ "$1" = 'bool'; then
+ CC="s,@CC@,//,g"
+else
+ CC="s,@CC@,,g"
+fi
XIN="s,@XIN@,${1},g"
XOUT="s,@XOUT@,${2},g"
diff --git a/src/hal/components/mux_generic.c b/src/hal/components/mux_generic.c
index a5515e3633b..eb5a4b592fa 100644
--- a/src/hal/components/mux_generic.c
+++ b/src/hal/components/mux_generic.c
@@ -62,8 +62,8 @@ RTAPI_MP_ARRAY_STRING(config, MAX_CHAN, "mux specifiers inNUMout");
int rtapi_app_main(void){
int retval;
int i, f;
- char hal_name[HAL_NAME_LEN];
- char *types[5] = {"invalid", "bit", "float", "s32", "u32"};
+ char hal_name[HAL_NAME_LEN+1];
+ static const char *types[HAL_TYPE_MAX] = {"invalid", "bool", "real", "sint", "uint", "port"};
if (!config[0]) {
rtapi_print_msg(RTAPI_MSG_ERR, "The mux_generic component requires at least"
" one valid format string\n");
@@ -122,11 +122,11 @@ int rtapi_app_main(void){
break;
case 's':
case 'S':
- type = HAL_S32;
+ type = HAL_SINT;
break;
case 'u':
case 'U':
- type = HAL_U32;
+ type = HAL_UINT;
break;
default:
rtapi_print_msg(RTAPI_MSG_ERR, "mux_generic: invalid character in "
@@ -209,9 +209,6 @@ int rtapi_app_main(void){
switch(inst->in_type) {
case HAL_BOOL: retval = hal_pin_new_bool(comp_id, HAL_IN, &inst->inputs[p].b, 0, "%s", hal_name); break;
case HAL_REAL: retval = hal_pin_new_real(comp_id, HAL_IN, &inst->inputs[p].r, 0, "%s", hal_name); break;
- case HAL_S32: retval = hal_pin_new_si32(comp_id, HAL_IN, &inst->inputs[p].s, 0, "%s", hal_name); break;
- case HAL_U32: retval = hal_pin_new_ui32(comp_id, HAL_IN, &inst->inputs[p].u, 0, "%s", hal_name); break;
- // FIXME: Future...when we switch types
case HAL_SINT: retval = hal_pin_new_sint(comp_id, HAL_IN, &inst->inputs[p].s, 0, "%s", hal_name); break;
case HAL_UINT: retval = hal_pin_new_uint(comp_id, HAL_IN, &inst->inputs[p].u, 0, "%s", hal_name); break;
default: retval = -ENOENT; break;
@@ -244,17 +241,14 @@ int rtapi_app_main(void){
}
//output pins
- retval = rtapi_snprintf(hal_name, HAL_NAME_LEN,
- "mux-gen.%02i.out-%s", i, types[inst->out_type]);
- if (retval >= HAL_NAME_LEN) {
+ retval = rtapi_snprintf(hal_name, sizeof(hal_name),
+ "mux-gen.%02i.out-%s", i, types[inst->out_type]);
+ if (retval > HAL_NAME_LEN) {
goto fail0;
}
switch(inst->out_type) {
case HAL_BOOL: retval = hal_pin_new_bool(comp_id, HAL_OUT, &inst->output.b, 0, "%s", hal_name); break;
case HAL_REAL: retval = hal_pin_new_real(comp_id, HAL_OUT, &inst->output.r, 0, "%s", hal_name); break;
- case HAL_S32: retval = hal_pin_new_si32(comp_id, HAL_OUT, &inst->output.s, 0, "%s", hal_name); break;
- case HAL_U32: retval = hal_pin_new_ui32(comp_id, HAL_OUT, &inst->output.u, 0, "%s", hal_name); break;
- // FIXME: Future...when we switch types
case HAL_SINT: retval = hal_pin_new_sint(comp_id, HAL_OUT, &inst->output.s, 0, "%s", hal_name); break;
case HAL_UINT: retval = hal_pin_new_uint(comp_id, HAL_OUT, &inst->output.u, 0, "%s", hal_name); break;
default: retval = -ENOENT; break;
@@ -262,7 +256,6 @@ int rtapi_app_main(void){
if (retval != 0) {
goto fail0;
}
-
}
hal_ready(comp_id);
@@ -307,11 +300,11 @@ void write_fp(void *arg, long period) {
case FT(HAL_BOOL, HAL_BOOL):
hal_set_bool(inst->output.b, hal_get_bool(inst->inputs[s].b));
break;
- case FT(HAL_BOOL, HAL_S32):
- hal_set_si32(inst->output.s, hal_get_bool(inst->inputs[s].b));
+ case FT(HAL_BOOL, HAL_SINT):
+ hal_set_sint(inst->output.s, hal_get_bool(inst->inputs[s].b));
break;
- case FT(HAL_BOOL, HAL_U32):
- hal_set_ui32(inst->output.u, hal_get_bool(inst->inputs[s].b));
+ case FT(HAL_BOOL, HAL_UINT):
+ hal_set_uint(inst->output.u, hal_get_bool(inst->inputs[s].b));
break;
case FT(HAL_BOOL, HAL_REAL):
hal_set_real(inst->output.r, hal_get_bool(inst->inputs[s].b) ? 1.0 : 0.0);
@@ -320,56 +313,56 @@ void write_fp(void *arg, long period) {
case FT(HAL_REAL, HAL_BOOL):
hal_set_bool(inst->output.b, fabs(hal_get_real(inst->inputs[s].r)) > EPS);
break;
- case FT(HAL_REAL, HAL_REAL):
- hal_set_real(inst->output.r, hal_get_real(inst->inputs[s].r));
- break;
- case FT(HAL_REAL, HAL_S32): {
+ case FT(HAL_REAL, HAL_SINT): {
rtapi_real v = hal_get_real(inst->inputs[s].r);
- if (v > RTAPI_INT32_MAX) {
- hal_set_si32(inst->output.s, RTAPI_INT32_MAX);
- } else if (v < RTAPI_INT32_MIN) {
- hal_set_si32(inst->output.s, RTAPI_INT32_MIN);
+ if (v > (rtapi_real)RTAPI_SINT_MAX) {
+ hal_set_sint(inst->output.s, RTAPI_SINT_MAX);
+ } else if (v < (rtapi_real)RTAPI_SINT_MIN) {
+ hal_set_sint(inst->output.s, RTAPI_SINT_MIN);
} else {
- hal_set_si32(inst->output.s, v);
+ hal_set_sint(inst->output.s, v);
}
break; }
- case FT(HAL_REAL, HAL_U32): {
+ case FT(HAL_REAL, HAL_UINT): {
rtapi_real v = hal_get_real(inst->inputs[s].r);
- if (v > RTAPI_UINT32_MAX) {
- hal_set_ui32(inst->output.u, RTAPI_UINT32_MAX);
- } else if (v < 0) {
- hal_set_ui32(inst->output.u, 0);
+ if (v > (rtapi_real)RTAPI_UINT_MAX) {
+ hal_set_uint(inst->output.u, RTAPI_UINT_MAX);
+ } else if (v < 0.0) {
+ hal_set_uint(inst->output.u, 0);
} else {
- hal_set_ui32(inst->output.u, v);
+ hal_set_uint(inst->output.u, v);
}
break; }
+ case FT(HAL_REAL, HAL_REAL):
+ hal_set_real(inst->output.r, hal_get_real(inst->inputs[s].r));
+ break;
- case FT(HAL_S32, HAL_BOOL):
- hal_set_bool(inst->output.b, hal_get_si32(inst->inputs[s].s) != 0);
+ case FT(HAL_SINT, HAL_BOOL):
+ hal_set_bool(inst->output.b, hal_get_sint(inst->inputs[s].s) != 0);
break;
- case FT(HAL_S32, HAL_S32):
- hal_set_si32(inst->output.s, hal_get_si32(inst->inputs[s].s));
+ case FT(HAL_SINT, HAL_SINT):
+ hal_set_sint(inst->output.s, hal_get_sint(inst->inputs[s].s));
break;
- case FT(HAL_S32, HAL_U32): {
- rtapi_s32 v = hal_get_si32(inst->inputs[s].s);
- hal_set_ui32(inst->output.u, v >= 0 ? v : 0);
+ case FT(HAL_SINT, HAL_UINT): {
+ rtapi_sint v = hal_get_sint(inst->inputs[s].s);
+ hal_set_uint(inst->output.u, v >= 0 ? v : 0);
break; }
- case FT(HAL_S32, HAL_REAL):
- hal_set_real(inst->output.r, hal_get_si32(inst->inputs[s].s));
+ case FT(HAL_SINT, HAL_REAL):
+ hal_set_real(inst->output.r, hal_get_sint(inst->inputs[s].s));
break;
- case FT(HAL_U32, HAL_BOOL):
- hal_set_bool(inst->output.b, hal_get_ui32(inst->inputs[s].u) != 0);
+ case FT(HAL_UINT, HAL_BOOL):
+ hal_set_bool(inst->output.b, hal_get_uint(inst->inputs[s].u) != 0);
break;
- case FT(HAL_U32, HAL_S32): {
- rtapi_u32 v = hal_get_ui32(inst->inputs[s].u);
- hal_set_si32(inst->output.s, v > RTAPI_INT32_MAX ? RTAPI_INT32_MAX : v);
+ case FT(HAL_UINT, HAL_SINT): {
+ rtapi_uint v = hal_get_uint(inst->inputs[s].u);
+ hal_set_sint(inst->output.s, v > RTAPI_SINT_MAX ? RTAPI_SINT_MAX : v);
break; }
- case FT(HAL_U32, HAL_U32):
- hal_set_ui32(inst->output.u, hal_get_ui32(inst->inputs[s].u));
+ case FT(HAL_UINT, HAL_UINT):
+ hal_set_uint(inst->output.u, hal_get_uint(inst->inputs[s].u));
break;
- case FT(HAL_U32, HAL_REAL):
- hal_set_real(inst->output.r, hal_get_ui32(inst->inputs[s].u));
+ case FT(HAL_UINT, HAL_REAL):
+ hal_set_real(inst->output.r, hal_get_uint(inst->inputs[s].u));
break;
}
}
diff --git a/src/hal/components/pushmsg.comp b/src/hal/components/pushmsg.comp
index adbe0e8e306..ef1f3f5288d 100644
--- a/src/hal/components/pushmsg.comp
+++ b/src/hal/components/pushmsg.comp
@@ -30,12 +30,10 @@ following syntax: +
Each placeholder creates a typed input pin *pushmsg*.____.____
that the user wires up to the source signal.
The type letter in the placeholder selects the pin type:
- * `b` - bit
- * `s` - s32
- * `u` - u32
- * `l` - s64
- * `k` - u64
- * `f` - float
+ * `b` - bool
+ * `s`,`l` - sint
+ * `u`,`k` - uint
+ * `f`,`r` - real
Each message line is limited to 128 characters in length. The length count
includes the `level` indicator, `pinname`, `message` text and the `|` separator
@@ -284,32 +282,25 @@ static int setup_message(const char *pfx, int idx, const char *msg, msg_slot_t *
return rv;
break;
case 's': case 'S':
- slot->substtype[subst] = HAL_S32;
- if ((rv = hal_pin_new_si32(comp_id, HAL_IN, &pin->substs[subst].s, 0, "%s.%s", pinname, cptr)) < 0)
- return rv;
- break;
- case 'u': case 'U':
- slot->substtype[subst] = HAL_U32;
- if ((rv = hal_pin_new_ui32(comp_id, HAL_IN, &pin->substs[subst].u, 0, "%s.%s", pinname, cptr)) < 0)
- return rv;
- break;
case 'l': case 'L':
slot->substtype[subst] = HAL_SINT;
if ((rv = hal_pin_new_sint(comp_id, HAL_IN, &pin->substs[subst].s, 0, "%s.%s", pinname, cptr)) < 0)
return rv;
break;
+ case 'u': case 'U':
case 'k': case 'K':
slot->substtype[subst] = HAL_UINT;
if ((rv = hal_pin_new_uint(comp_id, HAL_IN, &pin->substs[subst].u, 0, "%s.%s", pinname, cptr)) < 0)
return rv;
break;
case 'f': case 'F':
+ case 'r': case 'R':
slot->substtype[subst] = HAL_REAL;
if ((rv = hal_pin_new_real(comp_id, HAL_IN, &pin->substs[subst].r, 0.0, "%s.%s", pinname, cptr)) < 0)
return rv;
break;
default:
- rtapi_print_msg(RTAPI_MSG_ERR, "%s: Message %d bad substitution type '%c', expected one of {b,f,s,u,k,l}\n",
+ rtapi_print_msg(RTAPI_MSG_ERR, "%s: Message %d bad substitution type '%c', expected one of {b,f,r,s,u,k,l}\n",
pfx, idx, printable(tchar));
return -EBADMSG;
}
@@ -390,12 +381,6 @@ static void print_slot(int s)
case HAL_BOOL:
n = rtapi_snprintf(end, left, "%d%s", (int)hal_get_bool(pins[s].substs[i].b), slots[s].parts[i]);
break;
- case HAL_S32:
- n = rtapi_snprintf(end, left, "%d%s", (int)hal_get_si32(pins[s].substs[i].s), slots[s].parts[i]);
- break;
- case HAL_U32:
- n = rtapi_snprintf(end, left, "%u%s", (unsigned)hal_get_ui32(pins[s].substs[i].u), slots[s].parts[i]);
- break;
case HAL_SINT:
n = rtapi_snprintf(end, left, "%ld%s", (long)hal_get_sint(pins[s].substs[i].s), slots[s].parts[i]);
break;
diff --git a/src/hal/components/raster.comp b/src/hal/components/raster.comp
index 553c6df9515..9e3b66b000f 100644
--- a/src/hal/components/raster.comp
+++ b/src/hal/components/raster.comp
@@ -95,7 +95,7 @@ static bool float_eq(rtapi_real a, rtapi_real b) {
return fabs(a-b) < epsilon;
}
-static bool read_float(const hal_port_t *port, hal_real_t value) {
+static bool read_float(const hal_port_t port, hal_real_t value) {
char data[32];
int available = hal_port_readable(port);
char* pos;
@@ -119,7 +119,7 @@ static bool read_float(const hal_port_t *port, hal_real_t value) {
return true;
}
-static bool read_int(const hal_port_t *port, hal_sint_t value) {
+static bool read_int(const hal_port_t port, hal_sint_t value) {
char data[10];
long val;
int available = hal_port_readable(port);
@@ -157,7 +157,7 @@ static bool read_int(const hal_port_t *port, hal_sint_t value) {
pixels bpp must be defined in increments of 4.
a pixel value with all 1 bits is a special value considered "off" for the raster and no power will be output
*/
-static bool read_pixel_data(const hal_port_t *port, int bits_per_pixel, hal_real_t power) {
+static bool read_pixel_data(const hal_port_t port, int bits_per_pixel, hal_real_t power) {
char data[8];
long value = 0;
unsigned int off = 0xFFFFFFFF >> (32 - bits_per_pixel);
diff --git a/src/hal/components/reset.comp b/src/hal/components/reset.comp
index fb198026d80..b29c5e0d77d 100644
--- a/src/hal/components/reset.comp
+++ b/src/hal/components/reset.comp
@@ -37,15 +37,15 @@
******************************************************************************/
component reset "Resets an IO signal";
-pin in bool trigger "Trigger input";
-pin io ui32 out_u32 = 0 "Unsigned 32 bit integer output value";
-pin in ui32 reset_u32 = 0 "Unsigned 32 bit integer reset value";
-pin io si32 out_s32 = 0 "Signed 32 bit integer output value";
-pin in si32 reset_s32 = 0 "Signed 32 bit integer reset value";
-pin io real out_float = 0.0 "Float output value";
-pin in real reset_float = 0.0 "Float reset value";
-pin io bool out_bit = false "Bit integer output value";
-pin in bool reset_bit = false "Bit reset value";
+pin in bool trigger "Trigger input";
+pin io uint out_uint = 0 "Unsigned integer output value";
+pin in uint reset_uint = 0 "Unsigned integer reset value";
+pin io sint out_sint = 0 "Signed integer output value";
+pin in sint reset_sint = 0 "Signed integer reset value";
+pin io real out_real = 0.0 "Float output value";
+pin in real reset_real = 0.0 "Float reset value";
+pin io bool out_bool = false "Bit integer output value";
+pin in bool reset_bool = false "Bit reset value";
pin in bool retriggerable = true "Allow additional edges to reset";
pin in bool rising = true "Trigger on rising edge";
pin in bool falling = false "Trigger on falling edge";
@@ -67,10 +67,10 @@ FUNCTION(_) {
rtapi_bool new_trigger = trigger;
if ((new_trigger != last_trigger) && ((rising && (new_trigger)) || (falling && (!new_trigger))))
{
- out_u32_set(reset_u32);
- out_s32_set(reset_s32);
- out_float_set(reset_float);
- out_bit_set(reset_bit);
+ out_uint_set(reset_uint);
+ out_sint_set(reset_sint);
+ out_real_set(reset_real);
+ out_bool_set(reset_bool);
}
last_trigger = new_trigger;
}
diff --git a/src/hal/components/sampler.c b/src/hal/components/sampler.c
index 996091c7de7..55181f9b958 100644
--- a/src/hal/components/sampler.c
+++ b/src/hal/components/sampler.c
@@ -168,8 +168,6 @@ static void sample(void *arg, long period)
for (int n = 0; n < num_pins; n++) {
switch (hal_stream_element_type(&samp->fifo, n)) {
case HAL_REAL: data[n].f = hal_get_real(samp->pins[n].r); break;
- case HAL_S32: data[n].s = hal_get_si32(samp->pins[n].s); break;
- case HAL_U32: data[n].u = hal_get_ui32(samp->pins[n].u); break;
case HAL_SINT: data[n].l = hal_get_sint(samp->pins[n].s); break;
case HAL_UINT: data[n].k = hal_get_uint(samp->pins[n].u); break;
case HAL_BOOL: data[n].b = hal_get_bool(samp->pins[n].b); break;
@@ -231,8 +229,6 @@ static int init_sampler(int num, sampler_t *str)
int type;
switch(type = hal_stream_element_type(&str->fifo, n)) {
case HAL_REAL: retval = hal_pin_new_real(comp_id, HAL_IN, &str->pins[n].r, 0.0, pstr, num, n); break;
- case HAL_S32: retval = hal_pin_new_si32(comp_id, HAL_IN, &str->pins[n].s, 0, pstr, num, n); break;
- case HAL_U32: retval = hal_pin_new_ui32(comp_id, HAL_IN, &str->pins[n].u, 0, pstr, num, n); break;
case HAL_SINT: retval = hal_pin_new_sint(comp_id, HAL_IN, &str->pins[n].s, 0, pstr, num, n); break;
case HAL_UINT: retval = hal_pin_new_uint(comp_id, HAL_IN, &str->pins[n].u, 0, pstr, num, n); break;
case HAL_BOOL: retval = hal_pin_new_bool(comp_id, HAL_IN, &str->pins[n].b, 0, pstr, num, n); break;
diff --git a/src/hal/components/sampler_usr.c b/src/hal/components/sampler_usr.c
index ab4cd207640..71d2abeaa9e 100644
--- a/src/hal/components/sampler_usr.c
+++ b/src/hal/components/sampler_usr.c
@@ -220,12 +220,6 @@ int main(int argc, char **argv)
printf ( "0 " );
}
break;
- case HAL_U32:
- printf ( "%lu ", (unsigned long)buf[n].u);
- break;
- case HAL_S32:
- printf ( "%ld ", (long)buf[n].s);
- break;
case HAL_UINT:
printf ( "%llu ", (unsigned long long)buf[n].k);
break;
diff --git a/src/hal/components/streamer.c b/src/hal/components/streamer.c
index 7c1d7714f52..1f028f08294 100644
--- a/src/hal/components/streamer.c
+++ b/src/hal/components/streamer.c
@@ -224,8 +224,6 @@ static void update(void *arg, long period)
for (int n = 0; n < num_pins; n++) {
switch ( hal_stream_element_type(&str->fifo, n) ) {
case HAL_REAL: hal_set_real(str->pins[n].r, data[n].f); break;
- case HAL_S32: hal_set_si32(str->pins[n].s, data[n].s); break;
- case HAL_U32: hal_set_ui32(str->pins[n].u, data[n].u); break;
case HAL_SINT: hal_set_sint(str->pins[n].s, data[n].l); break;
case HAL_UINT: hal_set_uint(str->pins[n].u, data[n].k); break;
case HAL_BOOL: hal_set_bool(str->pins[n].b, data[n].b); break;
@@ -277,8 +275,6 @@ static int init_streamer(int num, streamer_t *str)
int type;
switch(type = hal_stream_element_type(&str->fifo, n)) {
case HAL_REAL: retval = hal_pin_new_real(comp_id, HAL_OUT, &str->pins[n].r, 0.0, pstr, num, n); break;
- case HAL_S32: retval = hal_pin_new_si32(comp_id, HAL_OUT, &str->pins[n].s, 0, pstr, num, n); break;
- case HAL_U32: retval = hal_pin_new_ui32(comp_id, HAL_OUT, &str->pins[n].u, 0, pstr, num, n); break;
case HAL_SINT: retval = hal_pin_new_sint(comp_id, HAL_OUT, &str->pins[n].s, 0, pstr, num, n); break;
case HAL_UINT: retval = hal_pin_new_uint(comp_id, HAL_OUT, &str->pins[n].u, 0, pstr, num, n); break;
case HAL_BOOL: retval = hal_pin_new_bool(comp_id, HAL_OUT, &str->pins[n].b, 0, pstr, num, n); break;
diff --git a/src/hal/components/streamer_usr.c b/src/hal/components/streamer_usr.c
index bbbf632b1b6..2ba5d9168f1 100644
--- a/src/hal/components/streamer_usr.c
+++ b/src/hal/components/streamer_usr.c
@@ -201,12 +201,6 @@ int main(int argc, char **argv)
cp2 = cp;
}
break;
- case HAL_U32:
- dptr->u = strtoul(cp, &cp2, 10);
- break;
- case HAL_S32:
- dptr->s = strtol(cp, &cp2, 10);
- break;
case HAL_UINT:
dptr->k = strtoull(cp, &cp2, 10);
break;
diff --git a/src/hal/components/time.comp b/src/hal/components/time.comp
index 2aa4061c5c3..1fa8ce4c5e1 100644
--- a/src/hal/components/time.comp
+++ b/src/hal/components/time.comp
@@ -104,13 +104,13 @@ pin in bool start "Timer On";
pin in bool pause = 0 "Pause";
// Output Pins
-pin out ui32 seconds "Seconds";
-pin out ui32 minutes "Minutes";
-pin out ui32 hours "Hours";
+pin out uint seconds "Seconds";
+pin out uint minutes "Minutes";
+pin out uint hours "Hours";
// Global Variables
variable rtapi_real totalnsec;
-variable int old_start;
+variable rtapi_bool old_start;
function _;
@@ -118,8 +118,8 @@ function _;
FUNCTION(_) {
- rtapi_u32 totalseconds;
- int running = start || pause;
+ rtapi_uint totalseconds;
+ rtapi_bool running = start || pause;
if(running && !old_start) totalnsec = 0;
if(start && !pause){
diff --git a/src/hal/components/weighted_sum.c b/src/hal/components/weighted_sum.c
index d28b2aa0a26..65e36f2c7d4 100644
--- a/src/hal/components/weighted_sum.c
+++ b/src/hal/components/weighted_sum.c
@@ -5,9 +5,9 @@
* See the "Users Manual" at emc2/docs/Hal_Introduction.pdf
*
* This component is a "weighted summer". It has a (user specified)
-* number of HAL_BIT input pins, and a HAL_S32 parameter corresponding
+* number of HAL_BOOL input pins, and a HAL_SINT parameter corresponding
* to each bit input.
-* There is one HAL_S32 output. The output value is the sum of the
+* There is one HAL_SINT output. The output value is the sum of the
* parameters for which the corresponding bit input is true.
*
* The default value for the parameters is 2^n, where n is the bit number.
diff --git a/src/hal/drivers/mesa-hostmot2/hm2_modbus.c b/src/hal/drivers/mesa-hostmot2/hm2_modbus.c
index 251bfef219d..399b23aae3a 100644
--- a/src/hal/drivers/mesa-hostmot2/hm2_modbus.c
+++ b/src/hal/drivers/mesa-hostmot2/hm2_modbus.c
@@ -1459,13 +1459,6 @@ static int build_data_frame(hm2_modbus_inst_t *inst)
case HAL_BOOL:
CHK_RV(map_u(cc, hal_get_bool(hal->pins[p].pin.b) ? 1 : 0, 0));
break;
- case HAL_U32:
- switch(mtypetype(cc->typeptr[0].mtype)) {
- case MBT_U: CHK_RV(map_u(cc, hal_get_ui32(hal->pins[p].pin.u), 0)); break;
- case MBT_S: CHK_RV(map_s(cc, map_us(hal_get_ui32(hal->pins[p].pin.u)), 0)); break;
- case MBT_F: CHK_RV(map_f(cc, map_uf(hal_get_ui32(hal->pins[p].pin.u)), 0)); break;
- }
- break;
case HAL_UINT:
switch(mtypetype(cc->typeptr[0].mtype)) {
case MBT_U: CHK_RV(map_u(cc, hal_get_uint(hal->pins[p].pin.u), 0)); break;
@@ -1473,22 +1466,6 @@ static int build_data_frame(hm2_modbus_inst_t *inst)
case MBT_F: CHK_RV(map_f(cc, map_uf(hal_get_uint(hal->pins[p].pin.u)), 0)); break;
}
break;
- case HAL_S32:
- if(!haspinscale(&cc->typeptr[0])) {
- switch(mtypetype(cc->typeptr[0].mtype)) {
- case MBT_U: CHK_RV(map_u(cc, map_su(hal_get_si32(hal->pins[p].pin.s)), 0)); break;
- case MBT_S: CHK_RV(map_s(cc, hal_get_si32(hal->pins[p].pin.s), 0)); break;
- case MBT_F: CHK_RV(map_f(cc, map_sf(hal_get_si32(hal->pins[p].pin.s)), 0)); break;
- }
- } else {
- val64.f = (rtapi_real)((rtapi_s64)hal_get_si32(hal->pins[p].pin.s) - hal_get_si32(hal->pins[p].offset.s)) * hal_get_real(hal->pins[p].scale);
- switch(mtypetype(cc->typeptr[0].mtype)) {
- case MBT_U: CHK_RV(map_u(cc, map_fu(val64.f), 0)); break;
- case MBT_S: CHK_RV(map_s(cc, map_fs(val64.f), 0)); break;
- case MBT_F: CHK_RV(map_f(cc, val64.f, 0)); break;
- }
- }
- break;
case HAL_SINT:
if(!haspinscale(&cc->typeptr[0])) {
switch(mtypetype(cc->typeptr[0].mtype)) {
@@ -1555,13 +1532,6 @@ static int build_data_frame(hm2_modbus_inst_t *inst)
case HAL_BOOL:
CHK_RV(map_u(cc, hal_get_bool(hal->pins[p].pin.b) ? 1 : 0, i));
break;
- case HAL_U32:
- switch(mtypetype(cc->typeptr[i].mtype)) {
- case MBT_U: CHK_RV(map_u(cc, hal_get_ui32(hal->pins[p].pin.u), i)); break;
- case MBT_S: CHK_RV(map_s(cc, map_us(hal_get_ui32(hal->pins[p].pin.u)), i)); break;
- case MBT_F: CHK_RV(map_f(cc, map_uf(hal_get_ui32(hal->pins[p].pin.u)), i)); break;
- }
- break;
case HAL_UINT:
switch(mtypetype(cc->typeptr[i].mtype)) {
case MBT_U: CHK_RV(map_u(cc, hal_get_uint(hal->pins[p].pin.u), i)); break;
@@ -1569,22 +1539,6 @@ static int build_data_frame(hm2_modbus_inst_t *inst)
case MBT_F: CHK_RV(map_f(cc, map_uf(hal_get_uint(hal->pins[p].pin.u)), i)); break;
}
break;
- case HAL_S32:
- if(!haspinscale(&cc->typeptr[i])) {
- switch(mtypetype(cc->typeptr[i].mtype)) {
- case MBT_U: CHK_RV(map_u(cc, map_su(hal_get_si32(hal->pins[p].pin.s)), i)); break;
- case MBT_S: CHK_RV(map_s(cc, hal_get_si32(hal->pins[p].pin.s), i)); break;
- case MBT_F: CHK_RV(map_f(cc, map_sf(hal_get_si32(hal->pins[p].pin.s)), i)); break;
- }
- } else {
- val64.f = (rtapi_real)((rtapi_s64)hal_get_si32(hal->pins[p].pin.s) - hal_get_si32(hal->pins[p].offset.s)) * hal_get_real(hal->pins[p].scale);
- switch(mtypetype(cc->typeptr[i].mtype)) {
- case MBT_U: CHK_RV(map_u(cc, map_fu(val64.f), i)); break;
- case MBT_S: CHK_RV(map_s(cc, map_fs(val64.f), i)); break;
- case MBT_F: CHK_RV(map_f(cc, val64.f, i)); break;
- }
- }
- break;
case HAL_SINT:
if(!haspinscale(&cc->typeptr[i])) {
switch(mtypetype(cc->typeptr[i].mtype)) {
@@ -1700,56 +1654,6 @@ static inline rtapi_u64 mask_mbtsize(unsigned mtype, rtapi_u64 v)
}
}
-static inline rtapi_u32 unmap32_uu(const hm2_modbus_cmd_t *cc, rtapi_u64 v, unsigned tidx)
-{
- if(haspinclamp(&cc->typeptr[tidx]) && v > RTAPI_UINT32_MAX)
- return RTAPI_UINT32_MAX;
- return (rtapi_u32)v;
-}
-
-static inline rtapi_u32 unmap32_us(const hm2_modbus_cmd_t *cc, rtapi_s64 v, unsigned tidx)
-{
- if(haspinclamp(&cc->typeptr[tidx])) {
- if(v > RTAPI_INT32_MAX) return RTAPI_INT32_MAX;
- if(v < 0) return 0;
- }
- return (rtapi_u32)v;
-}
-
-static inline rtapi_u32 unmap32_uf(const hm2_modbus_cmd_t *cc, double v, unsigned tidx)
-{
- if(haspinclamp(&cc->typeptr[tidx])) {
- if(v > (double)RTAPI_INT32_MAX) return RTAPI_INT32_MAX;
- if(v < 0.0) return 0;
- }
- return (rtapi_u32)v;
-}
-
-static inline rtapi_s32 unmap32_su(const hm2_modbus_cmd_t *cc, rtapi_u64 v, unsigned tidx)
-{
- if(haspinclamp(&cc->typeptr[tidx]) && v > (rtapi_u64)RTAPI_INT32_MAX)
- return RTAPI_INT32_MAX;
- return (rtapi_s32)v;
-}
-
-static inline rtapi_s32 unmap32_ss(const hm2_modbus_cmd_t *cc, rtapi_s64 v, unsigned tidx)
-{
- if(haspinclamp(&cc->typeptr[tidx])) {
- if(v > (rtapi_s64)RTAPI_INT32_MAX) return RTAPI_INT32_MAX;
- if(v < (rtapi_s64)RTAPI_INT32_MIN) return RTAPI_INT32_MIN;
- }
- return (rtapi_s32)v;
-}
-
-static inline rtapi_s32 unmap32_sf(const hm2_modbus_cmd_t *cc, double v, unsigned tidx)
-{
- if(haspinclamp(&cc->typeptr[tidx])) {
- if(v > (double)RTAPI_INT32_MAX) return RTAPI_INT32_MAX;
- if(v < (double)RTAPI_INT32_MIN) return RTAPI_INT32_MIN;
- }
- return (rtapi_s32)v;
-}
-
static inline rtapi_u64 unmap64_us(const hm2_modbus_cmd_t *cc, rtapi_s64 v, unsigned tidx)
{
if(haspinclamp(&cc->typeptr[tidx]) && v < 0)
@@ -1973,27 +1877,6 @@ static int parse_data_frame(hm2_modbus_inst_t *inst)
case HAL_BOOL:
hal_set_bool(hal->pins[p].pin.b, 0 != val64.u); // Zero maps to false, anything else to true
break;
- case HAL_U32:
- switch(mtypetype(cc->typeptr[i].mtype)) {
- case MBT_U: hal_set_ui32(hal->pins[p].pin.u, unmap32_uu(cc, val64.u, i)); break;
- case MBT_S: hal_set_ui32(hal->pins[p].pin.u, unmap32_us(cc, val64.s, i)); break;
- case MBT_F: hal_set_ui32(hal->pins[p].pin.u, unmap32_uf(cc, val64.f, i)); break;
- }
- break;
- case HAL_S32:
- switch(mtypetype(cc->typeptr[i].mtype)) {
- case MBT_U: hal_set_si32(hal->pins[p].pin.s, unmap32_su(cc, val64.u, i)); break;
- case MBT_S: hal_set_si32(hal->pins[p].pin.s, unmap32_ss(cc, val64.s, i)); break;
- case MBT_F: hal_set_si32(hal->pins[p].pin.s, unmap32_sf(cc, val64.f, i)); break;
- }
- if(haspinscale(&cc->typeptr[i])) {
- switch(mtypetype(cc->typeptr[i].mtype)) {
- case MBT_U: hal_set_real(hal->pins[p].scaled, (rtapi_real)(rtapi_s64)(val64.u - hal_get_uint(hal->pins[p].offset.u)) * hal_get_real(hal->pins[p].scale)); break;
- case MBT_S: hal_set_real(hal->pins[p].scaled, (rtapi_real)(val64.s - hal_get_sint(hal->pins[p].offset.s)) * hal_get_real(hal->pins[p].scale)); break;
- case MBT_F: hal_set_real(hal->pins[p].scaled, (val64.f - hal_get_real(hal->pins[p].offset.r)) * hal_get_real(hal->pins[p].scale)); break;
- }
- }
- break;
case HAL_UINT:
switch(mtypetype(cc->typeptr[i].mtype)) {
case MBT_U: hal_set_uint(hal->pins[p].pin.u, val64.u); break;
@@ -2260,8 +2143,6 @@ static int check_htype(unsigned type)
{
switch(type) {
case HAL_BOOL: // not valid in register read/write
- case HAL_U32:
- case HAL_S32:
case HAL_UINT:
case HAL_SINT:
case HAL_REAL:
@@ -2289,13 +2170,13 @@ static int load_mbccb(hm2_modbus_inst_t *inst, const char *fname)
}
// Done reading, now test format
- static const rtapi_u8 signature[8] = {'M','e','s','a','M','B','0','1'};
+ static const rtapi_u8 signature[8] = {'M','e','s','a','M','B','0','2'};
if(memcmp(signature, mbccb->sig, sizeof(signature))) {
char buf[sizeof(mbccb->sig)+1];
for(unsigned i = 0; i < sizeof(mbccb->sig); i++)
buf[i] = isprint(mbccb->sig[i]) ? mbccb->sig[i] : '?';
buf[sizeof(mbccb->sig)] = 0;
- MSG_ERR("%s: error: Invalid signature in mbccb file: '%s' (expected 'MesaMB01')\n", inst->name, buf);
+ MSG_ERR("%s: error: Invalid signature in mbccb file: '%s' (expected 'MesaMB02')\n", inst->name, buf);
MSG_ERR("%s: error: Have you compiled the mbccs source into a binary mbccb file using mesambccc?\n", inst->name);
goto errout;
}
@@ -2997,46 +2878,11 @@ int rtapi_app_main(void)
0, "%s.%s", inst->name, CPTR(dptr)));
break;
- case HAL_U32:
- CHECK(hal_pin_new_ui32(comp_id, dir, &(inst->hal->pins[p++].pin.u),
- 0, "%s.%s", inst->name, CPTR(dptr)));
- break;
-
case HAL_UINT:
CHECK(hal_pin_new_uint(comp_id, dir, &(inst->hal->pins[p++].pin.u),
0, "%s.%s", inst->name, CPTR(dptr)));
break;
- case HAL_S32:
- CHECK(hal_pin_new_si32(comp_id, dir, &(inst->hal->pins[p].pin.s),
- 0, "%s.%s", inst->name, CPTR(dptr)));
- if(haspinscale(&cc->typeptr[j])) {
- CHECK(hal_pin_new_real(comp_id, HAL_IN, &(inst->hal->pins[p].scale),
- 1.0, "%s.%s.scale", inst->name, CPTR(dptr)));
- if(HAL_OUT == dir) {
- CHECK(hal_pin_new_real(comp_id, HAL_OUT, &(inst->hal->pins[p].scaled),
- 0.0, "%s.%s.scaled", inst->name, CPTR(dptr)));
- switch(mtypetype(cc->typeptr[j].mtype)) {
- case MBT_U:
- CHECK(hal_pin_new_uint(comp_id, HAL_IN, &(inst->hal->pins[p].offset.u),
- 0, "%s.%s.offset", inst->name, CPTR(dptr)));
- break;
- case MBT_S:
- CHECK(hal_pin_new_sint(comp_id, HAL_IN, &(inst->hal->pins[p].offset.s),
- 0, "%s.%s.offset", inst->name, CPTR(dptr)));
- break;
- case MBT_F:
- CHECK(hal_pin_new_real(comp_id, HAL_IN, &(inst->hal->pins[p].offset.r),
- 0.0, "%s.%s.offset", inst->name, CPTR(dptr)));
- break;
- }
- } else {
- CHECK(hal_pin_new_si32(comp_id, HAL_IN, &(inst->hal->pins[p].offset.s),
- 0, "%s.%s.offset", inst->name, CPTR(dptr)));
- }
- }
- p++;
- break;
case HAL_SINT:
CHECK(hal_pin_new_sint(comp_id, dir, &(inst->hal->pins[p].pin.s),
0, "%s.%s", inst->name, CPTR(dptr)));
diff --git a/src/hal/drivers/mesa-hostmot2/mesambccc.py b/src/hal/drivers/mesa-hostmot2/mesambccc.py
index e03dfbca16f..c029419791c 100644
--- a/src/hal/drivers/mesa-hostmot2/mesambccc.py
+++ b/src/hal/drivers/mesa-hostmot2/mesambccc.py
@@ -57,6 +57,7 @@
import xml.parsers.expat as XP
import re
import struct
+import hal
# HAL names are a bit picky
# The following allows, for example, device names "xyz" but also "xyz.0" and
@@ -132,13 +133,10 @@
'timeout' : [10000, 10000000] } # 10 milliseconds to 10 seconds (can override in )
# XXX: Keep in sync with hal.h
-HAL_BIT = 1
-HAL_FLT = 2 # HAL_FLOAT
-HAL_S32 = 3
-HAL_U32 = 4
-HAL_PRT = 5 # HAL_PORT, unused
-HAL_S64 = 6
-HAL_U64 = 7
+HAL_BIT = hal.Type.BOOL
+HAL_FLT = hal.Type.REAL
+HAL_S64 = hal.Type.SINT
+HAL_U64 = hal.Type.UINT
# XXX: Keep in sync with hm2_modbus.c
MBT_AB = 0x00
@@ -199,18 +197,23 @@ def mbtType(mtype):
F_DCBA = MBT_F | MBT_DCBA
# Possible values of the 'haltype' attribute
-HALTYPES = { 'HAL_BIT': HAL_BIT, 'HAL_FLOAT': HAL_FLT, 'HAL_FLT': HAL_FLT,
- 'HAL_S32': HAL_S32, 'HAL_U32': HAL_U32,
+HALTYPES = { 'HAL_BOOL':HAL_BIT, 'HAL_REAL': HAL_FLT,
+ 'HAL_SINT':HAL_S64, 'HAL_UINT': HAL_U64,
+ 'HAL_BIT': HAL_BIT, 'HAL_FLOAT': HAL_FLT, 'HAL_FLT': HAL_FLT,
+ 'HAL_S32': HAL_S64, 'HAL_U32': HAL_U64,
'HAL_S64': HAL_S64, 'HAL_U64': HAL_U64,
# Be nice, allow types without useless prefix
+ 'BOOL': HAL_BIT, 'REAL': HAL_FLT,
+ 'SINT': HAL_S64, 'UINT': HAL_U64,
'BIT': HAL_BIT, 'FLOAT': HAL_FLT, 'FLT': HAL_FLT,
- 'S32': HAL_S32, 'U32': HAL_U32,
+ 'S32': HAL_S64, 'U32': HAL_U64,
'S64': HAL_S64, 'U64': HAL_U64 }
+HALTYPES32 = ['HAL_S32', 'HAL_U32', 'S32', 'U32']
+
# Reverse map of HALTYPES
-HALNAMES = { HAL_BIT: 'HAL_BIT', HAL_FLT: 'HAL_FLOAT',
- HAL_S32: 'HAL_S32', HAL_U32: 'HAL_U32',
- HAL_S64: 'HAL_S64', HAL_U64: 'HAL_U64' }
+HALNAMES = { HAL_BIT: 'HAL_BOOL', HAL_FLT: 'HAL_REAL',
+ HAL_S64: 'HAL_SINT', HAL_U64: 'HAL_UINT' }
# Possible values of the 'modbustype' attribute
# [typeId, maxCount, nWords]
@@ -288,7 +291,7 @@ def mbtType(mtype):
WRITEFUNCTIONS = [ W_COIL, W_REGISTER, W_COILS, W_REGISTERS ]
-# These functions always use HAL_BIT
+# These functions always use HAL_BOOL
# Also, the function is a register function if /not/ in this set
BITFUNCTIONS = [R_COILS, R_INPUTS, W_COIL, W_COILS]
REGFUNCTIONS = [R_REGISTERS, R_INPUTREGS, W_REGISTER, W_REGISTERS]
@@ -1076,6 +1079,8 @@ def getHalType(tag, ers):
if ht not in HALTYPES:
perr("Invalid haltype '{}' in {}".format(tag.attrib['haltype'], ers))
return None
+ if ht in HALTYPES32:
+ pwarn(f"32-bit haltype '{ht}' will still create 64-bit pins, please update your mbccs file.")
return HALTYPES[ht];
#
@@ -1154,11 +1159,11 @@ def handleCommands(commands):
count = 0
if function in BITFUNCTIONS:
- # Coils and inputs are binary and always map to HAL_BIT
+ # Coils and inputs are binary and always map to HAL_BOOL
if 'modbustype' in cmd.attrib:
pwarn("Attribute 'modbustype' ignored for bit functions in {}".format(lcl))
if 'haltype' in cmd.attrib:
- pwarn("Attribute 'haltype' ignored for bit functions (always HAL_BIT) in {}".format(lcl))
+ pwarn("Attribute 'haltype' ignored for bit functions (always HAL_BOOL) in {}".format(lcl))
defmtype = [-1, 2000, 1] # fake mtype
defhtype = HAL_BIT
else:
@@ -1184,20 +1189,16 @@ def handleCommands(commands):
if 0 != pflags & ~MBCCB_PINF_MASK:
pwarn("Additional pin flags '0x{:04x}' (allowed=0x{:04x}) in {}".format(pflags, MBCCB_PINF_MASK, lcl))
- if (pflags & MBCCB_PINF_SCALE) and defhtype in [HAL_U32, HAL_U64]:
+ if (pflags & MBCCB_PINF_SCALE) and defhtype in [HAL_U64]:
pwarn("Unsigned hal types cannot be scaled, disabling in {}".format(lcl))
pflags &= ~MBCCB_PINF_SCALE & 0xffff
if None != defmtype and ((0 == (pflags & MBCCB_PINF_SCALE)) and
- ((MBT_S == mbtType(defmtype[0]) and defhtype in [HAL_U32, HAL_U64])
- or (MBT_U == mbtType(defmtype[0]) and defhtype in [HAL_S32, HAL_S64]))):
+ ((MBT_S == mbtType(defmtype[0]) and defhtype in [HAL_U64])
+ or (MBT_U == mbtType(defmtype[0]) and defhtype in [HAL_S64]))):
pwarn("Signedness mismatch between haltype={} and modbustype={} may give wrong results in {}"
.format(HALNAMES[defhtype], MBNAMES[defmtype[0]], lcl))
- if None != defmtype and mbtOrderSize(defmtype[0]) == 8 and defhtype in [HAL_U32, HAL_S32]:
- pwarn("Haltype destination '{}' is smaller than Modbus source type {} in {}"
- .format(HALNAMES[defhtype], MBNAMES[defmtype[0]], lcl))
-
if (cflags & MBCCB_CMDF_RESEND) and interval == 0xffffffff:
perr("Interval 'once' and 'resend' are mutually exclusive in {}".format(lcl))
continue
@@ -1302,24 +1303,21 @@ def handleCommands(commands):
assert phtype != None
# W_REGISTER(S), R_REGISTERS and R_INPUTREGS can have special
if HAL_BIT == phtype and MBT_U != mbtType(pmtype):
- perr("Haltype HAL_BIT with register function must use unsigned modbustype in {}".format(lpl))
+ perr("Haltype HAL_BOOL with register function must use unsigned modbustype in {}".format(lpl))
err = True
break
# scale and clamp flags
cf, pf = parseOptFlags(device, pin.attrib, 0, pflags, lpl)
- if (pf & MBCCB_PINF_SCALE) and phtype in [HAL_U32, HAL_U64]:
+ if (pf & MBCCB_PINF_SCALE) and phtype in [HAL_U64]:
pwarn("Unsigned hal types cannot be scaled, disabling in {}".format(lpl))
pf &= ~MBCCB_PINF_SCALE
msz = mbtOrderSize(pmtype[0])
- hsz = 4 if phtype in [HAL_U32, HAL_S32] else 8
+ hsz = 8
if ((0 == (pf & MBCCB_PINF_SCALE)) and msz >= hsz and
- ((MBT_S == mbtType(pmtype[0]) and phtype in [HAL_U32, HAL_U64])
- or (MBT_U == mbtType(pmtype[0]) and phtype in [HAL_S32, HAL_S64]))):
+ ((MBT_S == mbtType(pmtype[0]) and phtype in [HAL_U64])
+ or (MBT_U == mbtType(pmtype[0]) and phtype in [HAL_S64]))):
pwarn("Signedness mismatch between haltype={} and modbustype={} may give wrong results in {}"
.format(HALNAMES[phtype], MBNAMES[pmtype[0]], lpl))
- if (mbtOrderSize(pmtype[0])) == 8 and phtype in [HAL_U32, HAL_S32]:
- pwarn("Haltype destination '{}' is smaller than Modbus source type {} in {}"
- .format(HALNAMES[phtype], MBNAMES[pmtype[0]], lpl))
if ((mbtOrderSize(pmtype[0]) == 4 and 0 != ((address + regofs) & 1))
or (mbtOrderSize(pmtype[0]) == 8 and 0 != ((address + regofs) & 3))):
@@ -1405,7 +1403,7 @@ def handleCommands(commands):
for p in range(len(pinlist)):
pin = pinlist[p]
if HAL_BIT == pin['htype']:
- mbn = 'HAL_BIT<=>BIT'
+ mbn = 'HAL_BOOL<=>BIT'
else:
mbn = '{}<=>{}'.format(HALNAMES[pin['htype']], MBNAMES[pin['mtype']])
print(" pin {:2} ({}): {:24} {} flags={} addr=0x{:04x}".format(p+1, io, pin['pin'],
@@ -1414,11 +1412,11 @@ def handleCommands(commands):
if function in WRITEFUNCTIONS:
pt = HALNAMES[pin['htype']]
else:
- pt = {MBT_U: "HAL_U64", MBT_S: "HAL_S64", MBT_F: "HAL_FLOAT"}[mbtType(pin['mtype'])]
+ pt = {MBT_U: "HAL_UINT", MBT_S: "HAL_SINT", MBT_F: "HAL_REAL"}[mbtType(pin['mtype'])]
print(" (in ): {:24} {}".format(pin['pin']+".offset", pt))
- print(" (in ): {:24} HAL_FLOAT".format(pin['pin']+".scale"))
+ print(" (in ): {:24} HAL_REAL".format(pin['pin']+".scale"))
if function not in WRITEFUNCTIONS:
- print(" (out): {:24} HAL_FLOAT".format(pin['pin']+".scaled"))
+ print(" (out): {:24} HAL_REAL".format(pin['pin']+".scaled"))
# end for cmd in commands:
return cmdlist
@@ -1685,7 +1683,7 @@ def main():
typeptr, i['interval'], i['timeout'], pinptr))
# typedef struct {
- # rtapi_u8 sig[8]; // Signature and version {'M','e','s','a','M','B','0','1'}
+ # rtapi_u8 sig[8]; // Signature and version {'M','e','s','a','M','B','0','2'}
# rtapi_u32 baudrate;
# rtapi_u16 format; // Parity and stopbits
# rtapi_u16 txdelay; // Tx t3.5
@@ -1704,7 +1702,7 @@ def main():
flg |= MBCCB_FORMAT_DUPLEX if configparams['duplex'] else 0
flg |= MBCCB_FORMAT_SUSPEND if configparams['suspend'] else 0
header = (struct.pack(">8sIHHHHHHIIIIIIIIII",
- b'MesaMB01',
+ b'MesaMB02',
configparams['baudrate'],
par[configparams['parity']] | flg,
configparams['txdelay'],
diff --git a/src/hal/drivers/mesa-hostmot2/modbus/analogue.mod b/src/hal/drivers/mesa-hostmot2/modbus/analogue.mod
index f2e3b899c98..3d4780cb986 100644
--- a/src/hal/drivers/mesa-hostmot2/modbus/analogue.mod
+++ b/src/hal/drivers/mesa-hostmot2/modbus/analogue.mod
@@ -6,7 +6,7 @@ The format of the channel descriptors is:
{TYPE, FUNC, ADDR, COUNT, pin_name}
-TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32, ENCODER
+TYPE is one of HAL_BOOL, HAL_REAL, HAL_S32, HAL_U32, ENCODER
FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands
COUNT = number of coils/registers to read
*/
@@ -15,7 +15,7 @@ COUNT = number of coils/registers to read
static const hm2_modbus_chan_descriptor_t channels[] = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
- {HAL_FLOAT, 3, 0x0000, 1, "volts"},
+ {HAL_REAL, 3, 0x0000, 1, "volts"},
};
/* Optionally #define DEBUG to aid with troubleshooting.
diff --git a/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c.tmpl b/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c.tmpl
index 05b2b3dad34..af9fd2258fb 100644
--- a/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c.tmpl
+++ b/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c.tmpl
@@ -324,7 +324,7 @@ int rtapi_app_main(void){
case 4: // read input registers
for (j = 0; j < ch->count; j++){
switch (ch->type){
- case HAL_U32:
+ case HAL_UINT:
if (ch->count > 1) {
retval = hal_pin_new_ui32(comp_id, dir,
&(inst->hal->pins[p].u),
@@ -338,7 +338,7 @@ int rtapi_app_main(void){
}
p++;
break;
- case HAL_S32:
+ case HAL_SINT:
if (ch->count > 1) {
retval = hal_pin_new_si32(comp_id, dir,
&(inst->hal->pins[p].s),
@@ -369,7 +369,7 @@ int rtapi_app_main(void){
inst->hal->buff[p] = 0;
p++;
break;
- case HAL_FLOAT:
+ case HAL_REAL:
if (ch->count > 1) {
retval = hal_pin_new_real(comp_id, dir,
&(inst->hal->pins[p].r),
@@ -681,13 +681,13 @@ static int build_data_frame(hm2_modbus_inst_t *inst){
case 6: //Write single register
r += ch_append16(ch, ch->addr);
switch (ch->type){
- case HAL_U32:
+ case HAL_UINT:
r += ch_append16(ch, (rtapi_u16)hal_get_ui32(hal->pins[p].u));
break;
- case HAL_S32:
+ case HAL_SINT:
r += ch_append16(ch, (rtapi_s16)hal_get_si32(hal->pins[p].s));
break;
- case HAL_FLOAT:
+ case HAL_REAL:
rtapi_print_msg(RTAPI_MSG_INFO, "671 %f %f %f \n", hal_get_real(hal->pins[p].r), hal_get_real(hal->pin2[p].r), hal_get_real(hal->scale[p]));
if (hal_get_real(hal->scale[p]) <= -EPSILON || hal_get_real(hal->scale[p]) >= +EPSILON){
r+= ch_append16(ch, (rtapi_u16)((hal_get_real(hal->pins[p].r) - hal_get_real(hal->pin2[p].r)) / hal_get_real(hal->scale[p]))) ;
@@ -716,13 +716,13 @@ static int build_data_frame(hm2_modbus_inst_t *inst){
r += ch_append8(ch, ch->count * 2);
for (i = 0; i < ch->count; i++){
switch (ch->type){
- case HAL_U32:
+ case HAL_UINT:
r += ch_append16(ch, (rtapi_u16)hal_get_ui32(hal->pins[p].u));
break;
- case HAL_S32:
+ case HAL_SINT:
r += ch_append16(ch, (rtapi_s16)hal_get_si32(hal->pins[p].s));
break;
- case HAL_FLOAT:
+ case HAL_REAL:
if (hal_get_real(hal->scale[p]) <= -EPSILON || hal_get_real(hal->scale[p]) >= +EPSILON){
r+= ch_append16(ch, (rtapi_u16)((hal_get_real(hal->pins[p].r) - hal_get_real(hal->pin2[p].r)) / hal_get_real(hal->scale[p]))) ;
} else {
@@ -793,12 +793,12 @@ static int parse_data_frame(hm2_modbus_inst_t *inst){
w = 3;
for (i = 0; i < bytes[2] / 2; i++){
switch (ch->type){
- case HAL_U32:
+ case HAL_UINT:
hal_set_ui32(hal->pins[p].u, 256 * bytes[w] + bytes[w + 1]);
w += 2;
p++;
break;
- case HAL_S32: // wrap the result into the (s32) offset too
+ case HAL_SINT: // wrap the result into the (s32) offset too
tmp = hal_get_si32(hal->pins[p].s);
hal_set_si32(hal->pins[p].s, bytes[w] * 256 + bytes[w + 1]);
w += 2;
@@ -809,7 +809,7 @@ static int parse_data_frame(hm2_modbus_inst_t *inst){
hal_set_real(hal->pin2[p].r, hal->buff[p] * hal_get_real(hal->scale[p]));
p++;
break;
- case HAL_FLOAT:
+ case HAL_REAL:
hal_set_real(hal->pins[p].r, (256 * bytes[w] + bytes[w + 1])
* hal_get_real(hal->scale[p]) + hal_get_real(hal->pin2[p].r));
w += 2;
diff --git a/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.mod.sample b/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.mod.sample
index 5530b6e2b79..bb8ee75120a 100644
--- a/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.mod.sample
+++ b/src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.mod.sample
@@ -3,7 +3,7 @@ The format of the channel descriptors is:
{TYPE, FUNC, ADDR, COUNT, pin_name}
-TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32
+TYPE is one of HAL_BOOL, HAL_REAL, HAL_SINT, HAL_UINT
FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands
COUNT = number of coils/registers to read
*/
@@ -13,21 +13,21 @@ COUNT = number of coils/registers to read
static const hm2_modbus_chan_descriptor_t channels[] = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
// Create 8 HAL bit pins coil-00 .. -07 supplying the values of coils at 0x0000
- {HAL_BIT, 1, 0x0000, 8, "coil"},
+ {HAL_BOOL, 1, 0x0000, 8, "coil"},
// Create 8 HAL bit pins input-00 .. -07 supplying the values of inputs at 0x0000
- {HAL_BIT, 2, 0x0000, 8, "input"},
+ {HAL_BOOL, 2, 0x0000, 8, "input"},
// Create a HAL pin to set the coil at address 0x0010
- {HAL_BIT, 5, 0x0010, 1, "coil-0"},
+ {HAL_BOOL, 5, 0x0010, 1, "coil-0"},
// Create 8 HAL pins to set the coils at 0x0020
- {HAL_BIT, 15, 0x0020, 8, "more_coils"},
+ {HAL_BOOL, 15, 0x0020, 8, "more_coils"},
// Create a scaled floating point pin calculated from input register 0x0100
- {HAL_FLOAT, 4, 0x0100, 1, "float"},
+ {HAL_REAL, 4, 0x0100, 1, "float"},
// Create 4 unsigned integer HAL pins from the holding registers at 0x0200-0x203
- {HAL_S32, 3, 0x0003, 4, "holding"},
+ {HAL_SINT, 3, 0x0003, 4, "holding"},
// Create a single signed int HAL pin to control the register at 0x0300
- {HAL_S32, 6, 0x0300, 1, "relay-3"},
+ {HAL_SINT, 6, 0x0300, 1, "relay-3"},
// Create 7 scaled FP HAL pins to control holfing registers at 0x400-0x406
- {HAL_FLOAT, 16, 0x0300, 1, "more_floats"},
+ {HAL_REAL, 16, 0x0300, 1, "more_floats"},
};
// vim: syn=c
diff --git a/src/hal/drivers/mesa-hostmot2/modbus/relayboard.mod b/src/hal/drivers/mesa-hostmot2/modbus/relayboard.mod
index 83d913dce94..7b4259ef1a9 100644
--- a/src/hal/drivers/mesa-hostmot2/modbus/relayboard.mod
+++ b/src/hal/drivers/mesa-hostmot2/modbus/relayboard.mod
@@ -5,7 +5,7 @@ The format of the channel descriptors is:
{TYPE, FUNC, ADDR, COUNT, pin_name}
-TYPE is one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32
+TYPE is one of HAL_BOOL, HAL_REAL, HAL_SINT, HAL_UINT
FUNC = 1, 2, 3, 4, 5, 6, 15, 16 - Modbus commands
COUNT = number of coils/registers to read
*/
@@ -14,12 +14,12 @@ COUNT = number of coils/registers to read
static const hm2_modbus_chan_descriptor_t channels[] = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
- {HAL_BIT, 1, 0x0000, 8, "state"},
- {HAL_BIT, 2, 0x0000, 8, "input"},
- {HAL_BIT, 5, 0x0000, 1, "relay-0"},
- {HAL_BIT, 5, 0x0001, 1, "relay-1"},
- {HAL_BIT, 5, 0x0002, 1, "relay-2"},
- {HAL_BIT, 5, 0x0003, 1, "relay-3"},
+ {HAL_BOOL, 1, 0x0000, 8, "state"},
+ {HAL_BOOL, 2, 0x0000, 8, "input"},
+ {HAL_BOOL, 5, 0x0000, 1, "relay-0"},
+ {HAL_BOOL, 5, 0x0001, 1, "relay-1"},
+ {HAL_BOOL, 5, 0x0002, 1, "relay-2"},
+ {HAL_BOOL, 5, 0x0003, 1, "relay-3"},
};
diff --git a/src/hal/hal.h b/src/hal/hal.h
index 02139799cdb..3d17b3b99bd 100644
--- a/src/hal/hal.h
+++ b/src/hal/hal.h
@@ -127,10 +127,44 @@
*/
+//
+// The HAL_API_VERSION define can be used to determine what features are
+// available in the HAL library API. It can be used to make code build on both
+// old and new LinuxCNC versions if you need to keep everything in one
+// source-tree.
+// Currently only two versions are possible:
+// a) No define present
+// The HAL API is for LinuxCNC up to and including version 2.9. The integer
+// pins and params are 32-bit only.
+//
+// b) HAL_API_VERSION == 1
+// The HAL API if for LinuxCNC 2.10 and later. It supports the getter,
+// setter and query API. Any access to the underlying data or HAL's private
+// inners is not allowed. HAL pins and params are opaque structures. The
+// underlying data size of integers is 64-bit.
+//
+#define HAL_API_VERSION 1
+
+//
+// HAL_STATIC_ASSERT wrapper for compile time asserts
+//
+#if __STDC_VERSION__ >= 202311L || defined(__cplusplus)
+#define HAL_STATIC_ASSERT(expr, msg) static_assert((expr), msg)
+#else
+// _Static_assert: GCC extension, in C standard since C11, deprecated
+// in favour of static_assert (like C++) from C23 onwards.
+#define HAL_STATIC_ASSERT(expr, msg) _Static_assert((expr), msg)
+#endif
+
+// Some useful defines
+#define __HAL_DEPRECATED(msg) __attribute__((deprecated(msg)))
+#define __HAL_ALWAYS_INLINE __attribute__((always_inline))
+#define __HAL_PFMT(a,b) __attribute__((format(printf,a,b)))
+
#include "rtapi.h"
RTAPI_BEGIN_DECLS
-#if ( !defined RTAPI ) && ( !defined ULAPI )
+#if !defined(RTAPI) && !defined(ULAPI)
#error HAL needs RTAPI/ULAPI, check makefile and flags
#endif
@@ -214,7 +248,7 @@ void hal_lib_exit(void);
Call only from within user space or init/cleanup code, not from
realtime code.
*/
-extern int hal_init(const char *name);
+int hal_init(const char *name);
/** 'hal_exit()' must be called before a HAL component exits, to
free resources associated with the component.
@@ -233,7 +267,7 @@ extern int hal_init(const char *name);
On success, hal_exit() returns 0, on failure it
returns a negative error code.
*/
-extern int hal_exit(int comp_id);
+int hal_exit(int comp_id);
/** hal_malloc() allocates a block of memory from the main HAL
shared memory area. It should be used by all components to
@@ -252,13 +286,13 @@ extern int hal_exit(int comp_id);
all components completely clears memory and you start
fresh.
*/
-extern void *hal_malloc(long int size);
+void *hal_malloc(long int size);
/** hal_ready() indicates that this component is ready. This allows
halcmd 'loadusr -W hal_example' to wait until the userspace
component 'hal_example' is ready before continuing.
*/
-extern int hal_ready(int comp_id);
+int hal_ready(int comp_id);
/** hal_set_unready() sets a component state to unready so
additional pins can be added. A subsequent call to
@@ -266,13 +300,13 @@ extern int hal_ready(int comp_id);
again. Kinematics modules created with halcompile use
this function to add pins to a parent component.
*/
-extern int hal_set_unready(int comp_id);
+int hal_set_unready(int comp_id);
/** hal_unready() indicates that this component is ready. This allows
halcmd 'loadusr -W hal_example' to wait until the userspace
component 'hal_example' is ready before continuing.
*/
-extern int hal_unready(int comp_id);
+int hal_unready(int comp_id);
// hal_strerror() returns a brief textual description string about the error
// identified. The argument should be the negative errno value, as returned by
@@ -282,12 +316,12 @@ const char *hal_strerror(int err);
/** hal_comp_name() returns the name of the given component, or NULL
if comp_id is not a loaded component
*/
-extern char* hal_comp_name(int comp_id);
+const char *hal_comp_name(int comp_id);
/** hal_get_realtime_type() returns the type of the running real time
*/
typedef rtapi_realtime_type_t hal_realtime_type_t;
-extern hal_realtime_type_t hal_get_realtime_type(void);
+hal_realtime_type_t hal_get_realtime_type(void);
/** The HAL maintains lists of variables, functions, and so on in
a central database, located in shared memory so all components
@@ -327,20 +361,20 @@ extern hal_realtime_type_t hal_get_realtime_type(void);
typedef enum {
HAL_TYPE_UNSPECIFIED = -1,
HAL_TYPE_UNINITIALIZED = 0,
- HAL_BIT = 1,
- HAL_FLOAT = 2,
- HAL_S32 = 3,
- HAL_U32 = 4,
+ HAL_BOOL = 1,
+ HAL_REAL = 2,
+ HAL_SINT = 3,
+ HAL_UINT = 4,
HAL_PORT = 5,
- HAL_S64 = 6,
- HAL_U64 = 7,
HAL_TYPE_MAX,
-} hal_type_t;
-#define HAL_BOOL HAL_BIT
-#define HAL_REAL HAL_FLOAT
-#define HAL_SINT HAL_S64
-#define HAL_UINT HAL_U64
+ HAL_S32 __HAL_DEPRECATED("No longer supported. Please migrate to HAL_SINT") = HAL_SINT,
+ HAL_U32 __HAL_DEPRECATED("No longer supported. Please migrate to HAL_UINT") = HAL_UINT,
+ HAL_S64 __HAL_DEPRECATED("Please rename to HAL_SINT") = HAL_SINT,
+ HAL_U64 __HAL_DEPRECATED("Please rename to HAL_UINT") = HAL_UINT,
+ HAL_FLOAT __HAL_DEPRECATED("Please rename to HAL_REAL") = HAL_REAL,
+ HAL_BIT __HAL_DEPRECATED("Please rename to HAL_BOOL") = HAL_BOOL,
+} hal_type_t;
//
// hal_pdir_t - Unified HAL pin/param direction type. Specifies the direction
@@ -370,11 +404,8 @@ typedef enum {
// Map both old direction types to the new combined type
// FIXME: These should be retired at some point
-typedef hal_pdir_t hal_pin_dir_t;
-typedef hal_pdir_t hal_param_dir_t;
-
-#define __HAL_DEPRECATED(msg) __attribute__((deprecated(msg)))
-#define __HAL_ALWAYS_INLINE __attribute__((always_inline))
+typedef hal_pdir_t hal_pin_dir_t __HAL_DEPRECATED("Please use hal_pdir_t");
+typedef hal_pdir_t hal_param_dir_t __HAL_DEPRECATED("Please use hal_pdir_t");
//
// bool hal_pdir_is_pin(hal_pdir_t)
@@ -396,37 +427,6 @@ static inline __HAL_ALWAYS_INLINE bool hal_pdir_is_neither(hal_pdir_t v) {
return (0 != (v & ~(HAL_IO|HAL_RW))) || (0 == (v & (HAL_IO|HAL_RW)));
}
-// FIXME: These alignment attributes should be removed.
-// HAL now allocates on an 8-byte boundary and the rest should be left to the
-// compiler.
-// ==> Remove when we get rid of old hal_*_t typedefs. <==
-typedef rtapi_real real_t;
-typedef rtapi_u64 ireal_t __attribute__((aligned(8))) __attribute__((deprecated)); // integral type as wide as real_t / hal_float_t
-
-typedef volatile bool hal_bit_t __HAL_DEPRECATED("Use getter/setter API");
-typedef volatile rtapi_u32 hal_u32_t __HAL_DEPRECATED("Use getter/setter API");
-typedef volatile rtapi_s32 hal_s32_t __HAL_DEPRECATED("Use getter/setter API");
-typedef volatile rtapi_u64 hal_u64_t __HAL_DEPRECATED("Use getter/setter API");
-typedef volatile rtapi_s64 hal_s64_t __HAL_DEPRECATED("Use getter/setter API");
-typedef volatile rtapi_real hal_float_t __HAL_DEPRECATED("Use getter/setter API");
-typedef volatile int hal_port_t;
-
-/** HAL "data union" structure
- ** This structure may hold any type of hal data
-*/
-typedef union {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- hal_bit_t b;
- hal_s32_t s;
- hal_u32_t u;
- hal_float_t f;
- hal_port_t p;
- hal_s64_t ls;
- hal_u64_t lu;
-#pragma GCC diagnostic pop
-} hal_data_u __HAL_DEPRECATED("Use getter/setter API");
-
// Fake forward declarations so we can make opaque pointers
struct __hal_stype_bool_t;
struct __hal_stype_sint_t;
@@ -438,14 +438,14 @@ typedef struct __hal_stype_bool_t *hal_bool_t;
typedef struct __hal_stype_sint_t *hal_sint_t;
typedef struct __hal_stype_uint_t *hal_uint_t;
typedef struct __hal_stype_real_t *hal_real_t;
-//typedef struct __hal_stype_port_t *hal_port_t;
+typedef struct __hal_stype_port_t *hal_port_t;
typedef union {
hal_bool_t b;
hal_sint_t s;
hal_uint_t u;
hal_real_t r;
- //hal_port_t p;
+ hal_port_t p;
} hal_refs_u;
// We rely on little-endian memory layout in the union where the smaller
@@ -461,35 +461,29 @@ typedef union {
// This is a define so we don't export it to other code.
// It is undef'ed after we're done with it.
-// FIXME: Get rid of the 32-bit types when we have upgraded everything using
-// getter/setter access only so we have guaranteed content.
#define __HAL_MAPPED_TYPE union __hal_mapped_type { \
volatile rtapi_bool _b; \
- volatile rtapi_s32 _ss; \
- volatile rtapi_u32 _su; \
volatile rtapi_sint _s; \
volatile rtapi_uint _u; \
volatile rtapi_real _r; \
+ volatile rtapi_port _p; \
}
-#if 0
-// The port change must be done later
-// A 'hal_port_t' is a pin/param reference which content represents
+// A 'hal_port_t' is a pin reference which content represents
// the integer offset in the HAL shared memory segment to a
// hal_port_shm_t structure.
-static inline __HAL_ALWAYS_INLINE rtapi_sint hal_get_port(hal_port_t ref) {
+static inline __HAL_ALWAYS_INLINE rtapi_port hal_get_port(hal_port_t ref) {
__HAL_MAPPED_TYPE;
// cppcheck-suppress dangerousTypeCast
- return ((union __hal_mapped_type *)ref)->_s;
+ return ((union __hal_mapped_type *)ref)->_p;
}
-static inline __HAL_ALWAYS_INLINE rtapi_sint hal_set_port(hal_port_t ref, rtapi_sint val) {
+static inline __HAL_ALWAYS_INLINE rtapi_port hal_set_port(hal_port_t ref, rtapi_port val) {
__HAL_MAPPED_TYPE;
// cppcheck-suppress dangerousTypeCast
- ((union __hal_mapped_type *)ref)->_s = val; // Store in the larger type
+ ((union __hal_mapped_type *)ref)->_p = val;
return val;
}
-#endif
//
// The hal_{get,set}_si32() and hal_{get,set}_ui32() are only present for
// compatibility. They may be removed when all the remaining code has been
@@ -511,7 +505,7 @@ static inline __HAL_ALWAYS_INLINE rtapi_s32 hal_get_si32(const hal_sint_t ref) {
__HAL_MAPPED_TYPE;
// Implicitly Truncated from the larger type
// cppcheck-suppress dangerousTypeCast
- return ((union __hal_mapped_type *)ref)->_ss;
+ return (rtapi_s32)((union __hal_mapped_type *)ref)->_s;
}
static inline __HAL_ALWAYS_INLINE rtapi_s32 hal_set_si32(hal_sint_t ref, rtapi_s32 val) {
__HAL_MAPPED_TYPE;
@@ -531,7 +525,7 @@ static inline __HAL_ALWAYS_INLINE rtapi_u32 hal_get_ui32(const hal_uint_t ref) {
__HAL_MAPPED_TYPE;
// Implicitly Truncated from the larger type
// cppcheck-suppress dangerousTypeCast
- return ((union __hal_mapped_type *)ref)->_su;
+ return (rtapi_u32)((union __hal_mapped_type *)ref)->_u;
}
static inline __HAL_ALWAYS_INLINE rtapi_u32 hal_set_ui32(hal_uint_t ref, rtapi_u32 val) {
__HAL_MAPPED_TYPE;
@@ -586,31 +580,8 @@ static inline __HAL_ALWAYS_INLINE rtapi_bool hal_set_bool(hal_bool_t ref, rtapi_
((union __hal_mapped_type *)ref)->_u = val;
return val;
}
-#undef __HAL_ALWAYS_INLINE
#undef __HAL_MAPPED_TYPE
-#define __HAL_PFMT(a,b) __attribute__((format(printf,a,b)))
-int hal_pin_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_pin_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_pin_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_pin_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_pin_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_pin_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real def, const char *fmt, ...) __HAL_PFMT(5,6);
-// Note: port has no initial default as it is an 'internal' reference
-//int hal_pin_new_port(int compid, hal_pin_dir_t dir, hal_port_t *ref, const char *fmt, ...) __HAL_PFMT(4,5);
-// FIXME: This needs to change into hal_port_t argument when we break the API
-// It is here so we may add halmodule without too much trouble until then.
-int hal_pin_new_port(int compid, hal_pin_dir_t dir, hal_sint_t *ref, const char *fmt, ...) __HAL_PFMT(4,5);
-
-int hal_param_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_param_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_param_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_param_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_param_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_param_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real def, const char *fmt, ...) __HAL_PFMT(5,6);
-int hal_param_new_fake(int compid, hal_refs_u *refs);
-#undef __HAL_PFMT
-
/***********************************************************************
* "LOCKING" FUNCTIONS *
************************************************************************/
@@ -620,7 +591,7 @@ int hal_param_new_fake(int compid, hal_refs_u *refs);
HAL_LOCK_* - intermediate locking levels
HAL_LOCK_ALL - locks everything
*/
-extern int hal_set_lock(unsigned char lock_type);
+int hal_set_lock(unsigned char lock_type);
/** The 'hal_get_lock()' function returns the current locking level
locking types defined in hal.h
@@ -629,105 +600,51 @@ extern int hal_set_lock(unsigned char lock_type);
HAL_LOCK_ALL - locks everything
*/
-extern unsigned char hal_get_lock(void);
+unsigned char hal_get_lock(void);
/***********************************************************************
* "PIN" FUNCTIONS *
************************************************************************/
-/** The 'hal_pin_xxx_new()' functions create a new 'pin' object.
- Once a pin has been created, it can be linked to a signal object
- using hal_link(). A pin contains a pointer, and the component
- that owns the pin can dereference the pointer to access whatever
- signal is linked to the pin. (If no signal is linked, it points
- to a dummy signal.)
- There are eight functions, one for each of the data types that
- the HAL supports. Pins may only be linked to signals of the same
- type.
- 'name' is the name of the new pin. It must be no longer than HAL_NAME_LEN.
- If there is already a pin with the same name the call will fail.
- 'dir' is the pin direction. It indicates whether the pin is
- an input or output from the component.
- 'data_ptr_addr' is the address of the pointer that the component
- will use for the pin. When the pin is linked to a signal, the
- pointer at 'data_ptr_addr' will be changed to point to the signal
- data location. 'data_ptr_addr' must point to memory allocated by
- hal_malloc(). Typically the component allocates space for a data
- structure with hal_malloc(), and 'data_ptr_addr' is the address
- of a member of that structure.
- 'comp_id' is the ID of the component that will 'own' the
- variable. Normally it should be the ID of the caller, but in
- some cases, a user mode component may be doing setup for a
- realtime component, so the ID should be that of the realtime
- component that will actually be using the pin.
- If successful, the hal_pin_xxx_new() functions return 0.
- On failure they return a negative error code.
-*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-extern int hal_pin_bit_new(const char *name, hal_pin_dir_t dir,
- hal_bit_t ** data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_bool()");
-extern int hal_pin_float_new(const char *name, hal_pin_dir_t dir,
- hal_float_t ** data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_real()");
-extern int hal_pin_u32_new(const char *name, hal_pin_dir_t dir,
- hal_u32_t ** data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_ui32()");
-extern int hal_pin_s32_new(const char *name, hal_pin_dir_t dir,
- hal_s32_t ** data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_si32()");
-extern int hal_pin_u64_new(const char *name, hal_pin_dir_t dir,
- hal_u64_t ** data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_uint()");
-extern int hal_pin_s64_new(const char *name, hal_pin_dir_t dir,
- hal_s64_t ** data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_sint()");
-extern int hal_pin_port_new(const char *name, hal_pin_dir_t dir,
- hal_port_t ** data_ptr_addr, int comp_id);
-
-
-/** The hal_pin_XXX_newf family of functions are similar to
- hal_pin_XXX_new except that they also do printf-style formatting to compute
- the pin name
- If successful, the hal_pin_xxx_newf() functions return 0.
- On failure they return a negative error code.
-*/
-extern int hal_pin_bit_newf(hal_pin_dir_t dir,
- hal_bit_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_pin_new_bool()");
-extern int hal_pin_float_newf(hal_pin_dir_t dir,
- hal_float_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_pin_new_real()");
-extern int hal_pin_u32_newf(hal_pin_dir_t dir,
- hal_u32_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_pin_new_ui32()");
-extern int hal_pin_s32_newf(hal_pin_dir_t dir,
- hal_s32_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_pin_new_si32()");
-extern int hal_pin_u64_newf(hal_pin_dir_t dir,
- hal_u64_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_pin_new_uint()");
-extern int hal_pin_s64_newf(hal_pin_dir_t dir,
- hal_s64_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_pin_new_sint()");
-extern int hal_pin_port_newf(hal_pin_dir_t dir,
- hal_port_t** data_ptr_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5)));
-#pragma GCC diagnostic pop
-
-
-/** 'hal_pin_new()' creates a new 'pin' object. It is a generic
- version of the eight functions above. It is provided ONLY for
- those special cases where a generic function is needed. It is
- STRONGLY recommended that the functions above be used instead,
- because they check the type of 'data_ptr_addr' against the pin
- type at compile time. Using this function requires a cast of
- the 'data_ptr_addr' argument that defeats type checking and can
- cause subtle bugs.
- 'name', 'dir', 'data_ptr_addr' and 'comp_id' are the same as in
- the functions above.
- 'type' is the hal type of the new pin - the type of data that
- will be passed in/out of the component through the new pin.
- If successful, hal_pin_new() returns 0. On failure
- it returns a negative error code.
-*/
-extern int hal_pin_new(const char *name, hal_type_t type, hal_pin_dir_t dir,
- void **data_ptr_addr, int comp_id) __HAL_DEPRECATED("Use hal_pin_new_XXXX()");
+//
+// The 'hal_pin_new_xxxx()' functions create a new 'pin' object.
+//
+// Once a pin has been created, it can be linked to a signal object using
+// hal_link(). A pin contains a pointer, and the component that owns the pin
+// can dereference the pointer to access whatever signal is linked to the pin.
+// (If no signal is linked, it points to a dummy signal.)
+//
+// There are seven (five) functions, one for each of the data types that the
+// HAL supports. Pins may only be linked to signals of the same type.
+//
+// - 'comp_id' is the ID of the component that will 'own' the variable.
+// Normally it should be the ID of the caller, but in some cases, a user
+// mode component may be doing setup for a realtime component, so the ID
+// should be that of the realtime component that will actually be using the
+// pin.
+// - 'dir' is the pin direction. It indicates whether the pin is an input or
+// output from the component.
+// - 'ref' is the address of the pointer that the component will use for the
+// pin. When the pin is linked to a signal, the pointer at 'data_ptr_addr'
+// will be changed to point to the signal data location. The 'ref' must
+// point to memory allocated by hal_malloc(). Typically the component
+// allocates space for a data structure with hal_malloc(), and 'ref' is the
+// address of a member of that structure.
+// - 'def' is the default value of the pin. The unconnected pin's value (any
+// direction) will be set to the value 'def'.
+// - 'fmt' is the name of the new pin. It must be no longer than HAL_NAME_LEN.
+// If there is already a pin with the same name the call will fail.
+//
+// If successful, the hal_pin_xxx_new() functions return zero (0). On failure
+// they return a negative error code.
+//
+int hal_pin_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_pin_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_pin_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_pin_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_pin_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_pin_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_pin_new_port(int compid, hal_pdir_t dir, hal_port_t *ref, const char *fmt, ...) __HAL_PFMT(4,5);
/** There is no 'hal_pin_delete()' function. Once a component has
created a pin, that pin remains as long as the component exists.
@@ -740,7 +657,7 @@ extern int hal_pin_new(const char *name, hal_type_t type, hal_pin_dir_t dir,
original name or the alias. Calling this function with 'alias'
set to NULL will remove any existing alias.
*/
-extern int hal_pin_alias(const char *pin_name, const char *alias);
+int hal_pin_alias(const char *pin_name, const char *alias);
/***********************************************************************
@@ -764,7 +681,7 @@ extern int hal_pin_alias(const char *pin_name, const char *alias);
If successful, 'hal_signal_new() returns 0. On failure
it returns a negative error code.
*/
-extern int hal_signal_new(const char *name, hal_type_t type);
+int hal_signal_new(const char *name, hal_type_t type);
/** 'hal_signal_delete()' deletes a signal object. Any pins linked to
the object are unlinked.
@@ -772,7 +689,7 @@ extern int hal_signal_new(const char *name, hal_type_t type);
If successful, 'hal_signal_delete()' returns 0. On
failure, it returns a negative error code.
*/
-extern int hal_signal_delete(const char *name);
+int hal_signal_delete(const char *name);
/** 'hal_link()' links a pin to a signal. 'pin_name' and 'sig_name' are
strings containing the pin and signal names. If the pin is already
@@ -785,109 +702,61 @@ extern int hal_signal_delete(const char *name);
On success, hal_link() returns 0, on failure it returns a
negative error code.
*/
-extern int hal_link(const char *pin_name, const char *sig_name);
+int hal_link(const char *pin_name, const char *sig_name);
/** 'hal_unlink()' unlinks any signal from the specified pin. 'pin_name'
is a string containing the pin name.
On success, hal_unlink() returns 0, on failure it
returns a negative error code.
*/
-extern int hal_unlink(const char *pin_name);
+int hal_unlink(const char *pin_name);
/***********************************************************************
* "PARAMETER" FUNCTIONS *
************************************************************************/
-
-/** The 'hal_param_xxx_new()' functions create a new 'parameter' object.
- A parameter is a value that is only used inside a component, but may
- need to be initialized or adjusted from outside the component to set
- up the system properly.
- Once a parameter has been created, it's value can be changed using
- the 'hal_param_xxx_set()' functions.
- There are eight functions, one for each of the data types that
- the HAL supports. Pins may only be linked to signals of the same
- type.
- 'name' is the name of the new parameter. It must be no longer than
- .HAL_NAME_LEN. If there is already a parameter with the same
- name the call will fail.
- 'dir' is the parameter direction. HAL_RO parameters are read only from
- outside, and are written to by the component itself, typically to provide a
- view "into" the component for testing or troubleshooting. HAL_RW
- parameters are writable from outside and also sometimes modified by the
- component itself as well.
- 'data_addr' is the address where the value of the parameter is to be
- stored. 'data_addr' must point to memory allocated by hal_malloc().
- Typically the component allocates space for a data structure with
- hal_malloc(), and 'data_addr' is the address of a member of that
- structure. Creating the parameter does not initialize or modify the
- value at *data_addr - the component should load a reasonable default
- value.
- 'comp_id' is the ID of the component that will 'own' the parameter.
- Normally it should be the ID of the caller, but in some cases, a
- user mode component may be doing setup for a realtime component, so
- the ID should be that of the realtime component that will actually
- be using the parameter.
- If successful, the hal_param_xxx_new() functions return 0.
- On failure they return a negative error code.
-*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-extern int hal_param_bit_new(const char *name, hal_param_dir_t dir,
- hal_bit_t * data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_bool()");
-extern int hal_param_float_new(const char *name, hal_param_dir_t dir,
- hal_float_t * data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_real()");
-extern int hal_param_u32_new(const char *name, hal_param_dir_t dir,
- hal_u32_t * data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_ui32()");
-extern int hal_param_s32_new(const char *name, hal_param_dir_t dir,
- hal_s32_t * data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_si32()");
-extern int hal_param_u64_new(const char *name, hal_param_dir_t dir,
- hal_u64_t * data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_uint()");
-extern int hal_param_s64_new(const char *name, hal_param_dir_t dir,
- hal_s64_t * data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_sint()");
-
-/** printf_style-style versions of hal_param_XXX_new */
-extern int hal_param_bit_newf(hal_param_dir_t dir,
- hal_bit_t * data_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_param_new_bool()");
-extern int hal_param_float_newf(hal_param_dir_t dir,
- hal_float_t * data_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_param_new_real()");
-extern int hal_param_u32_newf(hal_param_dir_t dir,
- hal_u32_t * data_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_param_new_ui32()");
-extern int hal_param_s32_newf(hal_param_dir_t dir,
- hal_s32_t * data_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_param_new_si32()");
-extern int hal_param_u64_newf(hal_param_dir_t dir,
- hal_u64_t * data_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_param_new_uint()");
-extern int hal_param_s64_newf(hal_param_dir_t dir,
- hal_s64_t * data_addr, int comp_id, const char *fmt, ...)
- __attribute__((format(printf,4,5))) __HAL_DEPRECATED("Use hal_param_new_sint()");
-#pragma GCC diagnostic pop
-
-
-/** 'hal_param_new()' creates a new 'parameter' object. It is a generic
- version of the eight functions above. It is provided ONLY for those
- special cases where a generic function is needed. It is STRONGLY
- recommended that the functions above be used instead, because they
- check the type of 'data_addr' against the parameter type at compile
- time. Using this function requires a cast of the 'data_addr' argument
- that defeats type checking and can cause subtle bugs.
- 'name', 'data_addr' and 'comp_id' are the same as in the
- functions above.
- 'type' is the hal type of the new parameter - the type of data
- that will be stored in the parameter.
- 'dir' is the parameter direction. HAL_RO parameters are read only from
- outside, and are written to by the component itself, typically to provide a
- view "into" the component for testing or troubleshooting. HAL_RW
- parameters are writable from outside and also sometimes modified by the
- component itself as well.
- If successful, hal_param_new() returns 0. On failure
- it returns a negative error code.
-*/
-extern int hal_param_new(const char *name, hal_type_t type, hal_param_dir_t dir,
- void *data_addr, int comp_id) __HAL_DEPRECATED("Use hal_param_new_XXXX()");
+//
+// The 'hal_param_xxx_new()' functions create a new 'parameter' object.
+//
+// A parameter is a value that is only used inside a component, but may need to
+// be initialized or adjusted from outside the component to set up the system
+// properly. A parameter is, just like pins an opaque pointer.
+//
+// Once a parameter has been created, it's value can be changed using the
+// appropriate hal_set_XXX() function for the respective type. There are seven
+// (five) functions, one for each of the data types that the HAL supports.
+// Parameters cannot be linked to signals.
+//
+// - 'comp_id' is the ID of the component that will 'own' the parameter.
+// Normally it should be the ID of the caller, but in some cases, a user
+// mode component may be doing setup for a realtime component, so the ID
+// should be that of the realtime component that will actually be using the
+// parameter.
+// - 'dir' is the parameter direction. HAL_RO parameters are read only from
+// outside, and are written to by the component itself, typically to
+// provide a view "into" the component for testing or troubleshooting.
+// HAL_RW parameters are writable from outside and also sometimes modified
+// by the component itself as well.
+// - 'ref' is the address where the pointer reference of where the parameter is
+// to be stored. 'ref' must point to memory allocated by hal_malloc().
+// Typically the component allocates space for a data structure with
+// hal_malloc(), and 'ref' is the address of a member of that structure.
+// - 'def' is the default value of the parameter. The default value willbe set
+// when the parameter is created.
+// - 'fmt' is the name of the new parameter. It must be no longer than
+// HAL_NAME_LEN. If there is already a parameter with the same name the
+// call will fail.
+// Both parameters and pins share the name space and a name must be unique.
+//
+// If successful, the hal_param_new_xxxx() functions return zero (0). On
+// failure they return a negative error code.
+//
+int hal_param_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_param_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_param_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_param_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_param_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_param_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real def, const char *fmt, ...) __HAL_PFMT(5,6);
+int hal_param_new_fake(int compid, hal_refs_u *refs);
/** There is no 'hal_param_delete()' function. Once a component has
created a parameter, that parameter remains as long as the
@@ -895,86 +764,12 @@ extern int hal_param_new(const char *name, hal_type_t type, hal_param_dir_t dir,
removed when the component calls 'hal_exit()'.
*/
-/** The 'hal_param_xxx_set()' functions modify the value of a parameter.
- 'name' is the name of the parameter that is to be set. The
- parameter type must match the function type, and the parameter
- must not be read-only.
- 'value' is the value to be loaded into the parameter.
- On success, the hal_param_xxx_set() functions return 0,
- and on failure they return a negative error code.
-*/
-int hal_param_bit_set(const char *name, int value) __HAL_DEPRECATED("Use hal_set_p()");
-int hal_param_float_set(const char *name, double value) __HAL_DEPRECATED("Use hal_set_p()");
-int hal_param_u32_set(const char *name, unsigned long value) __HAL_DEPRECATED("Use hal_set_p()");
-int hal_param_s32_set(const char *name, signed long value) __HAL_DEPRECATED("Use hal_set_p()");
-int hal_param_u64_set(const char *name, unsigned long value) __HAL_DEPRECATED("Use hal_set_p()");
-int hal_param_s64_set(const char *name, signed long value) __HAL_DEPRECATED("Use hal_set_p()");
-
/** 'hal_param_alias()' assigns an alternate name, aka an alias, to
a parameter. Once assigned, the parameter can be referred to by
either its original name or the alias. Calling this function
with 'alias' set to NULL will remove any existing alias.
*/
-extern int hal_param_alias(const char *pin_name, const char *alias);
-
-/** 'hal_param_set()' is a generic function that sets the value of a
- parameter. It is provided ONLY for those special cases where a
- generic function is needed. It is STRONGLY recommended that the
- functions above be used instead, because they are simpler and less
- prone to errors.
- 'name', is the same as in the functions above.
- 'type' is the hal type of the the data at *value_addr, and must
- match the type of the parameter. The parameter must not be
- read only.
- 'value_addr' is a pointer to the new value of the parameter.
- The data at that location will be interpreted according to the
- type of the parameter.
- If successful, hal_param_set() returns 0. On failure
- it returns a negative error code.
-*/
-int hal_param_set(const char *name, hal_type_t type, void *value_addr) __HAL_DEPRECATED("Use hal_set_p()");
-
-/***********************************************************************
-* PIN/SIG/PARAM GETTER FUNCTIONS *
-************************************************************************/
-
-/** 'hal_get_pin_value_by_name()' gets the value of any arbitrary HAL pin by
- * pin name.
- *
- * The 'type' and 'data' args are pointers to the returned values. The function
- * returns 0 if successful, or -1 on error. If 'connected' is non-NULL, its
- * value will be true if a signal is connected.
- */
-
-// We don't want our library to emit the deprecation warning.
-// We already know it and need to provide them until removed.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-extern int hal_get_pin_value_by_name(
- const char *name, hal_type_t *type, hal_data_u **data, bool *connected) __HAL_DEPRECATED("Use hal_get_p()");
-
-/** 'hal_get_signal_value_by_name()' returns the value of any arbitrary HAL
- * signal by signal name.
- *
- * The 'type' and 'data' args are pointers to the returned values. The function
- * returns 0 if successful, or -1 on error. If 'has_writers' is non-NULL, its
- * value will be true if the signal has writers.
- */
-
-extern int hal_get_signal_value_by_name(
- const char *name, hal_type_t *type, hal_data_u **data, bool *has_writers) __HAL_DEPRECATED("Use hal_get_s()");
-
-/** 'hal_get_param_value_by_name()' returns the value of any arbitrary HAL
- * parameter by parameter name.
- *
- * The 'type' and 'data' args are pointers to the returned values. The function
- * returns 0 if successful, or -1 on error.
- */
-
-extern int hal_get_param_value_by_name(
- const char *name, hal_type_t *type, hal_data_u **data) __HAL_DEPRECATED("Use hal_get_p()");
-#pragma GCC diagnostic pop
-
+int hal_param_alias(const char *pin_name, const char *alias);
/***********************************************************************
* EXECUTION RELATED FUNCTIONS *
@@ -1012,7 +807,7 @@ extern int hal_get_param_value_by_name(
Call only from realtime init code, not from user space or
realtime code.
*/
-extern int hal_export_funct(const char *name, void (*funct) (void *, long),
+int hal_export_funct(const char *name, void (*funct) (void *, long),
void *arg, int uses_fp, int reentrant, int comp_id);
/** hal_export_functf is similar to hal_export_funct except that it also does
@@ -1020,7 +815,7 @@ extern int hal_export_funct(const char *name, void (*funct) (void *, long),
If successful, it returns 0.
On failure it returns a negative error code.
*/
-extern int hal_export_functf(void (*funct) (void *, long),
+int hal_export_functf(void (*funct) (void *, long),
void *arg, int uses_fp, int reentrant, int comp_id, const char *fmt, ...);
/** hal_create_thread() establishes a realtime thread that will
@@ -1043,8 +838,7 @@ extern int hal_export_functf(void (*funct) (void *, long),
above. Call only from realtime init code, not from user
space or realtime code.
*/
-extern int hal_create_thread(const char *name, unsigned long period_nsec,
- int uses_fp);
+int hal_create_thread(const char *name, unsigned long period_nsec, int uses_fp);
/** hal_thread_delete() deletes a realtime thread.
'name' is the name of the thread, which must have been created
@@ -1054,7 +848,7 @@ extern int hal_create_thread(const char *name, unsigned long period_nsec,
Call only from realtime init code, not from user
space or realtime code.
*/
-extern int hal_thread_delete(const char *name);
+int hal_thread_delete(const char *name);
#endif /* RTAPI */
@@ -1079,8 +873,7 @@ extern int hal_thread_delete(const char *name);
only from within user space or init code, not from
realtime code.
*/
-extern int hal_add_funct_to_thread(const char *funct_name, const char *thread_name,
- int position);
+int hal_add_funct_to_thread(const char *funct_name, const char *thread_name, int position);
/** hal_init_funct_to_thread() registers a function to run exactly once,
in the realtime context of 'thread_name', before the thread executes
@@ -1099,7 +892,7 @@ extern int hal_add_funct_to_thread(const char *funct_name, const char *thread_na
have no effect.
Returns 0, -EALREADY, or a negative error code. Call only from user
space or init code, not from realtime code. */
-extern int hal_init_funct_to_thread(const char *funct_name, const char *thread_name, int position);
+int hal_init_funct_to_thread(const char *funct_name, const char *thread_name, int position);
/** hal_del_funct_from_thread() removes a function from a thread.
'funct_name' is the name of the function, as specified in
@@ -1110,14 +903,14 @@ extern int hal_init_funct_to_thread(const char *funct_name, const char *thread_n
only from within user space or init code, not from
realtime code.
*/
-extern int hal_del_funct_from_thread(const char *funct_name, const char *thread_name);
+int hal_del_funct_from_thread(const char *funct_name, const char *thread_name);
/** hal_start_threads() starts all threads that have been created.
This is the point at which realtime functions start being called.
On success it returns 0, on failure a negative
error code.
*/
-extern int hal_start_threads(void);
+int hal_start_threads(void);
/** hal_stop_threads() stops all threads that were previously
started by hal_start_threads(). It should be called before
@@ -1125,7 +918,7 @@ extern int hal_start_threads(void);
On success it returns 0, on failure a negative
error code.
*/
-extern int hal_stop_threads(void);
+int hal_stop_threads(void);
/** HAL 'constructor' typedef
If it is not NULL, this points to a function which can construct a new
@@ -1136,7 +929,7 @@ typedef int(*constructor)(const char *prefix, const char *arg);
/** hal_set_constructor() sets the constructor function for this component
*/
-extern int hal_set_constructor(int comp_id, constructor make);
+int hal_set_constructor(int comp_id, constructor make);
@@ -1161,7 +954,7 @@ extern int hal_set_constructor(int comp_id, constructor make);
true: count bytes were read into dest
false: no bytes were read into dest
*/
-extern bool hal_port_read(const hal_port_t *port, char* dest, unsigned count);
+bool hal_port_read(const hal_port_t port, char* dest, unsigned count);
/** hal_port_peek operates the same as hal_port_read but no bytes are consumed
@@ -1171,7 +964,7 @@ extern bool hal_port_read(const hal_port_t *port, char* dest, unsigned count);
true: count bytes were read into dest
false: no bytes were read into dest
*/
-extern bool hal_port_peek(const hal_port_t *port, char* dest, unsigned count);
+bool hal_port_peek(const hal_port_t port, char* dest, unsigned count);
/** hal_port_peek_commit advances the read position in the port buffer
by count bytes. A hal_port_peek followed by a hal_port_peek_commit
@@ -1182,7 +975,7 @@ extern bool hal_port_peek(const hal_port_t *port, char* dest, unsigned count);
true: count readable bytes were skipped and are no longer accessible
false: no bytes wer skipped
*/
-extern bool hal_port_peek_commit(const hal_port_t *port, unsigned count);
+bool hal_port_peek_commit(const hal_port_t port, unsigned count);
/** hal_port_write writes count bytes from src into the port.
This function should only be called by the component that owns
@@ -1192,40 +985,40 @@ extern bool hal_port_peek_commit(const hal_port_t *port, unsigned count);
false: no bytes were written into dest
*/
-extern bool hal_port_write(const hal_port_t *port, const char* src, unsigned count);
+bool hal_port_write(const hal_port_t port, const char* src, unsigned count);
/** hal_port_readable returns the number of bytes available
for reading from the port.
*/
-extern unsigned hal_port_readable(const hal_port_t *port);
+unsigned hal_port_readable(const hal_port_t port);
/** hal_port_writable returns the number of bytes that
can be written into the port
*/
-extern unsigned hal_port_writable(const hal_port_t *port);
+unsigned hal_port_writable(const hal_port_t port);
/** hal_port_buffer_size returns the total number of bytes
that a port can buffer
*/
-extern unsigned hal_port_buffer_size(const hal_port_t *port);
+unsigned hal_port_buffer_size(const hal_port_t port);
/** hal_port_clear emptys a given port of all data
without consuming any of it.
hal_port_clear should only be called by a reader
*/
-extern void hal_port_clear(const hal_port_t *port);
+void hal_port_clear(const hal_port_t port);
#ifdef ULAPI
/** hal_port_wait_readable spin waits on a port until it has at least
count bytes available for reading, or *stop > 0
*/
-extern void hal_port_wait_readable(hal_port_t** port, unsigned count, sig_atomic_t* stop);
+void hal_port_wait_readable(const hal_port_t port, unsigned count, sig_atomic_t *stop);
/** hal_port_wait_writable spin waits on a port until it has at least
count bytes available for writing or *stop > 0
*/
-extern void hal_port_wait_writable(hal_port_t** port, unsigned count, sig_atomic_t* stop);
+void hal_port_wait_writable(const hal_port_t port, unsigned count, sig_atomic_t *stop);
#endif
@@ -1239,10 +1032,8 @@ extern void hal_port_wait_writable(hal_port_t** port, unsigned count, sig_atomic
typedef union hal_stream_data {
rtapi_real f;
rtapi_bool b;
- rtapi_s32 s;
- rtapi_u32 u;
- rtapi_sint l;
- rtapi_uint k;
+ union { rtapi_sint s, l; };
+ union { rtapi_uint u, k; };
} hal_stream_data_u;
typedef hal_stream_data_u *hal_stream_data_ptr_u;
@@ -1257,34 +1048,34 @@ typedef hal_stream_t *hal_stream_ptr_t;
#define HAL_STREAM_MAX_PINS (21)
/** create and attach a stream */
-extern int hal_stream_create(hal_stream_t *stream, int comp, int key, unsigned depth, const char *typestring);
+int hal_stream_create(hal_stream_t *stream, int comp, int key, unsigned depth, const char *typestring);
/** detach and destroy an open stream */
-extern void hal_stream_destroy(hal_stream_t *stream);
+void hal_stream_destroy(hal_stream_t *stream);
/** attach to an existing stream */
-extern int hal_stream_attach(hal_stream_t *stream, int comp, int key, const char *typestring);
+int hal_stream_attach(hal_stream_t *stream, int comp, int key, const char *typestring);
/** detach from an open stream */
-extern int hal_stream_detach(hal_stream_t *stream);
+int hal_stream_detach(hal_stream_t *stream);
/** stream introspection */
-extern int hal_stream_element_count(hal_stream_t *stream);
-extern hal_type_t hal_stream_element_type(hal_stream_t *stream, int idx);
+int hal_stream_element_count(hal_stream_t *stream);
+hal_type_t hal_stream_element_type(hal_stream_t *stream, int idx);
// only one reader and one writer is allowed.
-extern int hal_stream_read(hal_stream_t *stream, hal_stream_data_u *buf, unsigned *sampleno);
-extern bool hal_stream_readable(hal_stream_t *stream);
-extern int hal_stream_depth(hal_stream_t *stream);
-extern unsigned hal_stream_maxdepth(hal_stream_t *stream);
-extern int hal_stream_num_underruns(hal_stream_t *stream);
-extern int hal_stream_num_overruns(hal_stream_t *stream);
+int hal_stream_read(hal_stream_t *stream, hal_stream_data_u *buf, unsigned *sampleno);
+bool hal_stream_readable(hal_stream_t *stream);
+int hal_stream_depth(hal_stream_t *stream);
+unsigned hal_stream_maxdepth(hal_stream_t *stream);
+int hal_stream_num_underruns(hal_stream_t *stream);
+int hal_stream_num_overruns(hal_stream_t *stream);
#ifdef ULAPI
-extern void hal_stream_wait_readable(hal_stream_t *stream, sig_atomic_t *stop);
+void hal_stream_wait_readable(hal_stream_t *stream, sig_atomic_t *stop);
#endif
-extern int hal_stream_write(hal_stream_t *stream, hal_stream_data_u *buf);
-extern bool hal_stream_writable(hal_stream_t *stream);
+int hal_stream_write(hal_stream_t *stream, hal_stream_data_u *buf);
+bool hal_stream_writable(hal_stream_t *stream);
#ifdef ULAPI
-extern void hal_stream_wait_writable(hal_stream_t *stream, sig_atomic_t *stop);
+void hal_stream_wait_writable(hal_stream_t *stream, sig_atomic_t *stop);
#endif
@@ -1293,17 +1084,6 @@ extern void hal_stream_wait_writable(hal_stream_t *stream, sig_atomic_t *stop);
************************************************************************/
-/** HAL_STATIC_ASSERT wrapper for compile time asserts
-*/
-#if __STDC_VERSION__ >= 202311L || defined(__cplusplus)
-#define HAL_STATIC_ASSERT(expression, message) static_assert((expression), message)
-#else
-/* _Static_assert: GCC extension, in C standard since C11, deprecated in favour of
- static_assert (like C++) from C23 onwards*/
-#define HAL_STATIC_ASSERT(expression, message) _Static_assert((expression), message)
-#endif
-
-
/** hal_extend_counter() extends a counter value with nbits to 64 bits.
For some hardware counters or encoders it may be desireable to
@@ -1644,4 +1424,8 @@ int hal_enforce_exact_base_period(void);
RTAPI_END_DECLS
+#undef __HAL_PFMT
+#undef __HAL_ALWAYS_INLINE
+#undef __HAL_DEPRECATED
+
#endif /* HAL_H */
diff --git a/src/hal/hal_lib.c b/src/hal/hal_lib.c
index ce5cbc68713..5ac484c6cea 100644
--- a/src/hal/hal_lib.c
+++ b/src/hal/hal_lib.c
@@ -778,10 +778,10 @@ const char *hal_strerror(int err)
}
}
-char *hal_comp_name(int comp_id)
+const char *hal_comp_name(int comp_id)
{
hal_comp_t *comp;
- char *result = NULL;
+ const char *result = NULL;
halpr_mutex_acquire();
comp = halpr_find_comp_by_id(comp_id);
if(comp) result = comp->name;
@@ -835,240 +835,9 @@ unsigned char hal_get_lock() {
* "PIN" FUNCTIONS *
************************************************************************/
-/* wrapper functs for typed pins - these call the generic funct below */
-
-// We don't want our library to emit the deprecation warning.
-// We already know it and need to provide them until removed.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-int hal_pin_bit_new(const char *name, hal_pin_dir_t dir,
- hal_bit_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_BIT, dir, (void **) data_ptr_addr, comp_id);
-}
-
-int hal_pin_float_new(const char *name, hal_pin_dir_t dir,
- hal_float_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_FLOAT, dir, (void **) data_ptr_addr,
- comp_id);
-}
-
-int hal_pin_u32_new(const char *name, hal_pin_dir_t dir,
- hal_u32_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_U32, dir, (void **) data_ptr_addr, comp_id);
-}
-
-int hal_pin_s32_new(const char *name, hal_pin_dir_t dir,
- hal_s32_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_S32, dir, (void **) data_ptr_addr, comp_id);
-}
-
-int hal_pin_u64_new(const char *name, hal_pin_dir_t dir,
- hal_u64_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_U64, dir, (void **) data_ptr_addr, comp_id);
-}
-
-int hal_pin_s64_new(const char *name, hal_pin_dir_t dir,
- hal_s64_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_S64, dir, (void **) data_ptr_addr, comp_id);
-}
-
-int hal_pin_port_new(const char *name, hal_pin_dir_t dir,
- hal_port_t ** data_ptr_addr, int comp_id)
-{
- return hal_pin_new(name, HAL_PORT, dir, (void **)data_ptr_addr, comp_id);
-}
-
-
-static int hal_pin_newfv(hal_type_t type, hal_pin_dir_t dir,
- void ** data_ptr_addr, int comp_id, const char *fmt, va_list ap)
-{
- char name[HAL_NAME_LEN + 1];
- int sz;
- sz = rtapi_vsnprintf(name, sizeof(name), fmt, ap);
- if(sz == -1 || sz > HAL_NAME_LEN) {
- rtapi_print_msg(RTAPI_MSG_ERR,
- "hal_pin_newfv: length %d too long for name starting '%s'\n",
- sz, name);
- return -ENOMEM;
- }
- return hal_pin_new(name, type, dir, data_ptr_addr, comp_id);
-}
-
-int hal_pin_bit_newf(hal_pin_dir_t dir,
- hal_bit_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_BIT, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_pin_float_newf(hal_pin_dir_t dir,
- hal_float_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_FLOAT, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_pin_u32_newf(hal_pin_dir_t dir,
- hal_u32_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_U32, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_pin_s32_newf(hal_pin_dir_t dir,
- hal_s32_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_S32, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_pin_u64_newf(hal_pin_dir_t dir,
- hal_u64_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_U64, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_pin_s64_newf(hal_pin_dir_t dir,
- hal_s64_t ** data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_S64, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-#pragma GCC diagnostic pop
-
-int hal_pin_port_newf(hal_pin_dir_t dir,
- hal_port_t **data_ptr_addr, int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_pin_newfv(HAL_PORT, dir, (void**)data_ptr_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-// *** New interface ***
-
-int hal_pin_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool def, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_BIT, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- if(ret)
- return ret;
- hal_set_bool(*ref, def);
- return 0;
-}
-
-int hal_pin_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 def, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_S32, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- if(ret)
- return ret;
- hal_set_si32(*ref, def);
- return 0;
-}
-
-int hal_pin_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 def, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_U32, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- if(ret)
- return ret;
- hal_set_ui32(*ref, def);
- return 0;
-}
-
-int hal_pin_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint def, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_S64, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- if(ret)
- return ret;
- hal_set_sint(*ref, def);
- return 0;
-}
-
-int hal_pin_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint def, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_U64, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- if(ret)
- return ret;
- hal_set_uint(*ref, def);
- return 0;
-}
-
-int hal_pin_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real def, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_FLOAT, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- if(ret)
- return ret;
- hal_set_real(*ref, def);
- return 0;
-}
-
-// Note: port has no initial default as it is an 'internal' reference
-//int hal_pin_new_port(int compid, hal_pdir_t dir, hal_port_t *ref, const char *fmt, ...)
-// FIXME: This needs to change into hal_port_t argument when we break the API
-// It is here so we may add halmodule without too much trouble until then.
-int hal_pin_new_port(int compid, hal_pdir_t dir, hal_sint_t *ref, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- int ret = hal_pin_newfv(HAL_PORT, dir, (void**)ref, compid, fmt, ap);
- va_end(ap);
- return ret;
-}
-
/* this is a generic function that does the majority of the work. */
-int hal_pin_new(const char *name, hal_type_t type, hal_pin_dir_t dir,
- void **data_ptr_addr, int comp_id)
+static int halpr_pin_new(const char *name, hal_type_t type, hal_pdir_t dir, void **data_ptr_addr, int comp_id)
{
rtapi_intptr_t *prev, next;
int cmp;
@@ -1081,18 +850,25 @@ int hal_pin_new(const char *name, hal_type_t type, hal_pin_dir_t dir,
return -EFAULT;
}
- if(*data_ptr_addr)
+ if(*data_ptr_addr)
{
rtapi_print_msg(RTAPI_MSG_ERR,
"HAL: ERROR: pin_new(%s) called with already-initialized memory\n",
name);
}
- if (type != HAL_BIT && type != HAL_FLOAT && type != HAL_S32 && type != HAL_U32 && type != HAL_S64 && type != HAL_U64 && type != HAL_PORT) {
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: pin type not one of HAL_BIT, HAL_FLOAT, HAL_S32, HAL_U32, HAL_S64, HAL_U64 or HAL_PORT\n");
- return -EINVAL;
+ switch(type) {
+ case HAL_BOOL:
+ case HAL_REAL:
+ case HAL_SINT:
+ case HAL_UINT:
+ case HAL_PORT:
+ break;
+ default:
+ rtapi_print_msg(RTAPI_MSG_ERR,
+ "HAL: ERROR: pin type not one of HAL_BOOL, HAL_REAL, HAL_SINT, HAL_UINT or HAL_PORT\n");
+ return -EINVAL;
}
-
+
if(dir != HAL_IN && dir != HAL_OUT && dir != HAL_IO) {
rtapi_print_msg(RTAPI_MSG_ERR,
"HAL: ERROR: pin direction not one of HAL_IN, HAL_OUT, or HAL_IO\n");
@@ -1208,6 +984,110 @@ int hal_pin_new(const char *name, hal_type_t type, hal_pin_dir_t dir,
}
}
+/* wrapper functs for typed pins - these call the generic funct below */
+
+static int hal_pin_newfv(hal_type_t type, hal_pdir_t dir,
+ void ** data_ptr_addr, int comp_id, const char *fmt, va_list ap)
+{
+ char name[HAL_NAME_LEN + 1];
+ int sz;
+ sz = rtapi_vsnprintf(name, sizeof(name), fmt, ap);
+ if(sz == -1 || sz > HAL_NAME_LEN) {
+ rtapi_print_msg(RTAPI_MSG_ERR,
+ "hal_pin_newfv: length %d too long for name starting '%s'\n",
+ sz, name);
+ return -ENOMEM;
+ }
+ return halpr_pin_new(name, type, dir, data_ptr_addr, comp_id);
+}
+
+// *** New interface ***
+
+int hal_pin_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool def, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_BOOL, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_bool(*ref, def);
+ return 0;
+}
+
+int hal_pin_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 def, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_SINT, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_si32(*ref, def);
+ return 0;
+}
+
+int hal_pin_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 def, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_UINT, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_ui32(*ref, def);
+ return 0;
+}
+
+int hal_pin_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint def, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_SINT, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_sint(*ref, def);
+ return 0;
+}
+
+int hal_pin_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint def, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_UINT, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_uint(*ref, def);
+ return 0;
+}
+
+int hal_pin_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real def, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_REAL, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_real(*ref, def);
+ return 0;
+}
+
+// Note: port has no initial default as it is an 'internal' reference
+int hal_pin_new_port(int compid, hal_pdir_t dir, hal_port_t *ref, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = hal_pin_newfv(HAL_PORT, dir, (void**)ref, compid, fmt, ap);
+ va_end(ap);
+ if(ret)
+ return ret;
+ hal_set_port(*ref, 0); // By definition, a port starts unallocated
+ return 0;
+}
+
int hal_pin_alias(const char *pin_name, const char *alias)
{
rtapi_intptr_t *prev, next;
@@ -1379,15 +1259,14 @@ int hal_signal_new(const char *name, hal_type_t type)
*/
switch (type) {
case HAL_BOOL:
- case HAL_S32:
- case HAL_U32:
case HAL_SINT:
case HAL_UINT:
case HAL_REAL:
case HAL_PORT:
data_addr = shmalloc_up(sizeof(*data_addr));
// Initialize the signal value
- memset(data_addr, 0, sizeof(*data_addr));
+ if(NULL != data_addr)
+ memset(data_addr, 0, sizeof(*data_addr));
break;
default:
halpr_mutex_release();
@@ -1604,8 +1483,6 @@ int hal_link(const char *pin_name, const char *sig_name)
switch (pin->type) {
case HAL_BOOL:
- case HAL_S32:
- case HAL_U32:
case HAL_SINT:
case HAL_UINT:
case HAL_REAL:
@@ -1683,126 +1560,6 @@ int hal_unlink(const char *pin_name)
/* wrapper functs for typed params - these call the generic funct below */
-// We don't want our library to emit the deprecation warning.
-// We already know it and need to provide them until removed.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-int hal_param_bit_new(const char *name, hal_param_dir_t dir, hal_bit_t * data_addr,
- int comp_id)
-{
- return hal_param_new(name, HAL_BIT, dir, (void *) data_addr, comp_id);
-}
-
-int hal_param_float_new(const char *name, hal_param_dir_t dir, hal_float_t * data_addr,
- int comp_id)
-{
- return hal_param_new(name, HAL_FLOAT, dir, (void *) data_addr, comp_id);
-}
-
-int hal_param_u32_new(const char *name, hal_param_dir_t dir, hal_u32_t * data_addr,
- int comp_id)
-{
- return hal_param_new(name, HAL_U32, dir, (void *) data_addr, comp_id);
-}
-
-int hal_param_s32_new(const char *name, hal_param_dir_t dir, hal_s32_t * data_addr,
- int comp_id)
-{
- return hal_param_new(name, HAL_S32, dir, (void *) data_addr, comp_id);
-}
-
-int hal_param_u64_new(const char *name, hal_param_dir_t dir, hal_u64_t * data_addr,
- int comp_id)
-{
- return hal_param_new(name, HAL_U64, dir, (void *) data_addr, comp_id);
-}
-int hal_param_s64_new(const char *name, hal_param_dir_t dir, hal_s64_t * data_addr,
- int comp_id)
-{
- return hal_param_new(name, HAL_S64, dir, (void *) data_addr, comp_id);
-}
-
-static int hal_param_newfv(hal_type_t type, hal_param_dir_t dir,
- void *data_addr, int comp_id, const char *fmt, va_list ap) {
- char name[HAL_NAME_LEN + 1];
- int sz;
- sz = rtapi_vsnprintf(name, sizeof(name), fmt, ap);
- if(sz == -1 || sz > HAL_NAME_LEN) {
- rtapi_print_msg(RTAPI_MSG_ERR,
- "hal_param_newfv: length %d too long for name starting '%s'\n",
- sz, name);
- return -ENOMEM;
- }
- return hal_param_new(name, type, dir, (void *) data_addr, comp_id);
-}
-
-int hal_param_bit_newf(hal_param_dir_t dir, hal_bit_t * data_addr,
- int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_param_newfv(HAL_BIT, dir, (void*)data_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_param_float_newf(hal_param_dir_t dir, hal_float_t * data_addr,
- int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_param_newfv(HAL_FLOAT, dir, (void*)data_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_param_u32_newf(hal_param_dir_t dir, hal_u32_t * data_addr,
- int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_param_newfv(HAL_U32, dir, (void*)data_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_param_s32_newf(hal_param_dir_t dir, hal_s32_t * data_addr,
- int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_param_newfv(HAL_S32, dir, (void*)data_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_param_u64_newf(hal_param_dir_t dir, hal_u64_t * data_addr,
- int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_param_newfv(HAL_U64, dir, (void*)data_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-
-int hal_param_s64_newf(hal_param_dir_t dir, hal_s64_t * data_addr,
- int comp_id, const char *fmt, ...)
-{
- va_list ap;
- int ret;
- va_start(ap, fmt);
- ret = hal_param_newfv(HAL_S64, dir, (void*)data_addr, comp_id, fmt, ap);
- va_end(ap);
- return ret;
-}
-#pragma GCC diagnostic pop
-
/* this is a generic function that does the majority of the work. */
// The old API parameter style uses the 'data_addr' as the actual data storage
@@ -1828,8 +1585,6 @@ static int hal_param_new_anyapi(const char *name, hal_type_t type, hal_pdir_t di
case HAL_REAL:
case HAL_SINT:
case HAL_UINT:
- case HAL_S32:
- case HAL_U32:
break;
default:
rtapi_print_msg(RTAPI_MSG_ERR,
@@ -1951,13 +1706,6 @@ static int hal_param_new_anyapi(const char *name, hal_type_t type, hal_pdir_t di
}
}
-// Old API interface
-int hal_param_new(const char *name, hal_type_t type, hal_pdir_t dir, void *data_addr,
- int comp_id)
-{
- return hal_param_new_anyapi(name, type, dir, data_addr, comp_id, 0);
-}
-
// New API interface only used locally
static int hal_param_new_newapi(hal_type_t type, hal_pdir_t dir, void *data_addr,
int comp_id, const char *fmt, va_list ap)
@@ -1979,7 +1727,7 @@ int hal_param_new_bool(int compid, hal_pdir_t dir, hal_bool_t *ref, rtapi_bool d
{
va_list ap;
va_start(ap, fmt);
- int ret = hal_param_new_newapi(HAL_BIT, dir, ref, compid, fmt, ap);
+ int ret = hal_param_new_newapi(HAL_BOOL, dir, ref, compid, fmt, ap);
va_end(ap);
if(ret)
return ret;
@@ -1991,7 +1739,7 @@ int hal_param_new_si32(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_s32 de
{
va_list ap;
va_start(ap, fmt);
- int ret = hal_param_new_newapi(HAL_S32, dir, ref, compid, fmt, ap);
+ int ret = hal_param_new_newapi(HAL_SINT, dir, ref, compid, fmt, ap);
va_end(ap);
if(ret)
return ret;
@@ -2003,7 +1751,7 @@ int hal_param_new_ui32(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_u32 de
{
va_list ap;
va_start(ap, fmt);
- int ret = hal_param_new_newapi(HAL_U32, dir, ref, compid, fmt, ap);
+ int ret = hal_param_new_newapi(HAL_UINT, dir, ref, compid, fmt, ap);
va_end(ap);
if(ret)
return ret;
@@ -2015,7 +1763,7 @@ int hal_param_new_sint(int compid, hal_pdir_t dir, hal_sint_t *ref, rtapi_sint d
{
va_list ap;
va_start(ap, fmt);
- int ret = hal_param_new_newapi(HAL_S64, dir, ref, compid, fmt, ap);
+ int ret = hal_param_new_newapi(HAL_SINT, dir, ref, compid, fmt, ap);
va_end(ap);
if(ret)
return ret;
@@ -2027,7 +1775,7 @@ int hal_param_new_uint(int compid, hal_pdir_t dir, hal_uint_t *ref, rtapi_uint d
{
va_list ap;
va_start(ap, fmt);
- int ret = hal_param_new_newapi(HAL_U64, dir, ref, compid, fmt, ap);
+ int ret = hal_param_new_newapi(HAL_UINT, dir, ref, compid, fmt, ap);
va_end(ap);
if(ret)
return ret;
@@ -2039,7 +1787,7 @@ int hal_param_new_real(int compid, hal_pdir_t dir, hal_real_t *ref, rtapi_real d
{
va_list ap;
va_start(ap, fmt);
- int ret = hal_param_new_newapi(HAL_FLOAT, dir, ref, compid, fmt, ap);
+ int ret = hal_param_new_newapi(HAL_REAL, dir, ref, compid, fmt, ap);
va_end(ap);
if(ret)
return ret;
@@ -2064,125 +1812,6 @@ int hal_param_new_fake(int compid, hal_refs_u *ref)
return 0;
}
-/* wrapper functs for typed params - these call the generic funct below */
-
-// We don't want our library to emit the deprecation warning.
-// We already know it and need to provide them until removed.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-int hal_param_bit_set(const char *name, int value)
-{
- return hal_param_set(name, HAL_BIT, &value);
-}
-
-int hal_param_float_set(const char *name, double value)
-{
- return hal_param_set(name, HAL_FLOAT, &value);
-}
-
-int hal_param_u32_set(const char *name, unsigned long value)
-{
- return hal_param_set(name, HAL_U32, &value);
-}
-
-int hal_param_s32_set(const char *name, signed long value)
-{
- return hal_param_set(name, HAL_S32, &value);
-}
-
-int hal_param_u64_set(const char *name, unsigned long value)
-{
- return hal_param_set(name, HAL_U64, &value);
-}
-
-int hal_param_s64_set(const char *name, signed long value)
-{
- return hal_param_set(name, HAL_S64, &value);
-}
-
-/* this is a generic function that does the majority of the work */
-
-int hal_param_set(const char *name, hal_type_t type, void *value_addr)
-{
- hal_param_t *param;
- void *d_ptr;
-
- if (hal_data == NULL) {
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: param_set called before init\n");
- return -EFAULT;
- }
-
- if (hal_data->lock & HAL_LOCK_PARAMS) {
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: param_set called while HAL locked\n");
- return -EPERM;
- }
-
- rtapi_print_msg(RTAPI_MSG_DBG, "HAL: setting parameter '%s'\n", name);
- /* get mutex before accessing shared data */
- halpr_mutex_acquire();
-
- /* search param list for name */
- param = halpr_find_param_by_name(name);
- if (param == NULL) {
- /* parameter not found */
- halpr_mutex_release();
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: parameter '%s' not found\n", name);
- return -EINVAL;
- }
- /* found it, is type compatible? */
- if (param->type != type) {
- halpr_mutex_release();
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: type mismatch setting param '%s'\n", name);
- return -EINVAL;
- }
- /* is it read only? */
- if (param->dir == HAL_RO) {
- halpr_mutex_release();
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: param '%s' is not writable\n", name);
- return -EINVAL;
- }
- /* everything is OK, set the value */
- d_ptr = SHMPTR(param->data_ptr);
- switch (param->type) {
- case HAL_BIT:
- if (*((int *) value_addr) == 0) {
- *(hal_bit_t *) (d_ptr) = 0;
- } else {
- *(hal_bit_t *) (d_ptr) = 1;
- }
- break;
- case HAL_FLOAT:
- *((hal_float_t *) (d_ptr)) = *((double *) (value_addr));
- break;
- case HAL_S32:
- *((hal_s32_t *) (d_ptr)) = *((signed long *) (value_addr));
- break;
- case HAL_U32:
- *((hal_u32_t *) (d_ptr)) = *((unsigned long *) (value_addr));
- break;
- case HAL_S64:
- *((hal_s64_t *) (d_ptr)) = *((signed long *) (value_addr));
- break;
- case HAL_U64:
- *((hal_u64_t *) (d_ptr)) = *((unsigned long *) (value_addr));
- break;
- default:
- /* Shouldn't get here, but just in case... */
- halpr_mutex_release();
- rtapi_print_msg(RTAPI_MSG_ERR,
- "HAL: ERROR: bad type %d setting param\n", param->type);
- return -EINVAL;
- }
- halpr_mutex_release();
- return 0;
-}
-#pragma GCC diagnostic pop
-
int hal_param_alias(const char *param_name, const char *alias)
{
rtapi_intptr_t *prev, next;
@@ -2307,62 +1936,6 @@ int hal_param_alias(const char *param_name, const char *alias)
}
}
-/***********************************************************************
-* PIN/SIG/PARAM GETTER FUNCTIONS *
-************************************************************************/
-
-// We don't want our library to emit the deprecation warning.
-// We already know it and need to provide them until removed.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-int hal_get_pin_value_by_name(
- const char *hal_name, hal_type_t *type, hal_data_u **data, bool *connected)
-{
- hal_pin_t *pin;
- hal_sig_t *sig;
- if ((pin = halpr_find_pin_by_name(hal_name)) == NULL)
- return -1;
-
- if (connected != NULL)
- *connected = pin && pin->signal;
- *type = pin->type;
- if (pin->signal != 0) {
- sig = (hal_sig_t *) SHMPTR(pin->signal);
- *data = (hal_data_u *) SHMPTR(sig->data_ptr);
- } else {
- *data = (hal_data_u *) &(pin->dummysig);
- }
- return 0;
-}
-
-int hal_get_signal_value_by_name(
- const char *hal_name, hal_type_t *type, hal_data_u **data, bool *has_writers)
-{
- hal_sig_t *sig;
- if ((sig = halpr_find_sig_by_name(hal_name)) == NULL)
- return -1;
-
- if (has_writers != NULL)
- *has_writers = !!sig->writers;
- *type = sig->type;
- *data = (hal_data_u *) SHMPTR(sig->data_ptr);
- return 0;
-}
-
-int hal_get_param_value_by_name(
- const char *hal_name, hal_type_t *type, hal_data_u **data)
-{
- hal_param_t *param;
- if ((param = halpr_find_param_by_name(hal_name)) == NULL)
- return -1;
-
- *type = param->type;
- *data = (hal_data_u *) SHMPTR(param->data_ptr);
- return 0;
-}
-#pragma GCC diagnostic pop
-
-
/***********************************************************************
* EXECUTION RELATED FUNCTIONS *
************************************************************************/
@@ -4159,8 +3732,6 @@ static void unlink_pin(hal_pin_t * pin)
switch (pin->type) {
case HAL_BOOL:
- case HAL_S32:
- case HAL_U32:
case HAL_SINT:
case HAL_UINT:
case HAL_REAL:
@@ -4517,7 +4088,7 @@ static bool hal_port_compute_copy(unsigned read,
}
-int halpr_port_alloc(unsigned size, hal_port_t *port) {
+int halpr_port_alloc(unsigned size, hal_port_t port) {
if(!port || size < 1 || size > HAL_PORT_SIZE_MAX)
return -EINVAL;
@@ -4531,32 +4102,33 @@ int halpr_port_alloc(unsigned size, hal_port_t *port) {
new_port->write = 0;
new_port->size = size;
- *port = SHMOFF(new_port);
+ hal_set_port(port, SHMOFF(new_port));
return 0;
}
-static inline hal_port_shm_t *hal_port_to_shm(const hal_port_t *port)
+static inline hal_port_shm_t *hal_port_to_shm(const hal_port_t port)
{
+ HAL_STATIC_ASSERT(sizeof(rtapi_port) <= sizeof(rtapi_sint), "rtapi_port size larger than rtapi_sint");
hal_port_shm_t *shm;
if(!port)
return NULL;
- long ofs = *port;
+ rtapi_port ofs = hal_get_port(port);
// The offset must be positive non-zero
// The offset must be modulo the magic field size (4 bytes)
// The offset must not point beyond shared memory for the control structure
- if(ofs <= 0 || 0 != (ofs & (long)(sizeof(shm->magic)-1)) || ofs > (long)(HAL_SIZE - sizeof(hal_port_shm_t)))
+ if(ofs <= 0 || 0 != (ofs & (rtapi_port)(sizeof(shm->magic)-1)) || ofs > (rtapi_port)(HAL_SIZE - sizeof(hal_port_shm_t)))
return NULL;
shm = SHMPTR(ofs);
// The magic number must match and size be valid
if (shm->magic != HAL_PORT_MAGIC_NUM || shm->size > HAL_PORT_SIZE_MAX)
return NULL;
// The ofset must not point beyond shared memory considering the size
- if (ofs > (long)(HAL_SIZE - (sizeof(hal_port_shm_t) + shm->size)))
+ if (ofs > (rtapi_port)(HAL_SIZE - (sizeof(hal_port_shm_t) + shm->size)))
return NULL;
return shm;
}
-bool hal_port_read(const hal_port_t *port, char* dest, unsigned count) {
+bool hal_port_read(const hal_port_t port, char* dest, unsigned count) {
unsigned read,
write,
end_bytes_to_read, //number of bytes to read after read position and before end of buffer
@@ -4592,7 +4164,7 @@ bool hal_port_read(const hal_port_t *port, char* dest, unsigned count) {
}
-bool hal_port_peek(const hal_port_t *port, char* dest, unsigned count) {
+bool hal_port_peek(const hal_port_t port, char* dest, unsigned count) {
unsigned read,
write,
end_bytes_to_read, //number of bytes to read after read position and before end of buffer
@@ -4627,7 +4199,7 @@ bool hal_port_peek(const hal_port_t *port, char* dest, unsigned count) {
}
-bool hal_port_peek_commit(const hal_port_t *port, unsigned count) {
+bool hal_port_peek_commit(const hal_port_t port, unsigned count) {
unsigned read,
write,
end_bytes_to_read, //number of bytes to read after read position and before end of buffer
@@ -4661,7 +4233,7 @@ bool hal_port_peek_commit(const hal_port_t *port, unsigned count) {
}
-bool hal_port_write(const hal_port_t *port, const char* src, unsigned count) {
+bool hal_port_write(const hal_port_t port, const char* src, unsigned count) {
unsigned read,
write,
bytes_avail,
@@ -4717,7 +4289,7 @@ bool hal_port_write(const hal_port_t *port, const char* src, unsigned count) {
}
-unsigned hal_port_readable(const hal_port_t *port) {
+unsigned hal_port_readable(const hal_port_t port) {
hal_port_shm_t* port_shm = hal_port_to_shm(port);
if(!port_shm) {
rtapi_print_msg(RTAPI_MSG_ERR, "hal_port_readable: invalid port %p\n", port);
@@ -4727,7 +4299,7 @@ unsigned hal_port_readable(const hal_port_t *port) {
}
-unsigned hal_port_writable(const hal_port_t *port) {
+unsigned hal_port_writable(const hal_port_t port) {
hal_port_shm_t* port_shm = hal_port_to_shm(port);
if(!port_shm) {
rtapi_print_msg(RTAPI_MSG_ERR, "hal_port_writable: invalid port %p\n", port);
@@ -4737,7 +4309,7 @@ unsigned hal_port_writable(const hal_port_t *port) {
}
-unsigned hal_port_buffer_size(const hal_port_t *port) {
+unsigned hal_port_buffer_size(const hal_port_t port) {
hal_port_shm_t* port_shm = hal_port_to_shm(port);
if(!port_shm) {
rtapi_print_msg(RTAPI_MSG_ERR, "hal_port_buffer_size: invalid port %p\n", port);
@@ -4747,7 +4319,7 @@ unsigned hal_port_buffer_size(const hal_port_t *port) {
}
-void hal_port_clear(const hal_port_t *port) {
+void hal_port_clear(const hal_port_t port) {
unsigned read,write;
hal_port_shm_t* port_shm = hal_port_to_shm(port);
if(!port_shm) {
@@ -4760,15 +4332,15 @@ void hal_port_clear(const hal_port_t *port) {
#ifdef ULAPI
-void hal_port_wait_readable(hal_port_t** port, unsigned count, sig_atomic_t* stop) {
- while((hal_port_readable(*port) < count) && (!stop || !*stop)) {
+void hal_port_wait_readable(const hal_port_t port, unsigned count, sig_atomic_t *stop) {
+ while((hal_port_readable(port) < count) && (!stop || !*stop)) {
rtapi_delay(10000000);
}
}
-void hal_port_wait_writable(hal_port_t** port, unsigned count, sig_atomic_t* stop) {
- while((hal_port_writable(*port) < count) && (!stop || !*stop)) {
+void hal_port_wait_writable(const hal_port_t port, unsigned count, sig_atomic_t *stop) {
+ while((hal_port_writable(port) < count) && (!stop || !*stop)) {
rtapi_delay(10000000);
}
}
@@ -4802,13 +4374,11 @@ static char *hal_stream_type_string(int type, char *buf, size_t nbuf)
{
const char *cptr;
switch(type) {
- case HAL_BIT: cptr = "bit"; break;
- case HAL_FLOAT: cptr = "float"; break;
- case HAL_S32: cptr = "s32"; break;
- case HAL_U32: cptr = "u32"; break;
- case HAL_S64: cptr = "s64"; break;
- case HAL_U64: cptr = "u64"; break;
- case HAL_PORT: cptr = "port"; break;
+ case HAL_BOOL: cptr = "bool"; break;
+ case HAL_REAL: cptr = "real"; break;
+ case HAL_SINT: cptr = "sint"; break;
+ case HAL_UINT: cptr = "uint"; break;
+ case HAL_PORT: cptr = "port"; break;
default:
rtapi_snprintf(buf, nbuf, "UNK#%d", type);
return buf;
@@ -4829,12 +4399,12 @@ static int hal_stream_parse_types(hal_type_t type[HAL_STREAM_MAX_PINS], const ch
for(n = 0; n < HAL_STREAM_MAX_PINS && *cfg != '\0'; n++) {
switch (*cfg) {
case 'r': case 'R':
- case 'f': case 'F': type[n] = HAL_FLOAT; break;
- case 'b': case 'B': type[n] = HAL_BIT; break;
- case 'u': case 'U': type[n] = HAL_U32; break;
- case 's': case 'S': type[n] = HAL_S32; break;
- case 'l': case 'L': type[n] = HAL_S64; break;
- case 'k': case 'K': type[n] = HAL_U64; break;
+ case 'f': case 'F': type[n] = HAL_REAL; break;
+ case 'b': case 'B': type[n] = HAL_BOOL; break;
+ case 's': case 'S':
+ case 'l': case 'L': type[n] = HAL_SINT; break;
+ case 'u': case 'U':
+ case 'k': case 'K': type[n] = HAL_UINT; break;
default:
rtapi_print_msg(RTAPI_MSG_ERR, "stream: ERROR: unknown type '%c', must be R (F), B, U, S, L or K\n", *cfg);
return 0;
@@ -5168,44 +4738,11 @@ EXPORT_SYMBOL(hal_pin_new_uint);
EXPORT_SYMBOL(hal_pin_new_real);
EXPORT_SYMBOL(hal_pin_new_port);
-EXPORT_SYMBOL(hal_pin_bit_new);
-EXPORT_SYMBOL(hal_pin_float_new);
-EXPORT_SYMBOL(hal_pin_u32_new);
-EXPORT_SYMBOL(hal_pin_s32_new);
-EXPORT_SYMBOL(hal_pin_u64_new);
-EXPORT_SYMBOL(hal_pin_s64_new);
-EXPORT_SYMBOL(hal_pin_port_new);
-EXPORT_SYMBOL(hal_pin_new);
-
-EXPORT_SYMBOL(hal_pin_bit_newf);
-EXPORT_SYMBOL(hal_pin_float_newf);
-EXPORT_SYMBOL(hal_pin_u32_newf);
-EXPORT_SYMBOL(hal_pin_s32_newf);
-EXPORT_SYMBOL(hal_pin_u64_newf);
-EXPORT_SYMBOL(hal_pin_s64_newf);
-EXPORT_SYMBOL(hal_pin_port_newf);
-
-
EXPORT_SYMBOL(hal_signal_new);
EXPORT_SYMBOL(hal_signal_delete);
EXPORT_SYMBOL(hal_link);
EXPORT_SYMBOL(hal_unlink);
-EXPORT_SYMBOL(hal_param_bit_new);
-EXPORT_SYMBOL(hal_param_float_new);
-EXPORT_SYMBOL(hal_param_u32_new);
-EXPORT_SYMBOL(hal_param_s32_new);
-EXPORT_SYMBOL(hal_param_u64_new);
-EXPORT_SYMBOL(hal_param_s64_new);
-EXPORT_SYMBOL(hal_param_new);
-
-EXPORT_SYMBOL(hal_param_bit_newf);
-EXPORT_SYMBOL(hal_param_float_newf);
-EXPORT_SYMBOL(hal_param_u32_newf);
-EXPORT_SYMBOL(hal_param_s32_newf);
-EXPORT_SYMBOL(hal_param_u64_newf);
-EXPORT_SYMBOL(hal_param_s64_newf);
-
EXPORT_SYMBOL(hal_param_new_bool);
EXPORT_SYMBOL(hal_param_new_si32);
EXPORT_SYMBOL(hal_param_new_ui32);
@@ -5214,14 +4751,6 @@ EXPORT_SYMBOL(hal_param_new_uint);
EXPORT_SYMBOL(hal_param_new_real);
EXPORT_SYMBOL(hal_param_new_fake);
-EXPORT_SYMBOL(hal_param_bit_set);
-EXPORT_SYMBOL(hal_param_float_set);
-EXPORT_SYMBOL(hal_param_u32_set);
-EXPORT_SYMBOL(hal_param_s32_set);
-EXPORT_SYMBOL(hal_param_u64_set);
-EXPORT_SYMBOL(hal_param_s64_set);
-EXPORT_SYMBOL(hal_param_set);
-
EXPORT_SYMBOL(hal_set_constructor);
EXPORT_SYMBOL(hal_comp_invoke_make);
diff --git a/src/hal/hal_lib_query.c b/src/hal/hal_lib_query.c
index 09ec62cc827..8a6b57c7e6f 100644
--- a/src/hal/hal_lib_query.c
+++ b/src/hal/hal_lib_query.c
@@ -40,45 +40,20 @@
//
//=====================================================
-static int set_common(hal_type_t type, const hal_query_value_u *v, hal_refs_u u, bool setport, bool isparam)
+static int set_common(hal_type_t type, const hal_query_value_u *v, hal_refs_u u, bool setport)
{
- // This is a special case because compatibility requires us to write to the
- // smaller field when addressing parameters. An old-style param has a
- // user-defined storage that may not be large enough for our new types and
- // would overwrite other memory.
- // FIXME: This code must be retired when we do the API break.
- if(isparam) {
- switch(type) {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- case HAL_BOOL: ((hal_data_u *)u.b)->b = v->b; break;
- case HAL_S32: ((hal_data_u *)u.s)->s = v->s; break;
- case HAL_U32: ((hal_data_u *)u.u)->u = v->u; break;
- case HAL_SINT: ((hal_data_u *)u.s)->ls = v->s; break;
- case HAL_UINT: ((hal_data_u *)u.u)->lu = v->u; break;
- case HAL_REAL: ((hal_data_u *)u.r)->f = v->r; break;
-#pragma GCC diagnostic pop
- default:
- case HAL_PORT: return -EBADF;
- }
- return 0;
- }
switch(type) {
case HAL_BOOL: hal_set_bool(u.b, v->b); break;
- case HAL_S32: hal_set_si32(u.s, v->s); break;
- case HAL_U32: hal_set_ui32(u.u, v->u); break;
case HAL_SINT: hal_set_sint(u.s, v->s); break;
case HAL_UINT: hal_set_uint(u.u, v->u); break;
case HAL_REAL: hal_set_real(u.r, v->r); break;
case HAL_PORT: {
if(!setport)
return -EBADF;
- // FIXME: This needs to be changed when the old API is removed
- rtapi_port port = hal_get_sint(u.s);
- if(0 != port && hal_port_buffer_size((hal_port_t *)u.s) > 0) {
+ if(hal_port_buffer_size(u.p) > 0) {
return -EISCONN;
}
- int rv = halpr_port_alloc(v->u, (hal_port_t *)u.s);
+ int rv = halpr_port_alloc(v->u, u.p);
if(rv)
return rv;
} break;
@@ -157,7 +132,7 @@ int hal_set_s(hal_query_t *q, hal_query_cb cb, void *arg)
if(!rv) {
// Success, data to write must be in the value union
hal_refs_u u = (hal_refs_u)(hal_sint_t)SHMPTR(sig->data_ptr);
- if((rv = set_common(sig->type, &q->sig.value, u, 1, 0)) < 0) {
+ if((rv = set_common(sig->type, &q->sig.value, u, 1)) < 0) {
halpr_mutex_release();
if(-EBADF == rv)
rtapi_print_msg(RTAPI_MSG_ERR, "hal_set_s: Signal '%s' has bad type %d\n", q->name, sig->type);
@@ -204,7 +179,6 @@ int hal_set_p(hal_query_t *q, hal_query_cb cb, void *arg)
hal_type_t t;
hal_pin_t *pin = NULL;
hal_refs_u u;
- bool isparam;
// If only parameters requested, don't look for pins
if(HAL_QTYPE_PARAM != q->qtype)
pin = halpr_find_pin_by_name(q->name);
@@ -251,7 +225,6 @@ int hal_set_p(hal_query_t *q, hal_query_cb cb, void *arg)
}
// FIXME: This can be targeted to param's data when the old API is retired
u = (hal_refs_u)(hal_sint_t)SHMPTR(param->data_ptr);
- isparam = 1;
} else {
// We have a pin, copy the data, but we still can fail
q->qtype = HAL_QTYPE_PIN;
@@ -281,7 +254,6 @@ int hal_set_p(hal_query_t *q, hal_query_cb cb, void *arg)
return -EACCES;
}
u = (hal_refs_u)(hal_sint_t)&pin->dummysig;
- isparam = 0;
}
// Note: the callback is called while holding the mutex
@@ -289,7 +261,7 @@ int hal_set_p(hal_query_t *q, hal_query_cb cb, void *arg)
if(!rv) {
// Success, data to write must be in the value union
- if((rv = set_common(t, &q->pp.value, u, 0, isparam)) < 0) {
+ if((rv = set_common(t, &q->pp.value, u, 0)) < 0) {
halpr_mutex_release();
if(-EBADF == rv)
rtapi_print_msg(RTAPI_MSG_ERR, "hal_set_p: %s '%s' has bad type %d\n", pin ? "Pin" : "Param", q->name, t);
@@ -305,8 +277,6 @@ static int get_common(hal_type_t type, hal_query_value_u *v, hal_refs_u u, bool
{
switch(type) {
case HAL_BOOL: v->b = hal_get_bool(u.b); break;
- case HAL_S32: v->s = hal_get_si32(u.s); break;
- case HAL_U32: v->u = hal_get_ui32(u.u); break;
case HAL_SINT: v->s = hal_get_sint(u.s); break;
case HAL_UINT: v->u = hal_get_uint(u.u); break;
case HAL_REAL: v->r = hal_get_real(u.r); break;
@@ -314,8 +284,7 @@ static int get_common(hal_type_t type, hal_query_value_u *v, hal_refs_u u, bool
if(!getport) {
v->u = 0;
} else {
- // FIXME: This needs to be changed when the old API is removed
- v->u = hal_port_buffer_size((hal_port_t *)u.s);
+ v->u = hal_port_buffer_size(u.p);
}
break;
default:
diff --git a/src/hal/hal_priv.h b/src/hal/hal_priv.h
index 3e16f554614..bdff005dcb9 100644
--- a/src/hal/hal_priv.h
+++ b/src/hal/hal_priv.h
@@ -124,7 +124,7 @@
*/
#define HAL_KEY 0x48414C32 /* key used to open HAL shared memory */
-#define HAL_VER 0x00000014 /* version code */
+#define HAL_VER 0x00000015 /* version code */
#define HAL_SIZE (2*256*4096)
/* These pointers are set by hal_init() to point to the shmem block
@@ -231,8 +231,8 @@ typedef union {
inside a larger structure.
*/
typedef struct hal_list_t {
- SHMFIELD(hal_list_t) next; /* next element in list */
- SHMFIELD(hal_list_t) prev; /* previous element in list */
+ SHMFIELD(hal_list_t) next; // next element in list
+ SHMFIELD(hal_list_t) prev; // previous element in list
} hal_list_t;
/** HAL "oldname" data structure.
@@ -240,8 +240,8 @@ typedef struct hal_list_t {
store the original name.
*/
typedef struct hal_oldname_t {
- SHMFIELD(hal_oldname_t) next_ptr; /* next struct (used for free list only) */
- char name[HAL_NAME_LEN + 1]; /* the original name */
+ SHMFIELD(hal_oldname_t) next_ptr; // next struct (used for free list only)
+ char name[HAL_NAME_LEN + 1]; // the original name
} hal_oldname_t;
typedef struct hal_comp_t hal_comp_t;
@@ -261,7 +261,7 @@ typedef struct hal_thread_t hal_thread_t;
structure for all data in the HAL.
*/
typedef struct hal_data_t {
- int version; /* version code for structs, etc */
+ int version; // version code for structs, etc
// WARNING: Do not touch these mutex lock fields. Only use the proper
// functions halpr_mutex_acquire() and halpr_mutex_release(). See comment
@@ -273,35 +273,31 @@ typedef struct hal_data_t {
int locklvl; // Lock recursion level
int locktid; // Lock owner thread ID
- rtapi_s32 shmem_avail; /* amount of shmem left free */
- constructor pending_constructor;
- /* pointer to the pending constructor function */
- char constructor_prefix[HAL_NAME_LEN+1];
- /* prefix of name for new instance */
- char constructor_arg[HAL_NAME_LEN+1];
- /* prefix of name for new instance */
- int shmem_bot; /* bottom of free shmem (first free byte) */
- int shmem_top; /* top of free shmem (1 past last free) */
- SHMFIELD(hal_comp_t) comp_list_ptr; /* root of linked list of components */
- SHMFIELD(hal_pin_t) pin_list_ptr; /* root of linked list of pins */
- SHMFIELD(hal_sig_t) sig_list_ptr; /* root of linked list of signals */
- SHMFIELD(hal_param_t) param_list_ptr; /* root of linked list of parameters */
- SHMFIELD(hal_funct_t) funct_list_ptr; /* root of linked list of functions */
- SHMFIELD(hal_thread_t) thread_list_ptr; /* root of linked list of threads */
- long base_period; /* timer period for realtime tasks */
- int threads_running; /* non-zero if threads are started */
- SHMFIELD(hal_oldname_t) oldname_free_ptr; /* list of free oldname structs */
- SHMFIELD(hal_comp_t) comp_free_ptr; /* list of free component structs */
- SHMFIELD(hal_pin_t) pin_free_ptr; /* list of free pin structs */
- SHMFIELD(hal_sig_t) sig_free_ptr; /* list of free signal structs */
- SHMFIELD(hal_param_t) param_free_ptr; /* list of free parameter structs */
- SHMFIELD(hal_funct_t) funct_free_ptr; /* list of free function structs */
- hal_list_t funct_entry_free; /* list of free funct entry structs */
- SHMFIELD(hal_thread_t) thread_free_ptr; /* list of free thread structs */
- int exact_base_period; /* if set, pretend that rtapi satisfied our
- period request exactly */
- rtapi_realtime_type_t realtime_type; /* reflects the running realtime type */
- unsigned char lock; /* hal locking, can be one of the HAL_LOCK_* types */
+ rtapi_s32 shmem_avail; // amount of shmem left free
+ constructor pending_constructor; // pointer to the pending constructor function
+ char constructor_prefix[HAL_NAME_LEN+1];// prefix of name for new instance
+ char constructor_arg[HAL_NAME_LEN+1]; // prefix of name for new instance
+ int shmem_bot; // bottom of free shmem (first free byte)
+ int shmem_top; // top of free shmem (1 past last free)
+ SHMFIELD(hal_comp_t) comp_list_ptr; // root of linked list of components
+ SHMFIELD(hal_pin_t) pin_list_ptr; // root of linked list of pins
+ SHMFIELD(hal_sig_t) sig_list_ptr; // root of linked list of signals
+ SHMFIELD(hal_param_t) param_list_ptr; // root of linked list of parameters
+ SHMFIELD(hal_funct_t) funct_list_ptr; // root of linked list of functions
+ SHMFIELD(hal_thread_t) thread_list_ptr; // root of linked list of threads
+ long base_period; // timer period for realtime tasks
+ int threads_running; // non-zero if threads are started
+ SHMFIELD(hal_oldname_t) oldname_free_ptr; // list of free oldname structs
+ SHMFIELD(hal_comp_t) comp_free_ptr; // list of free component structs
+ SHMFIELD(hal_pin_t) pin_free_ptr; // list of free pin structs
+ SHMFIELD(hal_sig_t) sig_free_ptr; // list of free signal structs
+ SHMFIELD(hal_param_t) param_free_ptr; // list of free parameter structs
+ SHMFIELD(hal_funct_t) funct_free_ptr; // list of free function structs
+ hal_list_t funct_entry_free; // list of free funct entry structs
+ SHMFIELD(hal_thread_t) thread_free_ptr; // list of free thread structs
+ int exact_base_period; // if set, pretend that rtapi satisfied our period request exactly
+ rtapi_realtime_type_t realtime_type; // reflects the running realtime type
+ unsigned char lock; // hal locking, can be one of the HAL_LOCK_* types
} hal_data_t;
//
@@ -319,16 +315,16 @@ typedef hal_comp_type_t component_type_t;
component calls hal_init().
*/
struct hal_comp_t {
- SHMFIELD(hal_comp_t) next_ptr; /* next component in the list */
- int comp_id; /* component ID (RTAPI module id) */
- int mem_id; /* RTAPI shmem ID used by this comp */
- component_type_t type;
- int ready; /* nonzero if ready, 0 if not */
- int pid; /* PID of component (user components only) */
- void *shmem_base; /* base of shmem for this component */
- char name[HAL_NAME_LEN + 1]; /* component name */
+ SHMFIELD(hal_comp_t) next_ptr; // next component in the list
+ int comp_id; // component ID (RTAPI module id)
+ int mem_id; // RTAPI shmem ID used by this comp
+ component_type_t type; // RT or non-RT (HAL_COMP_TYPE_*)
+ int ready; // nonzero if ready, 0 if not
+ int pid; // PID of component (user components only)
+ void *shmem_base; // base of shmem for this component
+ char name[HAL_NAME_LEN + 1]; // component name
constructor make;
- SHMFIELD(char) insmod_args; /* args passed to insmod when loaded */
+ SHMFIELD(char) insmod_args; // args passed to insmod when loaded
};
/** HAL 'pin' data structure.
@@ -337,28 +333,28 @@ struct hal_comp_t {
FIXME: Merge with hal_param_t
*/
struct hal_pin_t {
- SHMFIELD(hal_pin_t) next_ptr; /* next pin in linked list */
- SHMFIELD(void*) data_ptr_addr; /* address of pin data pointer */
- SHMFIELD(hal_comp_t) owner_ptr; /* component that owns this pin */
- SHMFIELD(hal_oldname_t) oldname; /* old name if aliased, else zero */
- halpr_data_u dummysig; /* if unlinked, data_ptr points here */
- SHMFIELD(hal_sig_t) signal; /* signal to which pin is linked */
- hal_type_t type; /* data type */
- hal_pin_dir_t dir; /* pin direction */
- char name[HAL_NAME_LEN + 1]; /* pin name */
+ SHMFIELD(hal_pin_t) next_ptr; // next pin in linked list
+ SHMFIELD(void*) data_ptr_addr; // address of pin data pointer
+ SHMFIELD(hal_comp_t) owner_ptr; // component that owns this pin
+ SHMFIELD(hal_oldname_t) oldname; // old name if aliased, else zero
+ halpr_data_u dummysig; // if unlinked, data_ptr points here
+ SHMFIELD(hal_sig_t) signal; // signal to which pin is linked
+ hal_type_t type; // data type
+ hal_pdir_t dir; // pin direction
+ char name[HAL_NAME_LEN + 1]; // pin name
};
/** HAL 'signal' data structure.
This structure contains information about a 'signal' object.
*/
struct hal_sig_t {
- SHMFIELD(hal_sig_t) next_ptr; /* next signal in linked list */
- SHMFIELD(void*) data_ptr; /* offset of signal value */
- hal_type_t type; /* data type */
- int readers; /* number of input pins linked */
- int writers; /* number of output pins linked */
- int bidirs; /* number of I/O pins linked */
- char name[HAL_NAME_LEN + 1]; /* signal name */
+ SHMFIELD(hal_sig_t) next_ptr; // next signal in linked list
+ SHMFIELD(void*) data_ptr; // offset of signal value
+ hal_type_t type; // data type
+ int readers; // number of input pins linked
+ int writers; // number of output pins linked
+ int bidirs; // number of I/O pins linked
+ char name[HAL_NAME_LEN + 1]; // signal name
};
/** HAL 'parameter' data structure.
@@ -367,15 +363,15 @@ struct hal_sig_t {
FIXME: Merge with hal_pin_t
*/
struct hal_param_t {
- SHMFIELD(hal_param_t) next_ptr; /* next parameter in linked list */
- SHMFIELD(void*) data_ptr; /* offset of parameter value */
- SHMFIELD(hal_comp_t) owner_ptr; /* component that owns this signal */
- SHMFIELD(hal_oldname_t) oldname; /* old name if aliased, else zero */
- halpr_data_u data; /* new API parameter storage is here, data_ptr points here too */
- SHMFIELD(void*) reserved; /* reserved to match hal_pin_t layout */
- hal_type_t type; /* data type */
- hal_param_dir_t dir; /* data direction */
- char name[HAL_NAME_LEN + 1]; /* parameter name */
+ SHMFIELD(hal_param_t) next_ptr; // next parameter in linked list
+ SHMFIELD(void*) data_ptr; // offset of parameter value
+ SHMFIELD(hal_comp_t) owner_ptr; // component that owns this signal
+ SHMFIELD(hal_oldname_t) oldname; // old name if aliased, else zero
+ halpr_data_u data; // new API parameter storage is here, data_ptr points here too
+ SHMFIELD(void*) reserved; // reserved to match hal_pin_t layout
+ hal_type_t type; // data type
+ hal_pdir_t dir; // data direction
+ char name[HAL_NAME_LEN + 1]; // parameter name
};
/** the HAL uses functions and threads to handle synchronization of
@@ -395,48 +391,48 @@ struct hal_param_t {
*/
struct hal_funct_t {
- SHMFIELD(hal_funct_t) next_ptr; /* next function in linked list */
- int uses_fp; /* floating point flag */
- SHMFIELD(hal_comp_t) owner_ptr; /* component that added this funct */
- int reentrant; /* non-zero if function is re-entrant */
- int users; /* number of threads using function */
- void *arg; /* argument for function */
- void (*funct) (void *, long); /* ptr to function code */
+ SHMFIELD(hal_funct_t) next_ptr; // next function in linked list
+ int uses_fp; // floating point flag
+ SHMFIELD(hal_comp_t) owner_ptr; // component that added this funct
+ int reentrant; // non-zero if function is re-entrant
+ int users; // number of threads using function
+ void *arg; // argument for function
+ void (*funct) (void *, long); // ptr to function code
// IMPORTANT: The pins and params are valid as seen from the context that
// created them. For uspace that is rtapi_app and in the kernel it is the
// kernel's module context.
- hal_sint_t runtime; /* (pin) duration of last run, in CPU cycles */
- hal_sint_t maxtime; /* (param) duration of longest run, in CPU cycles */
- hal_bool_t maxtime_increased; /* (param) on last call, maxtime increased */
- char name[HAL_NAME_LEN + 1]; /* function name */
+ hal_sint_t runtime; // (pin) duration of last run, in CPU cycles
+ hal_sint_t maxtime; // (param) duration of longest run, in CPU cycles
+ hal_bool_t maxtime_increased; // (param) on last call, maxtime increased
+ char name[HAL_NAME_LEN + 1]; // function name
};
struct hal_funct_entry_t {
- hal_list_t links; /* linked list data */
- void *arg; /* argument for function */
- void (*funct) (void *, long); /* ptr to function code */
- SHMFIELD(hal_funct_t) funct_ptr; /* pointer to function */
+ hal_list_t links; // linked list data
+ void *arg; // argument for function
+ void (*funct) (void *, long); // ptr to function code
+ SHMFIELD(hal_funct_t) funct_ptr; // pointer to function
};
-#define HAL_STACKSIZE 16384 /* realtime task stacksize */
+#define HAL_STACKSIZE 16384 // realtime task stacksize
struct hal_thread_t {
- SHMFIELD(hal_thread_t) next_ptr; /* next thread in linked list */
- int uses_fp; /* floating point flag */
- long int period; /* period of the thread, in nsec */
- int priority; /* priority of the thread */
- int task_id; /* ID of the task that runs this thread */
+ SHMFIELD(hal_thread_t) next_ptr; // next thread in linked list
+ int uses_fp; // floating point flag
+ long int period; // period of the thread, in nsec
+ int priority; // priority of the thread
+ int task_id; // ID of the task that runs this thread
// IMPORTANT: The pins and params are valid as seen from the context that
// created them. For uspace that is rtapi_app and in the kernel it is the
// kernel's module context.
- hal_sint_t runtime; /* (pin) duration of last run, in ns */
- hal_sint_t maxtime; /* (param) duration of longest run, in ns */
- hal_sint_t threadbeat; /* (pin) visible monotonic loop beat counter */
- rtapi_sint beatcnt; /* Thread monotonic increasing loop beat counter (so we don't need to read/write volatile) */
- hal_list_t funct_list; /* list of functions to run */
- hal_list_t init_funct_list; /* list of init functions, run once before first cyclic cycle */
- int init_done; /* 0 = init pending, 1 = init cycle has executed */
- char name[HAL_NAME_LEN + 1]; /* thread name */
+ hal_sint_t runtime; // (pin) duration of last run, in ns
+ hal_sint_t maxtime; // (param) duration of longest run, in ns
+ hal_sint_t threadbeat; // (pin) visible monotonic loop beat counter
+ rtapi_sint beatcnt; // Thread monotonic increasing loop beat counter (so we don't need to read/write volatile)
+ hal_list_t funct_list; // list of functions to run
+ hal_list_t init_funct_list; // list of init functions, run once before first cyclic cycle
+ int init_done; // 0 = init pending, 1 = init cycle has executed
+ char name[HAL_NAME_LEN + 1]; // thread name
int comp_id;
};
@@ -509,12 +505,9 @@ extern hal_comp_t *halpr_find_comp_by_id(int id);
call, and return the next matching item. If no match is found, they
return NULL.
*/
-extern hal_pin_t *halpr_find_pin_by_owner(hal_comp_t * owner,
- hal_pin_t * start);
-extern hal_param_t *halpr_find_param_by_owner(hal_comp_t * owner,
- hal_param_t * start);
-extern hal_funct_t *halpr_find_funct_by_owner(hal_comp_t * owner,
- hal_funct_t * start);
+extern hal_pin_t *halpr_find_pin_by_owner(hal_comp_t *owner, hal_pin_t *start);
+extern hal_param_t *halpr_find_param_by_owner(hal_comp_t *owner, hal_param_t *start);
+extern hal_funct_t *halpr_find_funct_by_owner(hal_comp_t *owner, hal_funct_t *start);
/** 'find_pin_by_sig()' finds pin(s) that are linked to a specific signal.
If 'start' is NULL, it starts at the beginning of the pin list, and
@@ -530,7 +523,7 @@ extern hal_pin_t *halpr_find_pin_by_sig(hal_sig_t * sig, hal_pin_t * start);
returned and the newly allocated hal_port_t is returned in the port
argument and can be used with all other hal_port functions.
*/
-int halpr_port_alloc(unsigned size, hal_port_t *port);
+int halpr_port_alloc(unsigned size, hal_port_t port);
// Recursive HAL mutex (replaces old mutex)
int halpr_mutex_acquire(void);
diff --git a/src/hal/halmodule.cc b/src/hal/halmodule.cc
index 3f581d7de4b..10d48d2df02 100644
--- a/src/hal/halmodule.cc
+++ b/src/hal/halmodule.cc
@@ -374,18 +374,6 @@ static int pyhal_write_common(halitem *pin, PyObject *value) {
hal_set_real(pin->u->r, tmp);
break;
}
- case HAL_U32: {
- rtapi_u32 tmp;
- if(!from_python(value, &tmp)) return -1;
- hal_set_ui32(pin->u->u, tmp);
- break;
- }
- case HAL_S32: {
- rtapi_s32 tmp;
- if(!from_python(value, &tmp)) return -1;
- hal_set_si32(pin->u->s, tmp);
- break;
- }
case HAL_UINT: {
rtapi_uint tmp;
if(!from_python(value, &tmp)) return -1;
@@ -408,14 +396,12 @@ static PyObject *pyhal_read_common(halitem *item) {
if(!item) return NULL;
switch(item->type) {
case HAL_BOOL: return to_python(hal_get_bool(item->u->b));
- case HAL_U32: return to_python(hal_get_ui32(item->u->u));
- case HAL_S32: return to_python(hal_get_si32(item->u->s));
case HAL_UINT: return to_python(hal_get_uint(item->u->u));
case HAL_SINT: return to_python(hal_get_sint(item->u->s));
case HAL_REAL: return to_python(hal_get_real(item->u->r));
case HAL_PORT:
if(item->is_pin)
- return to_python(hal_port_buffer_size(reinterpret_cast(item->u->u)));
+ return to_python(hal_port_buffer_size(item->u->p));
else
return to_python((unsigned)0); // HAL_PORT cannot be a parameter
default:
@@ -442,8 +428,6 @@ static bool is_valid_hal_type(hal_type_t t, bool allowport)
{
switch(t) {
case HAL_BOOL:
- case HAL_S32:
- case HAL_U32:
case HAL_SINT:
case HAL_UINT:
case HAL_REAL:
@@ -455,7 +439,7 @@ static bool is_valid_hal_type(hal_type_t t, bool allowport)
}
}
-static PyObject * pyhal_create_param(halobject *self, const char *name, hal_type_t type, hal_param_dir_t dir) {
+static PyObject * pyhal_create_param(halobject *self, const char *name, hal_type_t type, hal_pdir_t dir) {
int res;
halitem param;
param.is_pin = 0;
@@ -475,8 +459,6 @@ static PyObject * pyhal_create_param(halobject *self, const char *name, hal_type
switch(type) {
case HAL_BOOL: res = hal_param_new_bool(self->hal_id, dir, ¶m.u->b, 0, "%s.%s", self->prefix, name); break;
- case HAL_S32: res = hal_param_new_si32(self->hal_id, dir, ¶m.u->s, 0, "%s.%s", self->prefix, name); break;
- case HAL_U32: res = hal_param_new_ui32(self->hal_id, dir, ¶m.u->u, 0, "%s.%s", self->prefix, name); break;
case HAL_SINT: res = hal_param_new_sint(self->hal_id, dir, ¶m.u->s, 0, "%s.%s", self->prefix, name); break;
case HAL_UINT: res = hal_param_new_uint(self->hal_id, dir, ¶m.u->u, 0, "%s.%s", self->prefix, name); break;
case HAL_REAL: res = hal_param_new_real(self->hal_id, dir, ¶m.u->r, 0.0, "%s.%s", self->prefix, name); break;
@@ -490,7 +472,7 @@ static PyObject * pyhal_create_param(halobject *self, const char *name, hal_type
}
-static PyObject * pyhal_create_pin(halobject *self, const char *name, hal_type_t type, hal_pin_dir_t dir) {
+static PyObject * pyhal_create_pin(halobject *self, const char *name, hal_type_t type, hal_pdir_t dir) {
char pin_name[HAL_NAME_LEN+1];
int res;
halitem pin;
@@ -518,13 +500,10 @@ static PyObject * pyhal_create_pin(halobject *self, const char *name, hal_type_t
}
switch(type) {
case HAL_BOOL: res = hal_pin_new_bool(self->hal_id, dir, &pin.u->b, 0, "%s.%s", self->prefix, name); break;
- case HAL_S32: res = hal_pin_new_si32(self->hal_id, dir, &pin.u->s, 0, "%s.%s", self->prefix, name); break;
- case HAL_U32: res = hal_pin_new_ui32(self->hal_id, dir, &pin.u->u, 0, "%s.%s", self->prefix, name); break;
case HAL_SINT: res = hal_pin_new_sint(self->hal_id, dir, &pin.u->s, 0, "%s.%s", self->prefix, name); break;
case HAL_UINT: res = hal_pin_new_uint(self->hal_id, dir, &pin.u->u, 0, "%s.%s", self->prefix, name); break;
case HAL_REAL: res = hal_pin_new_real(self->hal_id, dir, &pin.u->r, 0.0, "%s.%s", self->prefix, name); break;
- // FIXME: This needs to change when we break the API.
- case HAL_PORT: res = hal_pin_new_port(self->hal_id, dir, &pin.u->s, "%s.%s", self->prefix, name); break;
+ case HAL_PORT: res = hal_pin_new_port(self->hal_id, dir, &pin.u->p, "%s.%s", self->prefix, name); break;
default: res = -EINVAL; break;
}
if(res) return pyhal_error(res);
@@ -547,7 +526,7 @@ static PyObject *pyhal_new_param(PyObject *_self, PyObject *o) {
PyErr_Format(PyExc_ValueError, "Duplicate parameter name '%s'", name);
return NULL;
} else { PyErr_Clear(); }
- return pyhal_create_param(self, name, (hal_type_t)type, (hal_param_dir_t)dir);
+ return pyhal_create_param(self, name, (hal_type_t)type, (hal_pdir_t)dir);
}
@@ -564,7 +543,7 @@ static PyObject *pyhal_new_pin(PyObject *_self, PyObject *o) {
PyErr_Format(PyExc_ValueError, "Duplicate pin name '%s'", name);
return NULL;
} else { PyErr_Clear(); }
- return pyhal_create_pin(self, name, (hal_type_t)type, (hal_pin_dir_t)dir);
+ return pyhal_create_pin(self, name, (hal_type_t)type, (hal_pdir_t)dir);
}
enum what_type_e {
@@ -820,12 +799,10 @@ PyTypeObject halobject_type = {
static const char * pin_type2name(hal_type_t type) {
switch (type) {
- case HAL_BOOL: return "BIT";
- case HAL_S32: return "S32";
- case HAL_U32: return "U32";
- case HAL_SINT: return "S64";
- case HAL_UINT: return "U64";
- case HAL_REAL: return "FLOAT";
+ case HAL_BOOL: return "BOOL";
+ case HAL_SINT: return "SINT";
+ case HAL_UINT: return "UINT";
+ case HAL_REAL: return "REAL";
case HAL_PORT: return "PORT";
default: return "unknown";
}
@@ -949,12 +926,12 @@ static PyObject *pyhal_port_write(PyObject *self, PyObject *o)
Py_INCREF(Py_False);
return Py_False;
}
- if(len > (Py_ssize_t)hal_port_writable((hal_port_t *)item->pin.u->u)) {
+ if(len > (Py_ssize_t)hal_port_writable(item->pin.u->p)) {
Py_INCREF(Py_False);
return Py_False;
}
- return PyBool_FromLong(hal_port_write((hal_port_t *)item->pin.u->u, cptr, (unsigned)len));
+ return PyBool_FromLong(hal_port_write(item->pin.u->p, cptr, (unsigned)len));
}
static PyObject *pyhal_port_read_peek(pyhalitem *item, PyObject *o, bool isread)
@@ -978,7 +955,7 @@ static PyObject *pyhal_port_read_peek(pyhalitem *item, PyObject *o, bool isread)
Py_INCREF(Py_False);
return Py_False;
}
- if(l > (unsigned long)hal_port_readable((hal_port_t *)item->pin.u->u)) {
+ if(l > (unsigned long)hal_port_readable(item->pin.u->p)) {
Py_INCREF(Py_False);
return Py_False;
}
@@ -990,9 +967,9 @@ static PyObject *pyhal_port_read_peek(pyhalitem *item, PyObject *o, bool isread)
}
bool b;
if(isread)
- b = hal_port_read((hal_port_t *)item->pin.u->u, PyBytes_AsString(bts), (unsigned)l);
+ b = hal_port_read(item->pin.u->p, PyBytes_AsString(bts), (unsigned)l);
else
- b = hal_port_peek((hal_port_t *)item->pin.u->u, PyBytes_AsString(bts), (unsigned)l);
+ b = hal_port_peek(item->pin.u->p, PyBytes_AsString(bts), (unsigned)l);
if(b) {
Py_DECREF(bts);
Py_INCREF(Py_False);
@@ -1030,7 +1007,7 @@ static PyObject *pyhal_port_peek_commit(PyObject *self, PyObject *o)
Py_INCREF(Py_False);
return Py_False;
}
- return PyBool_FromLong(hal_port_peek_commit((hal_port_t *)item->pin.u->u, (unsigned)l));
+ return PyBool_FromLong(hal_port_peek_commit(item->pin.u->p, (unsigned)l));
}
static PyObject *pyhal_port_writable(PyObject *self, PyObject *)
@@ -1042,7 +1019,7 @@ static PyObject *pyhal_port_writable(PyObject *self, PyObject *)
PyErr_Format(PyExc_RuntimeError, "writable: %s: Pin not output", item->name);
return NULL;
}
- return PyLong_FromUnsignedLong(hal_port_writable((hal_port_t *)item->pin.u->u));
+ return PyLong_FromUnsignedLong(hal_port_writable(item->pin.u->p));
}
static PyObject *pyhal_port_readable(PyObject *self, PyObject *)
@@ -1054,7 +1031,7 @@ static PyObject *pyhal_port_readable(PyObject *self, PyObject *)
PyErr_Format(PyExc_RuntimeError, "readable: %s: Pin not input", item->name);
return NULL;
}
- return PyLong_FromUnsignedLong(hal_port_readable((hal_port_t *)item->pin.u->u));
+ return PyLong_FromUnsignedLong(hal_port_readable(item->pin.u->p));
}
static PyObject *pyhal_port_clear(PyObject *self, PyObject *)
@@ -1062,7 +1039,7 @@ static PyObject *pyhal_port_clear(PyObject *self, PyObject *)
pyhalitem *item = reinterpret_cast(self);
if(!check_port(item, "clear"))
return NULL;
- hal_port_clear((hal_port_t *)item->pin.u->u);
+ hal_port_clear(item->pin.u->p);
Py_INCREF(Py_None);
return Py_None;
}
@@ -1072,7 +1049,7 @@ static PyObject *pyhal_port_size(PyObject *self, PyObject *)
pyhalitem *item = reinterpret_cast(self);
if(!check_port(item, "size"))
return NULL;
- return PyLong_FromUnsignedLong(hal_port_buffer_size((hal_port_t *)item->pin.u->u));
+ return PyLong_FromUnsignedLong(hal_port_buffer_size(item->pin.u->p));
}
static PyMethodDef halpin_methods[] = {
@@ -1234,8 +1211,6 @@ PyObject *new_sig(PyObject * /*self*/, PyObject *args) {
//printf("INFO HALMODULE -- make signal -> %s type %d\n",name,(hal_type_t) type);
switch (type) {
case HAL_BOOL:
- case HAL_S32:
- case HAL_U32:
case HAL_SINT:
case HAL_UINT:
case HAL_REAL:
@@ -1285,18 +1260,6 @@ static int set_common_cb(hal_query_t *q, void *arg)
qvp->r = tmp;
break;
}
- case HAL_S32: {
- rtapi_s32 tmp;
- if(!from_python(obj, &tmp)) return -EINVAL;
- qvp->s = tmp;
- break;
- }
- case HAL_U32: {
- rtapi_u32 tmp;
- if(!from_python(obj, &tmp)) return -EINVAL;
- qvp->u = tmp;
- break;
- }
case HAL_SINT: {
rtapi_sint tmp;
if(!from_python(obj, &tmp)) return -EINVAL;
@@ -1358,8 +1321,6 @@ static PyObject *halref_to_object(hal_type_t type, const hal_query_value_u *v)
{
switch(type) {
case HAL_BOOL: return to_python(v->b);
- case HAL_U32: return to_python((rtapi_u32)v->u);
- case HAL_S32: return to_python((rtapi_s32)v->s);
case HAL_UINT: return to_python(v->u);
case HAL_SINT: return to_python(v->s);
case HAL_REAL: return to_python(v->r);
@@ -1454,16 +1415,6 @@ static int pinparaminfo_add(const hal_query_t *q, PyObject *lst)
str_n, q->name, str_v, PyBool_FromLong(hal_get_bool(q->pp.ref.b)),
str_d, PyLong_FromLong(q->pp.dir), str_t, PyLong_FromLong(HAL_BOOL));
break;
- case HAL_U32:
- obj = Py_BuildValue("{s:s,s:k,s:N,s:N}",
- str_n, q->name, str_v, hal_get_ui32(q->pp.ref.u),
- str_d, PyLong_FromLong(q->pp.dir), str_t, PyLong_FromLong(HAL_U32));
- break;
- case HAL_S32:
- obj = Py_BuildValue("{s:s,s:l,s:N,s:N}",
- str_n, q->name, str_v, hal_get_si32(q->pp.ref.s),
- str_d, PyLong_FromLong(q->pp.dir), str_t, PyLong_FromLong(HAL_S32));
- break;
case HAL_UINT:
obj = Py_BuildValue("{s:s,s:K,s:N,s:N}",
str_n, q->name, str_v, hal_get_uint(q->pp.ref.u),
@@ -1548,16 +1499,6 @@ static int siginfo_add(const hal_query_t *q, PyObject *lst)
str_n, q->name, str_v, PyBool_FromLong(hal_get_bool(q->sig.ref.b)),
str_d, writer, str_t, PyLong_FromLong(HAL_BOOL));
break;
- case HAL_U32:
- obj = Py_BuildValue("{s:s,s:k,s:s,s:N}",
- str_n, q->name, str_v, hal_get_ui32(q->sig.ref.u),
- str_d, writer, str_t, PyLong_FromLong(HAL_U32));
- break;
- case HAL_S32:
- obj = Py_BuildValue("{s:s,s:l,s:s,s:N}",
- str_n, q->name, str_v, hal_get_si32(q->sig.ref.s),
- str_d, writer, str_t, PyLong_FromLong(HAL_S32));
- break;
case HAL_UINT:
obj = Py_BuildValue("{s:s,s:K,s:s,s:N}",
str_n, q->name, str_v, hal_get_uint(q->sig.ref.u),
@@ -1868,10 +1809,8 @@ static int pystream_init(PyObject *_self, PyObject *args, PyObject * /*kw*/) {
switch(hal_stream_element_type(&self->stream, i)) {
case HAL_BOOL: tbuf[i] = 'b'; break;
case HAL_REAL: tbuf[i] = 'f'; break;
- case HAL_S32: tbuf[i] = 's'; break;
- case HAL_U32: tbuf[i] = 'u'; break;
- case HAL_SINT: tbuf[i] = 'l'; break;
- case HAL_UINT: tbuf[i] = 'k'; break;
+ case HAL_SINT: tbuf[i] = 's'; break;
+ case HAL_UINT: tbuf[i] = 'u'; break;
default: tbuf[i] = '?'; break;
}
}
@@ -2107,7 +2046,7 @@ static PyMethodDef module_methods[] = {
{"get_msg_level", get_msg_level, METH_NOARGS,
".get_msg_level(): Get the RTAPI message level"},
{"new_sig", new_sig, METH_VARARGS,
- ".new_sig('signal_name', type): Create a new signal with the specified name. 'type' is one of HAL_BIT, HAL_FLOAT, HAL_S32, or HAL_U32."},
+ ".new_sig('signal_name', type): Create a new signal with the specified name. 'type' is one of HAL_BOOL, HAL_REAL, HAL_SINT, or HAL_UINT."},
{"connect", connect, METH_VARARGS,
".connect('pin_name', 'signal_name'): Connect the named pin to the named signal."},
{"disconnect", disconnect, METH_VARARGS,
@@ -2148,8 +2087,8 @@ const char *module_doc = "Interface to LinuxCNC's hal\n"
"import hal, time\n"
"h = hal.component(\"component-name\")\n"
"# create pins and parameters with calls to h.newpin and h.newparam\n"
-"h.newpin(\"in\", hal.HAL_FLOAT, hal.HAL_IN)\n"
-"h.newpin(\"out\", hal.HAL_FLOAT, hal.HAL_OUT)\n"
+"h.newpin(\"in\", hal.Type.REAL, hal.Dir.IN)\n"
+"h.newpin(\"out\", hal.Type.REAL, hal.Dir.OUT)\n"
"h.ready() # mark the component as 'ready'\n"
"\n"
"try:\n"
@@ -2193,15 +2132,15 @@ static const halenum_member_t halenum_type_members[] = {
{"SINT", HAL_SINT},
{"UINT", HAL_UINT},
{"PORT", HAL_PORT},
- {"S32", HAL_S32},
- {"U32", HAL_U32},
+ {"S32", HAL_SINT},
+ {"U32", HAL_UINT},
{"HAL_BOOL", HAL_BOOL},
{"HAL_REAL", HAL_REAL},
{"HAL_SINT", HAL_SINT},
{"HAL_UINT", HAL_UINT},
{"HAL_PORT", HAL_PORT},
- {"HAL_S32", HAL_S32},
- {"HAL_U32", HAL_U32},
+ {"HAL_S32", HAL_SINT},
+ {"HAL_U32", HAL_UINT},
{}
};
@@ -2321,12 +2260,6 @@ PyMODINIT_FUNC PyInit__hal(void)
PyModule_AddIntConstant(m, "HAL_REAL", HAL_REAL);
PyModule_AddIntConstant(m, "HAL_SINT", HAL_SINT);
PyModule_AddIntConstant(m, "HAL_UINT", HAL_UINT);
- PyModule_AddIntConstant(m, "HAL_BIT", HAL_BIT);
- PyModule_AddIntConstant(m, "HAL_FLOAT", HAL_FLOAT);
- PyModule_AddIntConstant(m, "HAL_S32", HAL_S32);
- PyModule_AddIntConstant(m, "HAL_U32", HAL_U32);
- PyModule_AddIntConstant(m, "HAL_S64", HAL_S64);
- PyModule_AddIntConstant(m, "HAL_U64", HAL_U64);
PyModule_AddIntConstant(m, "HAL_PORT", HAL_PORT);
PyModule_AddIntConstant(m, "HAL_RO", HAL_RO);
diff --git a/src/hal/halquery.cc b/src/hal/halquery.cc
index 64fb36a92a1..d29f46aedfc 100644
--- a/src/hal/halquery.cc
+++ b/src/hal/halquery.cc
@@ -32,16 +32,12 @@ static py::object value_object(hal_type_t type, hal_refs_u u, bool ispin)
{
switch(type) {
case HAL_BOOL: return py::bool_(hal_get_bool(u.b));
- case HAL_S32: return py::int_(hal_get_si32(u.s));
case HAL_SINT: return py::int_(hal_get_sint(u.s));
- case HAL_U32: return py::int_(hal_get_ui32(u.u));
case HAL_UINT: return py::int_(hal_get_uint(u.u));
case HAL_REAL: return py::float_(hal_get_real(u.r));
case HAL_PORT:
- // FIXME
- // Needs to change when we break the API and change hal_port_t
if(ispin)
- return py::int_(hal_port_buffer_size(reinterpret_cast(u.u)));
+ return py::int_(hal_port_buffer_size(u.p));
else
return py::int_(0); // HAL_PORT cannot be a parameter
default: return py::none();
diff --git a/src/hal/setps_util.c b/src/hal/setps_util.c
index c3831376404..a5c44a5487c 100644
--- a/src/hal/setps_util.c
+++ b/src/hal/setps_util.c
@@ -63,12 +63,9 @@ int setps_common_cb(hal_query_t *q, void *arg)
}
}
return -EINVAL;
- case HAL_S32:
case HAL_SINT:
errno = 0;
qvp->s = strtoll(value, &eptr, 0);
- if(HAL_S32 == type && (qvp->s < RTAPI_INT32_MIN || qvp->s > RTAPI_INT32_MAX))
- return -ERANGE;
if(0 != errno)
return -errno;
if(value == eptr || (('\0' != *eptr) && !isspace((unsigned char)*eptr)))
@@ -80,12 +77,9 @@ int setps_common_cb(hal_query_t *q, void *arg)
return -EBADF;
}
/* Fallthrough */
- case HAL_U32:
case HAL_UINT:
errno = 0;
qvp->u = strtoull(value, &eptr, 0);
- if((HAL_U32 == type || HAL_PORT == type) && qvp->u > RTAPI_UINT32_MAX)
- return -ERANGE;
if(0 != errno)
return -errno;
if(value == eptr || (('\0' != *eptr) && !isspace((unsigned char)*eptr)))
diff --git a/src/hal/user_comps/hal_bridge.py b/src/hal/user_comps/hal_bridge.py
index 1833ab7e7af..afa9bbb44b6 100644
--- a/src/hal/user_comps/hal_bridge.py
+++ b/src/hal/user_comps/hal_bridge.py
@@ -66,25 +66,25 @@ def init_hal(self):
self.comp = h = hal.component("bridge")
QHAL = Qhal(comp=self.comp, hal=hal)
- self.jogRate = QHAL.newpin("jog-rate", hal.HAL_FLOAT, hal.HAL_OUT)
- self.jogRateIn = QHAL.newpin("jog-rate-in", hal.HAL_FLOAT, hal.HAL_IN)
+ self.jogRate = QHAL.newpin("jog-rate", hal.Type.REAL, hal.Dir.OUT)
+ self.jogRateIn = QHAL.newpin("jog-rate-in", hal.Type.REAL, hal.Dir.IN)
self.jogRateIn.pinValueChanged.connect(self.pinChanged)
- self.jogRateAngular = QHAL.newpin("jog-rate-angular", hal.HAL_FLOAT, hal.HAL_OUT)
- self.jogRateAngularIn = QHAL.newpin("jog-rate-angular-in", hal.HAL_FLOAT, hal.HAL_OUT)
+ self.jogRateAngular = QHAL.newpin("jog-rate-angular", hal.Type.REAL, hal.Dir.OUT)
+ self.jogRateAngularIn = QHAL.newpin("jog-rate-angular-in", hal.Type.REAL, hal.Dir.OUT)
self.jogRateAngularIn.pinValueChanged.connect(self.pinChanged)
- self.jogIncrement = QHAL.newpin("jog-increment", hal.HAL_FLOAT, hal.HAL_OUT)
- self.jogIncrementAngular = QHAL.newpin("jog-increment-angular", hal.HAL_FLOAT, hal.HAL_OUT)
- self.activeJoint = QHAL.newpin('joint-selected', hal.HAL_S32, hal.HAL_OUT)
+ self.jogIncrement = QHAL.newpin("jog-increment", hal.Type.REAL, hal.Dir.OUT)
+ self.jogIncrementAngular = QHAL.newpin("jog-increment-angular", hal.Type.REAL, hal.Dir.OUT)
+ self.activeJoint = QHAL.newpin('joint-selected', hal.Type.SINT, hal.Dir.OUT)
for i in (self.INFO.AVAILABLE_AXES):
let = i.lower()
# input
- self['axis{}Select'.format(let)] = QHAL.newpin('axis-%s-select'%let, hal.HAL_BIT, hal.HAL_IN)
+ self['axis{}Select'.format(let)] = QHAL.newpin('axis-%s-select'%let, hal.Type.BOOL, hal.Dir.IN)
self['axis{}Select'.format(let)].pinValueChanged.connect(self.pinChanged)
# output
- self['Axis{}IsSelected'.format(let)] = QHAL.newpin('axis-%s-is-selected'%let, hal.HAL_BIT, hal.HAL_OUT)
+ self['Axis{}IsSelected'.format(let)] = QHAL.newpin('axis-%s-is-selected'%let, hal.Type.BOOL, hal.Dir.OUT)
self.cycle_start = QHAL.newpin('cycle-start-in',QHAL.HAL_BIT, QHAL.HAL_IN)
self.cycle_start.pinValueChanged.connect(self.pinChanged)
diff --git a/src/hal/user_comps/hal_input.py b/src/hal/user_comps/hal_input.py
index 87c90e716db..f786e2c3a23 100644
--- a/src/hal/user_comps/hal_input.py
+++ b/src/hal/user_comps/hal_input.py
@@ -82,18 +82,18 @@ def __init__(self, comp, idx, name, parts='KRAL'):
for key in self.device.get_bits('EV_KEY'):
key = tohalname(key)
self.codes.add(key)
- comp.newpin("%s.%s" % (idx, key), HAL_BIT, HAL_OUT)
- comp.newpin("%s.%s-not" % (idx, key), HAL_BIT, HAL_OUT)
+ comp.newpin("%s.%s" % (idx, key), hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("%s.%s-not" % (idx, key), hal.Type.BOOL, hal.Dir.OUT)
self.set(key + "-not", 1)
if 'R' in parts:
for axis in self.device.get_bits('EV_REL'):
name = tohalname(axis)
self.codes.add(name)
- comp.newpin("%s.%s-position" % (idx, name), HAL_FLOAT, HAL_OUT)
- comp.newpin("%s.%s-counts" % (idx, name), HAL_S32, HAL_OUT)
- comp.newpin("%s.%s-reset" % (idx, name), HAL_BIT, HAL_IN)
- comp.newpin("%s.%s-scale" % (idx, name), HAL_FLOAT, HAL_IN)
+ comp.newpin("%s.%s-position" % (idx, name), hal.Type.REAL, hal.Dir.OUT)
+ comp.newpin("%s.%s-counts" % (idx, name), hal.Type.SINT, hal.Dir.OUT)
+ comp.newpin("%s.%s-reset" % (idx, name), hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin("%s.%s-scale" % (idx, name), hal.Type.REAL, hal.Dir.IN)
self.set(name + '-scale', 1.)
self.rel_items.append(name)
@@ -102,16 +102,16 @@ def __init__(self, comp, idx, name, parts='KRAL'):
name = tohalname(axis)
self.codes.add(name)
absinfo = self.device.get_absinfo(axis)
- comp.newpin("%s.%s-position" % (idx, name), HAL_FLOAT, HAL_OUT)
- comp.newpin("%s.%s-counts" % (idx, name), HAL_S32, HAL_OUT)
- comp.newpin("%s.%s-is-pos" % (idx, name), HAL_BIT, HAL_OUT)
- comp.newpin("%s.%s-is-neg" % (idx, name), HAL_BIT, HAL_OUT)
- comp.newpin("%s.%s-scale" % (idx, name), HAL_FLOAT, HAL_IN)
- comp.newpin("%s.%s-offset" % (idx, name), HAL_FLOAT, HAL_IN)
- comp.newpin("%s.%s-fuzz" % (idx, name), HAL_S32, HAL_IN)
- comp.newpin("%s.%s-flat" % (idx, name), HAL_S32, HAL_IN)
- comp.newparam("%s.%s-min" % (idx, name), HAL_S32, HAL_RO)
- comp.newparam("%s.%s-max" % (idx, name), HAL_S32, HAL_RO)
+ comp.newpin("%s.%s-position" % (idx, name), hal.Type.REAL, hal.Dir.OUT)
+ comp.newpin("%s.%s-counts" % (idx, name), hal.Type.SINT, hal.Dir.OUT)
+ comp.newpin("%s.%s-is-pos" % (idx, name), hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("%s.%s-is-neg" % (idx, name), hal.Type.BOOL, hal.Dir.OUT)
+ comp.newpin("%s.%s-scale" % (idx, name), hal.Type.REAL, hal.Dir.IN)
+ comp.newpin("%s.%s-offset" % (idx, name), hal.Type.REAL, hal.Dir.IN)
+ comp.newpin("%s.%s-fuzz" % (idx, name), hal.Type.SINT, hal.Dir.IN)
+ comp.newpin("%s.%s-flat" % (idx, name), hal.Type.SINT, hal.Dir.IN)
+ comp.newparam("%s.%s-min" % (idx, name), hal.Type.SINT, hal.Dir.RO)
+ comp.newparam("%s.%s-max" % (idx, name), hal.Type.SINT, hal.Dir.RO)
center = (absinfo.minimum + absinfo.maximum)/2.
halfrange = (absinfo.maximum - absinfo.minimum)/2. or 1
self.set(name + "-counts", absinfo.value)
@@ -130,8 +130,8 @@ def __init__(self, comp, idx, name, parts='KRAL'):
for led in self.device.get_bits('EV_LED'):
name = tohalname(led)
self.ledmap[name] = led
- comp.newpin("%s.%s" % (idx, name), HAL_BIT, HAL_IN)
- comp.newpin("%s.%s-invert" % (idx, name), HAL_BIT, HAL_IN)
+ comp.newpin("%s.%s" % (idx, name), hal.Type.BOOL, hal.Dir.IN)
+ comp.newpin("%s.%s-invert" % (idx, name), hal.Type.BOOL, hal.Dir.IN)
self.last[name] = 0
self.device.write_event('EV_LED', led, 0)
@@ -203,7 +203,7 @@ def update(self):
self.set(r + "-position", self.get(r + "-counts") / scale)
for k, v in list(self.last.items()):
- # Note: this is OK because the hal module always returns True or False for HAL_BIT values
+ # Note: this is OK because the hal module always returns True or False for hal.Type.BOOL values
u = self.comp["%s.%s" % (
self.idx, k)] != self.comp["%s.%s-invert" % (self.idx, k)]
if u != self.last[k]:
diff --git a/src/hal/user_comps/mitsub_vfd.py b/src/hal/user_comps/mitsub_vfd.py
index 8d0d6914686..dff04f6718d 100644
--- a/src/hal/user_comps/mitsub_vfd.py
+++ b/src/hal/user_comps/mitsub_vfd.py
@@ -69,34 +69,34 @@ def __init__(self,vfd_names=[['mitsub_vfd','00']],baudrate=9600,port='/dev/ttyUS
for index,name in enumerate(self.comp_names):
#print index,' NAME:',name[0],' SLAVE:',name[1]
c = hal.component(name[0])
- c.newpin("fwd", hal.HAL_BIT, hal.HAL_IN)
- c.newpin("run", hal.HAL_BIT, hal.HAL_IN)
- c.newpin("up-to-speed", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("alarm", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("debug", hal.HAL_BIT, hal.HAL_IN)
- c.newpin("monitor", hal.HAL_BIT, hal.HAL_IN)
- c.newpin("motor-cmd", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("motor-fb", hal.HAL_FLOAT, hal.HAL_OUT)
- c.newpin("motor-amps", hal.HAL_FLOAT, hal.HAL_OUT)
- c.newpin("motor-volts", hal.HAL_FLOAT, hal.HAL_OUT)
- c.newpin("motor-power", hal.HAL_FLOAT, hal.HAL_OUT)
- c.newpin("motor-user", hal.HAL_FLOAT, hal.HAL_OUT)
- c.newpin("scale-cmd", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("scale-fb", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("scale-amps", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("scale-volts", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("scale-power", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("scale-user", hal.HAL_FLOAT, hal.HAL_IN)
- c.newpin("estop", hal.HAL_BIT, hal.HAL_IN)
- c.newpin("reset-on-estop", hal.HAL_BIT, hal.HAL_IN)
- c.newpin("stat-bit-0", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-1", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-2", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-3", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-4", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-5", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-6", hal.HAL_BIT, hal.HAL_OUT)
- c.newpin("stat-bit-7", hal.HAL_BIT, hal.HAL_OUT)
+ c.newpin("fwd", hal.Type.BOOL, hal.Dir.IN)
+ c.newpin("run", hal.Type.BOOL, hal.Dir.IN)
+ c.newpin("up-to-speed", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("alarm", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("debug", hal.Type.BOOL, hal.Dir.IN)
+ c.newpin("monitor", hal.Type.BOOL, hal.Dir.IN)
+ c.newpin("motor-cmd", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("motor-fb", hal.Type.REAL, hal.Dir.OUT)
+ c.newpin("motor-amps", hal.Type.REAL, hal.Dir.OUT)
+ c.newpin("motor-volts", hal.Type.REAL, hal.Dir.OUT)
+ c.newpin("motor-power", hal.Type.REAL, hal.Dir.OUT)
+ c.newpin("motor-user", hal.Type.REAL, hal.Dir.OUT)
+ c.newpin("scale-cmd", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("scale-fb", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("scale-amps", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("scale-volts", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("scale-power", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("scale-user", hal.Type.REAL, hal.Dir.IN)
+ c.newpin("estop", hal.Type.BOOL, hal.Dir.IN)
+ c.newpin("reset-on-estop", hal.Type.BOOL, hal.Dir.IN)
+ c.newpin("stat-bit-0", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-1", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-2", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-3", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-4", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-5", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-6", hal.Type.BOOL, hal.Dir.OUT)
+ c.newpin("stat-bit-7", hal.Type.BOOL, hal.Dir.OUT)
# set reasonable defaults
c['scale-cmd'] = 1
c['scale-fb'] = 1
diff --git a/src/hal/user_comps/mqtt-publisher.py b/src/hal/user_comps/mqtt-publisher.py
index 847137dc30b..0a7c1ce60af 100755
--- a/src/hal/user_comps/mqtt-publisher.py
+++ b/src/hal/user_comps/mqtt-publisher.py
@@ -73,11 +73,11 @@ def create_pins(self, keys):
self.lcncstat.poll()
self.hal = hal.component('mqtt-publisher')
- self.hal.newpin('enable', hal.HAL_BIT, hal.HAL_IN)
+ self.hal.newpin('enable', hal.Type.BOOL, hal.Dir.IN)
self.hal['enable'] = True
- self.hal.newpin('period', hal.HAL_U32, hal.HAL_IN)
+ self.hal.newpin('period', hal.Type.UINT, hal.Dir.IN)
self.hal['period'] = 10
- self.hal.newpin('lastpublish', hal.HAL_U32, hal.HAL_OUT)
+ self.hal.newpin('lastpublish', hal.Type.UINT, hal.Dir.OUT)
self.hal['lastpublish'] = 0
self.hal.ready()
diff --git a/src/hal/user_comps/mtconnect-agent.py b/src/hal/user_comps/mtconnect-agent.py
index c4a5d87047e..d64e2d1f418 100755
--- a/src/hal/user_comps/mtconnect-agent.py
+++ b/src/hal/user_comps/mtconnect-agent.py
@@ -94,8 +94,8 @@ def make_hal_pins():
comp = hal.component("mtconnect-agent")
comp.newpin("enable", hal.Type.BOOL, hal.Dir.IN)
comp["enable"] = True
- comp.newpin("sample-hz", hal.Type.U32, hal.Dir.IN)
- comp.newpin("heartbeat", hal.Type.U32, hal.Dir.OUT)
+ comp.newpin("sample-hz", hal.Type.UINT, hal.Dir.IN)
+ comp.newpin("heartbeat", hal.Type.UINT, hal.Dir.OUT)
# Status outputs (linkable in the HAL file):
# active - agent is polling and serving
# connected - MQTT broker link is up (stays low without MQTT; HTTP/SHDR
diff --git a/src/hal/user_comps/pmx485.py b/src/hal/user_comps/pmx485.py
index 6c7796f0be7..15e1d2a512d 100644
--- a/src/hal/user_comps/pmx485.py
+++ b/src/hal/user_comps/pmx485.py
@@ -46,20 +46,20 @@
# create pmx485 component
try:
pmx485 = hal.component('pmx485')
- pmx485.newpin('mode_set', hal.HAL_FLOAT, hal.HAL_IN) #set cutting mode
- pmx485.newpin('current_set', hal.HAL_FLOAT, hal.HAL_IN) #set cutting current
- pmx485.newpin('pressure_set', hal.HAL_FLOAT, hal.HAL_IN) #set gas pressure
- pmx485.newpin('enable', hal.HAL_BIT, hal.HAL_IN) #enabler
- pmx485.newpin('mode', hal.HAL_FLOAT, hal.HAL_OUT) #cut mode feedback
- pmx485.newpin('current', hal.HAL_FLOAT, hal.HAL_OUT) #cutting current feedback
- pmx485.newpin('pressure', hal.HAL_FLOAT, hal.HAL_OUT) #gas pressure feedback
- pmx485.newpin('fault', hal.HAL_FLOAT, hal.HAL_OUT) #fault code
- pmx485.newpin('status', hal.HAL_BIT, hal.HAL_OUT) #connection status out
- pmx485.newpin('current_min', hal.HAL_FLOAT, hal.HAL_OUT) #minimum allowed current
- pmx485.newpin('current_max', hal.HAL_FLOAT, hal.HAL_OUT) #maximum allowed current
- pmx485.newpin('pressure_min', hal.HAL_FLOAT, hal.HAL_OUT) #minimum allowed gas pressure
- pmx485.newpin('pressure_max', hal.HAL_FLOAT, hal.HAL_OUT) #maximum allowed gas pressure
- pmx485.newpin('arcTime', hal.HAL_FLOAT, hal.HAL_OUT) #arc on time feedback
+ pmx485.newpin('mode_set', hal.Type.REAL, hal.Dir.IN) #set cutting mode
+ pmx485.newpin('current_set', hal.Type.REAL, hal.Dir.IN) #set cutting current
+ pmx485.newpin('pressure_set', hal.Type.REAL, hal.Dir.IN) #set gas pressure
+ pmx485.newpin('enable', hal.Type.BOOL, hal.Dir.IN) #enabler
+ pmx485.newpin('mode', hal.Type.REAL, hal.Dir.OUT) #cut mode feedback
+ pmx485.newpin('current', hal.Type.REAL, hal.Dir.OUT) #cutting current feedback
+ pmx485.newpin('pressure', hal.Type.REAL, hal.Dir.OUT) #gas pressure feedback
+ pmx485.newpin('fault', hal.Type.REAL, hal.Dir.OUT) #fault code
+ pmx485.newpin('status', hal.Type.BOOL, hal.Dir.OUT) #connection status out
+ pmx485.newpin('current_min', hal.Type.REAL, hal.Dir.OUT) #minimum allowed current
+ pmx485.newpin('current_max', hal.Type.REAL, hal.Dir.OUT) #maximum allowed current
+ pmx485.newpin('pressure_min', hal.Type.REAL, hal.Dir.OUT) #minimum allowed gas pressure
+ pmx485.newpin('pressure_max', hal.Type.REAL, hal.Dir.OUT) #maximum allowed gas pressure
+ pmx485.newpin('arcTime', hal.Type.REAL, hal.Dir.OUT) #arc on time feedback
pmx485.ready()
except:
print('\nERROR: pmx485 component could not be initialized\n')
diff --git a/src/hal/user_comps/scorbot-er-3.py b/src/hal/user_comps/scorbot-er-3.py
index 77c420d916d..2206223f798 100755
--- a/src/hal/user_comps/scorbot-er-3.py
+++ b/src/hal/user_comps/scorbot-er-3.py
@@ -76,10 +76,10 @@ def serial_read(num_bytes):
old_counts = [None] * 8
old_motor_max_vel = [None] * 8
for joint in range(0, 8):
- h.newpin('joint%d.limit-sw' % joint, hal.HAL_BIT, hal.HAL_OUT)
- h.newpin('joint%d.motor-pos-cmd' % joint, hal.HAL_FLOAT, hal.HAL_IN)
- h.newpin('joint%d.scale' % joint, hal.HAL_FLOAT, hal.HAL_IN)
- h.newpin('joint%d.motor-max-vel' % joint, hal.HAL_S32, hal.HAL_IN)
+ h.newpin('joint%d.limit-sw' % joint, hal.Type.BOOL, hal.Dir.OUT)
+ h.newpin('joint%d.motor-pos-cmd' % joint, hal.Type.REAL, hal.Dir.IN)
+ h.newpin('joint%d.scale' % joint, hal.Type.REAL, hal.Dir.IN)
+ h.newpin('joint%d.motor-max-vel' % joint, hal.Type.SINT, hal.Dir.IN)
h['joint%d.motor-pos-cmd' % joint] = 0.0
old_motor_pos_cmd[joint] = 0.0
diff --git a/src/hal/user_comps/sim-torch.py b/src/hal/user_comps/sim-torch.py
index 9b45326917e..de150d33c71 100644
--- a/src/hal/user_comps/sim-torch.py
+++ b/src/hal/user_comps/sim-torch.py
@@ -29,19 +29,19 @@
h = hal.component('sim-torch')
# create the hal pins
h.setprefix('sim-torch')
-h.newpin('cut-noise-in', hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin('cycles-in', hal.HAL_S32, hal.HAL_IN)
-h.newpin('on-delay-in', hal.HAL_S32, hal.HAL_IN)
-h.newpin('offset-in', hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin('overshoot-in', hal.HAL_S32, hal.HAL_IN)
-h.newpin('ramp-noise-in', hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin('ramp-up-in', hal.HAL_S32, hal.HAL_IN)
-h.newpin('start', hal.HAL_BIT, hal.HAL_IN)
-h.newpin('voltage-in', hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin('close', hal.HAL_BIT, hal.HAL_IN)
-h.newpin('voltage-out', hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin('void', hal.HAL_BIT, hal.HAL_IN)
-h.newpin('void_ramp', hal.HAL_S32, hal.HAL_IN)
+h.newpin('cut-noise-in', hal.Type.REAL, hal.Dir.IN)
+h.newpin('cycles-in', hal.Type.SINT, hal.Dir.IN)
+h.newpin('on-delay-in', hal.Type.SINT, hal.Dir.IN)
+h.newpin('offset-in', hal.Type.REAL, hal.Dir.IN)
+h.newpin('overshoot-in', hal.Type.SINT, hal.Dir.IN)
+h.newpin('ramp-noise-in', hal.Type.REAL, hal.Dir.IN)
+h.newpin('ramp-up-in', hal.Type.SINT, hal.Dir.IN)
+h.newpin('start', hal.Type.BOOL, hal.Dir.IN)
+h.newpin('voltage-in', hal.Type.REAL, hal.Dir.IN)
+h.newpin('close', hal.Type.BOOL, hal.Dir.IN)
+h.newpin('voltage-out', hal.Type.REAL, hal.Dir.OUT)
+h.newpin('void', hal.Type.BOOL, hal.Dir.IN)
+h.newpin('void_ramp', hal.Type.SINT, hal.Dir.IN)
# setdefaults for input pins
h['cut-noise-in'] = 0.75
h['cycles-in'] = 200 #"the number of cycles that the arc voltage overshoots the cut voltage (cycles)"
diff --git a/src/hal/user_comps/vismach/5axisgui.py b/src/hal/user_comps/vismach/5axisgui.py
index 0366112c4f7..d5fe64fef4e 100755
--- a/src/hal/user_comps/vismach/5axisgui.py
+++ b/src/hal/user_comps/vismach/5axisgui.py
@@ -79,14 +79,14 @@ def coords(self):
return -self.comp.tool_length, r, 0, r
c = hal.component("5axisgui")
-c.newpin("jx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jy", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jb", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jc", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diam", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pivot_len", hal.HAL_FLOAT, hal.HAL_OUT)
+c.newpin("jx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jy", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jb", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jc", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diam", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pivot_len", hal.Type.REAL, hal.Dir.OUT)
c["pivot_len"] = pivot_len
c.ready()
diff --git a/src/hal/user_comps/vismach/hbmgui.py b/src/hal/user_comps/vismach/hbmgui.py
index 55f423c1136..0a3dcaf580f 100755
--- a/src/hal/user_comps/vismach/hbmgui.py
+++ b/src/hal/user_comps/vismach/hbmgui.py
@@ -74,13 +74,13 @@ def coords(self):
c = hal.component("hbmgui")
# HAL pins
-c.newpin("table", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("saddle", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("head", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("quill", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table", hal.Type.REAL, hal.Dir.IN)
+c.newpin("saddle", hal.Type.REAL, hal.Dir.IN)
+c.newpin("head", hal.Type.REAL, hal.Dir.IN)
+c.newpin("quill", hal.Type.REAL, hal.Dir.IN)
-c.newpin("tool-length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-radius", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool-length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-radius", hal.Type.REAL, hal.Dir.IN)
c.ready()
tool_radius=0.5
diff --git a/src/hal/user_comps/vismach/hexagui.py b/src/hal/user_comps/vismach/hexagui.py
index 36429fa899a..cba5d8b015a 100755
--- a/src/hal/user_comps/vismach/hexagui.py
+++ b/src/hal/user_comps/vismach/hexagui.py
@@ -52,20 +52,20 @@ def popupmsg():
#if(randomize): compname += str(random.randrange(0,10000))
c = hal.component(compname)
#declare hal pins here
-c.newpin("joint.0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint.5", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint.0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint.5", hal.Type.REAL, hal.Dir.IN)
#get the tool tip position in cartesian coordinates from emc
#so we dont have to do kinematics
-c.newpin("axis.x", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.y", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.z", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.a", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.b", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("axis.c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis.x", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.y", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.z", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.a", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.b", hal.Type.REAL, hal.Dir.IN)
+c.newpin("axis.c", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/src/hal/user_comps/vismach/lineardelta.py b/src/hal/user_comps/vismach/lineardelta.py
index b1b7377903c..2b0638258f0 100644
--- a/src/hal/user_comps/vismach/lineardelta.py
+++ b/src/hal/user_comps/vismach/lineardelta.py
@@ -59,12 +59,12 @@ def popupmsg():
for setting in sys.argv[1:]: exec(setting)
c = hal.component("lineardelta")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("R", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("L", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("R", hal.Type.REAL, hal.Dir.IN)
+c.newpin("L", hal.Type.REAL, hal.Dir.IN)
c['R'], c['L'] = lineardeltakins.get_geometry()
c.ready()
diff --git a/src/hal/user_comps/vismach/maho600gui.py b/src/hal/user_comps/vismach/maho600gui.py
index 14bc2ab1842..62835735e7a 100755
--- a/src/hal/user_comps/vismach/maho600gui.py
+++ b/src/hal/user_comps/vismach/maho600gui.py
@@ -69,19 +69,19 @@ def coords(self):
c = hal.component("maho600gui")
# table
-c.newpin("table", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table", hal.Type.REAL, hal.Dir.IN)
# full width ways that table rides one
# this assembly moves up and down for Y
-c.newpin("tableway", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tableway", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("head", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("head", hal.Type.REAL, hal.Dir.IN)
# head tilt
-c.newpin("arotate", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("arotate", hal.Type.REAL, hal.Dir.IN)
# rotary table
-c.newpin("brotate", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("brotate", hal.Type.REAL, hal.Dir.IN)
-c.newpin("tool-length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-radius", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool-length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-radius", hal.Type.REAL, hal.Dir.IN)
c.ready()
pivot_len=100
diff --git a/src/hal/user_comps/vismach/max5gui.py b/src/hal/user_comps/vismach/max5gui.py
index f020299cc66..46e6d4c7a35 100755
--- a/src/hal/user_comps/vismach/max5gui.py
+++ b/src/hal/user_comps/vismach/max5gui.py
@@ -69,18 +69,18 @@ def coords(self):
c = hal.component("max5gui")
# table
-c.newpin("table", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table", hal.Type.REAL, hal.Dir.IN)
# saddle
-c.newpin("saddle", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("head", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("head", hal.Type.REAL, hal.Dir.IN)
# head tilt
-c.newpin("tilt", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt", hal.Type.REAL, hal.Dir.IN)
# rotary table
-c.newpin("rotate", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate", hal.Type.REAL, hal.Dir.IN)
-c.newpin("tool-length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-radius", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool-length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-radius", hal.Type.REAL, hal.Dir.IN)
c.ready()
pivot_len=100
diff --git a/src/hal/user_comps/vismach/melfagui.py b/src/hal/user_comps/vismach/melfagui.py
index 479f1c6cdc2..058bd545fa0 100755
--- a/src/hal/user_comps/vismach/melfagui.py
+++ b/src/hal/user_comps/vismach/melfagui.py
@@ -41,15 +41,15 @@ def popupmsg():
import hal
c = hal.component("melfagui")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("lnkdx", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("lnkdz", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("grip", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
+c.newpin("lnkdx", hal.Type.REAL, hal.Dir.IN)
+c.newpin("lnkdz", hal.Type.REAL, hal.Dir.IN)
+c.newpin("grip", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/src/hal/user_comps/vismach/millturngui.py b/src/hal/user_comps/vismach/millturngui.py
index fa822699cde..a376035a1f6 100755
--- a/src/hal/user_comps/vismach/millturngui.py
+++ b/src/hal/user_comps/vismach/millturngui.py
@@ -57,18 +57,18 @@ def popupmsg():
# in this file, and uncomment last line in HAL file.
# add joints. Mill has 3.
c = hal.component("millturngui")
-c.newpin("jointX", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointY", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointZ", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("jointA", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("jointX", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointY", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointZ", hal.Type.REAL, hal.Dir.IN)
+c.newpin("jointA", hal.Type.REAL, hal.Dir.IN)
# kinematics pins
-c.newpin("millkins", hal.HAL_BIT, hal.HAL_IN)
+c.newpin("millkins", hal.Type.BOOL, hal.Dir.IN)
# tool length and diameter pins?
-c.newpin("toollength", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tooldiameter", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-x-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("toollength", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tooldiameter", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-x-offset", hal.Type.REAL, hal.Dir.IN)
# tells loadusr pins is ready
c.ready()
diff --git a/src/hal/user_comps/vismach/puma560gui.py b/src/hal/user_comps/vismach/puma560gui.py
index bdd9affb243..87b265bf2fa 100755
--- a/src/hal/user_comps/vismach/puma560gui.py
+++ b/src/hal/user_comps/vismach/puma560gui.py
@@ -57,13 +57,13 @@ def popupmsg():
import hal
c = hal.component("puma560gui")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("grip", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
+c.newpin("grip", hal.Type.REAL, hal.Dir.IN)
c.ready()
diff --git a/src/hal/user_comps/vismach/pumagui.py b/src/hal/user_comps/vismach/pumagui.py
index 05399be4fac..40cf0b15273 100755
--- a/src/hal/user_comps/vismach/pumagui.py
+++ b/src/hal/user_comps/vismach/pumagui.py
@@ -79,12 +79,12 @@ def popupmsg():
import hal
c = hal.component("pumagui")
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint6", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint6", hal.Type.REAL, hal.Dir.IN)
c.ready()
###################
diff --git a/src/hal/user_comps/vismach/rotarydelta.py b/src/hal/user_comps/vismach/rotarydelta.py
index da1beee2f31..d27e5d9c14a 100755
--- a/src/hal/user_comps/vismach/rotarydelta.py
+++ b/src/hal/user_comps/vismach/rotarydelta.py
@@ -59,13 +59,13 @@ def popupmsg():
for setting in sys.argv[1:]: exec(setting)
c = hal.component("rotarydelta")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("pfr", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tl", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("sl", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("fr", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("pfr", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tl", hal.Type.REAL, hal.Dir.IN)
+c.newpin("sl", hal.Type.REAL, hal.Dir.IN)
+c.newpin("fr", hal.Type.REAL, hal.Dir.IN)
c['pfr'], c['tl'], c['sl'], c['fr'] = rotarydeltakins.get_geometry()
c.ready()
diff --git a/src/hal/user_comps/vismach/scaragui.py b/src/hal/user_comps/vismach/scaragui.py
index 5a0082ea5c4..4a38f2c8cb2 100755
--- a/src/hal/user_comps/vismach/scaragui.py
+++ b/src/hal/user_comps/vismach/scaragui.py
@@ -56,12 +56,12 @@ def popupmsg():
import sys
c = hal.component("scaragui")
-c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint3", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint4", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("joint5", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("joint0", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint1", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint2", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint3", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint4", hal.Type.REAL, hal.Dir.IN)
+c.newpin("joint5", hal.Type.REAL, hal.Dir.IN)
c.ready()
# parameters that define the geometry see scarakins.c for definitions these
diff --git a/src/hal/user_comps/vismach/xyzab-tdr-gui.py b/src/hal/user_comps/vismach/xyzab-tdr-gui.py
index c70ca7c477b..1f62874dd9f 100644
--- a/src/hal/user_comps/vismach/xyzab-tdr-gui.py
+++ b/src/hal/user_comps/vismach/xyzab-tdr-gui.py
@@ -66,26 +66,26 @@ def popupmsg():
c = hal.component("xyzab-tdr-gui")
# axis-x
-c.newpin("axis-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis-x", hal.Type.REAL, hal.Dir.IN)
# axis-y
-c.newpin("axis-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis-y", hal.Type.REAL, hal.Dir.IN)
# axis-z
-c.newpin("axis-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("axis-z", hal.Type.REAL, hal.Dir.IN)
# rotary_a
-c.newpin("rotary-a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary-a", hal.Type.REAL, hal.Dir.IN)
# rotary_b
-c.newpin("rotary-b", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotary-b", hal.Type.REAL, hal.Dir.IN)
# geometric offsets between A and B axes
-c.newpin("x_offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z_offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("x_offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z_offset", hal.Type.REAL, hal.Dir.IN)
# rot-point offsets
-c.newpin("x-rot-point", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("y-rot-point", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-rot-point", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("x-rot-point", hal.Type.REAL, hal.Dir.IN)
+c.newpin("y-rot-point", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-rot-point", hal.Type.REAL, hal.Dir.IN)
# tool-length offset
# tool offsets
-c.newpin("tool_length", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool_diameter", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tool_length", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool_diameter", hal.Type.REAL, hal.Dir.IN)
c.ready()
# These values are arbitrary and are meant to simulate an absolute
diff --git a/src/hal/user_comps/vismach/xyzac-trt-gui.py b/src/hal/user_comps/vismach/xyzac-trt-gui.py
index 3e7c5fcb879..021dd2e2a1c 100755
--- a/src/hal/user_comps/vismach/xyzac-trt-gui.py
+++ b/src/hal/user_comps/vismach/xyzac-trt-gui.py
@@ -63,19 +63,19 @@ def popupmsg():
c = hal.component("xyzac-trt-gui")
# table-x
-c.newpin("table-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table-x", hal.Type.REAL, hal.Dir.IN)
# saddle-y
-c.newpin("saddle-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle-y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("spindle-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("spindle-z", hal.Type.REAL, hal.Dir.IN)
# table-x tilt-b
-c.newpin("tilt-a", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt-a", hal.Type.REAL, hal.Dir.IN)
# rotary table-x
-c.newpin("rotate-c", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate-c", hal.Type.REAL, hal.Dir.IN)
# offsets
-c.newpin("y-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("y-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-offset", hal.Type.REAL, hal.Dir.IN)
c.ready()
for setting in sys.argv[1:]: exec(setting)
diff --git a/src/hal/user_comps/vismach/xyzbc-trt-gui.py b/src/hal/user_comps/vismach/xyzbc-trt-gui.py
index 0804a29ed2b..a6185242331 100755
--- a/src/hal/user_comps/vismach/xyzbc-trt-gui.py
+++ b/src/hal/user_comps/vismach/xyzbc-trt-gui.py
@@ -62,18 +62,18 @@ def popupmsg():
c = hal.component("xyzbc-trt-gui")
# table-x
-c.newpin("table-x", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("table-x", hal.Type.REAL, hal.Dir.IN)
# saddle-y
-c.newpin("saddle-y", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("saddle-y", hal.Type.REAL, hal.Dir.IN)
# head vertical slide
-c.newpin("spindle-z", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("spindle-z", hal.Type.REAL, hal.Dir.IN)
# table-x tilt-b
-c.newpin("tilt-b", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("tilt-b", hal.Type.REAL, hal.Dir.IN)
# rotary table-x
-c.newpin("rotate-c", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("z-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("x-offset", hal.HAL_FLOAT, hal.HAL_IN)
-c.newpin("tool-offset", hal.HAL_FLOAT, hal.HAL_IN)
+c.newpin("rotate-c", hal.Type.REAL, hal.Dir.IN)
+c.newpin("z-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("x-offset", hal.Type.REAL, hal.Dir.IN)
+c.newpin("tool-offset", hal.Type.REAL, hal.Dir.IN)
c.ready()
for setting in sys.argv[1:]: exec(setting)
diff --git a/src/hal/user_comps/xhc-hb04.cc b/src/hal/user_comps/xhc-hb04.cc
index 920cccfa245..6e928fd067d 100644
--- a/src/hal/user_comps/xhc-hb04.cc
+++ b/src/hal/user_comps/xhc-hb04.cc
@@ -526,7 +526,7 @@ static int hal_pin_simu(char *pin_name, void **ptr, int s)
return 0;
}
-int _hal_pin_float_newf(hal_pin_dir_t dir, hal_real_t *data_ptr_addr, int comp_id, const char *fmt, ...)
+int _hal_pin_float_newf(hal_pdir_t dir, hal_real_t *data_ptr_addr, int comp_id, const char *fmt, ...)
{
char pin_name[256];
va_list args;
@@ -542,7 +542,7 @@ int _hal_pin_float_newf(hal_pin_dir_t dir, hal_real_t *data_ptr_addr, int comp_i
}
}
-int _hal_pin_s32_newf(hal_pin_dir_t dir, hal_sint_t *data_ptr_addr, int comp_id, const char *fmt, ...)
+int _hal_pin_s32_newf(hal_pdir_t dir, hal_sint_t *data_ptr_addr, int comp_id, const char *fmt, ...)
{
char pin_name[256];
va_list args;
@@ -558,7 +558,7 @@ int _hal_pin_s32_newf(hal_pin_dir_t dir, hal_sint_t *data_ptr_addr, int comp_id,
}
}
-int _hal_pin_bit_newf(hal_pin_dir_t dir, hal_bool_t *data_ptr_addr, int comp_id, const char *fmt, ...)
+int _hal_pin_bit_newf(hal_pdir_t dir, hal_bool_t *data_ptr_addr, int comp_id, const char *fmt, ...)
{
char pin_name[256];
va_list args;
diff --git a/src/hal/user_comps/xhc-whb04b-6/hal.cc b/src/hal/user_comps/xhc-whb04b-6/hal.cc
index 843643490e0..f75611c6b06 100644
--- a/src/hal/user_comps/xhc-whb04b-6/hal.cc
+++ b/src/hal/user_comps/xhc-whb04b-6/hal.cc
@@ -232,7 +232,7 @@ int Hal::newSimulatedHalPin(char* /*pin_name*/, void** ptr, int s)
return 0;
}
// ----------------------------------------------------------------------
-int Hal::newHalFloat(hal_pin_dir_t direction, hal_real_t *ptr, int componentId, const char *fmt, ...)
+int Hal::newHalFloat(hal_pdir_t direction, hal_real_t *ptr, int componentId, const char *fmt, ...)
{
char pin_name[256];
va_list args;
@@ -242,7 +242,7 @@ int Hal::newHalFloat(hal_pin_dir_t direction, hal_real_t *ptr, int componentId,
assert(strlen(pin_name) < HAL_NAME_LEN);
- *mHalCout << "hal float ";
+ *mHalCout << "hal real ";
if (direction == HAL_OUT)
{
*mHalCout << "out ";
@@ -268,7 +268,7 @@ int Hal::newHalFloat(hal_pin_dir_t direction, hal_real_t *ptr, int componentId,
}
}
// ----------------------------------------------------------------------
-int Hal::newHalSigned32(hal_pin_dir_t direction, hal_sint_t *ptr, int componentId, const char *fmt, ...)
+int Hal::newHalSigned32(hal_pdir_t direction, hal_sint_t *ptr, int componentId, const char *fmt, ...)
{
char pin_name[256];
va_list args;
@@ -278,7 +278,7 @@ int Hal::newHalSigned32(hal_pin_dir_t direction, hal_sint_t *ptr, int componentI
assert(strlen(pin_name) < HAL_NAME_LEN);
- *mHalCout << "hal s32 ";
+ *mHalCout << "hal sint ";
if (direction == HAL_OUT)
{
*mHalCout << "out ";
@@ -304,7 +304,7 @@ int Hal::newHalSigned32(hal_pin_dir_t direction, hal_sint_t *ptr, int componentI
}
}
// ----------------------------------------------------------------------
-int Hal::newHalUnsigned32(hal_pin_dir_t direction, hal_uint_t *ptr, int componentId, const char *fmt, ...)
+int Hal::newHalUnsigned32(hal_pdir_t direction, hal_uint_t *ptr, int componentId, const char *fmt, ...)
{
char pin_name[256];
va_list args;
@@ -314,7 +314,7 @@ int Hal::newHalUnsigned32(hal_pin_dir_t direction, hal_uint_t *ptr, int componen
assert(strlen(pin_name) < HAL_NAME_LEN);
- *mHalCout << "hal u32 ";
+ *mHalCout << "hal uint ";
if (direction == HAL_OUT)
{
*mHalCout << "out ";
@@ -340,7 +340,7 @@ int Hal::newHalUnsigned32(hal_pin_dir_t direction, hal_uint_t *ptr, int componen
}
}
// ----------------------------------------------------------------------
-int Hal::newHalBit(hal_pin_dir_t direction, hal_bool_t *ptr, int componentId, const char *fmt, ...)
+int Hal::newHalBit(hal_pdir_t direction, hal_bool_t *ptr, int componentId, const char *fmt, ...)
{
char pin_name[256];
va_list args;
@@ -350,7 +350,7 @@ int Hal::newHalBit(hal_pin_dir_t direction, hal_bool_t *ptr, int componentId, co
assert(strlen(pin_name) < HAL_NAME_LEN);
- *mHalCout << "hal bit ";
+ *mHalCout << "hal bool ";
if (direction == HAL_OUT)
{
*mHalCout << "out ";
diff --git a/src/hal/user_comps/xhc-whb04b-6/hal.h b/src/hal/user_comps/xhc-whb04b-6/hal.h
index 28a64aa1858..b5c05324b9f 100644
--- a/src/hal/user_comps/xhc-whb04b-6/hal.h
+++ b/src/hal/user_comps/xhc-whb04b-6/hal.h
@@ -588,19 +588,19 @@ class Hal
//! \param s size in bytes
//! \return != 0 on error, 0 otherwise
int newSimulatedHalPin(char* pin_name, void** ptr, int s);
- //! \sa int newHalFloat(hal_pin_dir_t direction, hal_real_t* ptr, int componentId, const char* fmt, ...);
- int newHalFloat(hal_pin_dir_t direction, hal_real_t* ptr, int componentId, const char* fmt, ...);
- //! \sa int newHalSigned32(hal_pin_dir_t direction, hal_sint_t* ptr, int componentId, const char* fmt, ...);
- int newHalSigned32(hal_pin_dir_t direction, hal_sint_t* ptr, int componentId, const char* fmt, ...);
- //! \sa int newHalUnsigned32(hal_pin_dir_t direction, hal_sint_t* ptr, int componentId, const char* fmt, ...);
- int newHalUnsigned32(hal_pin_dir_t direction, hal_uint_t* ptr, int componentId, const char* fmt, ...);
+ //! \sa int newHalFloat(hal_pdir_t direction, hal_real_t* ptr, int componentId, const char* fmt, ...);
+ int newHalFloat(hal_pdir_t direction, hal_real_t* ptr, int componentId, const char* fmt, ...);
+ //! \sa int newHalSigned32(hal_pdir_t direction, hal_sint_t* ptr, int componentId, const char* fmt, ...);
+ int newHalSigned32(hal_pdir_t direction, hal_sint_t* ptr, int componentId, const char* fmt, ...);
+ //! \sa int newHalUnsigned32(hal_pdir_t direction, hal_sint_t* ptr, int componentId, const char* fmt, ...);
+ int newHalUnsigned32(hal_pdir_t direction, hal_uint_t* ptr, int componentId, const char* fmt, ...);
//! \param direction module input or output
//! \param ptr will point to the allocated memory
//! \param componentId hal id
//! \param fmt the pin name when registered to hal
//! \param ... va args
//! \return != 0 on error, 0 otherwise
- int newHalBit(hal_pin_dir_t direction, hal_bool_t* ptr, int componentId, const char* fmt, ...);
+ int newHalBit(hal_pdir_t direction, hal_bool_t* ptr, int componentId, const char* fmt, ...);
//! allocates new hal pin according to \ref mIsSimulationMode
//! \param pin pointer reference to the memory to be fred
//! \post pin == nullptr
diff --git a/src/hal/user_comps/z_level_compensation.py b/src/hal/user_comps/z_level_compensation.py
index 366c2889587..07c1c94bd96 100644
--- a/src/hal/user_comps/z_level_compensation.py
+++ b/src/hal/user_comps/z_level_compensation.py
@@ -110,15 +110,15 @@ def compensate(self):
def run(self):
self.h = hal.component("z_level_compensation")
- self.h.newpin("enable-in", hal.HAL_BIT, hal.HAL_IN)
- self.h.newpin("scale", hal.HAL_FLOAT, hal.HAL_OUT)
- self.h.newpin("counts", hal.HAL_S32, hal.HAL_OUT)
- self.h.newpin("clear", hal.HAL_BIT, hal.HAL_IN)
- self.h.newpin("x-pos", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("y-pos", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("z-pos", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("fade-height", hal.HAL_FLOAT, hal.HAL_IN)
- self.h.newpin("method", hal.HAL_S32, hal.HAL_IN)
+ self.h.newpin("enable-in", hal.Type.BOOL, hal.Dir.IN)
+ self.h.newpin("scale", hal.Type.REAL, hal.Dir.OUT)
+ self.h.newpin("counts", hal.Type.SINT, hal.Dir.OUT)
+ self.h.newpin("clear", hal.Type.BOOL, hal.Dir.IN)
+ self.h.newpin("x-pos", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("y-pos", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("z-pos", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("fade-height", hal.Type.REAL, hal.Dir.IN)
+ self.h.newpin("method", hal.Type.SINT, hal.Dir.IN)
self.h.ready()
self.stat = linuxcnc.stat()
diff --git a/src/hal/utils/halcmd_commands.cc b/src/hal/utils/halcmd_commands.cc
index 569293f2f4e..a890113e432 100644
--- a/src/hal/utils/halcmd_commands.cc
+++ b/src/hal/utils/halcmd_commands.cc
@@ -628,8 +628,8 @@ static hal_type_t typestr_to_haltype(const char *type, bool anycase)
{ "port", HAL_PORT },
{ "bit", HAL_BOOL },
{ "float", HAL_REAL },
- { "u32", HAL_U32 },
- { "s32", HAL_S32 },
+ { "u32", HAL_UINT },
+ { "s32", HAL_SINT },
{ "u64", HAL_UINT },
{ "s64", HAL_SINT },
{ nullptr, HAL_TYPE_UNSPECIFIED }
@@ -707,11 +707,9 @@ static std::string querydata_valuestr(hal_type_t type, const hal_query_value_u *
return v->b ? "TRUE" : "FALSE";
case HAL_REAL:
return fmt::format("{:.7g}", v->r);
- case HAL_S32:
case HAL_SINT:
case HAL_PORT:
return fmt::format("{}", v->s);
- case HAL_U32:
case HAL_UINT:
return fmt::format("{}", v->u);
default:
@@ -792,8 +790,8 @@ static int get_type(const char ***patterns) {
hal_type_t htype = typestr_to_haltype(typestr, false);
if(htype != HAL_TYPE_UNINITIALIZED)
return htype;
- if(strcmp(typestr, "signed") == 0) return HAL_S32;
- if(strcmp(typestr, "unsigned") == 0) return HAL_U32;
+ if(strcmp(typestr, "signed") == 0) return HAL_SINT;
+ if(strcmp(typestr, "unsigned") == 0) return HAL_UINT;
return -1;
}
@@ -1900,12 +1898,10 @@ static void print_mem_status()
static const char *data_type(hal_type_t type)
{
switch (type) {
- case HAL_BOOL: return "bit ";
- case HAL_REAL: return "float";
- case HAL_S32: return "s32 ";
- case HAL_U32: return "u32 ";
- case HAL_SINT: return "s64 ";
- case HAL_UINT: return "u64 ";
+ case HAL_BOOL: return "bool ";
+ case HAL_REAL: return "real ";
+ case HAL_SINT: return "sint ";
+ case HAL_UINT: return "uint ";
case HAL_PORT: return "port ";
default: return "undef"; /* Shouldn't get here, but just in case... */
}
@@ -1914,12 +1910,10 @@ static const char *data_type(hal_type_t type)
static const char *data_type2(hal_type_t type)
{
switch (type) {
- case HAL_BOOL: return "bit";
- case HAL_REAL: return "float";
- case HAL_S32: return "s32";
- case HAL_U32: return "u32";
- case HAL_SINT: return "s64";
- case HAL_UINT: return "u64";
+ case HAL_BOOL: return "bool";
+ case HAL_REAL: return "real";
+ case HAL_SINT: return "sint";
+ case HAL_UINT: return "uint";
case HAL_PORT: return "port";
default: return "undef"; /* Shouldn't get here, but just in case... */
}
@@ -1978,15 +1972,11 @@ static std::string querydata_refstr_20(hal_type_t type, hal_refs_u u)
return fmt::format("{:>20s}", hal_get_bool(u.b) ? "TRUE" : "FALSE");
case HAL_REAL:
return fmt::format("{:20.7g}", hal_get_real(u.r));
- case HAL_S32:
- return fmt::format("{:20d}", (long)hal_get_si32(u.s));
case HAL_SINT:
case HAL_PORT:
- return fmt::format("{:20d}", (long long)hal_get_sint(u.s));
- case HAL_U32:
- return fmt::format(" 0x{:08X}", (unsigned long)hal_get_ui32(u.u));
+ return fmt::format("{:20d}", hal_get_sint(u.s));
case HAL_UINT:
- return fmt::format(" 0x{:016X}", (unsigned long long)hal_get_uint(u.u));
+ return fmt::format(" 0x{:016X}", hal_get_uint(u.u));
default:
/* Shouldn't get here, but just in case... */
return " undef ";
@@ -2003,13 +1993,9 @@ static std::string querydata_refstr(hal_type_t type, hal_refs_u u)
return hal_get_bool(u.b) ? "TRUE" : "FALSE";
case HAL_REAL:
return fmt::format("{:.7g}", hal_get_real(u.r));
- case HAL_S32:
- return fmt::format("{}", hal_get_si32(u.s));
case HAL_SINT:
case HAL_PORT:
return fmt::format("{}", hal_get_sint(u.s));
- case HAL_U32:
- return fmt::format("{}", hal_get_ui32(u.u));
case HAL_UINT:
return fmt::format("{}", hal_get_uint(u.u));
default:
@@ -2477,7 +2463,7 @@ int do_help_cmd(const char *command)
} else if (strcmp(command, "newsig") == 0) {
printf("newsig signame type\n");
printf(" Creates a new signal called 'signame'. Type\n");
- printf(" is 'bit', 'float', 'port', 'u32', or 's32'.\n");
+ printf(" is 'bool', 'real', 'port', 'uint', or 'sint'.\n");
} else if (strcmp(command, "delsig") == 0) {
printf("delsig signame\n");
printf(" Deletes signal 'signame'. If 'signame is 'all',\n");
diff --git a/src/hal/utils/halcmd_completion.c b/src/hal/utils/halcmd_completion.c
index 577a958f767..69e854eedd8 100644
--- a/src/hal/utils/halcmd_completion.c
+++ b/src/hal/utils/halcmd_completion.c
@@ -87,7 +87,7 @@ static const char *status_table[] = {
};
static const char *pintype_table[] = {
- "bit", "float", "u32", "s32",
+ "bool", "real", "uint", "sint",
NULL
};
@@ -120,14 +120,14 @@ static char **completion_matches_table(const char *text, const char **table, hal
static hal_type_t match_type = -1;
static int match_writers = -1;
-static hal_pin_dir_t match_direction = HAL_DIR_UNSPECIFIED;
+static hal_pdir_t match_direction = HAL_DIR_UNSPECIFIED;
-static int direction_match(hal_pin_dir_t dir1, hal_pin_dir_t dir2) {
+static int direction_match(hal_pdir_t dir1, hal_pdir_t dir2) {
if(dir1 == HAL_DIR_UNSPECIFIED || dir2 == -1) return 1;
return (dir1 | dir2) == HAL_IO;
}
-static int writer_match(hal_pin_dir_t dir, int writers) {
+static int writer_match(hal_pdir_t dir, int writers) {
if(writers == -1 || dir == -1) return 1;
if(dir & HAL_IN || writers == 0) return 1;
return 0;
diff --git a/src/hal/utils/halcompile.g b/src/hal/utils/halcompile.g
index 2690dc61df7..32aa408da56 100644
--- a/src/hal/utils/halcompile.g
+++ b/src/hal/utils/halcompile.g
@@ -41,6 +41,7 @@ parser Hal:
rule Declaration:
"pin" PINDIRECTION TYPE HALNAME OptArray OptSAssign OptPersonality OptString ";" {{ pin(HALNAME, TYPE, OptArray, PINDIRECTION, OptString, OptSAssign, OptPersonality) }}
| "param" PARAMDIRECTION TYPE HALNAME OptArray OptSAssign OptPersonality OptString ";" {{ param(HALNAME, TYPE, OptArray, PARAMDIRECTION, OptString, OptSAssign, OptPersonality) }}
+ | "alias" HALNAME OptArray {{ ppname = HALNAME; pparr = OptArray }} HALNAME OptArray ";" {{ alias(ppname, pparr, HALNAME, OptArray) }}
| "function" NAME OptFP OptString ";" {{ function(NAME, OptFP, OptString) }}
| "variable" NAME STARREDNAME OptSimpleArray OptAssign ";" {{ variable(NAME, STARREDNAME, OptSimpleArray, OptAssign) }}
| "option" NAME OptValue ";" {{ option(NAME, OptValue) }}
@@ -150,17 +151,27 @@ def parse(filename):
return a, b
dirmap = {'r': 'HAL_RO', 'rw': 'HAL_RW', 'in': 'HAL_IN', 'out': 'HAL_OUT', 'io': 'HAL_IO' }
-typemap = {'signed': 's32', 'unsigned': 'u32'}
-deprmap = {'s32': 'signed', 'u32': 'unsigned'}
-deprecated = ['s32', 'u32']
+# Using any in the typemap will result in a warning
+typemap = {
+ "bit": "bool",
+ "float": "real",
+ "s32": "si32",
+ "signed": "si32",
+ "u32": "ui32",
+ "unsigned": "ui32",
+ "s64": "sint",
+ "u64": "uint" }
newtypes = ['bool', 'sint', 'uint', 'si32', 'ui32', 'real']
+
def initialize():
global functions, params, pins, comp_name, names, docs, variables
global modparams, includes
+ global aliases
functions = []; params = []; pins = []; options = {}; variables = []
modparams = []; docs = []; includes = [];
+ aliases = {}
comp_name = None
names = {}
@@ -169,11 +180,15 @@ def Warn(msg, *args):
if args:
msg = msg % args
print("%s:%d: Warning: %s" % (S.filename, S.line, msg), file=sys.stderr)
+ if warn_is_error:
+ sys.exit(1)
def Error(msg, *args):
if args:
msg = msg % args
- raise runtime.SyntaxError(S.get_pos(), msg, None)
+ print("%s:%d: Error: %s" % (S.filename, S.line, msg), file=sys.stderr)
+ sys.exit(1)
+ #raise runtime.SyntaxError(S.get_pos(), msg, None)
def optfp_warn(state):
s = "nofp" if 0 == state else "fp"
@@ -208,8 +223,10 @@ def notes(doc):
docs.append(('notes', doc));
def type2type(type_):
- # When we start warning about s32/u32 this is where the warning goes
- return typemap.get(type_, type_)
+ if type_ in typemap:
+ Warn(f"Old type '{type_}' has been replaced by '{typemap[type_]}'")
+ return typemap[type_]
+ return type_
def checkarray(name, array):
hashes = len(re.findall("#+", name))
@@ -230,21 +247,39 @@ def pin(name, type_, array, dir_, doc, value, personality):
type_ = type2type(type_)
check_name_ok(name)
docs.append(('pin', name, type_, array, dir_, doc, value, personality))
- names[name] = None
+ names[name] = 'pin'
pins.append((name, type_, array, dir_, value, personality))
def param(name, type_, array, dir_, doc, value, personality):
+ if 'port' == type_:
+ Error("Parameters cannot be of type 'port'")
checkarray(name, array)
type_ = type2type(type_)
check_name_ok(name)
docs.append(('param', name, type_, array, dir_, doc, value, personality))
- names[name] = None
+ names[name] = 'param'
params.append((name, type_, array, dir_, value, personality))
+def alias(name, namearr, aliasname, aliasarr):
+ if namearr != aliasarr:
+ Error(f"Alias arrays for pin '{namearr}' != '{aliasarr}'")
+ checkarray(name, namearr)
+ checkarray(aliasname, aliasarr)
+ if aliasname in names:
+ Error(f"Alias name '{aliasname}' already in use")
+ if name not in names:
+ Error(f"Pin/param name '{name}' not found, cannot alias")
+ if name in aliases:
+ Error(f"Alias for pin/param '{name}' already exists as '{aliases[name][2]}'")
+ if names[name] not in ('pin', 'param'):
+ Error(f"Expected '{name}' to be pin or param, but got '{names[name]}'");
+ aliases[name] = (name, namearr, aliasname, aliasarr, names[name])
+ names[aliasname] = 'alias' # Must register to prevent collision
+
def function(name, fp, doc):
check_name_ok(name)
docs.append(('funct', name, fp, doc))
- names[name] = None
+ names[name] = 'function'
functions.append((name, fp))
def option(name, value):
@@ -254,12 +289,12 @@ def option(name, value):
def variable(type_, name, array, default):
check_name_ok(name)
- names[name] = None
+ names[name] = 'variable'
variables.append((type_, name, array, default))
def modparam(type_, name, default, doc):
check_name_ok(name)
- names[name] = None
+ names[name] = 'modparam'
modparams.append((type_, name, default, doc))
def include(value):
@@ -350,7 +385,7 @@ static int comp_id;
print(" int _personality;", file=f)
for name, type_, array, dir_, value, personality in pins:
- star = '' if type_ in newtypes else '*'
+ star = '' if type_ in newtypes or 'port' == type_ else '*'
if array:
if isinstance(array, tuple): array = array[0]
print(" hal_%s_t %s%s_p[%s];" % (to_t(type_), star, to_c(name), array), file=f)
@@ -457,6 +492,9 @@ static int comp_id;
dflt = "%s" % value if value is not None else "0"
print(" r = hal_pin_new_%s(comp_id, %s, &(inst->%s_p[j]), %s," % (
type_, dirmap[dir_], to_c(name), dflt), file=f)
+ elif 'port' == type_:
+ print(" r = hal_pin_new_%s(comp_id, %s, &(inst->%s_p[j])," % (
+ type_, dirmap[dir_], to_c(name)), file=f)
else:
print(" r = hal_pin_%s_newf(%s, &(inst->%s_p[j]), comp_id," % (
type_, dirmap[dir_], to_c(name)), file=f)
@@ -470,6 +508,10 @@ static int comp_id;
dflt = "%s" % value if value is not None else "0"
print(" r = hal_pin_new_%s(comp_id, %s, &(inst->%s_p), %s," % (
type_, dirmap[dir_], to_c(name), dflt), file=f)
+ elif 'port' == type_:
+ dflt = "%s" % value if value is not None else "0"
+ print(" r = hal_pin_new_%s(comp_id, %s, &(inst->%s_p)," % (
+ type_, dirmap[dir_], to_c(name)), file=f)
else:
print(" r = hal_pin_%s_newf(%s, &(inst->%s_p), comp_id," % (
type_, dirmap[dir_], to_c(name)), file=f)
@@ -522,6 +564,35 @@ static int comp_id;
if personality:
print("}", file=f)
+ if len(aliases) > 0:
+ print(" {", file=f)
+ print(" char pinname[HAL_NAME_LEN+1], alsname[HAL_NAME_LEN+1];", file=f)
+ for k, v in aliases.items():
+ name, namearr, aliasname, aliasarr, nametype = v
+ if isinstance(array, tuple):
+ lim, cnt = array
+ print(" if((%s) > (%s)) {" % (cnt, lim), file=f)
+ print(' rtapi_print_msg(RTAPI_MSG_ERR,' \
+ '"Alias %s: Requested size %%d exceeds max size %%d\\n",'
+ '(int)(%s), (int)(%s));' % (name, cnt, lim), file=f)
+ print(" return -ENOSPC;", file=f)
+ print(" }", file=f)
+ else:
+ cnt = array
+ if namearr:
+ print( " for(j = 0; j < (%s); j++) {" % cnt, file=f)
+ print(f" rtapi_snprintf(pinname, sizeof(pinname), \"%s.{to_hal(name)}\", prefix, j);", file=f)
+ print(f" rtapi_snprintf(alsname, sizeof(alsname), \"%s.{to_hal(aliasname)}\", prefix, j);", file=f)
+ print(f" r = {nametype}(pinname, alsname);", file=f)
+ print( " if(r != 0) return r;", file=f)
+ print( " }" % cnt, file=f)
+ else:
+ print(f" rtapi_snprintf(pinname, sizeof(pinname), \"%s.{to_hal(name)}\", prefix);", file=f)
+ print(f" rtapi_snprintf(alsname, sizeof(alsname), \"%s.{to_hal(aliasname)}\", prefix);", file=f)
+ print(f" r = hal_{nametype}_alias(pinname, alsname);", file=f)
+ print( " if(r != 0) return r;", file=f)
+ print(" }", file=f)
+
for type_, name, array, value in variables:
if value is None: continue
if array:
@@ -1333,6 +1404,8 @@ def main():
require_license = True
global require_unix_line_endings
require_unix_line_endings = False
+ global warn_is_error
+ warn_is_error = False
mode = PREPROCESS
adoc = False
keepadoc = None
@@ -1341,12 +1414,12 @@ def main():
global options
options = {}
try:
- opts, args = getopt.getopt(sys.argv[1:], "UluijJcpdak:o:h?P:",
+ opts, args = getopt.getopt(sys.argv[1:], "UluijJcpdak:o:h?P:w",
['unix', 'install', 'compile', 'preprocess', 'outfile=',
'document', 'adoc', 'keep-adoc=', 'help', 'userspace', 'install-doc',
'view-doc', 'require-license', 'print-modinc',
'personalities=', "extra-compile-args=",
- 'extra-link-args='])
+ 'extra-link-args=', 'werror'])
except getopt.GetoptError:
usage(1)
for k, v in opts:
@@ -1393,6 +1466,8 @@ def main():
option("extra_link_args", v)
if k in ("-?", "-h", "--help"):
usage(0)
+ if k in ("-w", "--werror"):
+ warn_is_error = True
if outfile and mode != PREPROCESS and mode != DOCUMENT:
raise SystemExit("Can only specify -o when preprocessing or documenting")
diff --git a/src/hal/utils/halrmt.cc b/src/hal/utils/halrmt.cc
index 821d4db2329..a4071eb4f8b 100644
--- a/src/hal/utils/halrmt.cc
+++ b/src/hal/utils/halrmt.cc
@@ -366,8 +366,6 @@ static const char *data_type(hal_type_t type)
switch (type) {
case HAL_BOOL: return "bool ";
case HAL_REAL: return "real ";
- case HAL_S32: return "s32 ";
- case HAL_U32: return "u32 ";
case HAL_SINT: return "sint ";
case HAL_UINT: return "uint ";
case HAL_PORT: return "port ";
@@ -424,9 +422,7 @@ static std::string data_value(hal_type_t type, hal_query_value_u val)
case HAL_BOOL: return val.b ? " TRUE" : " FALSE";
case HAL_REAL: return fmt::format("{:12.7g}", val.r);
case HAL_PORT: // FIXME
- case HAL_S32:
case HAL_SINT: return fmt::format(" {:10d}", val.s);
- case HAL_U32:
case HAL_UINT: return fmt::format(" {:08X}", val.u);
default: return " undef ";
}
@@ -438,9 +434,7 @@ static std::string data_value2(hal_type_t type, hal_query_value_u val)
case HAL_BOOL: return val.b ? "TRUE" : "FALSE";
case HAL_REAL: return fmt::format("{:.7g}", val.r);
case HAL_PORT: // FIXME
- case HAL_S32:
case HAL_SINT: return fmt::format("{}", val.s);
- case HAL_U32:
case HAL_UINT: return fmt::format("{}", val.u);
default: return "unknown_type";
}
@@ -2101,10 +2095,10 @@ static hal_type_t haltype_from_str(const std::string &str)
{ "bool", HAL_BOOL },
{ "float", HAL_REAL },
{ "real", HAL_REAL },
- { "s32", HAL_S32 },
+ { "s32", HAL_SINT },
{ "s64", HAL_SINT },
{ "sint", HAL_SINT },
- { "u32", HAL_U32 },
+ { "u32", HAL_UINT },
{ "u64", HAL_UINT },
{ "uint", HAL_UINT },
};
diff --git a/src/hal/utils/halsh.c b/src/hal/utils/halsh.c
index e0e4d70591c..38ba87dc461 100644
--- a/src/hal/utils/halsh.c
+++ b/src/hal/utils/halsh.c
@@ -111,13 +111,11 @@ static int halsh_format_one(Tcl_Interp *interp,
hal_stream_data_u v) {
char buf[64];
switch(hal_stream_element_type(s, idx)) {
- case HAL_BIT: snprintf(buf, sizeof(buf), "%d", v.b ? 1 : 0); break;
- case HAL_FLOAT: snprintf(buf, sizeof(buf), "%g", v.f); break;
- case HAL_S32: snprintf(buf, sizeof(buf), "%lld", (long long)v.s); break;
- case HAL_U32: snprintf(buf, sizeof(buf), "%llu", (unsigned long long)v.u); break;
- case HAL_S64: snprintf(buf, sizeof(buf), "%lld", (long long)v.l); break;
- case HAL_U64: snprintf(buf, sizeof(buf), "%llu", (unsigned long long)v.k); break;
- default: snprintf(buf, sizeof(buf), "0"); break;
+ case HAL_BOOL: snprintf(buf, sizeof(buf), "%d", v.b ? 1 : 0); break;
+ case HAL_REAL: snprintf(buf, sizeof(buf), "%g", v.f); break;
+ case HAL_SINT: snprintf(buf, sizeof(buf), "%lld", (long long)v.l); break;
+ case HAL_UINT: snprintf(buf, sizeof(buf), "%llu", (unsigned long long)v.k); break;
+ default: snprintf(buf, sizeof(buf), "0"); break;
}
Tcl_AppendElement(interp, buf);
return TCL_OK;
diff --git a/src/hal/utils/meter.c b/src/hal/utils/meter.c
index e371379955c..967ef4fce97 100644
--- a/src/hal/utils/meter.c
+++ b/src/hal/utils/meter.c
@@ -543,16 +543,6 @@ static const char *data_value(hal_type_t type, hal_refs_u ref)
snprintf(buf, sizeof(buf), "%.7g", (double)hal_get_real(ref.r));
value_str = buf;
break;
- case HAL_S32:
- snprintf(buf, sizeof(buf), "%10ld", (long)hal_get_si32(ref.s));
- value_str = buf;
- break;
- case HAL_U32: {
- unsigned long v = hal_get_ui32(ref.u);
- snprintf(buf, sizeof(buf), "%10lu (0x%08lX)", v, v);
- value_str = buf;
- }
- break;
case HAL_SINT:
snprintf(buf, sizeof(buf), "%10lld", (long long)hal_get_sint(ref.s));
value_str = buf;
diff --git a/src/hal/utils/scope_disp.c b/src/hal/utils/scope_disp.c
index 4953b697048..b243e9c554c 100644
--- a/src/hal/utils/scope_disp.c
+++ b/src/hal/utils/scope_disp.c
@@ -163,12 +163,6 @@ static void calculate_offset(int chan_num) {
case HAL_REAL:
value = dptr->r;
break;
- case HAL_S32:
- value = dptr->s;
- break;
- case HAL_U32:
- value = dptr->u;
- break;
case HAL_SINT:
value = dptr->s;
break;
@@ -828,12 +822,6 @@ void draw_waveform(int chan_num, int highlight)
case HAL_REAL:
fy = dptr->r;
break;
- case HAL_S32:
- fy = dptr->s;
- break;
- case HAL_U32:
- fy = dptr->u;
- break;
case HAL_SINT:
fy = dptr->s;
break;
diff --git a/src/hal/utils/scope_files.c b/src/hal/utils/scope_files.c
index 199f37c7f27..19daacb400a 100644
--- a/src/hal/utils/scope_files.c
+++ b/src/hal/utils/scope_files.c
@@ -628,13 +628,11 @@ void read_log_file(char *filename)
chan->min_index = -36;
chan->max_index = 36;
break;
- case HAL_S32:
case HAL_SINT:
chan->data_len = sizeof(scope_data_t);
chan->min_index = -2;
chan->max_index = 30;
break;
- case HAL_U32:
case HAL_UINT:
chan->data_len = sizeof(scope_data_t);
chan->min_index = -2;
@@ -753,12 +751,6 @@ void read_log_file(char *filename)
case HAL_REAL:
dptr->r = (rtapi_real)value;
break;
- case HAL_S32:
- dptr->s = (rtapi_s32)value;
- break;
- case HAL_U32:
- dptr->u = (rtapi_u32)value;
- break;
case HAL_SINT:
dptr->s = (rtapi_sint)value;
break;
@@ -846,12 +838,6 @@ static void write_sample(FILE *fp, scope_data_t *dptr, hal_type_t type)
case HAL_REAL:
data_value = dptr->r;
break;
- case HAL_S32:
- data_value = dptr->s;
- break;
- case HAL_U32:
- data_value = dptr->u;
- break;
case HAL_SINT:
data_value = dptr->s;
break;
diff --git a/src/hal/utils/scope_rt.c b/src/hal/utils/scope_rt.c
index cb3aca04b17..e7867231de0 100644
--- a/src/hal/utils/scope_rt.c
+++ b/src/hal/utils/scope_rt.c
@@ -266,8 +266,6 @@ static void capture_sample(void)
continue;
switch(ctrl_rt->data_type[n]) {
case HAL_BOOL: dest->b = hal_get_bool(ctrl_rt->data_addr[n].b); dest++; break;
- case HAL_S32: dest->s = hal_get_si32(ctrl_rt->data_addr[n].s); dest++; break;
- case HAL_U32: dest->u = hal_get_ui32(ctrl_rt->data_addr[n].u); dest++; break;
case HAL_SINT: dest->s = hal_get_sint(ctrl_rt->data_addr[n].s); dest++; break;
case HAL_UINT: dest->u = hal_get_uint(ctrl_rt->data_addr[n].u); dest++; break;
case HAL_REAL: dest->r = hal_get_real(ctrl_rt->data_addr[n].r); dest++; break;
@@ -316,15 +314,9 @@ static int check_trigger(void)
case HAL_BOOL:
compare_result = hal_get_bool(ctrl_rt->data_addr[ctrl_shm->trig_chan - 1].b);
break;
- case HAL_S32:
- compare_result = hal_get_si32(ctrl_rt->data_addr[ctrl_shm->trig_chan - 1].s) > level->s;
- break;
case HAL_SINT:
compare_result = hal_get_sint(ctrl_rt->data_addr[ctrl_shm->trig_chan - 1].s) > level->s;
break;
- case HAL_U32:
- compare_result = hal_get_ui32(ctrl_rt->data_addr[ctrl_shm->trig_chan - 1].u) > level->u;
- break;
case HAL_UINT:
compare_result = hal_get_uint(ctrl_rt->data_addr[ctrl_shm->trig_chan - 1].u) > level->u;
break;
diff --git a/src/hal/utils/scope_trig.c b/src/hal/utils/scope_trig.c
index 68d436ed783..3211e13b18a 100644
--- a/src/hal/utils/scope_trig.c
+++ b/src/hal/utils/scope_trig.c
@@ -137,24 +137,6 @@ void refresh_trigger(void)
case HAL_REAL:
ctrl_shm->trig_level.r = fp_level;
break;
- case HAL_S32:
- if (fp_level > (rtapi_real)RTAPI_INT32_MAX) {
- fp_level = (rtapi_real)RTAPI_INT32_MAX;
- }
- if (fp_level < (rtapi_real)RTAPI_INT32_MIN) {
- fp_level = (rtapi_real)RTAPI_INT32_MIN;
- }
- ctrl_shm->trig_level.s = fp_level;
- break;
- case HAL_U32:
- if (fp_level > (rtapi_real)RTAPI_UINT32_MAX) {
- fp_level = (rtapi_real)RTAPI_UINT32_MAX;
- }
- if (fp_level < 0.0) {
- fp_level = 0.0;
- }
- ctrl_shm->trig_level.u = fp_level;
- break;
case HAL_SINT:
if (fp_level > (rtapi_real)RTAPI_SINT_MAX) {
fp_level = (rtapi_real)RTAPI_SINT_MAX;
diff --git a/src/hal/utils/scope_vert.c b/src/hal/utils/scope_vert.c
index daddb16b3c8..120777ca819 100644
--- a/src/hal/utils/scope_vert.c
+++ b/src/hal/utils/scope_vert.c
@@ -255,13 +255,11 @@ int set_channel_source(int chan_num, int type, char *name)
chan->min_index = -36;
chan->max_index = 36;
break;
- case HAL_S32:
case HAL_SINT:
chan->data_len = sizeof(scope_data_t);
chan->min_index = -2;
chan->max_index = 30;
break;
- case HAL_U32:
case HAL_UINT:
chan->data_len = sizeof(scope_data_t);
chan->min_index = -2;
diff --git a/tcl/bin/halshow.tcl b/tcl/bin/halshow.tcl
index 1c8bde45c17..3b7cd81e5c6 100755
--- a/tcl/bin/halshow.tcl
+++ b/tcl/bin/halshow.tcl
@@ -957,7 +957,7 @@ proc watchHAL {which} {
$::cisp create text $::col1_width [expr $i * 20 + 13] -text $label \
-anchor w -tag $label -fill $labelcolor
set canvaswidth [winfo width $::cisp]
- if {$type == "bit"} {
+ if {$type == "bit" || $type == "bool"} {
$::cisp create oval 10 [expr $i * 20 + 5] 25 [expr $i * 20 + 20] \
-fill lightgray -tag oval$i
if {$writable == 1} {
@@ -1279,7 +1279,9 @@ proc refreshItem {cnum vartype varname} {
} else {
switch $varnumtype {
u32 - s32 {set varnumtype int}
+ uint - sint {set varnumtype int}
float {set varnumtype float}
+ real {set varnumtype float}
}
if [catch { set value [expr $ret] } ] {
set value $ret ;# allow display of a nan
diff --git a/tests/abort/on_abort_command-crazy-move/test-ui.py b/tests/abort/on_abort_command-crazy-move/test-ui.py
index 85a5e32255d..0fd8c1dc559 100755
--- a/tests/abort/on_abort_command-crazy-move/test-ui.py
+++ b/tests/abort/on_abort_command-crazy-move/test-ui.py
@@ -27,8 +27,8 @@
# Create and connect test feedback comp
#
h = hal.component("test-ui")
-h.newpin("Xpos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("Ypos", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("Xpos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("Ypos", hal.Type.REAL, hal.Dir.IN)
h.ready()
os.system("halcmd source ./postgui.hal")
diff --git a/tests/abort/stop-button-crazy-move/test-ui.py b/tests/abort/stop-button-crazy-move/test-ui.py
index 897c56e4926..839940e1e26 100755
--- a/tests/abort/stop-button-crazy-move/test-ui.py
+++ b/tests/abort/stop-button-crazy-move/test-ui.py
@@ -26,8 +26,8 @@
# Create and connect test feedback comp
#
h = hal.component("test-ui")
-h.newpin("Xpos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("Ypos", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("Xpos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("Ypos", hal.Type.REAL, hal.Dir.IN)
h.ready()
os.system("halcmd source ./postgui.hal")
diff --git a/tests/classicladder/estop/classicladder-estop-ui.py b/tests/classicladder/estop/classicladder-estop-ui.py
index 3f0f0ee859e..a579bb3b5d0 100755
--- a/tests/classicladder/estop/classicladder-estop-ui.py
+++ b/tests/classicladder/estop/classicladder-estop-ui.py
@@ -23,7 +23,7 @@ def wait_for_hal_pin(name, value, timeout=10):
retval = 0
h = hal.component("python-ui")
-h.newpin("ext-estop-button", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("ext-estop-button", hal.Type.BOOL, hal.Dir.OUT)
h.ready() # mark the component as 'ready'
hal.connect('python-ui.ext-estop-button', 'ext-estop')
diff --git a/tests/hal-backslash/expected b/tests/hal-backslash/expected
index 9f41ddd057f..a2315b700b5 100644
--- a/tests/hal-backslash/expected
+++ b/tests/hal-backslash/expected
@@ -1,4 +1,4 @@
Signals:
Type Value Name (linked to)
-bit TRUE hello
+bool TRUE hello
diff --git a/tests/hal-link-unlink/hallink.py b/tests/hal-link-unlink/hallink.py
index 3ce6e9eee37..59587b60a2a 100755
--- a/tests/hal-link-unlink/hallink.py
+++ b/tests/hal-link-unlink/hallink.py
@@ -7,8 +7,8 @@ def cmd(arg):
subprocess.call(arg, shell=True)
h = hal.component("linktest")
-h.newpin("in", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("inout", hal.HAL_FLOAT, hal.HAL_IO)
+h.newpin("in", hal.Type.REAL, hal.Dir.IN)
+h.newpin("inout", hal.Type.REAL, hal.Dir.IO)
h.ready()
# set pin values before linking
diff --git a/tests/hal-show/expected b/tests/hal-show/expected
index 7ecb4551e21..dd41b0cf1e4 100644
--- a/tests/hal-show/expected
+++ b/tests/hal-show/expected
@@ -1,72 +1,72 @@
Component Pins:
Owner Type Dir Value Name
- 10 bit IN FALSE conv-bit-u32.0.in <== net-conv-bit-u32.0.in
- 16 float IN 0 conv-float-s32.0.in <== net-conv-float-s32.0.in
- 19 s32 IN 0 conv-s32-float.0.in <== net-conv-s32-float.0.in
- 22 s64 IN 0 conv-s64-u64.0.in <== net-conv-s64-u64.0.in
- 13 u32 IN 0x00000000 conv-u32-bit.0.in <== net-conv-u32-bit.0.in
- 25 u64 IN 0x0000000000000000 conv-u64-s64.0.in <== net-conv-u64-s64.0.in
+ 10 bool IN FALSE conv-bool-uint.0.in <== net-conv-bool-uint.0.in
+ 16 real IN 0 conv-real-sint.0.in <== net-conv-real-sint.0.in
+ 19 sint IN 0 conv-sint-real.0.in <== net-conv-sint-real.0.in
+ 22 sint IN 0 conv-sint-uint.0.in <== net-conv-sint-uint.0.in
+ 13 uint IN 0x0000000000000000 conv-uint-bool.0.in <== net-conv-uint-bool.0.in
+ 25 uint IN 0x0000000000000000 conv-uint-sint.0.in <== net-conv-uint-sint.0.in
Signals:
Type Value Name (linked to)
-bit FALSE net-conv-bit-u32.0.in
- ==> conv-bit-u32.0.in
-u32 0x00000000 net-conv-bit-u32.0.out
- <== conv-bit-u32.0.out
-float 0 net-conv-float-s32.0.in
- ==> conv-float-s32.0.in
-s32 0 net-conv-float-s32.0.out
- <== conv-float-s32.0.out
-s32 0 net-conv-s32-float.0.in
- ==> conv-s32-float.0.in
-float 0 net-conv-s32-float.0.out
- <== conv-s32-float.0.out
-s64 0 net-conv-s64-u64.0.in
- ==> conv-s64-u64.0.in
-u64 0x0000000000000000 net-conv-s64-u64.0.out
- <== conv-s64-u64.0.out
-u32 0x00000000 net-conv-u32-bit.0.in
- ==> conv-u32-bit.0.in
-bit FALSE net-conv-u32-bit.0.out
- <== conv-u32-bit.0.out
-u64 0x0000000000000000 net-conv-u64-s64.0.in
- ==> conv-u64-s64.0.in
-s64 0 net-conv-u64-s64.0.out
- <== conv-u64-s64.0.out
+bool FALSE net-conv-bool-uint.0.in
+ ==> conv-bool-uint.0.in
+uint 0x0000000000000000 net-conv-bool-uint.0.out
+ <== conv-bool-uint.0.out
+real 0 net-conv-real-sint.0.in
+ ==> conv-real-sint.0.in
+sint 0 net-conv-real-sint.0.out
+ <== conv-real-sint.0.out
+sint 0 net-conv-sint-real.0.in
+ ==> conv-sint-real.0.in
+real 0 net-conv-sint-real.0.out
+ <== conv-sint-real.0.out
+sint 0 net-conv-sint-uint.0.in
+ ==> conv-sint-uint.0.in
+uint 0x0000000000000000 net-conv-sint-uint.0.out
+ <== conv-sint-uint.0.out
+uint 0x0000000000000000 net-conv-uint-bool.0.in
+ ==> conv-uint-bool.0.in
+bool FALSE net-conv-uint-bool.0.out
+ <== conv-uint-bool.0.out
+uint 0x0000000000000000 net-conv-uint-sint.0.in
+ ==> conv-uint-sint.0.in
+sint 0 net-conv-uint-sint.0.out
+ <== conv-uint-sint.0.out
Component Pins:
Owner Type Dir Value Name
- 10 bit IN TRUE conv-bit-u32.0.in <== net-conv-bit-u32.0.in
- 16 float IN 2.147484e+09 conv-float-s32.0.in <== net-conv-float-s32.0.in
- 19 s32 IN -2147483648 conv-s32-float.0.in <== net-conv-s32-float.0.in
- 22 s64 IN -9223372036854775808 conv-s64-u64.0.in <== net-conv-s64-u64.0.in
- 13 u32 IN 0xFFFFFFFF conv-u32-bit.0.in <== net-conv-u32-bit.0.in
- 25 u64 IN 0xFFFFFFFFFFFFFFFF conv-u64-s64.0.in <== net-conv-u64-s64.0.in
+ 10 bool IN TRUE conv-bool-uint.0.in <== net-conv-bool-uint.0.in
+ 16 real IN 2.147484e+09 conv-real-sint.0.in <== net-conv-real-sint.0.in
+ 19 sint IN -2147483648 conv-sint-real.0.in <== net-conv-sint-real.0.in
+ 22 sint IN -9223372036854775808 conv-sint-uint.0.in <== net-conv-sint-uint.0.in
+ 13 uint IN 0x00000000FFFFFFFF conv-uint-bool.0.in <== net-conv-uint-bool.0.in
+ 25 uint IN 0xFFFFFFFFFFFFFFFF conv-uint-sint.0.in <== net-conv-uint-sint.0.in
Signals:
Type Value Name (linked to)
-bit TRUE net-conv-bit-u32.0.in
- ==> conv-bit-u32.0.in
-u32 0x00000001 net-conv-bit-u32.0.out
- <== conv-bit-u32.0.out
-float 2.147484e+09 net-conv-float-s32.0.in
- ==> conv-float-s32.0.in
-s32 2147483647 net-conv-float-s32.0.out
- <== conv-float-s32.0.out
-s32 -2147483648 net-conv-s32-float.0.in
- ==> conv-s32-float.0.in
-float -2.147484e+09 net-conv-s32-float.0.out
- <== conv-s32-float.0.out
-s64 -9223372036854775808 net-conv-s64-u64.0.in
- ==> conv-s64-u64.0.in
-u64 0x8000000000000000 net-conv-s64-u64.0.out
- <== conv-s64-u64.0.out
-u32 0xFFFFFFFF net-conv-u32-bit.0.in
- ==> conv-u32-bit.0.in
-bit TRUE net-conv-u32-bit.0.out
- <== conv-u32-bit.0.out
-u64 0xFFFFFFFFFFFFFFFF net-conv-u64-s64.0.in
- ==> conv-u64-s64.0.in
-s64 -1 net-conv-u64-s64.0.out
- <== conv-u64-s64.0.out
+bool TRUE net-conv-bool-uint.0.in
+ ==> conv-bool-uint.0.in
+uint 0x0000000000000001 net-conv-bool-uint.0.out
+ <== conv-bool-uint.0.out
+real 2.147484e+09 net-conv-real-sint.0.in
+ ==> conv-real-sint.0.in
+sint 2147483647 net-conv-real-sint.0.out
+ <== conv-real-sint.0.out
+sint -2147483648 net-conv-sint-real.0.in
+ ==> conv-sint-real.0.in
+real -2.147484e+09 net-conv-sint-real.0.out
+ <== conv-sint-real.0.out
+sint -9223372036854775808 net-conv-sint-uint.0.in
+ ==> conv-sint-uint.0.in
+uint 0x8000000000000000 net-conv-sint-uint.0.out
+ <== conv-sint-uint.0.out
+uint 0x00000000FFFFFFFF net-conv-uint-bool.0.in
+ ==> conv-uint-bool.0.in
+bool TRUE net-conv-uint-bool.0.out
+ <== conv-uint-bool.0.out
+uint 0xFFFFFFFFFFFFFFFF net-conv-uint-sint.0.in
+ ==> conv-uint-sint.0.in
+sint -1 net-conv-uint-sint.0.out
+ <== conv-uint-sint.0.out
diff --git a/tests/hal-show/test.hal b/tests/hal-show/test.hal
index bbc57afd9ed..3b8fa61638b 100644
--- a/tests/hal-show/test.hal
+++ b/tests/hal-show/test.hal
@@ -1,52 +1,46 @@
# This should print every data type as input and output
loadrt threads
-loadrt conv_bit_u32 count=1
-loadrt conv_u32_bit count=1
-loadrt conv_float_s32 count=1
-loadrt conv_s32_float count=1
-loadrt conv_s64_u64 count=1
-loadrt conv_u64_s64 count=1
-
-addf conv-bit-u32.0 thread1
-addf conv-u32-bit.0 thread1
-addf conv-float-s32.0 thread1
-addf conv-s32-float.0 thread1
-addf conv-s64-u64.0 thread1
-addf conv-u64-s64.0 thread1
-
-net net-conv-float-s32.0.in conv-float-s32.0.in
-net net-conv-float-s32.0.out conv-float-s32.0.out
-net net-conv-s32-float.0.in conv-s32-float.0.in
-net net-conv-s32-float.0.out conv-s32-float.0.out
-net net-conv-bit-u32.0.in conv-bit-u32.0.in
-net net-conv-bit-u32.0.out conv-bit-u32.0.out
-net net-conv-s64-u64.0.in conv-s64-u64.0.in
-net net-conv-s64-u64.0.out conv-s64-u64.0.out
-net net-conv-u32-bit.0.in conv-u32-bit.0.in
-net net-conv-u32-bit.0.out conv-u32-bit.0.out
-net net-conv-u64-s64.0.in conv-u64-s64.0.in
-net net-conv-u64-s64.0.out conv-u64-s64.0.out
+loadrt conv_bool_uint count=1
+loadrt conv_uint_bool count=1
+loadrt conv_real_sint count=1
+loadrt conv_sint_real count=1
+loadrt conv_sint_uint count=1
+loadrt conv_uint_sint count=1
+
+addf conv-bool-uint.0 thread1
+addf conv-uint-bool.0 thread1
+addf conv-real-sint.0 thread1
+addf conv-sint-real.0 thread1
+addf conv-sint-uint.0 thread1
+addf conv-uint-sint.0 thread1
+
+net net-conv-real-sint.0.in conv-real-sint.0.in
+net net-conv-real-sint.0.out conv-real-sint.0.out
+net net-conv-sint-real.0.in conv-sint-real.0.in
+net net-conv-sint-real.0.out conv-sint-real.0.out
+net net-conv-bool-uint.0.in conv-bool-uint.0.in
+net net-conv-bool-uint.0.out conv-bool-uint.0.out
+net net-conv-sint-uint.0.in conv-sint-uint.0.in
+net net-conv-sint-uint.0.out conv-sint-uint.0.out
+net net-conv-uint-bool.0.in conv-uint-bool.0.in
+net net-conv-uint-bool.0.out conv-uint-bool.0.out
+net net-conv-uint-sint.0.in conv-uint-sint.0.in
+net net-conv-uint-sint.0.out conv-uint-sint.0.out
start
loadusr -w sleep 0.1
show pin *.in
show sig
-sets net-conv-float-s32.0.in 2147483647
-sets net-conv-s32-float.0.in -2147483648
-sets net-conv-bit-u32.0.in 1
-sets net-conv-s64-u64.0.in -9223372036854775808
-sets net-conv-u32-bit.0.in 0xffffffff
-sets net-conv-u64-s64.0.in 0xffffffffffffffff
+sets net-conv-real-sint.0.in 2147483647
+sets net-conv-sint-real.0.in -2147483648
+sets net-conv-bool-uint.0.in 1
+sets net-conv-sint-uint.0.in -9223372036854775808
+sets net-conv-uint-bool.0.in 0xffffffff
+sets net-conv-uint-sint.0.in 0xffffffffffffffff
loadusr -w sleep 0.1
show pin *.in
show sig
-
-
-
-
-
-
diff --git a/tests/halcompile/personalities_mod/4count_2pers.expected b/tests/halcompile/personalities_mod/4count_2pers.expected
index 01f5bc56498..81aa9f66ad2 100644
--- a/tests/halcompile/personalities_mod/4count_2pers.expected
+++ b/tests/halcompile/personalities_mod/4count_2pers.expected
@@ -1,100 +1,100 @@
-bitslice_test u32 IN 0 bitslice-test.0.in
-bitslice_test bit OUT FALSE bitslice-test.0.out-00
-bitslice_test bit OUT FALSE bitslice-test.0.out-01
-bitslice_test s32 OUT 0 bitslice-test.0.time
-bitslice_test u32 IN 0 bitslice-test.1.in
-bitslice_test bit OUT FALSE bitslice-test.1.out-00
-bitslice_test bit OUT FALSE bitslice-test.1.out-01
-bitslice_test bit OUT FALSE bitslice-test.1.out-02
-bitslice_test s32 OUT 0 bitslice-test.1.time
-bitslice_test u32 IN 0 bitslice-test.2.in
-bitslice_test bit OUT FALSE bitslice-test.2.out-00
-bitslice_test bit OUT FALSE bitslice-test.2.out-01
-bitslice_test s32 OUT 0 bitslice-test.2.time
-bitslice_test u32 IN 0 bitslice-test.3.in
-bitslice_test bit OUT FALSE bitslice-test.3.out-00
-bitslice_test bit OUT FALSE bitslice-test.3.out-01
-bitslice_test bit OUT FALSE bitslice-test.3.out-02
-bitslice_test s32 OUT 0 bitslice-test.3.time
-lincurve_test float IN 0 lincurve-test.0.in
-lincurve_test float OUT 0 lincurve-test.0.out
-lincurve_test float I/O 0 lincurve-test.0.out-io
-lincurve_test s32 OUT 0 lincurve-test.0.time
-lincurve_test float IN 0 lincurve-test.1.in
-lincurve_test float OUT 0 lincurve-test.1.out
-lincurve_test float I/O 0 lincurve-test.1.out-io
-lincurve_test s32 OUT 0 lincurve-test.1.time
-lincurve_test float IN 0 lincurve-test.2.in
-lincurve_test float OUT 0 lincurve-test.2.out
-lincurve_test float I/O 0 lincurve-test.2.out-io
-lincurve_test s32 OUT 0 lincurve-test.2.time
-lincurve_test float IN 0 lincurve-test.3.in
-lincurve_test float OUT 0 lincurve-test.3.out
-lincurve_test float I/O 0 lincurve-test.3.out-io
-lincurve_test s32 OUT 0 lincurve-test.3.time
-logic_test bit OUT FALSE logic-test.0.and
-logic_test bit IN FALSE logic-test.0.in-00
-logic_test bit IN FALSE logic-test.0.in-01
-logic_test s32 OUT 0 logic-test.0.time
-logic_test bit IN FALSE logic-test.1.in-00
-logic_test bit IN FALSE logic-test.1.in-01
-logic_test bit IN FALSE logic-test.1.in-02
-logic_test bit IN FALSE logic-test.1.in-03
-logic_test bit OUT FALSE logic-test.1.or
-logic_test s32 OUT 0 logic-test.1.time
-logic_test bit OUT FALSE logic-test.2.and
-logic_test bit IN FALSE logic-test.2.in-00
-logic_test bit IN FALSE logic-test.2.in-01
-logic_test s32 OUT 0 logic-test.2.time
-logic_test bit IN FALSE logic-test.3.in-00
-logic_test bit IN FALSE logic-test.3.in-01
-logic_test bit IN FALSE logic-test.3.in-02
-logic_test bit IN FALSE logic-test.3.in-03
-logic_test bit OUT FALSE logic-test.3.or
-logic_test s32 OUT 0 logic-test.3.time
+bitslice_test uint IN 0 bitslice-test.0.in
+bitslice_test bool OUT FALSE bitslice-test.0.out-00
+bitslice_test bool OUT FALSE bitslice-test.0.out-01
+bitslice_test sint OUT 0 bitslice-test.0.time
+bitslice_test uint IN 0 bitslice-test.1.in
+bitslice_test bool OUT FALSE bitslice-test.1.out-00
+bitslice_test bool OUT FALSE bitslice-test.1.out-01
+bitslice_test bool OUT FALSE bitslice-test.1.out-02
+bitslice_test sint OUT 0 bitslice-test.1.time
+bitslice_test uint IN 0 bitslice-test.2.in
+bitslice_test bool OUT FALSE bitslice-test.2.out-00
+bitslice_test bool OUT FALSE bitslice-test.2.out-01
+bitslice_test sint OUT 0 bitslice-test.2.time
+bitslice_test uint IN 0 bitslice-test.3.in
+bitslice_test bool OUT FALSE bitslice-test.3.out-00
+bitslice_test bool OUT FALSE bitslice-test.3.out-01
+bitslice_test bool OUT FALSE bitslice-test.3.out-02
+bitslice_test sint OUT 0 bitslice-test.3.time
+lincurve_test real IN 0 lincurve-test.0.in
+lincurve_test real OUT 0 lincurve-test.0.out
+lincurve_test real I/O 0 lincurve-test.0.out-io
+lincurve_test sint OUT 0 lincurve-test.0.time
+lincurve_test real IN 0 lincurve-test.1.in
+lincurve_test real OUT 0 lincurve-test.1.out
+lincurve_test real I/O 0 lincurve-test.1.out-io
+lincurve_test sint OUT 0 lincurve-test.1.time
+lincurve_test real IN 0 lincurve-test.2.in
+lincurve_test real OUT 0 lincurve-test.2.out
+lincurve_test real I/O 0 lincurve-test.2.out-io
+lincurve_test sint OUT 0 lincurve-test.2.time
+lincurve_test real IN 0 lincurve-test.3.in
+lincurve_test real OUT 0 lincurve-test.3.out
+lincurve_test real I/O 0 lincurve-test.3.out-io
+lincurve_test sint OUT 0 lincurve-test.3.time
+logic_test bool OUT FALSE logic-test.0.and
+logic_test bool IN FALSE logic-test.0.in-00
+logic_test bool IN FALSE logic-test.0.in-01
+logic_test sint OUT 0 logic-test.0.time
+logic_test bool IN FALSE logic-test.1.in-00
+logic_test bool IN FALSE logic-test.1.in-01
+logic_test bool IN FALSE logic-test.1.in-02
+logic_test bool IN FALSE logic-test.1.in-03
+logic_test bool OUT FALSE logic-test.1.or
+logic_test sint OUT 0 logic-test.1.time
+logic_test bool OUT FALSE logic-test.2.and
+logic_test bool IN FALSE logic-test.2.in-00
+logic_test bool IN FALSE logic-test.2.in-01
+logic_test sint OUT 0 logic-test.2.time
+logic_test bool IN FALSE logic-test.3.in-00
+logic_test bool IN FALSE logic-test.3.in-01
+logic_test bool IN FALSE logic-test.3.in-02
+logic_test bool IN FALSE logic-test.3.in-03
+logic_test bool OUT FALSE logic-test.3.or
+logic_test sint OUT 0 logic-test.3.time
-bitslice_test s32 RW 0 bitslice-test.0.tmax
-bitslice_test bit RO FALSE bitslice-test.0.tmax-increased
-bitslice_test s32 RW 0 bitslice-test.1.tmax
-bitslice_test bit RO FALSE bitslice-test.1.tmax-increased
-bitslice_test s32 RW 0 bitslice-test.2.tmax
-bitslice_test bit RO FALSE bitslice-test.2.tmax-increased
-bitslice_test s32 RW 0 bitslice-test.3.tmax
-bitslice_test bit RO FALSE bitslice-test.3.tmax-increased
-lincurve_test s32 RW 0 lincurve-test.0.tmax
-lincurve_test bit RO FALSE lincurve-test.0.tmax-increased
-lincurve_test float RW 0 lincurve-test.0.x-val-00
-lincurve_test float RW 0 lincurve-test.0.x-val-01
-lincurve_test float RW 0 lincurve-test.0.y-val-00
-lincurve_test float RW 0 lincurve-test.0.y-val-01
-lincurve_test s32 RW 0 lincurve-test.1.tmax
-lincurve_test bit RO FALSE lincurve-test.1.tmax-increased
-lincurve_test float RW 0 lincurve-test.1.x-val-00
-lincurve_test float RW 0 lincurve-test.1.x-val-01
-lincurve_test float RW 0 lincurve-test.1.x-val-02
-lincurve_test float RW 0 lincurve-test.1.y-val-00
-lincurve_test float RW 0 lincurve-test.1.y-val-01
-lincurve_test float RW 0 lincurve-test.1.y-val-02
-lincurve_test s32 RW 0 lincurve-test.2.tmax
-lincurve_test bit RO FALSE lincurve-test.2.tmax-increased
-lincurve_test float RW 0 lincurve-test.2.x-val-00
-lincurve_test float RW 0 lincurve-test.2.x-val-01
-lincurve_test float RW 0 lincurve-test.2.y-val-00
-lincurve_test float RW 0 lincurve-test.2.y-val-01
-lincurve_test s32 RW 0 lincurve-test.3.tmax
-lincurve_test bit RO FALSE lincurve-test.3.tmax-increased
-lincurve_test float RW 0 lincurve-test.3.x-val-00
-lincurve_test float RW 0 lincurve-test.3.x-val-01
-lincurve_test float RW 0 lincurve-test.3.x-val-02
-lincurve_test float RW 0 lincurve-test.3.y-val-00
-lincurve_test float RW 0 lincurve-test.3.y-val-01
-lincurve_test float RW 0 lincurve-test.3.y-val-02
-logic_test s32 RW 0 logic-test.0.tmax
-logic_test bit RO FALSE logic-test.0.tmax-increased
-logic_test s32 RW 0 logic-test.1.tmax
-logic_test bit RO FALSE logic-test.1.tmax-increased
-logic_test s32 RW 0 logic-test.2.tmax
-logic_test bit RO FALSE logic-test.2.tmax-increased
-logic_test s32 RW 0 logic-test.3.tmax
-logic_test bit RO FALSE logic-test.3.tmax-increased
+bitslice_test sint RW 0 bitslice-test.0.tmax
+bitslice_test bool RO FALSE bitslice-test.0.tmax-increased
+bitslice_test sint RW 0 bitslice-test.1.tmax
+bitslice_test bool RO FALSE bitslice-test.1.tmax-increased
+bitslice_test sint RW 0 bitslice-test.2.tmax
+bitslice_test bool RO FALSE bitslice-test.2.tmax-increased
+bitslice_test sint RW 0 bitslice-test.3.tmax
+bitslice_test bool RO FALSE bitslice-test.3.tmax-increased
+lincurve_test sint RW 0 lincurve-test.0.tmax
+lincurve_test bool RO FALSE lincurve-test.0.tmax-increased
+lincurve_test real RW 0 lincurve-test.0.x-val-00
+lincurve_test real RW 0 lincurve-test.0.x-val-01
+lincurve_test real RW 0 lincurve-test.0.y-val-00
+lincurve_test real RW 0 lincurve-test.0.y-val-01
+lincurve_test sint RW 0 lincurve-test.1.tmax
+lincurve_test bool RO FALSE lincurve-test.1.tmax-increased
+lincurve_test real RW 0 lincurve-test.1.x-val-00
+lincurve_test real RW 0 lincurve-test.1.x-val-01
+lincurve_test real RW 0 lincurve-test.1.x-val-02
+lincurve_test real RW 0 lincurve-test.1.y-val-00
+lincurve_test real RW 0 lincurve-test.1.y-val-01
+lincurve_test real RW 0 lincurve-test.1.y-val-02
+lincurve_test sint RW 0 lincurve-test.2.tmax
+lincurve_test bool RO FALSE lincurve-test.2.tmax-increased
+lincurve_test real RW 0 lincurve-test.2.x-val-00
+lincurve_test real RW 0 lincurve-test.2.x-val-01
+lincurve_test real RW 0 lincurve-test.2.y-val-00
+lincurve_test real RW 0 lincurve-test.2.y-val-01
+lincurve_test sint RW 0 lincurve-test.3.tmax
+lincurve_test bool RO FALSE lincurve-test.3.tmax-increased
+lincurve_test real RW 0 lincurve-test.3.x-val-00
+lincurve_test real RW 0 lincurve-test.3.x-val-01
+lincurve_test real RW 0 lincurve-test.3.x-val-02
+lincurve_test real RW 0 lincurve-test.3.y-val-00
+lincurve_test real RW 0 lincurve-test.3.y-val-01
+lincurve_test real RW 0 lincurve-test.3.y-val-02
+logic_test sint RW 0 logic-test.0.tmax
+logic_test bool RO FALSE logic-test.0.tmax-increased
+logic_test sint RW 0 logic-test.1.tmax
+logic_test bool RO FALSE logic-test.1.tmax-increased
+logic_test sint RW 0 logic-test.2.tmax
+logic_test bool RO FALSE logic-test.2.tmax-increased
+logic_test sint RW 0 logic-test.3.tmax
+logic_test bool RO FALSE logic-test.3.tmax-increased
diff --git a/tests/halcompile/personalities_mod/4names_2pers.expected b/tests/halcompile/personalities_mod/4names_2pers.expected
index 214ddaa56fc..2403c86f4e7 100644
--- a/tests/halcompile/personalities_mod/4names_2pers.expected
+++ b/tests/halcompile/personalities_mod/4names_2pers.expected
@@ -1,100 +1,100 @@
-bitslice_test u32 IN 0 bs1.in
-bitslice_test bit OUT FALSE bs1.out-00
-bitslice_test bit OUT FALSE bs1.out-01
-bitslice_test s32 OUT 0 bs1.time
-bitslice_test u32 IN 0 bs2.in
-bitslice_test bit OUT FALSE bs2.out-00
-bitslice_test bit OUT FALSE bs2.out-01
-bitslice_test bit OUT FALSE bs2.out-02
-bitslice_test s32 OUT 0 bs2.time
-bitslice_test u32 IN 0 bs3.in
-bitslice_test bit OUT FALSE bs3.out-00
-bitslice_test bit OUT FALSE bs3.out-01
-bitslice_test s32 OUT 0 bs3.time
-bitslice_test u32 IN 0 bs4.in
-bitslice_test bit OUT FALSE bs4.out-00
-bitslice_test bit OUT FALSE bs4.out-01
-bitslice_test bit OUT FALSE bs4.out-02
-bitslice_test s32 OUT 0 bs4.time
-lincurve_test float IN 0 lc1.in
-lincurve_test float OUT 0 lc1.out
-lincurve_test float I/O 0 lc1.out-io
-lincurve_test s32 OUT 0 lc1.time
-lincurve_test float IN 0 lc2.in
-lincurve_test float OUT 0 lc2.out
-lincurve_test float I/O 0 lc2.out-io
-lincurve_test s32 OUT 0 lc2.time
-lincurve_test float IN 0 lc3.in
-lincurve_test float OUT 0 lc3.out
-lincurve_test float I/O 0 lc3.out-io
-lincurve_test s32 OUT 0 lc3.time
-lincurve_test float IN 0 lc4.in
-lincurve_test float OUT 0 lc4.out
-lincurve_test float I/O 0 lc4.out-io
-lincurve_test s32 OUT 0 lc4.time
-logic_test bit OUT FALSE lg1.and
-logic_test bit IN FALSE lg1.in-00
-logic_test bit IN FALSE lg1.in-01
-logic_test s32 OUT 0 lg1.time
-logic_test bit IN FALSE lg2.in-00
-logic_test bit IN FALSE lg2.in-01
-logic_test bit IN FALSE lg2.in-02
-logic_test bit IN FALSE lg2.in-03
-logic_test bit OUT FALSE lg2.or
-logic_test s32 OUT 0 lg2.time
-logic_test bit OUT FALSE lg3.and
-logic_test bit IN FALSE lg3.in-00
-logic_test bit IN FALSE lg3.in-01
-logic_test s32 OUT 0 lg3.time
-logic_test bit IN FALSE lg4.in-00
-logic_test bit IN FALSE lg4.in-01
-logic_test bit IN FALSE lg4.in-02
-logic_test bit IN FALSE lg4.in-03
-logic_test bit OUT FALSE lg4.or
-logic_test s32 OUT 0 lg4.time
+bitslice_test uint IN 0 bs1.in
+bitslice_test bool OUT FALSE bs1.out-00
+bitslice_test bool OUT FALSE bs1.out-01
+bitslice_test sint OUT 0 bs1.time
+bitslice_test uint IN 0 bs2.in
+bitslice_test bool OUT FALSE bs2.out-00
+bitslice_test bool OUT FALSE bs2.out-01
+bitslice_test bool OUT FALSE bs2.out-02
+bitslice_test sint OUT 0 bs2.time
+bitslice_test uint IN 0 bs3.in
+bitslice_test bool OUT FALSE bs3.out-00
+bitslice_test bool OUT FALSE bs3.out-01
+bitslice_test sint OUT 0 bs3.time
+bitslice_test uint IN 0 bs4.in
+bitslice_test bool OUT FALSE bs4.out-00
+bitslice_test bool OUT FALSE bs4.out-01
+bitslice_test bool OUT FALSE bs4.out-02
+bitslice_test sint OUT 0 bs4.time
+lincurve_test real IN 0 lc1.in
+lincurve_test real OUT 0 lc1.out
+lincurve_test real I/O 0 lc1.out-io
+lincurve_test sint OUT 0 lc1.time
+lincurve_test real IN 0 lc2.in
+lincurve_test real OUT 0 lc2.out
+lincurve_test real I/O 0 lc2.out-io
+lincurve_test sint OUT 0 lc2.time
+lincurve_test real IN 0 lc3.in
+lincurve_test real OUT 0 lc3.out
+lincurve_test real I/O 0 lc3.out-io
+lincurve_test sint OUT 0 lc3.time
+lincurve_test real IN 0 lc4.in
+lincurve_test real OUT 0 lc4.out
+lincurve_test real I/O 0 lc4.out-io
+lincurve_test sint OUT 0 lc4.time
+logic_test bool OUT FALSE lg1.and
+logic_test bool IN FALSE lg1.in-00
+logic_test bool IN FALSE lg1.in-01
+logic_test sint OUT 0 lg1.time
+logic_test bool IN FALSE lg2.in-00
+logic_test bool IN FALSE lg2.in-01
+logic_test bool IN FALSE lg2.in-02
+logic_test bool IN FALSE lg2.in-03
+logic_test bool OUT FALSE lg2.or
+logic_test sint OUT 0 lg2.time
+logic_test bool OUT FALSE lg3.and
+logic_test bool IN FALSE lg3.in-00
+logic_test bool IN FALSE lg3.in-01
+logic_test sint OUT 0 lg3.time
+logic_test bool IN FALSE lg4.in-00
+logic_test bool IN FALSE lg4.in-01
+logic_test bool IN FALSE lg4.in-02
+logic_test bool IN FALSE lg4.in-03
+logic_test bool OUT FALSE lg4.or
+logic_test sint OUT 0 lg4.time
-bitslice_test s32 RW 0 bs1.tmax
-bitslice_test bit RO FALSE bs1.tmax-increased
-bitslice_test s32 RW 0 bs2.tmax
-bitslice_test bit RO FALSE bs2.tmax-increased
-bitslice_test s32 RW 0 bs3.tmax
-bitslice_test bit RO FALSE bs3.tmax-increased
-bitslice_test s32 RW 0 bs4.tmax
-bitslice_test bit RO FALSE bs4.tmax-increased
-lincurve_test s32 RW 0 lc1.tmax
-lincurve_test bit RO FALSE lc1.tmax-increased
-lincurve_test float RW 0 lc1.x-val-00
-lincurve_test float RW 0 lc1.x-val-01
-lincurve_test float RW 0 lc1.y-val-00
-lincurve_test float RW 0 lc1.y-val-01
-lincurve_test s32 RW 0 lc2.tmax
-lincurve_test bit RO FALSE lc2.tmax-increased
-lincurve_test float RW 0 lc2.x-val-00
-lincurve_test float RW 0 lc2.x-val-01
-lincurve_test float RW 0 lc2.x-val-02
-lincurve_test float RW 0 lc2.y-val-00
-lincurve_test float RW 0 lc2.y-val-01
-lincurve_test float RW 0 lc2.y-val-02
-lincurve_test s32 RW 0 lc3.tmax
-lincurve_test bit RO FALSE lc3.tmax-increased
-lincurve_test float RW 0 lc3.x-val-00
-lincurve_test float RW 0 lc3.x-val-01
-lincurve_test float RW 0 lc3.y-val-00
-lincurve_test float RW 0 lc3.y-val-01
-lincurve_test s32 RW 0 lc4.tmax
-lincurve_test bit RO FALSE lc4.tmax-increased
-lincurve_test float RW 0 lc4.x-val-00
-lincurve_test float RW 0 lc4.x-val-01
-lincurve_test float RW 0 lc4.x-val-02
-lincurve_test float RW 0 lc4.y-val-00
-lincurve_test float RW 0 lc4.y-val-01
-lincurve_test float RW 0 lc4.y-val-02
-logic_test s32 RW 0 lg1.tmax
-logic_test bit RO FALSE lg1.tmax-increased
-logic_test s32 RW 0 lg2.tmax
-logic_test bit RO FALSE lg2.tmax-increased
-logic_test s32 RW 0 lg3.tmax
-logic_test bit RO FALSE lg3.tmax-increased
-logic_test s32 RW 0 lg4.tmax
-logic_test bit RO FALSE lg4.tmax-increased
+bitslice_test sint RW 0 bs1.tmax
+bitslice_test bool RO FALSE bs1.tmax-increased
+bitslice_test sint RW 0 bs2.tmax
+bitslice_test bool RO FALSE bs2.tmax-increased
+bitslice_test sint RW 0 bs3.tmax
+bitslice_test bool RO FALSE bs3.tmax-increased
+bitslice_test sint RW 0 bs4.tmax
+bitslice_test bool RO FALSE bs4.tmax-increased
+lincurve_test sint RW 0 lc1.tmax
+lincurve_test bool RO FALSE lc1.tmax-increased
+lincurve_test real RW 0 lc1.x-val-00
+lincurve_test real RW 0 lc1.x-val-01
+lincurve_test real RW 0 lc1.y-val-00
+lincurve_test real RW 0 lc1.y-val-01
+lincurve_test sint RW 0 lc2.tmax
+lincurve_test bool RO FALSE lc2.tmax-increased
+lincurve_test real RW 0 lc2.x-val-00
+lincurve_test real RW 0 lc2.x-val-01
+lincurve_test real RW 0 lc2.x-val-02
+lincurve_test real RW 0 lc2.y-val-00
+lincurve_test real RW 0 lc2.y-val-01
+lincurve_test real RW 0 lc2.y-val-02
+lincurve_test sint RW 0 lc3.tmax
+lincurve_test bool RO FALSE lc3.tmax-increased
+lincurve_test real RW 0 lc3.x-val-00
+lincurve_test real RW 0 lc3.x-val-01
+lincurve_test real RW 0 lc3.y-val-00
+lincurve_test real RW 0 lc3.y-val-01
+lincurve_test sint RW 0 lc4.tmax
+lincurve_test bool RO FALSE lc4.tmax-increased
+lincurve_test real RW 0 lc4.x-val-00
+lincurve_test real RW 0 lc4.x-val-01
+lincurve_test real RW 0 lc4.x-val-02
+lincurve_test real RW 0 lc4.y-val-00
+lincurve_test real RW 0 lc4.y-val-01
+lincurve_test real RW 0 lc4.y-val-02
+logic_test sint RW 0 lg1.tmax
+logic_test bool RO FALSE lg1.tmax-increased
+logic_test sint RW 0 lg2.tmax
+logic_test bool RO FALSE lg2.tmax-increased
+logic_test sint RW 0 lg3.tmax
+logic_test bool RO FALSE lg3.tmax-increased
+logic_test sint RW 0 lg4.tmax
+logic_test bool RO FALSE lg4.tmax-increased
diff --git a/tests/halmodule.3/expected b/tests/halmodule.3/expected
deleted file mode 100644
index 140572ef7d0..00000000000
--- a/tests/halmodule.3/expected
+++ /dev/null
@@ -1,60 +0,0 @@
-# Pins
-and2.0.in0 {'haltype': 'pin', 'name': 'and2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-a', 'comp': 'and2', 'comp_id': 'ID'}
-and2.0.in1 {'haltype': 'pin', 'name': 'and2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-b', 'comp': 'and2', 'comp_id': 'ID'}
-and2.0.out {'haltype': 'pin', 'name': 'and2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'and2', 'comp_id': 'ID'}
-and2.0.time {'haltype': 'pin', 'name': 'and2.0.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': 'and2', 'comp_id': 'ID'}
-or2.0.in0 {'haltype': 'pin', 'name': 'or2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-a', 'comp': 'or2', 'comp_id': 'ID'}
-or2.0.in1 {'haltype': 'pin', 'name': 'or2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-b', 'comp': 'or2', 'comp_id': 'ID'}
-or2.0.out {'haltype': 'pin', 'name': 'or2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-b', 'comp': 'or2', 'comp_id': 'ID'}
-or2.0.time {'haltype': 'pin', 'name': 'or2.0.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': 'or2', 'comp_id': 'ID'}
-testthread.threadbeat {'haltype': 'pin', 'name': 'testthread.threadbeat', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': '__testthread', 'comp_id': 'ID'}
-testthread.time {'haltype': 'pin', 'name': 'testthread.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': '__testthread', 'comp_id': 'ID'}
-xor2.0.in0 {'haltype': 'pin', 'name': 'xor2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'xor2', 'comp_id': 'ID'}
-xor2.0.in1 {'haltype': 'pin', 'name': 'xor2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-b', 'comp': 'xor2', 'comp_id': 'ID'}
-xor2.0.out {'haltype': 'pin', 'name': 'xor2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-output', 'comp': 'xor2', 'comp_id': 'ID'}
-xor2.0.time {'haltype': 'pin', 'name': 'xor2.0.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': 'xor2', 'comp_id': 'ID'}
-# Params
-and2.0.tmax {'haltype': 'parameter', 'name': 'and2.0.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': 'and2', 'comp_id': 'ID'}
-and2.0.tmax-increased {'haltype': 'parameter', 'name': 'and2.0.tmax-increased', 'type': , 'dir': , 'value': False, 'alias': None, 'comp': 'and2', 'comp_id': 'ID'}
-or2.0.tmax {'haltype': 'parameter', 'name': 'or2.0.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': 'or2', 'comp_id': 'ID'}
-or2.0.tmax-increased {'haltype': 'parameter', 'name': 'or2.0.tmax-increased', 'type': , 'dir': , 'value': False, 'alias': None, 'comp': 'or2', 'comp_id': 'ID'}
-testthread.tmax {'haltype': 'parameter', 'name': 'testthread.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': '__testthread', 'comp_id': 'ID'}
-xor2.0.tmax {'haltype': 'parameter', 'name': 'xor2.0.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': 'xor2', 'comp_id': 'ID'}
-xor2.0.tmax-increased {'haltype': 'parameter', 'name': 'xor2.0.tmax-increased', 'type': , 'dir': , 'value': False, 'alias': None, 'comp': 'xor2', 'comp_id': 'ID'}
-# Signals
-net-input-a {'haltype': 'signal', 'name': 'net-input-a', 'type': , 'value': False, 'writers': 0, 'readers': 2, 'bidirs': 0, 'driver': None}
-net-input-b {'haltype': 'signal', 'name': 'net-input-b', 'type': , 'value': False, 'writers': 0, 'readers': 2, 'bidirs': 0, 'driver': None}
-net-output {'haltype': 'signal', 'name': 'net-output', 'type': , 'value': False, 'writers': 1, 'readers': 0, 'bidirs': 0, 'driver': 'xor2.0.out'}
-net-xor-a {'haltype': 'signal', 'name': 'net-xor-a', 'type': , 'value': False, 'writers': 1, 'readers': 1, 'bidirs': 0, 'driver': 'and2.0.out'}
-net-xor-b {'haltype': 'signal', 'name': 'net-xor-b', 'type': , 'value': False, 'writers': 1, 'readers': 1, 'bidirs': 0, 'driver': 'or2.0.out'}
-# Components
-xor2 {'haltype': 'component', 'name': 'xor2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
-or2 {'haltype': 'component', 'name': 'or2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
-and2 {'haltype': 'component', 'name': 'and2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
-__testthread {'haltype': 'component', 'name': '__testthread', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': None}
-threads {'haltype': 'component', 'name': 'threads', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'name1=testthread period1=1000000'}
-# Functions
-and2.0 {'haltype': 'function', 'name': 'and2.0', 'comp': 'and2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
-or2.0 {'haltype': 'function', 'name': 'or2.0', 'comp': 'or2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
-xor2.0 {'haltype': 'function', 'name': 'xor2.0', 'comp': 'xor2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
-# Threads
-testthread {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 0, 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
-# Signal pins
-and2.0.out {'haltype': 'pin', 'name': 'and2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'and2', 'comp_id': 'ID'}
-xor2.0.in0 {'haltype': 'pin', 'name': 'xor2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'xor2', 'comp_id': 'ID'}
-# Intended failures
-pin('does-not-exist') fails correctly
-param('does-not-exist') fails correctly
-signal('does-not-exist') fails correctly
-comp('does-not-exist') fails correctly
-comp(65534) fails correctly
-funct('does-not-exist') fails correctly
-thread('does-not-exist') fails correctly
-signalpins('does-not-exist') fails correctly
-# Simple named queries
-Pin: {'haltype': 'pin', 'name': 'or2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-b', 'comp': 'or2', 'comp_id': 'ID'}
-Param: {'haltype': 'parameter', 'name': 'testthread.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': '__testthread', 'comp_id': 'ID'}
-Signal: {'haltype': 'signal', 'name': 'net-output', 'type': , 'value': False, 'writers': 1, 'readers': 0, 'bidirs': 0, 'driver': 'xor2.0.out'}
-Component: {'haltype': 'component', 'name': 'and2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
-Function: {'haltype': 'function', 'name': 'xor2.0', 'comp': 'xor2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
-Thread: {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 0, 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
diff --git a/tests/halmodule.0/README b/tests/halmodule/comp-set-get/README
similarity index 100%
rename from tests/halmodule.0/README
rename to tests/halmodule/comp-set-get/README
diff --git a/tests/halmodule.0/expected b/tests/halmodule/comp-set-get/expected
similarity index 94%
rename from tests/halmodule.0/expected
rename to tests/halmodule/comp-set-get/expected
index 37c7b48be8d..1d5f8e6169a 100644
--- a/tests/halmodule.0/expected
+++ b/tests/halmodule/comp-set-get/expected
@@ -19,10 +19,10 @@ set f 1 ok
set f 1.0 ok
set f 1 ok
set f 89884656743115795386465259539451236680898848947115328636715040578866337902750481566354238661203768010560056939935696678829394884407208311246423715319737062188883946712432742638151109800623047059726541476042502884419075341171231440736956555270413618581675255342293149119973622969239858152417678164812112068608 ok
-set s 2147483648 fail
-set s -2147483649 fail
+set s 2147483648 ok
+set s -2147483649 ok
set u -1 fail
-set u 4294967296 fail
+set u 4294967296 ok
set f 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 fail
pincheck s True True True
pincheck u True True True
diff --git a/tests/halmodule.0/test.py b/tests/halmodule/comp-set-get/test.py
similarity index 75%
rename from tests/halmodule.0/test.py
rename to tests/halmodule/comp-set-get/test.py
index 59e0e83d457..5a4db102b8f 100755
--- a/tests/halmodule.0/test.py
+++ b/tests/halmodule/comp-set-get/test.py
@@ -4,10 +4,10 @@
h = hal.component("x")
try:
- ps = h.newpin("s", hal.HAL_S32, hal.HAL_OUT)
- pu = h.newpin("u", hal.HAL_U32, hal.HAL_OUT)
- pf = h.newpin("f", hal.HAL_FLOAT, hal.HAL_OUT)
- param = h.newparam("param", hal.HAL_BIT, hal.HAL_RW)
+ ps = h.newpin("s", hal.Type.SINT, hal.Dir.OUT)
+ pu = h.newpin("u", hal.Type.UINT, hal.Dir.OUT)
+ pf = h.newpin("f", hal.Type.REAL, hal.Dir.OUT)
+ param = h.newparam("param", hal.Type.BOOL, hal.Dir.RW)
h.ready()
def try_set(p, v):
@@ -64,27 +64,27 @@ def pin_validate(i, t, d):
print("pincheck {} {} {} {}".format(
i.get_name(), i.is_pin(), i.get_type() == t, i.get_dir() == d))
- pin_validate(ps, hal.HAL_S32, hal.HAL_OUT)
- pin_validate(pu, hal.HAL_U32, hal.HAL_OUT)
- pin_validate(pf, hal.HAL_FLOAT, hal.HAL_OUT)
+ pin_validate(ps, hal.Type.SINT, hal.Dir.OUT)
+ pin_validate(pu, hal.Type.UINT, hal.Dir.OUT)
+ pin_validate(pf, hal.Type.REAL, hal.Dir.OUT)
pin = h.getitem("s")
- pin_validate(pin, hal.HAL_S32, hal.HAL_OUT)
+ pin_validate(pin, hal.Type.SINT, hal.Dir.OUT)
try:
pin = h.getitem("not-found")
print("{} {} {}".format("getitem", "not-found", "ok"))
except:
print("{} {} {}".format("getitem", "not-found", "fail"))
- pin_validate(param, hal.HAL_BIT, hal.HAL_RW)
+ pin_validate(param, hal.Type.BOOL, hal.Dir.RW)
param = h.getitem("param")
- pin_validate(param, hal.HAL_BIT, hal.HAL_RW)
+ pin_validate(param, hal.Type.BOOL, hal.Dir.RW)
pin = h.getpin("s")
- pin_validate(pin, hal.HAL_S32, hal.HAL_OUT)
+ pin_validate(pin, hal.Type.SINT, hal.Dir.OUT)
param = h.getparam("param")
- pin_validate(param, hal.HAL_BIT, hal.HAL_RW)
+ pin_validate(param, hal.Type.BOOL, hal.Dir.RW)
try_set_pin(pu, 0)
try_set_pin(pu, -1)
diff --git a/tests/halmodule.0/test.sh b/tests/halmodule/comp-set-get/test.sh
similarity index 100%
rename from tests/halmodule.0/test.sh
rename to tests/halmodule/comp-set-get/test.sh
diff --git a/tests/halmodule/deprecated/deprecated.py b/tests/halmodule/deprecated/deprecated.py
new file mode 100755
index 00000000000..d19a2d81a07
--- /dev/null
+++ b/tests/halmodule/deprecated/deprecated.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+import hal
+
+# These should all give a FutureWarning
+a = hal.HAL_BIT
+assert a == hal.Type.BOOL, "Bad BIT/BOOL"
+a = hal.HAL_FLOAT
+assert a == hal.Type.REAL, "Bad FLOAT/REAL"
+a = hal.HAL_S32
+assert a == hal.Type.SINT, "Bad S32/SINT"
+a = hal.HAL_U32
+assert a == hal.Type.UINT, "Bad U32/UINT"
+a = hal.HAL_S64
+assert a == hal.Type.SINT, "Bad S64/SINT"
+a = hal.HAL_U64
+assert a == hal.Type.UINT, "Bad U64/UINT"
+
diff --git a/tests/halmodule/deprecated/expected b/tests/halmodule/deprecated/expected
new file mode 100644
index 00000000000..89f9c5896b8
--- /dev/null
+++ b/tests/halmodule/deprecated/expected
@@ -0,0 +1,12 @@
+FutureWarning: HAL_BIT has been deprecated. Please use the IntEnum type hal.Type.BOOL
+ a = hal.HAL_BIT
+FutureWarning: HAL_FLOAT has been deprecated. Please use the IntEnum type hal.Type.REAL
+ a = hal.HAL_FLOAT
+FutureWarning: HAL_S32 is no longer supported and replaced by hal.Type.SINT
+ a = hal.HAL_S32
+FutureWarning: HAL_U32 is no longer supported and replaced by hal.Type.UINT
+ a = hal.HAL_U32
+FutureWarning: HAL_S64 has been deprecated. Please use the IntEnum type hal.Type.SINT
+ a = hal.HAL_S64
+FutureWarning: HAL_U64 has been deprecated. Please use the IntEnum type hal.Type.UINT
+ a = hal.HAL_U64
diff --git a/tests/halmodule/deprecated/test.sh b/tests/halmodule/deprecated/test.sh
new file mode 100755
index 00000000000..e75d5284c73
--- /dev/null
+++ b/tests/halmodule/deprecated/test.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+./deprecated.py 2>&1 | sed -e's,^.*deprecated.py:[0-9]\+:\s*,,'
diff --git a/tests/halmodule/halquery/expected b/tests/halmodule/halquery/expected
new file mode 100644
index 00000000000..84bb9e1ef74
--- /dev/null
+++ b/tests/halmodule/halquery/expected
@@ -0,0 +1,60 @@
+# Pins
+and2.0.in0 {'haltype': 'pin', 'name': 'and2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-a', 'comp': 'and2', 'comp_id': 'ID'}
+and2.0.in1 {'haltype': 'pin', 'name': 'and2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-b', 'comp': 'and2', 'comp_id': 'ID'}
+and2.0.out {'haltype': 'pin', 'name': 'and2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'and2', 'comp_id': 'ID'}
+and2.0.time {'haltype': 'pin', 'name': 'and2.0.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': 'and2', 'comp_id': 'ID'}
+or2.0.in0 {'haltype': 'pin', 'name': 'or2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-a', 'comp': 'or2', 'comp_id': 'ID'}
+or2.0.in1 {'haltype': 'pin', 'name': 'or2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-b', 'comp': 'or2', 'comp_id': 'ID'}
+or2.0.out {'haltype': 'pin', 'name': 'or2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-b', 'comp': 'or2', 'comp_id': 'ID'}
+or2.0.time {'haltype': 'pin', 'name': 'or2.0.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': 'or2', 'comp_id': 'ID'}
+testthread.threadbeat {'haltype': 'pin', 'name': 'testthread.threadbeat', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': '__testthread', 'comp_id': 'ID'}
+testthread.time {'haltype': 'pin', 'name': 'testthread.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': '__testthread', 'comp_id': 'ID'}
+xor2.0.in0 {'haltype': 'pin', 'name': 'xor2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'xor2', 'comp_id': 'ID'}
+xor2.0.in1 {'haltype': 'pin', 'name': 'xor2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-b', 'comp': 'xor2', 'comp_id': 'ID'}
+xor2.0.out {'haltype': 'pin', 'name': 'xor2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-output', 'comp': 'xor2', 'comp_id': 'ID'}
+xor2.0.time {'haltype': 'pin', 'name': 'xor2.0.time', 'type': , 'dir': , 'value': 0, 'alias': None, 'signal': None, 'comp': 'xor2', 'comp_id': 'ID'}
+# Params
+and2.0.tmax {'haltype': 'parameter', 'name': 'and2.0.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': 'and2', 'comp_id': 'ID'}
+and2.0.tmax-increased {'haltype': 'parameter', 'name': 'and2.0.tmax-increased', 'type': , 'dir': , 'value': False, 'alias': None, 'comp': 'and2', 'comp_id': 'ID'}
+or2.0.tmax {'haltype': 'parameter', 'name': 'or2.0.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': 'or2', 'comp_id': 'ID'}
+or2.0.tmax-increased {'haltype': 'parameter', 'name': 'or2.0.tmax-increased', 'type': , 'dir': , 'value': False, 'alias': None, 'comp': 'or2', 'comp_id': 'ID'}
+testthread.tmax {'haltype': 'parameter', 'name': 'testthread.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': '__testthread', 'comp_id': 'ID'}
+xor2.0.tmax {'haltype': 'parameter', 'name': 'xor2.0.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': 'xor2', 'comp_id': 'ID'}
+xor2.0.tmax-increased {'haltype': 'parameter', 'name': 'xor2.0.tmax-increased', 'type': , 'dir': , 'value': False, 'alias': None, 'comp': 'xor2', 'comp_id': 'ID'}
+# Signals
+net-input-a {'haltype': 'signal', 'name': 'net-input-a', 'type': , 'value': False, 'writers': 0, 'readers': 2, 'bidirs': 0, 'driver': None}
+net-input-b {'haltype': 'signal', 'name': 'net-input-b', 'type': , 'value': False, 'writers': 0, 'readers': 2, 'bidirs': 0, 'driver': None}
+net-output {'haltype': 'signal', 'name': 'net-output', 'type': , 'value': False, 'writers': 1, 'readers': 0, 'bidirs': 0, 'driver': 'xor2.0.out'}
+net-xor-a {'haltype': 'signal', 'name': 'net-xor-a', 'type': , 'value': False, 'writers': 1, 'readers': 1, 'bidirs': 0, 'driver': 'and2.0.out'}
+net-xor-b {'haltype': 'signal', 'name': 'net-xor-b', 'type': , 'value': False, 'writers': 1, 'readers': 1, 'bidirs': 0, 'driver': 'or2.0.out'}
+# Components
+xor2 {'haltype': 'component', 'name': 'xor2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
+or2 {'haltype': 'component', 'name': 'or2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
+and2 {'haltype': 'component', 'name': 'and2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
+__testthread {'haltype': 'component', 'name': '__testthread', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': None}
+threads {'haltype': 'component', 'name': 'threads', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'name1=testthread period1=1000000'}
+# Functions
+and2.0 {'haltype': 'function', 'name': 'and2.0', 'comp': 'and2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
+or2.0 {'haltype': 'function', 'name': 'or2.0', 'comp': 'or2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
+xor2.0 {'haltype': 'function', 'name': 'xor2.0', 'comp': 'xor2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
+# Threads
+testthread {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 0, 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
+# Signal pins
+and2.0.out {'haltype': 'pin', 'name': 'and2.0.out', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'and2', 'comp_id': 'ID'}
+xor2.0.in0 {'haltype': 'pin', 'name': 'xor2.0.in0', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'xor2', 'comp_id': 'ID'}
+# Intended failures
+pin('does-not-exist') fails correctly
+param('does-not-exist') fails correctly
+signal('does-not-exist') fails correctly
+comp('does-not-exist') fails correctly
+comp(65534) fails correctly
+funct('does-not-exist') fails correctly
+thread('does-not-exist') fails correctly
+signalpins('does-not-exist') fails correctly
+# Simple named queries
+Pin: {'haltype': 'pin', 'name': 'or2.0.in1', 'type': , 'dir': , 'value': False, 'alias': None, 'signal': 'net-input-b', 'comp': 'or2', 'comp_id': 'ID'}
+Param: {'haltype': 'parameter', 'name': 'testthread.tmax', 'type': , 'dir': , 'value': 0, 'alias': None, 'comp': '__testthread', 'comp_id': 'ID'}
+Signal: {'haltype': 'signal', 'name': 'net-output', 'type': , 'value': False, 'writers': 1, 'readers': 0, 'bidirs': 0, 'driver': 'xor2.0.out'}
+Component: {'haltype': 'component', 'name': 'and2', 'type': , 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
+Function: {'haltype': 'function', 'name': 'xor2.0', 'comp': 'xor2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
+Thread: {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 0, 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
diff --git a/tests/halmodule.3/halquerytest.py b/tests/halmodule/halquery/halquerytest.py
similarity index 90%
rename from tests/halmodule.3/halquerytest.py
rename to tests/halmodule/halquery/halquerytest.py
index 58bec69e8bd..0025382e2dc 100755
--- a/tests/halmodule.3/halquerytest.py
+++ b/tests/halmodule/halquery/halquerytest.py
@@ -1,19 +1,23 @@
#!/usr/bin/env python3
import hal
+import re
# There is a chance that component IDs are not always consistent. They
# should be, but there are no guarantees. Therefore, we simply mask the
# number and use 'ID' as replacement.
+def fix_enum_numbers(d):
+ return re.sub(r':\s*\d+>', '>', str(d))
+
def fix_comp_id(d):
if 'comp_id' in d:
d['comp_id'] = "ID"
- return d
+ return fix_enum_numbers(d)
def fix_id(d):
if 'id' in d:
d['id'] = "ID"
- return d
+ return fix_enum_numbers(d)
# Call the listing query methods.
print("# Pins")
@@ -26,7 +30,7 @@ def fix_id(d):
print("# Signals")
for n,v in hal.query.signals().items():
- print(n, v)
+ print(n, fix_enum_numbers(v))
print("# Components")
for n,v in hal.query.comps().items():
@@ -67,7 +71,7 @@ def fix_id(d):
print("# Simple named queries")
print("Pin:", fix_comp_id(hal.query.pin('or2.0.in1')))
print("Param:", fix_comp_id(hal.query.param('testthread.tmax')))
-print("Signal:", hal.query.signal('net-output'))
+print("Signal:", fix_enum_numbers(hal.query.signal('net-output')))
print("Component:", fix_id(hal.query.comp('and2')))
print("Function:", fix_comp_id(hal.query.funct('xor2.0')))
print("Thread:", fix_comp_id(hal.query.thread('testthread')))
diff --git a/tests/halmodule.3/test.hal b/tests/halmodule/halquery/test.hal
similarity index 100%
rename from tests/halmodule.3/test.hal
rename to tests/halmodule/halquery/test.hal
diff --git a/tests/halmodule.2/expected b/tests/halmodule/no-comp-needed/expected
similarity index 100%
rename from tests/halmodule.2/expected
rename to tests/halmodule/no-comp-needed/expected
diff --git a/tests/halmodule.2/halmodtest.py b/tests/halmodule/no-comp-needed/halmodtest.py
similarity index 100%
rename from tests/halmodule.2/halmodtest.py
rename to tests/halmodule/no-comp-needed/halmodtest.py
diff --git a/tests/halmodule.2/test.hal b/tests/halmodule/no-comp-needed/test.hal
similarity index 100%
rename from tests/halmodule.2/test.hal
rename to tests/halmodule/no-comp-needed/test.hal
diff --git a/tests/halmodule.1/expected b/tests/halmodule/stream/expected
similarity index 100%
rename from tests/halmodule.1/expected
rename to tests/halmodule/stream/expected
diff --git a/tests/halmodule.1/stream_reader.py b/tests/halmodule/stream/stream_reader.py
similarity index 100%
rename from tests/halmodule.1/stream_reader.py
rename to tests/halmodule/stream/stream_reader.py
diff --git a/tests/halmodule.1/stream_test.py b/tests/halmodule/stream/stream_test.py
similarity index 100%
rename from tests/halmodule.1/stream_test.py
rename to tests/halmodule/stream/stream_test.py
diff --git a/tests/halmodule.1/stream_writer.py b/tests/halmodule/stream/stream_writer.py
similarity index 100%
rename from tests/halmodule.1/stream_writer.py
rename to tests/halmodule/stream/stream_writer.py
diff --git a/tests/halmodule.1/test.hal b/tests/halmodule/stream/test.hal
similarity index 100%
rename from tests/halmodule.1/test.hal
rename to tests/halmodule/stream/test.hal
diff --git a/tests/halui/jogging/test-ui.py b/tests/halui/jogging/test-ui.py
index 858f38df542..53a61b25606 100755
--- a/tests/halui/jogging/test-ui.py
+++ b/tests/halui/jogging/test-ui.py
@@ -174,38 +174,38 @@ def jog_joint(joint_number, target):
h = hal.component("python-ui")
-h.newpin("joint-0-home", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-0-homed", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("joint-0-select", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-0-selected", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("joint-0-position", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-0-velocity", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-0-jog-plus", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-0-jog-minus", hal.HAL_BIT, hal.HAL_OUT)
-
-h.newpin("joint-1-home", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-1-homed", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("joint-1-select", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-1-selected", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("joint-1-position", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-1-velocity", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-1-jog-plus", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-1-jog-minus", hal.HAL_BIT, hal.HAL_OUT)
-
-h.newpin("joint-2-home", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-2-homed", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("joint-2-select", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-2-selected", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("joint-2-position", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-2-velocity", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-2-jog-plus", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-2-jog-minus", hal.HAL_BIT, hal.HAL_OUT)
-
-h.newpin("jog-selected-minus", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("jog-selected-plus", hal.HAL_BIT, hal.HAL_OUT)
-
-h.newpin("motion-mode-joint", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("motion-mode-is-joint", hal.HAL_BIT, hal.HAL_IN)
+h.newpin("joint-0-home", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-0-homed", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("joint-0-select", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-0-selected", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("joint-0-position", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-0-velocity", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-0-jog-plus", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-0-jog-minus", hal.Type.BOOL, hal.Dir.OUT)
+
+h.newpin("joint-1-home", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-1-homed", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("joint-1-select", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-1-selected", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("joint-1-position", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-1-velocity", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-1-jog-plus", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-1-jog-minus", hal.Type.BOOL, hal.Dir.OUT)
+
+h.newpin("joint-2-home", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-2-homed", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("joint-2-select", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-2-selected", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("joint-2-position", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-2-velocity", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-2-jog-plus", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-2-jog-minus", hal.Type.BOOL, hal.Dir.OUT)
+
+h.newpin("jog-selected-minus", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("jog-selected-plus", hal.Type.BOOL, hal.Dir.OUT)
+
+h.newpin("motion-mode-joint", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("motion-mode-is-joint", hal.Type.BOOL, hal.Dir.IN)
h.ready() # mark the component as 'ready'
diff --git a/tests/halui/mdi/test-ui.py b/tests/halui/mdi/test-ui.py
index 81afb4fd342..296db4b1d62 100755
--- a/tests/halui/mdi/test-ui.py
+++ b/tests/halui/mdi/test-ui.py
@@ -77,18 +77,18 @@ def wait_for_halui_mode(pin_name):
h = hal.component("python-ui")
-h.newpin("mdi-0", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("mdi-1", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("mdi-2", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("mdi-3", hal.HAL_BIT, hal.HAL_OUT)
-
-h.newpin("joint-0-position", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-1-position", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("joint-2-position", hal.HAL_FLOAT, hal.HAL_IN)
-
-h.newpin("is-manual", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("is-auto", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("is-mdi", hal.HAL_BIT, hal.HAL_IN)
+h.newpin("mdi-0", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("mdi-1", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("mdi-2", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("mdi-3", hal.Type.BOOL, hal.Dir.OUT)
+
+h.newpin("joint-0-position", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-1-position", hal.Type.REAL, hal.Dir.IN)
+h.newpin("joint-2-position", hal.Type.REAL, hal.Dir.IN)
+
+h.newpin("is-manual", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("is-auto", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("is-mdi", hal.Type.BOOL, hal.Dir.IN)
h.ready() # mark the component as 'ready'
diff --git a/tests/hard-limits/test-ui.py b/tests/hard-limits/test-ui.py
index 61b1ffab036..a43181ed4c4 100755
--- a/tests/hard-limits/test-ui.py
+++ b/tests/hard-limits/test-ui.py
@@ -48,7 +48,7 @@ def assert_wait_complete(command):
#
comp = hal.component("test-ui")
-comp.newpin("x-neg-lim-sw", hal.HAL_BIT, hal.HAL_OUT)
+comp.newpin("x-neg-lim-sw", hal.Type.BOOL, hal.Dir.OUT)
comp.ready()
hal.connect('test-ui.x-neg-lim-sw', 'x-neg-lim-sw')
diff --git a/tests/io-startup/test-ui.py b/tests/io-startup/test-ui.py
index d46c5a1fd6d..0ffd32d26d4 100755
--- a/tests/io-startup/test-ui.py
+++ b/tests/io-startup/test-ui.py
@@ -39,7 +39,7 @@ def wait_for_pin_value(pin_name, value, timeout=5.0):
h = hal.component("test-ui")
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
h.ready() # mark the component as 'ready'
diff --git a/tests/limit3/constraints/test.hal b/tests/limit3/constraints/test.hal
index c7eb9f85c68..9c886f9a12e 100644
--- a/tests/limit3/constraints/test.hal
+++ b/tests/limit3/constraints/test.hal
@@ -25,13 +25,13 @@ net triangle <= siggen.0.triangle
loadrt mux_generic config=ff8
-net sine => mux-gen.00.in-float-00
-net cosine => mux-gen.00.in-float-01
-net square => mux-gen.00.in-float-02
-net sawtooth => mux-gen.00.in-float-03
-net triangle => mux-gen.00.in-float-04
+net sine => mux-gen.00.in-real-00
+net cosine => mux-gen.00.in-real-01
+net square => mux-gen.00.in-real-02
+net sawtooth => mux-gen.00.in-real-03
+net triangle => mux-gen.00.in-real-04
-net input <= mux-gen.00.out-float
+net input <= mux-gen.00.out-real
#
@@ -49,7 +49,7 @@ setp limit3.0.maxa 15800
net input => limit3.0.in
net output <= limit3.0.out
-net output => mux-gen.00.in-float-05
+net output => mux-gen.00.in-real-05
#
@@ -88,10 +88,10 @@ encoder.0.position-scale = 500
net heartbeat => encoder.0.phase-A
net encoder-position <= encoder.0.position
-loadrt conv_float_u32
-net encoder-position => conv-float-u32.0.in
+loadrt conv_real_uint
+net encoder-position => conv-real-uint.0.in
-net mux-select <= conv-float-u32.0.out
+net mux-select <= conv-real-uint.0.out
net mux-select => mux-gen.00.sel-int
@@ -113,7 +113,7 @@ loadrt threads name1=t period1=1000000
addf charge-pump t
addf encoder.update-counters t
addf encoder.capture-position t
-addf conv-float-u32.0 t
+addf conv-real-uint.0 t
addf siggen.0.update t
addf mux-gen.00 t
diff --git a/tests/mb2hal/mb2hal.1b/expected b/tests/mb2hal/mb2hal.1b/expected
index 61a45c4a4c0..2d2ead72ebe 100644
--- a/tests/mb2hal/mb2hal.1b/expected
+++ b/tests/mb2hal/mb2hal.1b/expected
@@ -1,39 +1,39 @@
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.00
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.01
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.02
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.03
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.00
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.01
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.02
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.03
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.00.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.00.int
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.01.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.01.int
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.02.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.02.int
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.03.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.03.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.00.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.00.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.01.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.01.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.02.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.02.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.03.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.03.int
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.00
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.01
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.02
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.03
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.00
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.01
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.02
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.03
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.00
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.01
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.02
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.03
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.00
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.01
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.02
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.03
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.00
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.01
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.02
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.03
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.00
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.01
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.02
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.03
diff --git a/tests/mb2hal/mb2hal.2b/expected b/tests/mb2hal/mb2hal.2b/expected
index abbcbcb63f8..b2f959b0d5e 100644
--- a/tests/mb2hal/mb2hal.2b/expected
+++ b/tests/mb2hal/mb2hal.2b/expected
@@ -1,69 +1,69 @@
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.00.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.00.bit-inv
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.01.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.01.bit-inv
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.02.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.02.bit-inv
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.03.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.03.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.00.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_02.00.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.01.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_02.01.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.02.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_02.02.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_02.03.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_02.03.bit-inv
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.00.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.00.int
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.01.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.01.int
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.02.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.02.int
- (ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.03.float
- (ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.03.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.00.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.00.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.01.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.01.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.02.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.02.int
+ (ignored comp id) real OUT 0 mb2hal.Modbus_fnct_03.03.float
+ (ignored comp id) sint OUT 0 mb2hal.Modbus_fnct_03.03.int
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.00.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.00.int
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.01.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.01.int
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.02.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.02.int
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.03.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.03.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.00.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_06.00.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.01.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_06.01.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.02.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_06.02.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_06.03.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_06.03.int
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.00.bit
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.01.bit
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.02.bit
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.03.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.00.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.01.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.02.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_15.03.bit
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.00.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.00.int
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.01.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.01.int
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.02.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.02.int
- (ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.03.float
- (ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.03.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.00.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_16.00.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.01.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_16.01.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.02.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_16.02.int
+ (ignored comp id) real IN 0 mb2hal.Modbus_fnct_16.03.float
+ (ignored comp id) sint IN 0 mb2hal.Modbus_fnct_16.03.int
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.00.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.00.bit-inv
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.01.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.01.bit-inv
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.02.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.02.bit-inv
- (ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.03.bit
- (ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.03.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_01.00.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_01.00.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_01.01.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_01.01.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_01.02.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_01.02.bit-inv
+ (ignored comp id) bool OUT FALSE mb2hal.Modbus_fnct_01.03.bit
+ (ignored comp id) bool OUT TRUE mb2hal.Modbus_fnct_01.03.bit-inv
Component Pins:
Owner Type Dir Value Name
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.00.bit
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.01.bit
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.02.bit
- (ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.03.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_05.00.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_05.01.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_05.02.bit
+ (ignored comp id) bool IN FALSE mb2hal.Modbus_fnct_05.03.bit
diff --git a/tests/mdi-queue-length/test-ui.py b/tests/mdi-queue-length/test-ui.py
index 44ddaeef741..5d966f4eeac 100755
--- a/tests/mdi-queue-length/test-ui.py
+++ b/tests/mdi-queue-length/test-ui.py
@@ -61,11 +61,11 @@ def wait_for_mdi_queue(queue_len, timeout=10):
h = hal.component("test-ui")
-h.newpin("digital-poker", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("digital-poker", hal.Type.BOOL, hal.Dir.OUT)
h['digital-poker'] = False
h.ready()
-hal.new_sig('poke', hal.HAL_BIT)
+hal.new_sig('poke', hal.Type.BOOL)
hal.connect('motion.digital-in-00', 'poke')
hal.connect('test-ui.digital-poker', 'poke')
diff --git a/tests/motion-logger/basic/test-ui.py b/tests/motion-logger/basic/test-ui.py
index d1135170f67..21da4c2bd47 100755
--- a/tests/motion-logger/basic/test-ui.py
+++ b/tests/motion-logger/basic/test-ui.py
@@ -12,7 +12,7 @@
import re
comp = hal.component("test-ui")
-comp.newpin("reopen-log", hal.HAL_BIT, hal.HAL_IO)
+comp.newpin("reopen-log", hal.Type.BOOL, hal.Dir.IO)
comp.ready()
os.system("halcmd net reopen-log test-ui.reopen-log motion-logger.reopen-log")
diff --git a/tests/motion/jogwheel-axis/test-ui.py b/tests/motion/jogwheel-axis/test-ui.py
index e66b3ae478c..052a8e2a6f8 100755
--- a/tests/motion/jogwheel-axis/test-ui.py
+++ b/tests/motion/jogwheel-axis/test-ui.py
@@ -60,20 +60,20 @@ def jog_axis(axis_letter, counts=1, scale=0.001):
h = hal.component("test-ui")
-h.newpin("axis-x-jog-enable", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("axis-x-jog-counts", hal.HAL_S32, hal.HAL_OUT)
-h.newpin("axis-x-jog-scale", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("axis-x-position", hal.HAL_FLOAT, hal.HAL_IN)
-
-h.newpin("axis-y-jog-enable", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("axis-y-jog-counts", hal.HAL_S32, hal.HAL_OUT)
-h.newpin("axis-y-jog-scale", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("axis-y-position", hal.HAL_FLOAT, hal.HAL_IN)
-
-h.newpin("axis-z-jog-enable", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("axis-z-jog-counts", hal.HAL_S32, hal.HAL_OUT)
-h.newpin("axis-z-jog-scale", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("axis-z-position", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("axis-x-jog-enable", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("axis-x-jog-counts", hal.Type.SINT, hal.Dir.OUT)
+h.newpin("axis-x-jog-scale", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("axis-x-position", hal.Type.REAL, hal.Dir.IN)
+
+h.newpin("axis-y-jog-enable", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("axis-y-jog-counts", hal.Type.SINT, hal.Dir.OUT)
+h.newpin("axis-y-jog-scale", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("axis-y-position", hal.Type.REAL, hal.Dir.IN)
+
+h.newpin("axis-z-jog-enable", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("axis-z-jog-counts", hal.Type.SINT, hal.Dir.OUT)
+h.newpin("axis-z-jog-scale", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("axis-z-position", hal.Type.REAL, hal.Dir.IN)
h.ready() # mark the component as 'ready'
diff --git a/tests/motion/jogwheel-joint/test-ui.py b/tests/motion/jogwheel-joint/test-ui.py
index 076f659d5df..9ac0d33a104 100755
--- a/tests/motion/jogwheel-joint/test-ui.py
+++ b/tests/motion/jogwheel-joint/test-ui.py
@@ -75,20 +75,20 @@ def jog_joint(joint_number, counts=1, scale=0.001):
h = hal.component("test-ui")
-h.newpin("joint-0-jog-enable", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-0-jog-counts", hal.HAL_S32, hal.HAL_OUT)
-h.newpin("joint-0-jog-scale", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("joint-0-position", hal.HAL_FLOAT, hal.HAL_IN)
-
-h.newpin("joint-1-jog-enable", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-1-jog-counts", hal.HAL_S32, hal.HAL_OUT)
-h.newpin("joint-1-jog-scale", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("joint-1-position", hal.HAL_FLOAT, hal.HAL_IN)
-
-h.newpin("joint-2-jog-enable", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("joint-2-jog-counts", hal.HAL_S32, hal.HAL_OUT)
-h.newpin("joint-2-jog-scale", hal.HAL_FLOAT, hal.HAL_OUT)
-h.newpin("joint-2-position", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("joint-0-jog-enable", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-0-jog-counts", hal.Type.SINT, hal.Dir.OUT)
+h.newpin("joint-0-jog-scale", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("joint-0-position", hal.Type.REAL, hal.Dir.IN)
+
+h.newpin("joint-1-jog-enable", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-1-jog-counts", hal.Type.SINT, hal.Dir.OUT)
+h.newpin("joint-1-jog-scale", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("joint-1-position", hal.Type.REAL, hal.Dir.IN)
+
+h.newpin("joint-2-jog-enable", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("joint-2-jog-counts", hal.Type.SINT, hal.Dir.OUT)
+h.newpin("joint-2-jog-scale", hal.Type.REAL, hal.Dir.OUT)
+h.newpin("joint-2-position", hal.Type.REAL, hal.Dir.IN)
h.ready() # mark the component as 'ready'
diff --git a/tests/mux/expected b/tests/mux/expected
index 5b8ef33feec..4403fedcd37 100644
--- a/tests/mux/expected
+++ b/tests/mux/expected
@@ -19,25 +19,25 @@
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 0 1.110000 0 0
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 0 1.110000 0 0
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 0 1.110000 0 0
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 2.220000 1 1
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 1 3.330000 0 2
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 1 3.330000 0 2
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 1 3.330000 0 2
@@ -58,21 +58,21 @@
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 0 3.330000 0 2
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 0 3.330000 0 2
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 0 3.330000 0 2
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 0 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
-1 1.000000 1 1 1 5000000000.001000 2147483647 4294967295 1 -100.000000 -100 0 1 4294967295.000000 2147483647 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 0 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
+1 1.000000 1 1 1 5000000000.001000 5000000000 5000000000 1 -100.000000 -100 0 1 4294967295.000000 4294967295 4294967295 1 4.440000 1 3
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 1 5.550000 0 4
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 1 5.550000 0 4
0 0.000000 0 0 0 0.000000 0 0 1 -999.000000 -999 0 0 0.000000 0 0 1 5.550000 0 4
diff --git a/tests/mux/test.hal b/tests/mux/test.hal
index ee1c4e18b93..5cd72d1d369 100644
--- a/tests/mux/test.hal
+++ b/tests/mux/test.hal
@@ -25,20 +25,20 @@ addf mux-gen.16 slow
addf mux-gen.17 slow
addf sampler.0 slow
-net v0 mux-gen.00.in-bit-00 mux-gen.01.in-bit-00 mux-gen.02.in-bit-00 mux-gen.03.in-bit-00 mux-gen.16.in-bit-00
-net v1 mux-gen.04.in-float-00 mux-gen.05.in-float-00 mux-gen.06.in-float-00 mux-gen.07.in-float-00
-net v2 mux-gen.08.in-s32-00 mux-gen.09.in-s32-00 mux-gen.10.in-s32-00 mux-gen.11.in-s32-00
-net v3 mux-gen.12.in-u32-00 mux-gen.13.in-u32-00 mux-gen.14.in-u32-00 mux-gen.15.in-u32-00
+net v0 mux-gen.00.in-bool-00 mux-gen.01.in-bool-00 mux-gen.02.in-bool-00 mux-gen.03.in-bool-00 mux-gen.16.in-bool-00
+net v1 mux-gen.04.in-real-00 mux-gen.05.in-real-00 mux-gen.06.in-real-00 mux-gen.07.in-real-00
+net v2 mux-gen.08.in-sint-00 mux-gen.09.in-sint-00 mux-gen.10.in-sint-00 mux-gen.11.in-sint-00
+net v3 mux-gen.12.in-uint-00 mux-gen.13.in-uint-00 mux-gen.14.in-uint-00 mux-gen.15.in-uint-00
-net v4 mux-gen.00.in-bit-01 mux-gen.01.in-bit-01 mux-gen.02.in-bit-01 mux-gen.03.in-bit-01 mux-gen.16.in-bit-01
-net v5 mux-gen.04.in-float-01 mux-gen.05.in-float-01 mux-gen.06.in-float-01 mux-gen.07.in-float-01
-net v6 mux-gen.08.in-s32-01 mux-gen.09.in-s32-01 mux-gen.10.in-s32-01 mux-gen.11.in-s32-01
-net v7 mux-gen.12.in-u32-01 mux-gen.13.in-u32-01 mux-gen.14.in-u32-01 mux-gen.15.in-u32-01
+net v4 mux-gen.00.in-bool-01 mux-gen.01.in-bool-01 mux-gen.02.in-bool-01 mux-gen.03.in-bool-01 mux-gen.16.in-bool-01
+net v5 mux-gen.04.in-real-01 mux-gen.05.in-real-01 mux-gen.06.in-real-01 mux-gen.07.in-real-01
+net v6 mux-gen.08.in-sint-01 mux-gen.09.in-sint-01 mux-gen.10.in-sint-01 mux-gen.11.in-sint-01
+net v7 mux-gen.12.in-uint-01 mux-gen.13.in-uint-01 mux-gen.14.in-uint-01 mux-gen.15.in-uint-01
-net sel mux-gen.00.sel-bit-00 mux-gen.01.sel-bit-00 mux-gen.02.sel-bit-00 mux-gen.03.sel-bit-00
-net sel mux-gen.04.sel-bit-00 mux-gen.05.sel-bit-00 mux-gen.06.sel-bit-00 mux-gen.07.sel-bit-00
-net sel mux-gen.08.sel-bit-00 mux-gen.09.sel-bit-00 mux-gen.10.sel-bit-00 mux-gen.11.sel-bit-00
-net sel mux-gen.12.sel-bit-00 mux-gen.13.sel-bit-00 mux-gen.14.sel-bit-00 mux-gen.15.sel-bit-00
+net sel mux-gen.00.sel-bit-00 mux-gen.01.sel-bit-00 mux-gen.02.sel-bit-00 mux-gen.03.sel-bit-00
+net sel mux-gen.04.sel-bit-00 mux-gen.05.sel-bit-00 mux-gen.06.sel-bit-00 mux-gen.07.sel-bit-00
+net sel mux-gen.08.sel-bit-00 mux-gen.09.sel-bit-00 mux-gen.10.sel-bit-00 mux-gen.11.sel-bit-00
+net sel mux-gen.12.sel-bit-00 mux-gen.13.sel-bit-00 mux-gen.14.sel-bit-00 mux-gen.15.sel-bit-00
net sel mux-gen.16.sel-bit-00
sets v0 0
@@ -52,33 +52,33 @@ sets v7 0xFFFFFFFF
setp mux-gen.16.debounce-us 4000
-setp mux-gen.17.in-float-00 1.11
-setp mux-gen.17.in-float-01 2.22
-setp mux-gen.17.in-float-02 3.33
-setp mux-gen.17.in-float-03 4.44
-setp mux-gen.17.in-float-04 5.55
+setp mux-gen.17.in-real-00 1.11
+setp mux-gen.17.in-real-01 2.22
+setp mux-gen.17.in-real-02 3.33
+setp mux-gen.17.in-real-03 4.44
+setp mux-gen.17.in-real-04 5.55
net sel streamer.0.pin.0 sampler.0.pin.18
net u streamer.0.pin.1 sampler.0.pin.19 mux-gen.17.sel-int
-net o0 mux-gen.00.out-bit sampler.0.pin.0
-net o1 mux-gen.01.out-float sampler.0.pin.1
-net o2 mux-gen.02.out-s32 sampler.0.pin.2
-net o3 mux-gen.03.out-u32 sampler.0.pin.3
-net o4 mux-gen.04.out-bit sampler.0.pin.4
-net o5 mux-gen.05.out-float sampler.0.pin.5
-net o6 mux-gen.06.out-s32 sampler.0.pin.6
-net o7 mux-gen.07.out-u32 sampler.0.pin.7
-net o8 mux-gen.08.out-bit sampler.0.pin.8
-net o9 mux-gen.09.out-float sampler.0.pin.9
-net o10 mux-gen.10.out-s32 sampler.0.pin.10
-net o11 mux-gen.11.out-u32 sampler.0.pin.11
-net o12 mux-gen.12.out-bit sampler.0.pin.12
-net o13 mux-gen.13.out-float sampler.0.pin.13
-net o14 mux-gen.14.out-s32 sampler.0.pin.14
-net o15 mux-gen.15.out-u32 sampler.0.pin.15
-net o16 mux-gen.16.out-bit sampler.0.pin.16
-net o17 mux-gen.17.out-float sampler.0.pin.17
+net o0 mux-gen.00.out-bool sampler.0.pin.0
+net o1 mux-gen.01.out-real sampler.0.pin.1
+net o2 mux-gen.02.out-sint sampler.0.pin.2
+net o3 mux-gen.03.out-uint sampler.0.pin.3
+net o4 mux-gen.04.out-bool sampler.0.pin.4
+net o5 mux-gen.05.out-real sampler.0.pin.5
+net o6 mux-gen.06.out-sint sampler.0.pin.6
+net o7 mux-gen.07.out-uint sampler.0.pin.7
+net o8 mux-gen.08.out-bool sampler.0.pin.8
+net o9 mux-gen.09.out-real sampler.0.pin.9
+net o10 mux-gen.10.out-sint sampler.0.pin.10
+net o11 mux-gen.11.out-uint sampler.0.pin.11
+net o12 mux-gen.12.out-bool sampler.0.pin.12
+net o13 mux-gen.13.out-real sampler.0.pin.13
+net o14 mux-gen.14.out-sint sampler.0.pin.14
+net o15 mux-gen.15.out-uint sampler.0.pin.15
+net o16 mux-gen.16.out-bool sampler.0.pin.16
+net o17 mux-gen.17.out-real sampler.0.pin.17
loadusr halstreamer input-signals
loadusr -w sleep 0.5
diff --git a/tests/pyvcp/expected b/tests/pyvcp/expected
index fcbcdb67b5f..b8dd870993d 100644
--- a/tests/pyvcp/expected
+++ b/tests/pyvcp/expected
@@ -1,24 +1,24 @@
-mypanel float OUT 0 mypanel.dial-a-out
-mypanel float OUT 0 mypanel.dial-b-out
-mypanel float IN 0 mypanel.dial-c-in
-mypanel float OUT 0 mypanel.dial-c-out
-mypanel float OUT 0 mypanel.dial.0.out
-mypanel float IN 0 mypanel.dial.0.param_pin
-mypanel float IN 0 mypanel.dial.1.param_pin
-mypanel float IN 0 mypanel.dial.2.param_pin
-mypanel float OUT 0 mypanel.scale-a-out-f
-mypanel s32 OUT 0 mypanel.scale-a-out-i
-mypanel float OUT 0 mypanel.scale-b-out-f
-mypanel s32 OUT 0 mypanel.scale-b-out-i
-mypanel float IN 0 mypanel.scale-c-in
-mypanel float OUT 0 mypanel.scale-c-out-f
-mypanel s32 OUT 0 mypanel.scale-c-out-i
-mypanel float OUT 0 mypanel.scale.0-f
-mypanel s32 OUT 0 mypanel.scale.0-i
-mypanel float IN 0 mypanel.scale.2.param_pin
-mypanel float OUT 0 mypanel.spinbox-a-out
-mypanel float OUT 0 mypanel.spinbox-b-out
-mypanel float IN 0 mypanel.spinbox-c-in
-mypanel float OUT 0 mypanel.spinbox-c-out
-mypanel float OUT 0 mypanel.spinbox.0
-mypanel float IN 0 mypanel.spinbox.2.param_pin
+mypanel real OUT 0 mypanel.dial-a-out
+mypanel real OUT 0 mypanel.dial-b-out
+mypanel real IN 0 mypanel.dial-c-in
+mypanel real OUT 0 mypanel.dial-c-out
+mypanel real OUT 0 mypanel.dial.0.out
+mypanel real IN 0 mypanel.dial.0.param_pin
+mypanel real IN 0 mypanel.dial.1.param_pin
+mypanel real IN 0 mypanel.dial.2.param_pin
+mypanel real OUT 0 mypanel.scale-a-out-f
+mypanel sint OUT 0 mypanel.scale-a-out-i
+mypanel real OUT 0 mypanel.scale-b-out-f
+mypanel sint OUT 0 mypanel.scale-b-out-i
+mypanel real IN 0 mypanel.scale-c-in
+mypanel real OUT 0 mypanel.scale-c-out-f
+mypanel sint OUT 0 mypanel.scale-c-out-i
+mypanel real OUT 0 mypanel.scale.0-f
+mypanel sint OUT 0 mypanel.scale.0-i
+mypanel real IN 0 mypanel.scale.2.param_pin
+mypanel real OUT 0 mypanel.spinbox-a-out
+mypanel real OUT 0 mypanel.spinbox-b-out
+mypanel real IN 0 mypanel.spinbox-c-in
+mypanel real OUT 0 mypanel.spinbox-c-out
+mypanel real OUT 0 mypanel.spinbox.0
+mypanel real IN 0 mypanel.spinbox.2.param_pin
diff --git a/tests/raster/rastertest.py b/tests/raster/rastertest.py
index 31cf8978490..9ab7ce83e97 100755
--- a/tests/raster/rastertest.py
+++ b/tests/raster/rastertest.py
@@ -188,22 +188,22 @@ def main():
c = hal.component("test")
pin = {
- 'reset': c.newpin("reset", hal.HAL_BIT, hal.HAL_OUT),
- 'enabled': c.newpin("enabled", hal.HAL_BIT, hal.HAL_IN),
- 'position': c.newpin("position", hal.HAL_FLOAT, hal.HAL_OUT),
- 'output': c.newpin("output", hal.HAL_FLOAT, hal.HAL_IN),
- 'offset': c.newpin("offset", hal.HAL_FLOAT, hal.HAL_IN),
- 'bpp': c.newpin("bpp", hal.HAL_S32, hal.HAL_IN),
- 'ppu': c.newpin("ppu", hal.HAL_FLOAT, hal.HAL_IN),
- 'count': c.newpin("count", hal.HAL_S32, hal.HAL_IN),
- 'fault': c.newpin("fault", hal.HAL_BIT, hal.HAL_IN),
- 'fault_code': c.newpin("fault-code", hal.HAL_S32, hal.HAL_IN),
- 'state': c.newpin("state", hal.HAL_S32, hal.HAL_IN),
- 'bitmap_position': c.newpin("bitmap-position", hal.HAL_FLOAT, hal.HAL_IN),
- 'current_pixel_index': c.newpin("current-pixel-index", hal.HAL_S32, hal.HAL_IN),
- 'current_pixel_value': c.newpin("current-pixel-value", hal.HAL_FLOAT, hal.HAL_IN),
- 'previous_pixel_value': c.newpin("previous-pixel-value", hal.HAL_FLOAT, hal.HAL_IN),
- 'fraction': c.newpin("fraction", hal.HAL_FLOAT, hal.HAL_IN),
+ 'reset': c.newpin("reset", hal.Type.BOOL, hal.Dir.OUT),
+ 'enabled': c.newpin("enabled", hal.Type.BOOL, hal.Dir.IN),
+ 'position': c.newpin("position", hal.Type.REAL, hal.Dir.OUT),
+ 'output': c.newpin("output", hal.Type.REAL, hal.Dir.IN),
+ 'offset': c.newpin("offset", hal.Type.REAL, hal.Dir.IN),
+ 'bpp': c.newpin("bpp", hal.Type.SINT, hal.Dir.IN),
+ 'ppu': c.newpin("ppu", hal.Type.REAL, hal.Dir.IN),
+ 'count': c.newpin("count", hal.Type.SINT, hal.Dir.IN),
+ 'fault': c.newpin("fault", hal.Type.BOOL, hal.Dir.IN),
+ 'fault_code': c.newpin("fault-code", hal.Type.SINT, hal.Dir.IN),
+ 'state': c.newpin("state", hal.Type.SINT, hal.Dir.IN),
+ 'bitmap_position': c.newpin("bitmap-position", hal.Type.REAL, hal.Dir.IN),
+ 'current_pixel_index': c.newpin("current-pixel-index", hal.Type.SINT, hal.Dir.IN),
+ 'current_pixel_value': c.newpin("current-pixel-value", hal.Type.REAL, hal.Dir.IN),
+ 'previous_pixel_value': c.newpin("previous-pixel-value", hal.Type.REAL, hal.Dir.IN),
+ 'fraction': c.newpin("fraction", hal.Type.REAL, hal.Dir.IN),
}
c.ready()
diff --git a/tests/remap/remap-io/test-ui.py b/tests/remap/remap-io/test-ui.py
index 65640490d6f..c96923b1124 100755
--- a/tests/remap/remap-io/test-ui.py
+++ b/tests/remap/remap-io/test-ui.py
@@ -5,10 +5,10 @@
# Set up pins
h = hal.component("test-ui")
-h.newpin('d_out', hal.HAL_BIT, hal.HAL_IN) # pin for reading digital out
-h.newpin('a_out', hal.HAL_FLOAT, hal.HAL_IN) # pin for reading analog out
-h.newpin('d_in', hal.HAL_BIT, hal.HAL_OUT) # pin for setting digital in
-h.newpin('a_in', hal.HAL_FLOAT, hal.HAL_OUT) # pin for setting analog in
+h.newpin('d_out', hal.Type.BOOL, hal.Dir.IN) # pin for reading digital out
+h.newpin('a_out', hal.Type.REAL, hal.Dir.IN) # pin for reading analog out
+h.newpin('d_in', hal.Type.BOOL, hal.Dir.OUT) # pin for setting digital in
+h.newpin('a_in', hal.Type.REAL, hal.Dir.OUT) # pin for setting analog in
h.ready() # mark the component as 'ready'
os.system('halcmd source postgui.hal') # Net above pins to motion I/O pins
diff --git a/tests/save.0/expected b/tests/save.0/expected
index 833c015c198..6b849eb5e0c 100644
--- a/tests/save.0/expected
+++ b/tests/save.0/expected
@@ -6,20 +6,20 @@ loadrt sampler cfg=bb depth=4096
# pin aliases
# param aliases
# signals
-newsig unlinked bit
+newsig unlinked bool
# nets
net dir stepgen.0.dir => sampler.0.pin.0
net step stepgen.0.step => sampler.0.pin.1
# parameter values
setp fast.tmax 0
setp sampler.0.tmax 0
-setp stepgen.0.dirhold 0x00000001
-setp stepgen.0.dirsetup 0x00000001
+setp stepgen.0.dirhold 0x0000000000000001
+setp stepgen.0.dirsetup 0x0000000000000001
setp stepgen.0.maxaccel 2
setp stepgen.0.maxvel 0.15
setp stepgen.0.position-scale 32000
-setp stepgen.0.steplen 0x00000001
-setp stepgen.0.stepspace 0x00000001
+setp stepgen.0.steplen 0x0000000000000001
+setp stepgen.0.stepspace 0x0000000000000001
setp stepgen.capture-position.tmax 0
setp stepgen.make-pulses.tmax 0
setp stepgen.update-freq.tmax 0
diff --git a/tests/single-step/test-ui.py b/tests/single-step/test-ui.py
index aaac15a8f93..00855f3ff7b 100755
--- a/tests/single-step/test-ui.py
+++ b/tests/single-step/test-ui.py
@@ -21,10 +21,10 @@
# Create and connect test feedback comp
#
h = hal.component("test-ui")
-h.newpin("Xpos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("Ypos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("Zpos", hal.HAL_FLOAT, hal.HAL_IN)
-h.newpin("counter", hal.HAL_FLOAT, hal.HAL_IN)
+h.newpin("Xpos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("Ypos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("Zpos", hal.Type.REAL, hal.Dir.IN)
+h.newpin("counter", hal.Type.REAL, hal.Dir.IN)
h.ready()
os.system("halcmd source ./postgui.hal")
diff --git a/tests/tlo/test-ui.py b/tests/tlo/test-ui.py
index c6c1f5e0402..42fe9390895 100755
--- a/tests/tlo/test-ui.py
+++ b/tests/tlo/test-ui.py
@@ -114,7 +114,7 @@ def verify_tool(tool, x, y, z, a, b, c, u, v, w, diameter, front_angle, back_ang
h = hal.component("python-ui")
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
h.ready() # mark the component as 'ready'
diff --git a/tests/tool-info/non-random/test-ui.py b/tests/tool-info/non-random/test-ui.py
index 137ad78c606..917cfaac0f9 100755
--- a/tests/tool-info/non-random/test-ui.py
+++ b/tests/tool-info/non-random/test-ui.py
@@ -127,13 +127,13 @@ def wait_for_hal_pin(pin_name, value, timeout=10):
h = hal.component("test-ui")
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("tool-change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-pocket", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prepare", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-prepared", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("tool-change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
h['tool-prepared'] = False
h['tool-changed'] = False
h.ready()
diff --git a/tests/tool-info/random-no-startup-tool/test-ui.py b/tests/tool-info/random-no-startup-tool/test-ui.py
index 62fe5707ad3..4f4f0a25af5 100755
--- a/tests/tool-info/random-no-startup-tool/test-ui.py
+++ b/tests/tool-info/random-no-startup-tool/test-ui.py
@@ -127,13 +127,13 @@ def wait_for_hal_pin(pin_name, value, timeout=10):
h = hal.component("test-ui")
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("tool-change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-pocket", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prepare", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-prepared", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("tool-change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
h['tool-prepared'] = False
h['tool-changed'] = False
h.ready()
diff --git a/tests/tool-info/random-with-startup-tool/test-ui.py b/tests/tool-info/random-with-startup-tool/test-ui.py
index 1f373cd327d..af906bf82b5 100755
--- a/tests/tool-info/random-with-startup-tool/test-ui.py
+++ b/tests/tool-info/random-with-startup-tool/test-ui.py
@@ -127,13 +127,13 @@ def wait_for_hal_pin(pin_name, value, timeout=10):
h = hal.component("test-ui")
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_OUT)
-h.newpin("tool-change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-pocket", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prepare", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-prepared", hal.Type.BOOL, hal.Dir.OUT)
+h.newpin("tool-change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
h['tool-prepared'] = False
h['tool-changed'] = False
h.ready()
diff --git a/tests/toolchanger/m61/test-ui.py b/tests/toolchanger/m61/test-ui.py
index ca29beb5d6e..025cc58a36d 100755
--- a/tests/toolchanger/m61/test-ui.py
+++ b/tests/toolchanger/m61/test-ui.py
@@ -125,16 +125,16 @@ def do_tool_change_handshake(tool_number, pocket_number):
h = hal.component("python-ui")
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-from-pocket", hal.HAL_S32, hal.HAL_IN)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-pocket", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-from-pocket", hal.Type.SINT, hal.Dir.IN)
-h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-prepare", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-prepared", hal.Type.BOOL, hal.Dir.OUT)
-h.newpin("tool-change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
h.ready() # mark the component as 'ready'
diff --git a/tests/toolchanger/reload-tool/non-random/test-ui.py b/tests/toolchanger/reload-tool/non-random/test-ui.py
index 7bff305516f..fca46c3e9f6 100755
--- a/tests/toolchanger/reload-tool/non-random/test-ui.py
+++ b/tests/toolchanger/reload-tool/non-random/test-ui.py
@@ -39,18 +39,18 @@ def wait_for_hal_pin(name, value, timeout=10):
h = hal.component("test-ui")
-h.newpin("tool-change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
h["tool-changed"] = False
-h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-prepare", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-prepared", hal.Type.BOOL, hal.Dir.OUT)
h["tool-prepared"] = False
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-from-pocket", hal.HAL_S32, hal.HAL_IN)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-pocket", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-from-pocket", hal.Type.SINT, hal.Dir.IN)
h.ready()
diff --git a/tests/toolchanger/reload-tool/random/test-ui.py b/tests/toolchanger/reload-tool/random/test-ui.py
index 7e5fc520eca..22509af932d 100755
--- a/tests/toolchanger/reload-tool/random/test-ui.py
+++ b/tests/toolchanger/reload-tool/random/test-ui.py
@@ -39,18 +39,18 @@ def wait_for_hal_pin(name, value, timeout=10):
h = hal.component("test-ui")
-h.newpin("tool-change", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-changed", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-change", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-changed", hal.Type.BOOL, hal.Dir.OUT)
h["tool-changed"] = False
-h.newpin("tool-prepare", hal.HAL_BIT, hal.HAL_IN)
-h.newpin("tool-prepared", hal.HAL_BIT, hal.HAL_OUT)
+h.newpin("tool-prepare", hal.Type.BOOL, hal.Dir.IN)
+h.newpin("tool-prepared", hal.Type.BOOL, hal.Dir.OUT)
h["tool-prepared"] = False
-h.newpin("tool-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-number", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-prep-pocket", hal.HAL_S32, hal.HAL_IN)
-h.newpin("tool-from-pocket", hal.HAL_S32, hal.HAL_IN)
+h.newpin("tool-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-number", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-prep-pocket", hal.Type.SINT, hal.Dir.IN)
+h.newpin("tool-from-pocket", hal.Type.SINT, hal.Dir.IN)
h.ready()