예제 #1
0
        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);
            }
        }
예제 #2
0
 void SendCommand(string command, string param = null)
 {
     if (param != null)
     {
         command += param;
     }
     lastCommand = command;
     queue.Enqueue("AT#" + command);
 }
예제 #3
0
 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();
         }
     }));
 }
예제 #4
0
 public static void EnqueueMessage(Message m)
 {
     if (iBus is SerialPortHub)
     {
         SendMessage(m);
         return;
     }
     #if DEBUG
     m.PerformanceInfo.TimeEnqueued = DateTime.Now;
     #endif
     messageWriteQueue.Enqueue(m);
 }
예제 #5
0
        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);
            }
        }
예제 #6
0
        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);
        }
예제 #7
0
        public void EnqueueMessage(Message m)
        {
#if DEBUG
            m.PerformanceInfo.TimeEnqueued = DateTime.Now;
#endif
            try
            {
                messageWriteQueue.Enqueue(m);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #8
0
 void EnqueueIPodCommand(iPodCommand command)
 {
     iPodCommands.Enqueue(command);
 }
예제 #9
0
파일: E65Seats.cs 프로젝트: sn4men/imBMW
 public static void ButtonHeaterDriverPress()
 {
     queueWorker.Enqueue(QueueCommand.ButtonHeaterDriver);
 }
예제 #10
0
        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();
                    }
                }
            };
        }
예제 #11
0
파일: Manager.cs 프로젝트: sink1/imBMW-1
 public static void EnqueueRawMessage(byte[] m)
 {
     messageWriteQueue.Enqueue(m);
 }
예제 #12
0
 public static void BlinkLamps()
 {
     commands.Enqueue(Command.BlinkLamps);
 }