Set a display screen
There are two types of screens (templates): notification screens and permanent screens.
Notifications screens are only visible for a set period of time. After that time, an automatic transition to the previous (permanent) screen takes place.
The notification screen can only be interrupted by a new screen setting command, either a notification or a permanent one.
To set a screen using SDK you need to provide the following data:
Parameter name | Data type | Description |
---|---|---|
| String | The ID of the selected template. |
| Array | The selected fields in the given template. |
| PGRefreshType | The refresh type used for the screen update. |
(optional) | Int > 0 | If provided, the extent of how long the notification screen displays. |
templateId
: String
This string describes which template to use, in order to show the information on the display device.
Each template has a number of fields into which you can insert your data. Fields usually have a header and a body.
To learn more, see Screen templates.
refreshType
: PGRefreshType
This parameter controls the display device's screen refresh strategy. There are two modes of refreshing: full refreshes and partial refreshes.
Possible values:
PGRefreshType.PGFullRefresh
- A full refresh takes longer because it turns the screen blank before setting the new one. Use it if your current process step is not time-critical and you want to have control over the artifacts visibility (e.g. if you want to control the refresh type every time).GRefreshType.PGPartialRefresh
- A partial refresh is quicker, but there may remain some artifacts from the previous screen. Use it if your current process step is time-critical and artifacts visibility is not an issue.PGRefreshType.PGDefault
- The default strategy defined by ProGlove. Both full or partial refreshes may appear. Use this if you have no preference over one or the other.
Note
The refresh type parameter will be ignored if you set a notification screen. These will always use PGPartialRefresh
.
durationMs
: Int>0
With this parameter you can specify whether you want to set the screen as a notification (>0) or as a permanent screen (=0 or not provided).
It represents the amount of time (in milliseconds) within which the notification should be displayed.
A value of 0 represents a permanent screen. A value <0 will result in a permanent screen as well.
templateFields
: Array
This is the central entry point for your information to enter our services. Provide an array of PGTemplateField
objects that describes the contents of the given template.
Every PGTemplateField
has an ID, a Header, and a Content field:
The ID is a positive integer, which identifies the
TemplateField
.The Content is a string displayed inside the field.
The Header is a string displayed on the top of the field. It should give context to what is shown in the field.
To learn more, see Screen templates.
SDK API
To configure a connected scanner's display, PGCentarlManager
provides PGDisplayManager
property with setScreen
method.
The method accepts PGCommand
with PGScreenData
data containing all the available screen settings.
If the request fails, an Error object is returned via the completion handler block.
- (void)setScreen:(nonnull PGCommand<PGScreenData *> *)screenDataCommand completionHandler:(void (^_Nonnull)(NSError * _Nullable error))completionHandler;
func setScreen(_ screenDataCommand: PGCommand<PGScreenData>, completionHandler: @escaping (Error?) -> Void)