u32 image
- piasdom
- Topic Author
- Offline
- Platinum Member
- Posts: 469
- Thank you received: 10
in the xml file or hal ?
if in hal, pyvcp.testimage0
pyvcp.testimage1
etc ...
The "image_u32" is the same as "image_bit" except you have essentially an unlimited number of images and you "select" the image by setting the halpin to a integer value with 0 for the first image in the images list and 1 for the second image etc.
Thanks
kenneth
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23178
- Thank you received: 4864
(I don't know why it is called that, a better description would be "bit2binary")
Please Log in or Create an account to join the conversation.
- piasdom
- Topic Author
- Offline
- Platinum Member
- Posts: 469
- Thank you received: 10
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23178
- Thank you received: 4864
What is the data type of the date you want to indicate?
Please Log in or Create an account to join the conversation.
- piasdom
- Topic Author
- Offline
- Platinum Member
- Posts: 469
- Thank you received: 10
i found a u_32 pin(halui.joint.selected) and used that to get the pyvcp button to show in axis.
now i'm trying to click the button to change the images. i have the button and the
first image is displayed but never changes. but the way you asked the question makes me think
i don't understand u32
Thanks
kenneth
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23178
- Thank you received: 4864
well, i'm trying to use a button to change the image three times.as with image_bit.
i found a u_32 pin(halui.joint.selected) and used that to get the pyvcp button to show in axis.
now i'm trying to click the button to change the images. i have the button and the
first image is displayed but never changes. but the way you asked the question makes me think
i don't understand u32
I think you will find that the image change if you select a different joint....
Click the X Y Z buttons in the Axis UI and you will probably see the image change.
You need to have a u32 pin which has a value that changes as a result of your button press.
I can think of ways to make a value count up by one every time a pyvcp button is pressed, but it is likely to involve a lot of edge detectors and other functions
Please Log in or Create an account to join the conversation.
- piasdom
- Topic Author
- Offline
- Platinum Member
- Posts: 469
- Thank you received: 10
select x ... click button and no change.
but i think i have my lick wrong. when i try to connect halui.joint.selected to
test-pin, says i can't connect 32 to bit. i tried toggle, and2 and or2 and get the
error about crossing u to bit. 32
#testing
net test-pin pyvcp.test
net tested-pin halui.joint.selected pyvcp.testimage
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23178
- Thank you received: 4864
www.linuxcnc.org/docview/2.5/html/hal/ba..._a_id_sec_hal_data_a
There are functions in HAL to convert between them:
conv_bit_s32
conv_bit_u32
conv_float_s32
conv_float_u32
conv_s32_bit
conv_s32_float
conv_s32_u32
conv_u32_bit
conv_u32_float
conv_u32_s32
Please Log in or Create an account to join the conversation.
- piasdom
- Topic Author
- Offline
- Platinum Member
- Posts: 469
- Thank you received: 10
Please Log in or Create an account to join the conversation.
- piasdom
- Topic Author
- Offline
- Platinum Member
- Posts: 469
- Thank you received: 10
changes to the second gif. i let go and it goes back the the first gif. the images are some
i already had. should i try a toggle or and2 in the net ?
<labelframe text = "test">
<image name='on' file='on.gif'/>
<image name='off' file='off.gif'/>
<image name='estop' file='Estop.gif'/>
<vbox>
<image_u32 halpin='testimage' images='on off estop'/>
</vbox>
<button>
<halpin>"test"</halpin>
<text>"testing"</text>
<font>('Helvetica 2',14)</font>
<fg>"midnightblue"</fg>
</button>
</labelframe>
post.hal
#testing
net test-pin conv-bit-u32.0.in == pyvcp.test
net tested-pin conv-bit-u32.0.out == pyvcp.testimage
Thanks
kenneth
Please Log in or Create an account to join the conversation.