Defines additional methods for a StateMachine
コード例 #1
0
ファイル: Boiler.cs プロジェクト: yuriik83/UA-.NET
        /// <summary>
        /// Called when the program changes state.
        /// </summary>
        public void Simulation_TransitionInitiated(OperationContext context, StateMachine machine, StateMachineTransitionEventArgs e)
        {
            lock (DataLock)
            {
                switch (e.ToState.Name)
                {
                    case Opc.Ua.BrowseNames.Ready:
                    {
                        if (m_timer != null)
                        {
                            m_timer.Dispose();
                            m_timer = null;
                        }

                        break;
                    }

                    case Opc.Ua.BrowseNames.Suspended:
                    case Opc.Ua.BrowseNames.Halted:
                    {
                        if (m_timer != null)
                        {
                            m_timer.Dispose();
                            m_timer = null;
                        }

                        break;
                    }

                    case Opc.Ua.BrowseNames.Running:
                    {
                        OnStartSimulation();
                        break;
                    }
                }
            }
        }