[101] | 1 | (function() {
|
---|
| 2 | 'use strict';
|
---|
| 3 | var $asm = {};
|
---|
| 4 | global.control = global.control || {};
|
---|
| 5 | global.ctrlui = global.ctrlui || {};
|
---|
| 6 | global.Kadecot = global.Kadecot || {};
|
---|
| 7 | ss.initAssembly($asm, 'EcnlControllerUI');
|
---|
| 8 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 9 | // CtrlUI
|
---|
| 10 | var $CtrlUI = function() {
|
---|
| 11 | this.$read = new (ss.makeGenericType(ss.Dictionary$2, [$ctrlui_DeviceController$DeviceInfo, $ctrlui_DeviceController$DeviceInfo]))();
|
---|
| 12 | this.$m_WampClient = null;
|
---|
| 13 | this.$m_DeviceController = null;
|
---|
| 14 | this.$_m_CurrentNode = null;
|
---|
| 15 | this.$timerId = 0;
|
---|
| 16 | this.$dpi = null;
|
---|
| 17 | this.$m_WampClient = new $Kadecot_WampClient();
|
---|
| 18 | this.$m_WampClient.addOpenCallback(ss.mkdel(this, this.$wampClientConnected));
|
---|
| 19 | this.$m_WampClient.addCloseCallback(ss.mkdel(this, this.$wampClientDisconnected));
|
---|
[125] | 20 | this.$m_WampClient.connect('ws://' + window.location.host + '/webapi');
|
---|
[101] | 21 | };
|
---|
| 22 | $CtrlUI.__typeName = 'CtrlUI';
|
---|
| 23 | $CtrlUI.main = function() {
|
---|
| 24 | if (ss.isNullOrUndefined($CtrlUI.page)) {
|
---|
| 25 | $CtrlUI.page = new $CtrlUI();
|
---|
| 26 | $CtrlUI.info = new $ctrlui_Information();
|
---|
| 27 | }
|
---|
| 28 | $(document).on('pageinit', '#index', ss.mkdel($CtrlUI.page, $CtrlUI.page.$initClassGroups$1));
|
---|
| 29 | };
|
---|
| 30 | $CtrlUI.getPage = function(ele) {
|
---|
| 31 | var page = ele;
|
---|
| 32 | if ($(page).is('[data-role="page"]')) {
|
---|
| 33 | return page;
|
---|
| 34 | }
|
---|
| 35 | if ($(page).parents('[data-role="page"]').length === 1) {
|
---|
| 36 | return $(page).parents('[data-role="page"]').get(0);
|
---|
| 37 | }
|
---|
| 38 | return null;
|
---|
| 39 | };
|
---|
| 40 | $CtrlUI.$ajaxError = function(request, textStatus, error, url) {
|
---|
| 41 | var sep = new RegExp('(\r\n|\r|\n)');
|
---|
| 42 | var lines = [];
|
---|
| 43 | lines.push(textStatus);
|
---|
| 44 | if (ss.isInstanceOfType(error, String)) {
|
---|
| 45 | lines.push(ss.cast(error, String));
|
---|
| 46 | }
|
---|
| 47 | else {
|
---|
| 48 | lines.push(ss.cast(error.message, String));
|
---|
| 49 | var stack = ss.cast(error.stack, String);
|
---|
| 50 | ss.arrayAddRange(lines, stack.split(sep));
|
---|
| 51 | }
|
---|
| 52 | var html = $('<p>');
|
---|
| 53 | for (var $t1 = 0; $t1 < lines.length; $t1++) {
|
---|
| 54 | var line = lines[$t1];
|
---|
| 55 | if (ss.isValue(sep.exec(line))) {
|
---|
| 56 | continue;
|
---|
| 57 | }
|
---|
| 58 | html.append(document.createTextNode(line).wholeText);
|
---|
| 59 | html.append($('<br/>'));
|
---|
| 60 | }
|
---|
| 61 | html.append(url + 'の読み込みに失敗しました');
|
---|
| 62 | $('#popup_dialog_caption').text('通信エラー');
|
---|
| 63 | $('#popup_dialog_title').text('通信エラーが発生しました');
|
---|
| 64 | $('#popup_dialog_text').html(html);
|
---|
| 65 | $('#popup_dialog').popup('open', { transition: 'slidedown' });
|
---|
| 66 | };
|
---|
| 67 | global.CtrlUI = $CtrlUI;
|
---|
| 68 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 69 | // ElementExtensions
|
---|
| 70 | var $ElementExtensions = function() {
|
---|
| 71 | };
|
---|
| 72 | $ElementExtensions.__typeName = 'ElementExtensions';
|
---|
| 73 | global.ElementExtensions = $ElementExtensions;
|
---|
| 74 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 75 | // jQueryMobile
|
---|
| 76 | var $jQueryMobile = function() {
|
---|
| 77 | };
|
---|
| 78 | $jQueryMobile.__typeName = 'jQueryMobile';
|
---|
| 79 | global.jQueryMobile = $jQueryMobile;
|
---|
| 80 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 81 | // LoadingOption
|
---|
| 82 | var $LoadingOption = function() {
|
---|
| 83 | this.text = null;
|
---|
| 84 | this.textVisible = false;
|
---|
| 85 | };
|
---|
| 86 | $LoadingOption.__typeName = 'LoadingOption';
|
---|
| 87 | $LoadingOption.$ctor1 = function(text, textVisible) {
|
---|
| 88 | this.text = null;
|
---|
| 89 | this.textVisible = false;
|
---|
| 90 | this.text = text;
|
---|
| 91 | this.textVisible = textVisible;
|
---|
| 92 | };
|
---|
| 93 | global.LoadingOption = $LoadingOption;
|
---|
| 94 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 95 | // control.KeyPress
|
---|
| 96 | var $control_KeyPress = function() {
|
---|
| 97 | };
|
---|
| 98 | $control_KeyPress.__typeName = 'control.KeyPress';
|
---|
| 99 | global.control.KeyPress = $control_KeyPress;
|
---|
| 100 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 101 | // control.UI
|
---|
| 102 | var $control_UI = function() {
|
---|
| 103 | };
|
---|
| 104 | $control_UI.__typeName = 'control.UI';
|
---|
| 105 | $control_UI.getDeviceInfo = function(dc, dev, device) {
|
---|
| 106 | var di = new $ctrlui_DeviceController$DeviceInfo.$ctor1(dc, dev);
|
---|
| 107 | di.set_data(device);
|
---|
| 108 | if (ss.isValue(dc)) {
|
---|
| 109 | for (var $t1 = 0; $t1 < dev.properties.length; $t1++) {
|
---|
| 110 | var prop = { $: dev.properties[$t1] };
|
---|
| 111 | var epi = Enumerable.from(dc.properties).firstOrDefault(ss.mkdel({ prop: prop }, function(p) {
|
---|
| 112 | return p.propertyCode === this.prop.$.epc;
|
---|
| 113 | }), ss.getDefaultValue($ctrlui_JsonPropertyInfo));
|
---|
| 114 | if (ss.isNullOrUndefined(epi)) {
|
---|
| 115 | continue;
|
---|
| 116 | }
|
---|
| 117 | di.get_properties().push(new $ctrlui_DeviceController$DevicePropertyInfo(epi, prop.$));
|
---|
| 118 | }
|
---|
| 119 | }
|
---|
| 120 | return di;
|
---|
| 121 | };
|
---|
| 122 | $control_UI.getAllDevices = function(args) {
|
---|
| 123 | var devs = ss.cast(ss.cast(args, Array)[4].deviceList, Array);
|
---|
| 124 | var alldevs = [];
|
---|
| 125 | var nodes = new (ss.makeGenericType(ss.Dictionary$2, [String, Array]))();
|
---|
| 126 | for (var $t1 = 0; $t1 < devs.length; $t1++) {
|
---|
| 127 | var dev = devs[$t1];
|
---|
| 128 | var device = new $ctrlui_WampApiKadecotDevice(dev);
|
---|
| 129 | var devices = {};
|
---|
| 130 | if (nodes.tryGetValue(device.ip_addr, devices)) {
|
---|
| 131 | devices.$.push(device);
|
---|
| 132 | }
|
---|
| 133 | else {
|
---|
| 134 | devices.$ = [];
|
---|
| 135 | devices.$.push(device);
|
---|
| 136 | nodes.set_item(device.ip_addr, devices.$);
|
---|
| 137 | }
|
---|
| 138 | alldevs.push(device);
|
---|
| 139 | }
|
---|
| 140 | return alldevs;
|
---|
| 141 | };
|
---|
| 142 | $control_UI.toJSClassGroupInfoList = function(data) {
|
---|
| 143 | var _classGroups = ss.cast((ss.referenceEquals(ss.getInstanceType(data), String) ? $.parseJSON(ss.cast(data, String)) : data), Array);
|
---|
| 144 | var classGroups = [];
|
---|
| 145 | for (var $t1 = 0; $t1 < _classGroups.length; $t1++) {
|
---|
| 146 | var _item = _classGroups[$t1];
|
---|
| 147 | var item = new $ctrlui_JsonClassGroupInfo(_item);
|
---|
| 148 | classGroups.push(item);
|
---|
| 149 | }
|
---|
| 150 | return classGroups;
|
---|
| 151 | };
|
---|
| 152 | $control_UI.toJSClassInfoList = function(data, classGroup) {
|
---|
| 153 | var _classes = ss.cast((ss.referenceEquals(ss.getInstanceType(data), String) ? $.parseJSON(ss.cast(data, String)) : data), Array);
|
---|
| 154 | var classes = [];
|
---|
| 155 | var eclass;
|
---|
| 156 | for (var $t1 = 0; $t1 < _classes.length; $t1++) {
|
---|
| 157 | var _item = _classes[$t1];
|
---|
| 158 | eclass = new $ctrlui_JsonClassInfo(_item);
|
---|
| 159 | eclass.classGroup = classGroup;
|
---|
| 160 | classes.push(eclass);
|
---|
| 161 | }
|
---|
| 162 | return classes;
|
---|
| 163 | };
|
---|
| 164 | $control_UI.toJSPropertyInfoList = function(data) {
|
---|
| 165 | var _properties = ss.cast((ss.referenceEquals(ss.getInstanceType(data), String) ? $.parseJSON(ss.cast(data, String)) : data), Array);
|
---|
| 166 | var properties = [];
|
---|
| 167 | for (var $t1 = 0; $t1 < _properties.length; $t1++) {
|
---|
| 168 | var _item = _properties[$t1];
|
---|
| 169 | var item = new $ctrlui_JsonPropertyInfo.$ctor1(_item);
|
---|
| 170 | properties.push(item);
|
---|
| 171 | }
|
---|
| 172 | return properties;
|
---|
| 173 | };
|
---|
| 174 | $control_UI.disable = function(obj, flag) {
|
---|
| 175 | if (flag) {
|
---|
| 176 | obj.attr('disabled', 'disabled');
|
---|
| 177 | }
|
---|
| 178 | else {
|
---|
| 179 | obj.removeAttr('disabled');
|
---|
| 180 | }
|
---|
| 181 | return obj;
|
---|
| 182 | };
|
---|
| 183 | $control_UI.toggleClass = function(obj, deleteClass, addClass) {
|
---|
| 184 | obj.toggleClass(deleteClass, false);
|
---|
| 185 | obj.toggleClass(addClass, true);
|
---|
| 186 | return obj;
|
---|
| 187 | };
|
---|
| 188 | $control_UI.getDeviceBtn = function(di) {
|
---|
| 189 | return $control_UI.getDeviceLi(di).children('a');
|
---|
| 190 | };
|
---|
| 191 | $control_UI.getDeviceLi = function(di) {
|
---|
| 192 | return $('#li_device_' + di.getObjectID());
|
---|
| 193 | };
|
---|
| 194 | $control_UI.isRULE_SET = function(dpi) {
|
---|
| 195 | return (ss.isNullOrUndefined(dpi.get_propertyInfo()) ? false : ss.contains(dpi.get_propertyInfo().access, 'RULE_SET'));
|
---|
| 196 | };
|
---|
| 197 | global.control.UI = $control_UI;
|
---|
| 198 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 199 | // control.UIAnchor
|
---|
| 200 | var $control_UIAnchor = function() {
|
---|
| 201 | $control_UIObject.$ctor1.call(this, '<a>');
|
---|
| 202 | };
|
---|
| 203 | $control_UIAnchor.__typeName = 'control.UIAnchor';
|
---|
| 204 | $control_UIAnchor.$ctor1 = function(text) {
|
---|
| 205 | $control_UIAnchor.call(this);
|
---|
| 206 | this.set_text(text);
|
---|
| 207 | };
|
---|
| 208 | $control_UIAnchor.$ctor2 = function(uiobject) {
|
---|
| 209 | $control_UIAnchor.call(this);
|
---|
| 210 | this.append(uiobject);
|
---|
| 211 | };
|
---|
| 212 | global.control.UIAnchor = $control_UIAnchor;
|
---|
| 213 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 214 | // control.UIBackButton
|
---|
| 215 | var $control_UIBackButton = function() {
|
---|
| 216 | $control_UIButton.call(this);
|
---|
| 217 | this.set_buttonIcon(2);
|
---|
| 218 | this.set_title('元に戻す');
|
---|
| 219 | this.set_tabIndex(-1);
|
---|
| 220 | this.addClass('text_backButton');
|
---|
| 221 | this.object.hide();
|
---|
| 222 | };
|
---|
| 223 | $control_UIBackButton.__typeName = 'control.UIBackButton';
|
---|
| 224 | global.control.UIBackButton = $control_UIBackButton;
|
---|
| 225 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 226 | // control.UIButton
|
---|
| 227 | var $control_UIButton = function() {
|
---|
| 228 | $control_UIObject.$ctor1.call(this, '<a>');
|
---|
| 229 | this.set_button(true);
|
---|
| 230 | this.set_noText(true);
|
---|
| 231 | this.set_href('#');
|
---|
| 232 | this.set_cornerAll(true);
|
---|
| 233 | };
|
---|
| 234 | $control_UIButton.__typeName = 'control.UIButton';
|
---|
| 235 | global.control.UIButton = $control_UIButton;
|
---|
| 236 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 237 | // control.UIButton.Icon
|
---|
| 238 | var $control_UIButton$Icon = function() {
|
---|
| 239 | };
|
---|
| 240 | $control_UIButton$Icon.__typeName = 'control.UIButton$Icon';
|
---|
| 241 | global.control.UIButton$Icon = $control_UIButton$Icon;
|
---|
| 242 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 243 | // control.UICalBox
|
---|
| 244 | var $control_UICalBox = function() {
|
---|
| 245 | $control_UITextInput.call(this);
|
---|
| 246 | this.set_dataRole('datebox');
|
---|
| 247 | this.set_dataOptions(ss.mkdict(['mode', 'calbox']));
|
---|
| 248 | this.set_dataClearBtn(false);
|
---|
| 249 | this.on('dateboxcreate', ss.thisFix(ss.mkdel(this, this.$dateBoxCreate)));
|
---|
| 250 | };
|
---|
| 251 | $control_UICalBox.__typeName = 'control.UICalBox';
|
---|
| 252 | global.control.UICalBox = $control_UICalBox;
|
---|
| 253 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 254 | // control.UICalBox.UIInputDate
|
---|
| 255 | var $control_UICalBox$UIInputDate = function(ev) {
|
---|
| 256 | $control_UIObject.call(this);
|
---|
| 257 | this.object = $(ev.target).parent('.ui-input-datebox');
|
---|
| 258 | };
|
---|
| 259 | $control_UICalBox$UIInputDate.__typeName = 'control.UICalBox$UIInputDate';
|
---|
| 260 | global.control.UICalBox$UIInputDate = $control_UICalBox$UIInputDate;
|
---|
| 261 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 262 | // control.UICollapsibleset
|
---|
| 263 | var $control_UICollapsibleset = function() {
|
---|
| 264 | $control_UIObject.$ctor1.call(this, '<div>');
|
---|
| 265 | this.set_dataRole('collapsible');
|
---|
| 266 | };
|
---|
| 267 | $control_UICollapsibleset.__typeName = 'control.UICollapsibleset';
|
---|
| 268 | $control_UICollapsibleset.$ctor2 = function(attr, h2) {
|
---|
| 269 | $control_UICollapsibleset.call(this);
|
---|
| 270 | this.attribute(attr);
|
---|
| 271 | this.append(new $control_UIH.$ctor2(2, h2));
|
---|
| 272 | };
|
---|
| 273 | $control_UICollapsibleset.$ctor1 = function(h2) {
|
---|
| 274 | $control_UICollapsibleset.call(this);
|
---|
| 275 | this.append(new $control_UIH.$ctor2(2, h2));
|
---|
| 276 | };
|
---|
| 277 | global.control.UICollapsibleset = $control_UICollapsibleset;
|
---|
| 278 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 279 | // control.UIDeviceController
|
---|
| 280 | var $control_UIDeviceController = function() {
|
---|
| 281 | this.deviceController = null;
|
---|
| 282 | };
|
---|
| 283 | $control_UIDeviceController.__typeName = 'control.UIDeviceController';
|
---|
| 284 | global.control.UIDeviceController = $control_UIDeviceController;
|
---|
| 285 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 286 | // control.UIDeviceController.UIDeviceInfo
|
---|
| 287 | var $control_UIDeviceController$UIDeviceInfo = function() {
|
---|
| 288 | this.page = null;
|
---|
| 289 | this.di = null;
|
---|
| 290 | this.$elements = null;
|
---|
| 291 | };
|
---|
| 292 | $control_UIDeviceController$UIDeviceInfo.__typeName = 'control.UIDeviceController$UIDeviceInfo';
|
---|
| 293 | global.control.UIDeviceController$UIDeviceInfo = $control_UIDeviceController$UIDeviceInfo;
|
---|
| 294 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 295 | // control.UIDeviceController.UIDevicePropertyInfo
|
---|
| 296 | var $control_UIDeviceController$UIDevicePropertyInfo = function() {
|
---|
| 297 | this.$grpbox = null;
|
---|
| 298 | this.$dpi = null;
|
---|
| 299 | };
|
---|
| 300 | $control_UIDeviceController$UIDevicePropertyInfo.__typeName = 'control.UIDeviceController$UIDevicePropertyInfo';
|
---|
| 301 | global.control.UIDeviceController$UIDevicePropertyInfo = $control_UIDeviceController$UIDevicePropertyInfo;
|
---|
| 302 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 303 | // control.UIDiv
|
---|
| 304 | var $control_UIDiv = function() {
|
---|
| 305 | $control_UIObject.$ctor1.call(this, '<div>');
|
---|
| 306 | };
|
---|
| 307 | $control_UIDiv.__typeName = 'control.UIDiv';
|
---|
| 308 | global.control.UIDiv = $control_UIDiv;
|
---|
| 309 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 310 | // control.UIEventHandler
|
---|
| 311 | var $control_UIEventHandler = function() {
|
---|
| 312 | };
|
---|
| 313 | $control_UIEventHandler.__typeName = 'control.UIEventHandler';
|
---|
| 314 | $control_UIEventHandler.loadingShow = function(ev) {
|
---|
| 315 | $.mobile.loading('show');
|
---|
| 316 | };
|
---|
| 317 | $control_UIEventHandler.loadingHide = function(ev) {
|
---|
| 318 | $.mobile.loading('hide');
|
---|
| 319 | };
|
---|
| 320 | global.control.UIEventHandler = $control_UIEventHandler;
|
---|
| 321 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 322 | // control.UIEventNames
|
---|
| 323 | var $control_UIEventNames = function() {
|
---|
| 324 | };
|
---|
| 325 | $control_UIEventNames.__typeName = 'control.UIEventNames';
|
---|
| 326 | global.control.UIEventNames = $control_UIEventNames;
|
---|
| 327 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 328 | // control.UIFieldContain
|
---|
| 329 | var $control_UIFieldContain = function() {
|
---|
| 330 | this.label = null;
|
---|
| 331 | this.input = null;
|
---|
| 332 | $control_UIObject.$ctor1.call(this, '<div>');
|
---|
| 333 | this.set_dataRole('fieldcontain');
|
---|
| 334 | };
|
---|
| 335 | $control_UIFieldContain.__typeName = 'control.UIFieldContain';
|
---|
| 336 | $control_UIFieldContain.$ctor1 = function(uiobject) {
|
---|
| 337 | $control_UIFieldContain.call(this);
|
---|
| 338 | this.append(uiobject);
|
---|
| 339 | };
|
---|
| 340 | $control_UIFieldContain.$ctor2 = function(label, uiobject) {
|
---|
| 341 | $control_UIFieldContain.call(this);
|
---|
| 342 | this.label = label;
|
---|
| 343 | this.input = uiobject;
|
---|
| 344 | this.append(this.label);
|
---|
| 345 | this.append(this.input);
|
---|
| 346 | };
|
---|
| 347 | global.control.UIFieldContain = $control_UIFieldContain;
|
---|
| 348 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 349 | // control.UIFieldSet
|
---|
| 350 | var $control_UIFieldSet = function() {
|
---|
| 351 | this.radioList = null;
|
---|
| 352 | this.$_ControlGroup = false;
|
---|
| 353 | this.$_Horizontal = false;
|
---|
| 354 | $control_UIObject.$ctor1.call(this, '<fieldset>');
|
---|
| 355 | this.set_controlGroup(true);
|
---|
| 356 | };
|
---|
| 357 | $control_UIFieldSet.__typeName = 'control.UIFieldSet';
|
---|
| 358 | $control_UIFieldSet.$ctor1 = function(horizontal) {
|
---|
| 359 | $control_UIFieldSet.call(this);
|
---|
| 360 | this.set_horizontal(horizontal);
|
---|
| 361 | };
|
---|
| 362 | global.control.UIFieldSet = $control_UIFieldSet;
|
---|
| 363 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 364 | // control.UIFieldSet.RadioInput
|
---|
| 365 | var $control_UIFieldSet$RadioInput = function(Label, Radio) {
|
---|
| 366 | this.radio = null;
|
---|
| 367 | this.label = null;
|
---|
| 368 | this.radio = Radio;
|
---|
| 369 | this.label = Label;
|
---|
| 370 | };
|
---|
| 371 | $control_UIFieldSet$RadioInput.__typeName = 'control.UIFieldSet$RadioInput';
|
---|
| 372 | global.control.UIFieldSet$RadioInput = $control_UIFieldSet$RadioInput;
|
---|
| 373 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 374 | // control.UIFlipSwitch
|
---|
| 375 | var $control_UIFlipSwitch = function() {
|
---|
| 376 | this.ON = null;
|
---|
| 377 | this.OFF = null;
|
---|
| 378 | $control_UIObject.$ctor1.call(this, '<select>');
|
---|
| 379 | this.set_dataRole('flipswitch');
|
---|
| 380 | //base.Append(new UIOption());
|
---|
| 381 | //base.Append(new UIOption());
|
---|
| 382 | };
|
---|
| 383 | $control_UIFlipSwitch.__typeName = 'control.UIFlipSwitch';
|
---|
| 384 | $control_UIFlipSwitch.$ctor1 = function(off, on) {
|
---|
| 385 | $control_UIFlipSwitch.call(this);
|
---|
| 386 | this.OFF = off;
|
---|
| 387 | this.ON = on;
|
---|
| 388 | this.append(this.OFF);
|
---|
| 389 | this.append(this.ON);
|
---|
| 390 | };
|
---|
| 391 | global.control.UIFlipSwitch = $control_UIFlipSwitch;
|
---|
| 392 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 393 | // control.UIGridA
|
---|
| 394 | var $control_UIGridA = function() {
|
---|
| 395 | this.blockA = new $control_UIGridA$UIBlockA();
|
---|
| 396 | this.blockB = new $control_UIGridA$UIBlockB();
|
---|
| 397 | $control_UIObject.$ctor1.call(this, '<div>');
|
---|
| 398 | this.object.addClass('ui-grid-a');
|
---|
| 399 | this.append(this.blockA);
|
---|
| 400 | this.append(this.blockB);
|
---|
| 401 | };
|
---|
| 402 | $control_UIGridA.__typeName = 'control.UIGridA';
|
---|
| 403 | global.control.UIGridA = $control_UIGridA;
|
---|
| 404 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 405 | // control.UIGridA.UIBlockA
|
---|
| 406 | var $control_UIGridA$UIBlockA = function() {
|
---|
| 407 | $control_UIObject.$ctor1.call(this, '<div>');
|
---|
| 408 | this.object.addClass('ui-block-a');
|
---|
| 409 | };
|
---|
| 410 | $control_UIGridA$UIBlockA.__typeName = 'control.UIGridA$UIBlockA';
|
---|
| 411 | global.control.UIGridA$UIBlockA = $control_UIGridA$UIBlockA;
|
---|
| 412 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 413 | // control.UIGridA.UIBlockB
|
---|
| 414 | var $control_UIGridA$UIBlockB = function() {
|
---|
| 415 | $control_UIObject.$ctor1.call(this, '<div>');
|
---|
| 416 | this.object.addClass('ui-block-b');
|
---|
| 417 | };
|
---|
| 418 | $control_UIGridA$UIBlockB.__typeName = 'control.UIGridA$UIBlockB';
|
---|
| 419 | global.control.UIGridA$UIBlockB = $control_UIGridA$UIBlockB;
|
---|
| 420 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 421 | // control.UIGrpBox
|
---|
| 422 | var $control_UIGrpBox = function() {
|
---|
| 423 | this.$label = null;
|
---|
| 424 | this.$user = true;
|
---|
| 425 | this.$dpi = null;
|
---|
| 426 | this.$liAside = null;
|
---|
| 427 | this.getValue = null;
|
---|
| 428 | this.fieldContain = null;
|
---|
| 429 | this.kadecotSet = null;
|
---|
| 430 | this.backButton = new $control_UIBackButton();
|
---|
| 431 | $control_UIListviewItem.call(this);
|
---|
| 432 | this.$liAside = new $control_UIP.$ctor2('', 'ui-li-aside');
|
---|
| 433 | this.append(this.$liAside);
|
---|
| 434 | this.change$1(ss.thisFix(ss.mkdel(this, this.grpBoxChange)));
|
---|
| 435 | };
|
---|
| 436 | $control_UIGrpBox.__typeName = 'control.UIGrpBox';
|
---|
| 437 | $control_UIGrpBox.$ctor1 = function(dpi) {
|
---|
| 438 | $control_UIGrpBox.call(this);
|
---|
| 439 | this.$dpi = dpi;
|
---|
| 440 | this.$label = new $control_UILabel.$ctor2(dpi);
|
---|
| 441 | this.$dpi.prepareInputInfo();
|
---|
| 442 | if (dpi.get_propertyCode() === 0) {
|
---|
| 443 | }
|
---|
| 444 | else if (dpi.get_propertyCode() === 151) {
|
---|
| 445 | this.$setTimebox();
|
---|
| 446 | }
|
---|
| 447 | else if (dpi.get_propertyCode() === 152) {
|
---|
| 448 | this.$setCalBox();
|
---|
| 449 | }
|
---|
| 450 | else if (this.$dpi.get_inputTypes().length === 0) {
|
---|
| 451 | this.$setTextInput();
|
---|
| 452 | }
|
---|
| 453 | else if (dpi.get_propertyCode() === 128 && dpi.get_inputTypes().length === 1 && dpi.get_inputTypes()[0].mode === 1) {
|
---|
| 454 | this.setFlipSwitch();
|
---|
| 455 | }
|
---|
| 456 | else {
|
---|
| 457 | var $t1 = dpi.get_inputTypes();
|
---|
| 458 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 459 | var pii = $t1[$t2];
|
---|
| 460 | switch (pii.mode) {
|
---|
| 461 | case 1: {
|
---|
| 462 | {
|
---|
| 463 | this.$setFieldSet(pii);
|
---|
| 464 | }
|
---|
| 465 | break;
|
---|
| 466 | }
|
---|
| 467 | case 2: {
|
---|
| 468 | {
|
---|
| 469 | this.setRange(pii);
|
---|
| 470 | }
|
---|
| 471 | break;
|
---|
| 472 | }
|
---|
| 473 | default: {
|
---|
| 474 | {
|
---|
| 475 | this.setDefault();
|
---|
| 476 | }
|
---|
| 477 | break;
|
---|
| 478 | }
|
---|
| 479 | }
|
---|
| 480 | }
|
---|
| 481 | }
|
---|
| 482 | };
|
---|
| 483 | global.control.UIGrpBox = $control_UIGrpBox;
|
---|
| 484 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 485 | // control.UIH
|
---|
| 486 | var $control_UIH = function() {
|
---|
| 487 | $control_UIObject.$ctor1.call(this, '<h1>');
|
---|
| 488 | };
|
---|
| 489 | $control_UIH.__typeName = 'control.UIH';
|
---|
| 490 | $control_UIH.$ctor1 = function(i) {
|
---|
| 491 | $control_UIObject.$ctor1.call(this, '<h' + i.toString() + '>');
|
---|
| 492 | };
|
---|
| 493 | $control_UIH.$ctor2 = function(i, text) {
|
---|
| 494 | $control_UIH.$ctor1.call(this, i);
|
---|
| 495 | this.set_text(text);
|
---|
| 496 | };
|
---|
| 497 | global.control.UIH = $control_UIH;
|
---|
| 498 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 499 | // control.UIImg
|
---|
| 500 | var $control_UIImg = function() {
|
---|
| 501 | $control_UIObject.$ctor1.call(this, '<img>');
|
---|
| 502 | };
|
---|
| 503 | $control_UIImg.__typeName = 'control.UIImg';
|
---|
| 504 | $control_UIImg.$ctor1 = function(attr) {
|
---|
| 505 | $control_UIImg.call(this);
|
---|
| 506 | this.attribute(attr);
|
---|
| 507 | };
|
---|
| 508 | $control_UIImg.$ctor2 = function(nameValuePairs) {
|
---|
| 509 | $control_UIImg.call(this);
|
---|
| 510 | this.attribute(ss.mkdict(nameValuePairs));
|
---|
| 511 | };
|
---|
| 512 | global.control.UIImg = $control_UIImg;
|
---|
| 513 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 514 | // control.UILabel
|
---|
| 515 | var $control_UILabel = function() {
|
---|
| 516 | $control_UIObject.$ctor1.call(this, '<label>');
|
---|
| 517 | };
|
---|
| 518 | $control_UILabel.__typeName = 'control.UILabel';
|
---|
| 519 | $control_UILabel.$ctor1 = function(text) {
|
---|
| 520 | $control_UILabel.call(this);
|
---|
| 521 | this.set_text(text);
|
---|
| 522 | };
|
---|
| 523 | $control_UILabel.$ctor3 = function(text, for1) {
|
---|
| 524 | $control_UILabel.$ctor1.call(this, text);
|
---|
| 525 | this.set_for(for1);
|
---|
| 526 | };
|
---|
| 527 | $control_UILabel.$ctor4 = function(text, for1, name) {
|
---|
| 528 | $control_UILabel.$ctor3.call(this, text, for1);
|
---|
| 529 | this.set_name(name);
|
---|
| 530 | };
|
---|
| 531 | $control_UILabel.$ctor2 = function(dpi) {
|
---|
| 532 | $control_UILabel.$ctor1.call(this, dpi.getText());
|
---|
| 533 | this.set_title(dpi.get_propertyInfo().valueDescription);
|
---|
| 534 | };
|
---|
| 535 | global.control.UILabel = $control_UILabel;
|
---|
| 536 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 537 | // control.UILi
|
---|
| 538 | var $control_UILi = function() {
|
---|
| 539 | $control_UIObject.$ctor1.call(this, '<li>');
|
---|
| 540 | };
|
---|
| 541 | $control_UILi.__typeName = 'control.UILi';
|
---|
| 542 | global.control.UILi = $control_UILi;
|
---|
| 543 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 544 | // control.UIListDivider
|
---|
| 545 | var $control_UIListDivider = function() {
|
---|
| 546 | $control_UIListviewItem.call(this);
|
---|
| 547 | this.set_dataRole('list-divider');
|
---|
| 548 | };
|
---|
| 549 | $control_UIListDivider.__typeName = 'control.UIListDivider';
|
---|
| 550 | $control_UIListDivider.$ctor1 = function(text) {
|
---|
| 551 | $control_UIListDivider.call(this);
|
---|
| 552 | this.set_text(text);
|
---|
| 553 | };
|
---|
| 554 | $control_UIListDivider.$ctor2 = function(uiobject) {
|
---|
| 555 | $control_UIListDivider.call(this);
|
---|
| 556 | this.append(uiobject);
|
---|
| 557 | };
|
---|
| 558 | $control_UIListDivider.$ctor3 = function(object) {
|
---|
| 559 | $control_UIListDivider.call(this);
|
---|
| 560 | this.append$1(object);
|
---|
| 561 | };
|
---|
| 562 | global.control.UIListDivider = $control_UIListDivider;
|
---|
| 563 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 564 | // control.UIListview
|
---|
| 565 | var $control_UIListview = function() {
|
---|
| 566 | $control_UIObject.$ctor1.call(this, '<ul>');
|
---|
| 567 | this.set_dataRole('listview');
|
---|
| 568 | };
|
---|
| 569 | $control_UIListview.__typeName = 'control.UIListview';
|
---|
| 570 | $control_UIListview.$ctor1 = function(nameValuePairs) {
|
---|
| 571 | $control_UIListview.call(this);
|
---|
| 572 | this.attribute(ss.mkdict(nameValuePairs));
|
---|
| 573 | };
|
---|
| 574 | global.control.UIListview = $control_UIListview;
|
---|
| 575 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 576 | // control.UIListviewItem
|
---|
| 577 | var $control_UIListviewItem = function() {
|
---|
| 578 | $control_UIObject.$ctor1.call(this, '<li>');
|
---|
| 579 | };
|
---|
| 580 | $control_UIListviewItem.__typeName = 'control.UIListviewItem';
|
---|
| 581 | $control_UIListviewItem.$ctor1 = function(uiobject) {
|
---|
| 582 | $control_UIListviewItem.call(this);
|
---|
| 583 | this.append(uiobject);
|
---|
| 584 | };
|
---|
| 585 | global.control.UIListviewItem = $control_UIListviewItem;
|
---|
| 586 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 587 | // control.UINodeList
|
---|
| 588 | var $control_UINodeList = function(NodeList, listitem_click) {
|
---|
| 589 | this.$info = null;
|
---|
| 590 | this.$info = new $control_UIDiv();
|
---|
| 591 | var identifer = '';
|
---|
| 592 | var $t1 = ss.getEnumerator(NodeList);
|
---|
| 593 | try {
|
---|
| 594 | while ($t1.moveNext()) {
|
---|
| 595 | var node = $t1.current();
|
---|
| 596 | var profile = node.get_profile();
|
---|
| 597 | if ($('#cl_node_' + identifer).length > 0) {
|
---|
| 598 | continue;
|
---|
| 599 | }
|
---|
| 600 | var col = new $control_UICollapsibleset.$ctor1(node.get_data().toString());
|
---|
| 601 | col.set_id('cl_node_' + identifer);
|
---|
| 602 | col.set_dataInset(true);
|
---|
| 603 | this.$info.append(col);
|
---|
| 604 | var listview = new $control_UIListview.$ctor1(['id', 'lv_node_' + identifer]);
|
---|
| 605 | col.append(listview);
|
---|
| 606 | var $t2 = node.get_devices();
|
---|
| 607 | for (var $t3 = 0; $t3 < $t2.length; $t3++) {
|
---|
| 608 | var item = { $: $t2[$t3] };
|
---|
| 609 | if (item.$.get_profile()) {
|
---|
| 610 | continue;
|
---|
| 611 | }
|
---|
| 612 | identifer = item.$.getObjectID();
|
---|
| 613 | if ($('#li_device_' + identifer).length > 0) {
|
---|
| 614 | continue;
|
---|
| 615 | }
|
---|
| 616 | var listitem = { $: new $control_UIListviewItem() };
|
---|
| 617 | listitem.$.set_id('li_device_' + identifer);
|
---|
| 618 | listitem.$.click$1(ss.thisFix(ss.mkdel({ item: item }, function(ele, ev) {
|
---|
| 619 | listitem_click(ele, ev, this.item.$);
|
---|
| 620 | })));
|
---|
| 621 | listview.append(listitem.$);
|
---|
| 622 | var anchor = new $control_UIAnchor();
|
---|
| 623 | anchor.set_href('#');
|
---|
| 624 | anchor.set_title(ss.cast(item.$.get_data(), $ctrlui_WampApiKadecotDevice).description);
|
---|
| 625 | anchor.set_text(ss.cast(item.$.get_data(), $ctrlui_WampApiKadecotDevice).nickname);
|
---|
| 626 | anchor.click$1(ss.thisFix(ss.mkdel({ listitem: listitem, item: item, $this: this }, function(ele1, ev1) {
|
---|
| 627 | this.$this.$listitem_Click(this.listitem.$, this.item.$);
|
---|
| 628 | })));
|
---|
| 629 | listitem.$.append(anchor);
|
---|
| 630 | }
|
---|
| 631 | }
|
---|
| 632 | }
|
---|
| 633 | finally {
|
---|
| 634 | $t1.dispose();
|
---|
| 635 | }
|
---|
| 636 | };
|
---|
| 637 | $control_UINodeList.__typeName = 'control.UINodeList';
|
---|
| 638 | global.control.UINodeList = $control_UINodeList;
|
---|
| 639 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 640 | // control.UIObject
|
---|
| 641 | var $control_UIObject = function() {
|
---|
| 642 | this.object = null;
|
---|
| 643 | this.$ecnlclass = 0;
|
---|
| 644 | };
|
---|
| 645 | $control_UIObject.__typeName = 'control.UIObject';
|
---|
| 646 | $control_UIObject.$ctor2 = function(uiobject) {
|
---|
| 647 | this.object = null;
|
---|
| 648 | this.$ecnlclass = 0;
|
---|
| 649 | this.object = uiobject.object;
|
---|
| 650 | };
|
---|
| 651 | $control_UIObject.$ctor3 = function(object) {
|
---|
| 652 | this.object = null;
|
---|
| 653 | this.$ecnlclass = 0;
|
---|
| 654 | this.object = object;
|
---|
| 655 | };
|
---|
| 656 | $control_UIObject.$ctor1 = function(html) {
|
---|
| 657 | this.object = null;
|
---|
| 658 | this.$ecnlclass = 0;
|
---|
| 659 | this.object = $(html);
|
---|
| 660 | };
|
---|
| 661 | global.control.UIObject = $control_UIObject;
|
---|
| 662 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 663 | // control.UIObject.EcnlClass
|
---|
| 664 | var $control_UIObject$EcnlClass = function() {
|
---|
| 665 | };
|
---|
| 666 | $control_UIObject$EcnlClass.__typeName = 'control.UIObject$EcnlClass';
|
---|
| 667 | global.control.UIObject$EcnlClass = $control_UIObject$EcnlClass;
|
---|
| 668 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 669 | // control.UIOption
|
---|
| 670 | var $control_UIOption = function() {
|
---|
| 671 | $control_UIObject.$ctor1.call(this, '<option>');
|
---|
| 672 | };
|
---|
| 673 | $control_UIOption.__typeName = 'control.UIOption';
|
---|
| 674 | $control_UIOption.$ctor2 = function(text, value) {
|
---|
| 675 | $control_UIOption.call(this);
|
---|
| 676 | this.set_text(text);
|
---|
| 677 | this.set_value(value);
|
---|
| 678 | };
|
---|
| 679 | $control_UIOption.$ctor1 = function(object) {
|
---|
| 680 | $control_UIObject.$ctor3.call(this, object);
|
---|
| 681 | };
|
---|
| 682 | global.control.UIOption = $control_UIOption;
|
---|
| 683 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 684 | // control.UIP
|
---|
| 685 | var $control_UIP = function() {
|
---|
| 686 | $control_UIObject.$ctor1.call(this, '<p>');
|
---|
| 687 | };
|
---|
| 688 | $control_UIP.__typeName = 'control.UIP';
|
---|
| 689 | $control_UIP.$ctor1 = function(text) {
|
---|
| 690 | $control_UIP.call(this);
|
---|
| 691 | this.set_text(text);
|
---|
| 692 | };
|
---|
| 693 | $control_UIP.$ctor2 = function(text, class1) {
|
---|
| 694 | $control_UIP.$ctor1.call(this, text);
|
---|
| 695 | this.addClass(class1);
|
---|
| 696 | };
|
---|
| 697 | global.control.UIP = $control_UIP;
|
---|
| 698 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 699 | // control.UIPin
|
---|
| 700 | var $control_UIPin = function() {
|
---|
| 701 | this.readButton = null;
|
---|
| 702 | this.uiPinMode = null;
|
---|
| 703 | this.range = null;
|
---|
| 704 | this.analogRead = null;
|
---|
| 705 | this.flipSwitch = null;
|
---|
| 706 | this.pin = 0;
|
---|
| 707 | this.listDivider = null;
|
---|
| 708 | $control_UILi.call(this);
|
---|
| 709 | this.addClass('pin');
|
---|
| 710 | this.listDivider = new $control_UIListDivider();
|
---|
| 711 | this.uiPinMode = new $control_UIFieldSet.$ctor1(true);
|
---|
| 712 | this.range = new $control_UIRangeInput();
|
---|
| 713 | this.readButton = new $control_UIButton();
|
---|
| 714 | this.readButton.set_title('取得');
|
---|
| 715 | this.readButton.set_buttonIcon(1);
|
---|
| 716 | };
|
---|
| 717 | $control_UIPin.__typeName = 'control.UIPin';
|
---|
| 718 | $control_UIPin.$ctor1 = function(pin) {
|
---|
| 719 | $control_UIPin.call(this);
|
---|
| 720 | this.pin = pin;
|
---|
| 721 | var Div = new $control_UIDiv();
|
---|
| 722 | Div.append(new $control_UIH.$ctor2(1, 'pin' + pin.toString()));
|
---|
| 723 | Div.append(this.readButton);
|
---|
| 724 | this.listDivider.append(Div);
|
---|
| 725 | this.$setUIPinMode(pin);
|
---|
| 726 | this.$setUIDigital(pin);
|
---|
| 727 | this.$setUIRange(pin);
|
---|
| 728 | if (pin >= 0 && pin <= 7) {
|
---|
| 729 | this.flipSwitch = new $control_UIFlipSwitch.$ctor1(new $control_UIOption.$ctor2('LOW', 'LOW'), new $control_UIOption.$ctor2('HIGH', 'HIGH'));
|
---|
| 730 | this.append(new $control_UIFieldContain.$ctor1(this.uiPinMode));
|
---|
| 731 | this.append(new $control_UIFieldContain.$ctor1(this.flipSwitch));
|
---|
| 732 | this.append(new $control_UIFieldContain.$ctor1(this.range));
|
---|
| 733 | }
|
---|
| 734 | else if (pin >= 8 && pin <= 13) {
|
---|
| 735 | this.flipSwitch = new $control_UIFlipSwitch.$ctor1(new $control_UIOption.$ctor2('LOW', 'LOW'), new $control_UIOption.$ctor2('HIGH', 'HIGH'));
|
---|
| 736 | this.append(new $control_UIFieldContain.$ctor1(this.uiPinMode));
|
---|
| 737 | this.append(new $control_UIFieldContain.$ctor1(this.flipSwitch));
|
---|
| 738 | }
|
---|
| 739 | else if (pin >= 14 && pin <= 19) {
|
---|
| 740 | this.$setAnalogRead(pin);
|
---|
| 741 | this.append(new $control_UIFieldContain.$ctor1(this.analogRead));
|
---|
| 742 | }
|
---|
| 743 | };
|
---|
| 744 | global.control.UIPin = $control_UIPin;
|
---|
| 745 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 746 | // control.UIRadioInput
|
---|
| 747 | var $control_UIRadioInput = function() {
|
---|
| 748 | $control_UIObject.$ctor1.call(this, '<input>');
|
---|
| 749 | this.object.attr('type', 'radio');
|
---|
| 750 | };
|
---|
| 751 | $control_UIRadioInput.__typeName = 'control.UIRadioInput';
|
---|
| 752 | $control_UIRadioInput.$ctor2 = function(id, name) {
|
---|
| 753 | $control_UIRadioInput.call(this);
|
---|
| 754 | this.set_id(id);
|
---|
| 755 | this.set_name(name);
|
---|
| 756 | };
|
---|
| 757 | $control_UIRadioInput.$ctor3 = function(id, name, value) {
|
---|
| 758 | $control_UIRadioInput.$ctor2.call(this, id, name);
|
---|
| 759 | this.set_value(value);
|
---|
| 760 | };
|
---|
| 761 | $control_UIRadioInput.$ctor1 = function(value) {
|
---|
| 762 | $control_UIRadioInput.call(this);
|
---|
| 763 | this.set_value(value);
|
---|
| 764 | };
|
---|
| 765 | global.control.UIRadioInput = $control_UIRadioInput;
|
---|
| 766 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 767 | // control.UIRangeInput
|
---|
| 768 | var $control_UIRangeInput = function() {
|
---|
| 769 | this.handle = false;
|
---|
| 770 | this.sliderHandle = null;
|
---|
| 771 | $control_UIObject.$ctor1.call(this, '<input>');
|
---|
| 772 | this.set_type('number');
|
---|
| 773 | this.set_dataType('range');
|
---|
| 774 | this.set_$dataHighlight(true);
|
---|
| 775 | this.keypress(ss.thisFix(ss.mkdel(this, this.$sliderKeypress)));
|
---|
| 776 | this.handle = true;
|
---|
| 777 | this.one('slidecreate', ss.thisFix(ss.mkdel(this, this.$sliderCreate)));
|
---|
| 778 | };
|
---|
| 779 | $control_UIRangeInput.__typeName = 'control.UIRangeInput';
|
---|
| 780 | $control_UIRangeInput.$ctor1 = function(min, max) {
|
---|
| 781 | $control_UIRangeInput.call(this);
|
---|
| 782 | this.set_min(min);
|
---|
| 783 | this.set_max(max);
|
---|
| 784 | this.set_maxlength(this.$getMaxLength());
|
---|
| 785 | };
|
---|
| 786 | global.control.UIRangeInput = $control_UIRangeInput;
|
---|
| 787 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 788 | // control.UIRangeInput.UIHandle
|
---|
| 789 | var $control_UIRangeInput$UIHandle = function(ev) {
|
---|
| 790 | $control_UIObject.call(this);
|
---|
| 791 | this.object = $(ev.target).parent().find('.ui-slider-handle');
|
---|
| 792 | };
|
---|
| 793 | $control_UIRangeInput$UIHandle.__typeName = 'control.UIRangeInput$UIHandle';
|
---|
| 794 | global.control.UIRangeInput$UIHandle = $control_UIRangeInput$UIHandle;
|
---|
| 795 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 796 | // control.UIRangeInput.UISliderTrack
|
---|
| 797 | var $control_UIRangeInput$UISliderTrack = function(ev) {
|
---|
| 798 | $control_UIObject.call(this);
|
---|
| 799 | this.object = $(ev.target).parent().find('.ui-slider-track');
|
---|
| 800 | };
|
---|
| 801 | $control_UIRangeInput$UISliderTrack.__typeName = 'control.UIRangeInput$UISliderTrack';
|
---|
| 802 | global.control.UIRangeInput$UISliderTrack = $control_UIRangeInput$UISliderTrack;
|
---|
| 803 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 804 | // control.UITextInput
|
---|
| 805 | var $control_UITextInput = function() {
|
---|
| 806 | $control_UIObject.$ctor1.call(this, '<input>');
|
---|
| 807 | this.set_type('text');
|
---|
| 808 | this.set_dataClearBtn(true);
|
---|
| 809 | };
|
---|
| 810 | $control_UITextInput.__typeName = 'control.UITextInput';
|
---|
| 811 | $control_UITextInput.$ctor1 = function(dic) {
|
---|
| 812 | $control_UITextInput.call(this);
|
---|
| 813 | this.attribute(dic);
|
---|
| 814 | };
|
---|
| 815 | global.control.UITextInput = $control_UITextInput;
|
---|
| 816 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 817 | // control.UITimeBox
|
---|
| 818 | var $control_UITimeBox = function() {
|
---|
| 819 | $control_UITextInput.call(this);
|
---|
| 820 | this.set_dataRole('datebox');
|
---|
| 821 | this.set_dataOptions(ss.mkdict(['mode', 'timebox']));
|
---|
| 822 | this.set_dataClearBtn(false);
|
---|
| 823 | this.on('dateboxcreate', ss.thisFix(ss.mkdel(this, this.$dateBoxCreate)));
|
---|
| 824 | };
|
---|
| 825 | $control_UITimeBox.__typeName = 'control.UITimeBox';
|
---|
| 826 | global.control.UITimeBox = $control_UITimeBox;
|
---|
| 827 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 828 | // ctrlui.State
|
---|
| 829 | var $ctrlui_$State = function() {
|
---|
| 830 | };
|
---|
| 831 | $ctrlui_$State.__typeName = 'ctrlui.$State';
|
---|
| 832 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 833 | // ctrlui.TokenInfo
|
---|
| 834 | var $ctrlui_$TokenInfo = function(token, type) {
|
---|
| 835 | this.$token = null;
|
---|
| 836 | this.$type = 0;
|
---|
| 837 | this.$token = token;
|
---|
| 838 | this.$type = type;
|
---|
| 839 | };
|
---|
| 840 | $ctrlui_$TokenInfo.__typeName = 'ctrlui.$TokenInfo';
|
---|
| 841 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 842 | // ctrlui.TokenType
|
---|
| 843 | var $ctrlui_$TokenType = function() {
|
---|
| 844 | };
|
---|
| 845 | $ctrlui_$TokenType.__typeName = 'ctrlui.$TokenType';
|
---|
| 846 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 847 | // ctrlui.ValueSet
|
---|
| 848 | var $ctrlui_$ValueSet = function(values, ranges, bitField, initialValue) {
|
---|
| 849 | this.$values = null;
|
---|
| 850 | this.$ranges = null;
|
---|
| 851 | this.$bitField = null;
|
---|
| 852 | this.$initialValue = null;
|
---|
| 853 | this.$values = values;
|
---|
| 854 | this.$ranges = ranges;
|
---|
| 855 | this.$bitField = bitField;
|
---|
| 856 | this.$initialValue = initialValue;
|
---|
| 857 | };
|
---|
| 858 | $ctrlui_$ValueSet.__typeName = 'ctrlui.$ValueSet';
|
---|
| 859 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 860 | // ctrlui.BitField
|
---|
| 861 | var $ctrlui_BitField = function(least, most, disp) {
|
---|
| 862 | this.$_Least = 0;
|
---|
| 863 | this.$_Most = 0;
|
---|
| 864 | this.$_Disp = null;
|
---|
| 865 | this.$_Values = [];
|
---|
| 866 | this.$_Ranges = [];
|
---|
| 867 | this.$_InitailValue = null;
|
---|
| 868 | $ctrlui_Value.call(this);
|
---|
| 869 | this.$_Least = least;
|
---|
| 870 | this.$_Most = most;
|
---|
| 871 | this.$_Disp = disp;
|
---|
| 872 | };
|
---|
| 873 | $ctrlui_BitField.__typeName = 'ctrlui.BitField';
|
---|
| 874 | global.ctrlui.BitField = $ctrlui_BitField;
|
---|
| 875 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 876 | // ctrlui.BitFiledsValue
|
---|
| 877 | var $ctrlui_BitFiledsValue = function(bitFlds, bitFldVals, value) {
|
---|
| 878 | this.$_BitFields = null;
|
---|
| 879 | this.$_BitFieldValues = null;
|
---|
| 880 | this.$_Value = 0;
|
---|
| 881 | $ctrlui_Value.call(this);
|
---|
| 882 | this.$_BitFields = bitFlds;
|
---|
| 883 | this.$_BitFieldValues = bitFldVals;
|
---|
| 884 | this.$_Value = value;
|
---|
| 885 | };
|
---|
| 886 | $ctrlui_BitFiledsValue.__typeName = 'ctrlui.BitFiledsValue';
|
---|
| 887 | global.ctrlui.BitFiledsValue = $ctrlui_BitFiledsValue;
|
---|
| 888 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 889 | // ctrlui.DeviceController
|
---|
| 890 | var $ctrlui_DeviceController = function(nodeList) {
|
---|
| 891 | this.$m_NodeList = [];
|
---|
| 892 | $control_UIDeviceController.call(this);
|
---|
| 893 | this.$m_NodeList = nodeList;
|
---|
| 894 | this.deviceController = this;
|
---|
| 895 | };
|
---|
| 896 | $ctrlui_DeviceController.__typeName = 'ctrlui.DeviceController';
|
---|
| 897 | global.ctrlui.DeviceController = $ctrlui_DeviceController;
|
---|
| 898 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 899 | // ctrlui.DeviceController.DeviceInfo
|
---|
| 900 | var $ctrlui_DeviceController$DeviceInfo = function(eci, prps) {
|
---|
| 901 | this.$m_ClassInfo = null;
|
---|
| 902 | this.$m_Profile = false;
|
---|
| 903 | this.$m_ClassGroupCode = 0;
|
---|
| 904 | this.$m_ClassCode = 0;
|
---|
| 905 | this.$m_InstanceCode = 0;
|
---|
| 906 | this.$m_Properties = [];
|
---|
| 907 | this.$m_EObjId = 0;
|
---|
| 908 | this.$2$DataField = null;
|
---|
| 909 | $control_UIDeviceController$UIDeviceInfo.call(this);
|
---|
| 910 | this.$m_ClassInfo = eci;
|
---|
| 911 | ss.arrayAddRange(this.$m_Properties, prps);
|
---|
| 912 | };
|
---|
| 913 | $ctrlui_DeviceController$DeviceInfo.__typeName = 'ctrlui.DeviceController$DeviceInfo';
|
---|
| 914 | $ctrlui_DeviceController$DeviceInfo.$ctor2 = function(eci, profile, x1, x2, x3, eobjid) {
|
---|
| 915 | this.$m_ClassInfo = null;
|
---|
| 916 | this.$m_Profile = false;
|
---|
| 917 | this.$m_ClassGroupCode = 0;
|
---|
| 918 | this.$m_ClassCode = 0;
|
---|
| 919 | this.$m_InstanceCode = 0;
|
---|
| 920 | this.$m_Properties = [];
|
---|
| 921 | this.$m_EObjId = 0;
|
---|
| 922 | this.$2$DataField = null;
|
---|
| 923 | $control_UIDeviceController$UIDeviceInfo.call(this);
|
---|
| 924 | this.$m_ClassInfo = eci;
|
---|
| 925 | this.$m_Profile = profile;
|
---|
| 926 | this.$m_ClassGroupCode = x1;
|
---|
| 927 | this.$m_ClassCode = x2;
|
---|
| 928 | this.$m_InstanceCode = x3;
|
---|
| 929 | this.$m_EObjId = eobjid;
|
---|
| 930 | };
|
---|
| 931 | $ctrlui_DeviceController$DeviceInfo.$ctor1 = function(eci, dev) {
|
---|
| 932 | $ctrlui_DeviceController$DeviceInfo.$ctor2.call(this, eci, dev.profile, dev.x1, dev.x2, dev.x3, dev.eobjid);
|
---|
| 933 | };
|
---|
| 934 | global.ctrlui.DeviceController$DeviceInfo = $ctrlui_DeviceController$DeviceInfo;
|
---|
| 935 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 936 | // ctrlui.DeviceController.DevicePropertyInfo
|
---|
| 937 | var $ctrlui_DeviceController$DevicePropertyInfo = function(epi, prop) {
|
---|
| 938 | $ctrlui_DeviceController$DevicePropertyInfo.$ctor1.call(this, epi, prop.epc, prop.flag, epi.size);
|
---|
| 939 | };
|
---|
| 940 | $ctrlui_DeviceController$DevicePropertyInfo.__typeName = 'ctrlui.DeviceController$DevicePropertyInfo';
|
---|
| 941 | $ctrlui_DeviceController$DevicePropertyInfo.$ctor1 = function(epi, epc, flag, size) {
|
---|
| 942 | this.$m_PropertyInfo = null;
|
---|
| 943 | this.$m_PropertyCode = 0;
|
---|
| 944 | this.$m_Flag = 0;
|
---|
| 945 | this.$m_Size = 0;
|
---|
| 946 | this.$m_Data = null;
|
---|
| 947 | this.$m_InputTypes = null;
|
---|
| 948 | this.$2$InputDataField = null;
|
---|
| 949 | this.$2$IsWaitResField = false;
|
---|
| 950 | $control_UIDeviceController$UIDevicePropertyInfo.call(this);
|
---|
| 951 | this.$m_PropertyInfo = epi;
|
---|
| 952 | this.$m_PropertyCode = epc;
|
---|
| 953 | this.$m_Flag = flag;
|
---|
| 954 | this.$m_Size = size;
|
---|
| 955 | //base.SetProperty(this);
|
---|
| 956 | };
|
---|
| 957 | global.ctrlui.DeviceController$DevicePropertyInfo = $ctrlui_DeviceController$DevicePropertyInfo;
|
---|
| 958 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 959 | // ctrlui.DeviceController.NodeInfo
|
---|
| 960 | var $ctrlui_DeviceController$NodeInfo = function(nodeId, profile) {
|
---|
| 961 | this.$m_NodeId = 0;
|
---|
| 962 | this.$m_Profile = null;
|
---|
| 963 | this.$m_Devices = [];
|
---|
| 964 | this.$1$DataField = null;
|
---|
| 965 | this.$m_NodeId = nodeId;
|
---|
| 966 | this.$m_Profile = profile;
|
---|
| 967 | };
|
---|
| 968 | $ctrlui_DeviceController$NodeInfo.__typeName = 'ctrlui.DeviceController$NodeInfo';
|
---|
| 969 | global.ctrlui.DeviceController$NodeInfo = $ctrlui_DeviceController$NodeInfo;
|
---|
| 970 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 971 | // ctrlui.ENOD_ID
|
---|
| 972 | var $ctrlui_ENOD_ID = function() {
|
---|
| 973 | };
|
---|
| 974 | $ctrlui_ENOD_ID.__typeName = 'ctrlui.ENOD_ID';
|
---|
| 975 | global.ctrlui.ENOD_ID = $ctrlui_ENOD_ID;
|
---|
| 976 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 977 | // ctrlui.EPC_FLAG
|
---|
| 978 | var $ctrlui_EPC_FLAG = function() {
|
---|
| 979 | };
|
---|
| 980 | $ctrlui_EPC_FLAG.__typeName = 'ctrlui.EPC_FLAG';
|
---|
| 981 | global.ctrlui.EPC_FLAG = $ctrlui_EPC_FLAG;
|
---|
| 982 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 983 | // ctrlui.Information
|
---|
| 984 | var $ctrlui_Information = function() {
|
---|
| 985 | this.$info = null;
|
---|
| 986 | };
|
---|
| 987 | $ctrlui_Information.__typeName = 'ctrlui.Information';
|
---|
| 988 | global.ctrlui.Information = $ctrlui_Information;
|
---|
| 989 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 990 | // ctrlui.InRangeValue
|
---|
| 991 | var $ctrlui_InRangeValue = function(range, value) {
|
---|
| 992 | this.$_Range = null;
|
---|
| 993 | this.$_Value = 0;
|
---|
| 994 | $ctrlui_Value.call(this);
|
---|
| 995 | this.$_Range = range;
|
---|
| 996 | this.$_Value = value;
|
---|
| 997 | };
|
---|
| 998 | $ctrlui_InRangeValue.__typeName = 'ctrlui.InRangeValue';
|
---|
| 999 | global.ctrlui.InRangeValue = $ctrlui_InRangeValue;
|
---|
| 1000 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1001 | // ctrlui.JsonClassGroupInfo
|
---|
| 1002 | var $ctrlui_JsonClassGroupInfo = function(p) {
|
---|
| 1003 | this.classGroupCode = 0;
|
---|
| 1004 | this.description = null;
|
---|
| 1005 | this.define = null;
|
---|
| 1006 | this.classes = null;
|
---|
| 1007 | this.classGroupCode = ss.unbox(ss.cast(p.classGroupCode, ss.Int32));
|
---|
| 1008 | this.description = ss.cast(p.description, String);
|
---|
| 1009 | this.define = ss.cast(p.define, String);
|
---|
| 1010 | };
|
---|
| 1011 | $ctrlui_JsonClassGroupInfo.__typeName = 'ctrlui.JsonClassGroupInfo';
|
---|
| 1012 | global.ctrlui.JsonClassGroupInfo = $ctrlui_JsonClassGroupInfo;
|
---|
| 1013 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1014 | // ctrlui.JsonClassInfo
|
---|
| 1015 | var $ctrlui_JsonClassInfo = function(p) {
|
---|
| 1016 | this.classCode = 0;
|
---|
| 1017 | this.description = null;
|
---|
| 1018 | this.name = null;
|
---|
| 1019 | this.define = null;
|
---|
| 1020 | this.type = null;
|
---|
| 1021 | this.classGroup = null;
|
---|
| 1022 | this.properties = null;
|
---|
| 1023 | this.classCode = ss.unbox(ss.cast(p.classCode, ss.Int32));
|
---|
| 1024 | this.description = ss.cast(p.description, String);
|
---|
| 1025 | this.name = ss.cast(p.name, String);
|
---|
| 1026 | this.define = ss.cast(p.define, String);
|
---|
| 1027 | this.type = ss.cast(p.type, String);
|
---|
| 1028 | this.classGroup = ss.cast(p.classGroup, $ctrlui_JsonClassGroupInfo);
|
---|
| 1029 | this.properties = ss.cast(p.properties, Array);
|
---|
| 1030 | };
|
---|
| 1031 | $ctrlui_JsonClassInfo.__typeName = 'ctrlui.JsonClassInfo';
|
---|
| 1032 | global.ctrlui.JsonClassInfo = $ctrlui_JsonClassInfo;
|
---|
| 1033 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1034 | // ctrlui.JsonFieldInfo
|
---|
| 1035 | var $ctrlui_JsonFieldInfo = function() {
|
---|
| 1036 | this.description = null;
|
---|
| 1037 | this.valueDescription = null;
|
---|
| 1038 | this.unitDescription = null;
|
---|
| 1039 | this.initialValue = null;
|
---|
| 1040 | this.type = null;
|
---|
| 1041 | this.identifer = null;
|
---|
| 1042 | this.primitive = false;
|
---|
| 1043 | this.isArray = false;
|
---|
| 1044 | this.arrayCount = 0;
|
---|
| 1045 | this.size = 0;
|
---|
| 1046 | this.fields = null;
|
---|
| 1047 | };
|
---|
| 1048 | $ctrlui_JsonFieldInfo.__typeName = 'ctrlui.JsonFieldInfo';
|
---|
| 1049 | global.ctrlui.JsonFieldInfo = $ctrlui_JsonFieldInfo;
|
---|
| 1050 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1051 | // ctrlui.JsonNodeInfo
|
---|
| 1052 | var $ctrlui_JsonNodeInfo = function(type, identifer, attribute) {
|
---|
| 1053 | this.objects = null;
|
---|
| 1054 | $ctrlui_JsonObjectInfo.call(this, type, identifer);
|
---|
| 1055 | this.attribute = attribute;
|
---|
| 1056 | this.objects = [];
|
---|
| 1057 | };
|
---|
| 1058 | $ctrlui_JsonNodeInfo.__typeName = 'ctrlui.JsonNodeInfo';
|
---|
| 1059 | global.ctrlui.JsonNodeInfo = $ctrlui_JsonNodeInfo;
|
---|
| 1060 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1061 | // ctrlui.JsonObjectInfo
|
---|
| 1062 | var $ctrlui_JsonObjectInfo = function(type, identifer) {
|
---|
| 1063 | this.type = null;
|
---|
| 1064 | this.parent = null;
|
---|
| 1065 | this.identifer = null;
|
---|
| 1066 | this.instatceCode = 0;
|
---|
| 1067 | this.attribute = null;
|
---|
| 1068 | this.properties = null;
|
---|
| 1069 | this.type = type;
|
---|
| 1070 | this.identifer = identifer;
|
---|
| 1071 | this.instatceCode = 1;
|
---|
| 1072 | this.attribute = 'device';
|
---|
| 1073 | this.properties = [];
|
---|
| 1074 | };
|
---|
| 1075 | $ctrlui_JsonObjectInfo.__typeName = 'ctrlui.JsonObjectInfo';
|
---|
| 1076 | global.ctrlui.JsonObjectInfo = $ctrlui_JsonObjectInfo;
|
---|
| 1077 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1078 | // ctrlui.JsonPropertyInfo
|
---|
| 1079 | var $ctrlui_JsonPropertyInfo = function() {
|
---|
| 1080 | this.classInfo = null;
|
---|
| 1081 | this.propertyCode = 0;
|
---|
| 1082 | this.access = null;
|
---|
| 1083 | this.required = null;
|
---|
| 1084 | $ctrlui_JsonFieldInfo.call(this);
|
---|
| 1085 | };
|
---|
| 1086 | $ctrlui_JsonPropertyInfo.__typeName = 'ctrlui.JsonPropertyInfo';
|
---|
| 1087 | $ctrlui_JsonPropertyInfo.$ctor1 = function(p) {
|
---|
| 1088 | this.classInfo = null;
|
---|
| 1089 | this.propertyCode = 0;
|
---|
| 1090 | this.access = null;
|
---|
| 1091 | this.required = null;
|
---|
| 1092 | $ctrlui_JsonFieldInfo.call(this);
|
---|
| 1093 | this.classInfo = ss.cast(p.classInfo, $ctrlui_JsonObjectInfo);
|
---|
| 1094 | this.propertyCode = ss.unbox(ss.cast(p.propertyCode, ss.Int32));
|
---|
| 1095 | this.access = ss.cast(p.access, Array);
|
---|
| 1096 | this.required = ss.cast(p.required, Array);
|
---|
| 1097 | this.description = ss.cast(p.description, String);
|
---|
| 1098 | this.valueDescription = ss.cast(p.valueDescription, String);
|
---|
| 1099 | this.unitDescription = ss.cast(p.unitDescription, String);
|
---|
| 1100 | this.initialValue = ss.cast(p.initialValue, String);
|
---|
| 1101 | this.type = ss.cast(p.type, String);
|
---|
| 1102 | this.identifer = ss.cast(p.identifer, String);
|
---|
| 1103 | this.primitive = !!p.primitive;
|
---|
| 1104 | this.isArray = !!p.isArray;
|
---|
| 1105 | this.arrayCount = ss.unbox(ss.cast(p.arrayCount, ss.Int32));
|
---|
| 1106 | this.size = ss.unbox(ss.cast(p.size, ss.Int32));
|
---|
| 1107 | this.fields = ss.cast(p.fields, Array);
|
---|
| 1108 | };
|
---|
| 1109 | global.ctrlui.JsonPropertyInfo = $ctrlui_JsonPropertyInfo;
|
---|
| 1110 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1111 | // ctrlui.JsonSkeltonResult
|
---|
| 1112 | var $ctrlui_JsonSkeltonResult = function() {
|
---|
| 1113 | this.macro = null;
|
---|
| 1114 | this.declare = null;
|
---|
| 1115 | this.predefine = null;
|
---|
| 1116 | this.types = null;
|
---|
| 1117 | this.funcs = null;
|
---|
| 1118 | this.instance = null;
|
---|
| 1119 | this.define = null;
|
---|
| 1120 | this.config = null;
|
---|
| 1121 | };
|
---|
| 1122 | $ctrlui_JsonSkeltonResult.__typeName = 'ctrlui.JsonSkeltonResult';
|
---|
| 1123 | global.ctrlui.JsonSkeltonResult = $ctrlui_JsonSkeltonResult;
|
---|
| 1124 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1125 | // ctrlui.Option
|
---|
| 1126 | var $ctrlui_Option = function(val, disp) {
|
---|
| 1127 | this.$_Val = 0;
|
---|
| 1128 | this.$_Disp = null;
|
---|
| 1129 | $ctrlui_Value.call(this);
|
---|
| 1130 | this.$_Val = val;
|
---|
| 1131 | this.$_Disp = disp;
|
---|
| 1132 | };
|
---|
| 1133 | $ctrlui_Option.__typeName = 'ctrlui.Option';
|
---|
| 1134 | global.ctrlui.Option = $ctrlui_Option;
|
---|
| 1135 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1136 | // ctrlui.PropertyInputInfo
|
---|
| 1137 | var $ctrlui_PropertyInputInfo = function() {
|
---|
| 1138 | this.mode = 0;
|
---|
| 1139 | };
|
---|
| 1140 | $ctrlui_PropertyInputInfo.__typeName = 'ctrlui.PropertyInputInfo';
|
---|
| 1141 | global.ctrlui.PropertyInputInfo = $ctrlui_PropertyInputInfo;
|
---|
| 1142 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1143 | // ctrlui.PropertyInputMode
|
---|
| 1144 | var $ctrlui_PropertyInputMode = function() {
|
---|
| 1145 | };
|
---|
| 1146 | $ctrlui_PropertyInputMode.__typeName = 'ctrlui.PropertyInputMode';
|
---|
| 1147 | global.ctrlui.PropertyInputMode = $ctrlui_PropertyInputMode;
|
---|
| 1148 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1149 | // ctrlui.PropertyRangeInput
|
---|
| 1150 | var $ctrlui_PropertyRangeInput = function() {
|
---|
| 1151 | this.maximum = 0;
|
---|
| 1152 | this.minimum = 0;
|
---|
| 1153 | this.minDescrption = null;
|
---|
| 1154 | this.maxDescrption = null;
|
---|
| 1155 | $ctrlui_PropertyInputInfo.call(this);
|
---|
| 1156 | this.mode = 2;
|
---|
| 1157 | };
|
---|
| 1158 | $ctrlui_PropertyRangeInput.__typeName = 'ctrlui.PropertyRangeInput';
|
---|
| 1159 | global.ctrlui.PropertyRangeInput = $ctrlui_PropertyRangeInput;
|
---|
| 1160 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1161 | // ctrlui.PropertySelectInput
|
---|
| 1162 | var $ctrlui_PropertySelectInput = function() {
|
---|
| 1163 | this.option = new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, String]))();
|
---|
| 1164 | $ctrlui_PropertyInputInfo.call(this);
|
---|
| 1165 | this.mode = 1;
|
---|
| 1166 | };
|
---|
| 1167 | $ctrlui_PropertySelectInput.__typeName = 'ctrlui.PropertySelectInput';
|
---|
| 1168 | global.ctrlui.PropertySelectInput = $ctrlui_PropertySelectInput;
|
---|
| 1169 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1170 | // ctrlui.Range
|
---|
| 1171 | var $ctrlui_Range = function(min, max, disp) {
|
---|
| 1172 | this.$_Min = 0;
|
---|
| 1173 | this.$_Max = 0;
|
---|
| 1174 | this.$_Disp = null;
|
---|
| 1175 | this.$_MinDisp = null;
|
---|
| 1176 | this.$_MaxDisp = null;
|
---|
| 1177 | this.$_Unit = null;
|
---|
| 1178 | this.$_InitialValue = 0;
|
---|
| 1179 | $ctrlui_Value.call(this);
|
---|
| 1180 | this.$_Min = min;
|
---|
| 1181 | this.$_Max = max;
|
---|
| 1182 | this.$_Disp = disp;
|
---|
| 1183 | this.$_MinDisp = '';
|
---|
| 1184 | this.$_MaxDisp = '';
|
---|
| 1185 | this.$_Unit = '';
|
---|
| 1186 | this.$_InitialValue = min;
|
---|
| 1187 | };
|
---|
| 1188 | $ctrlui_Range.__typeName = 'ctrlui.Range';
|
---|
| 1189 | $ctrlui_Range.$ctor1 = function(min, max, disp, minDisp, maxDisp, unit) {
|
---|
| 1190 | this.$_Min = 0;
|
---|
| 1191 | this.$_Max = 0;
|
---|
| 1192 | this.$_Disp = null;
|
---|
| 1193 | this.$_MinDisp = null;
|
---|
| 1194 | this.$_MaxDisp = null;
|
---|
| 1195 | this.$_Unit = null;
|
---|
| 1196 | this.$_InitialValue = 0;
|
---|
| 1197 | $ctrlui_Value.call(this);
|
---|
| 1198 | this.$_Min = min;
|
---|
| 1199 | this.$_Max = max;
|
---|
| 1200 | this.$_Disp = disp;
|
---|
| 1201 | this.$_MinDisp = minDisp;
|
---|
| 1202 | this.$_MaxDisp = maxDisp;
|
---|
| 1203 | this.$_Unit = unit;
|
---|
| 1204 | this.$_InitialValue = min;
|
---|
| 1205 | };
|
---|
| 1206 | global.ctrlui.Range = $ctrlui_Range;
|
---|
| 1207 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1208 | // ctrlui.T_ECN_EOJ
|
---|
| 1209 | var $ctrlui_T_ECN_EOJ = function(src, offset) {
|
---|
| 1210 | this.$_eoj = new Array(3);
|
---|
| 1211 | this.$_eoj[0] = src[offset];
|
---|
| 1212 | this.$_eoj[1] = src[offset + 1];
|
---|
| 1213 | this.$_eoj[2] = src[offset + 2];
|
---|
| 1214 | };
|
---|
| 1215 | $ctrlui_T_ECN_EOJ.__typeName = 'ctrlui.T_ECN_EOJ';
|
---|
| 1216 | global.ctrlui.T_ECN_EOJ = $ctrlui_T_ECN_EOJ;
|
---|
| 1217 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1218 | // ctrlui.Value
|
---|
| 1219 | var $ctrlui_Value = function() {
|
---|
| 1220 | };
|
---|
| 1221 | $ctrlui_Value.__typeName = 'ctrlui.Value';
|
---|
| 1222 | global.ctrlui.Value = $ctrlui_Value;
|
---|
| 1223 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1224 | // ctrlui.ValueRange
|
---|
| 1225 | var $ctrlui_ValueRange = function() {
|
---|
| 1226 | this.$_Values = [];
|
---|
| 1227 | this.$_Ranges = [];
|
---|
| 1228 | this.$_BitFields = [];
|
---|
| 1229 | this.$_MemberFields = [];
|
---|
| 1230 | this.$_InitailValue = null;
|
---|
| 1231 | };
|
---|
| 1232 | $ctrlui_ValueRange.__typeName = 'ctrlui.ValueRange';
|
---|
| 1233 | $ctrlui_ValueRange.$parseValueRange = function(input, type, values, ranges, bitFeild, initialValue) {
|
---|
| 1234 | bitFeild.$ = null;
|
---|
| 1235 | initialValue.$ = null;
|
---|
| 1236 | var tokens = [];
|
---|
| 1237 | var pos = 0;
|
---|
| 1238 | while (pos < input.length) {
|
---|
| 1239 | var ms;
|
---|
| 1240 | var m;
|
---|
| 1241 | if (ss.isValue(m = (ms = new RegExp($ctrlui_$TokenInfo.$hexValue)).exec(input.substring(pos)))) {
|
---|
| 1242 | tokens.push(new $ctrlui_$TokenInfo(m[0], 1));
|
---|
| 1243 | pos += m[0].length;
|
---|
| 1244 | }
|
---|
| 1245 | else if (ss.isValue(m = (ms = new RegExp($ctrlui_$TokenInfo.$numeric)).exec(input.substring(pos)))) {
|
---|
| 1246 | tokens.push(new $ctrlui_$TokenInfo(m[0], 2));
|
---|
| 1247 | pos += m[0].length;
|
---|
| 1248 | }
|
---|
| 1249 | else {
|
---|
| 1250 | if (ss.isNullOrUndefined(m = (ms = new RegExp($ctrlui_$TokenInfo.$separetor)).exec(input.substring(pos)))) {
|
---|
| 1251 | tokens.push(new $ctrlui_$TokenInfo(input.substring(pos), 3));
|
---|
| 1252 | break;
|
---|
| 1253 | }
|
---|
| 1254 | var index = pos + m.index;
|
---|
| 1255 | if (index === pos) {
|
---|
| 1256 | tokens.push(new $ctrlui_$TokenInfo(m[0], 0));
|
---|
| 1257 | pos += 1;
|
---|
| 1258 | }
|
---|
| 1259 | else {
|
---|
| 1260 | tokens.push(new $ctrlui_$TokenInfo(input.substr(pos, index - pos), 3));
|
---|
| 1261 | tokens.push(new $ctrlui_$TokenInfo(m[0], 0));
|
---|
| 1262 | pos = index + 1;
|
---|
| 1263 | }
|
---|
| 1264 | }
|
---|
| 1265 | }
|
---|
| 1266 | tokens.push(new $ctrlui_$TokenInfo('', 4));
|
---|
| 1267 | var OK = false;
|
---|
| 1268 | var sentence = [];
|
---|
| 1269 | var state = 0;
|
---|
| 1270 | for (var $t1 = 0; $t1 < tokens.length; $t1++) {
|
---|
| 1271 | var token = tokens[$t1];
|
---|
| 1272 | switch (state) {
|
---|
| 1273 | case 0: {
|
---|
| 1274 | if (token.$type === 1 || token.$type === 2) {
|
---|
| 1275 | sentence.push(token);
|
---|
| 1276 | state = 1;
|
---|
| 1277 | continue;
|
---|
| 1278 | }
|
---|
| 1279 | else if (token.$type === 0 && token.$token === '[') {
|
---|
| 1280 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1281 | break;
|
---|
| 1282 | }
|
---|
| 1283 | state = 12;
|
---|
| 1284 | continue;
|
---|
| 1285 | }
|
---|
| 1286 | break;
|
---|
| 1287 | }
|
---|
| 1288 | case 1: {
|
---|
| 1289 | if (token.$type === 0) {
|
---|
| 1290 | switch (token.$token) {
|
---|
| 1291 | case '=': {
|
---|
| 1292 | state = 2;
|
---|
| 1293 | continue;
|
---|
| 1294 | }
|
---|
| 1295 | case '~': {
|
---|
| 1296 | state = 4;
|
---|
| 1297 | continue;
|
---|
| 1298 | }
|
---|
| 1299 | }
|
---|
| 1300 | }
|
---|
| 1301 | else if (token.$type === 4) {
|
---|
| 1302 | var option = new $ctrlui_Option(sentence[0].$toInt64(type), '固定');
|
---|
| 1303 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1304 | bitFeild.$.$addValue(option);
|
---|
| 1305 | }
|
---|
| 1306 | else {
|
---|
| 1307 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1308 | initialValue.$ = option;
|
---|
| 1309 | }
|
---|
| 1310 | values.push(option);
|
---|
| 1311 | }
|
---|
| 1312 | ss.clear(sentence);
|
---|
| 1313 | state = 11;
|
---|
| 1314 | continue;
|
---|
| 1315 | }
|
---|
| 1316 | break;
|
---|
| 1317 | }
|
---|
| 1318 | case 2: {
|
---|
| 1319 | if (token.$type === 3) {
|
---|
| 1320 | var option1 = new $ctrlui_Option(sentence[0].$toInt64(type), token.$token);
|
---|
| 1321 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1322 | bitFeild.$.$addValue(option1);
|
---|
| 1323 | }
|
---|
| 1324 | else {
|
---|
| 1325 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1326 | initialValue.$ = option1;
|
---|
| 1327 | }
|
---|
| 1328 | values.push(option1);
|
---|
| 1329 | }
|
---|
| 1330 | ss.clear(sentence);
|
---|
| 1331 | state = 11;
|
---|
| 1332 | continue;
|
---|
| 1333 | }
|
---|
| 1334 | else if (token.$type === 2) {
|
---|
| 1335 | sentence.push(token);
|
---|
| 1336 | state = 3;
|
---|
| 1337 | continue;
|
---|
| 1338 | }
|
---|
| 1339 | break;
|
---|
| 1340 | }
|
---|
| 1341 | case 3: {
|
---|
| 1342 | if (token.$type === 3) {
|
---|
| 1343 | var option2 = new $ctrlui_Option(sentence[0].$toInt64(type), sentence[1].$token + token.$token);
|
---|
| 1344 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1345 | bitFeild.$.$addValue(option2);
|
---|
| 1346 | }
|
---|
| 1347 | else {
|
---|
| 1348 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1349 | initialValue.$ = option2;
|
---|
| 1350 | }
|
---|
| 1351 | values.push(option2);
|
---|
| 1352 | }
|
---|
| 1353 | ss.clear(sentence);
|
---|
| 1354 | state = 11;
|
---|
| 1355 | continue;
|
---|
| 1356 | }
|
---|
| 1357 | else if (token.$type === 0 && token.$token === ',') {
|
---|
| 1358 | var option3 = new $ctrlui_Option(sentence[0].$toInt64(type), sentence[1].$token);
|
---|
| 1359 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1360 | bitFeild.$.$addValue(option3);
|
---|
| 1361 | }
|
---|
| 1362 | else {
|
---|
| 1363 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1364 | initialValue.$ = option3;
|
---|
| 1365 | }
|
---|
| 1366 | values.push(option3);
|
---|
| 1367 | }
|
---|
| 1368 | ss.clear(sentence);
|
---|
| 1369 | state = 0;
|
---|
| 1370 | continue;
|
---|
| 1371 | }
|
---|
| 1372 | else if (token.$type === 4) {
|
---|
| 1373 | var option4 = new $ctrlui_Option(sentence[0].$toInt64(type), sentence[1].$token);
|
---|
| 1374 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1375 | bitFeild.$.$addValue(option4);
|
---|
| 1376 | }
|
---|
| 1377 | else {
|
---|
| 1378 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1379 | initialValue.$ = option4;
|
---|
| 1380 | }
|
---|
| 1381 | values.push(option4);
|
---|
| 1382 | }
|
---|
| 1383 | ss.clear(sentence);
|
---|
| 1384 | OK = true;
|
---|
| 1385 | }
|
---|
| 1386 | break;
|
---|
| 1387 | }
|
---|
| 1388 | case 4: {
|
---|
| 1389 | if (token.$type === 1 || token.$type === 2) {
|
---|
| 1390 | sentence.push(token);
|
---|
| 1391 | state = 5;
|
---|
| 1392 | continue;
|
---|
| 1393 | }
|
---|
| 1394 | else if (token.$type === 0 && token.$token === '=') {
|
---|
| 1395 | var max = '0x';
|
---|
| 1396 | for (var i = sentence[0].$token.length - 2; i > 0; i--) {
|
---|
| 1397 | max += 'F';
|
---|
| 1398 | }
|
---|
| 1399 | sentence.push(new $ctrlui_$TokenInfo(max, 1));
|
---|
| 1400 | state = 6;
|
---|
| 1401 | continue;
|
---|
| 1402 | }
|
---|
| 1403 | break;
|
---|
| 1404 | }
|
---|
| 1405 | case 5: {
|
---|
| 1406 | if (token.$type === 0) {
|
---|
| 1407 | switch (token.$token) {
|
---|
| 1408 | case '=': {
|
---|
| 1409 | if (sentence.length === 2) {
|
---|
| 1410 | state = 6;
|
---|
| 1411 | continue;
|
---|
| 1412 | }
|
---|
| 1413 | break;
|
---|
| 1414 | }
|
---|
| 1415 | case '(': {
|
---|
| 1416 | sentence.push(new $ctrlui_$TokenInfo('', 3));
|
---|
| 1417 | state = 7;
|
---|
| 1418 | continue;
|
---|
| 1419 | }
|
---|
| 1420 | case ',': {
|
---|
| 1421 | var range = new $ctrlui_Range(sentence[0].$toInt64(type), sentence[1].$toInt64(type), ((sentence.length > 2) ? sentence[2].$token : ''));
|
---|
| 1422 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1423 | bitFeild.$.$addRange(range);
|
---|
| 1424 | }
|
---|
| 1425 | else {
|
---|
| 1426 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1427 | initialValue.$ = range;
|
---|
| 1428 | }
|
---|
| 1429 | ranges.push(range);
|
---|
| 1430 | }
|
---|
| 1431 | ss.clear(sentence);
|
---|
| 1432 | state = 0;
|
---|
| 1433 | continue;
|
---|
| 1434 | }
|
---|
| 1435 | }
|
---|
| 1436 | }
|
---|
| 1437 | else if (token.$type === 4) {
|
---|
| 1438 | var range1 = new $ctrlui_Range(sentence[0].$toInt64(type), sentence[1].$toInt64(type), ((sentence.length > 2) ? sentence[2].$token : ''));
|
---|
| 1439 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1440 | bitFeild.$.$addRange(range1);
|
---|
| 1441 | }
|
---|
| 1442 | else {
|
---|
| 1443 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1444 | initialValue.$ = range1;
|
---|
| 1445 | }
|
---|
| 1446 | ranges.push(range1);
|
---|
| 1447 | }
|
---|
| 1448 | ss.clear(sentence);
|
---|
| 1449 | OK = true;
|
---|
| 1450 | }
|
---|
| 1451 | break;
|
---|
| 1452 | }
|
---|
| 1453 | case 6: {
|
---|
| 1454 | if (token.$type === 3) {
|
---|
| 1455 | sentence.push(token);
|
---|
| 1456 | state = 5;
|
---|
| 1457 | continue;
|
---|
| 1458 | }
|
---|
| 1459 | break;
|
---|
| 1460 | }
|
---|
| 1461 | case 7: {
|
---|
| 1462 | if (token.$type === 2 || token.$type === 3) {
|
---|
| 1463 | sentence.push(token);
|
---|
| 1464 | state = 8;
|
---|
| 1465 | continue;
|
---|
| 1466 | }
|
---|
| 1467 | break;
|
---|
| 1468 | }
|
---|
| 1469 | case 8: {
|
---|
| 1470 | if (token.$type === 0 && token.$token === '~') {
|
---|
| 1471 | state = 9;
|
---|
| 1472 | continue;
|
---|
| 1473 | }
|
---|
| 1474 | break;
|
---|
| 1475 | }
|
---|
| 1476 | case 9: {
|
---|
| 1477 | if (token.$type === 2 || token.$type === 3) {
|
---|
| 1478 | sentence.push(token);
|
---|
| 1479 | state = 10;
|
---|
| 1480 | continue;
|
---|
| 1481 | }
|
---|
| 1482 | break;
|
---|
| 1483 | }
|
---|
| 1484 | case 10: {
|
---|
| 1485 | if (token.$type === 0 && token.$token === ')') {
|
---|
| 1486 | var range2 = new $ctrlui_Range.$ctor1(sentence[0].$toInt64(type), sentence[1].$toInt64(type), sentence[2].$token, sentence[3].$token, sentence[4].$token, ((sentence.length > 5) ? sentence[5].$token : ''));
|
---|
| 1487 | if (ss.isValue(bitFeild.$)) {
|
---|
| 1488 | bitFeild.$.$addRange(range2);
|
---|
| 1489 | }
|
---|
| 1490 | else {
|
---|
| 1491 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1492 | initialValue.$ = range2;
|
---|
| 1493 | }
|
---|
| 1494 | ranges.push(range2);
|
---|
| 1495 | }
|
---|
| 1496 | ss.clear(sentence);
|
---|
| 1497 | state = 11;
|
---|
| 1498 | continue;
|
---|
| 1499 | }
|
---|
| 1500 | else if (token.$type === 3) {
|
---|
| 1501 | sentence.push(token);
|
---|
| 1502 | state = 10;
|
---|
| 1503 | continue;
|
---|
| 1504 | }
|
---|
| 1505 | break;
|
---|
| 1506 | }
|
---|
| 1507 | case 12: {
|
---|
| 1508 | if (token.$type === 2) {
|
---|
| 1509 | sentence.push(token);
|
---|
| 1510 | state = 13;
|
---|
| 1511 | continue;
|
---|
| 1512 | }
|
---|
| 1513 | break;
|
---|
| 1514 | }
|
---|
| 1515 | case 13: {
|
---|
| 1516 | if (token.$type === 0) {
|
---|
| 1517 | switch (token.$token) {
|
---|
| 1518 | case '~': {
|
---|
| 1519 | state = 14;
|
---|
| 1520 | continue;
|
---|
| 1521 | }
|
---|
| 1522 | case ']': {
|
---|
| 1523 | sentence.push(sentence[0]);
|
---|
| 1524 | state = 15;
|
---|
| 1525 | continue;
|
---|
| 1526 | }
|
---|
| 1527 | }
|
---|
| 1528 | }
|
---|
| 1529 | break;
|
---|
| 1530 | }
|
---|
| 1531 | case 14: {
|
---|
| 1532 | if (token.$type === 2) {
|
---|
| 1533 | sentence.push(token);
|
---|
| 1534 | state = 16;
|
---|
| 1535 | continue;
|
---|
| 1536 | }
|
---|
| 1537 | break;
|
---|
| 1538 | }
|
---|
| 1539 | case 16: {
|
---|
| 1540 | if (token.$type === 0 && token.$token === ']') {
|
---|
| 1541 | state = 15;
|
---|
| 1542 | continue;
|
---|
| 1543 | }
|
---|
| 1544 | break;
|
---|
| 1545 | }
|
---|
| 1546 | case 15: {
|
---|
| 1547 | if (token.$type === 3) {
|
---|
| 1548 | sentence.push(token);
|
---|
| 1549 | state = 17;
|
---|
| 1550 | continue;
|
---|
| 1551 | }
|
---|
| 1552 | break;
|
---|
| 1553 | }
|
---|
| 1554 | case 17: {
|
---|
| 1555 | if (token.$type === 0 && token.$token === ':') {
|
---|
| 1556 | bitFeild.$ = new $ctrlui_BitField(sentence[0].$toInt32(), sentence[1].$toInt32(), sentence[2].$token);
|
---|
| 1557 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1558 | initialValue.$ = bitFeild.$;
|
---|
| 1559 | }
|
---|
| 1560 | ss.clear(sentence);
|
---|
| 1561 | state = 0;
|
---|
| 1562 | continue;
|
---|
| 1563 | }
|
---|
| 1564 | else if (token.$type === 4) {
|
---|
| 1565 | bitFeild.$ = new $ctrlui_BitField(sentence[0].$toInt32(), sentence[1].$toInt32(), sentence[2].$token);
|
---|
| 1566 | if (ss.isNullOrUndefined(initialValue.$)) {
|
---|
| 1567 | initialValue.$ = bitFeild.$;
|
---|
| 1568 | }
|
---|
| 1569 | ss.clear(sentence);
|
---|
| 1570 | OK = true;
|
---|
| 1571 | break;
|
---|
| 1572 | }
|
---|
| 1573 | break;
|
---|
| 1574 | }
|
---|
| 1575 | case 11: {
|
---|
| 1576 | if (token.$type === 4) {
|
---|
| 1577 | OK = true;
|
---|
| 1578 | }
|
---|
| 1579 | else if (token.$type === 0 && token.$token === ',') {
|
---|
| 1580 | state = 0;
|
---|
| 1581 | continue;
|
---|
| 1582 | }
|
---|
| 1583 | break;
|
---|
| 1584 | }
|
---|
| 1585 | }
|
---|
| 1586 | break;
|
---|
| 1587 | }
|
---|
| 1588 | return OK;
|
---|
| 1589 | };
|
---|
| 1590 | $ctrlui_ValueRange.parse = function(valrng, emti) {
|
---|
| 1591 | var valueRange = new $ctrlui_ValueRange();
|
---|
| 1592 | if (emti.primitive) {
|
---|
| 1593 | var lines = valrng.split(new RegExp('\r\n'));
|
---|
| 1594 | for (var $t1 = 0; $t1 < lines.length; $t1++) {
|
---|
| 1595 | var line = lines[$t1];
|
---|
| 1596 | if ((new RegExp('^<(.+)>$')).test(line)) {
|
---|
| 1597 | continue;
|
---|
| 1598 | }
|
---|
| 1599 | var values;
|
---|
| 1600 | var ranges;
|
---|
| 1601 | var bitField = {};
|
---|
| 1602 | var initialValue = {};
|
---|
| 1603 | var pair = {};
|
---|
| 1604 | if ($ctrlui_ValueRange.$_ParsedText.tryGetValue(line, pair)) {
|
---|
| 1605 | values = pair.$.$values;
|
---|
| 1606 | ranges = pair.$.$ranges;
|
---|
| 1607 | bitField.$ = pair.$.$bitField;
|
---|
| 1608 | initialValue.$ = pair.$.$initialValue;
|
---|
| 1609 | }
|
---|
| 1610 | else {
|
---|
| 1611 | values = [];
|
---|
| 1612 | ranges = [];
|
---|
| 1613 | $ctrlui_ValueRange.$parseValueRange(line, emti.type, values, ranges, bitField, initialValue);
|
---|
| 1614 | $ctrlui_ValueRange.$_ParsedText.add(line, new $ctrlui_$ValueSet(values, ranges, bitField.$, initialValue.$));
|
---|
| 1615 | }
|
---|
| 1616 | ss.arrayAddRange(valueRange.$_Values, values);
|
---|
| 1617 | ss.arrayAddRange(valueRange.$_Ranges, ranges);
|
---|
| 1618 | if (ss.isValue(bitField.$)) {
|
---|
| 1619 | valueRange.$_BitFields.push(bitField.$);
|
---|
| 1620 | }
|
---|
| 1621 | if (ss.isNullOrUndefined(valueRange.$_InitailValue)) {
|
---|
| 1622 | valueRange.$_InitailValue = initialValue.$;
|
---|
| 1623 | }
|
---|
| 1624 | }
|
---|
| 1625 | }
|
---|
| 1626 | else {
|
---|
| 1627 | for (var $t2 = 0; $t2 < emti.fields.length; $t2++) {
|
---|
| 1628 | var efi = emti.fields[$t2];
|
---|
| 1629 | var member = $ctrlui_ValueRange.parse(efi.valueDescription, efi);
|
---|
| 1630 | valueRange.$_MemberFields.push(member);
|
---|
| 1631 | }
|
---|
| 1632 | }
|
---|
| 1633 | return valueRange;
|
---|
| 1634 | };
|
---|
| 1635 | global.ctrlui.ValueRange = $ctrlui_ValueRange;
|
---|
| 1636 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1637 | // ctrlui.WampApiKadecotDevice
|
---|
| 1638 | var $ctrlui_WampApiKadecotDevice = function(doc) {
|
---|
| 1639 | this.description = null;
|
---|
| 1640 | this.deviceId = 0;
|
---|
| 1641 | this.deviceType = null;
|
---|
| 1642 | this.ip_addr = null;
|
---|
| 1643 | this.nickname = null;
|
---|
| 1644 | this.protocol = null;
|
---|
| 1645 | this.status = false;
|
---|
| 1646 | this.description = ss.cast(doc.description, String);
|
---|
| 1647 | this.deviceId = ss.unbox(ss.cast(doc.deviceId, ss.Int32));
|
---|
| 1648 | this.deviceType = ss.cast(doc.deviceType, String);
|
---|
| 1649 | this.ip_addr = ss.cast(doc.ip_addr, String);
|
---|
| 1650 | this.nickname = ss.cast(doc.nickname, String);
|
---|
| 1651 | this.protocol = ss.cast(doc.protocol, String);
|
---|
| 1652 | this.status = !!doc.status;
|
---|
| 1653 | };
|
---|
| 1654 | $ctrlui_WampApiKadecotDevice.__typeName = 'ctrlui.WampApiKadecotDevice';
|
---|
| 1655 | global.ctrlui.WampApiKadecotDevice = $ctrlui_WampApiKadecotDevice;
|
---|
| 1656 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1657 | // ctrlui.WampApiKadecotGet
|
---|
| 1658 | var $ctrlui_WampApiKadecotGet = function(deviceId, propertyName) {
|
---|
| 1659 | this.deviceId = 0;
|
---|
| 1660 | this.propertyName = null;
|
---|
| 1661 | this.deviceId = deviceId;
|
---|
| 1662 | this.propertyName = propertyName;
|
---|
| 1663 | };
|
---|
| 1664 | $ctrlui_WampApiKadecotGet.__typeName = 'ctrlui.WampApiKadecotGet';
|
---|
| 1665 | global.ctrlui.WampApiKadecotGet = $ctrlui_WampApiKadecotGet;
|
---|
| 1666 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1667 | // ctrlui.WampApiKadecotRes
|
---|
| 1668 | var $ctrlui_WampApiKadecotRes = function(item) {
|
---|
| 1669 | this.propertyName = null;
|
---|
| 1670 | this.propertyValue = null;
|
---|
| 1671 | this.propertyName = ss.cast(item.propertyName, String);
|
---|
| 1672 | if (ss.isValue(ss.getMembers(ss.getInstanceType(item), 16, 284, 'propertyValue'))) {
|
---|
| 1673 | this.propertyValue = ss.cast(item.propertyValue, Array);
|
---|
| 1674 | }
|
---|
| 1675 | else {
|
---|
| 1676 | this.propertyValue = [];
|
---|
| 1677 | }
|
---|
| 1678 | };
|
---|
| 1679 | $ctrlui_WampApiKadecotRes.__typeName = 'ctrlui.WampApiKadecotRes';
|
---|
| 1680 | global.ctrlui.WampApiKadecotRes = $ctrlui_WampApiKadecotRes;
|
---|
| 1681 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1682 | // ctrlui.WampApiKadecotSet
|
---|
| 1683 | var $ctrlui_WampApiKadecotSet = function(deviceId, propertyName, propertyValue) {
|
---|
| 1684 | this.deviceId = 0;
|
---|
| 1685 | this.propertyName = null;
|
---|
| 1686 | this.propertyValue = null;
|
---|
| 1687 | this.deviceId = deviceId;
|
---|
| 1688 | this.propertyName = propertyName;
|
---|
| 1689 | this.propertyValue = propertyValue;
|
---|
| 1690 | };
|
---|
| 1691 | $ctrlui_WampApiKadecotSet.__typeName = 'ctrlui.WampApiKadecotSet';
|
---|
| 1692 | global.ctrlui.WampApiKadecotSet = $ctrlui_WampApiKadecotSet;
|
---|
| 1693 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1694 | // ctrlui.WebApiEchonetMessage
|
---|
| 1695 | var $ctrlui_WebApiEchonetMessage = function(esv) {
|
---|
| 1696 | this.esv = 0;
|
---|
| 1697 | this.sender = 0;
|
---|
| 1698 | this.seoj = new $ctrlui_T_ECN_EOJ(new Array(3), 0);
|
---|
| 1699 | this.deoj = new $ctrlui_T_ECN_EOJ(new Array(3), 0);
|
---|
| 1700 | this.properties = [];
|
---|
| 1701 | this.esv = ss.unbox(ss.cast(esv.esv, ss.Int32));
|
---|
| 1702 | this.sender = ss.cast(esv.sender, ss.Int32);
|
---|
| 1703 | var sseoj = ss.cast(esv.seoj, String);
|
---|
| 1704 | this.seoj.set_x1(parseInt(sseoj.substr(0, 2), 16));
|
---|
| 1705 | this.seoj.set_x2(parseInt(sseoj.substr(2, 2), 16));
|
---|
| 1706 | this.seoj.set_x3(parseInt(sseoj.substr(4, 2), 16));
|
---|
| 1707 | var $t1 = ss.cast(esv.properties, Array);
|
---|
| 1708 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 1709 | var prop = $t1[$t2];
|
---|
| 1710 | this.properties.push(new $ctrlui_WebApiPropertyData(prop));
|
---|
| 1711 | }
|
---|
| 1712 | };
|
---|
| 1713 | $ctrlui_WebApiEchonetMessage.__typeName = 'ctrlui.WebApiEchonetMessage';
|
---|
| 1714 | global.ctrlui.WebApiEchonetMessage = $ctrlui_WebApiEchonetMessage;
|
---|
| 1715 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1716 | // ctrlui.WebApiGet
|
---|
| 1717 | var $ctrlui_WebApiGet = function() {
|
---|
| 1718 | this.deojid = 0;
|
---|
| 1719 | this.properties = [];
|
---|
| 1720 | };
|
---|
| 1721 | $ctrlui_WebApiGet.__typeName = 'ctrlui.WebApiGet';
|
---|
| 1722 | $ctrlui_WebApiGet.$ctor1 = function(esv) {
|
---|
| 1723 | this.deojid = 0;
|
---|
| 1724 | this.properties = [];
|
---|
| 1725 | this.deojid = ss.cast(esv.deojid, ss.Int32);
|
---|
| 1726 | var $t1 = ss.cast(esv.properties, Array);
|
---|
| 1727 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 1728 | var prop = $t1[$t2];
|
---|
| 1729 | this.properties.push(new $ctrlui_WebApiPropertyCode.$ctor1(prop, true));
|
---|
| 1730 | }
|
---|
| 1731 | };
|
---|
| 1732 | global.ctrlui.WebApiGet = $ctrlui_WebApiGet;
|
---|
| 1733 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1734 | // ctrlui.WebApiGrsaguraMessage
|
---|
| 1735 | var $ctrlui_WebApiGrsaguraMessage = function(esv) {
|
---|
| 1736 | this.pin = 0;
|
---|
| 1737 | this.value = null;
|
---|
| 1738 | this.pin = ss.unbox(ss.cast(esv.pin, ss.Int32));
|
---|
| 1739 | if (ss.referenceEquals(ss.getInstanceType(esv.value), Number)) {
|
---|
| 1740 | this.value = ss.unbox(ss.cast(esv.value, Number)).toString();
|
---|
| 1741 | }
|
---|
| 1742 | else {
|
---|
| 1743 | this.value = ss.cast(esv.value, String);
|
---|
| 1744 | }
|
---|
| 1745 | };
|
---|
| 1746 | $ctrlui_WebApiGrsaguraMessage.__typeName = 'ctrlui.WebApiGrsaguraMessage';
|
---|
| 1747 | global.ctrlui.WebApiGrsaguraMessage = $ctrlui_WebApiGrsaguraMessage;
|
---|
| 1748 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1749 | // ctrlui.WebApiObjectInfo
|
---|
| 1750 | var $ctrlui_WebApiObjectInfo = function(eobjid, obj, profile) {
|
---|
| 1751 | this.profile = false;
|
---|
| 1752 | this.x1 = 0;
|
---|
| 1753 | this.x2 = 0;
|
---|
| 1754 | this.x3 = 0;
|
---|
| 1755 | this.eobjid = 0;
|
---|
| 1756 | this.enodid = 0;
|
---|
| 1757 | this.properties = [];
|
---|
| 1758 | this.eobjid = eobjid;
|
---|
| 1759 | this.profile = profile;
|
---|
| 1760 | this.x1 = ss.unbox(ss.cast(obj.x1, ss.Int32));
|
---|
| 1761 | this.x2 = ss.unbox(ss.cast(obj.x2, ss.Int32));
|
---|
| 1762 | this.x3 = ss.unbox(ss.cast(obj.x3, ss.Int32));
|
---|
| 1763 | this.enodid = ss.unbox(ss.cast(obj.enodid, ss.Int32));
|
---|
| 1764 | var $t1 = ss.cast(obj.properties, Array);
|
---|
| 1765 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 1766 | var prop = $t1[$t2];
|
---|
| 1767 | this.properties.push(new $ctrlui_WebApiPropertyInfo(prop));
|
---|
| 1768 | }
|
---|
| 1769 | };
|
---|
| 1770 | $ctrlui_WebApiObjectInfo.__typeName = 'ctrlui.WebApiObjectInfo';
|
---|
| 1771 | global.ctrlui.WebApiObjectInfo = $ctrlui_WebApiObjectInfo;
|
---|
| 1772 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1773 | // ctrlui.WebApiPropertyCode
|
---|
| 1774 | var $ctrlui_WebApiPropertyCode = function(epc) {
|
---|
| 1775 | this.epc = 0;
|
---|
| 1776 | this.epc = epc;
|
---|
| 1777 | };
|
---|
| 1778 | $ctrlui_WebApiPropertyCode.__typeName = 'ctrlui.WebApiPropertyCode';
|
---|
| 1779 | $ctrlui_WebApiPropertyCode.$ctor1 = function(prop, dummy) {
|
---|
| 1780 | this.epc = 0;
|
---|
| 1781 | this.epc = ss.unbox(ss.cast(prop.epc, ss.Int32));
|
---|
| 1782 | };
|
---|
| 1783 | global.ctrlui.WebApiPropertyCode = $ctrlui_WebApiPropertyCode;
|
---|
| 1784 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1785 | // ctrlui.WebApiPropertyData
|
---|
| 1786 | var $ctrlui_WebApiPropertyData = function(prop) {
|
---|
| 1787 | this.epc = 0;
|
---|
| 1788 | this.edt = null;
|
---|
| 1789 | var _edt;
|
---|
| 1790 | this.epc = ss.unbox(ss.cast(prop.epc, ss.Int32));
|
---|
| 1791 | var text = ss.cast(prop.edt, String);
|
---|
| 1792 | if (text.length > 0) {
|
---|
| 1793 | _edt = new Array(ss.Int32.div(text.length, 2));
|
---|
| 1794 | for (var i = 0, j = 0; j < text.length; j += 2) {
|
---|
| 1795 | _edt[i++] = parseInt(text.substr(j, 2), 16);
|
---|
| 1796 | }
|
---|
| 1797 | }
|
---|
| 1798 | else {
|
---|
| 1799 | _edt = [];
|
---|
| 1800 | }
|
---|
| 1801 | this.edt = this.$setEdt(_edt);
|
---|
| 1802 | };
|
---|
| 1803 | $ctrlui_WebApiPropertyData.__typeName = 'ctrlui.WebApiPropertyData';
|
---|
| 1804 | $ctrlui_WebApiPropertyData.$ctor1 = function(epc, edt) {
|
---|
| 1805 | this.epc = 0;
|
---|
| 1806 | this.edt = null;
|
---|
| 1807 | this.epc = epc;
|
---|
| 1808 | this.edt = this.$setEdt(edt);
|
---|
| 1809 | };
|
---|
| 1810 | global.ctrlui.WebApiPropertyData = $ctrlui_WebApiPropertyData;
|
---|
| 1811 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1812 | // ctrlui.WebApiPropertyInfo
|
---|
| 1813 | var $ctrlui_WebApiPropertyInfo = function(prop) {
|
---|
| 1814 | this.epc = 0;
|
---|
| 1815 | this.flag = 0;
|
---|
| 1816 | this.epc = ss.unbox(ss.cast(prop.epc, ss.Int32));
|
---|
| 1817 | this.flag = 0;
|
---|
| 1818 | var temp = ss.cast(prop.flag, String);
|
---|
| 1819 | if (temp.indexOf('RULE_ANNO') !== -1) {
|
---|
| 1820 | this.flag |= 4;
|
---|
| 1821 | }
|
---|
| 1822 | if (temp.indexOf('RULE_SET') !== -1) {
|
---|
| 1823 | this.flag |= 1;
|
---|
| 1824 | }
|
---|
| 1825 | if (temp.indexOf('RULE_GET') !== -1) {
|
---|
| 1826 | this.flag |= 2;
|
---|
| 1827 | }
|
---|
| 1828 | if (temp.indexOf('ANNOUNCE') !== -1) {
|
---|
| 1829 | this.flag |= 64;
|
---|
| 1830 | }
|
---|
| 1831 | if (temp.indexOf('VARIABLE') !== -1) {
|
---|
| 1832 | this.flag |= 128;
|
---|
| 1833 | }
|
---|
| 1834 | };
|
---|
| 1835 | $ctrlui_WebApiPropertyInfo.__typeName = 'ctrlui.WebApiPropertyInfo';
|
---|
| 1836 | global.ctrlui.WebApiPropertyInfo = $ctrlui_WebApiPropertyInfo;
|
---|
| 1837 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1838 | // ctrlui.WebApiSet
|
---|
| 1839 | var $ctrlui_WebApiSet = function() {
|
---|
| 1840 | this.deojid = 0;
|
---|
| 1841 | this.properties = [];
|
---|
| 1842 | };
|
---|
| 1843 | $ctrlui_WebApiSet.__typeName = 'ctrlui.WebApiSet';
|
---|
| 1844 | $ctrlui_WebApiSet.$ctor1 = function(esv) {
|
---|
| 1845 | this.deojid = 0;
|
---|
| 1846 | this.properties = [];
|
---|
| 1847 | this.deojid = ss.cast(esv.deojid, ss.Int32);
|
---|
| 1848 | var $t1 = ss.cast(esv.properties, Array);
|
---|
| 1849 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 1850 | var prop = $t1[$t2];
|
---|
| 1851 | this.properties.push(new $ctrlui_WebApiPropertyData(prop));
|
---|
| 1852 | }
|
---|
| 1853 | };
|
---|
| 1854 | global.ctrlui.WebApiSet = $ctrlui_WebApiSet;
|
---|
| 1855 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1856 | // ctrlui.WebApiSetGet
|
---|
| 1857 | var $ctrlui_WebApiSetGet = function() {
|
---|
| 1858 | this.deojid = 0;
|
---|
| 1859 | this.setProperties = [];
|
---|
| 1860 | this.getProperties = [];
|
---|
| 1861 | };
|
---|
| 1862 | $ctrlui_WebApiSetGet.__typeName = 'ctrlui.WebApiSetGet';
|
---|
| 1863 | $ctrlui_WebApiSetGet.$ctor1 = function(esv) {
|
---|
| 1864 | this.deojid = 0;
|
---|
| 1865 | this.setProperties = [];
|
---|
| 1866 | this.getProperties = [];
|
---|
| 1867 | this.deojid = ss.cast(esv.deojid, ss.Int32);
|
---|
| 1868 | var $t1 = ss.cast(esv.properties, Array);
|
---|
| 1869 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 1870 | var prop = $t1[$t2];
|
---|
| 1871 | this.getProperties.push(new $ctrlui_WebApiPropertyCode.$ctor1(prop, true));
|
---|
| 1872 | }
|
---|
| 1873 | };
|
---|
| 1874 | global.ctrlui.WebApiSetGet = $ctrlui_WebApiSetGet;
|
---|
| 1875 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1876 | // Kadecot.WAMP_MSG_TYPE
|
---|
| 1877 | var $Kadecot_WAMP_MSG_TYPE = function() {
|
---|
| 1878 | };
|
---|
| 1879 | $Kadecot_WAMP_MSG_TYPE.__typeName = 'Kadecot.WAMP_MSG_TYPE';
|
---|
| 1880 | global.Kadecot.WAMP_MSG_TYPE = $Kadecot_WAMP_MSG_TYPE;
|
---|
| 1881 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1882 | // Kadecot.WampClient
|
---|
| 1883 | var $Kadecot_WampClient = function() {
|
---|
| 1884 | this.$webSocket = null;
|
---|
| 1885 | this.$challnge_flag = false;
|
---|
| 1886 | this.$url = null;
|
---|
| 1887 | this.$plotocols = ['wamp.2.json'];
|
---|
| 1888 | this.$on_open_flag = false;
|
---|
| 1889 | this.$request_id = 0;
|
---|
| 1890 | this.$errorCallback = null;
|
---|
| 1891 | this.$subscription_id_list = null;
|
---|
| 1892 | this.$wampClientCore = null;
|
---|
| 1893 | this.$challnge_flag = false;
|
---|
| 1894 | this.$url = null;
|
---|
| 1895 | this.$webSocket = null;
|
---|
| 1896 | this.$on_open_flag = false;
|
---|
| 1897 | this.$errorCallback = null;
|
---|
| 1898 | this.$request_id = 1;
|
---|
| 1899 | this.$subscription_id_list = new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, ss.Int32]))();
|
---|
| 1900 | //origin = "http://UnityKadecotPlugin/";
|
---|
| 1901 | this.$wampClientCore = new $Kadecot_WampClientCore();
|
---|
| 1902 | };
|
---|
| 1903 | $Kadecot_WampClient.__typeName = 'Kadecot.WampClient';
|
---|
| 1904 | global.Kadecot.WampClient = $Kadecot_WampClient;
|
---|
| 1905 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1906 | // Kadecot.WampClientCore
|
---|
| 1907 | var $Kadecot_WampClientCore = function() {
|
---|
| 1908 | this.$1$openCallbackField = null;
|
---|
| 1909 | this.$1$closeCallbackField = null;
|
---|
| 1910 | this.$1$heartbeatCallbackField = null;
|
---|
| 1911 | this.$1$helloCallbackField = null;
|
---|
| 1912 | this.$1$authenticateCallbackField = null;
|
---|
| 1913 | this.$1$goodbyeCallbackField = null;
|
---|
| 1914 | this.$1$publishCallbackField = null;
|
---|
| 1915 | this.$1$subscribeCallbackField = null;
|
---|
| 1916 | this.$1$unsubscribeCallbackField = null;
|
---|
| 1917 | this.$1$callCallbackField = null;
|
---|
| 1918 | this.$1$cancelCallbackField = null;
|
---|
| 1919 | this.$1$registerCallbackField = null;
|
---|
| 1920 | this.$1$unregisterCallbackField = null;
|
---|
| 1921 | this.$1$eventCallbackField = null;
|
---|
| 1922 | this.$1$invocationCallbackField = null;
|
---|
| 1923 | this.$1$interruptCallbackField = null;
|
---|
| 1924 | this.set_openCallback(null);
|
---|
| 1925 | this.set_closeCallback(null);
|
---|
| 1926 | this.set_heartbeatCallback(null);
|
---|
| 1927 | this.set_helloCallback(null);
|
---|
| 1928 | this.set_authenticateCallback(null);
|
---|
| 1929 | this.set_goodbyeCallback(null);
|
---|
| 1930 | this.set_publishCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1931 | this.set_subscribeCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1932 | this.set_unsubscribeCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1933 | this.set_callCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1934 | this.set_cancelCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1935 | this.set_registerCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1936 | this.set_unregisterCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1937 | this.set_eventCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1938 | this.set_invocationCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1939 | this.set_interruptCallback(new (ss.makeGenericType(ss.Dictionary$2, [ss.Int32, Function]))());
|
---|
| 1940 | };
|
---|
| 1941 | $Kadecot_WampClientCore.__typeName = 'Kadecot.WampClientCore';
|
---|
| 1942 | global.Kadecot.WampClientCore = $Kadecot_WampClientCore;
|
---|
| 1943 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 1944 | // Kadecot.WampDeserializer
|
---|
| 1945 | var $Kadecot_WampDeserializer = function() {
|
---|
| 1946 | };
|
---|
| 1947 | $Kadecot_WampDeserializer.__typeName = 'Kadecot.WampDeserializer';
|
---|
| 1948 | $Kadecot_WampDeserializer.parse = function(msg) {
|
---|
| 1949 | var data;
|
---|
| 1950 | if (ss.isNullOrUndefined(msg) || ss.equalsT(msg, '')) {
|
---|
| 1951 | throw new ss.ArgumentNullException();
|
---|
| 1952 | }
|
---|
| 1953 | data = JSON.parse(msg);
|
---|
| 1954 | if (!ss.isInstanceOfType(data, ss.IList) || ss.isInstanceOfType(data, ss.IList) && ss.cast(data, Array).length < 2) {
|
---|
| 1955 | return null;
|
---|
| 1956 | }
|
---|
| 1957 | var list = ss.cast(data, Array);
|
---|
| 1958 | switch (ss.unbox(ss.cast(list[0], ss.Int32))) {
|
---|
| 1959 | case 1: {
|
---|
| 1960 | // WAMP SPEC: [HELLO, Realm|uri, Details|dict]
|
---|
| 1961 | if (ss.cast(data, Array).length < 3) {
|
---|
| 1962 | return null;
|
---|
| 1963 | }
|
---|
| 1964 | break;
|
---|
| 1965 | }
|
---|
| 1966 | case 2: {
|
---|
| 1967 | // WAMP SPEC: [WELCOME, Session|id, Details|dict]
|
---|
| 1968 | if (ss.cast(data, Array).length < 3) {
|
---|
| 1969 | return null;
|
---|
| 1970 | }
|
---|
| 1971 | break;
|
---|
| 1972 | }
|
---|
| 1973 | case 3: {
|
---|
| 1974 | // WAMP SPEC: [ABORT, Details|dict, Reason|uri]
|
---|
| 1975 | if (ss.cast(data, Array).length < 3) {
|
---|
| 1976 | return null;
|
---|
| 1977 | }
|
---|
| 1978 | break;
|
---|
| 1979 | }
|
---|
| 1980 | case 4: {
|
---|
| 1981 | // advanced WAMP SPEC: [CHALLENGE, AuthMethod|string, Extra|dict]
|
---|
| 1982 | if (ss.cast(data, Array).length < 3) {
|
---|
| 1983 | return null;
|
---|
| 1984 | }
|
---|
| 1985 | break;
|
---|
| 1986 | }
|
---|
| 1987 | case 5: {
|
---|
| 1988 | // advanced WAMP SPEC: [CHALLENGE, AuthMethod|string, Extra|dict]
|
---|
| 1989 | if (ss.cast(data, Array).length < 3) {
|
---|
| 1990 | return null;
|
---|
| 1991 | }
|
---|
| 1992 | break;
|
---|
| 1993 | }
|
---|
| 1994 | case 6: {
|
---|
| 1995 | // WAMP SPEC: [GOODBYE, Details|dict, Reason|uri]
|
---|
| 1996 | if (ss.cast(data, Array).length < 3) {
|
---|
| 1997 | return null;
|
---|
| 1998 | }
|
---|
| 1999 | break;
|
---|
| 2000 | }
|
---|
| 2001 | case 7: {
|
---|
| 2002 | // advanced WAMP SPEC: [AUTHENTICATE, Signature|string, Extra|dict]
|
---|
| 2003 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2004 | return null;
|
---|
| 2005 | }
|
---|
| 2006 | break;
|
---|
| 2007 | }
|
---|
| 2008 | case 8: {
|
---|
| 2009 | // WAMP SPEC: [ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, (Arguments|list, ArgumentsKw|dict)]
|
---|
| 2010 | if (ss.cast(data, Array).length < 5) {
|
---|
| 2011 | return null;
|
---|
| 2012 | }
|
---|
| 2013 | switch (ss.unbox(ss.cast(ss.cast(data, Array)[1], ss.Int32))) {
|
---|
| 2014 | case 6:
|
---|
| 2015 | case 70:
|
---|
| 2016 | case 8:
|
---|
| 2017 | case 32:
|
---|
| 2018 | case 34:
|
---|
| 2019 | case 16:
|
---|
| 2020 | case 68:
|
---|
| 2021 | case 48: {
|
---|
| 2022 | // add QUnit test
|
---|
| 2023 | // add QUnit test
|
---|
| 2024 | // add QUnit test
|
---|
| 2025 | break;
|
---|
| 2026 | }
|
---|
| 2027 | case 64:
|
---|
| 2028 | case 66: {
|
---|
| 2029 | // WAMP SPEC: [ERROR, REGISTER, REGISTER.Request|id, Details|dict, Error|uri]
|
---|
| 2030 | break;
|
---|
| 2031 | }
|
---|
| 2032 | default: {
|
---|
| 2033 | return null;
|
---|
| 2034 | }
|
---|
| 2035 | }
|
---|
| 2036 | break;
|
---|
| 2037 | }
|
---|
| 2038 | case 16: {
|
---|
| 2039 | // WAMP SPEC: [PUBLISH, Request|id, Options|dict, Topic|uri]
|
---|
| 2040 | // WAMP SPEC: [PUBLISH, Request|id, Options|dict, Topic|uri, Arguments|list]
|
---|
| 2041 | // WAMP SPEC: [PUBLISH, Request|id, Options|dict, Topic|uri, Arguments|list, ArgumentsKw|dict]
|
---|
| 2042 | if (ss.cast(data, Array).length < 4) {
|
---|
| 2043 | return null;
|
---|
| 2044 | }
|
---|
| 2045 | break;
|
---|
| 2046 | }
|
---|
| 2047 | case 17: {
|
---|
| 2048 | // WAMP SPEC: [PUBLISHED, PUBLISH.Request|id, Publication|id]
|
---|
| 2049 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2050 | return null;
|
---|
| 2051 | }
|
---|
| 2052 | break;
|
---|
| 2053 | }
|
---|
| 2054 | case 32: {
|
---|
| 2055 | // WAMP SPEC: [SUBSCRIBE, Request|id, Options|dict, Topic|uri]
|
---|
| 2056 | if (ss.cast(data, Array).length < 4) {
|
---|
| 2057 | return null;
|
---|
| 2058 | }
|
---|
| 2059 | break;
|
---|
| 2060 | }
|
---|
| 2061 | case 33: {
|
---|
| 2062 | // WAMP SPEC: [SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]
|
---|
| 2063 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2064 | return null;
|
---|
| 2065 | }
|
---|
| 2066 | break;
|
---|
| 2067 | }
|
---|
| 2068 | case 34: {
|
---|
| 2069 | // WAMP SPEC: [UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id]
|
---|
| 2070 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2071 | return null;
|
---|
| 2072 | }
|
---|
| 2073 | break;
|
---|
| 2074 | }
|
---|
| 2075 | case 35: {
|
---|
| 2076 | // WAMP SPEC: [UNSUBSCRIBED, UNSUBSCRIBE.Request|id]
|
---|
| 2077 | if (ss.cast(data, Array).length < 2) {
|
---|
| 2078 | return null;
|
---|
| 2079 | }
|
---|
| 2080 | break;
|
---|
| 2081 | }
|
---|
| 2082 | case 36: {
|
---|
| 2083 | // WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict]
|
---|
| 2084 | // WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Arguments|list]
|
---|
| 2085 | // WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Arguments|list, PUBLISH.ArgumentKw|dict]
|
---|
| 2086 | if (ss.cast(data, Array).length < 4) {
|
---|
| 2087 | return null;
|
---|
| 2088 | }
|
---|
| 2089 | break;
|
---|
| 2090 | }
|
---|
| 2091 | case 48: {
|
---|
| 2092 | // WAMP SPEC: [CALL, Request|id, Options|dict, Procedure|uri]
|
---|
| 2093 | // WAMP SPEC: [CALL, Request|id, Options|dict, Procedure|uri, Arguments|list]
|
---|
| 2094 | // WAMP SPEC: [CALL, Request|id, Options|dict, Procedure|uri, Arguments|list, ArgumentsKw|dict]
|
---|
| 2095 | if (ss.cast(data, Array).length < 4) {
|
---|
| 2096 | return null;
|
---|
| 2097 | }
|
---|
| 2098 | break;
|
---|
| 2099 | }
|
---|
| 2100 | case 49: {
|
---|
| 2101 | // advanced WAMP SPEC: [CANCEL, CALL.Request|id, Options|dict]
|
---|
| 2102 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2103 | return null;
|
---|
| 2104 | }
|
---|
| 2105 | break;
|
---|
| 2106 | }
|
---|
| 2107 | case 50: {
|
---|
| 2108 | // WAMP SPEC: [RESULT, CALL.Request|id, Details|dict]
|
---|
| 2109 | // WAMP SPEC: [RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list]
|
---|
| 2110 | // WAMP SPEC: [RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list, YIELD.ArgumentsKw|dict]
|
---|
| 2111 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2112 | return null;
|
---|
| 2113 | }
|
---|
| 2114 | break;
|
---|
| 2115 | }
|
---|
| 2116 | case 64: {
|
---|
| 2117 | // WAMP SPEC: [REGISTER, Request|id, Options|dict, Procedure|uri]
|
---|
| 2118 | if (ss.cast(data, Array).length < 4) {
|
---|
| 2119 | return null;
|
---|
| 2120 | }
|
---|
| 2121 | break;
|
---|
| 2122 | }
|
---|
| 2123 | case 65: {
|
---|
| 2124 | // WAMP SPEC: [REGISTERED, REGISTER.Request|id, Registration|id]
|
---|
| 2125 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2126 | return null;
|
---|
| 2127 | }
|
---|
| 2128 | break;
|
---|
| 2129 | }
|
---|
| 2130 | case 66: {
|
---|
| 2131 | // WAMP SPEC: [UNREGISTER, Request|id, REGISTERED.Registration|id]
|
---|
| 2132 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2133 | return null;
|
---|
| 2134 | }
|
---|
| 2135 | break;
|
---|
| 2136 | }
|
---|
| 2137 | case 67: {
|
---|
| 2138 | // WAMP SPEC: [UNREGISTERED, UNREGISTER.Request|id]
|
---|
| 2139 | if (ss.cast(data, Array).length < 2) {
|
---|
| 2140 | return null;
|
---|
| 2141 | }
|
---|
| 2142 | break;
|
---|
| 2143 | }
|
---|
| 2144 | case 68: {
|
---|
| 2145 | // WAMP SPEC: [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict]
|
---|
| 2146 | // WAMP SPEC: [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list]
|
---|
| 2147 | // WAMP SPEC: [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list, CALL.ArgumentsKw|dict]
|
---|
| 2148 | if (ss.cast(data, Array).length < 4) {
|
---|
| 2149 | return null;
|
---|
| 2150 | }
|
---|
| 2151 | break;
|
---|
| 2152 | }
|
---|
| 2153 | case 69: {
|
---|
| 2154 | // advanced WAMP SPEC: [INTERRUPT, INVOCATION.Request|id, Options|dict]
|
---|
| 2155 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2156 | return null;
|
---|
| 2157 | }
|
---|
| 2158 | break;
|
---|
| 2159 | }
|
---|
| 2160 | case 70: {
|
---|
| 2161 | // WAMP SPEC: [YIELD, INVOCATION.Request|id, Options|dict, (Arguments|list, ArgumentsKw|dict)]
|
---|
| 2162 | if (ss.cast(data, Array).length < 3) {
|
---|
| 2163 | return null;
|
---|
| 2164 | }
|
---|
| 2165 | break;
|
---|
| 2166 | }
|
---|
| 2167 | default: {
|
---|
| 2168 | return null;
|
---|
| 2169 | }
|
---|
| 2170 | }
|
---|
| 2171 | return data;
|
---|
| 2172 | };
|
---|
| 2173 | global.Kadecot.WampDeserializer = $Kadecot_WampDeserializer;
|
---|
| 2174 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 2175 | // Kadecot.WampSerializer
|
---|
| 2176 | var $Kadecot_WampSerializer = function() {
|
---|
| 2177 | };
|
---|
| 2178 | $Kadecot_WampSerializer.__typeName = 'Kadecot.WampSerializer';
|
---|
| 2179 | $Kadecot_WampSerializer.createHello = function(realm, details) {
|
---|
| 2180 | var data;
|
---|
| 2181 | if (ss.isNullOrUndefined(realm) || ss.equalsT(realm, '')) {
|
---|
| 2182 | throw new ss.ArgumentNullException();
|
---|
| 2183 | }
|
---|
| 2184 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2185 | throw new ss.ArgumentNullException();
|
---|
| 2186 | }
|
---|
| 2187 | var detailJson = JSON.parse(details);
|
---|
| 2188 | var list = [];
|
---|
| 2189 | ss.add(list, 1);
|
---|
| 2190 | ss.add(list, realm);
|
---|
| 2191 | ss.add(list, detailJson);
|
---|
| 2192 | data = JSON.stringify(list);
|
---|
| 2193 | return data;
|
---|
| 2194 | };
|
---|
| 2195 | $Kadecot_WampSerializer.createWelcome = function(session, details) {
|
---|
| 2196 | var data;
|
---|
| 2197 | var detailJson = JSON.parse(details);
|
---|
| 2198 | var list = [];
|
---|
| 2199 | ss.add(list, 2);
|
---|
| 2200 | ss.add(list, session);
|
---|
| 2201 | ss.add(list, detailJson);
|
---|
| 2202 | data = JSON.stringify(list);
|
---|
| 2203 | return data;
|
---|
| 2204 | };
|
---|
| 2205 | $Kadecot_WampSerializer.createAbort = function(details, reason) {
|
---|
| 2206 | var data;
|
---|
| 2207 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2208 | throw new ss.ArgumentNullException();
|
---|
| 2209 | }
|
---|
| 2210 | if (ss.isNullOrUndefined(reason) || ss.equalsT(reason, '')) {
|
---|
| 2211 | throw new ss.ArgumentNullException();
|
---|
| 2212 | }
|
---|
| 2213 | var detailJson = JSON.parse(details);
|
---|
| 2214 | var list = [];
|
---|
| 2215 | ss.add(list, 3);
|
---|
| 2216 | ss.add(list, detailJson);
|
---|
| 2217 | ss.add(list, reason);
|
---|
| 2218 | data = JSON.stringify(list);
|
---|
| 2219 | return data;
|
---|
| 2220 | };
|
---|
| 2221 | $Kadecot_WampSerializer.createChallenge = function(authMethod, extra) {
|
---|
| 2222 | var data;
|
---|
| 2223 | if (ss.isNullOrUndefined(authMethod) || ss.equalsT(authMethod, '')) {
|
---|
| 2224 | throw new ss.ArgumentNullException();
|
---|
| 2225 | }
|
---|
| 2226 | if (ss.isNullOrUndefined(extra) || ss.equalsT(extra, '')) {
|
---|
| 2227 | throw new ss.ArgumentNullException();
|
---|
| 2228 | }
|
---|
| 2229 | var extraJson = JSON.parse(extra);
|
---|
| 2230 | var list = [];
|
---|
| 2231 | ss.add(list, 4);
|
---|
| 2232 | ss.add(list, authMethod);
|
---|
| 2233 | ss.add(list, extraJson);
|
---|
| 2234 | data = JSON.stringify(list);
|
---|
| 2235 | return data;
|
---|
| 2236 | };
|
---|
| 2237 | $Kadecot_WampSerializer.createAuthenticate = function(signature, extra) {
|
---|
| 2238 | var data;
|
---|
| 2239 | if (ss.isNullOrUndefined(signature) || ss.equalsT(signature, '')) {
|
---|
| 2240 | throw new ss.ArgumentNullException();
|
---|
| 2241 | }
|
---|
| 2242 | if (ss.isNullOrUndefined(extra) || ss.equalsT(extra, '')) {
|
---|
| 2243 | throw new ss.ArgumentNullException();
|
---|
| 2244 | }
|
---|
| 2245 | var extraJson = JSON.parse(extra);
|
---|
| 2246 | var list = [];
|
---|
| 2247 | ss.add(list, 5);
|
---|
| 2248 | ss.add(list, signature);
|
---|
| 2249 | ss.add(list, extraJson);
|
---|
| 2250 | data = JSON.stringify(list);
|
---|
| 2251 | return data;
|
---|
| 2252 | };
|
---|
| 2253 | $Kadecot_WampSerializer.createGoodbye = function(details, reason) {
|
---|
| 2254 | var data;
|
---|
| 2255 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2256 | throw new ss.ArgumentNullException();
|
---|
| 2257 | }
|
---|
| 2258 | if (ss.isNullOrUndefined(reason)) {
|
---|
| 2259 | throw new ss.ArgumentNullException();
|
---|
| 2260 | }
|
---|
| 2261 | var detailJson = JSON.parse(details);
|
---|
| 2262 | var list = [];
|
---|
| 2263 | ss.add(list, 6);
|
---|
| 2264 | ss.add(list, detailJson);
|
---|
| 2265 | ss.add(list, reason);
|
---|
| 2266 | data = JSON.stringify(list);
|
---|
| 2267 | return data;
|
---|
| 2268 | };
|
---|
| 2269 | $Kadecot_WampSerializer.createHeartbeat = function(incomingSeq, outgoingSeq, discard) {
|
---|
| 2270 | var data;
|
---|
| 2271 | var list = [];
|
---|
| 2272 | if (ss.isNullOrUndefined(discard) || ss.equalsT(discard, '')) {
|
---|
| 2273 | ss.add(list, 7);
|
---|
| 2274 | ss.add(list, incomingSeq);
|
---|
| 2275 | ss.add(list, outgoingSeq);
|
---|
| 2276 | data = JSON.stringify(list);
|
---|
| 2277 | }
|
---|
| 2278 | else {
|
---|
| 2279 | ss.add(list, 7);
|
---|
| 2280 | ss.add(list, incomingSeq);
|
---|
| 2281 | ss.add(list, outgoingSeq);
|
---|
| 2282 | ss.add(list, discard);
|
---|
| 2283 | data = JSON.stringify(list);
|
---|
| 2284 | }
|
---|
| 2285 | return data;
|
---|
| 2286 | };
|
---|
| 2287 | $Kadecot_WampSerializer.createError = function(type, request, details, error, arguments1, argumentsKw) {
|
---|
| 2288 | var data;
|
---|
| 2289 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2290 | throw new ss.ArgumentNullException();
|
---|
| 2291 | }
|
---|
| 2292 | if (ss.isNullOrUndefined(error) || ss.equalsT(error, '')) {
|
---|
| 2293 | throw new ss.ArgumentNullException();
|
---|
| 2294 | }
|
---|
| 2295 | var detailJson = JSON.parse(details);
|
---|
| 2296 | var argsJson = JSON.parse(arguments1);
|
---|
| 2297 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2298 | var list = [];
|
---|
| 2299 | ss.add(list, 8);
|
---|
| 2300 | ss.add(list, type);
|
---|
| 2301 | ss.add(list, request);
|
---|
| 2302 | ss.add(list, detailJson);
|
---|
| 2303 | ss.add(list, error);
|
---|
| 2304 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2305 | ss.add(list, argsJson);
|
---|
| 2306 | }
|
---|
| 2307 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2308 | ss.add(list, argsJson);
|
---|
| 2309 | ss.add(list, argsKwJson);
|
---|
| 2310 | }
|
---|
| 2311 | data = JSON.stringify(list);
|
---|
| 2312 | return data;
|
---|
| 2313 | };
|
---|
| 2314 | $Kadecot_WampSerializer.createPublish = function(request, options, topic, arguments1, argumentsKw) {
|
---|
| 2315 | var data;
|
---|
| 2316 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2317 | throw new ss.ArgumentNullException();
|
---|
| 2318 | }
|
---|
| 2319 | if (ss.isNullOrUndefined(topic) || ss.equalsT(topic, '')) {
|
---|
| 2320 | throw new ss.ArgumentNullException();
|
---|
| 2321 | }
|
---|
| 2322 | var optJson = JSON.parse(options);
|
---|
| 2323 | var argsJson = JSON.parse(arguments1);
|
---|
| 2324 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2325 | var list = [];
|
---|
| 2326 | ss.add(list, 16);
|
---|
| 2327 | ss.add(list, request);
|
---|
| 2328 | ss.add(list, optJson);
|
---|
| 2329 | ss.add(list, topic);
|
---|
| 2330 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2331 | ss.add(list, argsJson);
|
---|
| 2332 | }
|
---|
| 2333 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2334 | ss.add(list, argsJson);
|
---|
| 2335 | ss.add(list, argsKwJson);
|
---|
| 2336 | }
|
---|
| 2337 | data = JSON.stringify(list);
|
---|
| 2338 | return data;
|
---|
| 2339 | };
|
---|
| 2340 | $Kadecot_WampSerializer.createPublished = function(request, publication) {
|
---|
| 2341 | var data;
|
---|
| 2342 | var list = [];
|
---|
| 2343 | ss.add(list, 17);
|
---|
| 2344 | ss.add(list, request);
|
---|
| 2345 | ss.add(list, publication);
|
---|
| 2346 | data = JSON.stringify(list);
|
---|
| 2347 | return data;
|
---|
| 2348 | };
|
---|
| 2349 | $Kadecot_WampSerializer.createSubscribe = function(request, options, topic) {
|
---|
| 2350 | var data;
|
---|
| 2351 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2352 | throw new ss.ArgumentNullException();
|
---|
| 2353 | }
|
---|
| 2354 | if (ss.isNullOrUndefined(topic) || ss.equalsT(topic, '')) {
|
---|
| 2355 | throw new ss.ArgumentNullException();
|
---|
| 2356 | }
|
---|
| 2357 | var optJson = JSON.parse(options);
|
---|
| 2358 | var list = [];
|
---|
| 2359 | ss.add(list, 32);
|
---|
| 2360 | ss.add(list, request);
|
---|
| 2361 | ss.add(list, optJson);
|
---|
| 2362 | ss.add(list, topic);
|
---|
| 2363 | data = JSON.stringify(list);
|
---|
| 2364 | return data;
|
---|
| 2365 | };
|
---|
| 2366 | $Kadecot_WampSerializer.createSubscribed = function(request, subscription) {
|
---|
| 2367 | var data;
|
---|
| 2368 | var list = [];
|
---|
| 2369 | ss.add(list, 33);
|
---|
| 2370 | ss.add(list, request);
|
---|
| 2371 | ss.add(list, subscription);
|
---|
| 2372 | data = JSON.stringify(list);
|
---|
| 2373 | return data;
|
---|
| 2374 | };
|
---|
| 2375 | $Kadecot_WampSerializer.createUnsubscribe = function(request, subscription) {
|
---|
| 2376 | var data;
|
---|
| 2377 | var list = [];
|
---|
| 2378 | ss.add(list, 34);
|
---|
| 2379 | ss.add(list, request);
|
---|
| 2380 | ss.add(list, subscription);
|
---|
| 2381 | // list.Add ("com.sonycsl.kadecot.echonetlite.procedure.set.topic.HomeAirConditioner.OperationStatus");
|
---|
| 2382 | data = JSON.stringify(list);
|
---|
| 2383 | return data;
|
---|
| 2384 | };
|
---|
| 2385 | $Kadecot_WampSerializer.createUnsubscribed = function(request) {
|
---|
| 2386 | var data;
|
---|
| 2387 | var list = [];
|
---|
| 2388 | ss.add(list, 35);
|
---|
| 2389 | ss.add(list, request);
|
---|
| 2390 | data = JSON.stringify(list);
|
---|
| 2391 | return data;
|
---|
| 2392 | };
|
---|
| 2393 | $Kadecot_WampSerializer.createEvent = function(subscription, publication, details, arguments1, argumentsKw) {
|
---|
| 2394 | var data;
|
---|
| 2395 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2396 | throw new ss.ArgumentNullException();
|
---|
| 2397 | }
|
---|
| 2398 | var detailJson = JSON.parse(details);
|
---|
| 2399 | var argsJson = JSON.parse(arguments1);
|
---|
| 2400 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2401 | var list = [];
|
---|
| 2402 | ss.add(list, 36);
|
---|
| 2403 | ss.add(list, subscription);
|
---|
| 2404 | ss.add(list, publication);
|
---|
| 2405 | ss.add(list, detailJson);
|
---|
| 2406 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2407 | ss.add(list, argsJson);
|
---|
| 2408 | }
|
---|
| 2409 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2410 | ss.add(list, argsJson);
|
---|
| 2411 | ss.add(list, argsKwJson);
|
---|
| 2412 | }
|
---|
| 2413 | data = JSON.stringify(list);
|
---|
| 2414 | return data;
|
---|
| 2415 | };
|
---|
| 2416 | $Kadecot_WampSerializer.createCall = function(request, options, procedure, arguments1, argumentsKw) {
|
---|
| 2417 | var data;
|
---|
| 2418 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2419 | throw new ss.ArgumentNullException();
|
---|
| 2420 | }
|
---|
| 2421 | if (ss.isNullOrUndefined(procedure) || ss.equalsT(procedure, '')) {
|
---|
| 2422 | throw new ss.ArgumentNullException();
|
---|
| 2423 | }
|
---|
| 2424 | var optionJson = JSON.parse(options);
|
---|
| 2425 | var argsJson = JSON.parse(arguments1);
|
---|
| 2426 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2427 | var list = [];
|
---|
| 2428 | ss.add(list, 48);
|
---|
| 2429 | ss.add(list, request);
|
---|
| 2430 | ss.add(list, optionJson);
|
---|
| 2431 | ss.add(list, procedure);
|
---|
| 2432 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2433 | ss.add(list, argsJson);
|
---|
| 2434 | }
|
---|
| 2435 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2436 | ss.add(list, argsJson);
|
---|
| 2437 | ss.add(list, argsKwJson);
|
---|
| 2438 | }
|
---|
| 2439 | data = JSON.stringify(list);
|
---|
| 2440 | return data;
|
---|
| 2441 | };
|
---|
| 2442 | $Kadecot_WampSerializer.createCancel = function(request, options) {
|
---|
| 2443 | var data;
|
---|
| 2444 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2445 | throw new ss.ArgumentNullException();
|
---|
| 2446 | }
|
---|
| 2447 | var optionJson = JSON.parse(options);
|
---|
| 2448 | var list = [];
|
---|
| 2449 | ss.add(list, 49);
|
---|
| 2450 | ss.add(list, request);
|
---|
| 2451 | ss.add(list, optionJson);
|
---|
| 2452 | data = JSON.stringify(list);
|
---|
| 2453 | return data;
|
---|
| 2454 | };
|
---|
| 2455 | $Kadecot_WampSerializer.createResult = function(request, details, arguments1, argumentsKw) {
|
---|
| 2456 | var data;
|
---|
| 2457 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2458 | throw new ss.ArgumentNullException();
|
---|
| 2459 | }
|
---|
| 2460 | var detailJson = JSON.parse(details);
|
---|
| 2461 | var argsJson = JSON.parse(arguments1);
|
---|
| 2462 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2463 | var list = [];
|
---|
| 2464 | ss.add(list, 50);
|
---|
| 2465 | ss.add(list, request);
|
---|
| 2466 | ss.add(list, detailJson);
|
---|
| 2467 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2468 | ss.add(list, argsJson);
|
---|
| 2469 | }
|
---|
| 2470 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2471 | ss.add(list, argsJson);
|
---|
| 2472 | ss.add(list, argsKwJson);
|
---|
| 2473 | }
|
---|
| 2474 | data = JSON.stringify(list);
|
---|
| 2475 | return data;
|
---|
| 2476 | };
|
---|
| 2477 | $Kadecot_WampSerializer.createRegister = function(request, options, procedure) {
|
---|
| 2478 | var data;
|
---|
| 2479 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2480 | throw new ss.ArgumentNullException();
|
---|
| 2481 | }
|
---|
| 2482 | if (ss.isNullOrUndefined(procedure) || ss.equalsT(procedure, '')) {
|
---|
| 2483 | throw new ss.ArgumentNullException();
|
---|
| 2484 | }
|
---|
| 2485 | var optJson = JSON.parse(options);
|
---|
| 2486 | var list = [];
|
---|
| 2487 | ss.add(list, 64);
|
---|
| 2488 | ss.add(list, request);
|
---|
| 2489 | ss.add(list, optJson);
|
---|
| 2490 | ss.add(list, procedure);
|
---|
| 2491 | data = JSON.stringify(list);
|
---|
| 2492 | return data;
|
---|
| 2493 | };
|
---|
| 2494 | $Kadecot_WampSerializer.createRegistered = function(request, registration) {
|
---|
| 2495 | var data;
|
---|
| 2496 | var list = [];
|
---|
| 2497 | ss.add(list, 65);
|
---|
| 2498 | ss.add(list, request);
|
---|
| 2499 | ss.add(list, registration);
|
---|
| 2500 | data = JSON.stringify(list);
|
---|
| 2501 | return data;
|
---|
| 2502 | };
|
---|
| 2503 | $Kadecot_WampSerializer.createUnregister = function(request, registration) {
|
---|
| 2504 | var data;
|
---|
| 2505 | var list = [];
|
---|
| 2506 | ss.add(list, 66);
|
---|
| 2507 | ss.add(list, request);
|
---|
| 2508 | ss.add(list, registration);
|
---|
| 2509 | data = JSON.stringify(list);
|
---|
| 2510 | return data;
|
---|
| 2511 | };
|
---|
| 2512 | $Kadecot_WampSerializer.createUnregistered = function(request) {
|
---|
| 2513 | var data;
|
---|
| 2514 | var list = [];
|
---|
| 2515 | ss.add(list, 67);
|
---|
| 2516 | ss.add(list, request);
|
---|
| 2517 | data = JSON.stringify(list);
|
---|
| 2518 | return data;
|
---|
| 2519 | };
|
---|
| 2520 | $Kadecot_WampSerializer.createInvocation = function(request, registration, details, arguments1, argumentsKw) {
|
---|
| 2521 | var data;
|
---|
| 2522 | if (ss.isNullOrUndefined(details) || ss.equalsT(details, '')) {
|
---|
| 2523 | throw new ss.ArgumentNullException();
|
---|
| 2524 | }
|
---|
| 2525 | var detailJson = JSON.parse(details);
|
---|
| 2526 | var argsJson = JSON.parse(arguments1);
|
---|
| 2527 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2528 | var list = [];
|
---|
| 2529 | ss.add(list, 68);
|
---|
| 2530 | ss.add(list, request);
|
---|
| 2531 | ss.add(list, registration);
|
---|
| 2532 | ss.add(list, detailJson);
|
---|
| 2533 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2534 | ss.add(list, argsJson);
|
---|
| 2535 | }
|
---|
| 2536 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2537 | ss.add(list, argsJson);
|
---|
| 2538 | ss.add(list, argsKwJson);
|
---|
| 2539 | }
|
---|
| 2540 | data = JSON.stringify(list);
|
---|
| 2541 | return data;
|
---|
| 2542 | };
|
---|
| 2543 | $Kadecot_WampSerializer.createInterrupt = function(request, options) {
|
---|
| 2544 | var data;
|
---|
| 2545 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2546 | throw new ss.ArgumentNullException();
|
---|
| 2547 | }
|
---|
| 2548 | var optJson = JSON.parse(options);
|
---|
| 2549 | var list = [];
|
---|
| 2550 | ss.add(list, 69);
|
---|
| 2551 | ss.add(list, request);
|
---|
| 2552 | ss.add(list, optJson);
|
---|
| 2553 | data = JSON.stringify(list);
|
---|
| 2554 | return data;
|
---|
| 2555 | };
|
---|
| 2556 | $Kadecot_WampSerializer.createYield = function(request, options, arguments1, argumentsKw) {
|
---|
| 2557 | var data;
|
---|
| 2558 | if (ss.isNullOrUndefined(options) || ss.equalsT(options, '')) {
|
---|
| 2559 | throw new ss.ArgumentNullException();
|
---|
| 2560 | }
|
---|
| 2561 | var optJson = JSON.parse(options);
|
---|
| 2562 | var argsJson = JSON.parse(arguments1);
|
---|
| 2563 | var argsKwJson = JSON.parse(argumentsKw);
|
---|
| 2564 | var list = [];
|
---|
| 2565 | ss.add(list, 70);
|
---|
| 2566 | ss.add(list, request);
|
---|
| 2567 | ss.add(list, optJson);
|
---|
| 2568 | if (ss.isValue(arguments1) && ss.isNullOrUndefined(argumentsKw)) {
|
---|
| 2569 | ss.add(list, argsJson);
|
---|
| 2570 | }
|
---|
| 2571 | else if (ss.isValue(arguments1) && ss.isValue(argumentsKw)) {
|
---|
| 2572 | ss.add(list, argsJson);
|
---|
| 2573 | ss.add(list, argsKwJson);
|
---|
| 2574 | }
|
---|
| 2575 | data = JSON.stringify(list);
|
---|
| 2576 | return data;
|
---|
| 2577 | };
|
---|
| 2578 | global.Kadecot.WampSerializer = $Kadecot_WampSerializer;
|
---|
| 2579 | ss.initClass($CtrlUI, $asm, {
|
---|
| 2580 | get_$m_CurrentNode: function() {
|
---|
| 2581 | return this.$_m_CurrentNode;
|
---|
| 2582 | },
|
---|
| 2583 | set_$m_CurrentNode: function(value) {
|
---|
| 2584 | var flag = !ss.referenceEquals(this.$_m_CurrentNode, value) || ss.isNullOrUndefined(this.$_m_CurrentNode) && ss.isNullOrUndefined(value);
|
---|
| 2585 | this.$_m_CurrentNode = value;
|
---|
| 2586 | if (flag) {
|
---|
| 2587 | $(document).trigger($control_UIEventNames.currentNodeChange);
|
---|
| 2588 | }
|
---|
| 2589 | },
|
---|
| 2590 | $initClassGroups$1: function(eve) {
|
---|
| 2591 | $CtrlUI.$page = eve.target;
|
---|
| 2592 | this.$setEvent();
|
---|
| 2593 | if (ss.isValue($CtrlUI.$m_ClassGroups)) {
|
---|
| 2594 | return;
|
---|
| 2595 | }
|
---|
| 2596 | $ctrlui_DeviceController.getClassInfo = ss.mkdel(this, this.$getClassInfoHandler);
|
---|
| 2597 | this.set_$m_CurrentNode(null);
|
---|
| 2598 | var ClassGroupListUrl = 'devices/ClassGroupList.json';
|
---|
| 2599 | $.ajax(ClassGroupListUrl).success(ss.mkdel(this, this.$initClassGroups)).error(function(request, textStatus, error) {
|
---|
| 2600 | $CtrlUI.$ajaxError(request, textStatus, error, ClassGroupListUrl);
|
---|
| 2601 | });
|
---|
| 2602 | },
|
---|
| 2603 | $setEvent: function() {
|
---|
| 2604 | $(document).on($control_UIEventNames.loadingShow, $control_UIEventHandler.loadingShow);
|
---|
| 2605 | $(document).on($control_UIEventNames.loadingHide, $control_UIEventHandler.loadingHide);
|
---|
| 2606 | $(document).on($control_UIEventNames.currentNodeChange, ss.thisFix(ss.mkdel(this, this.$currentNodeChange)));
|
---|
| 2607 | $(document).on($control_UIEventNames.searchStart, ss.mkdel(this, this.searchStart));
|
---|
| 2608 | $(document).on($control_UIEventNames.searchEnd, ss.mkdel(this, this.searchEnd));
|
---|
| 2609 | $(document).on($control_UIEventNames.searchError, ss.mkdel(this, this.searchError));
|
---|
| 2610 | $(document).on($control_UIEventNames.propertyWriteStart, ss.mkdel(this, this.propertyWriteStart));
|
---|
| 2611 | $(document).on($control_UIEventNames.propertyWriteEnd, ss.mkdel(this, this.propertyWriteEnd));
|
---|
| 2612 | this.get_connectionSwt().change(ss.thisFix(ss.mkdel(this, this.connect)));
|
---|
| 2613 | this.get_setPropertyBtn().click(ss.thisFix(ss.mkdel(this, this.setProperty)));
|
---|
| 2614 | this.get_getPropertyBtn().click(ss.mkdel(this, this.getProperty));
|
---|
| 2615 | this.get_setGetPropertyBtn().click(ss.thisFix(ss.mkdel(this, this.setGetProperty)));
|
---|
| 2616 | this.get_kadecotBtn().click(ss.thisFix(ss.mkdel(this, this.kadecotClick)));
|
---|
| 2617 | this.get_propertyList().change(ss.thisFix(ss.mkdel(this, this.propertyChange)));
|
---|
| 2618 | this.get_setInitParamsBtn().click(ss.thisFix(ss.mkdel(this, this.$setInitParams)));
|
---|
[125] | 2619 | this.get_getInitParamsBtn().click(ss.thisFix(ss.mkdel(this, this.$getInitParams)));
|
---|
[101] | 2620 | },
|
---|
| 2621 | $initClassGroups: function(data) {
|
---|
| 2622 | var classGroups = $control_UI.toJSClassGroupInfoList(data);
|
---|
| 2623 | //初期化
|
---|
| 2624 | $CtrlUI.$m_Classes = [];
|
---|
| 2625 | $CtrlUI.$m_ClassGroups = Array.prototype.slice.call(classGroups);
|
---|
| 2626 | this.$getClassInfoHandler($ctrlui_T_ECN_EOJ.x1_PROFILE, $ctrlui_T_ECN_EOJ.x2_NODE_PROFILE, ss.mkdel(this, this.$getClassInfoCallback));
|
---|
| 2627 | },
|
---|
| 2628 | $getClassInfoCallback: function(di) {
|
---|
| 2629 | $CtrlUI.$m_ProfileClassInfo = di;
|
---|
| 2630 | },
|
---|
| 2631 | $getClassInfoHandler: function(x1, x2, cb) {
|
---|
| 2632 | var eclass = Enumerable.from($CtrlUI.$m_Classes).firstOrDefault(function(p) {
|
---|
| 2633 | return p.classGroup.classGroupCode === x1 && p.classCode === x2;
|
---|
| 2634 | }, ss.getDefaultValue($ctrlui_JsonClassInfo));
|
---|
| 2635 | //すでにjsonファイルが読み込まれているので、ファイルを読み込まない。
|
---|
| 2636 | if (ss.isValue(eclass)) {
|
---|
| 2637 | if (ss.isNullOrUndefined(eclass.properties)) {
|
---|
| 2638 | this.$getPropertyList(eclass, cb);
|
---|
| 2639 | }
|
---|
| 2640 | else {
|
---|
| 2641 | cb(eclass);
|
---|
| 2642 | }
|
---|
| 2643 | return;
|
---|
| 2644 | }
|
---|
| 2645 | //eclass==nullの場合
|
---|
| 2646 | var classGroup = Enumerable.from($CtrlUI.$m_ClassGroups).firstOrDefault(function(p1) {
|
---|
| 2647 | return p1.classGroupCode === x1;
|
---|
| 2648 | }, ss.getDefaultValue($ctrlui_JsonClassGroupInfo));
|
---|
| 2649 | var classListUrl = 'devices/ClassList' + ss.formatNumber(x1, 'X2').toUpperCase() + '.json';
|
---|
| 2650 | $.ajax(classListUrl).success(ss.mkdel(this, function(data) {
|
---|
| 2651 | this.$getClassInfoSuccess(data, x1, x2, classGroup, cb);
|
---|
| 2652 | })).error(ss.mkdel(this, function(request, textStatus, error) {
|
---|
| 2653 | this.$getClassInfoError(request, textStatus, error, eclass, cb, classListUrl);
|
---|
| 2654 | }));
|
---|
| 2655 | },
|
---|
| 2656 | $getClassInfoSuccess: function(data, x1, x2, classGroup, cb) {
|
---|
| 2657 | var classes = $control_UI.toJSClassInfoList(data, classGroup);
|
---|
| 2658 | ss.arrayAddRange($CtrlUI.$m_Classes, classes);
|
---|
| 2659 | var eclass = Enumerable.from($CtrlUI.$m_Classes).firstOrDefault(function(p) {
|
---|
| 2660 | return p.classGroup.classGroupCode === x1 && p.classCode === x2;
|
---|
| 2661 | }, ss.getDefaultValue($ctrlui_JsonClassInfo));
|
---|
| 2662 | this.$getPropertyList(eclass, cb);
|
---|
| 2663 | },
|
---|
| 2664 | $getPropertyList: function(eclass, cb) {
|
---|
| 2665 | var PropertyListUrl = 'devices/PropertyList' + ss.formatNumber(eclass.classGroup.classGroupCode, 'X2').toUpperCase() + ss.formatNumber(eclass.classCode, 'X2').toUpperCase() + '.json';
|
---|
| 2666 | $.ajax(PropertyListUrl).success(ss.mkdel(this, function(data1) {
|
---|
| 2667 | this.$getPropertyListSuccess(data1, eclass);
|
---|
| 2668 | })).error(ss.mkdel(this, function(request, textStatus, error) {
|
---|
| 2669 | this.$propertyListAjaxError(request, textStatus, error, eclass, cb, PropertyListUrl);
|
---|
| 2670 | })).complete(ss.mkdel(this, function(request1, textStatus1) {
|
---|
| 2671 | this.$getPropertyListComplete(request1, textStatus1, eclass, cb);
|
---|
| 2672 | }));
|
---|
| 2673 | },
|
---|
| 2674 | $getPropertyListSuccess: function(data, eclass) {
|
---|
| 2675 | var properties = $control_UI.toJSPropertyInfoList(data);
|
---|
| 2676 | eclass.properties = Array.prototype.slice.call(properties);
|
---|
| 2677 | },
|
---|
| 2678 | $getPropertyListComplete: function(request, textStatus, eclass, cb) {
|
---|
| 2679 | if (ss.equalsT(request.statusText, 'OK')) {
|
---|
| 2680 | cb(eclass);
|
---|
| 2681 | }
|
---|
| 2682 | },
|
---|
| 2683 | $getClassInfoError: function(request, textStatus, error, eclass, cb, url) {
|
---|
| 2684 | $CtrlUI.$ajaxError(request, textStatus, error, url);
|
---|
| 2685 | cb(eclass);
|
---|
| 2686 | },
|
---|
| 2687 | $propertyListAjaxError: function(request, textStatus, error, eclass, cb, url) {
|
---|
| 2688 | var PropertyListBaseUrl = 'devices/PropertyListBase.json';
|
---|
| 2689 | $.ajax(PropertyListBaseUrl).success(ss.mkdel(this, function(data1) {
|
---|
| 2690 | this.$getPropertyListSuccess(data1, eclass);
|
---|
| 2691 | })).error(function(request1, textStatus1, error1) {
|
---|
| 2692 | $CtrlUI.$ajaxError(request1, textStatus1, error1, url);
|
---|
| 2693 | }).complete(ss.mkdel(this, function(request11, textStatus11) {
|
---|
| 2694 | this.$getPropertyListComplete(request11, textStatus11, eclass, cb);
|
---|
| 2695 | }));
|
---|
| 2696 | },
|
---|
| 2697 | $sendHello: function() {
|
---|
| 2698 | this.$m_WampClient.sendHello('default', '{"roles":{"caller":{},"subscriber":{}}}', ss.mkdel(this, this.$onWelcom));
|
---|
| 2699 | },
|
---|
| 2700 | $onWelcom: function(args) {
|
---|
| 2701 | this.$m_WampClient.sendSubscribe('{}', 'com.sonycsl.kadecot.echonetlite.topic.GeneralLighting.OperationStatus', ss.mkdel(this, this.$onSubscribed), ss.mkdel(this, this.$onSubscribed));
|
---|
| 2702 | },
|
---|
| 2703 | $onSubscribed: function(args) {
|
---|
| 2704 | },
|
---|
| 2705 | $onDevListed: function(args) {
|
---|
| 2706 | var cmd = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 2707 | if (cmd !== 50) {
|
---|
| 2708 | $(document).trigger($control_UIEventNames.searchError);
|
---|
| 2709 | return;
|
---|
| 2710 | }
|
---|
| 2711 | //初期化
|
---|
| 2712 | var alldevs = $control_UI.getAllDevices(args);
|
---|
| 2713 | this.$getDeviceInfo(alldevs, 0, []);
|
---|
| 2714 | },
|
---|
| 2715 | $getDeviceInfo: function(alldevs, pos, m_NodeList) {
|
---|
| 2716 | var device = alldevs[pos];
|
---|
| 2717 | var callback = ss.mkdel(this, function(args) {
|
---|
| 2718 | var cmd = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 2719 | if (cmd !== 50) {
|
---|
| 2720 | $(document).trigger($control_UIEventNames.searchError);
|
---|
| 2721 | return;
|
---|
| 2722 | }
|
---|
| 2723 | var dev = new $ctrlui_WebApiObjectInfo(device.deviceId, ss.cast(args, Array)[4], false);
|
---|
| 2724 | this.$getClassInfoHandler(dev.x1, dev.x2, ss.mkdel(this, function(dc) {
|
---|
| 2725 | var di = $control_UI.getDeviceInfo(dc, dev, device);
|
---|
| 2726 | var node = Enumerable.from(m_NodeList).firstOrDefault(function(ni) {
|
---|
| 2727 | return ss.referenceEquals(ss.cast(ni.get_data(), String), device.ip_addr);
|
---|
| 2728 | }, ss.getDefaultValue($ctrlui_DeviceController$NodeInfo));
|
---|
| 2729 | if (ss.isNullOrUndefined(node)) {
|
---|
| 2730 | var profile = new $ctrlui_DeviceController$DeviceInfo.$ctor2($CtrlUI.$m_ProfileClassInfo, true, $ctrlui_T_ECN_EOJ.x1_PROFILE, $ctrlui_T_ECN_EOJ.x2_NODE_PROFILE, 1, dev.enodid);
|
---|
| 2731 | node = new $ctrlui_DeviceController$NodeInfo(dev.enodid, profile);
|
---|
| 2732 | node.set_data(device.ip_addr);
|
---|
| 2733 | m_NodeList.push(node);
|
---|
| 2734 | }
|
---|
| 2735 | node.get_devices().push(di);
|
---|
| 2736 | pos++;
|
---|
| 2737 | if (pos < alldevs.length) {
|
---|
| 2738 | this.$getDeviceInfo(alldevs, pos, m_NodeList);
|
---|
| 2739 | }
|
---|
| 2740 | else {
|
---|
| 2741 | $(document).trigger($control_UIEventNames.searchEnd);
|
---|
| 2742 | this.$m_DeviceController = new $ctrlui_DeviceController(m_NodeList);
|
---|
| 2743 | this.$updateUI();
|
---|
| 2744 | }
|
---|
| 2745 | }));
|
---|
| 2746 | });
|
---|
| 2747 | if (device.protocol === 'arduino') {
|
---|
| 2748 | var arg = { x1: 14, x2: 240, x3: 1, enodid: 1, properties: [{ epc: 0, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 1, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 2, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 3, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 4, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 5, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 6, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 7, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 8, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 9, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 10, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 11, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 12, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 13, flag: 'RULE_SET,RULE_GET', size: 1 }, { epc: 14, flag: 'RULE_GET', size: 1 }, { epc: 15, flag: 'RULE_GET', size: 1 }, { epc: 16, flag: 'RULE_GET', size: 1 }, { epc: 17, flag: 'RULE_GET', size: 1 }, { epc: 18, flag: 'RULE_GET', size: 1 }, { epc: 19, flag: 'RULE_GET', size: 1 }] };
|
---|
| 2749 | callback([50, 0, { deviceId: 1 }, [], arg]);
|
---|
| 2750 | }
|
---|
| 2751 | else {
|
---|
| 2752 | this.$m_WampClient.sendCall('{"deviceId":' + device.deviceId + '}', 'jp.toppers.ecnl.procedure.getDeviceInfo', null, null, callback);
|
---|
| 2753 | }
|
---|
| 2754 | },
|
---|
| 2755 | $updateUI: function() {
|
---|
| 2756 | if (ss.isNullOrUndefined(this.get_nodeList())) {
|
---|
| 2757 | return;
|
---|
| 2758 | }
|
---|
| 2759 | this.get_nodeList().html('');
|
---|
| 2760 | this.get_nodeList().append(this.$m_DeviceController.getUINodeList(ss.mkdel(this, this.$listitem_Click)));
|
---|
| 2761 | this.get_nodeList().collapsibleset({}).collapsibleset('refresh');
|
---|
| 2762 | $("ul[data-role='listview']", this.get_nodeList()).listview().listview('refresh');
|
---|
| 2763 | },
|
---|
| 2764 | $onResponse: function(args) {
|
---|
| 2765 | var switchData = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 2766 | if (switchData !== 50) {
|
---|
| 2767 | return;
|
---|
| 2768 | }
|
---|
| 2769 | var doc = ss.cast(args, Array)[4];
|
---|
| 2770 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 2771 | this.$m_DeviceController.recvResponse(new $ctrlui_WebApiEchonetMessage(doc));
|
---|
| 2772 | if (ss.isNullOrUndefined(this.get_propertyList())) {
|
---|
| 2773 | return;
|
---|
| 2774 | }
|
---|
| 2775 | this.get_$m_CurrentNode().getData();
|
---|
| 2776 | }
|
---|
| 2777 | $control_UI.disable(this.get_setPropertyBtn(), true);
|
---|
| 2778 | },
|
---|
| 2779 | $onSetResponse: function(args) {
|
---|
| 2780 | var doc = ss.cast(args, Array)[4];
|
---|
| 2781 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 2782 | if (ss.isNullOrUndefined(this.get_propertyList())) {
|
---|
| 2783 | return;
|
---|
| 2784 | }
|
---|
| 2785 | this.$m_DeviceController.recvResponse(new $ctrlui_WebApiEchonetMessage(doc));
|
---|
| 2786 | }
|
---|
| 2787 | $control_UI.disable(this.get_setPropertyBtn(), true);
|
---|
| 2788 | },
|
---|
| 2789 | $listitem_Click: function(elem, ev, di) {
|
---|
| 2790 | if (ss.isNullOrUndefined(this.get_propertyList())) {
|
---|
| 2791 | return;
|
---|
| 2792 | }
|
---|
| 2793 | this.set_$m_CurrentNode(di);
|
---|
| 2794 | },
|
---|
| 2795 | $wampClientConnected: function() {
|
---|
| 2796 | //接続スイッチがOFFの時、スイッチを切り替える
|
---|
| 2797 | var flag = this.get_connectionSwt().prop('checked');
|
---|
| 2798 | if (!flag) {
|
---|
| 2799 | this.get_connectionSwt().prop('checked', true).flipswitch('refresh');
|
---|
| 2800 | }
|
---|
| 2801 | $control_UI.toggleClass(this.get_searchBtn(), 'ui-icon-alert', 'ui-icon-refresh');
|
---|
| 2802 | this.$sendHello();
|
---|
| 2803 | },
|
---|
| 2804 | $wampClientDisconnected: function() {
|
---|
| 2805 | $control_UI.toggleClass(this.get_searchBtn(), 'ui-icon-refresh', 'ui-icon-alert');
|
---|
| 2806 | },
|
---|
| 2807 | connect: function(ele, eve) {
|
---|
| 2808 | var connect = $(ele).prop('checked');
|
---|
| 2809 | //接続スイッチがOn && m_WampClient.isConnecting() == false
|
---|
| 2810 | if (connect && !this.$m_WampClient.isConnecting()) {
|
---|
[125] | 2811 | this.$m_WampClient.connect('ws://' + window.location.host + '/webapi');
|
---|
[101] | 2812 | }
|
---|
| 2813 | else if (!connect && this.$m_WampClient.isConnecting()) {
|
---|
| 2814 | this.$m_WampClient.disconnect();
|
---|
| 2815 | // m_WampClient.sendGoodbye("{}", "wamp.error.system_shutdown",Disconnect);
|
---|
| 2816 | }
|
---|
| 2817 | },
|
---|
| 2818 | disconnect: function(args) {
|
---|
| 2819 | this.$m_WampClient.disconnect();
|
---|
| 2820 | },
|
---|
| 2821 | search: function(ele, ev) {
|
---|
| 2822 | $(document).trigger($control_UIEventNames.searchStart);
|
---|
| 2823 | var data = this.$m_WampClient.sendCall('{}', 'com.sonycsl.kadecot.provider.procedure.getDeviceList', null, null, ss.mkdel(this, this.$onDevListed));
|
---|
| 2824 | if (ss.isNullOrUndefined(data)) {
|
---|
| 2825 | $(document).trigger($control_UIEventNames.searchError);
|
---|
| 2826 | return;
|
---|
| 2827 | }
|
---|
| 2828 | this.$timerId = window.setInterval(function() {
|
---|
| 2829 | $(document).trigger($control_UIEventNames.searchError);
|
---|
| 2830 | }, 20000);
|
---|
| 2831 | },
|
---|
| 2832 | searchStart: function(ev) {
|
---|
| 2833 | $.mobile.loading('show', new $LoadingOption.$ctor1('機器検索中...', true));
|
---|
| 2834 | $control_UI.disable(this.get_searchBtn(), true);
|
---|
| 2835 | },
|
---|
| 2836 | searchEnd: function(ev) {
|
---|
| 2837 | if (this.$timerId !== 0) {
|
---|
| 2838 | window.clearInterval(this.$timerId);
|
---|
| 2839 | this.$timerId = 0;
|
---|
| 2840 | }
|
---|
| 2841 | $.mobile.loading('hide');
|
---|
| 2842 | $control_UI.disable(this.get_searchBtn(), false);
|
---|
| 2843 | $control_UI.toggleClass(this.get_nodeList().find('li .ui-icon-alert'), 'ui-icon-alert', 'ui-icon-carat-r');
|
---|
| 2844 | },
|
---|
| 2845 | searchError: function(ev) {
|
---|
| 2846 | if (this.$timerId !== 0) {
|
---|
| 2847 | window.clearInterval(this.$timerId);
|
---|
| 2848 | this.$timerId = 0;
|
---|
| 2849 | }
|
---|
| 2850 | $.mobile.loading('hide');
|
---|
| 2851 | $('#bt_search').removeAttr('disabled');
|
---|
| 2852 | window.alert('機器が見つかりませんでした');
|
---|
| 2853 | $control_UI.toggleClass(this.get_nodeList().find('li .ui-icon-carat-r'), 'ui-icon-carat-r', 'ui-icon-alert');
|
---|
| 2854 | },
|
---|
| 2855 | propertyWriteStart: function(ev) {
|
---|
| 2856 | $.mobile.loading('show');
|
---|
| 2857 | },
|
---|
| 2858 | propertyWriteEnd: function(ev) {
|
---|
| 2859 | //PropertyList.Find("li").Find(".ui-field-contain").Children(".ui-input-text").Each((i, ele) => {
|
---|
| 2860 | // if (jQuery.Select(ele).Children(".ui-input-text").Length > 0) {
|
---|
| 2861 | // jQuery.Select(ele).Children("a").Remove();
|
---|
| 2862 | // jQuery.Select(ele).Children(".ui-input-text").Unwrap();
|
---|
| 2863 | // }
|
---|
| 2864 | //});
|
---|
| 2865 | $.mobile.loading('hide');
|
---|
| 2866 | },
|
---|
| 2867 | setProperty: function(ele, eve) {
|
---|
| 2868 | var esv = new $ctrlui_WebApiSet();
|
---|
| 2869 | var ctrls = this.get_propertyList();
|
---|
| 2870 | esv.deojid = this.get_$m_CurrentNode().get_eObjId();
|
---|
| 2871 | var enable = false;
|
---|
| 2872 | var $t1 = this.get_$m_CurrentNode().get_properties();
|
---|
| 2873 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 2874 | var dpi = $t1[$t2];
|
---|
| 2875 | if (ss.isNullOrUndefined(dpi.get_inputData())) {
|
---|
| 2876 | continue;
|
---|
| 2877 | }
|
---|
| 2878 | else if (dpi.get_isWaitRes()) {
|
---|
| 2879 | esv.addEdt(dpi.get_propertyCode(), dpi.get_inputData());
|
---|
| 2880 | enable = true;
|
---|
| 2881 | }
|
---|
| 2882 | }
|
---|
| 2883 | if (!enable) {
|
---|
| 2884 | return;
|
---|
| 2885 | }
|
---|
| 2886 | var call = this.$m_WampClient.sendCall(esv.getOption(), 'jp.toppers.ecnl.procedure.set', '[]', esv.getArguments(), ss.mkdel(this, this.$onSetResponse));
|
---|
| 2887 | if (ss.isNullOrUndefined(call)) {
|
---|
| 2888 | window.alert('機器が接続されていません');
|
---|
| 2889 | }
|
---|
| 2890 | },
|
---|
| 2891 | getProperty: function(eve) {
|
---|
| 2892 | var protocol = ss.cast(this.get_$m_CurrentNode().get_data(), $ctrlui_WampApiKadecotDevice).protocol;
|
---|
| 2893 | if (protocol === 'arduino') {
|
---|
| 2894 | return;
|
---|
| 2895 | }
|
---|
| 2896 | var esv = new $ctrlui_WebApiGet();
|
---|
| 2897 | //現在選択中のノードからEObjIDを取得
|
---|
| 2898 | esv.deojid = this.get_$m_CurrentNode().get_eObjId();
|
---|
| 2899 | //取得フラグ
|
---|
| 2900 | var enable = false;
|
---|
| 2901 | var $t1 = this.get_$m_CurrentNode().get_properties();
|
---|
| 2902 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 2903 | var dpi = $t1[$t2];
|
---|
| 2904 | if (ss.isNullOrUndefined(dpi)) {
|
---|
| 2905 | continue;
|
---|
| 2906 | }
|
---|
| 2907 | dpi.set_isWaitRes(false);
|
---|
| 2908 | var target = (dpi.get_flag() & 2) !== 0;
|
---|
| 2909 | //読み込み禁止の場合
|
---|
| 2910 | if (!target) {
|
---|
| 2911 | dpi.set_errorText('読み込み禁止です');
|
---|
| 2912 | continue;
|
---|
| 2913 | }
|
---|
| 2914 | dpi.set_isWaitRes(true);
|
---|
| 2915 | esv.addEpc(dpi.get_propertyCode());
|
---|
| 2916 | //読み込み可なのでtrue
|
---|
| 2917 | enable = true;
|
---|
| 2918 | }
|
---|
| 2919 | if (!enable) {
|
---|
| 2920 | return;
|
---|
| 2921 | }
|
---|
| 2922 | var call = this.$m_WampClient.sendCall(esv.getOption(), 'jp.toppers.ecnl.procedure.get', '[]', esv.getArguments(), ss.mkdel(this, this.$onResponse));
|
---|
| 2923 | if (ss.isNullOrUndefined(call)) {
|
---|
| 2924 | $control_UI.toggleClass($control_UI.getDeviceBtn(this.get_$m_CurrentNode()), 'ui-icon-carat-r', 'ui-icon-alert');
|
---|
| 2925 | }
|
---|
| 2926 | else {
|
---|
| 2927 | $control_UI.toggleClass($control_UI.getDeviceBtn(this.get_$m_CurrentNode()), 'ui-icon-alert', 'ui-icon-carat-r');
|
---|
| 2928 | }
|
---|
| 2929 | },
|
---|
| 2930 | setGetProperty: function(ele, ev) {
|
---|
| 2931 | var esv = new $ctrlui_WebApiSet();
|
---|
| 2932 | esv.deojid = this.get_$m_CurrentNode().get_eObjId();
|
---|
| 2933 | var enable = false;
|
---|
| 2934 | var $t1 = this.get_$m_CurrentNode().get_properties();
|
---|
| 2935 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 2936 | var dpi = $t1[$t2];
|
---|
| 2937 | if (ss.isNullOrUndefined(dpi.get_inputData())) {
|
---|
| 2938 | continue;
|
---|
| 2939 | }
|
---|
| 2940 | else if (dpi.get_isWaitRes()) {
|
---|
| 2941 | esv.addEdt(dpi.get_propertyCode(), dpi.get_inputData());
|
---|
| 2942 | enable = true;
|
---|
| 2943 | }
|
---|
| 2944 | }
|
---|
| 2945 | if (!enable) {
|
---|
| 2946 | return;
|
---|
| 2947 | }
|
---|
| 2948 | var call = this.$m_WampClient.sendCall(esv.getOption(), 'jp.toppers.ecnl.procedure.setget', '[]', esv.getArguments(), ss.mkdel(this, this.$onResponse));
|
---|
| 2949 | if (ss.isNullOrUndefined(call)) {
|
---|
| 2950 | window.alert('機器が接続されていません');
|
---|
| 2951 | }
|
---|
| 2952 | },
|
---|
| 2953 | propertyChange: function(ele, ev) {
|
---|
| 2954 | var flag = this.get_$m_CurrentNode().isWait();
|
---|
| 2955 | $control_UI.disable(this.get_setPropertyBtn(), !flag);
|
---|
| 2956 | $control_UI.disable(this.get_setGetPropertyBtn(), !flag);
|
---|
| 2957 | },
|
---|
| 2958 | kadecotClick: function(ele, ev) {
|
---|
| 2959 | window.open('http://app.kadecot.net/index.html?kip=' + window.location.hostname, 'Kadecot');
|
---|
| 2960 | },
|
---|
| 2961 | kadecotSet: function(dpi, data) {
|
---|
| 2962 | var propName;
|
---|
| 2963 | if (dpi.get_propertyCode() === 128) {
|
---|
| 2964 | propName = 'OperationStatus';
|
---|
| 2965 | }
|
---|
| 2966 | else {
|
---|
| 2967 | propName = '0x' + dpi.get_propertyCode().toString(16);
|
---|
| 2968 | }
|
---|
| 2969 | var di = this.get_$m_CurrentNode();
|
---|
| 2970 | if (ss.isNullOrUndefined(di)) {
|
---|
| 2971 | return;
|
---|
| 2972 | }
|
---|
| 2973 | this.$dpi = dpi;
|
---|
| 2974 | var msg = new $ctrlui_WampApiKadecotSet(di.get_eObjId(), propName, data);
|
---|
| 2975 | this.$m_WampClient.sendCall(msg.$getOption(), 'com.sonycsl.kadecot.echonetlite.procedure.set', '[]', msg.$getArguments(), ss.mkdel(this, this.$kadecotSet));
|
---|
| 2976 | },
|
---|
| 2977 | $kadecotSet: function(args) {
|
---|
| 2978 | var di = this.get_$m_CurrentNode();
|
---|
| 2979 | var doc = ss.cast(args, Array)[4];
|
---|
| 2980 | var res = new $ctrlui_WampApiKadecotRes(doc);
|
---|
| 2981 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 2982 | this.$m_DeviceController.recvResponse$1(di, 113, this.$dpi.get_propertyCode(), res.propertyValue);
|
---|
| 2983 | }
|
---|
| 2984 | },
|
---|
| 2985 | kadecotGet$1: function(dpi) {
|
---|
| 2986 | var propName;
|
---|
| 2987 | if (dpi.get_propertyCode() === 128) {
|
---|
| 2988 | propName = 'OperationStatus';
|
---|
| 2989 | }
|
---|
| 2990 | else {
|
---|
| 2991 | propName = '0x' + dpi.get_propertyCode().toString(16);
|
---|
| 2992 | }
|
---|
| 2993 | var di = this.get_$m_CurrentNode();
|
---|
| 2994 | if (ss.isNullOrUndefined(di)) {
|
---|
| 2995 | return;
|
---|
| 2996 | }
|
---|
| 2997 | var msg = new $ctrlui_WampApiKadecotGet(di.get_eObjId(), propName);
|
---|
| 2998 | this.$dpi = dpi;
|
---|
| 2999 | this.$m_WampClient.sendCall(msg.$getOption(), 'com.sonycsl.kadecot.echonetlite.procedure.get', '[]', msg.$getArguments(), ss.mkdel(this, this.kadecotGet));
|
---|
| 3000 | },
|
---|
| 3001 | kadecotGet: function(args) {
|
---|
| 3002 | var di = this.get_$m_CurrentNode();
|
---|
| 3003 | var doc = ss.cast(args, Array)[4];
|
---|
| 3004 | var res = new $ctrlui_WampApiKadecotRes(doc);
|
---|
| 3005 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 3006 | this.$m_DeviceController.recvResponse$1(di, 114, this.$dpi.get_propertyCode(), res.propertyValue);
|
---|
| 3007 | }
|
---|
| 3008 | },
|
---|
| 3009 | $currentNodeChange: function(elem, ev) {
|
---|
| 3010 | this.$buttonDisabled(this.get_$m_CurrentNode());
|
---|
| 3011 | if (ss.isNullOrUndefined(this.get_$m_CurrentNode())) {
|
---|
| 3012 | return;
|
---|
| 3013 | }
|
---|
| 3014 | this.$propertyCreate(this.get_$m_CurrentNode());
|
---|
| 3015 | this.getProperty(ev);
|
---|
| 3016 | return;
|
---|
| 3017 | },
|
---|
| 3018 | $buttonDisabled: function(di) {
|
---|
| 3019 | if (ss.isNullOrUndefined(di)) {
|
---|
| 3020 | $control_UI.disable(this.get_setGetPropertyBtn(), true);
|
---|
| 3021 | $control_UI.disable(this.get_getPropertyBtn(), true);
|
---|
| 3022 | $control_UI.disable(this.get_setPropertyBtn(), true);
|
---|
| 3023 | return;
|
---|
| 3024 | }
|
---|
| 3025 | var ctrls = this.get_propertyList();
|
---|
| 3026 | $control_UI.disable(this.get_setGetPropertyBtn(), ss.isNullOrUndefined(ctrls));
|
---|
| 3027 | $control_UI.disable(this.get_getPropertyBtn(), ss.isNullOrUndefined(ctrls));
|
---|
| 3028 | $control_UI.disable(this.get_setPropertyBtn(), ss.isNullOrUndefined(ctrls));
|
---|
| 3029 | },
|
---|
| 3030 | $propertyCreate: function(di) {
|
---|
| 3031 | if (ss.isNullOrUndefined(di)) {
|
---|
| 3032 | return;
|
---|
| 3033 | }
|
---|
| 3034 | $(document).trigger($control_UIEventNames.propertyWriteStart);
|
---|
| 3035 | di.setUIDevice(this);
|
---|
| 3036 | this.get_propertyList().html('');
|
---|
| 3037 | this.get_propertyList().append(di.getPropertys());
|
---|
| 3038 | this.get_propertyList().listview().listview('refresh');
|
---|
| 3039 | this.get_propertyList().listview().trigger('create');
|
---|
| 3040 | $(document).trigger($control_UIEventNames.propertyWriteEnd);
|
---|
| 3041 | },
|
---|
| 3042 | $setInitParams: function(elem, e) {
|
---|
| 3043 | var macaddrfrm = new RegExp('([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2})');
|
---|
[125] | 3044 | var ipaddrfrm = new RegExp('([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})');
|
---|
[101] | 3045 | var m = macaddrfrm.exec(this.get_macAddrTxt().val());
|
---|
| 3046 | if (ss.isNullOrUndefined(m)) {
|
---|
| 3047 | return;
|
---|
| 3048 | }
|
---|
[125] | 3049 | var macAddr = '"macAddr":[' + parseInt(m[1], 16) + ',' + parseInt(m[2], 16) + ',' + parseInt(m[3], 16) + ',' + parseInt(m[4], 16) + ',' + parseInt(m[5], 16) + ',' + parseInt(m[6], 16) + ']';
|
---|
| 3050 | var dhcpEnable = '"dhcpEnable":' + this.get_dhcpEnableCb().prop('checked').toString();
|
---|
| 3051 | m = ipaddrfrm.exec(this.get_ipAddrTxt().val());
|
---|
| 3052 | if (ss.isNullOrUndefined(m)) {
|
---|
| 3053 | return;
|
---|
| 3054 | }
|
---|
| 3055 | var ipAddr = '"ipAddr":[' + parseInt(m[1]) + ',' + parseInt(m[2]) + ',' + parseInt(m[3]) + ',' + parseInt(m[4]) + ']';
|
---|
| 3056 | m = ipaddrfrm.exec(this.get_netmaskTxt().val());
|
---|
| 3057 | if (ss.isNullOrUndefined(m)) {
|
---|
| 3058 | return;
|
---|
| 3059 | }
|
---|
| 3060 | var netmask = '"netmask":[' + parseInt(m[1]) + ',' + parseInt(m[2]) + ',' + parseInt(m[3]) + ',' + parseInt(m[4]) + ']';
|
---|
| 3061 | m = ipaddrfrm.exec(this.get_gatewayTxt().val());
|
---|
| 3062 | if (ss.isNullOrUndefined(m)) {
|
---|
| 3063 | return;
|
---|
| 3064 | }
|
---|
| 3065 | var gateway = '"gateway":[' + parseInt(m[1]) + ',' + parseInt(m[2]) + ',' + parseInt(m[3]) + ',' + parseInt(m[4]) + ']';
|
---|
| 3066 | this.$m_WampClient.sendCall('{}', 'jp.toppers.ecnl.procedure.setInitParams', '[]', '{' + macAddr + ',' + dhcpEnable + ',' + ipAddr + ',' + netmask + ',' + gateway + '}', ss.mkdel(this, this.setInitParamsRes));
|
---|
[101] | 3067 | },
|
---|
| 3068 | setInitParamsRes: function(args) {
|
---|
| 3069 | var cmd = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 3070 | if (cmd !== 50) {
|
---|
| 3071 | $('#popup_dialog_caption').text('エラー');
|
---|
| 3072 | $('#popup_dialog_title').text('エラーが発生しました');
|
---|
| 3073 | $('#popup_dialog_text').text('初期データの書き込みに失敗しました。');
|
---|
| 3074 | $('#popup_dialog').popup('open', { transition: 'slidedown' });
|
---|
| 3075 | return;
|
---|
| 3076 | }
|
---|
| 3077 | $('#popup_dialog_caption').text('初期データ');
|
---|
| 3078 | $('#popup_dialog_title').text('初期データを書き込みました');
|
---|
| 3079 | $('#popup_dialog_text').text('初期データの書き込みに成功しました。');
|
---|
| 3080 | $('#popup_dialog').popup('open', { transition: 'slidedown' });
|
---|
| 3081 | },
|
---|
| 3082 | $getInitParams: function(elem, e) {
|
---|
| 3083 | this.$m_WampClient.sendCall('{}', 'jp.toppers.ecnl.procedure.getInitParams', '[]', '{}', ss.mkdel(this, this.getInitParamsRes));
|
---|
| 3084 | },
|
---|
| 3085 | getInitParamsRes: function(args) {
|
---|
| 3086 | var cmd = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 3087 | if (cmd !== 50) {
|
---|
| 3088 | $('#popup_dialog_caption').text('エラー');
|
---|
| 3089 | $('#popup_dialog_title').text('エラーが発生しました');
|
---|
| 3090 | $('#popup_dialog_text').text('初期データの読み込みに失敗しました。');
|
---|
| 3091 | $('#popup_dialog').popup('open', { transition: 'slidedown' });
|
---|
| 3092 | return;
|
---|
| 3093 | }
|
---|
[125] | 3094 | var param = ss.cast(args, Array)[4];
|
---|
| 3095 | var macaddr = ss.cast(param.macAddr, Array);
|
---|
[101] | 3096 | this.get_macAddrTxt().val(ss.formatString('{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}', macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]));
|
---|
[125] | 3097 | var dhcpEnable = !!param.dhcpEnable;
|
---|
| 3098 | this.get_dhcpEnableCb().prop('checked', dhcpEnable).checkboxradio('refresh');
|
---|
| 3099 | var ipaddr = ss.cast(param.ipAddr, Array);
|
---|
| 3100 | this.get_ipAddrTxt().val(ss.formatString('{0}:{1}:{2}:{3}', ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]));
|
---|
| 3101 | var netmask = ss.cast(param.netmask, Array);
|
---|
| 3102 | this.get_netmaskTxt().val(ss.formatString('{0}:{1}:{2}:{3}', netmask[0], netmask[1], netmask[2], netmask[3]));
|
---|
| 3103 | var gateway = ss.cast(param.gateway, Array);
|
---|
| 3104 | this.get_gatewayTxt().val(ss.formatString('{0}:{1}:{2}:{3}', gateway[0], gateway[1], gateway[2], gateway[3]));
|
---|
[101] | 3105 | },
|
---|
| 3106 | get_setPropertyBtn: function() {
|
---|
| 3107 | return $('#bt_set_property', $CtrlUI.$page);
|
---|
| 3108 | },
|
---|
| 3109 | get_getPropertyBtn: function() {
|
---|
| 3110 | return $('#bt_get_property', $CtrlUI.$page);
|
---|
| 3111 | },
|
---|
| 3112 | get_setGetPropertyBtn: function() {
|
---|
| 3113 | return $('#bt_set_get_property', $CtrlUI.$page);
|
---|
| 3114 | },
|
---|
| 3115 | get_kadecotBtn: function() {
|
---|
| 3116 | return $('#bt_kadecot', $CtrlUI.$page);
|
---|
| 3117 | },
|
---|
| 3118 | get_connectionSwt: function() {
|
---|
| 3119 | return $('#fs_connection', $CtrlUI.$page);
|
---|
| 3120 | },
|
---|
| 3121 | get_propertyList: function() {
|
---|
| 3122 | return $('#lv_property_list', $CtrlUI.$page);
|
---|
| 3123 | },
|
---|
| 3124 | get_searchBtn: function() {
|
---|
| 3125 | return $('#bt_search', $CtrlUI.$page);
|
---|
| 3126 | },
|
---|
| 3127 | get_nodeList: function() {
|
---|
| 3128 | return $('#node_list', $CtrlUI.$page);
|
---|
| 3129 | },
|
---|
| 3130 | get_propertyGroupBox: function() {
|
---|
| 3131 | return $('#lv_property_list', $CtrlUI.$page).find('li');
|
---|
| 3132 | },
|
---|
| 3133 | get_setInitParamsBtn: function() {
|
---|
| 3134 | return $('#bt_set_init_params', $CtrlUI.$page);
|
---|
| 3135 | },
|
---|
| 3136 | get_getInitParamsBtn: function() {
|
---|
| 3137 | return $('#bt_get_init_params', $CtrlUI.$page);
|
---|
| 3138 | },
|
---|
| 3139 | get_macAddrTxt: function() {
|
---|
| 3140 | return $('#txt_mac_addr', $CtrlUI.$page);
|
---|
| 3141 | },
|
---|
[125] | 3142 | get_dhcpEnableCb: function() {
|
---|
| 3143 | return $('#cb_dhcp_enable', $CtrlUI.$page);
|
---|
| 3144 | },
|
---|
| 3145 | get_ipAddrTxt: function() {
|
---|
| 3146 | return $('#txt_ip_addr', $CtrlUI.$page);
|
---|
| 3147 | },
|
---|
| 3148 | get_netmaskTxt: function() {
|
---|
| 3149 | return $('#txt_netmask', $CtrlUI.$page);
|
---|
| 3150 | },
|
---|
| 3151 | get_gatewayTxt: function() {
|
---|
| 3152 | return $('#txt_gateway', $CtrlUI.$page);
|
---|
| 3153 | },
|
---|
[101] | 3154 | pinMode_Change: function(fieldset, pin) {
|
---|
| 3155 | var value = fieldset.checkdValue();
|
---|
| 3156 | var dic = ss.mkdict(['pin', pin, 'mode', value]);
|
---|
| 3157 | this.$m_WampClient.sendCall('{"deviceId":' + 1 + '}', 'com.sonycsl.kadecot.arduino.pinMode', '[]', JSON.stringify(dic), ss.mkdel(this, this.pinMode));
|
---|
| 3158 | },
|
---|
| 3159 | digital_Change: function(button, flipswitch, pin) {
|
---|
| 3160 | var msg = new $ctrlui_WampApiKadecotSet(1, '2', new Array(2));
|
---|
| 3161 | var dic = ss.mkdict(['pin', pin, 'value', flipswitch.get_value()]);
|
---|
| 3162 | this.$m_WampClient.sendCall('{"deviceId":' + 1 + '}', 'com.sonycsl.kadecot.arduino.digitalWrite', '[]', JSON.stringify(dic), ss.mkdel(this, this.digitalWrite));
|
---|
| 3163 | },
|
---|
| 3164 | analogWrite_Change: function(range, pin) {
|
---|
| 3165 | var msg = new $ctrlui_WampApiKadecotSet(1, '2', new Array(2));
|
---|
| 3166 | var dic = ss.mkdict(['pin', pin, 'value', range.get_value$1()]);
|
---|
| 3167 | this.$m_WampClient.sendCall('{"deviceId":' + 1 + '}', 'com.sonycsl.kadecot.arduino.analogWrite', '[]', JSON.stringify(dic), ss.mkdel(this, this.pinMode));
|
---|
| 3168 | },
|
---|
| 3169 | analogRead: function(range, pin) {
|
---|
| 3170 | var dic = ss.mkdict(['pin', pin]);
|
---|
| 3171 | this.$m_WampClient.sendCall('{"deviceId":' + 1 + '}', 'com.sonycsl.kadecot.arduino.analogRead', '[]', JSON.stringify(dic), ss.mkdel(this, function(args) {
|
---|
| 3172 | this.digitalRead$1(args, range);
|
---|
| 3173 | }));
|
---|
| 3174 | },
|
---|
| 3175 | pinMode: function(args) {
|
---|
| 3176 | var switchData = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 3177 | if (switchData !== 50) {
|
---|
| 3178 | return;
|
---|
| 3179 | }
|
---|
| 3180 | var doc = ss.cast(args, Array)[4];
|
---|
| 3181 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 3182 | if (ss.isNullOrUndefined(this.get_propertyList())) {
|
---|
| 3183 | return;
|
---|
| 3184 | }
|
---|
| 3185 | }
|
---|
| 3186 | },
|
---|
| 3187 | digitalWrite: function(args) {
|
---|
| 3188 | var switchData = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 3189 | if (switchData !== 50) {
|
---|
| 3190 | return;
|
---|
| 3191 | }
|
---|
| 3192 | var doc = ss.cast(args, Array)[4];
|
---|
| 3193 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 3194 | if (ss.isNullOrUndefined(this.get_propertyList())) {
|
---|
| 3195 | return;
|
---|
| 3196 | }
|
---|
| 3197 | }
|
---|
| 3198 | },
|
---|
| 3199 | digitalRead: function(button, flip, i) {
|
---|
| 3200 | var dic = ss.mkdict(['pin', i]);
|
---|
| 3201 | var str = this.$m_WampClient.sendCall('{"deviceId":' + 1 + '}', 'com.sonycsl.kadecot.arduino.digitalRead', '[]', JSON.stringify(dic), ss.mkdel(this, function(arg) {
|
---|
| 3202 | this.digitalRead$1(arg, flip);
|
---|
| 3203 | }));
|
---|
| 3204 | if (ss.isNullOrUndefined(str)) {
|
---|
| 3205 | button.toggleClass$1('ui-icon-refresh', 'ui-icon-alert');
|
---|
| 3206 | }
|
---|
| 3207 | else {
|
---|
| 3208 | button.toggleClass$1('ui-icon-alert', 'ui-icon-refresh');
|
---|
| 3209 | }
|
---|
| 3210 | },
|
---|
| 3211 | digitalRead$1: function(args, uiobject) {
|
---|
| 3212 | var switchData = ss.unbox(ss.cast(ss.cast(args, Array)[0], ss.Int32));
|
---|
| 3213 | if (switchData !== 50) {
|
---|
| 3214 | return;
|
---|
| 3215 | }
|
---|
| 3216 | var doc = ss.cast(args, Array)[4];
|
---|
| 3217 | if (ss.isValue(this.$m_DeviceController)) {
|
---|
| 3218 | var msg = new $ctrlui_WebApiGrsaguraMessage(doc);
|
---|
| 3219 | if (ss.referenceEquals(ss.getInstanceType(uiobject), $control_UIFlipSwitch)) {
|
---|
| 3220 | var flip = ss.cast(uiobject, $control_UIFlipSwitch);
|
---|
| 3221 | flip.set_value(msg.value);
|
---|
| 3222 | }
|
---|
| 3223 | else if (ss.referenceEquals(ss.getInstanceType(uiobject), $control_UIRangeInput)) {
|
---|
| 3224 | var range = ss.cast(uiobject, $control_UIRangeInput);
|
---|
| 3225 | range.set_value$1(parseInt(msg.value));
|
---|
| 3226 | range.object.slider('refresh');
|
---|
| 3227 | }
|
---|
| 3228 | }
|
---|
| 3229 | }
|
---|
| 3230 | });
|
---|
| 3231 | ss.initClass($ElementExtensions, $asm, {});
|
---|
| 3232 | ss.initClass($jQueryMobile, $asm, {});
|
---|
| 3233 | ss.initClass($LoadingOption, $asm, {});
|
---|
| 3234 | $LoadingOption.$ctor1.prototype = $LoadingOption.prototype;
|
---|
| 3235 | ss.initEnum($control_KeyPress, $asm, { delete$1: 0, backSpace: 8, minus: 45, dot: 46, slash: 47, _0: 48, _1: 49, _2: 50, _3: 51, _4: 52, _5: 53, _6: 54, _7: 55, _8: 56, _9: 57, a: 65, b: 66, c: 67, d: 68, e: 69, f: 70, a$1: 97, b$1: 98, c$1: 99, d$1: 100, e$1: 101, f$1: 102 });
|
---|
| 3236 | ss.initClass($control_UI, $asm, {});
|
---|
| 3237 | ss.initClass($control_UIObject, $asm, {
|
---|
| 3238 | get_element: function() {
|
---|
| 3239 | return this.object.get(0);
|
---|
| 3240 | },
|
---|
| 3241 | change: function() {
|
---|
| 3242 | this.object.change();
|
---|
| 3243 | return this;
|
---|
| 3244 | },
|
---|
| 3245 | change$1: function(eventHandler) {
|
---|
| 3246 | this.object.change(eventHandler);
|
---|
| 3247 | },
|
---|
| 3248 | keypress: function(eventHandler) {
|
---|
| 3249 | this.object.keypress(eventHandler);
|
---|
| 3250 | },
|
---|
| 3251 | toggle: function(showOrHide) {
|
---|
| 3252 | return this.object.toggle(showOrHide);
|
---|
| 3253 | },
|
---|
| 3254 | attribute$1: function(attributeName, value) {
|
---|
| 3255 | this.object.attr(attributeName, value);
|
---|
| 3256 | },
|
---|
| 3257 | removeAttr: function(attributeName) {
|
---|
| 3258 | this.object.removeAttr(attributeName);
|
---|
| 3259 | },
|
---|
| 3260 | getAttribute: function(attributeName) {
|
---|
| 3261 | return this.object.attr(attributeName);
|
---|
| 3262 | },
|
---|
| 3263 | find: function(selector) {
|
---|
| 3264 | return this.object.find(selector);
|
---|
| 3265 | },
|
---|
| 3266 | removeClass: function(className) {
|
---|
| 3267 | this.object.removeClass(className);
|
---|
| 3268 | return this;
|
---|
| 3269 | },
|
---|
| 3270 | toggleClass: function(className, add) {
|
---|
| 3271 | this.object.toggleClass(className, add);
|
---|
| 3272 | return this;
|
---|
| 3273 | },
|
---|
| 3274 | toggleClass$1: function(deleteClass, addClass) {
|
---|
| 3275 | $control_UI.toggleClass(this.object, deleteClass, addClass);
|
---|
| 3276 | return this;
|
---|
| 3277 | },
|
---|
| 3278 | one: function(eventName, eventHandler) {
|
---|
| 3279 | this.object.one(eventName, eventHandler);
|
---|
| 3280 | return this;
|
---|
| 3281 | },
|
---|
| 3282 | attribute: function(nameValueMap) {
|
---|
| 3283 | this.object.attr(nameValueMap);
|
---|
| 3284 | return this;
|
---|
| 3285 | },
|
---|
| 3286 | click$1: function(eventHandler) {
|
---|
| 3287 | this.object.click(eventHandler);
|
---|
| 3288 | return this;
|
---|
| 3289 | },
|
---|
| 3290 | click: function(eventHandler) {
|
---|
| 3291 | this.object.click(eventHandler);
|
---|
| 3292 | return this;
|
---|
| 3293 | },
|
---|
| 3294 | get_text: function() {
|
---|
| 3295 | return this.object.text();
|
---|
| 3296 | },
|
---|
| 3297 | set_text: function(value) {
|
---|
| 3298 | this.object.text(value);
|
---|
| 3299 | },
|
---|
| 3300 | get_id: function() {
|
---|
| 3301 | return this.object.attr('id');
|
---|
| 3302 | },
|
---|
| 3303 | set_id: function(value) {
|
---|
| 3304 | this.object.attr('id', value);
|
---|
| 3305 | },
|
---|
| 3306 | get_for: function() {
|
---|
| 3307 | return this.object.attr('for');
|
---|
| 3308 | },
|
---|
| 3309 | set_for: function(value) {
|
---|
| 3310 | this.object.attr('for', value);
|
---|
| 3311 | },
|
---|
| 3312 | get_name: function() {
|
---|
| 3313 | return this.object.attr('name');
|
---|
| 3314 | },
|
---|
| 3315 | set_name: function(value) {
|
---|
| 3316 | this.object.attr('name', value);
|
---|
| 3317 | },
|
---|
| 3318 | get_dataRole: function() {
|
---|
| 3319 | return this.object.attr('data-role');
|
---|
| 3320 | },
|
---|
| 3321 | set_dataRole: function(value) {
|
---|
| 3322 | this.object.attr('data-role', value);
|
---|
| 3323 | },
|
---|
| 3324 | get_dataType: function() {
|
---|
| 3325 | return this.object.attr('data-type');
|
---|
| 3326 | },
|
---|
| 3327 | set_dataType: function(value) {
|
---|
| 3328 | this.object.attr('data-type', value);
|
---|
| 3329 | },
|
---|
| 3330 | get_title: function() {
|
---|
| 3331 | return this.object.attr('title');
|
---|
| 3332 | },
|
---|
| 3333 | set_title: function(value) {
|
---|
| 3334 | this.object.attr('title', value);
|
---|
| 3335 | },
|
---|
| 3336 | get_value: function() {
|
---|
| 3337 | if (this.object.is('fieldset')) {
|
---|
| 3338 | return this.object.find("input[type='radio']:checked").val();
|
---|
| 3339 | }
|
---|
| 3340 | return this.object.val();
|
---|
| 3341 | },
|
---|
| 3342 | set_value: function(value) {
|
---|
| 3343 | if (this.object.is('fieldset')) {
|
---|
| 3344 | this.object.find('input[type="radio"]').each(function(j, elem) {
|
---|
| 3345 | if (ss.referenceEquals($(elem).val(), value)) {
|
---|
| 3346 | $(elem).prop('checked', true);
|
---|
| 3347 | }
|
---|
| 3348 | else {
|
---|
| 3349 | $(elem).prop('checked', false);
|
---|
| 3350 | }
|
---|
| 3351 | });
|
---|
| 3352 | this.object.find('input[type="radio"]').checkboxradio().checkboxradio('refresh');
|
---|
| 3353 | }
|
---|
| 3354 | else {
|
---|
| 3355 | this.object.val(value);
|
---|
| 3356 | if (this.get_dataRole() === 'flipswitch') {
|
---|
| 3357 | this.object.val(value).flipswitch('refresh');
|
---|
| 3358 | }
|
---|
| 3359 | }
|
---|
| 3360 | },
|
---|
| 3361 | get_maxlength: function() {
|
---|
| 3362 | return parseInt(this.getAttribute('maxlength'));
|
---|
| 3363 | },
|
---|
| 3364 | set_maxlength: function(value) {
|
---|
| 3365 | this.attribute$1('maxlength', value.toString());
|
---|
| 3366 | },
|
---|
| 3367 | get_min: function() {
|
---|
| 3368 | return parseInt(this.object.attr('min'));
|
---|
| 3369 | },
|
---|
| 3370 | set_min: function(value) {
|
---|
| 3371 | this.object.attr('min', value.toString());
|
---|
| 3372 | },
|
---|
| 3373 | get_max: function() {
|
---|
| 3374 | return parseInt(this.object.attr('max'));
|
---|
| 3375 | },
|
---|
| 3376 | set_max: function(value) {
|
---|
| 3377 | this.object.attr('max', value.toString());
|
---|
| 3378 | },
|
---|
| 3379 | get_tabIndex: function() {
|
---|
| 3380 | return parseInt(this.object.attr('tabindex'));
|
---|
| 3381 | },
|
---|
| 3382 | set_tabIndex: function(value) {
|
---|
| 3383 | this.object.attr('tabindex', value.toString());
|
---|
| 3384 | },
|
---|
| 3385 | get_type: function() {
|
---|
| 3386 | return this.object.attr('type');
|
---|
| 3387 | },
|
---|
| 3388 | set_type: function(value) {
|
---|
| 3389 | this.object.attr('type', value);
|
---|
| 3390 | },
|
---|
| 3391 | append: function(uiobject) {
|
---|
| 3392 | this.object.append(uiobject.object);
|
---|
| 3393 | },
|
---|
| 3394 | append$1: function(object) {
|
---|
| 3395 | return this.object.append(object);
|
---|
| 3396 | },
|
---|
| 3397 | disable: function(flag) {
|
---|
| 3398 | if (flag) {
|
---|
| 3399 | this.attribute$1('disabled', 'disabled');
|
---|
| 3400 | }
|
---|
| 3401 | else {
|
---|
| 3402 | this.removeAttr('disabled');
|
---|
| 3403 | }
|
---|
| 3404 | return this;
|
---|
| 3405 | },
|
---|
| 3406 | children: function() {
|
---|
| 3407 | return this.object.children();
|
---|
| 3408 | },
|
---|
| 3409 | addClass: function(className) {
|
---|
| 3410 | this.object.addClass(className);
|
---|
| 3411 | return this;
|
---|
| 3412 | },
|
---|
| 3413 | pointerEvents: function(flag) {
|
---|
| 3414 | if (!flag) {
|
---|
| 3415 | this.object.css('pointer-events', 'none');
|
---|
| 3416 | }
|
---|
| 3417 | return this;
|
---|
| 3418 | },
|
---|
| 3419 | hide: function() {
|
---|
| 3420 | this.object.hide();
|
---|
| 3421 | return this;
|
---|
| 3422 | },
|
---|
| 3423 | show: function() {
|
---|
| 3424 | this.object.show();
|
---|
| 3425 | return this;
|
---|
| 3426 | },
|
---|
| 3427 | get_class: function() {
|
---|
| 3428 | return this.$ecnlclass;
|
---|
| 3429 | },
|
---|
| 3430 | set_class: function(value) {
|
---|
| 3431 | this.$ecnlclass = value;
|
---|
| 3432 | this.addClass(this.$ecnlClassString(value));
|
---|
| 3433 | },
|
---|
| 3434 | $ecnlClassString: function(class1) {
|
---|
| 3435 | if (class1 === 0) {
|
---|
| 3436 | return 'ecnl_pink';
|
---|
| 3437 | }
|
---|
| 3438 | else if (class1 === 1) {
|
---|
| 3439 | return 'ecnl_violet';
|
---|
| 3440 | }
|
---|
| 3441 | else if (class1 === 2) {
|
---|
| 3442 | return 'ecnl_light_green';
|
---|
| 3443 | }
|
---|
| 3444 | else if (class1 === 3) {
|
---|
| 3445 | return 'ecnl_light_blue';
|
---|
| 3446 | }
|
---|
| 3447 | else {
|
---|
| 3448 | return '';
|
---|
| 3449 | }
|
---|
| 3450 | }
|
---|
| 3451 | });
|
---|
| 3452 | $control_UIObject.$ctor2.prototype = $control_UIObject.$ctor3.prototype = $control_UIObject.$ctor1.prototype = $control_UIObject.prototype;
|
---|
| 3453 | ss.initClass($control_UIAnchor, $asm, {
|
---|
| 3454 | get_href: function() {
|
---|
| 3455 | return this.getAttribute('href');
|
---|
| 3456 | },
|
---|
| 3457 | set_href: function(value) {
|
---|
| 3458 | this.attribute$1('href', value);
|
---|
| 3459 | },
|
---|
| 3460 | get_target: function() {
|
---|
| 3461 | return this.getAttribute('target');
|
---|
| 3462 | },
|
---|
| 3463 | set_target: function(value) {
|
---|
| 3464 | this.attribute$1('target', value);
|
---|
| 3465 | }
|
---|
| 3466 | }, $control_UIObject);
|
---|
| 3467 | $control_UIAnchor.$ctor1.prototype = $control_UIAnchor.$ctor2.prototype = $control_UIAnchor.prototype;
|
---|
| 3468 | ss.initClass($control_UIButton, $asm, {
|
---|
| 3469 | get_button: function() {
|
---|
| 3470 | return this.object.hasClass('ui-btn');
|
---|
| 3471 | },
|
---|
| 3472 | set_button: function(value) {
|
---|
| 3473 | this.object.toggleClass('ui-btn', value);
|
---|
| 3474 | },
|
---|
| 3475 | get_noText: function() {
|
---|
| 3476 | return this.object.hasClass('ui-btn-icon-notext');
|
---|
| 3477 | },
|
---|
| 3478 | set_noText: function(value) {
|
---|
| 3479 | this.object.toggleClass('ui-btn-icon-notext', value);
|
---|
| 3480 | },
|
---|
| 3481 | get_cornerAll: function() {
|
---|
| 3482 | return this.object.hasClass('ui-corner-all');
|
---|
| 3483 | },
|
---|
| 3484 | set_cornerAll: function(value) {
|
---|
| 3485 | this.object.toggleClass('ui-corner-all', value);
|
---|
| 3486 | },
|
---|
| 3487 | get_buttonIcon: function() {
|
---|
| 3488 | return this.$getIcon();
|
---|
| 3489 | },
|
---|
| 3490 | set_buttonIcon: function(value) {
|
---|
| 3491 | this.object.toggleClass(this.$getClass(value), true);
|
---|
| 3492 | },
|
---|
| 3493 | get_href: function() {
|
---|
| 3494 | return this.object.attr('href');
|
---|
| 3495 | },
|
---|
| 3496 | set_href: function(value) {
|
---|
| 3497 | this.object.attr('href', value);
|
---|
| 3498 | },
|
---|
| 3499 | $getClass: function(icon) {
|
---|
| 3500 | var text = '';
|
---|
| 3501 | if (icon === 0) {
|
---|
| 3502 | text = 'delete';
|
---|
| 3503 | }
|
---|
| 3504 | else if (icon === 1) {
|
---|
| 3505 | text = 'refresh';
|
---|
| 3506 | }
|
---|
| 3507 | else if (icon === 2) {
|
---|
| 3508 | text = 'back';
|
---|
| 3509 | }
|
---|
| 3510 | return 'ui-icon-' + text;
|
---|
| 3511 | },
|
---|
| 3512 | $getIcon: function() {
|
---|
| 3513 | if (this.object.hasClass('ui-icon-delete')) {
|
---|
| 3514 | return 0;
|
---|
| 3515 | }
|
---|
| 3516 | else if (this.object.hasClass('ui-icon-refresh')) {
|
---|
| 3517 | return 1;
|
---|
| 3518 | }
|
---|
| 3519 | else if (this.object.hasClass('ui-icon-back')) {
|
---|
| 3520 | return 2;
|
---|
| 3521 | }
|
---|
| 3522 | return 0;
|
---|
| 3523 | }
|
---|
| 3524 | }, $control_UIObject);
|
---|
| 3525 | ss.initClass($control_UIBackButton, $asm, {}, $control_UIButton);
|
---|
| 3526 | ss.initEnum($control_UIButton$Icon, $asm, { delete$1: 0, refresh: 1, back: 2 });
|
---|
| 3527 | ss.initClass($control_UITextInput, $asm, {
|
---|
| 3528 | get_dataClearBtn: function() {
|
---|
| 3529 | return /^\s*true\s*$/i.test(this.getAttribute('data-clear-btn'));
|
---|
| 3530 | },
|
---|
| 3531 | set_dataClearBtn: function(value) {
|
---|
| 3532 | if (value) {
|
---|
| 3533 | this.attribute$1('data-clear-btn', value.toString());
|
---|
| 3534 | }
|
---|
| 3535 | else {
|
---|
| 3536 | this.removeAttr('data-clear-btn');
|
---|
| 3537 | }
|
---|
| 3538 | ;
|
---|
| 3539 | },
|
---|
| 3540 | get_placeholder: function() {
|
---|
| 3541 | return this.getAttribute('placeholder');
|
---|
| 3542 | },
|
---|
| 3543 | set_placeholder: function(value) {
|
---|
| 3544 | this.attribute$1('placeholder', value);
|
---|
| 3545 | },
|
---|
| 3546 | get_dataOptions: function() {
|
---|
| 3547 | return JSON.parse(this.getAttribute('data-options'));
|
---|
| 3548 | },
|
---|
| 3549 | set_dataOptions: function(value) {
|
---|
| 3550 | this.attribute$1('data-options', JSON.stringify(value));
|
---|
| 3551 | },
|
---|
| 3552 | keyup: function(eventHandler) {
|
---|
| 3553 | this.object.keyup(eventHandler);
|
---|
| 3554 | return this.object;
|
---|
| 3555 | },
|
---|
| 3556 | on: function(eventName, eventHandler) {
|
---|
| 3557 | this.object.on(eventName, eventHandler);
|
---|
| 3558 | return this.object;
|
---|
| 3559 | },
|
---|
| 3560 | get_readOnly: function() {
|
---|
| 3561 | return this.getAttribute('readonly') === 'readonly';
|
---|
| 3562 | },
|
---|
| 3563 | set_readOnly: function(value) {
|
---|
| 3564 | if (value) {
|
---|
| 3565 | this.attribute$1('readonly', 'readonly');
|
---|
| 3566 | }
|
---|
| 3567 | else {
|
---|
| 3568 | this.removeAttr('readonly');
|
---|
| 3569 | }
|
---|
| 3570 | }
|
---|
| 3571 | }, $control_UIObject);
|
---|
| 3572 | $control_UITextInput.$ctor1.prototype = $control_UITextInput.prototype;
|
---|
| 3573 | ss.initClass($control_UICalBox, $asm, {
|
---|
| 3574 | get_dY: function() {
|
---|
| 3575 | return this.$getCal(0);
|
---|
| 3576 | },
|
---|
| 3577 | get_dM: function() {
|
---|
| 3578 | return this.$getCal(1);
|
---|
| 3579 | },
|
---|
| 3580 | get_dD: function() {
|
---|
| 3581 | return this.$getCal(2);
|
---|
| 3582 | },
|
---|
| 3583 | get_xY: function() {
|
---|
| 3584 | return ss.formatNumber(this.get_dY(), 'X4');
|
---|
| 3585 | },
|
---|
| 3586 | get_xM: function() {
|
---|
| 3587 | return ss.formatNumber(this.get_dM(), 'X2');
|
---|
| 3588 | },
|
---|
| 3589 | get_xD: function() {
|
---|
| 3590 | return ss.formatNumber(this.get_dD(), 'X2');
|
---|
| 3591 | },
|
---|
| 3592 | get_YYYYMMDD: function() {
|
---|
| 3593 | return this.get_xY() + this.get_xM() + this.get_xD();
|
---|
| 3594 | },
|
---|
| 3595 | get_yyyymmdd: function() {
|
---|
| 3596 | return ss.formatNumber(this.get_dY(), 'D4') + '/' + ss.formatNumber(this.get_dM(), 'D2') + '/' + ss.formatNumber(this.get_dD(), 'D2');
|
---|
| 3597 | },
|
---|
| 3598 | $dateBoxCreate: function(ele, ev) {
|
---|
| 3599 | $control_UI.toggleClass($(ele).parents().find('.ui-icon-grid'), 'ui-icon-grid', 'ui-icon-calendar');
|
---|
| 3600 | },
|
---|
| 3601 | $getCal: function(i) {
|
---|
| 3602 | var x = 0;
|
---|
| 3603 | if (this.get_value().indexOf('/') !== -1) {
|
---|
| 3604 | var value = this.get_value().split('/');
|
---|
| 3605 | x = parseInt(value[i]);
|
---|
| 3606 | }
|
---|
| 3607 | return x;
|
---|
| 3608 | }
|
---|
| 3609 | }, $control_UITextInput);
|
---|
| 3610 | ss.initClass($control_UICalBox$UIInputDate, $asm, {}, $control_UIObject);
|
---|
| 3611 | ss.initClass($control_UICollapsibleset, $asm, {
|
---|
| 3612 | get_dataInset: function() {
|
---|
| 3613 | return /^\s*true\s*$/i.test(this.object.attr('data-inset'));
|
---|
| 3614 | },
|
---|
| 3615 | set_dataInset: function(value) {
|
---|
| 3616 | this.object.attr('data-inset', value.toString());
|
---|
| 3617 | }
|
---|
| 3618 | }, $control_UIObject);
|
---|
| 3619 | $control_UICollapsibleset.$ctor2.prototype = $control_UICollapsibleset.$ctor1.prototype = $control_UICollapsibleset.prototype;
|
---|
| 3620 | ss.initClass($control_UIDeviceController, $asm, {
|
---|
| 3621 | getUINodeList: function(listitem_click) {
|
---|
| 3622 | var nodelist = new $control_UINodeList(this.deviceController.get_nodeList(), listitem_click);
|
---|
| 3623 | return nodelist.getNodeList();
|
---|
| 3624 | }
|
---|
| 3625 | });
|
---|
| 3626 | ss.initClass($control_UIDeviceController$UIDeviceInfo, $asm, {
|
---|
| 3627 | uiDeviceSet: function(di, Page) {
|
---|
| 3628 | this.di = di;
|
---|
| 3629 | this.page = Page;
|
---|
| 3630 | if (ss.cast(di.get_data(), $ctrlui_WampApiKadecotDevice).protocol === 'arduino') {
|
---|
| 3631 | this.$elements = di.setPin(Page);
|
---|
| 3632 | }
|
---|
| 3633 | else {
|
---|
| 3634 | this.$elements = di.setEchonetlite(Page);
|
---|
| 3635 | }
|
---|
| 3636 | },
|
---|
| 3637 | getPropertys: function() {
|
---|
| 3638 | return $(this.$elements);
|
---|
| 3639 | },
|
---|
| 3640 | getData: function() {
|
---|
| 3641 | var $t1 = this.di.get_properties();
|
---|
| 3642 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 3643 | var dpi = $t1[$t2];
|
---|
| 3644 | if (ss.isValue(dpi.get_data())) {
|
---|
| 3645 | dpi.getValue(dpi.get_data());
|
---|
| 3646 | }
|
---|
| 3647 | }
|
---|
| 3648 | },
|
---|
| 3649 | isWait: function() {
|
---|
| 3650 | var flag = false;
|
---|
| 3651 | if (ss.isValue(this.di) && ss.isValue(this.di.get_properties())) {
|
---|
| 3652 | var $t1 = this.di.get_properties();
|
---|
| 3653 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 3654 | var dpi = $t1[$t2];
|
---|
| 3655 | if (ss.isValue(dpi) && dpi.get_isWaitRes()) {
|
---|
| 3656 | flag = true;
|
---|
| 3657 | }
|
---|
| 3658 | }
|
---|
| 3659 | }
|
---|
| 3660 | return flag;
|
---|
| 3661 | },
|
---|
| 3662 | setEchonetlite: function(ctrlui) {
|
---|
| 3663 | var ele = new Array(this.di.get_properties().length);
|
---|
| 3664 | var i = 0;
|
---|
| 3665 | var $t1 = this.di.get_properties();
|
---|
| 3666 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 3667 | var dpi = $t1[$t2];
|
---|
| 3668 | dpi.setProperty(dpi);
|
---|
| 3669 | dpi.setName(this.di);
|
---|
| 3670 | dpi.setKadecotGet(ss.mkdel(this.page, this.page.kadecotGet$1));
|
---|
| 3671 | dpi.setKadecotSet(ss.mkdel(this.page, this.page.kadecotSet));
|
---|
| 3672 | ele[i++] = dpi.getElement();
|
---|
| 3673 | }
|
---|
| 3674 | return ele;
|
---|
| 3675 | },
|
---|
| 3676 | setPin: function(ctrlui) {
|
---|
| 3677 | this.page = ctrlui;
|
---|
| 3678 | var ele = new Array(20);
|
---|
| 3679 | var element;
|
---|
| 3680 | var j = 0;
|
---|
| 3681 | for (var i = 0; i <= 19; i++) {
|
---|
| 3682 | element = this.setPin$1(i, this.page);
|
---|
| 3683 | ele[j++] = element[0];
|
---|
| 3684 | ele[j++] = element[1];
|
---|
| 3685 | }
|
---|
| 3686 | return ele;
|
---|
| 3687 | },
|
---|
| 3688 | setPin$1: function(i, Page) {
|
---|
| 3689 | var uiPin = new $control_UIPin.$ctor1(i);
|
---|
| 3690 | uiPin.setPinModeChange(ss.mkdel(Page, Page.pinMode_Change));
|
---|
| 3691 | uiPin.setDigitalChange(ss.mkdel(Page, Page.digital_Change));
|
---|
| 3692 | uiPin.setReadButtonClick(ss.mkdel(Page, Page.digitalRead));
|
---|
| 3693 | uiPin.setAnalogWriteChange(ss.mkdel(Page, Page.analogWrite_Change));
|
---|
| 3694 | uiPin.setAnalogReadChange(ss.mkdel(Page, Page.analogRead));
|
---|
| 3695 | return uiPin.getElements();
|
---|
| 3696 | }
|
---|
| 3697 | });
|
---|
| 3698 | ss.initClass($control_UIDeviceController$UIDevicePropertyInfo, $asm, {
|
---|
| 3699 | getElement: function() {
|
---|
| 3700 | return this.$grpbox.object.get(0);
|
---|
| 3701 | },
|
---|
| 3702 | setName: function(di) {
|
---|
| 3703 | var nameid = di.getObjectID() + this.$dpi.getPropertyCode('X2');
|
---|
| 3704 | this.$grpbox.setName(nameid);
|
---|
| 3705 | },
|
---|
| 3706 | get_errorText: function() {
|
---|
| 3707 | return this.$grpbox.get_errorText();
|
---|
| 3708 | },
|
---|
| 3709 | set_errorText: function(value) {
|
---|
| 3710 | this.$grpbox.set_errorText(value);
|
---|
| 3711 | },
|
---|
| 3712 | getMaxLength: function() {
|
---|
| 3713 | var len = 2 * (ss.isNullOrUndefined(this.$dpi.get_propertyInfo()) ? this.$dpi.get_size() : (((this.$dpi.get_propertyInfo().arrayCount === 0) ? 1 : this.$dpi.get_propertyInfo().arrayCount) * this.$dpi.get_propertyInfo().size));
|
---|
| 3714 | return len;
|
---|
| 3715 | },
|
---|
| 3716 | setProperty: function(dpi) {
|
---|
| 3717 | this.$dpi = dpi;
|
---|
| 3718 | this.$grpbox = new $control_UIGrpBox.$ctor1(dpi);
|
---|
| 3719 | },
|
---|
| 3720 | setKadecotGet: function(KadecotGet) {
|
---|
| 3721 | var opeSt = null;
|
---|
| 3722 | //現在時刻設定
|
---|
| 3723 | if (this.$dpi.get_propertyCode() === 151) {
|
---|
| 3724 | }
|
---|
| 3725 | else if (this.$dpi.get_propertyCode() === 152) {
|
---|
| 3726 | }
|
---|
| 3727 | else if (this.$dpi.get_inputTypes().length === 0) {
|
---|
| 3728 | }
|
---|
| 3729 | else if (this.$dpi.get_propertyCode() === 128 && this.$dpi.get_inputTypes().length === 1 && this.$dpi.get_inputTypes()[0].mode === 1) {
|
---|
| 3730 | }
|
---|
| 3731 | else {
|
---|
| 3732 | var $t1 = this.$dpi.get_inputTypes();
|
---|
| 3733 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 3734 | var pii = $t1[$t2];
|
---|
| 3735 | if (this.$dpi.get_propertyCode() === 128) {
|
---|
| 3736 | opeSt = this.$dpi;
|
---|
| 3737 | }
|
---|
| 3738 | }
|
---|
| 3739 | if (ss.isValue(opeSt)) {
|
---|
| 3740 | KadecotGet(opeSt);
|
---|
| 3741 | }
|
---|
| 3742 | }
|
---|
| 3743 | },
|
---|
| 3744 | setKadecotSet: function(KadecotSet) {
|
---|
| 3745 | this.$grpbox.kadecotSet = KadecotSet;
|
---|
| 3746 | },
|
---|
| 3747 | getValue: function(data) {
|
---|
| 3748 | this.$grpbox.setGetValue(data);
|
---|
| 3749 | }
|
---|
| 3750 | });
|
---|
| 3751 | ss.initClass($control_UIDiv, $asm, {}, $control_UIObject);
|
---|
| 3752 | ss.initClass($control_UIEventHandler, $asm, {});
|
---|
| 3753 | ss.initClass($control_UIEventNames, $asm, {});
|
---|
| 3754 | ss.initClass($control_UIFieldContain, $asm, {}, $control_UIObject);
|
---|
| 3755 | $control_UIFieldContain.$ctor1.prototype = $control_UIFieldContain.$ctor2.prototype = $control_UIFieldContain.prototype;
|
---|
| 3756 | ss.initClass($control_UIFieldSet, $asm, {
|
---|
| 3757 | checkdValue: function() {
|
---|
| 3758 | return $("input[type='radio']:checked", this.object).val();
|
---|
| 3759 | },
|
---|
| 3760 | append$2: function(radio) {
|
---|
| 3761 | if (ss.isNullOrUndefined(this.radioList)) {
|
---|
| 3762 | this.radioList = [];
|
---|
| 3763 | }
|
---|
| 3764 | this.radioList.push(new $control_UIFieldSet$RadioInput(radio.label, radio.radio));
|
---|
| 3765 | var last = Enumerable.from(this.radioList).last();
|
---|
| 3766 | this.append(last.label);
|
---|
| 3767 | this.append(last.radio);
|
---|
| 3768 | },
|
---|
| 3769 | get_controlGroup: function() {
|
---|
| 3770 | return this.$_ControlGroup;
|
---|
| 3771 | },
|
---|
| 3772 | set_controlGroup: function(value) {
|
---|
| 3773 | if (value) {
|
---|
| 3774 | this.set_dataRole('controlgroup');
|
---|
| 3775 | }
|
---|
| 3776 | else {
|
---|
| 3777 | this.set_dataRole('');
|
---|
| 3778 | }
|
---|
| 3779 | this.$_ControlGroup = value;
|
---|
| 3780 | },
|
---|
| 3781 | get_horizontal: function() {
|
---|
| 3782 | return this.$_Horizontal;
|
---|
| 3783 | },
|
---|
| 3784 | set_horizontal: function(value) {
|
---|
| 3785 | if (value) {
|
---|
| 3786 | this.set_dataType('horizontal');
|
---|
| 3787 | }
|
---|
| 3788 | else {
|
---|
| 3789 | this.set_dataType('');
|
---|
| 3790 | }
|
---|
| 3791 | this.$_Horizontal = value;
|
---|
| 3792 | }
|
---|
| 3793 | }, $control_UIObject);
|
---|
| 3794 | $control_UIFieldSet.$ctor1.prototype = $control_UIFieldSet.prototype;
|
---|
| 3795 | ss.initClass($control_UIFieldSet$RadioInput, $asm, {});
|
---|
| 3796 | ss.initClass($control_UIFlipSwitch, $asm, {}, $control_UIObject);
|
---|
| 3797 | $control_UIFlipSwitch.$ctor1.prototype = $control_UIFlipSwitch.prototype;
|
---|
| 3798 | ss.initClass($control_UIGridA, $asm, {}, $control_UIObject);
|
---|
| 3799 | ss.initClass($control_UIGridA$UIBlockA, $asm, {}, $control_UIObject);
|
---|
| 3800 | ss.initClass($control_UIGridA$UIBlockB, $asm, {}, $control_UIObject);
|
---|
| 3801 | ss.initClass($control_UIListviewItem, $asm, {}, $control_UIObject);
|
---|
| 3802 | $control_UIListviewItem.$ctor1.prototype = $control_UIListviewItem.prototype;
|
---|
| 3803 | ss.initClass($control_UIGrpBox, $asm, {
|
---|
| 3804 | setFlipSwitch: function() {
|
---|
| 3805 | var psi = ss.cast(this.$dpi.get_inputTypes()[0], $ctrlui_PropertySelectInput);
|
---|
| 3806 | // OFF
|
---|
| 3807 | var off = Enumerable.from(psi.option).first(function(kvp) {
|
---|
| 3808 | return kvp.key === 49;
|
---|
| 3809 | });
|
---|
| 3810 | // ON
|
---|
| 3811 | var on = Enumerable.from(psi.option).first(function(kvp1) {
|
---|
| 3812 | return kvp1.key === 48;
|
---|
| 3813 | });
|
---|
| 3814 | var OFF = new $control_UIOption.$ctor2(off.value, ss.formatNumber(off.key, 'X2'));
|
---|
| 3815 | var ON = new $control_UIOption.$ctor2(on.value, ss.formatNumber(on.key, 'X2'));
|
---|
| 3816 | var Flipswitch = new $control_UIFlipSwitch.$ctor1(OFF, ON);
|
---|
| 3817 | Flipswitch.change$1(ss.thisFix(ss.mkdel(this, this.$flip_Change)));
|
---|
| 3818 | Flipswitch.disable(!$control_UI.isRULE_SET(this.$dpi));
|
---|
| 3819 | this.fieldContain = new $control_UIFieldContain.$ctor2(this.$label, Flipswitch);
|
---|
| 3820 | //FieldContain.Object.Trigger("create");
|
---|
| 3821 | this.append(this.fieldContain);
|
---|
| 3822 | },
|
---|
| 3823 | setDefault: function() {
|
---|
| 3824 | var Textbox = new $control_UITextInput();
|
---|
| 3825 | Textbox.change$1(ss.thisFix(ss.mkdel(this, this.$text_Change)));
|
---|
| 3826 | var value = '';
|
---|
| 3827 | Textbox.set_value(value);
|
---|
| 3828 | this.fieldContain = new $control_UIFieldContain.$ctor2(this.$label, Textbox);
|
---|
| 3829 | this.append(this.fieldContain);
|
---|
| 3830 | },
|
---|
| 3831 | setRange: function(pii) {
|
---|
| 3832 | var range = new $control_UIRangeInput();
|
---|
| 3833 | range.change$1(ss.thisFix(ss.mkdel(this, this.$range_Change)));
|
---|
| 3834 | this.fieldContain = new $control_UIFieldContain.$ctor2(this.$label, range);
|
---|
| 3835 | var value = ss.cast(pii, $ctrlui_PropertyRangeInput).minimum;
|
---|
| 3836 | range.set_value$1(value);
|
---|
| 3837 | range.set_min(ss.cast(pii, $ctrlui_PropertyRangeInput).minimum);
|
---|
| 3838 | range.set_max(ss.cast(pii, $ctrlui_PropertyRangeInput).maximum);
|
---|
| 3839 | this.append$1(this.fieldContain.object).trigger('create');
|
---|
| 3840 | },
|
---|
| 3841 | $range_Change: function(elem, ev) {
|
---|
| 3842 | if (!this.checkValiable()) {
|
---|
| 3843 | return;
|
---|
| 3844 | }
|
---|
| 3845 | ;
|
---|
| 3846 | if (!this.checkHex()) {
|
---|
| 3847 | return;
|
---|
| 3848 | }
|
---|
| 3849 | ;
|
---|
| 3850 | var data = this.get_$byteValue();
|
---|
| 3851 | this.$dpi.set_inputData(data);
|
---|
| 3852 | this.kadecotSet(this.$dpi, data);
|
---|
| 3853 | },
|
---|
| 3854 | $setCalBox: function() {
|
---|
| 3855 | var Textbox = new $control_UICalBox();
|
---|
| 3856 | Textbox.change$1(ss.thisFix(ss.mkdel(this, this.$calbox_Change)));
|
---|
| 3857 | var epi = this.$dpi.get_propertyInfo();
|
---|
| 3858 | this.fieldContain = new $control_UIFieldContain.$ctor2(this.$label, Textbox);
|
---|
| 3859 | var len = this.$dpi.getMaxLength();
|
---|
| 3860 | var valueDescription = '';
|
---|
| 3861 | for (var $t1 = 0; $t1 < epi.fields.length; $t1++) {
|
---|
| 3862 | var jfi = epi.fields[$t1];
|
---|
| 3863 | valueDescription += '【' + jfi.description + ':' + jfi.valueDescription + '】';
|
---|
| 3864 | }
|
---|
| 3865 | Textbox.set_placeholder(this.$dpi.getText());
|
---|
| 3866 | Textbox.set_value('');
|
---|
| 3867 | //Textbox.Disable(!dpi.IsRULE_SET());
|
---|
| 3868 | Textbox.set_readOnly(!$control_UI.isRULE_SET(this.$dpi));
|
---|
| 3869 | Textbox.set_title(valueDescription);
|
---|
| 3870 | this.one('dateboxcreate', ss.thisFix(ss.mkdel(this, this.$calbox_Create)));
|
---|
| 3871 | this.append$1(this.fieldContain.object);
|
---|
| 3872 | },
|
---|
| 3873 | $calbox_Create: function(ele, ev) {
|
---|
| 3874 | var textinput = $(ev.target).parent('.ui-input-datebox');
|
---|
| 3875 | textinput.append(this.backButton.object);
|
---|
| 3876 | this.backButton.click$1(ss.thisFix(ss.mkdel(this, this.$backButtonClick)));
|
---|
| 3877 | },
|
---|
| 3878 | $calbox_Change: function(elem, ev) {
|
---|
| 3879 | var Calbox = ss.cast(this.fieldContain.input, $control_UICalBox);
|
---|
| 3880 | var data = new Array(4);
|
---|
| 3881 | this.removeClass$1();
|
---|
| 3882 | if (!(Calbox.get_dY() >= 1 && Calbox.get_dY() < 9999 && (Calbox.get_dM() >= 1 && Calbox.get_dM() <= 12 && (Calbox.get_dD() >= 1 && Calbox.get_dD() <= 31)))) {
|
---|
| 3883 | this.toggleClass('ecnl_pink', true);
|
---|
| 3884 | }
|
---|
| 3885 | else {
|
---|
| 3886 | data[0] = parseInt(Calbox.get_xY().substr(0, 2), 16);
|
---|
| 3887 | data[1] = parseInt(Calbox.get_xY().substr(2, 2), 16);
|
---|
| 3888 | data[2] = parseInt(Calbox.get_xM(), 16);
|
---|
| 3889 | data[3] = parseInt(Calbox.get_xD(), 16);
|
---|
| 3890 | this.$dpi.set_inputData(data);
|
---|
| 3891 | this.$dpi.set_isWaitRes(true);
|
---|
| 3892 | this.set_class(2);
|
---|
| 3893 | }
|
---|
| 3894 | },
|
---|
| 3895 | $flip_Change: function(elem, ev) {
|
---|
| 3896 | var data = this.get_$byteValue();
|
---|
| 3897 | this.$dpi.set_inputData(data);
|
---|
| 3898 | this.kadecotSet(this.$dpi, data);
|
---|
| 3899 | },
|
---|
| 3900 | $setTextInput: function() {
|
---|
| 3901 | var Textbox = new $control_UITextInput();
|
---|
| 3902 | Textbox.change$1(ss.thisFix(ss.mkdel(this, this.$text_Change)));
|
---|
| 3903 | Textbox.keypress(ss.thisFix(ss.mkdel(this, this.$text_KeyPress)));
|
---|
| 3904 | Textbox.keyup(ss.thisFix(ss.mkdel(this, this.$text_Keyup)));
|
---|
| 3905 | Textbox.on('textinputcreate', ss.thisFix(ss.mkdel(this, this.$text_Create)));
|
---|
| 3906 | var epi = this.$dpi.get_propertyInfo();
|
---|
| 3907 | var valueDescription = '';
|
---|
| 3908 | for (var $t1 = 0; $t1 < epi.fields.length; $t1++) {
|
---|
| 3909 | var jfi = epi.fields[$t1];
|
---|
| 3910 | valueDescription += '【' + jfi.description + ':' + jfi.valueDescription + '】';
|
---|
| 3911 | }
|
---|
| 3912 | Textbox.set_value('');
|
---|
| 3913 | //Textbox.Disable(!dpi.IsRULE_SET());
|
---|
| 3914 | Textbox.set_readOnly(!$control_UI.isRULE_SET(this.$dpi));
|
---|
| 3915 | Textbox.set_maxlength(this.$dpi.getMaxLength());
|
---|
| 3916 | Textbox.set_title(valueDescription);
|
---|
| 3917 | this.fieldContain = new $control_UIFieldContain.$ctor2(this.$label, Textbox);
|
---|
| 3918 | this.append$1(this.fieldContain.object);
|
---|
| 3919 | },
|
---|
| 3920 | $setTimebox: function() {
|
---|
| 3921 | var Textbox = new $control_UITimeBox();
|
---|
| 3922 | Textbox.change$1(ss.thisFix(ss.mkdel(this, this.$timebox_Change$1)));
|
---|
| 3923 | var epi = this.$dpi.get_propertyInfo();
|
---|
| 3924 | this.fieldContain = new $control_UIFieldContain.$ctor2(this.$label, Textbox);
|
---|
| 3925 | var len = this.$dpi.getMaxLength();
|
---|
| 3926 | var valueDescription = '';
|
---|
| 3927 | for (var $t1 = 0; $t1 < epi.fields.length; $t1++) {
|
---|
| 3928 | var jfi = epi.fields[$t1];
|
---|
| 3929 | valueDescription += '【' + jfi.description + ':' + jfi.valueDescription + '】';
|
---|
| 3930 | }
|
---|
| 3931 | Textbox.set_placeholder(this.$dpi.getText());
|
---|
| 3932 | Textbox.set_value('');
|
---|
| 3933 | Textbox.set_title(valueDescription);
|
---|
| 3934 | //Textbox.Disable(!dpi.IsRULE_SET());
|
---|
| 3935 | Textbox.set_readOnly(!$control_UI.isRULE_SET(this.$dpi));
|
---|
| 3936 | this.append(this.fieldContain);
|
---|
| 3937 | this.one('dateboxcreate', ss.thisFix(ss.mkdel(this, this.$timebox_Create)));
|
---|
| 3938 | },
|
---|
| 3939 | $setFieldSet: function(pii) {
|
---|
| 3940 | var FieldSet = new $control_UIFieldSet();
|
---|
| 3941 | var Label = new $control_UILabel();
|
---|
| 3942 | Label.set_text(this.$dpi.getText());
|
---|
| 3943 | FieldSet.set_horizontal(true);
|
---|
| 3944 | FieldSet.change$1(ss.thisFix(ss.mkdel(this, this.$select_Change)));
|
---|
| 3945 | this.fieldContain = new $control_UIFieldContain.$ctor2(Label, FieldSet);
|
---|
| 3946 | var $t1 = ss.cast(pii, $ctrlui_PropertySelectInput).option.getEnumerator();
|
---|
| 3947 | try {
|
---|
| 3948 | while ($t1.moveNext()) {
|
---|
| 3949 | var opt = $t1.current();
|
---|
| 3950 | var Radio = new $control_UIRadioInput.$ctor1(ss.formatNumber(opt.key, 'X'));
|
---|
| 3951 | FieldSet.append$2(new $control_UIFieldSet$RadioInput(new $control_UILabel.$ctor1(opt.value), Radio));
|
---|
| 3952 | }
|
---|
| 3953 | }
|
---|
| 3954 | finally {
|
---|
| 3955 | $t1.dispose();
|
---|
| 3956 | }
|
---|
| 3957 | this.append$1(this.fieldContain.object);
|
---|
| 3958 | },
|
---|
| 3959 | $select_Change: function(elem, ev) {
|
---|
| 3960 | var data = this.get_$byteValue();
|
---|
| 3961 | this.$dpi.set_inputData(data);
|
---|
| 3962 | this.kadecotSet(this.$dpi, data);
|
---|
| 3963 | },
|
---|
| 3964 | $timebox_Change$1: function(ele, ev) {
|
---|
| 3965 | this.removeClass$1();
|
---|
| 3966 | if (this.get_changed()) {
|
---|
| 3967 | this.$timebox_Change();
|
---|
| 3968 | }
|
---|
| 3969 | },
|
---|
| 3970 | $timebox_Change: function() {
|
---|
| 3971 | var value = this.fieldContain.input.get_value();
|
---|
| 3972 | var val = value.split(':');
|
---|
| 3973 | var data = new Array(2);
|
---|
| 3974 | data[0] = parseInt(val[0], 10);
|
---|
| 3975 | data[1] = parseInt(val[1], 10);
|
---|
| 3976 | var hex = ss.formatNumber(data[0], 'X2') + ss.formatNumber(data[1], 'X2');
|
---|
| 3977 | this.removeClass$1();
|
---|
| 3978 | this.$dpi.set_inputData(data);
|
---|
| 3979 | this.$dpi.set_isWaitRes(true);
|
---|
| 3980 | this.toggleClass('ecnl_light_green', true);
|
---|
| 3981 | },
|
---|
| 3982 | $timebox_Create: function(ele, ev) {
|
---|
| 3983 | var textinput = $(ev.target).parent('.ui-input-datebox');
|
---|
| 3984 | textinput.append(this.backButton.object);
|
---|
| 3985 | this.backButton.click$1(ss.thisFix(ss.mkdel(this, this.$backButtonClick)));
|
---|
| 3986 | },
|
---|
| 3987 | $text_Keyup: function(elem, ev) {
|
---|
| 3988 | $(elem).change();
|
---|
| 3989 | },
|
---|
| 3990 | $text_Create: function(elem, ev) {
|
---|
| 3991 | var textinput = $(ev.target).parent('.ui-input-text');
|
---|
| 3992 | textinput.append(this.backButton.object);
|
---|
| 3993 | this.backButton.click$1(ss.thisFix(ss.mkdel(this, this.$backButtonClick)));
|
---|
| 3994 | },
|
---|
| 3995 | $text_KeyPress: function(elem, ev) {
|
---|
| 3996 | var number = ev.which >= 48 && ev.which <= 57;
|
---|
| 3997 | var lower = ev.which >= 97 && ev.which <= 102;
|
---|
| 3998 | var upper = ev.which >= 65 && ev.which <= 70;
|
---|
| 3999 | var BackSpace = ev.which === 8;
|
---|
| 4000 | var Delete = ev.which === 0;
|
---|
| 4001 | var flag = !number && !lower && (!BackSpace && !Delete) && !upper;
|
---|
| 4002 | if (flag) {
|
---|
| 4003 | ev.preventDefault();
|
---|
| 4004 | }
|
---|
| 4005 | },
|
---|
| 4006 | $backButtonClick: function(elem, ev) {
|
---|
| 4007 | this.fieldContain.input.set_value(this.toText(this.getValue));
|
---|
| 4008 | this.fieldContain.input.object.change();
|
---|
| 4009 | },
|
---|
| 4010 | $text_Change: function(elem, ev) {
|
---|
| 4011 | if (this.get_changed()) {
|
---|
| 4012 | this.removeClass$1();
|
---|
| 4013 | if (!this.checkValiable()) {
|
---|
| 4014 | return;
|
---|
| 4015 | }
|
---|
| 4016 | ;
|
---|
| 4017 | if (!this.checkHex()) {
|
---|
| 4018 | return;
|
---|
| 4019 | }
|
---|
| 4020 | ;
|
---|
| 4021 | this.$setDpi();
|
---|
| 4022 | }
|
---|
| 4023 | },
|
---|
| 4024 | get_$inputType: function() {
|
---|
| 4025 | return ss.getInstanceType(this.fieldContain.input);
|
---|
| 4026 | },
|
---|
| 4027 | $toByteValue: function() {
|
---|
| 4028 | var Value = this.fieldContain.input.get_value();
|
---|
| 4029 | var data = new Array(ss.Int32.div(Value.length, 2));
|
---|
| 4030 | for (var i = 0, j = 0; j < Value.length; j += 2) {
|
---|
| 4031 | data[i++] = parseInt(Value.substr(j, 2), 16);
|
---|
| 4032 | }
|
---|
| 4033 | return data;
|
---|
| 4034 | },
|
---|
| 4035 | $setDpi: function() {
|
---|
| 4036 | this.$dpi.set_inputData(this.get_$byteValue());
|
---|
| 4037 | this.$dpi.set_isWaitRes(true);
|
---|
| 4038 | this.set_errorText('');
|
---|
| 4039 | this.toggleClass((this.$user ? 'ecnl_light_green' : 'ecnl_light_blue'), true);
|
---|
| 4040 | },
|
---|
| 4041 | get_$byteValue: function() {
|
---|
| 4042 | return this.$toByteValue();
|
---|
| 4043 | },
|
---|
| 4044 | get_errorText: function() {
|
---|
| 4045 | return this.$liAside.get_text();
|
---|
| 4046 | },
|
---|
| 4047 | set_errorText: function(value) {
|
---|
| 4048 | this.$liAside.set_text(value);
|
---|
| 4049 | },
|
---|
| 4050 | removeClass$1: function() {
|
---|
| 4051 | this.set_errorText('');
|
---|
| 4052 | this.backButton.hide();
|
---|
| 4053 | this.removeClass('ecnl_pink');
|
---|
| 4054 | this.removeClass('ecnl_violet');
|
---|
| 4055 | this.removeClass('ecnl_light_green');
|
---|
| 4056 | this.removeClass('ecnl_light_blue');
|
---|
| 4057 | },
|
---|
| 4058 | setName: function(nameid) {
|
---|
| 4059 | var name = nameid;
|
---|
| 4060 | if (ss.referenceEquals(this.get_$inputType(), $control_UICalBox)) {
|
---|
| 4061 | name = 'cal_' + nameid;
|
---|
| 4062 | }
|
---|
| 4063 | else if (ss.referenceEquals(this.get_$inputType(), $control_UITimeBox)) {
|
---|
| 4064 | name = 'tmb_' + nameid;
|
---|
| 4065 | }
|
---|
| 4066 | else if (ss.referenceEquals(this.get_$inputType(), $control_UITextInput)) {
|
---|
| 4067 | name = 'txt_' + nameid;
|
---|
| 4068 | }
|
---|
| 4069 | else if (ss.referenceEquals(this.get_$inputType(), $control_UIRadioInput)) {
|
---|
| 4070 | name = 'rng_' + nameid;
|
---|
| 4071 | }
|
---|
| 4072 | else if (ss.referenceEquals(this.get_$inputType(), $control_UIFlipSwitch)) {
|
---|
| 4073 | name = 'flp_' + nameid;
|
---|
| 4074 | var Flipswitch = ss.cast(this.fieldContain.input, $control_UIFlipSwitch);
|
---|
| 4075 | var val0 = Flipswitch.OFF.get_value();
|
---|
| 4076 | var val1 = Flipswitch.ON.get_value();
|
---|
| 4077 | Flipswitch.OFF.set_id(name + val0);
|
---|
| 4078 | Flipswitch.ON.set_id(name + val1);
|
---|
| 4079 | }
|
---|
| 4080 | else if (ss.referenceEquals(this.get_$inputType(), $control_UIFieldSet)) {
|
---|
| 4081 | name = 'sel_' + nameid;
|
---|
| 4082 | var FieldSet = ss.cast(this.fieldContain.input, $control_UIFieldSet);
|
---|
| 4083 | FieldSet.set_id(name);
|
---|
| 4084 | for (var i = 0; i < FieldSet.radioList.length; i++) {
|
---|
| 4085 | var id = name + FieldSet.radioList[i].radio.get_value();
|
---|
| 4086 | FieldSet.radioList[i].radio.set_name(name);
|
---|
| 4087 | FieldSet.radioList[i].radio.set_id(id);
|
---|
| 4088 | FieldSet.radioList[i].label.set_for(id);
|
---|
| 4089 | }
|
---|
| 4090 | }
|
---|
| 4091 | this.fieldContain.label.set_for(name);
|
---|
| 4092 | this.fieldContain.input.set_id(name);
|
---|
| 4093 | this.fieldContain.input.set_name(name);
|
---|
| 4094 | },
|
---|
| 4095 | checkHex: function() {
|
---|
| 4096 | var Value = this.fieldContain.input.get_value();
|
---|
| 4097 | if (!(new RegExp('^([0-9A-Fa-f][0-9A-Fa-f])+$')).test(Value)) {
|
---|
| 4098 | this.set_errorText('16進数で入力してください');
|
---|
| 4099 | this.toggleClass('ecnl_pink', true);
|
---|
| 4100 | return false;
|
---|
| 4101 | }
|
---|
| 4102 | return true;
|
---|
| 4103 | },
|
---|
| 4104 | checkValiable: function() {
|
---|
| 4105 | var epi = this.$dpi.get_propertyInfo();
|
---|
| 4106 | //可変長データの場合
|
---|
| 4107 | var valiable = this.$dpi.isValiable();
|
---|
| 4108 | var len = this.$dpi.getMaxLength();
|
---|
| 4109 | var Value = this.fieldContain.input.get_value();
|
---|
| 4110 | var length = Value.length !== len && (!valiable || Value.length > len);
|
---|
| 4111 | if (Value.length !== len && (!valiable || Value.length > len)) {
|
---|
| 4112 | this.set_errorText(len.toString() + '文字で入力してください');
|
---|
| 4113 | this.toggleClass((this.$user ? 'ecnl_pink' : 'ecnl_violet'), true);
|
---|
| 4114 | return false;
|
---|
| 4115 | }
|
---|
| 4116 | return true;
|
---|
| 4117 | },
|
---|
| 4118 | toTextDefault: function(data) {
|
---|
| 4119 | var value = '';
|
---|
| 4120 | if (ss.isNullOrUndefined(data)) {
|
---|
| 4121 | return '';
|
---|
| 4122 | }
|
---|
| 4123 | for (var i = 0; i < data.length; i++) {
|
---|
| 4124 | value += ss.formatNumber(data[i], 'X2');
|
---|
| 4125 | }
|
---|
| 4126 | return value;
|
---|
| 4127 | },
|
---|
| 4128 | toTextTimeBox: function(data) {
|
---|
| 4129 | var str = this.toTextDefault(data);
|
---|
| 4130 | if (str.length === 4) {
|
---|
| 4131 | var h = parseInt('0x' + str.substr(0, 2));
|
---|
| 4132 | var m = parseInt('0x' + str.substr(2, 2));
|
---|
| 4133 | return ss.formatNumber(h, 'D2') + ':' + ss.formatNumber(m, 'D2');
|
---|
| 4134 | }
|
---|
| 4135 | else {
|
---|
| 4136 | return '';
|
---|
| 4137 | }
|
---|
| 4138 | },
|
---|
| 4139 | toTextCal: function(data) {
|
---|
| 4140 | var str = this.toText(data);
|
---|
| 4141 | if (str.length === 8) {
|
---|
| 4142 | var y = parseInt('0x' + str.substr(0, 4));
|
---|
| 4143 | var m = parseInt('0x' + str.substr(4, 2));
|
---|
| 4144 | var d = parseInt('0x' + str.substr(6, 2));
|
---|
| 4145 | if (y < 1 || m < 1 || d < 1) {
|
---|
| 4146 | return ss.formatNumber(y, 'D4') + '/' + ss.formatNumber(m, 'D2') + '/' + ss.formatNumber(m, 'D2');
|
---|
| 4147 | }
|
---|
| 4148 | var date = new Date(y, m - 1, d);
|
---|
| 4149 | return ss.formatDate(date, 'yyyy/MM/dd');
|
---|
| 4150 | }
|
---|
| 4151 | else {
|
---|
| 4152 | return '';
|
---|
| 4153 | }
|
---|
| 4154 | },
|
---|
| 4155 | toText: function(data) {
|
---|
| 4156 | if (ss.isNullOrUndefined(data)) {
|
---|
| 4157 | return '';
|
---|
| 4158 | }
|
---|
| 4159 | if (ss.equals(ss.getInstanceType(this.fieldContain.input), $control_UITimeBox)) {
|
---|
| 4160 | return this.toTextTimeBox(data);
|
---|
| 4161 | }
|
---|
| 4162 | else if (ss.equals(ss.getInstanceType(this.fieldContain.input), $control_UICalBox)) {
|
---|
| 4163 | return this.toTextCal(data);
|
---|
| 4164 | }
|
---|
| 4165 | else {
|
---|
| 4166 | return this.toTextDefault(data);
|
---|
| 4167 | }
|
---|
| 4168 | },
|
---|
| 4169 | get_changed: function() {
|
---|
| 4170 | return !ss.equalsT(this.fieldContain.input.get_value(), this.toText(this.getValue));
|
---|
| 4171 | },
|
---|
| 4172 | grpBoxChange: function(ele, ev) {
|
---|
| 4173 | this.backButton.toggle(this.get_changed());
|
---|
| 4174 | if (!this.get_changed()) {
|
---|
| 4175 | this.$dpi.set_isWaitRes(false);
|
---|
| 4176 | this.$dpi.set_inputData(null);
|
---|
| 4177 | this.removeClass$1();
|
---|
| 4178 | }
|
---|
| 4179 | },
|
---|
| 4180 | setGetValue: function(data) {
|
---|
| 4181 | this.removeClass$1();
|
---|
| 4182 | this.getValue = data;
|
---|
| 4183 | this.fieldContain.input.set_value(this.toText(data));
|
---|
| 4184 | this.fieldContain.input.change();
|
---|
| 4185 | }
|
---|
| 4186 | }, $control_UIListviewItem);
|
---|
| 4187 | $control_UIGrpBox.$ctor1.prototype = $control_UIGrpBox.prototype;
|
---|
| 4188 | ss.initClass($control_UIH, $asm, {}, $control_UIObject);
|
---|
| 4189 | $control_UIH.$ctor1.prototype = $control_UIH.$ctor2.prototype = $control_UIH.prototype;
|
---|
| 4190 | ss.initClass($control_UIImg, $asm, {}, $control_UIObject);
|
---|
| 4191 | $control_UIImg.$ctor1.prototype = $control_UIImg.$ctor2.prototype = $control_UIImg.prototype;
|
---|
| 4192 | ss.initClass($control_UILabel, $asm, {}, $control_UIObject);
|
---|
| 4193 | $control_UILabel.$ctor1.prototype = $control_UILabel.$ctor3.prototype = $control_UILabel.$ctor4.prototype = $control_UILabel.$ctor2.prototype = $control_UILabel.prototype;
|
---|
| 4194 | ss.initClass($control_UILi, $asm, {}, $control_UIObject);
|
---|
| 4195 | ss.initClass($control_UIListDivider, $asm, {}, $control_UIListviewItem);
|
---|
| 4196 | $control_UIListDivider.$ctor1.prototype = $control_UIListDivider.$ctor2.prototype = $control_UIListDivider.$ctor3.prototype = $control_UIListDivider.prototype;
|
---|
| 4197 | ss.initClass($control_UIListview, $asm, {}, $control_UIObject);
|
---|
| 4198 | $control_UIListview.$ctor1.prototype = $control_UIListview.prototype;
|
---|
| 4199 | ss.initClass($control_UINodeList, $asm, {
|
---|
| 4200 | getNodeList: function() {
|
---|
| 4201 | return this.$info.children();
|
---|
| 4202 | },
|
---|
| 4203 | $listitem_Click: function(listitem, item) {
|
---|
| 4204 | //選択中クラスの追加
|
---|
| 4205 | $('.li-select').removeClass('li-select');
|
---|
| 4206 | listitem.addClass('li-select');
|
---|
| 4207 | }
|
---|
| 4208 | });
|
---|
| 4209 | ss.initEnum($control_UIObject$EcnlClass, $asm, { ecnl_pink: 0, ecnl_violet: 1, ecnl_light_green: 2, ecnl_light_blue: 3 });
|
---|
| 4210 | ss.initClass($control_UIOption, $asm, {}, $control_UIObject);
|
---|
| 4211 | $control_UIOption.$ctor2.prototype = $control_UIOption.$ctor1.prototype = $control_UIOption.prototype;
|
---|
| 4212 | ss.initClass($control_UIP, $asm, {}, $control_UIObject);
|
---|
| 4213 | $control_UIP.$ctor1.prototype = $control_UIP.$ctor2.prototype = $control_UIP.prototype;
|
---|
| 4214 | ss.initClass($control_UIPin, $asm, {
|
---|
| 4215 | $setUIPinMode: function(i) {
|
---|
| 4216 | this.uiPinMode.append(new $control_UILabel.$ctor4('INPUT', 'input' + i.toString(), 'pin' + i.toString()));
|
---|
| 4217 | this.uiPinMode.append(new $control_UIRadioInput.$ctor3('input' + i.toString(), 'pin' + i.toString(), 'INPUT'));
|
---|
| 4218 | this.uiPinMode.append(new $control_UILabel.$ctor4('OUTPUT', 'output' + i.toString(), 'pin' + i.toString()));
|
---|
| 4219 | this.uiPinMode.append(new $control_UIRadioInput.$ctor3('output' + i.toString(), 'pin' + i.toString(), 'OUTPUT'));
|
---|
| 4220 | this.uiPinMode.append(new $control_UILabel.$ctor4('INPUT_PULLUP', 'input_pullup' + i.toString(), 'pin' + i.toString()));
|
---|
| 4221 | this.uiPinMode.append(new $control_UIRadioInput.$ctor3('input_pullup' + i.toString(), 'pin' + i.toString(), 'INPUT_PULLUP'));
|
---|
| 4222 | return this.uiPinMode;
|
---|
| 4223 | },
|
---|
| 4224 | $setUIDigital: function(i) {
|
---|
| 4225 | },
|
---|
| 4226 | $setUIRange: function(i) {
|
---|
| 4227 | this.range = new $control_UIRangeInput.$ctor1(-1, 255);
|
---|
| 4228 | this.range.set_value$1(123);
|
---|
| 4229 | },
|
---|
| 4230 | $setAnalogRead: function(i) {
|
---|
| 4231 | this.analogRead = new $control_UIRangeInput.$ctor1(0, 1023);
|
---|
| 4232 | this.analogRead.handle = false;
|
---|
| 4233 | },
|
---|
| 4234 | getElements: function() {
|
---|
| 4235 | var elements = new Array(2);
|
---|
| 4236 | elements[0] = this.listDivider.get_element();
|
---|
| 4237 | elements[1] = this.get_element();
|
---|
| 4238 | return elements;
|
---|
| 4239 | },
|
---|
| 4240 | setPinModeChange: function(eventhandler) {
|
---|
| 4241 | if (ss.isValue(this.uiPinMode)) {
|
---|
| 4242 | this.uiPinMode.change$1(ss.thisFix(ss.mkdel(this, function(elem, ev) {
|
---|
| 4243 | eventhandler(this.uiPinMode, this.pin);
|
---|
| 4244 | })));
|
---|
| 4245 | }
|
---|
| 4246 | },
|
---|
| 4247 | setDigitalChange: function(eventhandler) {
|
---|
| 4248 | if (ss.isValue(this.flipSwitch)) {
|
---|
| 4249 | this.flipSwitch.change$1(ss.thisFix(ss.mkdel(this, function(elem, ev) {
|
---|
| 4250 | eventhandler(this.readButton, this.flipSwitch, this.pin);
|
---|
| 4251 | })));
|
---|
| 4252 | }
|
---|
| 4253 | },
|
---|
| 4254 | setReadButtonClick: function(eventhandler) {
|
---|
| 4255 | if (ss.isValue(this.flipSwitch)) {
|
---|
| 4256 | this.readButton.click$1(ss.thisFix(ss.mkdel(this, function(elem, ev) {
|
---|
| 4257 | eventhandler(this.readButton, this.flipSwitch, this.pin);
|
---|
| 4258 | })));
|
---|
| 4259 | }
|
---|
| 4260 | },
|
---|
| 4261 | setAnalogWriteChange: function(eventhandler) {
|
---|
| 4262 | if (ss.isValue(this.range)) {
|
---|
| 4263 | this.range.change$1(ss.thisFix(ss.mkdel(this, function(elem, ev) {
|
---|
| 4264 | eventhandler(this.range, this.pin);
|
---|
| 4265 | })));
|
---|
| 4266 | }
|
---|
| 4267 | },
|
---|
| 4268 | setAnalogReadChange: function(eventhandler) {
|
---|
| 4269 | if (ss.isValue(this.analogRead)) {
|
---|
| 4270 | this.readButton.click$1(ss.thisFix(ss.mkdel(this, function(elem, ev) {
|
---|
| 4271 | eventhandler(this.analogRead, this.pin);
|
---|
| 4272 | })));
|
---|
| 4273 | }
|
---|
| 4274 | }
|
---|
| 4275 | }, $control_UILi);
|
---|
| 4276 | $control_UIPin.$ctor1.prototype = $control_UIPin.prototype;
|
---|
| 4277 | ss.initClass($control_UIRadioInput, $asm, {}, $control_UIObject);
|
---|
| 4278 | $control_UIRadioInput.$ctor2.prototype = $control_UIRadioInput.$ctor3.prototype = $control_UIRadioInput.$ctor1.prototype = $control_UIRadioInput.prototype;
|
---|
| 4279 | ss.initClass($control_UIRangeInput, $asm, {
|
---|
| 4280 | $getMaxLength: function() {
|
---|
| 4281 | var min = 0;
|
---|
| 4282 | var j;
|
---|
| 4283 | if (this.get_min() < 0) {
|
---|
| 4284 | min = 1;
|
---|
| 4285 | j = -10;
|
---|
| 4286 | while (ss.Int32.div(this.get_max(), j) > 1) {
|
---|
| 4287 | min++;
|
---|
| 4288 | j *= 10;
|
---|
| 4289 | }
|
---|
| 4290 | min++;
|
---|
| 4291 | }
|
---|
| 4292 | var i = 1;
|
---|
| 4293 | j = 10;
|
---|
| 4294 | while (ss.Int32.div(this.get_max(), j) >= 1) {
|
---|
| 4295 | i++;
|
---|
| 4296 | j *= 10;
|
---|
| 4297 | }
|
---|
| 4298 | return ((i > min) ? i : min);
|
---|
| 4299 | },
|
---|
| 4300 | get_$dataHighlight: function() {
|
---|
| 4301 | return /^\s*true\s*$/i.test(this.getAttribute('data-highlight'));
|
---|
| 4302 | },
|
---|
| 4303 | set_$dataHighlight: function(value) {
|
---|
| 4304 | this.attribute$1('data-highlight', value.toString());
|
---|
| 4305 | },
|
---|
| 4306 | get_value$1: function() {
|
---|
| 4307 | if (this.get_value() === '') {
|
---|
| 4308 | this.set_value$1(this.get_min());
|
---|
| 4309 | }
|
---|
| 4310 | return parseInt(this.get_value());
|
---|
| 4311 | },
|
---|
| 4312 | set_value$1: function(value) {
|
---|
| 4313 | this.set_value(value.toString());
|
---|
| 4314 | },
|
---|
| 4315 | $sliderKeypress: function(ele, ev) {
|
---|
| 4316 | var number = ev.which >= 48 && ev.which <= 57;
|
---|
| 4317 | var BackSpace = ev.which === 8;
|
---|
| 4318 | var Delete = ev.which === 0;
|
---|
| 4319 | var minus = ev.which === 45;
|
---|
| 4320 | var flag = !number && !minus && (!BackSpace && !Delete);
|
---|
| 4321 | if (flag) {
|
---|
| 4322 | ev.preventDefault();
|
---|
| 4323 | }
|
---|
| 4324 | },
|
---|
| 4325 | $sliderCreate: function(ele, ev) {
|
---|
| 4326 | this.sliderHandle = new $control_UIRangeInput$UIHandle(ev);
|
---|
| 4327 | this.sliderHandle.toggle(this.handle);
|
---|
| 4328 | var SliderTrack = new $control_UIRangeInput$UISliderTrack(ev);
|
---|
| 4329 | SliderTrack.pointerEvents(this.handle);
|
---|
| 4330 | this.pointerEvents(this.handle);
|
---|
| 4331 | }
|
---|
| 4332 | }, $control_UIObject);
|
---|
| 4333 | $control_UIRangeInput.$ctor1.prototype = $control_UIRangeInput.prototype;
|
---|
| 4334 | ss.initClass($control_UIRangeInput$UIHandle, $asm, {}, $control_UIObject);
|
---|
| 4335 | ss.initClass($control_UIRangeInput$UISliderTrack, $asm, {}, $control_UIObject);
|
---|
| 4336 | ss.initClass($control_UITimeBox, $asm, {
|
---|
| 4337 | $dateBoxCreate: function(ele, ev) {
|
---|
| 4338 | $control_UI.toggleClass($(ele).parents().find('.ui-icon-grid'), 'ui-icon-grid', 'ui-icon-clock');
|
---|
| 4339 | }
|
---|
| 4340 | }, $control_UITextInput);
|
---|
| 4341 | ss.initEnum($ctrlui_$State, $asm, { $value: 0, $equalOrRange: 1, $description: 2, $unitOrCommaOrEnd: 3, $rengeMax: 4, $startParenthesis: 5, $rangeDescription: 6, $minDescription: 7, $rangeSeparetor: 8, $maxDescription: 9, $endParenthesis: 10, $commaOrEnd: 11, $bitFieldLSB: 12, $bitRange: 13, $bitFieldMSB: 14, $bitFieldDescription: 15, $bitRangeEnd: 16, $colon: 17 });
|
---|
| 4342 | ss.initClass($ctrlui_$TokenInfo, $asm, {
|
---|
| 4343 | toString: function() {
|
---|
| 4344 | return this.$token;
|
---|
| 4345 | },
|
---|
| 4346 | $toInt32: function() {
|
---|
| 4347 | switch (this.$type) {
|
---|
| 4348 | case 1: {
|
---|
| 4349 | return parseInt(this.$token.substring(2), 16);
|
---|
| 4350 | }
|
---|
| 4351 | case 2: {
|
---|
| 4352 | return parseInt(this.$token);
|
---|
| 4353 | }
|
---|
| 4354 | default: {
|
---|
| 4355 | return 0;
|
---|
| 4356 | }
|
---|
| 4357 | }
|
---|
| 4358 | },
|
---|
| 4359 | $toInt64: function(typeName) {
|
---|
| 4360 | var temp;
|
---|
| 4361 | switch (this.$type) {
|
---|
| 4362 | case 1: {
|
---|
| 4363 | temp = this.$token.substring(2);
|
---|
| 4364 | return parseInt(temp, 16);
|
---|
| 4365 | }
|
---|
| 4366 | case 2: {
|
---|
| 4367 | return parseInt(this.$token);
|
---|
| 4368 | }
|
---|
| 4369 | default: {
|
---|
| 4370 | return 0;
|
---|
| 4371 | }
|
---|
| 4372 | }
|
---|
| 4373 | }
|
---|
| 4374 | });
|
---|
| 4375 | ss.initEnum($ctrlui_$TokenType, $asm, { $separetor: 0, $hexValue: 1, $numeric: 2, $string: 3, $end: 4 });
|
---|
| 4376 | ss.initClass($ctrlui_$ValueSet, $asm, {});
|
---|
| 4377 | ss.initClass($ctrlui_Value, $asm, { get_disp: null, getInitialValue: null });
|
---|
| 4378 | ss.initClass($ctrlui_BitField, $asm, {
|
---|
| 4379 | get_least: function() {
|
---|
| 4380 | return this.$_Least;
|
---|
| 4381 | },
|
---|
| 4382 | get_most: function() {
|
---|
| 4383 | return this.$_Most;
|
---|
| 4384 | },
|
---|
| 4385 | get_disp: function() {
|
---|
| 4386 | return this.$_Disp;
|
---|
| 4387 | },
|
---|
| 4388 | get_values: function() {
|
---|
| 4389 | return this.$_Values;
|
---|
| 4390 | },
|
---|
| 4391 | get_ranges: function() {
|
---|
| 4392 | return this.$_Ranges;
|
---|
| 4393 | },
|
---|
| 4394 | get_initailValue: function() {
|
---|
| 4395 | return this.$_InitailValue;
|
---|
| 4396 | },
|
---|
| 4397 | getInitialValue: function() {
|
---|
| 4398 | if (ss.isNullOrUndefined(this.$_InitailValue)) {
|
---|
| 4399 | return '';
|
---|
| 4400 | }
|
---|
| 4401 | return this.$_InitailValue.getInitialValue();
|
---|
| 4402 | },
|
---|
| 4403 | $addValue: function(option) {
|
---|
| 4404 | if (ss.isNullOrUndefined(this.$_InitailValue)) {
|
---|
| 4405 | this.$_InitailValue = option;
|
---|
| 4406 | }
|
---|
| 4407 | this.$_Values.push(option);
|
---|
| 4408 | },
|
---|
| 4409 | $addRange: function(range) {
|
---|
| 4410 | if (ss.isNullOrUndefined(this.$_InitailValue)) {
|
---|
| 4411 | this.$_InitailValue = range;
|
---|
| 4412 | }
|
---|
| 4413 | this.$_Ranges.push(range);
|
---|
| 4414 | },
|
---|
| 4415 | $isInRange: function(val64) {
|
---|
| 4416 | for (var $t1 = 0; $t1 < this.$_Values.length; $t1++) {
|
---|
| 4417 | var val = this.$_Values[$t1];
|
---|
| 4418 | if (val.get_val() !== val64) {
|
---|
| 4419 | continue;
|
---|
| 4420 | }
|
---|
| 4421 | return true;
|
---|
| 4422 | }
|
---|
| 4423 | for (var $t2 = 0; $t2 < this.$_Ranges.length; $t2++) {
|
---|
| 4424 | var rng = this.$_Ranges[$t2];
|
---|
| 4425 | if (rng.get_min() > val64 || rng.get_max() < val64) {
|
---|
| 4426 | continue;
|
---|
| 4427 | }
|
---|
| 4428 | return true;
|
---|
| 4429 | }
|
---|
| 4430 | return false;
|
---|
| 4431 | },
|
---|
| 4432 | $getInRangeValue: function(val64) {
|
---|
| 4433 | for (var $t1 = 0; $t1 < this.$_Values.length; $t1++) {
|
---|
| 4434 | var val = this.$_Values[$t1];
|
---|
| 4435 | if (val.get_val() !== val64) {
|
---|
| 4436 | continue;
|
---|
| 4437 | }
|
---|
| 4438 | return val;
|
---|
| 4439 | }
|
---|
| 4440 | for (var $t2 = 0; $t2 < this.$_Ranges.length; $t2++) {
|
---|
| 4441 | var rng = this.$_Ranges[$t2];
|
---|
| 4442 | if (rng.get_min() > val64 || rng.get_max() < val64) {
|
---|
| 4443 | continue;
|
---|
| 4444 | }
|
---|
| 4445 | return new $ctrlui_InRangeValue(rng, val64);
|
---|
| 4446 | }
|
---|
| 4447 | return null;
|
---|
| 4448 | }
|
---|
| 4449 | }, $ctrlui_Value);
|
---|
| 4450 | ss.initClass($ctrlui_BitFiledsValue, $asm, {
|
---|
| 4451 | get_disp: function() {
|
---|
| 4452 | return '';
|
---|
| 4453 | },
|
---|
| 4454 | getInitialValue: function() {
|
---|
| 4455 | return this.$_Value.toString(16).toUpperCase();
|
---|
| 4456 | }
|
---|
| 4457 | }, $ctrlui_Value);
|
---|
| 4458 | ss.initClass($ctrlui_DeviceController, $asm, {
|
---|
| 4459 | get_nodeList: function() {
|
---|
| 4460 | return this.$m_NodeList;
|
---|
| 4461 | },
|
---|
| 4462 | recvResponse: function(response) {
|
---|
| 4463 | var ni = {};
|
---|
| 4464 | var di = {};
|
---|
| 4465 | this.$getDevice(response.sender, response.seoj, ni, di);
|
---|
| 4466 | if (ss.isNullOrUndefined(ni.$)) {
|
---|
| 4467 | return false;
|
---|
| 4468 | }
|
---|
| 4469 | if (ss.isNullOrUndefined(di.$)) {
|
---|
| 4470 | return false;
|
---|
| 4471 | }
|
---|
| 4472 | for (var $t1 = 0; $t1 < response.properties.length; $t1++) {
|
---|
| 4473 | var prop = response.properties[$t1];
|
---|
| 4474 | if (prop.edt.length > 0) {
|
---|
| 4475 | //プロパティ値を採用
|
---|
| 4476 | di.$.$setPropertyData(prop.epc, prop.$getEdt());
|
---|
| 4477 | }
|
---|
| 4478 | else {
|
---|
| 4479 | // プロパティ値書き込み応答の場合
|
---|
| 4480 | if (response.esv === 113) {
|
---|
| 4481 | // 入力値を採用
|
---|
| 4482 | di.$.$adoptInputData(prop.epc);
|
---|
| 4483 | }
|
---|
| 4484 | }
|
---|
| 4485 | }
|
---|
| 4486 | return true;
|
---|
| 4487 | },
|
---|
| 4488 | recvResponse$1: function(di, esv, epc, edt) {
|
---|
| 4489 | if (edt.length > 0) {
|
---|
| 4490 | // プロパティ値を設定
|
---|
| 4491 | di.$setPropertyData(epc, edt);
|
---|
| 4492 | }
|
---|
| 4493 | else {
|
---|
| 4494 | // プロパティ値書き込み応答の場合
|
---|
| 4495 | if (esv === 113) {
|
---|
| 4496 | // 入力値を採用
|
---|
| 4497 | di.$adoptInputData(epc);
|
---|
| 4498 | }
|
---|
| 4499 | }
|
---|
| 4500 | },
|
---|
| 4501 | $getDevice: function(nodid, eoj, nod, obj) {
|
---|
| 4502 | obj.$ = null;
|
---|
| 4503 | nod.$ = this.$findNode(nodid);
|
---|
| 4504 | if (ss.isValue(nod.$)) {
|
---|
| 4505 | // ノードプロファイルの場合
|
---|
| 4506 | if (eoj.get_x1() === 14 && eoj.get_x2() === 240) {
|
---|
| 4507 | obj.$ = nod.$.get_profile();
|
---|
| 4508 | }
|
---|
| 4509 | else {
|
---|
| 4510 | obj.$ = this.$findDevice(nod.$, eoj);
|
---|
| 4511 | }
|
---|
| 4512 | }
|
---|
| 4513 | },
|
---|
| 4514 | $findNode: function(enodid) {
|
---|
| 4515 | var ni = null;
|
---|
| 4516 | switch (enodid) {
|
---|
| 4517 | case 0:
|
---|
| 4518 | case 1: {
|
---|
| 4519 | ni = this.$m_NodeList[0];
|
---|
| 4520 | break;
|
---|
| 4521 | }
|
---|
| 4522 | default: {
|
---|
| 4523 | ni = Enumerable.from(this.$m_NodeList).firstOrDefault(function(p) {
|
---|
| 4524 | return p.get_nodeId() === enodid;
|
---|
| 4525 | }, ss.getDefaultValue($ctrlui_DeviceController$NodeInfo));
|
---|
| 4526 | break;
|
---|
| 4527 | }
|
---|
| 4528 | }
|
---|
| 4529 | return ni;
|
---|
| 4530 | },
|
---|
| 4531 | $findDevice: function(ni, eoj) {
|
---|
| 4532 | var $t1 = ni.get_devices();
|
---|
| 4533 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 4534 | var di = $t1[$t2];
|
---|
| 4535 | if (di.get_classGroupCode() === eoj.get_x1() && di.get_classCode() === eoj.get_x2() && di.get_instanceCode() === eoj.get_x3()) {
|
---|
| 4536 | return di;
|
---|
| 4537 | }
|
---|
| 4538 | }
|
---|
| 4539 | return null;
|
---|
| 4540 | }
|
---|
| 4541 | }, $control_UIDeviceController);
|
---|
| 4542 | ss.initClass($ctrlui_DeviceController$DeviceInfo, $asm, {
|
---|
| 4543 | get_classInfo: function() {
|
---|
| 4544 | return this.$m_ClassInfo;
|
---|
| 4545 | },
|
---|
| 4546 | get_profile: function() {
|
---|
| 4547 | return this.$m_Profile;
|
---|
| 4548 | },
|
---|
| 4549 | get_classGroupCode: function() {
|
---|
| 4550 | return this.$m_ClassGroupCode;
|
---|
| 4551 | },
|
---|
| 4552 | get_classCode: function() {
|
---|
| 4553 | return this.$m_ClassCode;
|
---|
| 4554 | },
|
---|
| 4555 | get_instanceCode: function() {
|
---|
| 4556 | return this.$m_InstanceCode;
|
---|
| 4557 | },
|
---|
| 4558 | get_properties: function() {
|
---|
| 4559 | return this.$m_Properties;
|
---|
| 4560 | },
|
---|
| 4561 | get_eObjId: function() {
|
---|
| 4562 | return this.$m_EObjId;
|
---|
| 4563 | },
|
---|
| 4564 | get_data: function() {
|
---|
| 4565 | return this.$2$DataField;
|
---|
| 4566 | },
|
---|
| 4567 | set_data: function(value) {
|
---|
| 4568 | this.$2$DataField = value;
|
---|
| 4569 | },
|
---|
| 4570 | getText: function() {
|
---|
| 4571 | if (ss.isValue(this.$m_ClassInfo)) {
|
---|
| 4572 | return this.$m_ClassInfo.description;
|
---|
| 4573 | }
|
---|
| 4574 | else {
|
---|
| 4575 | return ss.formatString('{0:X2}{1:X2}{2:X2}', this.$m_ClassGroupCode, this.$m_ClassCode, this.$m_InstanceCode);
|
---|
| 4576 | }
|
---|
| 4577 | },
|
---|
| 4578 | $setPropertyData: function(epc, edt) {
|
---|
| 4579 | var dpi = Enumerable.from(this.$m_Properties).firstOrDefault(function(p) {
|
---|
| 4580 | return p.get_propertyCode() === epc;
|
---|
| 4581 | }, ss.getDefaultValue($ctrlui_DeviceController$DevicePropertyInfo));
|
---|
| 4582 | if (ss.isNullOrUndefined(dpi)) {
|
---|
| 4583 | return;
|
---|
| 4584 | }
|
---|
| 4585 | dpi.setPropertyData(edt);
|
---|
| 4586 | },
|
---|
| 4587 | $adoptInputData: function(epc) {
|
---|
| 4588 | var dpi = Enumerable.from(this.$m_Properties).firstOrDefault(function(p) {
|
---|
| 4589 | return p.get_propertyCode() === epc;
|
---|
| 4590 | }, ss.getDefaultValue($ctrlui_DeviceController$DevicePropertyInfo));
|
---|
| 4591 | if (ss.isNullOrUndefined(dpi)) {
|
---|
| 4592 | return;
|
---|
| 4593 | }
|
---|
| 4594 | dpi.adoptInputData();
|
---|
| 4595 | },
|
---|
| 4596 | getObjectID: function() {
|
---|
| 4597 | var text = ss.formatNumber(this.get_classGroupCode(), 'X2') + ss.formatNumber(this.get_classCode(), 'X2') + ss.formatNumber(this.get_instanceCode(), 'X2');
|
---|
| 4598 | return text;
|
---|
| 4599 | },
|
---|
| 4600 | setUIDevice: function(page) {
|
---|
| 4601 | this.uiDeviceSet(this, page);
|
---|
| 4602 | }
|
---|
| 4603 | }, $control_UIDeviceController$UIDeviceInfo);
|
---|
| 4604 | $ctrlui_DeviceController$DeviceInfo.$ctor2.prototype = $ctrlui_DeviceController$DeviceInfo.$ctor1.prototype = $ctrlui_DeviceController$DeviceInfo.prototype;
|
---|
| 4605 | ss.initClass($ctrlui_DeviceController$DevicePropertyInfo, $asm, {
|
---|
| 4606 | get_propertyInfo: function() {
|
---|
| 4607 | return this.$m_PropertyInfo;
|
---|
| 4608 | },
|
---|
| 4609 | get_propertyCode: function() {
|
---|
| 4610 | return this.$m_PropertyCode;
|
---|
| 4611 | },
|
---|
| 4612 | getPropertyCode: function(format) {
|
---|
| 4613 | return ss.formatNumber(this.get_propertyCode(), format);
|
---|
| 4614 | },
|
---|
| 4615 | isValiable: function() {
|
---|
| 4616 | return (ss.isNullOrUndefined(this.get_propertyInfo()) ? true : ss.contains(this.get_propertyInfo().access, 'VARIABLE'));
|
---|
| 4617 | },
|
---|
| 4618 | get_flag: function() {
|
---|
| 4619 | return this.$m_Flag;
|
---|
| 4620 | },
|
---|
| 4621 | get_size: function() {
|
---|
| 4622 | return this.$m_Size;
|
---|
| 4623 | },
|
---|
| 4624 | getText: function() {
|
---|
| 4625 | if (ss.isValue(this.$m_PropertyInfo)) {
|
---|
| 4626 | return this.$m_PropertyInfo.description;
|
---|
| 4627 | }
|
---|
| 4628 | else {
|
---|
| 4629 | return ss.formatString('{0:X2}', this.$m_PropertyCode);
|
---|
| 4630 | }
|
---|
| 4631 | },
|
---|
| 4632 | get_inputData: function() {
|
---|
| 4633 | return this.$2$InputDataField;
|
---|
| 4634 | },
|
---|
| 4635 | set_inputData: function(value) {
|
---|
| 4636 | this.$2$InputDataField = value;
|
---|
| 4637 | },
|
---|
| 4638 | get_data: function() {
|
---|
| 4639 | return this.$m_Data;
|
---|
| 4640 | },
|
---|
| 4641 | get_isWaitRes: function() {
|
---|
| 4642 | return this.$2$IsWaitResField;
|
---|
| 4643 | },
|
---|
| 4644 | set_isWaitRes: function(value) {
|
---|
| 4645 | this.$2$IsWaitResField = value;
|
---|
| 4646 | },
|
---|
| 4647 | get_inputTypes: function() {
|
---|
| 4648 | return this.$m_InputTypes;
|
---|
| 4649 | },
|
---|
| 4650 | setPropertyData: function(edt) {
|
---|
| 4651 | this.$m_Data = edt;
|
---|
| 4652 | },
|
---|
| 4653 | adoptInputData: function() {
|
---|
| 4654 | this.$m_Data = this.get_inputData();
|
---|
| 4655 | this.set_inputData(null);
|
---|
| 4656 | },
|
---|
| 4657 | prepareInputInfo: function() {
|
---|
| 4658 | if (ss.isValue(this.$m_InputTypes)) {
|
---|
| 4659 | return;
|
---|
| 4660 | }
|
---|
| 4661 | this.$m_InputTypes = [];
|
---|
| 4662 | var epi = this.$m_PropertyInfo;
|
---|
| 4663 | if (ss.isNullOrUndefined(epi) || !epi.primitive) {
|
---|
| 4664 | return;
|
---|
| 4665 | }
|
---|
| 4666 | var valueRange = $ctrlui_ValueRange.parse(epi.valueDescription, epi);
|
---|
| 4667 | if (!ss.isNullOrEmptyString(epi.initialValue)) {
|
---|
| 4668 | valueRange.set_initailValue(epi.initialValue);
|
---|
| 4669 | }
|
---|
| 4670 | if (valueRange.get_values().length > 0) {
|
---|
| 4671 | var pii;
|
---|
| 4672 | pii = new $ctrlui_PropertySelectInput();
|
---|
| 4673 | var $t1 = valueRange.get_values();
|
---|
| 4674 | for (var $t2 = 0; $t2 < $t1.length; $t2++) {
|
---|
| 4675 | var option = $t1[$t2];
|
---|
| 4676 | pii.option.add(option.get_val(), option.get_disp());
|
---|
| 4677 | }
|
---|
| 4678 | this.$m_InputTypes.push(pii);
|
---|
| 4679 | }
|
---|
| 4680 | var $t3 = valueRange.get_ranges();
|
---|
| 4681 | for (var $t4 = 0; $t4 < $t3.length; $t4++) {
|
---|
| 4682 | var range = $t3[$t4];
|
---|
| 4683 | var pii1;
|
---|
| 4684 | pii1 = new $ctrlui_PropertyRangeInput();
|
---|
| 4685 | pii1.minimum = range.get_min();
|
---|
| 4686 | pii1.maximum = range.get_max();
|
---|
| 4687 | pii1.minDescrption = range.get_minDisp();
|
---|
| 4688 | pii1.maxDescrption = range.get_maxDisp();
|
---|
| 4689 | this.$m_InputTypes.push(pii1);
|
---|
| 4690 | }
|
---|
| 4691 | }
|
---|
| 4692 | }, $control_UIDeviceController$UIDevicePropertyInfo);
|
---|
| 4693 | $ctrlui_DeviceController$DevicePropertyInfo.$ctor1.prototype = $ctrlui_DeviceController$DevicePropertyInfo.prototype;
|
---|
| 4694 | ss.initClass($ctrlui_DeviceController$NodeInfo, $asm, {
|
---|
| 4695 | get_nodeId: function() {
|
---|
| 4696 | return this.$m_NodeId;
|
---|
| 4697 | },
|
---|
| 4698 | get_profile: function() {
|
---|
| 4699 | return this.$m_Profile;
|
---|
| 4700 | },
|
---|
| 4701 | get_devices: function() {
|
---|
| 4702 | return this.$m_Devices;
|
---|
| 4703 | },
|
---|
| 4704 | get_data: function() {
|
---|
| 4705 | return this.$1$DataField;
|
---|
| 4706 | },
|
---|
| 4707 | set_data: function(value) {
|
---|
| 4708 | this.$1$DataField = value;
|
---|
| 4709 | }
|
---|
| 4710 | });
|
---|
| 4711 | ss.initEnum($ctrlui_ENOD_ID, $asm, { noT_MATCH_ID: -1, multicasT_ID: 0, locaL_ID: 1, apI_ID: 2, remotE_ID: 3, tablE_NUM: 100 });
|
---|
| 4712 | ss.initEnum($ctrlui_EPC_FLAG, $asm, { NONE: 0, rulE_SET: 1, rulE_GET: 2, rulE_ANNO: 4, ANNOUNCE: 64, VARIABLE: 128 });
|
---|
| 4713 | ss.initClass($ctrlui_Information, $asm, {
|
---|
| 4714 | update: function(ele, id) {
|
---|
| 4715 | var page = $CtrlUI.getPage(ele);
|
---|
| 4716 | this.$info = $('#' + id, page);
|
---|
| 4717 | if (ss.isNullOrUndefined(this.$info)) {
|
---|
| 4718 | return;
|
---|
| 4719 | }
|
---|
| 4720 | $.ajax('./' + id + '.json').success(ss.mkdel(this, this.$success)).error(ss.mkdel(this, this.$error));
|
---|
| 4721 | },
|
---|
| 4722 | $success: function(data, textStatus, request) {
|
---|
| 4723 | var items = ss.cast((ss.referenceEquals(ss.getInstanceType(data), String) ? $.parseJSON(ss.cast(data, String)) : data), Array);
|
---|
| 4724 | var listview = (new $control_UIListview.$ctor1(['data-inset', true, 'data-theme', 'b'])).object;
|
---|
| 4725 | listview.append((new $control_UIListDivider.$ctor1('ソフトウェア情報')).object);
|
---|
| 4726 | for (var $t1 = 0; $t1 < items.length; $t1++) {
|
---|
| 4727 | var item = items[$t1];
|
---|
| 4728 | var title = ss.cast(item.title, String);
|
---|
| 4729 | var version = ss.cast(item.version, String);
|
---|
| 4730 | var link = ss.cast(item.link, String);
|
---|
| 4731 | var note = ss.cast(item.note, String);
|
---|
| 4732 | var a;
|
---|
| 4733 | if (ss.isNullOrEmptyString(link)) {
|
---|
| 4734 | a = new $control_UIAnchor.$ctor2(new $control_UIH.$ctor2(2, title));
|
---|
| 4735 | a.set_href('#');
|
---|
| 4736 | }
|
---|
| 4737 | else {
|
---|
| 4738 | a = new $control_UIAnchor.$ctor2(new $control_UIH.$ctor2(2, title));
|
---|
| 4739 | a.set_href(link);
|
---|
| 4740 | a.set_target('_blank');
|
---|
| 4741 | }
|
---|
| 4742 | a.append(new $control_UIP.$ctor1('Version ' + version));
|
---|
| 4743 | if (!ss.isNullOrEmptyString(note)) {
|
---|
| 4744 | a.append(new $control_UIP.$ctor1(note));
|
---|
| 4745 | }
|
---|
| 4746 | listview.append((new $control_UIListviewItem.$ctor1(a)).object);
|
---|
| 4747 | }
|
---|
| 4748 | var anchor = new $control_UIAnchor();
|
---|
| 4749 | anchor.set_target('_blank');
|
---|
| 4750 | anchor.set_href('http://www.core-s.co.jp');
|
---|
| 4751 | anchor.append$1((new $control_UIImg.$ctor2(['src', 'imgs/core-s.svg'])).object).append('コアーズ株式会社');
|
---|
| 4752 | var listitem = (new $control_UIListDivider.$ctor2(anchor)).object;
|
---|
| 4753 | listview.append(listitem);
|
---|
| 4754 | this.$info.html('');
|
---|
| 4755 | this.$info.append(listview);
|
---|
| 4756 | $('ul', this.$info).listview().listview('refresh');
|
---|
| 4757 | this.$info.popup('reposition', { positionTo: 'origin' });
|
---|
| 4758 | },
|
---|
| 4759 | $error: function(request, textStatus, error) {
|
---|
| 4760 | var listview = (new $control_UIListview.$ctor1(['data-inset', 'true', 'data-theme', 'b'])).object;
|
---|
| 4761 | listview.append((new $control_UIListDivider.$ctor1('ソフトウェア情報')).object);
|
---|
| 4762 | listview.append((new $control_UIListviewItem.$ctor1(new $control_UIP.$ctor1('通信エラー'))).object);
|
---|
| 4763 | this.$info.append(listview);
|
---|
| 4764 | $('ul', this.$info).listview().listview('refresh');
|
---|
| 4765 | this.$info.popup('reposition', { positionTo: 'origin' });
|
---|
| 4766 | }
|
---|
| 4767 | });
|
---|
| 4768 | ss.initClass($ctrlui_InRangeValue, $asm, {
|
---|
| 4769 | get_range: function() {
|
---|
| 4770 | return this.$_Range;
|
---|
| 4771 | },
|
---|
| 4772 | get_value: function() {
|
---|
| 4773 | return this.$_Value;
|
---|
| 4774 | },
|
---|
| 4775 | get_disp: function() {
|
---|
| 4776 | return this.$_Range.getDisp(this.$_Value);
|
---|
| 4777 | },
|
---|
| 4778 | getInitialValue: function() {
|
---|
| 4779 | return this.$_Value.toString(16).toUpperCase();
|
---|
| 4780 | }
|
---|
| 4781 | }, $ctrlui_Value);
|
---|
| 4782 | ss.initClass($ctrlui_JsonClassGroupInfo, $asm, {});
|
---|
| 4783 | ss.initClass($ctrlui_JsonClassInfo, $asm, {});
|
---|
| 4784 | ss.initClass($ctrlui_JsonFieldInfo, $asm, {});
|
---|
| 4785 | ss.initClass($ctrlui_JsonObjectInfo, $asm, {
|
---|
| 4786 | findProperty: function(epc) {
|
---|
| 4787 | for (var $t1 = 0; $t1 < this.properties.length; $t1++) {
|
---|
| 4788 | var item = this.properties[$t1];
|
---|
| 4789 | if (item.propertyCode === epc) {
|
---|
| 4790 | return item;
|
---|
| 4791 | }
|
---|
| 4792 | }
|
---|
| 4793 | return null;
|
---|
| 4794 | }
|
---|
| 4795 | });
|
---|
| 4796 | ss.initClass($ctrlui_JsonNodeInfo, $asm, {}, $ctrlui_JsonObjectInfo);
|
---|
| 4797 | ss.initClass($ctrlui_JsonPropertyInfo, $asm, {}, $ctrlui_JsonFieldInfo);
|
---|
| 4798 | $ctrlui_JsonPropertyInfo.$ctor1.prototype = $ctrlui_JsonPropertyInfo.prototype;
|
---|
| 4799 | ss.initClass($ctrlui_JsonSkeltonResult, $asm, {});
|
---|
| 4800 | ss.initClass($ctrlui_Option, $asm, {
|
---|
| 4801 | get_val: function() {
|
---|
| 4802 | return this.$_Val;
|
---|
| 4803 | },
|
---|
| 4804 | get_disp: function() {
|
---|
| 4805 | return this.$_Disp;
|
---|
| 4806 | },
|
---|
| 4807 | getInitialValue: function() {
|
---|
| 4808 | return this.$_Val.toString(16).toUpperCase();
|
---|
| 4809 | }
|
---|
| 4810 | }, $ctrlui_Value);
|
---|
| 4811 | ss.initClass($ctrlui_PropertyInputInfo, $asm, {});
|
---|
| 4812 | ss.initEnum($ctrlui_PropertyInputMode, $asm, { unknown: 0, select: 1, range: 2 });
|
---|
| 4813 | ss.initClass($ctrlui_PropertyRangeInput, $asm, {}, $ctrlui_PropertyInputInfo);
|
---|
| 4814 | ss.initClass($ctrlui_PropertySelectInput, $asm, {}, $ctrlui_PropertyInputInfo);
|
---|
| 4815 | ss.initClass($ctrlui_Range, $asm, {
|
---|
| 4816 | get_min: function() {
|
---|
| 4817 | return this.$_Min;
|
---|
| 4818 | },
|
---|
| 4819 | get_max: function() {
|
---|
| 4820 | return this.$_Max;
|
---|
| 4821 | },
|
---|
| 4822 | get_disp: function() {
|
---|
| 4823 | return this.$_Disp;
|
---|
| 4824 | },
|
---|
| 4825 | get_minDisp: function() {
|
---|
| 4826 | return this.$_MinDisp;
|
---|
| 4827 | },
|
---|
| 4828 | get_maxDisp: function() {
|
---|
| 4829 | return this.$_MaxDisp;
|
---|
| 4830 | },
|
---|
| 4831 | get_unit: function() {
|
---|
| 4832 | return this.$_Unit;
|
---|
| 4833 | },
|
---|
| 4834 | get_initialValue: function() {
|
---|
| 4835 | return this.$_InitialValue;
|
---|
| 4836 | },
|
---|
| 4837 | set_initialValue: function(value) {
|
---|
| 4838 | this.$_InitialValue = value;
|
---|
| 4839 | },
|
---|
| 4840 | getInitialValue: function() {
|
---|
| 4841 | return this.$_InitialValue.toString(16).toUpperCase();
|
---|
| 4842 | },
|
---|
| 4843 | getDisp: function(value) {
|
---|
| 4844 | return this.$_Disp + value.toString() + this.$_Unit;
|
---|
| 4845 | }
|
---|
| 4846 | }, $ctrlui_Value);
|
---|
| 4847 | $ctrlui_Range.$ctor1.prototype = $ctrlui_Range.prototype;
|
---|
| 4848 | ss.initClass($ctrlui_T_ECN_EOJ, $asm, {
|
---|
| 4849 | get_x1: function() {
|
---|
| 4850 | return this.$_eoj[0];
|
---|
| 4851 | },
|
---|
| 4852 | set_x1: function(value) {
|
---|
| 4853 | this.$_eoj[0] = value;
|
---|
| 4854 | },
|
---|
| 4855 | get_x2: function() {
|
---|
| 4856 | return this.$_eoj[1];
|
---|
| 4857 | },
|
---|
| 4858 | set_x2: function(value) {
|
---|
| 4859 | this.$_eoj[1] = value;
|
---|
| 4860 | },
|
---|
| 4861 | get_x3: function() {
|
---|
| 4862 | return this.$_eoj[2];
|
---|
| 4863 | },
|
---|
| 4864 | set_x3: function(value) {
|
---|
| 4865 | this.$_eoj[2] = value;
|
---|
| 4866 | }
|
---|
| 4867 | });
|
---|
| 4868 | ss.initClass($ctrlui_ValueRange, $asm, {
|
---|
| 4869 | get_values: function() {
|
---|
| 4870 | return this.$_Values;
|
---|
| 4871 | },
|
---|
| 4872 | get_ranges: function() {
|
---|
| 4873 | return this.$_Ranges;
|
---|
| 4874 | },
|
---|
| 4875 | get_bitFields: function() {
|
---|
| 4876 | return this.$_BitFields;
|
---|
| 4877 | },
|
---|
| 4878 | get_memberFields: function() {
|
---|
| 4879 | return this.$_MemberFields;
|
---|
| 4880 | },
|
---|
| 4881 | get_initailValue: function() {
|
---|
| 4882 | if (ss.isNullOrUndefined(this.$_InitailValue)) {
|
---|
| 4883 | return '';
|
---|
| 4884 | }
|
---|
| 4885 | return this.$_InitailValue.getInitialValue();
|
---|
| 4886 | },
|
---|
| 4887 | set_initailValue: function(value) {
|
---|
| 4888 | var val64 = parseInt(value);
|
---|
| 4889 | for (var $t1 = 0; $t1 < this.$_Values.length; $t1++) {
|
---|
| 4890 | var val = this.$_Values[$t1];
|
---|
| 4891 | if (val.get_val() !== val64) {
|
---|
| 4892 | continue;
|
---|
| 4893 | }
|
---|
| 4894 | this.$_InitailValue = val;
|
---|
| 4895 | return;
|
---|
| 4896 | }
|
---|
| 4897 | for (var $t2 = 0; $t2 < this.$_Ranges.length; $t2++) {
|
---|
| 4898 | var rng = this.$_Ranges[$t2];
|
---|
| 4899 | if (rng.get_min() > val64 || rng.get_max() < val64) {
|
---|
| 4900 | continue;
|
---|
| 4901 | }
|
---|
| 4902 | this.$_InitailValue = new $ctrlui_InRangeValue(rng, val64);
|
---|
| 4903 | return;
|
---|
| 4904 | }
|
---|
| 4905 | if (this.$_BitFields.length > 0) {
|
---|
| 4906 | var ok = true;
|
---|
| 4907 | var bitFlds = [];
|
---|
| 4908 | for (var $t3 = 0; $t3 < this.$_BitFields.length; $t3++) {
|
---|
| 4909 | var bit = this.$_BitFields[$t3];
|
---|
| 4910 | if (!bit.$isInRange(val64)) {
|
---|
| 4911 | ok = false;
|
---|
| 4912 | break;
|
---|
| 4913 | }
|
---|
| 4914 | bitFlds.push(bit.$getInRangeValue(val64));
|
---|
| 4915 | }
|
---|
| 4916 | if (ok) {
|
---|
| 4917 | this.$_InitailValue = new $ctrlui_BitFiledsValue(Array.prototype.slice.call(this.$_BitFields), Array.prototype.slice.call(bitFlds), val64);
|
---|
| 4918 | return;
|
---|
| 4919 | }
|
---|
| 4920 | }
|
---|
| 4921 | }
|
---|
| 4922 | });
|
---|
| 4923 | ss.initClass($ctrlui_WampApiKadecotDevice, $asm, {});
|
---|
| 4924 | ss.initClass($ctrlui_WampApiKadecotGet, $asm, {
|
---|
| 4925 | $getOption: function() {
|
---|
| 4926 | return '{"deviceId":' + this.deviceId.toString() + '}';
|
---|
| 4927 | },
|
---|
| 4928 | $getArguments: function() {
|
---|
| 4929 | return '{"propertyName":"' + this.propertyName + '"}';
|
---|
| 4930 | }
|
---|
| 4931 | });
|
---|
| 4932 | ss.initClass($ctrlui_WampApiKadecotRes, $asm, {});
|
---|
| 4933 | ss.initClass($ctrlui_WampApiKadecotSet, $asm, {
|
---|
| 4934 | $getOption: function() {
|
---|
| 4935 | return '{"deviceId":' + this.deviceId.toString() + '}';
|
---|
| 4936 | },
|
---|
| 4937 | $getArguments: function() {
|
---|
| 4938 | return '{"propertyName":"' + this.propertyName + '","propertyValue":' + JSON.stringify(this.propertyValue) + '}';
|
---|
| 4939 | }
|
---|
| 4940 | });
|
---|
| 4941 | ss.initClass($ctrlui_WebApiEchonetMessage, $asm, {});
|
---|
| 4942 | ss.initClass($ctrlui_WebApiGet, $asm, {
|
---|
| 4943 | addEpc: function(epc) {
|
---|
| 4944 | this.properties.push(new $ctrlui_WebApiPropertyCode(epc));
|
---|
| 4945 | },
|
---|
| 4946 | getJson: function() {
|
---|
| 4947 | return '{"esv_get":' + JSON.stringify(this) + '}';
|
---|
| 4948 | },
|
---|
| 4949 | getOption: function() {
|
---|
| 4950 | return '{"deviceId":' + this.deojid.toString() + '}';
|
---|
| 4951 | },
|
---|
| 4952 | getArguments: function() {
|
---|
| 4953 | return JSON.stringify(this);
|
---|
| 4954 | }
|
---|
| 4955 | });
|
---|
| 4956 | $ctrlui_WebApiGet.$ctor1.prototype = $ctrlui_WebApiGet.prototype;
|
---|
| 4957 | ss.initClass($ctrlui_WebApiGrsaguraMessage, $asm, {});
|
---|
| 4958 | ss.initClass($ctrlui_WebApiObjectInfo, $asm, {});
|
---|
| 4959 | ss.initClass($ctrlui_WebApiPropertyCode, $asm, {});
|
---|
| 4960 | $ctrlui_WebApiPropertyCode.$ctor1.prototype = $ctrlui_WebApiPropertyCode.prototype;
|
---|
| 4961 | ss.initClass($ctrlui_WebApiPropertyData, $asm, {
|
---|
| 4962 | $setEdt: function(_edt) {
|
---|
| 4963 | var sb = new ss.StringBuilder();
|
---|
| 4964 | for (var $t1 = 0; $t1 < _edt.length; $t1++) {
|
---|
| 4965 | var b = _edt[$t1];
|
---|
| 4966 | sb.append(ss.formatNumber(b, 'X2'));
|
---|
| 4967 | }
|
---|
| 4968 | return sb.toString();
|
---|
| 4969 | },
|
---|
| 4970 | $getEdt: function() {
|
---|
| 4971 | var result = new Array(ss.Int32.div(this.edt.length, 2));
|
---|
| 4972 | for (var i = 0, j = 0; j < this.edt.length; i++, j += 2) {
|
---|
| 4973 | result[i] = parseInt(this.edt.substr(j, 2), 16);
|
---|
| 4974 | }
|
---|
| 4975 | return result;
|
---|
| 4976 | }
|
---|
| 4977 | });
|
---|
| 4978 | $ctrlui_WebApiPropertyData.$ctor1.prototype = $ctrlui_WebApiPropertyData.prototype;
|
---|
| 4979 | ss.initClass($ctrlui_WebApiPropertyInfo, $asm, {});
|
---|
| 4980 | ss.initClass($ctrlui_WebApiSet, $asm, {
|
---|
| 4981 | addEdt: function(epc, edt) {
|
---|
| 4982 | this.properties.push(new $ctrlui_WebApiPropertyData.$ctor1(epc, edt));
|
---|
| 4983 | },
|
---|
| 4984 | getJson: function() {
|
---|
| 4985 | return '{"esv_set":' + JSON.stringify(this) + '}';
|
---|
| 4986 | },
|
---|
| 4987 | getOption: function() {
|
---|
| 4988 | return '{"deviceId":' + this.deojid.toString() + '}';
|
---|
| 4989 | },
|
---|
| 4990 | getArguments: function() {
|
---|
| 4991 | return JSON.stringify(this);
|
---|
| 4992 | }
|
---|
| 4993 | });
|
---|
| 4994 | $ctrlui_WebApiSet.$ctor1.prototype = $ctrlui_WebApiSet.prototype;
|
---|
| 4995 | ss.initClass($ctrlui_WebApiSetGet, $asm, {
|
---|
| 4996 | addEdt: function(epc, edt) {
|
---|
| 4997 | this.setProperties.push(new $ctrlui_WebApiPropertyData.$ctor1(epc, edt));
|
---|
| 4998 | },
|
---|
| 4999 | addEpc: function(epc) {
|
---|
| 5000 | this.getProperties.push(new $ctrlui_WebApiPropertyCode(epc));
|
---|
| 5001 | },
|
---|
| 5002 | getJson: function() {
|
---|
| 5003 | return '{"esv_set_get":' + JSON.stringify(this) + '}';
|
---|
| 5004 | },
|
---|
| 5005 | getOption: function() {
|
---|
| 5006 | return '{"deviceId":' + this.deojid.toString() + '}';
|
---|
| 5007 | },
|
---|
| 5008 | getArguments: function() {
|
---|
| 5009 | return JSON.stringify(this);
|
---|
| 5010 | }
|
---|
| 5011 | });
|
---|
| 5012 | $ctrlui_WebApiSetGet.$ctor1.prototype = $ctrlui_WebApiSetGet.prototype;
|
---|
| 5013 | ss.initEnum($Kadecot_WAMP_MSG_TYPE, $asm, { HELLO: 1, WELCOME: 2, ABORT: 3, CHALLENGE: 4, AUTHENTICATE: 5, GOODBYE: 6, HEARTBEAT: 7, ERROR: 8, PUBLISH: 16, PUBLISHED: 17, SUBSCRIBE: 32, SUBSCRIBED: 33, UNSUBSCRIBE: 34, UNSUBSCRIBED: 35, EVENT: 36, CALL: 48, CANCEL: 49, RESULT: 50, REGISTER: 64, REGISTERED: 65, UNREGISTER: 66, UNREGISTERED: 67, INVOCATION: 68, INTERRUPT: 69, YIELD: 70 });
|
---|
| 5014 | ss.initClass($Kadecot_WampClient, $asm, {
|
---|
| 5015 | connect: function(serverIp) {
|
---|
| 5016 | if (this.$on_open_flag) {
|
---|
| 5017 | return;
|
---|
| 5018 | }
|
---|
| 5019 | if (!ss.isNullOrEmptyString(serverIp)) {
|
---|
| 5020 | this.$url = serverIp;
|
---|
| 5021 | //port : 41314
|
---|
| 5022 | }
|
---|
| 5023 | else {
|
---|
| 5024 | this.$url = 'ws://localhost:8080/';
|
---|
| 5025 | }
|
---|
| 5026 | this.$webSocket = new WebSocket(this.$url, this.$plotocols);
|
---|
| 5027 | //webSocket.Origin = origin;
|
---|
| 5028 | this.$webSocket.onopen = ss.delegateCombine(this.$webSocket.onopen, ss.mkdel(this, this.onOpen));
|
---|
| 5029 | this.$webSocket.onmessage = ss.delegateCombine(this.$webSocket.onmessage, ss.mkdel(this, this.onMessage));
|
---|
| 5030 | this.$webSocket.onclose = ss.delegateCombine(this.$webSocket.onclose, ss.mkdel(this, this.onClose));
|
---|
| 5031 | this.$webSocket.onerror = ss.delegateCombine(this.$webSocket.onerror, ss.mkdel(this, this.onError));
|
---|
| 5032 | //webSocket.Connect();
|
---|
| 5033 | },
|
---|
| 5034 | disconnect: function() {
|
---|
| 5035 | this.$webSocket.close();
|
---|
| 5036 | },
|
---|
| 5037 | addOpenCallback: function(callback) {
|
---|
| 5038 | this.$wampClientCore.set_openCallback(callback);
|
---|
| 5039 | },
|
---|
| 5040 | deleteOpenCallback: function() {
|
---|
| 5041 | this.$wampClientCore.deleteOpenCallback();
|
---|
| 5042 | },
|
---|
| 5043 | addCloseCallback: function(callback) {
|
---|
| 5044 | this.$wampClientCore.set_closeCallback(callback);
|
---|
| 5045 | },
|
---|
| 5046 | deleteCloseCallback: function() {
|
---|
| 5047 | this.$wampClientCore.deleteCloseCallback();
|
---|
| 5048 | },
|
---|
| 5049 | addGoodbyeCallback: function(callback) {
|
---|
| 5050 | this.$wampClientCore.set_goodbyeCallback(callback);
|
---|
| 5051 | },
|
---|
| 5052 | deleteGoodbyeCallback: function() {
|
---|
| 5053 | this.$wampClientCore.deleteGoodbyeCallback();
|
---|
| 5054 | },
|
---|
| 5055 | addHeartbeatCallback: function(callback) {
|
---|
| 5056 | this.$wampClientCore.set_heartbeatCallback(callback);
|
---|
| 5057 | },
|
---|
| 5058 | deleteHeartbeatCallback: function() {
|
---|
| 5059 | this.$wampClientCore.deleteHeartbeatCallback();
|
---|
| 5060 | },
|
---|
| 5061 | addInvocationCallback: function(request, callback) {
|
---|
| 5062 | this.$wampClientCore.get_invocationCallback().set_item(request, callback);
|
---|
| 5063 | },
|
---|
| 5064 | deleteInvocationCallback: function(request) {
|
---|
| 5065 | this.$wampClientCore.deleteInvocationCallback(request);
|
---|
| 5066 | },
|
---|
| 5067 | sendHello: function(realm, details, callback) {
|
---|
| 5068 | //serialize
|
---|
| 5069 | var data;
|
---|
| 5070 | data = $Kadecot_WampSerializer.createHello(realm, details);
|
---|
| 5071 | //encrypt data
|
---|
| 5072 | //set callback
|
---|
| 5073 | this.$wampClientCore.set_helloCallback(callback);
|
---|
| 5074 | //send data
|
---|
| 5075 | if (this.$on_open_flag === true) {
|
---|
| 5076 | this.$webSocket.send(data);
|
---|
| 5077 | }
|
---|
| 5078 | else {
|
---|
| 5079 | return null;
|
---|
| 5080 | }
|
---|
| 5081 | return data;
|
---|
| 5082 | },
|
---|
| 5083 | sendAuthenticate: function(signature, extra, callback) {
|
---|
| 5084 | //serialize
|
---|
| 5085 | var data;
|
---|
| 5086 | data = $Kadecot_WampSerializer.createAuthenticate(signature, extra);
|
---|
| 5087 | //encrypt data
|
---|
| 5088 | //set callback
|
---|
| 5089 | this.$wampClientCore.set_authenticateCallback(callback);
|
---|
| 5090 | //send data
|
---|
| 5091 | if (this.$on_open_flag) {
|
---|
| 5092 | this.$webSocket.send(data);
|
---|
| 5093 | }
|
---|
| 5094 | else {
|
---|
| 5095 | return null;
|
---|
| 5096 | }
|
---|
| 5097 | return data;
|
---|
| 5098 | },
|
---|
| 5099 | sendGoodbye: function(details, reason, callback) {
|
---|
| 5100 | //serialize
|
---|
| 5101 | var data;
|
---|
| 5102 | data = $Kadecot_WampSerializer.createGoodbye(details, reason);
|
---|
| 5103 | //encrypt data
|
---|
| 5104 | //set callback
|
---|
| 5105 | this.$wampClientCore.set_goodbyeCallback(callback);
|
---|
| 5106 | //send data
|
---|
| 5107 | if (this.$on_open_flag) {
|
---|
| 5108 | this.$webSocket.send(data);
|
---|
| 5109 | }
|
---|
| 5110 | else {
|
---|
| 5111 | return null;
|
---|
| 5112 | }
|
---|
| 5113 | return data;
|
---|
| 5114 | },
|
---|
| 5115 | sendHeartbeat: function(incomingSeq, outgoingSeq, discard) {
|
---|
| 5116 | //serialize
|
---|
| 5117 | var data;
|
---|
| 5118 | data = $Kadecot_WampSerializer.createHeartbeat(incomingSeq, outgoingSeq, discard);
|
---|
| 5119 | //encrypt data
|
---|
| 5120 | //send data
|
---|
| 5121 | if (this.$on_open_flag) {
|
---|
| 5122 | this.$webSocket.send(data);
|
---|
| 5123 | }
|
---|
| 5124 | else {
|
---|
| 5125 | return null;
|
---|
| 5126 | }
|
---|
| 5127 | return data;
|
---|
| 5128 | },
|
---|
| 5129 | sendError: function(type, request, details, error, arguments1, argumentsKw) {
|
---|
| 5130 | //serialize
|
---|
| 5131 | var data;
|
---|
| 5132 | data = $Kadecot_WampSerializer.createError(type, request, details, error, arguments1, argumentsKw);
|
---|
| 5133 | //encrypt data
|
---|
| 5134 | //send data
|
---|
| 5135 | if (this.$on_open_flag) {
|
---|
| 5136 | this.$webSocket.send(data);
|
---|
| 5137 | }
|
---|
| 5138 | else {
|
---|
| 5139 | return null;
|
---|
| 5140 | }
|
---|
| 5141 | return data;
|
---|
| 5142 | },
|
---|
| 5143 | sendPublish: function(options, topic, arguments1, argumentsKw, callback) {
|
---|
| 5144 | //serialize
|
---|
| 5145 | var data;
|
---|
| 5146 | var request;
|
---|
| 5147 | request = this.$request_id;
|
---|
| 5148 | this.$request_id++;
|
---|
| 5149 | data = $Kadecot_WampSerializer.createPublish(request, options, topic, arguments1, argumentsKw);
|
---|
| 5150 | //encrypt data
|
---|
| 5151 | //set callback
|
---|
| 5152 | this.$wampClientCore.get_publishCallback().set_item(request, callback);
|
---|
| 5153 | //send data
|
---|
| 5154 | if (this.$on_open_flag) {
|
---|
| 5155 | this.$webSocket.send(data);
|
---|
| 5156 | }
|
---|
| 5157 | else {
|
---|
| 5158 | return null;
|
---|
| 5159 | }
|
---|
| 5160 | return data;
|
---|
| 5161 | },
|
---|
| 5162 | sendSubscribe: function(options, topic, eventfunc, callback) {
|
---|
| 5163 | //serialize
|
---|
| 5164 | var data;
|
---|
| 5165 | var request;
|
---|
| 5166 | request = this.$request_id;
|
---|
| 5167 | this.$request_id++;
|
---|
| 5168 | data = $Kadecot_WampSerializer.createSubscribe(request, options, topic);
|
---|
| 5169 | //encrypt data
|
---|
| 5170 | //set callback
|
---|
| 5171 | this.$wampClientCore.get_subscribeCallback().set_item(request, callback);
|
---|
| 5172 | //set event callback
|
---|
| 5173 | this.$wampClientCore.get_eventCallback().set_item(request, eventfunc);
|
---|
| 5174 | //send data
|
---|
| 5175 | if (this.$on_open_flag) {
|
---|
| 5176 | this.$webSocket.send(data);
|
---|
| 5177 | }
|
---|
| 5178 | else {
|
---|
| 5179 | return null;
|
---|
| 5180 | }
|
---|
| 5181 | return data;
|
---|
| 5182 | },
|
---|
| 5183 | sendUnsubscribe: function(subscription, callback) {
|
---|
| 5184 | //serialize
|
---|
| 5185 | var data;
|
---|
| 5186 | var request;
|
---|
| 5187 | request = this.$request_id;
|
---|
| 5188 | this.$request_id++;
|
---|
| 5189 | data = $Kadecot_WampSerializer.createUnsubscribe(request, subscription);
|
---|
| 5190 | //encrypt data
|
---|
| 5191 | //set callback
|
---|
| 5192 | this.$wampClientCore.get_unsubscribeCallback().set_item(request, callback);
|
---|
| 5193 | //set Unsubscribe request id - subscription id
|
---|
| 5194 | this.$subscription_id_list.set_item(request, subscription);
|
---|
| 5195 | //send data
|
---|
| 5196 | if (this.$on_open_flag) {
|
---|
| 5197 | this.$webSocket.send(data);
|
---|
| 5198 | }
|
---|
| 5199 | else {
|
---|
| 5200 | return null;
|
---|
| 5201 | }
|
---|
| 5202 | return data;
|
---|
| 5203 | },
|
---|
| 5204 | sendCall: function(options, procedure, arguments1, argumentsKw, callback) {
|
---|
| 5205 | //serialize
|
---|
| 5206 | var data;
|
---|
| 5207 | var request;
|
---|
| 5208 | request = this.$request_id;
|
---|
| 5209 | this.$request_id++;
|
---|
| 5210 | data = $Kadecot_WampSerializer.createCall(request, options, procedure, arguments1, argumentsKw);
|
---|
| 5211 | //encrypt data
|
---|
| 5212 | //set callback
|
---|
| 5213 | this.$wampClientCore.get_callCallback().set_item(request, callback);
|
---|
| 5214 | //send data
|
---|
| 5215 | if (this.$on_open_flag === true) {
|
---|
| 5216 | this.$webSocket.send(data);
|
---|
| 5217 | }
|
---|
| 5218 | else {
|
---|
| 5219 | return null;
|
---|
| 5220 | }
|
---|
| 5221 | return data;
|
---|
| 5222 | },
|
---|
| 5223 | sendCancel: function(request, options, callback) {
|
---|
| 5224 | //serialize
|
---|
| 5225 | var data;
|
---|
| 5226 | data = $Kadecot_WampSerializer.createCancel(request, options);
|
---|
| 5227 | //encrypt data
|
---|
| 5228 | //set callback
|
---|
| 5229 | this.$wampClientCore.get_cancelCallback().set_item(request, callback);
|
---|
| 5230 | //send data
|
---|
| 5231 | if (this.$on_open_flag) {
|
---|
| 5232 | this.$webSocket.send(data);
|
---|
| 5233 | }
|
---|
| 5234 | else {
|
---|
| 5235 | return null;
|
---|
| 5236 | }
|
---|
| 5237 | return data;
|
---|
| 5238 | },
|
---|
| 5239 | sendRegister: function(options, procedure, callback) {
|
---|
| 5240 | //serialize
|
---|
| 5241 | var data;
|
---|
| 5242 | var request;
|
---|
| 5243 | request = this.$request_id;
|
---|
| 5244 | this.$request_id++;
|
---|
| 5245 | data = $Kadecot_WampSerializer.createRegister(request, options, procedure);
|
---|
| 5246 | //encrypt data
|
---|
| 5247 | //set callback
|
---|
| 5248 | this.$wampClientCore.get_registerCallback().set_item(request, callback);
|
---|
| 5249 | //send data
|
---|
| 5250 | if (this.$on_open_flag) {
|
---|
| 5251 | this.$webSocket.send(data);
|
---|
| 5252 | }
|
---|
| 5253 | else {
|
---|
| 5254 | return null;
|
---|
| 5255 | }
|
---|
| 5256 | return data;
|
---|
| 5257 | },
|
---|
| 5258 | sendUnregister: function(registration, callback) {
|
---|
| 5259 | //serialize
|
---|
| 5260 | var data;
|
---|
| 5261 | var request;
|
---|
| 5262 | request = this.$request_id;
|
---|
| 5263 | this.$request_id++;
|
---|
| 5264 | data = $Kadecot_WampSerializer.createUnregister(request, registration);
|
---|
| 5265 | //encrypt data
|
---|
| 5266 | //set callback
|
---|
| 5267 | this.$wampClientCore.get_unregisterCallback().set_item(request, callback);
|
---|
| 5268 | //send data
|
---|
| 5269 | if (this.$on_open_flag) {
|
---|
| 5270 | this.$webSocket.send(data);
|
---|
| 5271 | }
|
---|
| 5272 | else {
|
---|
| 5273 | return null;
|
---|
| 5274 | }
|
---|
| 5275 | return data;
|
---|
| 5276 | },
|
---|
| 5277 | sendYield: function(request, options, arguments1, argumentsKw) {
|
---|
| 5278 | //serialize
|
---|
| 5279 | var data;
|
---|
| 5280 | data = $Kadecot_WampSerializer.createYield(request, options, arguments1, argumentsKw);
|
---|
| 5281 | //encrypt data
|
---|
| 5282 | //send data
|
---|
| 5283 | if (this.$on_open_flag) {
|
---|
| 5284 | this.$webSocket.send(data);
|
---|
| 5285 | }
|
---|
| 5286 | return data;
|
---|
| 5287 | },
|
---|
| 5288 | onOpen: function(e) {
|
---|
| 5289 | this.$on_open_flag = true;
|
---|
| 5290 | var callback = this.$wampClientCore.get_openCallback();
|
---|
| 5291 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5292 | callback();
|
---|
| 5293 | }
|
---|
| 5294 | },
|
---|
| 5295 | onClose: function(e) {
|
---|
| 5296 | this.$on_open_flag = false;
|
---|
| 5297 | // webSocket = null;
|
---|
| 5298 | var callback = this.$wampClientCore.get_closeCallback();
|
---|
| 5299 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5300 | callback();
|
---|
| 5301 | }
|
---|
| 5302 | },
|
---|
| 5303 | onError: function(e) {
|
---|
| 5304 | var eea = e;
|
---|
| 5305 | if (!ss.staticEquals(this.$errorCallback, null)) {
|
---|
| 5306 | this.$errorCallback(ss.cast(eea.message, String));
|
---|
| 5307 | }
|
---|
| 5308 | },
|
---|
| 5309 | onMessage: function(e) {
|
---|
| 5310 | var msg = e;
|
---|
| 5311 | //System.Diagnostics.Debug.WriteLine("[wamp perser] msg :" + msg.ToString());
|
---|
| 5312 | var data;
|
---|
| 5313 | var callback = null;
|
---|
| 5314 | //decrypt data
|
---|
| 5315 | //deserialize
|
---|
[148] | 5316 | try {
|
---|
| 5317 | if (!!ss.isValue(msg.data)) {
|
---|
| 5318 | data = $Kadecot_WampDeserializer.parse(ss.cast(msg.data, String));
|
---|
| 5319 | }
|
---|
| 5320 | else {
|
---|
| 5321 | data = $Kadecot_WampDeserializer.parse(ss.cast(msg, String));
|
---|
| 5322 | }
|
---|
[101] | 5323 | }
|
---|
[148] | 5324 | catch ($t1) {
|
---|
| 5325 | data = null;
|
---|
[101] | 5326 | }
|
---|
| 5327 | if (ss.isNullOrUndefined(data)) {
|
---|
| 5328 | return;
|
---|
| 5329 | }
|
---|
| 5330 | var list = ss.cast(data, Array);
|
---|
| 5331 | var switchData = ss.unbox(ss.cast(list[0], ss.Int32));
|
---|
| 5332 | switch (switchData) {
|
---|
| 5333 | case 2: {
|
---|
| 5334 | // WAMP SPEC: [WELCOME, Session|id, Details|dict]
|
---|
| 5335 | if (this.$challnge_flag) {
|
---|
| 5336 | this.$challnge_flag = false;
|
---|
| 5337 | callback = this.$wampClientCore.get_authenticateCallback();
|
---|
| 5338 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5339 | callback(data);
|
---|
| 5340 | }
|
---|
| 5341 | else {
|
---|
| 5342 | }
|
---|
| 5343 | }
|
---|
| 5344 | else {
|
---|
| 5345 | callback = this.$wampClientCore.get_helloCallback();
|
---|
| 5346 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5347 | callback(data);
|
---|
| 5348 | }
|
---|
| 5349 | else {
|
---|
| 5350 | }
|
---|
| 5351 | }
|
---|
| 5352 | break;
|
---|
| 5353 | }
|
---|
| 5354 | case 3: {
|
---|
| 5355 | // WAMP SPEC: [ABORT, Details|dict, Reason|uri]
|
---|
| 5356 | if (this.$challnge_flag) {
|
---|
| 5357 | this.$challnge_flag = false;
|
---|
| 5358 | callback = this.$wampClientCore.get_authenticateCallback();
|
---|
| 5359 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5360 | callback(data);
|
---|
| 5361 | }
|
---|
| 5362 | else {
|
---|
| 5363 | }
|
---|
| 5364 | }
|
---|
| 5365 | else {
|
---|
| 5366 | callback = this.$wampClientCore.get_helloCallback();
|
---|
| 5367 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5368 | callback(data);
|
---|
| 5369 | }
|
---|
| 5370 | else {
|
---|
| 5371 | }
|
---|
| 5372 | }
|
---|
| 5373 | break;
|
---|
| 5374 | }
|
---|
| 5375 | case 4: {
|
---|
| 5376 | // advanced WAMP SPEC: [CHALLENGE, AuthMethod|string, Extra|dict]
|
---|
| 5377 | this.$challnge_flag = true;
|
---|
| 5378 | callback = this.$wampClientCore.get_helloCallback();
|
---|
| 5379 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5380 | callback(data);
|
---|
| 5381 | }
|
---|
| 5382 | else {
|
---|
| 5383 | }
|
---|
| 5384 | break;
|
---|
| 5385 | }
|
---|
| 5386 | case 6: {
|
---|
| 5387 | // WAMP SPEC: [GOODBYE, Details|dict, Reason|uri]
|
---|
| 5388 | callback = this.$wampClientCore.get_goodbyeCallback();
|
---|
| 5389 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5390 | callback(data);
|
---|
| 5391 | }
|
---|
| 5392 | else {
|
---|
| 5393 | }
|
---|
| 5394 | break;
|
---|
| 5395 | }
|
---|
| 5396 | case 7: {
|
---|
| 5397 | // advanced WAMP SPEC: [AUTHENTICATE, Signature|string, Extra|dict]
|
---|
| 5398 | callback = this.$wampClientCore.get_heartbeatCallback();
|
---|
| 5399 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5400 | callback(data);
|
---|
| 5401 | }
|
---|
| 5402 | else {
|
---|
| 5403 | }
|
---|
| 5404 | break;
|
---|
| 5405 | }
|
---|
| 5406 | case 8: {
|
---|
| 5407 | // WAMP SPEC: [ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, (Arguments|list, ArgumentsKw|dict)]
|
---|
| 5408 | var switchDataSec = ss.unbox(ss.cast(list[1], ss.Int32));
|
---|
| 5409 | var request = ss.unbox(ss.cast(list[2], ss.Int32));
|
---|
| 5410 | switch (switchDataSec) {
|
---|
| 5411 | case 32: {
|
---|
| 5412 | // WAMP SPEC: [ERROR, SUBSCRIBE, SUBSCRIBE.Request|id, Details|dict, Error|uri]
|
---|
| 5413 | callback = this.$wampClientCore.get_subscribeCallback().get_item(request);
|
---|
| 5414 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5415 | callback(data);
|
---|
| 5416 | }
|
---|
| 5417 | else {
|
---|
| 5418 | }
|
---|
| 5419 | break;
|
---|
| 5420 | }
|
---|
| 5421 | case 34: {
|
---|
| 5422 | // WAMP SPEC: [ERROR, UNSUBSCRIBE, UNSUBSCRIBE.Request|id, Details|dict, Error|uri]
|
---|
| 5423 | callback = this.$wampClientCore.get_unsubscribeCallback().get_item(request);
|
---|
| 5424 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5425 | callback(data);
|
---|
| 5426 | }
|
---|
| 5427 | else {
|
---|
| 5428 | }
|
---|
| 5429 | break;
|
---|
| 5430 | }
|
---|
| 5431 | case 16: {
|
---|
| 5432 | // WAMP SPEC: [ERROR, PUBLISH, PUBLISH.Request|id, Details|dict, Error|uri]
|
---|
| 5433 | callback = this.$wampClientCore.get_publishCallback().get_item(request);
|
---|
| 5434 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5435 | callback(data);
|
---|
| 5436 | }
|
---|
| 5437 | else {
|
---|
| 5438 | }
|
---|
| 5439 | break;
|
---|
| 5440 | }
|
---|
| 5441 | case 68: {
|
---|
| 5442 | // WAMP SPEC: [ERROR, INVOCATION, INVOCATION.Request|id, Details|dict, Error|uri]
|
---|
| 5443 | // WAMP SPEC: [ERROR, INVOCATION, INVOCATION.Request|id, Details|dict, Error|uri, Arguments|list]
|
---|
| 5444 | // WAMP SPEC: [ERROR, INVOCATION, INVOCATION.Request|id, Details|dict, Error|uri, Arguments|list, ArgumentsKw|dict]
|
---|
| 5445 | callback = this.$wampClientCore.get_invocationCallback().get_item(request);
|
---|
| 5446 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5447 | callback(data);
|
---|
| 5448 | }
|
---|
| 5449 | else {
|
---|
| 5450 | }
|
---|
| 5451 | break;
|
---|
| 5452 | }
|
---|
| 5453 | case 48: {
|
---|
| 5454 | // WAMP SPEC: [ERROR, CALL, CALL.Request|id, Details|dict, Error|uri]
|
---|
| 5455 | // WAMP SPEC: [ERROR, CALL, CALL.Request|id, Details|dict, Error|uri, Arguments|list]
|
---|
| 5456 | // WAMP SPEC: [ERROR, CALL, CALL.Request|id, Details|dict, Error|uri, Arguments|list, ArgumentsKw|dict]
|
---|
| 5457 | callback = this.$wampClientCore.get_callCallback().get_item(request);
|
---|
| 5458 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5459 | callback(data);
|
---|
| 5460 | }
|
---|
| 5461 | else {
|
---|
| 5462 | }
|
---|
| 5463 | break;
|
---|
| 5464 | }
|
---|
| 5465 | case 64: {
|
---|
| 5466 | // WAMP SPEC: [ERROR, REGISTER, REGISTER.Request|id, Details|dict, Error|uri]
|
---|
| 5467 | callback = this.$wampClientCore.get_registerCallback().get_item(request);
|
---|
| 5468 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5469 | callback(data);
|
---|
| 5470 | }
|
---|
| 5471 | else {
|
---|
| 5472 | }
|
---|
| 5473 | break;
|
---|
| 5474 | }
|
---|
| 5475 | case 66: {
|
---|
| 5476 | // WAMP SPEC: [ERROR, UNREGISTER, UNREGISTER.Request|id, Details|dict, Error|uri]
|
---|
| 5477 | callback = this.$wampClientCore.get_unregisterCallback().get_item(request);
|
---|
| 5478 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5479 | callback(data);
|
---|
| 5480 | }
|
---|
| 5481 | else {
|
---|
| 5482 | }
|
---|
| 5483 | break;
|
---|
| 5484 | }
|
---|
| 5485 | default: {
|
---|
| 5486 | return;
|
---|
| 5487 | }
|
---|
| 5488 | }
|
---|
| 5489 | break;
|
---|
| 5490 | }
|
---|
| 5491 | case 17: {
|
---|
| 5492 | // WAMP SPEC: [PUBLISHED, PUBLISH.Request|id, Publication|id]
|
---|
| 5493 | callback = this.$wampClientCore.get_publishCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5494 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5495 | callback(data);
|
---|
| 5496 | }
|
---|
| 5497 | else {
|
---|
| 5498 | }
|
---|
| 5499 | break;
|
---|
| 5500 | }
|
---|
| 5501 | case 33: {
|
---|
| 5502 | // WAMP SPEC: [SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]
|
---|
| 5503 | var reqId = ss.unbox(ss.cast(list[1], ss.Int32));
|
---|
| 5504 | var subId = ss.unbox(ss.cast(list[2], ss.Int32));
|
---|
| 5505 | callback = this.$wampClientCore.get_subscribeCallback().get_item(reqId);
|
---|
| 5506 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5507 | this.$wampClientCore.get_eventCallback().set_item(subId, this.$wampClientCore.get_eventCallback().get_item(reqId));
|
---|
| 5508 | this.$wampClientCore.deleteEventCallback(reqId);
|
---|
| 5509 | callback(data);
|
---|
| 5510 | }
|
---|
| 5511 | else {
|
---|
| 5512 | }
|
---|
| 5513 | break;
|
---|
| 5514 | }
|
---|
| 5515 | case 35: {
|
---|
| 5516 | // WAMP SPEC: [UNSUBSCRIBED, UNSUBSCRIBE.Request|id]
|
---|
| 5517 | callback = this.$wampClientCore.get_unsubscribeCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5518 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5519 | this.$wampClientCore.deleteEventCallback(this.$subscription_id_list.get_item(ss.unbox(ss.cast(list[1], ss.Int32))));
|
---|
| 5520 | callback(data);
|
---|
| 5521 | }
|
---|
| 5522 | else {
|
---|
| 5523 | }
|
---|
| 5524 | break;
|
---|
| 5525 | }
|
---|
| 5526 | case 36: {
|
---|
| 5527 | // WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict]
|
---|
| 5528 | // WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Arguments|list]
|
---|
| 5529 | // WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Arguments|list, PUBLISH.ArgumentKw|dict]
|
---|
| 5530 | callback = this.$wampClientCore.get_eventCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5531 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5532 | callback(data);
|
---|
| 5533 | }
|
---|
| 5534 | else {
|
---|
| 5535 | }
|
---|
| 5536 | break;
|
---|
| 5537 | }
|
---|
| 5538 | case 50: {
|
---|
| 5539 | // WAMP SPEC: [RESULT, CALL.Request|id, Details|dict]
|
---|
| 5540 | // WAMP SPEC: [RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list]
|
---|
| 5541 | // WAMP SPEC: [RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list, YIELD.ArgumentsKw|dict]
|
---|
| 5542 | callback = this.$wampClientCore.get_callCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5543 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5544 | callback(data);
|
---|
| 5545 | }
|
---|
| 5546 | else {
|
---|
| 5547 | }
|
---|
| 5548 | break;
|
---|
| 5549 | }
|
---|
| 5550 | case 65: {
|
---|
| 5551 | // WAMP SPEC: [REGISTERED, REGISTER.Request|id, Registration|id]
|
---|
| 5552 | callback = this.$wampClientCore.get_registerCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5553 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5554 | callback(data);
|
---|
| 5555 | }
|
---|
| 5556 | else {
|
---|
| 5557 | }
|
---|
| 5558 | break;
|
---|
| 5559 | }
|
---|
| 5560 | case 67: {
|
---|
| 5561 | // WAMP SPEC: [UNREGISTERED, UNREGISTER.Request|id]
|
---|
| 5562 | callback = this.$wampClientCore.get_unregisterCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5563 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5564 | callback(data);
|
---|
| 5565 | }
|
---|
| 5566 | else {
|
---|
| 5567 | }
|
---|
| 5568 | break;
|
---|
| 5569 | }
|
---|
| 5570 | case 68: {
|
---|
| 5571 | // WAMP SPEC: [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict]
|
---|
| 5572 | // WAMP SPEC: [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list]
|
---|
| 5573 | // WAMP SPEC: [INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list, CALL.ArgumentsKw|dict]
|
---|
| 5574 | callback = this.$wampClientCore.get_invocationCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5575 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5576 | callback(data);
|
---|
| 5577 | }
|
---|
| 5578 | else {
|
---|
| 5579 | }
|
---|
| 5580 | break;
|
---|
| 5581 | }
|
---|
| 5582 | case 69: {
|
---|
| 5583 | // advanced WAMP SPEC: [INTERRUPT, INVOCATION.Request|id, Options|dict]
|
---|
| 5584 | callback = this.$wampClientCore.get_interruptCallback().get_item(ss.unbox(ss.cast(list[1], ss.Int32)));
|
---|
| 5585 | if (!ss.staticEquals(callback, null)) {
|
---|
| 5586 | callback(data);
|
---|
| 5587 | }
|
---|
| 5588 | else {
|
---|
| 5589 | }
|
---|
| 5590 | break;
|
---|
| 5591 | }
|
---|
| 5592 | default: {
|
---|
| 5593 | break;
|
---|
| 5594 | }
|
---|
| 5595 | }
|
---|
| 5596 | },
|
---|
| 5597 | isConnecting: function() {
|
---|
| 5598 | return this.$on_open_flag;
|
---|
| 5599 | }
|
---|
| 5600 | });
|
---|
| 5601 | ss.initClass($Kadecot_WampClientCore, $asm, {
|
---|
| 5602 | get_openCallback: function() {
|
---|
| 5603 | return this.$1$openCallbackField;
|
---|
| 5604 | },
|
---|
| 5605 | set_openCallback: function(value) {
|
---|
| 5606 | this.$1$openCallbackField = value;
|
---|
| 5607 | },
|
---|
| 5608 | get_closeCallback: function() {
|
---|
| 5609 | return this.$1$closeCallbackField;
|
---|
| 5610 | },
|
---|
| 5611 | set_closeCallback: function(value) {
|
---|
| 5612 | this.$1$closeCallbackField = value;
|
---|
| 5613 | },
|
---|
| 5614 | get_heartbeatCallback: function() {
|
---|
| 5615 | return this.$1$heartbeatCallbackField;
|
---|
| 5616 | },
|
---|
| 5617 | set_heartbeatCallback: function(value) {
|
---|
| 5618 | this.$1$heartbeatCallbackField = value;
|
---|
| 5619 | },
|
---|
| 5620 | get_helloCallback: function() {
|
---|
| 5621 | return this.$1$helloCallbackField;
|
---|
| 5622 | },
|
---|
| 5623 | set_helloCallback: function(value) {
|
---|
| 5624 | this.$1$helloCallbackField = value;
|
---|
| 5625 | },
|
---|
| 5626 | get_authenticateCallback: function() {
|
---|
| 5627 | return this.$1$authenticateCallbackField;
|
---|
| 5628 | },
|
---|
| 5629 | set_authenticateCallback: function(value) {
|
---|
| 5630 | this.$1$authenticateCallbackField = value;
|
---|
| 5631 | },
|
---|
| 5632 | get_goodbyeCallback: function() {
|
---|
| 5633 | return this.$1$goodbyeCallbackField;
|
---|
| 5634 | },
|
---|
| 5635 | set_goodbyeCallback: function(value) {
|
---|
| 5636 | this.$1$goodbyeCallbackField = value;
|
---|
| 5637 | },
|
---|
| 5638 | get_publishCallback: function() {
|
---|
| 5639 | return this.$1$publishCallbackField;
|
---|
| 5640 | },
|
---|
| 5641 | set_publishCallback: function(value) {
|
---|
| 5642 | this.$1$publishCallbackField = value;
|
---|
| 5643 | },
|
---|
| 5644 | get_subscribeCallback: function() {
|
---|
| 5645 | return this.$1$subscribeCallbackField;
|
---|
| 5646 | },
|
---|
| 5647 | set_subscribeCallback: function(value) {
|
---|
| 5648 | this.$1$subscribeCallbackField = value;
|
---|
| 5649 | },
|
---|
| 5650 | get_unsubscribeCallback: function() {
|
---|
| 5651 | return this.$1$unsubscribeCallbackField;
|
---|
| 5652 | },
|
---|
| 5653 | set_unsubscribeCallback: function(value) {
|
---|
| 5654 | this.$1$unsubscribeCallbackField = value;
|
---|
| 5655 | },
|
---|
| 5656 | get_callCallback: function() {
|
---|
| 5657 | return this.$1$callCallbackField;
|
---|
| 5658 | },
|
---|
| 5659 | set_callCallback: function(value) {
|
---|
| 5660 | this.$1$callCallbackField = value;
|
---|
| 5661 | },
|
---|
| 5662 | get_cancelCallback: function() {
|
---|
| 5663 | return this.$1$cancelCallbackField;
|
---|
| 5664 | },
|
---|
| 5665 | set_cancelCallback: function(value) {
|
---|
| 5666 | this.$1$cancelCallbackField = value;
|
---|
| 5667 | },
|
---|
| 5668 | get_registerCallback: function() {
|
---|
| 5669 | return this.$1$registerCallbackField;
|
---|
| 5670 | },
|
---|
| 5671 | set_registerCallback: function(value) {
|
---|
| 5672 | this.$1$registerCallbackField = value;
|
---|
| 5673 | },
|
---|
| 5674 | get_unregisterCallback: function() {
|
---|
| 5675 | return this.$1$unregisterCallbackField;
|
---|
| 5676 | },
|
---|
| 5677 | set_unregisterCallback: function(value) {
|
---|
| 5678 | this.$1$unregisterCallbackField = value;
|
---|
| 5679 | },
|
---|
| 5680 | get_eventCallback: function() {
|
---|
| 5681 | return this.$1$eventCallbackField;
|
---|
| 5682 | },
|
---|
| 5683 | set_eventCallback: function(value) {
|
---|
| 5684 | this.$1$eventCallbackField = value;
|
---|
| 5685 | },
|
---|
| 5686 | get_invocationCallback: function() {
|
---|
| 5687 | return this.$1$invocationCallbackField;
|
---|
| 5688 | },
|
---|
| 5689 | set_invocationCallback: function(value) {
|
---|
| 5690 | this.$1$invocationCallbackField = value;
|
---|
| 5691 | },
|
---|
| 5692 | get_interruptCallback: function() {
|
---|
| 5693 | return this.$1$interruptCallbackField;
|
---|
| 5694 | },
|
---|
| 5695 | set_interruptCallback: function(value) {
|
---|
| 5696 | this.$1$interruptCallbackField = value;
|
---|
| 5697 | },
|
---|
| 5698 | deleteOpenCallback: function() {
|
---|
| 5699 | this.set_openCallback(null);
|
---|
| 5700 | },
|
---|
| 5701 | deleteCloseCallback: function() {
|
---|
| 5702 | this.set_closeCallback(null);
|
---|
| 5703 | },
|
---|
| 5704 | deleteHeartbeatCallback: function() {
|
---|
| 5705 | this.set_heartbeatCallback(null);
|
---|
| 5706 | },
|
---|
| 5707 | deleteHelloCallback: function() {
|
---|
| 5708 | this.set_helloCallback(null);
|
---|
| 5709 | },
|
---|
| 5710 | deleteAuthenticateCallback: function() {
|
---|
| 5711 | this.set_authenticateCallback(null);
|
---|
| 5712 | },
|
---|
| 5713 | deleteGoodbyeCallback: function() {
|
---|
| 5714 | this.set_goodbyeCallback(null);
|
---|
| 5715 | },
|
---|
| 5716 | deletePublishCallback: function(request) {
|
---|
| 5717 | this.get_publishCallback().set_item(request, null);
|
---|
| 5718 | },
|
---|
| 5719 | deleteSubscribeCallback: function(request) {
|
---|
| 5720 | this.get_subscribeCallback().set_item(request, null);
|
---|
| 5721 | },
|
---|
| 5722 | deleteUnsubscribeCallback: function(request) {
|
---|
| 5723 | this.get_unsubscribeCallback().set_item(request, null);
|
---|
| 5724 | },
|
---|
| 5725 | deleteCallCallback: function(request) {
|
---|
| 5726 | this.get_callCallback().set_item(request, null);
|
---|
| 5727 | },
|
---|
| 5728 | deleteCancelCallback: function(request) {
|
---|
| 5729 | this.get_cancelCallback().set_item(request, null);
|
---|
| 5730 | },
|
---|
| 5731 | deleteRegisterCallback: function(request) {
|
---|
| 5732 | this.get_registerCallback().set_item(request, null);
|
---|
| 5733 | },
|
---|
| 5734 | deleteUnregisterCallback: function(request) {
|
---|
| 5735 | this.get_unregisterCallback().set_item(request, null);
|
---|
| 5736 | },
|
---|
| 5737 | deleteEventCallback: function(request) {
|
---|
| 5738 | this.get_eventCallback().set_item(request, null);
|
---|
| 5739 | },
|
---|
| 5740 | deleteInvocationCallback: function(request) {
|
---|
| 5741 | this.get_invocationCallback().set_item(request, null);
|
---|
| 5742 | },
|
---|
| 5743 | deleteInterruptCallback: function(request) {
|
---|
| 5744 | this.get_interruptCallback().set_item(request, null);
|
---|
| 5745 | }
|
---|
| 5746 | });
|
---|
| 5747 | ss.initClass($Kadecot_WampDeserializer, $asm, {});
|
---|
| 5748 | ss.initClass($Kadecot_WampSerializer, $asm, {});
|
---|
| 5749 | ss.setMetadata($ctrlui_EPC_FLAG, { enumFlags: true });
|
---|
| 5750 | (function() {
|
---|
| 5751 | $control_UIEventNames.currentNodeChange = 'currentnode.change';
|
---|
| 5752 | $control_UIEventNames.loadingShow = 'loading.show';
|
---|
| 5753 | $control_UIEventNames.loadingHide = 'loading.hide';
|
---|
| 5754 | $control_UIEventNames.searchStart = 'search.start';
|
---|
| 5755 | $control_UIEventNames.searchEnd = 'search.end';
|
---|
| 5756 | $control_UIEventNames.searchError = 'search.error';
|
---|
| 5757 | $control_UIEventNames.propertyWriteStart = 'propertywrite.start';
|
---|
| 5758 | $control_UIEventNames.propertyWriteEnd = 'propertywrite.end';
|
---|
| 5759 | })();
|
---|
| 5760 | (function() {
|
---|
| 5761 | $ctrlui_$TokenInfo.$separetor = '[=,:\\(\\)\\[\\]~]';
|
---|
| 5762 | $ctrlui_$TokenInfo.$hexValue = '^0x[0-9A-Fa-f]+';
|
---|
| 5763 | $ctrlui_$TokenInfo.$numeric = '^[\\-\\+]?[\\.]?[0-9]+[0-9,\\.]*';
|
---|
| 5764 | })();
|
---|
| 5765 | (function() {
|
---|
| 5766 | $ctrlui_ValueRange.$_ParsedText = new (ss.makeGenericType(ss.Dictionary$2, [String, $ctrlui_$ValueSet]))();
|
---|
| 5767 | })();
|
---|
| 5768 | (function() {
|
---|
| 5769 | $ctrlui_DeviceController.getClassInfo = null;
|
---|
| 5770 | })();
|
---|
| 5771 | (function() {
|
---|
| 5772 | $ctrlui_T_ECN_EOJ.x1_PROFILE = 14;
|
---|
| 5773 | $ctrlui_T_ECN_EOJ.x2_NODE_PROFILE = 240;
|
---|
| 5774 | })();
|
---|
| 5775 | (function() {
|
---|
| 5776 | $CtrlUI.page = null;
|
---|
| 5777 | $CtrlUI.info = null;
|
---|
| 5778 | $CtrlUI.$page = null;
|
---|
| 5779 | $CtrlUI.$m_ClassGroups = null;
|
---|
| 5780 | $CtrlUI.$m_ProfileClassInfo = null;
|
---|
| 5781 | $CtrlUI.$m_Classes = null;
|
---|
| 5782 | })();
|
---|
| 5783 | })();
|
---|