Jump to: navigation, search

Difference between revisions of "Optical code"


(Unlocking objects)
Line 84: Line 84:
 
</tab>
 
</tab>
 
</tabs>
 
</tabs>
 +
 +
[[Category:Client|Optical code]]
 +
[[Category:Pages with broken file links|Optical code]]
  
 
== Technical background ==
 
== Technical background ==

Revision as of 12:39, 14 April 2021

In order for the users to find objects more efficiently, UBIK® objects can be marked with values for optical codes. Whenever a user scans an optical code, the resulting code value can be used to find all matching objects, namely objects that have the right property.

Types of optical codes

The following types are supported at the moment:

  • Barcode;
  • QR Code;
  • ID Marker.

Types of scanners

The following scanners are used for scanning:

  • ZXing Barcode Scanner (for barcodes and QR codes)
  • ID Marker Scanner - based on Metaio. (for ID Markers) This is now obsolete.
  • Getac Z710 integrated barcode/qr-code scanner (from version 2.4.4 on)


Searching for objects

UBIK® provides two mechanisms for searching objects: online and offline.

Searching offline

In any case (regardless of the network connection and sync mode), UBIK® always goes through all the objects currently available on the device and find the ones that match the scanned results.

Searching online

When the Internet is available and UBIK® is not running under offline mode, the search result is enhanced by online search. This means any objects that match the scanned results can be found even if they don't yet exist locally.

Presenting results of a search

Once the objects are found, they are displayed in a list. The users can then browse to any of the objects for more information by clicking on the objects.

Unlocking objects

In some scenarios where topics such as security, regulations etc. are of higher importance, some objects can often be locked by default until certain codes are scanned.

IC Attention.pngThe unlock codes are always compared case sensitive.

Unlock after a search

By default, a search is started for every scanned code. If an object is found, it is presented in the UI and unlocked. A group of objects sharing the same unlock code are unlocked as well.

Unlock mode

Unlock notification
Unlock notification

It's also possible to start a scan with an "unlock mode" (see XAML example below). In this mode, the app doesn't rely on the search mechanism to find the objects and, therefore, doesn't present anything in the UI. Instead, any objects having their unlock code matching the scanned unlock code are unlocked in the background.

  • It's possible (but optional) to specify an expected unlock code as well. In this case, nothing gets unlocked if the scanned code doesn't match the specified one;
  • It doesn't matter whether objects having the unlock code are present at the time when that code is scanned or not. The scanned unlock code will be remembered for 15 minutes. If objects carrying that same unlock code show up on the client (locally created or downloaded from the server) within that time, they will have an unlocked status automatically.


Example XAML code to enable the unlock mode:

UWP

<Button
   ...
   xmlns:controls="using:UBIK.WinX.Controls"
   Command="{Binding NavigateToScanPageCommand}">
    <Button.CommandParameter>
        <controls:KeyValueList>
            <controls:KeyValueParameter Key="UnlockMode" Value="true" />
            <controls:KeyValueParameter Key="UnlockCode" Value="$LWP01" />
        </controls:KeyValueList>
    </Button.CommandParameter>
</Button>

Xamarin

<Button
   ...
   xmlns:classes="clr-namespace:UBIK.CPL.Classes;assembly=UBIK.CPL"
   Command="{Binding NavigateToScanPageCommand}">
    <Button.CommandParameter>
        <classes:KeyValueList>
            <classes:KeyValueParameter Key="UnlockMode" Value="true" />
            <classes:KeyValueParameter Key="UnlockCode" Value="$LWP01" />
        </classes:KeyValueList>
    </Button.CommandParameter>
</Button>

Technical background

In order for objects to be identifiable through optical codes, they have to carry the SYSCLS OBJECTWITHIDMARKER classification.

The data types of different optical codes are listed as follows:

  • Barcode - String;
  • QR Code - String;
  • ID Marker - Integer.

The service query used for online searching is IDMARKERSCANQUERY.

See also