示例#1
0
        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            LightService.Run();

            EnableStatusControlls();
            StartTimer();
        }
示例#2
0
        /// <summary>
        /// Starts the driver. This typcially sets any class variables and hooks
        /// any event handlers such as SerialPort ReceivedBytes, etc.
        /// </summary>
        /// <param name="configFileData">
        ///     Contains the contents of any configuration files specified in the
        ///     ConfigurationFileNames property.
        /// </param>
        /// <returns>Initial driver ready status.</returns>
        public override bool StartDriver(Dictionary <string, byte[]> configFileData)
        {
            // Configure service settings for small request packet performance
            ServicePointManager.Expect100Continue = false;
            ServicePointManager.UseNagleAlgorithm = false;

            // If bridge IP is blank then locate it using MeetHue service
            ConfigureHueBridgeIp();

            // Instantiate a service object for reading and writing data to the Hue gateway
            _lightService = new LightService(Logger, _bridgeIpAddress, _bridgeUserName);

            // Create a timer object that will initiate a poll request to the gateway
            _lightPollingTimer = new Timer
            {
                AutoReset = false
            };
            _lightPollingTimer.Elapsed += PollHueGatewayState;

            // Start the timer to schedule the next poll
            _lightPollingTimer.Start();

            // Driver isn't ready until we get lighting data so return false
            return(false);
        }
示例#3
0
        private void stopButton_Click(object sender, RoutedEventArgs e)
        {
            LightService.Stop();

            DisableStatusControlls();
            StopTimer();
        }
        public static void Main()
        {
            var client = new ElasticClient(new ConnectionSettings(new Uri(Environment.GetEnvironmentVariable("ES_LIGHT_URL"))));

            Configuration.Initialize("newdeveloper");
            LightService.Discover();
            _lights = new LightCollection();

            var health = client.Health(HealthLevel.Cluster);

            string status = health.Status;

            Color esColor = Color.FromName(status);

            if (status == "green")
            {
                esColor = Color.DarkGreen;
            }

            if (health.RelocatingShards > 0)
            {
                esColor = Color.Purple;
            }

            SetAllLights(esColor);
        }
示例#5
0
 private void InitResources()
 {
     chunkService       = gameObject.GetComponent <ChunkService>();
     levelGenerator     = gameObject.GetComponent <LevelGenerator>();
     lightService       = gameObject.GetComponent <LightService>();
     block_sprites      = Resources.LoadAll <Sprite>("Sprites/blocks");
     tilebaseDictionary = tilebase_cfg.GetDico();
     tile_selector      = Instantiate(Resources.Load("Prefabs/tile_selector")) as GameObject;
 }
 public StorageLocationAppService(
     IWMSRepositories <StorageLocation, string> repository,
     IWMSRepositories <StorageLocationType, string> repositoryT,
     IWMSRepositories <Storage, string> repositoryS,
     LightService lightService) : base(repository)
 {
     _repositoryT = repositoryT;
     _repository  = repository;
     _repositoryS = repositoryS;
     LightService = lightService;
 }
示例#7
0
        public void CleanUp()
        {
            if (Service != null)
            {
                Service.Logout();
            }

            if (LightingServices != null)
            {
                foreach (LightingService LightService in LightingServices)
                {
                    LightService.CleanUp();
                }
            }
        }
示例#8
0
 public void Init(int chunkSize, Dictionary <int, TileBase> _tilebaseDictionary, int[,] tilesWorldMap, int[,] tilesLightMap, GameObject player, LightService lightService, int[,] tilesShadowMap)
 {
     playerCam           = player.GetComponentInChildren <Camera>();
     boundX              = tilesMapChunks.GetUpperBound(0);
     boundY              = tilesMapChunks.GetUpperBound(1);
     halfChunk           = chunkSize / 2;
     this.player         = player;
     worldMapTransform   = GameObject.FindGameObjectWithTag("WorldMap").gameObject.transform;
     tilebaseDictionary  = _tilebaseDictionary;
     this.tilesLightMap  = tilesLightMap;
     this.tilesWorldMap  = tilesWorldMap;
     this.chunkSize      = chunkSize;
     this.lightService   = lightService;
     this.tilesShadowMap = tilesShadowMap;
     cacheChunkData      = new ChunkDataModel[boundX, boundY];
     CreatePoolChunk(20, 52);
 }
示例#9
0
        public Shaders()
        {
            Content.RootDirectory = "Content";

            // Komponenten erstellen
            camera       = CameraFactory.CreateCamera(this, CameraType.FreeLookCamera);
            shape        = new Shape(this);
            room         = new Shape(this);
            lightService = new LightService(this);
            crosshair    = new Crosshair(this)
            {
                Visible = false
            };
            effectService      = new EffectService();
            collisionDetection = new CollisionDetection(this);

            // Komponenten zur Engine hinzufügen
            Components.Add(new CameraHandler(this)
            {
                Camera = camera
            });
            Components.Add(camera);
            Components.Add(lightService);
            Components.Add(shape);
            Components.Add(room);
            Components.Add(crosshair);
            Components.Add(collisionDetection);

            // Services hinzufügen
            Services.AddService(typeof(ICameraService), camera);
            Services.AddService(typeof(ILightService), lightService);
            Services.AddService(typeof(IEffectService), effectService);

            // Grafik-Einstellungen
            graphics = new GraphicsDeviceManager(this);
            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.PreferMultiSampling            = true;
            graphics.IsFullScreen              = true;
            graphics.PreferredBackBufferWidth  = 1366;
            graphics.PreferredBackBufferHeight = 768;

            IsFixedTimeStep = true;
        }
 public ReelSupplyTempAppService(
     IWMSRepositories <ReelSupplyTemp, string> repository,
     IWMSRepositories <ReadyMBill, string> repositoryrb,
     IWMSRepositories <ReadyMBillDetailed, string> repositoryrbd,
     IWMSRepositories <Reel, string> repositoryReel,
     IWMSRepositories <StorageLocation, string> repositorySL,
     LightService lightService,
     IWMSRepositories <ReelMoveMethod, string> repositoryRMM,
     IWMSRepositories <MPN, string> repositorympn
     ) : base(repository)
 {
     _repository     = repository;
     _repositoryrb   = repositoryrb;
     _repositoryrbd  = repositoryrbd;
     _repositoryRMM  = repositoryRMM;
     _repositoryReel = repositoryReel;
     _repositorympn  = repositorympn;
     _repositorySL   = repositorySL;
     LightService    = lightService;
 }
示例#11
0
 public ReelAppService(
     IWMSRepositories <Reel, string> repository,
     IWMSRepositories <MPN, string> repositorympn,
     IBarCodeAnalysisAppService barCodeAnalysisAppService,
     IWMSRepositories <StorageLocation, string> repositorysl,
     IWMSRepositories <ReelSupplyTemp, string> repositoryReelSupplyTemp,
     IWMSRepositories <ReelMoveLog, string> repositoryReelMoveLog,
     IWMSRepositories <ReadyMBillDetailed, string> repositoryReadyMBilld,
     IWMSRepositories <ReceivedReelBill, string> repositoryrrb,
     // IWMSRepositories<ReadySlot, string> repositoryReadySlot,
     IWMSRepositories <ReadyMBill, string> repositoryReadyMBill,
     IWMSRepositories <StorageArea, string> repositorysStorageA,
     IWMSRepositories <MPNStorageAreaMap, string> repositorysMPNA,
     IWMSRepositories <Storage, string> repositorysStorage,
     IWMSRepositories <Slot, string> repositorySlot,
     IWMSRepositories <Setting, long> repositoryT,
     LightService lightService,
     IWMSRepositories <ReelSendTemp, string> repositoryRST,
     IWMSRepositories <ReelMoveMethod, string> repositoryRMM) : base(repository)
 {
     _repository = repository;
     _barCodeAnalysisAppService = barCodeAnalysisAppService;
     _repositoryRMM             = repositoryRMM;
     _repositorympn             = repositorympn;
     _repositorysl             = repositorysl;
     _repositoryReelMoveLog    = repositoryReelMoveLog;
     _repositoryReadyMBilld    = repositoryReadyMBilld;
     _repositoryRST            = repositoryRST;
     _repositoryReelSupplyTemp = repositoryReelSupplyTemp;
     _repositoryrrb            = repositoryrrb;
     _repositorysStorageA      = repositorysStorageA;
     _repositoryT = repositoryT;
     // _repositoryReadySlot = repositoryReadySlot;
     LightService          = lightService;
     _repositoryReadyMBill = repositoryReadyMBill;
     _repositorySlot       = repositorySlot;
     _repositorysMPNA      = repositorysMPNA;
     _repositorysStorage   = repositorysStorage;
 }
示例#12
0
        protected override async Task OnParametersSetAsync()
        {
            switch (Page)
            {
            case null:
            case "lights":
                if (Lights is null)
                {
                    Lights = await LightService.GetAllAsync();
                }
                break;

            case "heats":
                if (Heats is null)
                {
                    Heats = await HeatService.GetAllAsync();
                }
                break;

            case "courts":
                if (Courts is null)
                {
                    Courts = await CourtService.GetAllAsync();
                }
                break;

            case "rates":
                if (Rates is null)
                {
                    Rates = await RatesService.GetAllAsync();
                }
                break;

            default:
                throw new KeyNotFoundException("Dashboard nested page not found!");
            }
        }
示例#13
0
 public void Init(int _chunkSize, Dictionary <int, TileBase> _tilebaseDictionary, int[,] _tilesWorldMap, float[,] _tilesLightMap, GameObject _player, Tilemap _tilemapLight, Tilemap _tilemapWall, GameObject[,] _tilesObjetMap, CycleDay _cycleDay, LightService _lightService, float[,] _tilesShadowMap, Tilemap _tilemapShadow)
 {
     boundX             = tilesMapChunks.GetUpperBound(0);
     boundY             = tilesMapChunks.GetUpperBound(1);
     halfChunk          = _chunkSize / 2;
     player             = _player;
     worldMapTransform  = GameObject.FindGameObjectWithTag("WorldMap").gameObject.transform;
     tilebaseDictionary = _tilebaseDictionary;
     tilesLightMap      = _tilesLightMap;
     tilesWorldMap      = _tilesWorldMap;
     tilemapWall        = _tilemapWall;
     chunkSize          = _chunkSize;
     tilemapLight       = _tilemapLight;
     tilesObjetMap      = _tilesObjetMap;
     cycleDay           = _cycleDay;
     tilesObjetMap      = _tilesObjetMap;
     lightService       = _lightService;
     tilesShadowMap     = _tilesShadowMap;
     tilemapShadow      = _tilemapShadow;
     tilemapWall.GetComponent <TileMapScript>().tilesWorldMap = tilesWorldMap;
     // CreatePoolChunk(6, 25); // cas pour 32 tiles
     CreatePoolChunk(3, 13); // cas pour 64 tiles
     // RenderPartialMapForTest(); // for debug map
 }
示例#14
0
 public LightController(ApplicationContext context)
 {
     _service = new LightService(context);
 }
示例#15
0
        private async void lightTimer_Tick(object sender, EventArgs e)
        {
            var data = await LightService.GetTemperaturesAsync();

            TranslateTemperatures.Invoke(data);
        }
示例#16
0
        protected override async Task OnInitializedAsync()
        {
            _lights = await LightService.GetAllAsync();

            _heats = await HeatService.GetAllAsync();
        }
示例#17
0
        private async void checkButton_Click(object sender, RoutedEventArgs e)
        {
            var data = await LightService.GetTemperaturesAsync();

            UpdateTemperatures(data);
        }
 public void Setup()
 {
     _LightService = new LightService();
 }
示例#19
0
 protected override async Task OnInitializedAsync() =>
 Lights = await LightService.GetAllAsync();
示例#20
0
 public void DiscoverNewLights()
 {
     Configuration.Initialize("36e02089265925772f085fcd3884ec9b");
     LightService.Discover();
 }
示例#21
0
        public void Init()
        {
            #region Device Setup
            CreateDeviceAndSwapChain();
            deviceContext = device.ImmediateContext;

            swapChain.GetParent <Factory>().MakeWindowAssociation(renderForm.Handle, WindowAssociationFlags.IgnoreAll);

            this.backBuffer  = Texture2D.FromSwapChain <Texture2D>(swapChain, 0);
            renderTargetView = new RenderTargetView(device, backBuffer);

            deviceContext.OutputMerger.SetRenderTargets(renderTargetView);

            viewport = new Viewport(0, 0, width, height);
            deviceContext.Rasterizer.SetViewport(viewport);
            deviceContext.Rasterizer.SetScissorRectangle(0, 0, renderForm.ClientSize.Width, renderForm.ClientSize.Height);
            renderState = new RasterizerState(device, new RasterizerStateDescription()
            {
                CullMode                 = CullMode.Back,
                DepthBias                = 0,
                DepthBiasClamp           = 0,
                FillMode                 = FillMode.Solid,
                IsAntialiasedLineEnabled = false,
                IsDepthClipEnabled       = true,
                IsFrontCounterClockwise  = false,
                IsMultisampleEnabled     = true,
                IsScissorEnabled         = false,
                SlopeScaledDepthBias     = 0
            });
            deviceContext.Rasterizer.State = renderState;

            depthBuffer = new Texture2D(device, new Texture2DDescription()
            {
                Format            = Format.D32_Float_S8X24_UInt,
                ArraySize         = 1,
                MipLevels         = 1,
                Width             = renderForm.ClientSize.Width,
                Height            = renderForm.ClientSize.Height,
                SampleDescription = new SampleDescription(1, 0),
                Usage             = ResourceUsage.Default,
                BindFlags         = BindFlags.DepthStencil,
                CpuAccessFlags    = CpuAccessFlags.None,
                OptionFlags       = ResourceOptionFlags.None
            });
            depthStencilView = new DepthStencilView(device, depthBuffer);
            deviceContext.OutputMerger.SetTargets(depthStencilView, renderTargetView);
            deviceContext.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList;
            #endregion

            RegisterServices();

            this.renderService = engine.Services.GetService <RenderService>();
            this.lightService  = engine.Services.GetService <LightService>();

            renderService.Init();

            //Constant Buffers
            perFrameBuffer         = engine.Services.GetService <BufferFactory>().CreateConstantBuffer <PerFrameCB>();
            perObjectBuffer        = engine.Services.GetService <BufferFactory>().CreateConstantBuffer <PerObjectCB>();
            PointLightBuffer       = engine.Services.GetService <BufferFactory>().CreateConstantBuffer(SharpDX.Utilities.SizeOf <PointLightStructure>() * Constants.MaxLightCounts.POINT);
            DirectionalLightBuffer = engine.Services.GetService <BufferFactory>().CreateConstantBuffer(SharpDX.Utilities.SizeOf <DirectionalLightStructure>() * Constants.MaxLightCounts.DIRECTIONAL);

            renderService.RegisterConstantBuffer(Constants.ConstantBufferNames.PER_FRAME_CB, perFrameBuffer, ConstantBufferType.PixelShader);
            renderService.RegisterConstantBuffer(Constants.ConstantBufferNames.POINT_LIGHT_CB, PointLightBuffer, ConstantBufferType.PixelShader);
            renderService.RegisterConstantBuffer(Constants.ConstantBufferNames.DIRECTIONAL_LIGHT_CB, DirectionalLightBuffer, ConstantBufferType.PixelShader);
            renderService.RegisterConstantBuffer(Constants.ConstantBufferNames.PER_OBJECT_CB, perObjectBuffer, ConstantBufferType.VertexShader);

            renderForm.Show();
        }
示例#22
0
        protected async Task Select(Guid key)
        {
            Light = await LightService.GetOneAsync(key);

            StateHasChanged();
        }