public void InterlockCloseTest() { bool TestCondition = true; foreach (Switch inputTrue in InputsTrue) { TestCondition &= inputTrue.SwitchConducting; } foreach (Switch inputFalse in InputsFalse) { TestCondition &= !inputFalse.SwitchConducting; } if (TestCondition || TestConditionOverride) { Debug.Log("InterlockTest passed"); AlarmWindow.instance.SetMessage("Sub_S42", gameObject.name, this.GetType().Name, "InterlockTest passed", "INFO"); TriggerEvent.Invoke(); } else { BlockEvent.Invoke(); Debug.Log("InterlockTest blocked"); operateDialog.SetOperateResult(-1); AlarmWindow.instance.SetMessage("Sub_S42", gameObject.name, this.GetType().Name, "InterlockTest blocked", "ERROR"); } }
public void OpenSwitch() { if (inTransition == false) { if (operateDialog != null) { operateDialog.SetOperateResult(1); } AlarmWindow.instance.SetMessage("Sub_S42", gameObject.name, Name, "Operate open", "INFO"); StartCoroutine("Open"); } else { AlarmWindow.instance.SetMessage("Sub_S42", gameObject.name, Name, "Cannot operate moving switch", "ERROR"); Debug.Log("cannot open moving switch"); if (operateDialog != null) { operateDialog.SetOperateResult(-3); } } }