Esempio n. 1
0
        public bool SetSessionId(uint sessionId, bool commit)
        {
            bool failed = false;

            failed |= OmApi.OM_FAILED(OmApi.OmSetSessionId(deviceId, sessionId));
            if (commit)
            {
                failed |= OmApi.OM_FAILED(OmApi.OmCommit(deviceId));
            }

//validData = false;
            if (!failed)
            {
                this.sessionId = sessionId;
            }

            hasChanged = true;
            om.OnChanged(new OmDeviceEventArgs(this));
            return(!failed);
        }
Esempio n. 2
0
        public bool SetInterval(DateTime start, DateTime stop)
        {
            bool failed = false;

            failed |= OmApi.OM_FAILED(OmApi.OmSetDelays(deviceId, OmApi.OmDateTimePack(start), OmApi.OmDateTimePack(stop)));
            if (!failed)
            {
                failed |= OmApi.OM_FAILED(OmApi.OmCommit(deviceId));
            }

//validData = false;
            if (!failed)
            {
                this.startTime = start;
                this.stopTime  = stop;
            }

            hasChanged = true;
            om.OnChanged(new OmDeviceEventArgs(this));
            return(!failed);
        }