예제 #1
0
        public void Stop()
        {
            if (calculatorGraph == null)
            {
                return;
            }

            // TODO: not to call CloseAllPacketSources if calculatorGraph has not started.
            using (var status = calculatorGraph.CloseAllPacketSources()) {
                if (!status.ok)
                {
                    Logger.LogError(TAG, status.ToString());
                }
            }

            using (var status = calculatorGraph.WaitUntilDone()) {
                if (!status.ok)
                {
                    Logger.LogError(TAG, status.ToString());
                }
            }

            nameTable.Remove(calculatorGraph.mpPtr);
            calculatorGraph.Dispose();
            calculatorGraph = null;

            if (stopwatch != null && stopwatch.IsRunning)
            {
                stopwatch.Stop();
            }

            OnOutput.RemoveAllListeners();
        }
예제 #2
0
        public void LifecycleMethods_ShouldControlGraphLifeCycle()
        {
            var graph = new CalculatorGraph(validConfigText);

            Assert.True(graph.StartRun().ok);
            Assert.False(graph.GraphInputStreamsClosed());

            Assert.True(graph.WaitUntilIdle().ok);
            Assert.True(graph.CloseAllPacketSources().ok);
            Assert.True(graph.GraphInputStreamsClosed());
            Assert.True(graph.WaitUntilDone().ok);
            Assert.False(graph.HasError());
        }
예제 #3
0
    public void Stop()
    {
        if (graph != null)
        {
            var status = graph.CloseAllPacketSources();

            if (!status.ok)
            {
                Debug.LogError(status.ToString());
            }
            graph.WaitUntilDone().AssertOk();
        }
    }
예제 #4
0
    public void Stop()
    {
        if (graph == null)
        {
            return;
        }

        using (var status = graph.CloseAllPacketSources()) {
            if (!status.ok)
            {
                Debug.LogError(status.ToString());
            }
        }

        using (var status = graph.WaitUntilDone()) {
            if (!status.ok)
            {
                Debug.LogError(status.ToString());
            }
        }
    }