Select to view content in your preferred language

Rangefinder OnMeasurement

659
2
12-29-2010 06:33 AM
MikeDahm
Frequent Contributor
I have a layer that will be collected by one point offset using a Rangefinder and a GeoXT.  Within my edit form I have a measurement tab that I am using to calculate height and width of an object.  I know that the OnMeasurement is absorbed by Arcpad when the rangefinder triggers a capture offset point.  Is there a way within the Edit Form to disable this for a Page?

I tried loading the measurement page as a separate general Form but then the OnMeasurement applet that I am using doesn't seem to work, it only seems to work with the Edit Form.

Any suggestions?
Tags (3)
0 Kudos
2 Replies
EricHajek1
Regular Contributor
What I think you want to do is the following:
Open the AXF and then the feature layer whose editform you want to collect RF measurements in.
Add a "System Object" by clicking the icon that looks like a couple of gears. You might have to focus the feature layer's window within ArcPad Studio for it to become active.
It'll bring up a menu with various system events in it, so the one we want is Rangefinder -> OnMeasurement.
Each time it receives a measurement sentence from the Rangefinder while the editform (perhaps other forms as well?) is active, the script you put into the onmeasurement box will be run.

If you need to enter values into different editboxes at different times, you could create some global variables, and set them to the names of those editboxes when they fire thier onsetfocus events, and then clear the variables on the onkillfocus events. Your onmeasurement could look something like this:

If Not LRFPage = "" and Not LRFControl = "" Then
currForm.Pages(LRFPage).Controls(LRFControl).value = Round((Rangefinder.Distance * 3.2808399),2)
End If

(In this case, currForm is a global variable referring to the editform that is open. LRFPage and LRFControl are assigned and unassigned (set to "") based on what editbox is currently focused using thier onsetfocus / onkillfocus events as mentioned above. So if no controls are focused, onmeasurement does nothing. )

Let me know if you have any questions, but I'm sort of new to using rangefinders as well, so if anyone has a more elegant solution I'd love to hear about it.
0 Kudos
MikeDahm
Frequent Contributor
I do have a separate script running the RANGEFINDER onmeasurement="MeasurementReceived(); command that directs it to what I want it to measure within my EditForm.  The problem is that I am locating the points with the rangefinder and when using an offset point Arcpad locks you out of the OnMeasurement within the EditForm.  

I did find a way to get around the rangefinder being locked down by ArcPad.  In the OnLoad event for the EditForm I trick ArcPad by turning closing the rangefinder opening it back up.  It pauses the form when it opens for a second or two but it works so far.
0 Kudos