Beispiel #1
0
        //--- (generated code: YFunction implementation)
#pragma warning disable 1998
        internal virtual void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("logicalName"))
            {
                _logicalName = json_val.getString("logicalName");
            }
            if (json_val.has("advertisedValue"))
            {
                _advertisedValue = json_val.getString("advertisedValue");
            }
        }
Beispiel #2
0
        //--- (YHumidity implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("relHum"))
            {
                _relHum = Math.Round(json_val.getDouble("relHum") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("absHum"))
            {
                _absHum = Math.Round(json_val.getDouble("absHum") * 1000.0 / 65536.0) / 1000.0;
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #3
0
        //--- (YAltitude implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("qnh"))
            {
                _qnh = Math.Round(json_val.getDouble("qnh") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("technology"))
            {
                _technology = json_val.getString("technology");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #4
0
        //--- (YQuadratureDecoder implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("speed"))
            {
                _speed = Math.Round(json_val.getDouble("speed") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("decoding"))
            {
                _decoding = json_val.getInt("decoding") > 0 ? 1 : 0;
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #5
0
        //--- (YCarbonDioxide implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("abcPeriod"))
            {
                _abcPeriod = json_val.getInt("abcPeriod");
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (generated code: YFiles implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("filesCount"))
            {
                _filesCount = json_val.getInt("filesCount");
            }
            if (json_val.has("freeSpace"))
            {
                _freeSpace = json_val.getInt("freeSpace");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #7
0
        //--- (YArithmeticSensor implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("description"))
            {
                _description = json_val.getString("description");
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YSegmentedDisplay implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("displayedText"))
            {
                _displayedText = json_val.getString("displayedText");
            }
            if (json_val.has("displayMode"))
            {
                _displayMode = json_val.getInt("displayMode");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #9
0
        //--- (YTilt implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("bandwidth"))
            {
                _bandwidth = json_val.getInt("bandwidth");
            }
            if (json_val.has("axis"))
            {
                _axis = json_val.getInt("axis");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YRelay implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("state"))
            {
                _state = json_val.getInt("state") > 0 ? 1 : 0;
            }
            if (json_val.has("stateAtPowerOn"))
            {
                _stateAtPowerOn = json_val.getInt("stateAtPowerOn");
            }
            if (json_val.has("maxTimeOnStateA"))
            {
                _maxTimeOnStateA = json_val.getLong("maxTimeOnStateA");
            }
            if (json_val.has("maxTimeOnStateB"))
            {
                _maxTimeOnStateB = json_val.getLong("maxTimeOnStateB");
            }
            if (json_val.has("output"))
            {
                _output = json_val.getInt("output") > 0 ? 1 : 0;
            }
            if (json_val.has("pulseTimer"))
            {
                _pulseTimer = json_val.getLong("pulseTimer");
            }
            if (json_val.has("delayedPulseTimer"))
            {
                YJSONObject subjson = json_val.getYJSONObject("delayedPulseTimer");
                if (subjson.has("moving"))
                {
                    _delayedPulseTimer.moving = subjson.getInt("moving");
                }
                if (subjson.has("target"))
                {
                    _delayedPulseTimer.target = subjson.getInt("target");
                }
                if (subjson.has("ms"))
                {
                    _delayedPulseTimer.ms = subjson.getInt("ms");
                }
            }
            if (json_val.has("countdown"))
            {
                _countdown = json_val.getLong("countdown");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YMultiAxisController implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("nAxis"))
            {
                _nAxis = json_val.getInt("nAxis");
            }
            if (json_val.has("globalState"))
            {
                _globalState = json_val.getInt("globalState");
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YVoltageOutput implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("currentVoltage"))
            {
                _currentVoltage = Math.Round(json_val.getDouble("currentVoltage") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("voltageTransition"))
            {
                _voltageTransition = json_val.getString("voltageTransition");
            }
            if (json_val.has("voltageAtStartUp"))
            {
                _voltageAtStartUp = Math.Round(json_val.getDouble("voltageAtStartUp") * 1000.0 / 65536.0) / 1000.0;
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #13
0
        //--- (YHubPort implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("enabled"))
            {
                _enabled = json_val.getInt("enabled") > 0 ? 1 : 0;
            }
            if (json_val.has("portState"))
            {
                _portState = json_val.getInt("portState");
            }
            if (json_val.has("baudRate"))
            {
                _baudRate = json_val.getInt("baudRate");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #14
0
        //--- (YPower implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("cosPhi"))
            {
                _cosPhi = Math.Round(json_val.getDouble("cosPhi") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("meter"))
            {
                _meter = Math.Round(json_val.getDouble("meter") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("meterTimer"))
            {
                _meterTimer = json_val.getInt("meterTimer");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #15
0
        //--- (YDaisyChain implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("daisyState"))
            {
                _daisyState = json_val.getInt("daisyState");
            }
            if (json_val.has("childCount"))
            {
                _childCount = json_val.getInt("childCount");
            }
            if (json_val.has("requiredChildCount"))
            {
                _requiredChildCount = json_val.getInt("requiredChildCount");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YDualPower implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("powerState"))
            {
                _powerState = json_val.getInt("powerState");
            }
            if (json_val.has("powerControl"))
            {
                _powerControl = json_val.getInt("powerControl");
            }
            if (json_val.has("extVoltage"))
            {
                _extVoltage = json_val.getInt("extVoltage");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #17
0
        internal virtual string imm_get_json_path_struct(YJSONObject jsonObject, string[] paths, int ofs)
        {
            string key = paths[ofs];

            if (!jsonObject.has(key))
            {
                return("");
            }

            YJSONContent obj = jsonObject.get(key);

            if (obj != null)
            {
                if (paths.Length == ofs + 1)
                {
                    return(obj.toJSON());
                }

                if (obj is YJSONArray)
                {
                    return(imm_get_json_path_array(jsonObject.getYJSONArray(key), paths, ofs + 1));
                }
                else if (obj is YJSONObject)
                {
                    return(imm_get_json_path_struct(jsonObject.getYJSONObject(key), paths, ofs + 1));
                }
            }
            return("");
        }
Beispiel #18
0
        //--- (YCompass implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("bandwidth"))
            {
                _bandwidth = json_val.getInt("bandwidth");
            }
            if (json_val.has("axis"))
            {
                _axis = json_val.getInt("axis");
            }
            if (json_val.has("magneticHeading"))
            {
                _magneticHeading = Math.Round(json_val.getDouble("magneticHeading") * 1000.0 / 65536.0) / 1000.0;
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #19
0
        //--- (YLed implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("power"))
            {
                _power = json_val.getInt("power") > 0 ? 1 : 0;
            }
            if (json_val.has("luminosity"))
            {
                _luminosity = json_val.getInt("luminosity");
            }
            if (json_val.has("blinking"))
            {
                _blinking = json_val.getInt("blinking");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #20
0
        //--- (YOsControl implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("shutdownCountdown"))
            {
                _shutdownCountdown = json_val.getInt("shutdownCountdown");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #21
0
        //--- (YLightSensor implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("measureType"))
            {
                _measureType = json_val.getInt("measureType");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #22
0
        //--- (YCurrent implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("enabled"))
            {
                _enabled = json_val.getInt("enabled") > 0 ? 1 : 0;
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #23
0
        //--- (YPwmPowerSource implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("powerMode"))
            {
                _powerMode = json_val.getInt("powerMode");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #24
0
        //--- (YPowerOutput implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("voltage"))
            {
                _voltage = json_val.getInt("voltage");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #25
0
        //--- (generated code: YWireless implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("linkQuality"))
            {
                _linkQuality = json_val.getInt("linkQuality");
            }
            if (json_val.has("ssid"))
            {
                _ssid = json_val.getString("ssid");
            }
            if (json_val.has("channel"))
            {
                _channel = json_val.getInt("channel");
            }
            if (json_val.has("security"))
            {
                _security = json_val.getInt("security");
            }
            if (json_val.has("message"))
            {
                _message = json_val.getString("message");
            }
            if (json_val.has("wlanConfig"))
            {
                _wlanConfig = json_val.getString("wlanConfig");
            }
            if (json_val.has("wlanState"))
            {
                _wlanState = json_val.getInt("wlanState");
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YWeighScale implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("excitation"))
            {
                _excitation = json_val.getInt("excitation");
            }
            if (json_val.has("compTempAdaptRatio"))
            {
                _compTempAdaptRatio = Math.Round(json_val.getDouble("compTempAdaptRatio") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("compTempAvg"))
            {
                _compTempAvg = Math.Round(json_val.getDouble("compTempAvg") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("compTempChg"))
            {
                _compTempChg = Math.Round(json_val.getDouble("compTempChg") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("compensation"))
            {
                _compensation = Math.Round(json_val.getDouble("compensation") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("zeroTracking"))
            {
                _zeroTracking = Math.Round(json_val.getDouble("zeroTracking") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #27
0
        //--- (YWakeUpSchedule implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("minutesA"))
            {
                _minutesA = json_val.getInt("minutesA");
            }
            if (json_val.has("minutesB"))
            {
                _minutesB = json_val.getInt("minutesB");
            }
            if (json_val.has("hours"))
            {
                _hours = json_val.getInt("hours");
            }
            if (json_val.has("weekDays"))
            {
                _weekDays = json_val.getInt("weekDays");
            }
            if (json_val.has("monthDays"))
            {
                _monthDays = json_val.getInt("monthDays");
            }
            if (json_val.has("months"))
            {
                _months = json_val.getInt("months");
            }
            if (json_val.has("nextOccurence"))
            {
                _nextOccurence = json_val.getLong("nextOccurence");
            }
            base.imm_parseAttr(json_val);
        }
Beispiel #28
0
        //--- (generated code: YDataLogger implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("currentRunIndex"))
            {
                _currentRunIndex = json_val.getInt("currentRunIndex");
            }
            if (json_val.has("timeUTC"))
            {
                _timeUTC = json_val.getLong("timeUTC");
            }
            if (json_val.has("recording"))
            {
                _recording = json_val.getInt("recording");
            }
            if (json_val.has("autoStart"))
            {
                _autoStart = json_val.getInt("autoStart") > 0 ? 1 : 0;
            }
            if (json_val.has("beaconDriven"))
            {
                _beaconDriven = json_val.getInt("beaconDriven") > 0 ? 1 : 0;
            }
            if (json_val.has("usage"))
            {
                _usage = json_val.getInt("usage");
            }
            if (json_val.has("clearHistory"))
            {
                _clearHistory = json_val.getInt("clearHistory") > 0 ? 1 : 0;
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YGenericSensor implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("signalValue"))
            {
                _signalValue = Math.Round(json_val.getDouble("signalValue") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("signalUnit"))
            {
                _signalUnit = json_val.getString("signalUnit");
            }
            if (json_val.has("signalRange"))
            {
                _signalRange = json_val.getString("signalRange");
            }
            if (json_val.has("valueRange"))
            {
                _valueRange = json_val.getString("valueRange");
            }
            if (json_val.has("signalBias"))
            {
                _signalBias = Math.Round(json_val.getDouble("signalBias") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("signalSampling"))
            {
                _signalSampling = json_val.getInt("signalSampling");
            }
            if (json_val.has("enabled"))
            {
                _enabled = json_val.getInt("enabled") > 0 ? 1 : 0;
            }
            base.imm_parseAttr(json_val);
        }
        //--- (YBluetoothLink implementation)
#pragma warning disable 1998
        internal override void imm_parseAttr(YJSONObject json_val)
        {
            if (json_val.has("ownAddress"))
            {
                _ownAddress = json_val.getString("ownAddress");
            }
            if (json_val.has("pairingPin"))
            {
                _pairingPin = json_val.getString("pairingPin");
            }
            if (json_val.has("remoteAddress"))
            {
                _remoteAddress = json_val.getString("remoteAddress");
            }
            if (json_val.has("remoteName"))
            {
                _remoteName = json_val.getString("remoteName");
            }
            if (json_val.has("mute"))
            {
                _mute = json_val.getInt("mute") > 0 ? 1 : 0;
            }
            if (json_val.has("preAmplifier"))
            {
                _preAmplifier = json_val.getInt("preAmplifier");
            }
            if (json_val.has("volume"))
            {
                _volume = json_val.getInt("volume");
            }
            if (json_val.has("linkState"))
            {
                _linkState = json_val.getInt("linkState");
            }
            if (json_val.has("linkQuality"))
            {
                _linkQuality = json_val.getInt("linkQuality");
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base.imm_parseAttr(json_val);
        }