public PlayerPageViewModel(
            INavigationService navigationService,
            ITranslationService translationService,
            IDeviceManager deviceManager,
            IDialogService dialogService,
            IGameControllerService gameControllerService,
            IUIThreadService uIThreadService,
            IPlayLogic playLogic,
            NavigationParameters parameters)
            : base(navigationService, translationService)
        {
            _deviceManager         = deviceManager;
            _dialogService         = dialogService;
            _gameControllerService = gameControllerService;
            _uIThreadService       = uIThreadService;
            _playLogic             = playLogic;

            Creation      = parameters.Get <Creation>("creation");
            ActiveProfile = Creation.ControllerProfiles.First();

            CollectDevices();

            BuWizzOutputLevelChangedCommand  = new SafeCommand <int>(level => ChangeOutputLevel(level, _buwizzDevices));
            BuWizz2OutputLevelChangedCommand = new SafeCommand <int>(level => ChangeOutputLevel(level, _buwizz2Devices));
        }
 public PoweredUpDevice(
     string name,
     string address,
     byte[] deviceData,
     IDeviceRepository deviceRepository,
     IUIThreadService uiThreadService,
     IBluetoothLEService bleService)
     : base(name, address, deviceRepository, uiThreadService, bleService)
 {
 }
예제 #3
0
파일: Device.cs 프로젝트: arionlos/1
        internal Device(string name, string address, IDeviceRepository deviceRepository, IUIThreadService uiThreadService)
        {
            _deviceRepository = deviceRepository;
            _uiThreadService  = uiThreadService;

            _name        = name;
            Address      = address;
            _deviceState = DeviceState.Disconnected;
            _outputLevel = DefaultOutputLevel;
        }
예제 #4
0
 public DeviceManager(
     IBluetoothDeviceManager bluetoothDeviceManager,
     IInfraredDeviceManager infraredDeviceManager,
     IDeviceRepository deviceRepository,
     DeviceFactory deviceFactory,
     IUIThreadService uiThreadService)
 {
     _bluetoothDeviceManager = bluetoothDeviceManager;
     _infraredDeviceManager  = infraredDeviceManager;
     _deviceRepository       = deviceRepository;
     _deviceFactory          = deviceFactory;
     _uiThreadService        = uiThreadService;
 }
예제 #5
0
        public DevicePageViewModel(
            INavigationService navigationService,
            ITranslationService translationService,
            IDeviceManager deviceManager,
            IDialogService dialogService,
            IUIThreadService uIThreadService,
            NavigationParameters parameters)
            : base(navigationService, translationService)
        {
            _deviceManager   = deviceManager;
            _dialogService   = dialogService;
            _uIThreadService = uIThreadService;

            Device = parameters.Get <Device>("device");

            RenameCommand = new SafeCommand(async() => await RenameDeviceAsync());
            BuWizzOutputLevelChangedCommand  = new SafeCommand <int>(outputLevel => SetBuWizzOutputLevel(outputLevel));
            BuWizz2OutputLevelChangedCommand = new SafeCommand <int>(outputLevel => SetBuWizzOutputLevel(outputLevel));
        }
        public ChannelSetupPageViewModel(
            INavigationService navigationService,
            ITranslationService translationService,
            IDeviceManager deviceManager,
            IDialogService dialogService,
            IUIThreadService uIThreadService,
            NavigationParameters parameters)
            : base(navigationService, translationService)
        {
            _deviceManager   = deviceManager;
            _dialogService   = dialogService;
            _uIThreadService = uIThreadService;

            Device         = parameters.Get <Device>("device");
            Action         = parameters.Get <ControllerAction>("controlleraction");
            ServoBaseAngle = Action.ServoBaseAngle;

            SaveChannelSettingsCommand = new SafeCommand(async() => await SaveChannelSettingsAsync());
            AutoCalibrateServoCommand  = new SafeCommand(async() => await AutoCalibrateServoAsync());
            ResetServoBaseCommand      = new SafeCommand(async() => await ResetServoBaseAngleAsync());
        }
예제 #7
0
파일: SBrickDevice.cs 프로젝트: arionlos/1
 public SBrickDevice(string name, string address, IDeviceRepository deviceRepository, IUIThreadService uiThreadService, IBluetoothLEService bleService)
     : base(name, address, deviceRepository, uiThreadService, bleService)
 {
 }
예제 #8
0
 public InfraredDevice(string name, string address, IInfraredDeviceManager infraredDeviceManager, IUIThreadService uiThreadService, IDeviceRepository deviceRepository)
     : base(name, address, deviceRepository, uiThreadService)
 {
     _infraredDeviceManager = infraredDeviceManager;
 }
예제 #9
0
 public BuWizz2Device(string name, string address, byte[] deviceData, IDeviceRepository deviceRepository, IUIThreadService uiThreadService, IBluetoothLEService bleService)
     : base(name, address, deviceRepository, uiThreadService, bleService)
 {
     // On BuWizz2 with manufacturer data 0x4e054257001e the ports are swapped
     // (no normal BuWizz2es manufacturer data is 0x4e054257001b)
     _swapChannels = deviceData != null && deviceData.Length >= 6 && deviceData[5] == 0x1E;
 }