Exemplo n.º 1
0
 private void SaveAllowKeys(IAllowKeys args)
 {
     _allowKeys = args.CanAllowKeys;
     if (!_allowKeys)
     {
         _currentSwitchFunction = SwitchFunction.Unset;
     }
 }
Exemplo n.º 2
0
 private bool MustActivateKeysFirst_GOUI()
 {
     if (_currentSwitchFunction != SwitchFunction.GOUI)
     {
         _currentSwitchFunction = SwitchFunction.GOUI;
         SwitchType             = SwitchType.Activate;
         ChangeControls?.Invoke(this);
         _switcher.UseGOUISwitcher(SwitchType);
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 private bool MustActivateKeysFirst_Switch()
 {
     if (_currentSwitchFunction != SwitchFunction.UI)
     {
         _currentSwitchFunction = SwitchFunction.UI;
         SwitchType             = SwitchType.Activate;
         ChangeControls?.Invoke(this);
         _homeGroup.SwitchHomeGroups(SwitchType);
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
    private bool MustActivateKeysFirst_Branch()
    {
        if (_currentSwitchFunction != SwitchFunction.Branch)
        {
            _currentSwitchFunction = SwitchFunction.Branch;
            SwitchType             = SwitchType.Activate;
            ChangeControls?.Invoke(this);

            var activeBranch = _myDataHub.ActiveBranch;
            activeBranch.GroupIndex = BranchGroups.SwitchBranchGroup(activeBranch.BranchGroupsList,
                                                                     activeBranch.GroupIndex,
                                                                     SwitchType.Activate);
            return(true);
        }
        return(false);
    }
Exemplo n.º 5
0
        /***Float Switch Activated***/
        public static bool GetWaterLevelGroupSwitchesActivated(string name, SwitchFunction function = SwitchFunction.ATO)
        {
            CheckWaterLevelGroupKey(name);
            bool activated = true;

            foreach (var switchName in waterLevelGroups[name].floatSwitches)
            {
                var floatSwitch = Sensors.FloatSwitches.GetGadget(switchName) as FloatSwitch;
                if (floatSwitch.switchFuntion == function)
                {
                    // Using AND because we want all the switches to be activated
                    activated &= floatSwitch.activated;
                }
            }
            return(activated);
        }
Exemplo n.º 6
0
 private void SaveOnHomeScreen(IOnHomeScreen args)
 {
     _currentSwitchFunction = SwitchFunction.Unset;
     _onHomeScreen          = args.OnHomeScreen;
 }