コード例 #1
0
    //--- (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);
    }
コード例 #2
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);
    }
コード例 #3
0
    //--- (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);
    }
コード例 #4
0
    //--- (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);
    }
コード例 #5
0
ファイル: yocto_buzzer.cs プロジェクト: julesstahli/Yoctopuce
    //--- (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);
    }
コード例 #6
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("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);
    }
コード例 #7
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);
    }
コード例 #8
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);
    }
コード例 #9
0
    //--- (YVoltage implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("enabled"))
        {
            _enabled = json_val.getInt("enabled") > 0 ? 1 : 0;
        }
        base._parseAttr(json_val);
    }
コード例 #10
0
        //--- (YPowerOutput implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("voltage"))
            {
                _voltage = json_val.getInt("voltage");
            }
            base._parseAttr(json_val);
        }
コード例 #11
0
    //--- (YLightSensor implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("measureType"))
        {
            _measureType = json_val.getInt("measureType");
        }
        base._parseAttr(json_val);
    }
コード例 #12
0
    //--- (YOsControl implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("shutdownCountdown"))
        {
            _shutdownCountdown = json_val.getInt("shutdownCountdown");
        }
        base._parseAttr(json_val);
    }
コード例 #13
0
        //--- (YInputChain implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("expectedNodes"))
            {
                _expectedNodes = json_val.getInt("expectedNodes");
            }
            if (json_val.has("detectedNodes"))
            {
                _detectedNodes = json_val.getInt("detectedNodes");
            }
            if (json_val.has("loopbackTest"))
            {
                _loopbackTest = json_val.getInt("loopbackTest") > 0 ? 1 : 0;
            }
            if (json_val.has("refreshRate"))
            {
                _refreshRate = json_val.getInt("refreshRate");
            }
            if (json_val.has("bitChain1"))
            {
                _bitChain1 = json_val.getString("bitChain1");
            }
            if (json_val.has("bitChain2"))
            {
                _bitChain2 = json_val.getString("bitChain2");
            }
            if (json_val.has("bitChain3"))
            {
                _bitChain3 = json_val.getString("bitChain3");
            }
            if (json_val.has("bitChain4"))
            {
                _bitChain4 = json_val.getString("bitChain4");
            }
            if (json_val.has("bitChain5"))
            {
                _bitChain5 = json_val.getString("bitChain5");
            }
            if (json_val.has("bitChain6"))
            {
                _bitChain6 = json_val.getString("bitChain6");
            }
            if (json_val.has("bitChain7"))
            {
                _bitChain7 = json_val.getString("bitChain7");
            }
            if (json_val.has("watchdogPeriod"))
            {
                _watchdogPeriod = json_val.getInt("watchdogPeriod");
            }
            if (json_val.has("chainDiags"))
            {
                _chainDiags = json_val.getInt("chainDiags");
            }
            base._parseAttr(json_val);
        }
コード例 #14
0
        //--- (YPowerSupply implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("voltageSetPoint"))
            {
                _voltageSetPoint = Math.Round(json_val.getDouble("voltageSetPoint") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("currentLimit"))
            {
                _currentLimit = Math.Round(json_val.getDouble("currentLimit") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("powerOutput"))
            {
                _powerOutput = json_val.getInt("powerOutput") > 0 ? 1 : 0;
            }
            if (json_val.has("voltageSense"))
            {
                _voltageSense = json_val.getInt("voltageSense");
            }
            if (json_val.has("measuredVoltage"))
            {
                _measuredVoltage = Math.Round(json_val.getDouble("measuredVoltage") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("measuredCurrent"))
            {
                _measuredCurrent = Math.Round(json_val.getDouble("measuredCurrent") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("inputVoltage"))
            {
                _inputVoltage = Math.Round(json_val.getDouble("inputVoltage") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("vInt"))
            {
                _vInt = Math.Round(json_val.getDouble("vInt") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("ldoTemperature"))
            {
                _ldoTemperature = Math.Round(json_val.getDouble("ldoTemperature") * 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;
            }
            if (json_val.has("currentAtStartUp"))
            {
                _currentAtStartUp = Math.Round(json_val.getDouble("currentAtStartUp") * 1000.0 / 65536.0) / 1000.0;
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base._parseAttr(json_val);
        }
コード例 #15
0
    //--- (end of generated code: YFileRecord definitions)

    public YFileRecord(string data)
    {
        //--- (generated code: YFileRecord attributes initialization)
        //--- (end of generated code: YFileRecord attributes initialization)
        YAPI.YJSONObject p = new YAPI.YJSONObject(data);
        p.parse();
        this._name = p.getString("name");
        this._size = p.getInt("size");
        this._crc  = p.getInt("crc");
    }
コード例 #16
0
    //--- (end of generated code: YWlanRecord definitions)

    public YWlanRecord(string data)
    {
        //--- (generated code: YWlanRecord attributes initialization)
        //--- (end of generated code: YWlanRecord attributes initialization)
        YAPI.YJSONObject p = new YAPI.YJSONObject(data);
        p.parse();
        this._ssid    = p.getString("ssid");
        this._sec     = p.getString("sec");
        this._rssi    = p.getInt("rssi");
        this._channel = p.getInt("channel");
    }
コード例 #17
0
    //--- (YSegmentedDisplay implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("displayedText"))
        {
            _displayedText = json_val.getString("displayedText");
        }
        if (json_val.has("displayMode"))
        {
            _displayMode = json_val.getInt("displayMode");
        }
        base._parseAttr(json_val);
    }
コード例 #18
0
        //--- (YCarbonDioxide implementation)

        protected override void _parseAttr(YAPI.YJSONObject json_val)
        {
            if (json_val.has("abcPeriod"))
            {
                _abcPeriod = json_val.getInt("abcPeriod");
            }
            if (json_val.has("command"))
            {
                _command = json_val.getString("command");
            }
            base._parseAttr(json_val);
        }
コード例 #19
0
        //--- (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);
        }
コード例 #20
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);
    }
コード例 #21
0
    //--- (YTilt 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");
        }
        base._parseAttr(json_val);
    }
コード例 #22
0
        //--- (YHumidity implementation)

        protected override void _parseAttr(YAPI.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._parseAttr(json_val);
        }
コード例 #23
0
    //--- (YArithmeticSensor implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("description"))
        {
            _description = json_val.getString("description");
        }
        if (json_val.has("command"))
        {
            _command = json_val.getString("command");
        }
        base._parseAttr(json_val);
    }
コード例 #24
0
    //--- (generated code: YFiles implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("filesCount"))
        {
            _filesCount = json_val.getInt("filesCount");
        }
        if (json_val.has("freeSpace"))
        {
            _freeSpace = json_val.getInt("freeSpace");
        }
        base._parseAttr(json_val);
    }
コード例 #25
0
    //--- (YAnButton implementation)

    protected override void _parseAttr(YAPI.YJSONObject json_val)
    {
        if (json_val.has("calibratedValue"))
        {
            _calibratedValue = json_val.getInt("calibratedValue");
        }
        if (json_val.has("rawValue"))
        {
            _rawValue = json_val.getInt("rawValue");
        }
        if (json_val.has("analogCalibration"))
        {
            _analogCalibration = json_val.getInt("analogCalibration") > 0 ? 1 : 0;
        }
        if (json_val.has("calibrationMax"))
        {
            _calibrationMax = json_val.getInt("calibrationMax");
        }
        if (json_val.has("calibrationMin"))
        {
            _calibrationMin = json_val.getInt("calibrationMin");
        }
        if (json_val.has("sensitivity"))
        {
            _sensitivity = json_val.getInt("sensitivity");
        }
        if (json_val.has("isPressed"))
        {
            _isPressed = json_val.getInt("isPressed") > 0 ? 1 : 0;
        }
        if (json_val.has("lastTimePressed"))
        {
            _lastTimePressed = json_val.getLong("lastTimePressed");
        }
        if (json_val.has("lastTimeReleased"))
        {
            _lastTimeReleased = json_val.getLong("lastTimeReleased");
        }
        if (json_val.has("pulseCounter"))
        {
            _pulseCounter = json_val.getLong("pulseCounter");
        }
        if (json_val.has("pulseTimer"))
        {
            _pulseTimer = json_val.getLong("pulseTimer");
        }
        if (json_val.has("inputType"))
        {
            _inputType = json_val.getInt("inputType");
        }
        base._parseAttr(json_val);
    }
コード例 #26
0
ファイル: yocto_relay.cs プロジェクト: stuart2w/SAW
    //--- (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);
    }
コード例 #27
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);
    }
コード例 #28
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);
    }
コード例 #29
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);
    }
コード例 #30
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);
    }