public override void Next() { if (backChangingHistory.Count >= maxBackChangingHistoryCapacity) { backChangingHistory.RemoveAt(0); } backChangingHistory.Add(new DiskAndTrack(DiskNumber, TrackNumber, FileName)); if (nextChangingHistory.Count > 0) { var history = (DiskAndTrack)nextChangingHistory.Pop(); DiskNumber = history.diskNumber; TrackNumber = history.trackNumber; FileName = history.fileName; OnTrackChanged(); } else { while (NextTracksQueue.Count == 0) { } var preparedItem = (DiskAndTrack)NextTracksQueue.Dequeue(); DiskNumber = preparedItem.diskNumber; TrackNumber = preparedItem.trackNumber; FileName = preparedItem.fileName; OnTrackChanged(); generateNextTrackQueue.Enqueue(1); } }
void SendCommand(string command, string param = null) { if (param != null) { command += param; } lastCommand = command; queue.Enqueue("AT#" + command); }
public static void Reboot() { commands.Enqueue(new HttpRequestCommand("reboot", response => { Logger.Warning("REBOOTED."); Thread.Sleep(1000); if (CheckStatusThread.ThreadState == ThreadState.Suspended || CheckStatusThread.ThreadState == ThreadState.SuspendRequested) { CheckStatusThread.Resume(); } })); }
public static void EnqueueMessage(Message m) { if (iBus is SerialPortHub) { SendMessage(m); return; } #if DEBUG m.PerformanceInfo.TimeEnqueued = DateTime.Now; #endif messageWriteQueue.Enqueue(m); }
internal static void ResetBoard() { Logger.Trace("Board will reset in 2 seconds!!!"); FrontDisplay.RefreshLEDs(LedType.RedBlinking, append: true); LedBlinkingQueueThreadWorker.Enqueue(new LedBlinkingItem(orangeLed, 2, 200)); requestIgnitionStateTimer?.Dispose(); UnmountMassStorage(); FrontDisplay.RefreshLEDs(LedType.Empty); #if OnBoardMonitorEmulator System.Windows.MessageBox.Show("Board was resetted"); #endif #if DEBUG || DebugOnRealDeviceOverFTDI if (Debugger.IsAttached) { return; } #endif if (resetPin == null) { resetPin = new OutputPort(Pin.ResetPin, false); } }
public void SendCommand(string command, Link link = Link.Control) { /*if (isSleeping) * { * isSleeping = false; * SendCommand(" AT"); // wakes up after SLEEP * }*/ if (link == Link.Control) { lastControlCommand = command; } object cmd; if (!IsMuxMode) { cmd = command; } else { cmd = new MuxCommand(command, link); } queue.Enqueue(cmd); }
public void EnqueueMessage(Message m) { #if DEBUG m.PerformanceInfo.TimeEnqueued = DateTime.Now; #endif try { messageWriteQueue.Enqueue(m); } catch (Exception ex) { throw ex; } }
void EnqueueIPodCommand(iPodCommand command) { iPodCommands.Enqueue(command); }
public static void ButtonHeaterDriverPress() { queueWorker.Enqueue(QueueCommand.ButtonHeaterDriver); }
static Comfort() { commands = new QueueThreadWorker(ProcessCommand); InstrumentClusterElectronics.SpeedRPMChanged += (e) => { if (needLockDoors && e.Speed > DoorsLockSpeed) { if (AutoLockDoors) { BodyModule.LockDoors(); } needLockDoors = false; needUnlockDoors = true; } if (e.Speed == 0) { needLockDoors = true; } }; InstrumentClusterElectronics.IgnitionStateChanged += (e) => { if (!needComfortClose && e.CurrentIgnitionState != IgnitionState.Off && e.PreviousIgnitionState == IgnitionState.Off) { needComfortClose = true; } if (needUnlockDoors && e.CurrentIgnitionState == IgnitionState.Off) { if (AutoUnlockDoors) { BodyModule.UnlockDoors(); } needUnlockDoors = false; needLockDoors = true; } }; BodyModule.RemoteKeyButtonPressed += (e) => { if (e.Button == RemoteKeyButton.Lock && needComfortClose) { needComfortClose = false; if (AutoCloseWindows) { commands.Enqueue(Command.FullCloseWindows); } if (AutoCloseSunroof) { BodyModule.CloseSunroof(); } if (AutoFoldMirrors) { BodyModule.FoldMirrors(); } } if (e.Button == RemoteKeyButton.Unlock) { if (AutoUnfoldMirrors) { BodyModule.UnfoldMirrors(); } } }; }
public static void EnqueueRawMessage(byte[] m) { messageWriteQueue.Enqueue(m); }
public static void BlinkLamps() { commands.Enqueue(Command.BlinkLamps); }