The interface of the Annotation app is fully configurable that can be adapted it to any project.
The forms are defined in .ui text files which have to be in the Documents/annotation_forms/ folder of the device.
These files can be created using any text editor.
Some example forms can be found in the examples folder.
The controls have the following syntax:
Control_type {
parameter: value
other_parameter: value
}
There are three parameters, which are common for most controls:
-
id: this is the unique identifier of the control. This parameter must be defined for all contols, exceptBSeparator. It consists in one word, beginning with a lowercase letter. -
label: the label displayed with the control (all, exceptGPSWidget). It has to be enclosed in quotation marks. -
persistent: if this is set totrue, the control will keep its value after the data is saved; otherwise it resets to the default value (all the input controls)
BEdit: a text/number field.
Parameters:
id- unique identifierlabel- label to be shown near the controlpersistent- set totrueto keep the value of the control after saving the datafieldwidth- sets the width of the text fieldnumberfield- set totrueto accept only numbers. This also sets the on-screen keyboard to numeric.
BSpinBox: a number field with +/- buttons to change its value.
Parameters:
id- unique identifierlabel- label to be shown near the controlpersistent- set totrueto keep the value of the controlautoincrement- set totrueto increment the value of the control after saving a datadefaultvalue- the initial value of the control. When the spinbox is reset, it will take this value again.maxvalue- the upper limit of the value
BSlider: a slider. The parameters are similar to BSpinBox.
Parameters:
id- unique identifierlabel- label to be shown near the controlpersistent- set totrueto keep the value of the controldefaultvalue- the initial value of the control. When the spinbox is reset, it will take this value again.maxvalue- the upper limit of the valuefieldwidth- sets the length of the slider
BCheckBox: a check box
Parameters:
id- unique identifierlabel- label of the check boxpersistent- set totrueto keep the value of the control
BComboBox: a control with selectable values
Parameters:
id- unique identifierlabel- label to be shown near the combo boxpersistent- set totrueto keep the value of the controlitems- the list of the items of the control in format:["Item1","Item2",...]fieldwidth- sets the width of the combo box field
BSeparator: Adds a separator with a title to the interface. Useful for grouping controls
Parameters:
label- title of the next group
Note: Do not set an id for a BSeparator control!
GPSWidget: shows the GPS coordinates. Use this to add georeferencing to the data.
Parameters:
id- unique identifier
Note: Do not assign a label to the GPSWidget control!
CameraWidget: a widget to take a photo. The photo will be saved to the pictures folder (e.g. DCIM on mobile devices) with file name annot_[date]_[time].jpg
Parameters:
id- unique identifier
You can also add comments to a UI file in lines beginning with //, like in C/C++.
-
If you cannot see the
uifile in the dropdown list, make sure that it is in theDocuments/annotation_formsfolder of your device. -
If you see an empty form, it means that something is wrong with your
uifile. Try to remove some controls until you get a working form, and check the removed controls for errors.-
Make sure that each
idis unique! Theidshould be one word, beginning with a letter. -
The parameters are always lowercase and case sensitive; they are followed by
:! (label :is correct;Label =is incorrect) -
Strings (e.g. for
label) are enclosed in quotation marks. Other values (likeid) are without quotation marks. See example below:BCheckbox { id: mycheckbox //no quotation mark label: "Check box" //quotation mark persistent: true //no quotation mark }
-
