Пример #1
0
 public ValueStatistics()
 {
     LastProcessedTimestap = DateTime.UtcNow;
     statValues = new List<StatValue>();
     statValues.Add(new StatValue(0, LastProcessedTimestap));
     lastEvent = lastOn = lastOff = new StatValue(0, LastProcessedTimestap);
     historyValues = new TsList<StatValue>();
     historyValues.Add(lastEvent);
 }
Пример #2
0
 public ValueStatistics()
 {
     LastProcessedTimestap = DateTime.UtcNow;
     statValues            = new List <StatValue>();
     statValues.Add(new StatValue(0, LastProcessedTimestap));
     lastEvent     = lastOn = lastOff = new StatValue(0, LastProcessedTimestap);
     historyValues = new TsList <StatValue>();
     historyValues.Add(lastEvent);
 }
Пример #3
0
 public void ProgramAdd(ProgramBlock program)
 {
     automationPrograms.Add(program);
     program.EnabledStateChanged += program_EnabledStateChanged;
     program.Engine.SetHost(homegenie);
     RaiseProgramModuleEvent(program, Properties.ProgramStatus, "Added");
     if (isEngineEnabled && program.IsEnabled)
     {
         program.Engine.StartScheduler();
     }
 }
Пример #4
0
 public void ProgramAdd(ProgramBlock program)
 {
     automationPrograms.Add(program);
     program.EnabledStateChanged += program_EnabledStateChanged;
     program.Engine.SetHost(homegenie);
     // Initialize state
     RaiseProgramModuleEvent(program, Properties.ProgramStatus, "Idle");
     if (program.IsEnabled)
     {
         StartProgramEvaluator(program);
     }
 }
Пример #5
0
        private Store GetStore(string storeName)
        {
            var store = storeList.Find(s => s.Name == storeName);

            // create store if does not exists
            if (store == null)
            {
                store = new Store(storeName);
                storeList.Add(store);
            }
            return(store);
        }
Пример #6
0
 public ValueStatistics()
 {
     LastProcessedTimestap = DateTime.UtcNow;
     statValues            = new List <StatValue>();
     statValues.Add(new StatValue(0, LastProcessedTimestap));
     lastEvent = lastOn = lastOff = new StatValue(0, LastProcessedTimestap);
     historyValues.Add(lastEvent);
     while (historyValues.Count > historyLimit)
     {
         historyValues.RemoveAt(historyValues.Count - 1);
     }
 }
Пример #7
0
 public void ProgramAdd(ProgramBlock program)
 {
     program.SetHost(homegenie);
     automationPrograms.Add(program);
     program.EnabledStateChanged += program_EnabledStateChanged;
     //
     // in case of c# script preload assembly from generated .dll
     if (program.Type.ToLower() == "csharp" && !program.AssemblyLoad())
     {
         program.ScriptErrors = "Program update is required.";
     }
     //
     // Initialize state
     RaiseProgramModuleEvent(program, Properties.PROGRAM_STATUS, "Idle");
     if (program.IsEnabled)
     {
         StartProgramEvaluator(program);
     }
 }