//--- (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);
    }
Exemple #2
0
    //--- (YMagnetometer 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);
    }
Exemple #3
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;
        }
        base._parseAttr(json_val);
    }
        //--- (YAltitude implementation)

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

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("motorStatus"))
        {
            _motorStatus = json_val.getInt("motorStatus");
        }
        if (json_val.has("drivingForce"))
        {
            _drivingForce = Math.Round(json_val.getDouble("drivingForce") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("brakingForce"))
        {
            _brakingForce = Math.Round(json_val.getDouble("brakingForce") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("cutOffVoltage"))
        {
            _cutOffVoltage = Math.Round(json_val.getDouble("cutOffVoltage") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("overCurrentLimit"))
        {
            _overCurrentLimit = json_val.getInt("overCurrentLimit");
        }
        if (json_val.has("frequency"))
        {
            _frequency = Math.Round(json_val.getDouble("frequency") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("starterTime"))
        {
            _starterTime = json_val.getInt("starterTime");
        }
        if (json_val.has("failSafeTimeout"))
        {
            _failSafeTimeout = json_val.getInt("failSafeTimeout");
        }
        if (json_val.has("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }
Exemple #6
0
        //--- (YPwmOutput 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("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("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("pwmTransition"))
            {
                _pwmTransition = json_val.getString("pwmTransition");
            }
            if (json_val.has("enabledAtPowerOn"))
            {
                _enabledAtPowerOn = json_val.getInt("enabledAtPowerOn") > 0 ? 1 : 0;
            }
            if (json_val.has("dutyCycleAtPowerOn"))
            {
                _dutyCycleAtPowerOn = Math.Round(json_val.getDouble("dutyCycleAtPowerOn") * 1000.0 / 65536.0) / 1000.0;
            }
            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");
        }
        base._parseAttr(json_val);
    }
Exemple #8
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("deliveredEnergyMeter"))
        {
            _deliveredEnergyMeter = Math.Round(json_val.getDouble("deliveredEnergyMeter") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("receivedEnergyMeter"))
        {
            _receivedEnergyMeter = Math.Round(json_val.getDouble("receivedEnergyMeter") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("meterTimer"))
        {
            _meterTimer = json_val.getInt("meterTimer");
        }
        base._parseAttr(json_val);
    }
Exemple #9
0
    //--- (YProximity 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("detectionThreshold"))
        {
            _detectionThreshold = json_val.getInt("detectionThreshold");
        }
        if (json_val.has("detectionHysteresis"))
        {
            _detectionHysteresis = json_val.getInt("detectionHysteresis");
        }
        if (json_val.has("presenceMinTime"))
        {
            _presenceMinTime = json_val.getInt("presenceMinTime");
        }
        if (json_val.has("removalMinTime"))
        {
            _removalMinTime = json_val.getInt("removalMinTime");
        }
        if (json_val.has("isPresent"))
        {
            _isPresent = json_val.getInt("isPresent") > 0 ? 1 : 0;
        }
        if (json_val.has("lastTimeApproached"))
        {
            _lastTimeApproached = json_val.getLong("lastTimeApproached");
        }
        if (json_val.has("lastTimeRemoved"))
        {
            _lastTimeRemoved = json_val.getLong("lastTimeRemoved");
        }
        if (json_val.has("pulseCounter"))
        {
            _pulseCounter = json_val.getLong("pulseCounter");
        }
        if (json_val.has("pulseTimer"))
        {
            _pulseTimer = json_val.getLong("pulseTimer");
        }
        if (json_val.has("proximityReportMode"))
        {
            _proximityReportMode = json_val.getInt("proximityReportMode");
        }
        base._parseAttr(json_val);
    }
Exemple #10
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);
    }
Exemple #11
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);
    }
Exemple #13
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);
        }
    //--- (YStepperMotor implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("motorState"))
        {
            _motorState = json_val.getInt("motorState");
        }
        if (json_val.has("diags"))
        {
            _diags = json_val.getInt("diags");
        }
        if (json_val.has("stepPos"))
        {
            _stepPos = json_val.getDouble("stepPos") / 16.0;
        }
        if (json_val.has("speed"))
        {
            _speed = Math.Round(json_val.getDouble("speed") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("pullinSpeed"))
        {
            _pullinSpeed = Math.Round(json_val.getDouble("pullinSpeed") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("maxAccel"))
        {
            _maxAccel = Math.Round(json_val.getDouble("maxAccel") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("maxSpeed"))
        {
            _maxSpeed = Math.Round(json_val.getDouble("maxSpeed") * 1000.0 / 65536.0) / 1000.0;
        }
        if (json_val.has("stepping"))
        {
            _stepping = json_val.getInt("stepping");
        }
        if (json_val.has("overcurrent"))
        {
            _overcurrent = json_val.getInt("overcurrent");
        }
        if (json_val.has("tCurrStop"))
        {
            _tCurrStop = json_val.getInt("tCurrStop");
        }
        if (json_val.has("tCurrRun"))
        {
            _tCurrRun = json_val.getInt("tCurrRun");
        }
        if (json_val.has("alertMode"))
        {
            _alertMode = json_val.getString("alertMode");
        }
        if (json_val.has("auxMode"))
        {
            _auxMode = json_val.getString("auxMode");
        }
        if (json_val.has("auxSignal"))
        {
            _auxSignal = json_val.getInt("auxSignal");
        }
        if (json_val.has("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }
Exemple #15
0
        //--- (YGps implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("isFixed"))
            {
                _isFixed = json_val.getInt("isFixed") > 0 ? 1 : 0;
            }
            if (json_val.has("satCount"))
            {
                _satCount = json_val.getLong("satCount");
            }
            if (json_val.has("satPerConst"))
            {
                _satPerConst = json_val.getLong("satPerConst");
            }
            if (json_val.has("gpsRefreshRate"))
            {
                _gpsRefreshRate = Math.Round(json_val.getDouble("gpsRefreshRate") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("coordSystem"))
            {
                _coordSystem = json_val.getInt("coordSystem");
            }
            if (json_val.has("constellation"))
            {
                _constellation = json_val.getInt("constellation");
            }
            if (json_val.has("latitude"))
            {
                _latitude = json_val.getString("latitude");
            }
            if (json_val.has("longitude"))
            {
                _longitude = json_val.getString("longitude");
            }
            if (json_val.has("dilution"))
            {
                _dilution = Math.Round(json_val.getDouble("dilution") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("altitude"))
            {
                _altitude = Math.Round(json_val.getDouble("altitude") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("groundSpeed"))
            {
                _groundSpeed = Math.Round(json_val.getDouble("groundSpeed") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("direction"))
            {
                _direction = Math.Round(json_val.getDouble("direction") * 1000.0 / 65536.0) / 1000.0;
            }
            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("command"))
            {
                _command = json_val.getString("command");
            }
            base._parseAttr(json_val);
        }