2 'rootui5/panel/Controller',
3 'sap/ui/model/json/JSONModel',
5 ],
function (GuiPanelController, JSONModel, MessageToast) {
8 return GuiPanelController.extend(
"localapp.controller.TestPanel", {
11 onPanelInit :
function() {
12 this.setPanelTitle(
"TestPanel");
16 onPanelExit :
function() {
19 onPanelReceive:
function(msg, offset) {
20 if (typeof msg !=
"string") {
22 var arr =
new Float32Array(msg, offset);
26 if (msg.indexOf(
"MODEL:")==0) {
27 var data = JSROOT.parse(msg.substr(6));
29 this.getView().setModel(
new JSONModel(data));
31 MessageToast.show(
"Receive msg: " + msg.substr(0,30));
35 handleButtonPress:
function() {
36 MessageToast.show(
"Press sample button");
40 handleSendPress:
function() {
41 this.panelSend(
"MODEL:" + this.getView().getModel().getJSON());
44 handleRefreshPress:
function() {
45 this.panelSend(
"REFRESH");