public ControllerStateHistory ActivateState(ISqLiteContext ctx, ControllerStateInformation controllerStateInformation, DateTime startTime)
        {
            var history = _entityFactory.CreateStateHistory(controllerStateInformation, startTime);

            ctx.Add(history);

            return(history);
        }
Exemple #2
0
        void InsertControllerState(ISqLiteContext ctx, Controller controller, IControllerState controllerState)
        {
            var stateModel = new ControllerStateInformation();

            stateModel.State            = controllerState.State;
            stateModel.PowerConsumption = controllerState.PowerConsumption;
            stateModel.Controller       = controller;

            ctx.Add(stateModel);
        }
Exemple #3
0
        Controller InsertController(ISqLiteContext ctx, IMqttAdapter mqttAdapter)
        {
            var controller = _entityFactory.CreateController();

            controller.Identifier = mqttAdapter.Identifier;
            controller.Type       = mqttAdapter.Type;
            controller.InitializationArguments = _jsonSerializerService.Serialize(mqttAdapter.GetInitializationArguments());

            ctx.Add(controller);

            return(controller);
        }