Difference between revisions of "OS.bee Customer Display"
(→Customer Display) |
(→Customer Display) |
||
Line 13: | Line 13: | ||
* '''''#dv888.compex.de-''''': this part is master machine. | * '''''#dv888.compex.de-''''': this part is master machine. | ||
* '''''CustomerDisplay''''': this part is the display name which is used by this slave, and it is as same as the display name which is defined in the UI model. | * '''''CustomerDisplay''''': this part is the display name which is used by this slave, and it is as same as the display name which is defined in the UI model. | ||
+ | |||
+ | === Technical changes in DSL model === | ||
+ | |||
+ | ==== changes in dto ==== | ||
+ | * New '''dto''' "'''CustomerDisplayDto'''": | ||
+ | *:<syntaxhighlight lang="java"> | ||
+ | dto CustomerDisplayDto { | ||
+ | var double totalAmount | ||
+ | var boolean left | ||
+ | var String message | ||
+ | var boolean right | ||
+ | var BlobMapping image | ||
+ | ref CashSlipDto slip | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | * Referenced by other DTOs: | ||
+ | *:<syntaxhighlight lang="java"> | ||
+ | autoDto CashPositionDto extends BaseUUIDDto wraps CashPosition { | ||
+ | |||
+ | inheritVar now | ||
+ | inheritVar quantity | ||
+ | inheritVar price | ||
+ | inheritVar amount | ||
+ | inheritRef slip mapto CashSlipDto | ||
+ | inheritRef product mapto MproductDto | ||
+ | inheritRef sales mapto Msales_factDto | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==== changes in UI==== | ||
+ | * New '''UI''': | ||
+ | *:<syntaxhighlight lang="java"> | ||
+ | display Customer { | ||
+ | rootType CustomerDisplayDto | ||
+ | datasource main:CustomerDisplayDto | ||
+ | datasource img:BlobConverter | ||
+ | horizontalLayout { | ||
+ | verticalLayout left { | ||
+ | textfield(i18n noCaption readonly) message | ||
+ | table(i18n noCaption) slip { | ||
+ | scrollToBottom | ||
+ | type CashPositionDto | ||
+ | columns { | ||
+ | column quantity | ||
+ | column product.sku | ||
+ | column product.product_name | ||
+ | column price | ||
+ | column amount | ||
+ | } | ||
+ | sort { | ||
+ | column now asc | ||
+ | } | ||
+ | } | ||
+ | align fill-left | ||
+ | form(styles "os-cash-total") { | ||
+ | decimalField(precision= 2 readonly) totalAmount | ||
+ | } | ||
+ | bind [this.message].value <-- img.input | ||
+ | bind [this.slip].collection <-- main.slip.positions | ||
+ | bind [this.totalAmount].value <-- main.totalAmount | ||
+ | } | ||
+ | verticalLayout right { | ||
+ | image info | ||
+ | bind img.input <-- main.^image | ||
+ | bind [this.info].resource <-- img.output | ||
+ | } | ||
+ | bind [this.left].visible <-- main.left | ||
+ | bind [this.right].visible <-- main.right | ||
+ | } | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | ** 2 part, left & right, control in which state, which part to display | ||
+ | |||
+ | ==== changes in Functionlibrary ==== | ||
+ | * New lines in '''operation''' "'''initImages'''" & '''operation''' "'''conputeTotal'''" : | ||
+ | *:<syntaxhighlight lang="java"> | ||
+ | operation initImages(IStateMachine stateMachine, Object [] params) { | ||
+ | . . . | ||
+ | stateMachine.set("CustomerDisplayImage", cashregister.store.company.companyImage) | ||
+ | . . . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | *:<syntaxhighlight lang="java"> | ||
+ | operation computeTotal(IStateMachine stateMachine) { | ||
+ | . . . | ||
+ | stateMachine.set("CustomerDisplayTotalAmount", amount); | ||
+ | . . . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==== changes in Statemachine ==== | ||
+ | Some new keywords are introduced for this new functionality: | ||
+ | * <syntaxhighlight lang="java"> display <DisplayName> using <DTOName> </syntaxhighlight> | ||
+ | * <syntaxhighlight lang="java"> dto <DTOAlias> type <DTOName> attach <DisplayName> </syntaxhighlight> | ||
+ | * <syntaxhighlight lang="java"> displayText text "some text" @<DisplayName> to <DTOAttribute> </syntaxhighlight> | ||
+ | |||
+ | The references of a DTO that is attached to a display are always synchronized across all connected displays. Single fields must be synchronized by '''displayText'''. | ||
+ | |||
+ | ► e.g.: | ||
+ | <syntaxhighlight lang="java"> | ||
+ | dto cashslip type CashSlipDto attach CustomerDisplay | ||
+ | display CustomerDisplay using CustomerDisplayDto | ||
+ | displayText text "locked" @CustomerDisplay to message | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ► Attention: the formerly used keyword '''displayText''' was related to '''lineDisplays''' and is now reused for displays. That means for an update to this version, all '''displayText''' keywords must be changed to '''lineDisplayText'''. | ||
+ | ► The referenced DTO must be the rootType of the Display definition in the ui model. | ||
+ | |||
+ | # New '''events''' "'''dataProvider DataControl'''": | ||
+ | #:<syntaxhighlight lang="java"> | ||
+ | dataProvider DataControl { | ||
+ | . . . | ||
+ | dto cashslip type CashSlipDto attach CustomerDisplay | ||
+ | dto customerDisplay type CustomerDisplayDto | ||
+ | . . . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | # New '''events''' "'''peripheral PeripheralControl'''": | ||
+ | #:<syntaxhighlight lang="java"> | ||
+ | peripheral PeripheralControl { | ||
+ | . . . | ||
+ | display CustomerDisplay using CustomerDisplay | ||
+ | . . . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | # Setting for customerDisplay, in '''state''' "'''IDLE'''": | ||
+ | #:<syntaxhighlight lang="java"> | ||
+ | trigger onStartUp | ||
+ | actions transition LOCKED{ | ||
+ | . . . | ||
+ | displayText false @CustomerDisplay to ^left | ||
+ | displayText true @CustomerDisplay to ^right | ||
+ | . . . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | # Setting for customerDisplay, in '''state''' "'''LOCKED'''": | ||
+ | #:<syntaxhighlight lang="java"> | ||
+ | trigger onOk | ||
+ | actions transition ATTENTIVE{ | ||
+ | . . . | ||
+ | displayText true @CustomerDisplay to ^left | ||
+ | displayText false @CustomerDisplay to ^right | ||
+ | . . . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
== Copyright Notice == | == Copyright Notice == | ||
{{Copyright Notice}} | {{Copyright Notice}} |
Revision as of 10:38, 12 April 2018
Contents
Customer Display
The latest version of the Statemachine DSL (Finite State-Machine) covers the synchronization of external (slave) browsers to a main (master) browser connected to an OS.bee server. The requirement was mainly inspired by the need of a customer display for the OS.bee POS application OS.pos. In this context it is required parts of the main screen's data which is shared on the slave browser working as a display.
Multiple displays can be connected to a master just by using a pattern on the address line of the slave-browser:
► example: http://dv999.compex.de:8081/osbpdisplay/#dv888.compex.de-CustomerDisplay
- http://dv999.compex.de:8081/osbp: this part as same as the address in main display, including server host-name and port number.
- display/: this part is the slave name, you can attach one or more slaves on the same master.
- #dv888.compex.de-: this part is master machine.
- CustomerDisplay: this part is the display name which is used by this slave, and it is as same as the display name which is defined in the UI model.
Technical changes in DSL model
changes in dto
- New dto "CustomerDisplayDto":
dto CustomerDisplayDto { var double totalAmount var boolean left var String message var boolean right var BlobMapping image ref CashSlipDto slip }
- Referenced by other DTOs:
autoDto CashPositionDto extends BaseUUIDDto wraps CashPosition { inheritVar now inheritVar quantity inheritVar price inheritVar amount inheritRef slip mapto CashSlipDto inheritRef product mapto MproductDto inheritRef sales mapto Msales_factDto }
changes in UI
- New UI:
display Customer { rootType CustomerDisplayDto datasource main:CustomerDisplayDto datasource img:BlobConverter horizontalLayout { verticalLayout left { textfield(i18n noCaption readonly) message table(i18n noCaption) slip { scrollToBottom type CashPositionDto columns { column quantity column product.sku column product.product_name column price column amount } sort { column now asc } } align fill-left form(styles "os-cash-total") { decimalField(precision= 2 readonly) totalAmount } bind [this.message].value <-- img.input bind [this.slip].collection <-- main.slip.positions bind [this.totalAmount].value <-- main.totalAmount } verticalLayout right { image info bind img.input <-- main.^image bind [this.info].resource <-- img.output } bind [this.left].visible <-- main.left bind [this.right].visible <-- main.right } }
- 2 part, left & right, control in which state, which part to display
changes in Functionlibrary
- New lines in operation "initImages" & operation "conputeTotal" :
operation initImages(IStateMachine stateMachine, Object [] params) { . . . stateMachine.set("CustomerDisplayImage", cashregister.store.company.companyImage) . . . }
operation computeTotal(IStateMachine stateMachine) { . . . stateMachine.set("CustomerDisplayTotalAmount", amount); . . . }
changes in Statemachine
Some new keywords are introduced for this new functionality:
-
display <DisplayName> using <DTOName>
-
dto <DTOAlias> type <DTOName> attach <DisplayName>
-
displayText text "some text" @<DisplayName> to <DTOAttribute>
The references of a DTO that is attached to a display are always synchronized across all connected displays. Single fields must be synchronized by displayText.
► e.g.:
dto cashslip type CashSlipDto attach CustomerDisplay
display CustomerDisplay using CustomerDisplayDto
displayText text "locked" @CustomerDisplay to message
► Attention: the formerly used keyword displayText was related to lineDisplays and is now reused for displays. That means for an update to this version, all displayText keywords must be changed to lineDisplayText. ► The referenced DTO must be the rootType of the Display definition in the ui model.
- New events "dataProvider DataControl":
dataProvider DataControl { . . . dto cashslip type CashSlipDto attach CustomerDisplay dto customerDisplay type CustomerDisplayDto . . . }
- New events "peripheral PeripheralControl":
peripheral PeripheralControl { . . . display CustomerDisplay using CustomerDisplay . . . }
- Setting for customerDisplay, in state "IDLE":
trigger onStartUp actions transition LOCKED{ . . . displayText false @CustomerDisplay to ^left displayText true @CustomerDisplay to ^right . . . }
- Setting for customerDisplay, in state "LOCKED":
trigger onOk actions transition ATTENTIVE{ . . . displayText true @CustomerDisplay to ^left displayText false @CustomerDisplay to ^right . . . }
Copyright Notice
All rights are reserved by Compex Systemhaus GmbH. In particular, duplications, translations, microfilming, saving and processing in electronic systems are protected by copyright. Use of this manual is only authorized with the permission of Compex Systemhaus GmbH. Infringements of the law shall be punished in accordance with civil and penal laws. We have taken utmost care in putting together texts and images. Nevertheless, the possibility of errors cannot be completely ruled out. The Figures and information in this manual are only given as approximations unless expressly indicated as binding. Amendments to the manual due to amendments to the standard software remain reserved. Please note that the latest amendments to the manual can be accessed through our helpdesk at any time. The contractually agreed regulations of the licensing and maintenance of the standard software shall apply with regard to liability for any errors in the documentation. Guarantees, particularly guarantees of quality or durability can only be assumed for the manual insofar as its quality or durability are expressly stipulated as guaranteed. If you would like to make a suggestion, the Compex Team would be very pleased to hear from you.
(c) 2016-2024 Compex Systemhaus GmbH