<?xml version="1.0" encoding="UTF-8"?>
|
<hdevelop file_version="1.1" halcon_version="12.0">
|
<procedure name="Go2GenTLStamp">
|
<interface>
|
<io>
|
<par name="Stamps" base_type="iconic" dimension="0"/>
|
</io>
|
<ic>
|
<par name="Index" base_type="ctrl" dimension="0"/>
|
</ic>
|
<oc>
|
<par name="Value" base_type="ctrl" dimension="0"/>
|
</oc>
|
</interface>
|
<body>
|
<c>* Check if we are on a 64-bit machine</c>
|
<l>test_value := 0xFFFFFFFF</l>
|
<l>if (test_value > 0)</l>
|
<l> is64bit := 1</l>
|
<l>else</l>
|
<l> is64bit := 0</l>
|
<l>endif</l>
|
<c>* </c>
|
<l>get_grayval (Stamps, 0, (Index * 4), tempvalue0)</l>
|
<l>get_grayval (Stamps, 0, (Index * 4) + 1, tempvalue1)</l>
|
<l>get_grayval (Stamps, 0, (Index * 4) + 2, tempvalue2)</l>
|
<l>get_grayval (Stamps, 0, (Index * 4) + 3, tempvalue3)</l>
|
<c>* </c>
|
<c>* The actual stamp from the Gocator is 64-bit. tempvalue0 is the most significant 16-bit (i.e. the top bit is the sign bit)</c>
|
<c>* The code below assumes we only need the bottom 32-bit information. User need to update this conversion function if they want to</c>
|
<c>* return 64-bit value.</c>
|
<c>* </c>
|
<l>if (is64bit = 1)</l>
|
<l> tuple_lsh (tempvalue0, 48, tempvalue0)</l>
|
<l> tuple_lsh (tempvalue1, 32, tempvalue1)</l>
|
<l> tuple_lsh (tempvalue2, 16, tempvalue2)</l>
|
<l> tuple_lsh (tempvalue3, 0, tempvalue3)</l>
|
<l> Value := tempvalue0 + tempvalue1 + tempvalue2 + tempvalue3</l>
|
<l>else</l>
|
<l> tuple_lsh (tempvalue2, 16, tempvalue2)</l>
|
<l> tuple_lsh (tempvalue3, 0, tempvalue3)</l>
|
<l> Value := tempvalue2 + tempvalue3</l>
|
<l>endif</l>
|
<l>return ()</l>
|
</body>
|
<docu id="Go2GenTLStamp">
|
<parameters>
|
<parameter id="Index"/>
|
<parameter id="Stamps"/>
|
<parameter id="Value"/>
|
</parameters>
|
</docu>
|
</procedure>
|
</hdevelop>
|