Example #1
0
        private void LockUpdate(uint offset, byte[] lockedBytes = null)
        {
            if (lockedBytes == null)
            {
                lockedBytes = _watchVar.GetByteData(offset);
            }

            var lockedVar = new WatchVariableLock(_watchVar.GetRamAddress(offset, false), lockedBytes);

            Config.Stream.LockedVariables[lockedVar] = lockedVar;
        }
Example #2
0
        public WatchVariableLock GetVariableLock(uint offset)
        {
            var lockCriteria = new WatchVariableLock(_watchVar.GetRamAddress(offset, false), new byte[_watchVar.ByteCount]);

            if (!Config.Stream.LockedVariables.ContainsKey(lockCriteria))
            {
                return(null);
            }

            return(Config.Stream.LockedVariables[lockCriteria]);
        }
        private void SeeLockInfo()
        {
            List <string> lines = new List <string>();

            lines.Add(WatchVariableLock.GetHeaderLine());
            foreach (WatchVariableLock lok in _lockList)
            {
                lines.Add(lok.ToString());
            }
            InfoForm.ShowValue(string.Join("\r\n", lines), "Lock Info", "Lock Info");
        }
Example #4
0
        private void LockUpdate(byte[] lockedBytes = null)
        {
            if (lockedBytes == null)
            {
                lockedBytes = _watchVar.GetByteData(_stream, OtherOffset);
            }

            var lockedVar = new WatchVariableLock(_stream, _watchVar.GetRamAddress(_stream, OtherOffset, false), lockedBytes);

            _stream.LockedVariables[lockedVar] = lockedVar;
        }
Example #5
0
        public WatchVariableLock GetVariableLock()
        {
            var lockCriteria = new WatchVariableLock(_stream, _watchVar.GetRamAddress(_stream, OtherOffset, false), new byte[_watchVar.GetByteCount()]);

            if (!_stream.LockedVariables.ContainsKey(lockCriteria))
            {
                return(null);
            }

            return(_stream.LockedVariables[lockCriteria]);
        }
        public static List <object> GetExistingLockValues(
            WatchVariable variable, List <uint> addresses = null)
        {
            if (LockConfig.LockingDisabled)
            {
                return(null);
            }
            // don't get the locks with values, or there's a stack overflow error
            List <WatchVariableLock> locks        = variable.GetLocksWithoutValues(addresses);
            List <object>            returnValues = new List <object>();

            foreach (WatchVariableLock lok in locks)
            {
                WatchVariableLock existingLock = _lockList.FirstOrDefault(l => l.Equals(lok));
                object            value        = existingLock?.Value;
                returnValues.Add(value);
            }
            return(returnValues);
        }