Ejemplo n.º 1
0
        private List <AutomaticOverviewEntry> GetAutomaticEntries()
        {
            List <AutomaticOverviewEntry> returnval = new List <AutomaticOverviewEntry>();
            ChannelsData loadFromDataBase           = DataBaseObjectStorage.LoadFromDataBase(ChannelsData.CreateNew);

            foreach (ChannelData channel in loadFromDataBase.Channels)
            {
                returnval.AddRange(GetAutomaticEntries(channel, channel));
            }

            return(returnval);
        }
Ejemplo n.º 2
0
        private List <ManualOverviewEntry> GetManualEnties()
        {
            List <ManualOverviewEntry> returnval = new List <ManualOverviewEntry>();
            int count = 0;

            //TODO: Group by Name, create Duration if it doesn't exists set startetime to entime from last execution
            ChainScheduleManager <ManualChainedActionExecution> loadedData = DataBaseObjectStorage.LoadFromDataBase(() => new ChainScheduleManager <ManualChainedActionExecution>());

            foreach (ChainScheduleManager <ManualChainedActionExecution> .ChainedExecutionData chainedExecutionData in loadedData.Jobs)
            {
                returnval.Add(new ManualOverviewEntry()
                {
                    StartTime          = chainedExecutionData.StartTime,
                    ActionName         = chainedExecutionData.ElementEventSource,
                    ActivationPriority = count++,
                    ChannelName        = GetChannelName(chainedExecutionData.ChainedActionExecutionData.ManualActionExecution.ChannelId),
                    EndTime            = chainedExecutionData.StartTime + chainedExecutionData.Duration,
                    MasterEnabled      = chainedExecutionData.ChainedActionExecutionData.ManualActionExecution.ActivateMasterChannel
                });
            }

            return(returnval);
        }
Ejemplo n.º 3
0
 public ActionResult Put([FromBody] ManualData manualDataData)
 {
     DataBaseObjectStorage.SaveToDataBase(manualDataData);
     return(NoContent());
 }
Ejemplo n.º 4
0
 public ActionResult <ManualData> Get() => Ok(DataBaseObjectStorage.LoadFromDataBase <ManualData>(ManualData.CreateNew));
Ejemplo n.º 5
0
        public ActionResult DeleteManualEntry(int number)
        {
            ChainScheduleManager <ManualChainedActionExecution> .DeleteEntry(DataBaseObjectStorage.LoadFromDataBase(() => new ChainScheduleManager <ManualChainedActionExecution>()).Jobs[number]);

            return(Ok());
        }
Ejemplo n.º 6
0
 public ActionResult Put([FromBody] ChannelsData channelsDatalDataData)
 {
     DataBaseObjectStorage.SaveToDataBase(channelsDatalDataData);
     AutomaticScheduler.Setup(channelsDatalDataData);
     return(NoContent());
 }
Ejemplo n.º 7
0
 public ActionResult <ChannelsData> Get() => Ok(DataBaseObjectStorage.LoadFromDataBase <ChannelsData>(ChannelsData.CreateNew));