Пример #1
0
        public void Run()
        {
            if (_applet == null)
            {
                return;
            }

            _applet.Connect();

            _device = null;
            _waitAre.WaitOne();

            do
            {
                if (_monoArrived)
                {
                    _device = (LcdDeviceMonochrome)_applet.OpenDeviceByType(LcdDeviceType.Monochrome);
                    _device.SoftButtonsChanged += _device_SoftButtonsChanged;
                    Draw();
                }

                if (_applet.IsEnabled && _device != null && !_device.IsDisposed)
                {
                    _device.DoUpdateAndDraw();
                }
            } while (!_mustExit);

            if (_applet.IsEnabled && _device != null && !_device.IsDisposed)
            {
                _device.DoUpdateAndDraw();
            }

            Thread.Sleep(5);
        }
Пример #2
0
        static void Main(string[] args)
        {
            if (args.Length >= 1)
            {
                _logEnabled = (args[0] == "-debug");
                ConsoleReporter.Report(String.Format("Log {0}", (_logEnabled) ? "enabled" : "disabled"), ConsoleReporter.ReportStatus.Info, _logEnabled);
            }

            Console.WriteLine("{0}\nVersion {1}\n{2}\n", Constants.APP_NAME.ToUpper(), Constants.APP_VERSION, Constants.APP_COPYRIGHT);

            InitDB();
            InitApp();
            InitSettings();

            _device = null;
            _waitAre.WaitOne();
            ConsoleReporter.Report("WaitOne done", ConsoleReporter.ReportStatus.None, _logEnabled);

            do
            {
                if (_monoArrived)
                {
                    ConsoleReporter.Report("Mono Device arrived", ConsoleReporter.ReportStatus.Info, _logEnabled);
                    if (_device == null)
                    {
                        _device = (LcdDeviceMonochrome)_applet.OpenDeviceByType(LcdDeviceType.Monochrome);
                        _device.SoftButtonsChanged += _device_SoftButtonsChanged;
                        InitGraphics(_device);
                    }
                    else
                    {
                        _device.ReOpen();
                    }

                    _monoArrived = false;
                }

                if (_applet.IsEnabled && _device != null && !_device.IsDisposed)
                {
                    _device.DoUpdateAndDraw();
                }
            } while (!_mustExit);

            if (_applet.IsEnabled && _device != null && !_device.IsDisposed)
            {
                _device.DoUpdateAndDraw();
            }

            ConsoleReporter.Report("Applet done! Quitting...", ConsoleReporter.ReportStatus.Process, _logEnabled);
            Thread.Sleep(10);
        }
Пример #3
0
 void UpdatedTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (_Device != null && !_Device.IsDisposed)
     {
         _Device.DoUpdateAndDraw();
     }
 }
        private void applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            device_ = applet_.OpenDeviceByType(e.DeviceType);
            device_.SoftButtonsChanged += new EventHandler <LcdSoftButtonsEventArgs>(buttonPressed);

            settings_.setDevice(device_);
            device_.SetAsForegroundApplet = settings_.alwaysOnTop_;

            Screen startupScreen = new StartupScreen(device_, device_.DeviceType, null, this, 0);

            lcdScreenList_.Add(startupScreen);

            device_.CurrentPage = startupScreen;

            device_.DoUpdateAndDraw();

            if (mbApiInterface_.Player_GetPlayState() == PlayState.Playing)
            {
                openScreens();
            }
        }