//--- (YRelay implementation)

    protected override void _parseAttr(YAPI.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"))
        {
            YAPI.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._parseAttr(json_val);
    }
Example #2
0
    //--- (YDaisyChain implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #3
0
    //--- (YVoltageOutput implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #4
0
    //--- (YQuadratureDecoder implementation)

    protected override void _parseAttr(YAPI.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;
        }
        if (json_val.has("edgesPerCycle"))
        {
            _edgesPerCycle = json_val.getInt("edgesPerCycle");
        }
        base._parseAttr(json_val);
    }
Example #5
0
    //--- (YCompass implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
    //--- (YHubPort implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #7
0
    //--- (YDualPower implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #8
0
    //--- (YMultiAxisController implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #9
0
    //--- (YPower implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
    //--- (YLed implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #11
0
    //--- (YPwmPowerSource implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("powerMode"))
        {
            _powerMode = json_val.getInt("powerMode");
        }
        base._parseAttr(json_val);
    }
    //--- (YLightSensor implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("measureType"))
        {
            _measureType = json_val.getInt("measureType");
        }
        base._parseAttr(json_val);
    }
        //--- (YPowerOutput implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("voltage"))
            {
                _voltage = json_val.getInt("voltage");
            }
            base._parseAttr(json_val);
        }
    //--- (YOsControl implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("shutdownCountdown"))
        {
            _shutdownCountdown = json_val.getInt("shutdownCountdown");
        }
        base._parseAttr(json_val);
    }
    //--- (YGenericSensor implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
    //--- (YWakeUpSchedule implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #17
0
    //--- (generated code: YWireless implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #18
0
        //--- (YMultiCellWeighScale implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("cellCount"))
            {
                _cellCount = json_val.getInt("cellCount");
            }
            if (json_val.has("externalSense"))
            {
                _externalSense = json_val.getInt("externalSense") > 0 ? 1 : 0;
            }
            if (json_val.has("excitation"))
            {
                _excitation = json_val.getInt("excitation");
            }
            if (json_val.has("tempAvgAdaptRatio"))
            {
                _tempAvgAdaptRatio = Math.Round(json_val.getDouble("tempAvgAdaptRatio") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("tempChgAdaptRatio"))
            {
                _tempChgAdaptRatio = Math.Round(json_val.getDouble("tempChgAdaptRatio") * 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._parseAttr(json_val);
        }
    //--- (YPwmInput implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("dutyCycle"))
        {
            _dutyCycle = Math.Round(json_val.getDouble("dutyCycle") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("pulseDuration"))
        {
            _pulseDuration = Math.Round(json_val.getDouble("pulseDuration") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("frequency"))
        {
            _frequency = Math.Round(json_val.getDouble("frequency") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("period"))
        {
            _period = Math.Round(json_val.getDouble("period") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("pulseCounter"))
        {
            _pulseCounter = json_val.getLong("pulseCounter");
        }
        if (json_val.has("pulseTimer"))
        {
            _pulseTimer = json_val.getLong("pulseTimer");
        }
        if (json_val.has("pwmReportMode"))
        {
            _pwmReportMode = json_val.getInt("pwmReportMode");
        }
        if (json_val.has("debouncePeriod"))
        {
            _debouncePeriod = json_val.getInt("debouncePeriod");
        }
        if (json_val.has("bandwidth"))
        {
            _bandwidth = json_val.getInt("bandwidth");
        }
        if (json_val.has("edgesPerPeriod"))
        {
            _edgesPerPeriod = json_val.getInt("edgesPerPeriod");
        }
        base._parseAttr(json_val);
    }
    //--- (YBluetoothLink implementation)

    protected override void _parseAttr(YAPI.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._parseAttr(json_val);
    }
Example #21
0
    //--- (YServo implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("position"))
        {
            _position = json_val.getInt("position");
        }
        if (json_val.has("enabled"))
        {
            _enabled = json_val.getInt("enabled") > 0 ? 1 : 0;
        }
        if (json_val.has("range"))
        {
            _range = json_val.getInt("range");
        }
        if (json_val.has("neutral"))
        {
            _neutral = json_val.getInt("neutral");
        }
        if (json_val.has("move"))
        {
            YAPI.YJSONObject subjson = json_val.getYJSONObject("move");
            if (subjson.has("moving"))
            {
                _move.moving = subjson.getInt("moving");
            }
            if (subjson.has("target"))
            {
                _move.target = subjson.getInt("target");
            }
            if (subjson.has("ms"))
            {
                _move.ms = subjson.getInt("ms");
            }
        }
        if (json_val.has("positionAtPowerOn"))
        {
            _positionAtPowerOn = json_val.getInt("positionAtPowerOn");
        }
        if (json_val.has("enabledAtPowerOn"))
        {
            _enabledAtPowerOn = json_val.getInt("enabledAtPowerOn") > 0 ? 1 : 0;
        }
        base._parseAttr(json_val);
    }
        //--- (YRealTimeClock implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("unixTime"))
            {
                _unixTime = json_val.getLong("unixTime");
            }
            if (json_val.has("dateTime"))
            {
                _dateTime = json_val.getString("dateTime");
            }
            if (json_val.has("utcOffset"))
            {
                _utcOffset = json_val.getInt("utcOffset");
            }
            if (json_val.has("timeSet"))
            {
                _timeSet = json_val.getInt("timeSet") > 0 ? 1 : 0;
            }
            base._parseAttr(json_val);
        }
    //--- (generated code: YGyro implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("bandwidth"))
        {
            _bandwidth = json_val.getInt("bandwidth");
        }
        if (json_val.has("xValue"))
        {
            _xValue = Math.Round(json_val.getDouble("xValue") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("yValue"))
        {
            _yValue = Math.Round(json_val.getDouble("yValue") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("zValue"))
        {
            _zValue = Math.Round(json_val.getDouble("zValue") * 1000.0 / 65536.0) / 1000.0;
        }
        base._parseAttr(json_val);
    }
    //--- (YMultiSensController implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("nSensors"))
        {
            _nSensors = json_val.getInt("nSensors");
        }
        if (json_val.has("maxSensors"))
        {
            _maxSensors = json_val.getInt("maxSensors");
        }
        if (json_val.has("maintenanceMode"))
        {
            _maintenanceMode = json_val.getInt("maintenanceMode") > 0 ? 1 : 0;
        }
        if (json_val.has("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }
Example #25
0
        //--- (YCurrentLoopOutput implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("current"))
            {
                _current = Math.Round(json_val.getDouble("current") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("currentTransition"))
            {
                _currentTransition = json_val.getString("currentTransition");
            }
            if (json_val.has("currentAtStartUp"))
            {
                _currentAtStartUp = Math.Round(json_val.getDouble("currentAtStartUp") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("loopPower"))
            {
                _loopPower = json_val.getInt("loopPower");
            }
            base._parseAttr(json_val);
        }
Example #26
0
    //--- (YTemperature implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("sensorType"))
        {
            _sensorType = json_val.getInt("sensorType");
        }
        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("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }
    //--- (YRefFrame implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("mountPos"))
        {
            _mountPos = json_val.getInt("mountPos");
        }
        if (json_val.has("bearing"))
        {
            _bearing = Math.Round(json_val.getDouble("bearing") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("calibrationParam"))
        {
            _calibrationParam = json_val.getString("calibrationParam");
        }
        if (json_val.has("fusionMode"))
        {
            _fusionMode = json_val.getInt("fusionMode");
        }
        base._parseAttr(json_val);
    }
    //--- (YRangeFinder implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("rangeFinderMode"))
        {
            _rangeFinderMode = json_val.getInt("rangeFinderMode");
        }
        if (json_val.has("timeFrame"))
        {
            _timeFrame = json_val.getLong("timeFrame");
        }
        if (json_val.has("quality"))
        {
            _quality = json_val.getInt("quality");
        }
        if (json_val.has("hardwareCalibration"))
        {
            _hardwareCalibration = json_val.getString("hardwareCalibration");
        }
        if (json_val.has("currentTemperature"))
        {
            _currentTemperature = Math.Round(json_val.getDouble("currentTemperature") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }
Example #29
0
    //--- (YWakeUpMonitor implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("powerDuration"))
        {
            _powerDuration = json_val.getInt("powerDuration");
        }
        if (json_val.has("sleepCountdown"))
        {
            _sleepCountdown = json_val.getInt("sleepCountdown");
        }
        if (json_val.has("nextWakeUp"))
        {
            _nextWakeUp = json_val.getLong("nextWakeUp");
        }
        if (json_val.has("wakeUpReason"))
        {
            _wakeUpReason = json_val.getInt("wakeUpReason");
        }
        if (json_val.has("wakeUpState"))
        {
            _wakeUpState = json_val.getInt("wakeUpState");
        }
        if (json_val.has("rtcTime"))
        {
            _rtcTime = json_val.getLong("rtcTime");
        }
        base._parseAttr(json_val);
    }
Example #30
0
    //--- (YBuzzer implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("frequency"))
        {
            _frequency = Math.Round(json_val.getDouble("frequency") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("volume"))
        {
            _volume = json_val.getInt("volume");
        }
        if (json_val.has("playSeqSize"))
        {
            _playSeqSize = json_val.getInt("playSeqSize");
        }
        if (json_val.has("playSeqMaxSize"))
        {
            _playSeqMaxSize = json_val.getInt("playSeqMaxSize");
        }
        if (json_val.has("playSeqSignature"))
        {
            _playSeqSignature = json_val.getInt("playSeqSignature");
        }
        if (json_val.has("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }