private string ToDotGraph()
 {
     return(UmlDotGraph.Format(_machine.GetInfo()));
 }
Пример #2
0
 public string AsDiagram()
 {
     return(UmlDotGraph.Format(_machine.GetInfo()));
 }
 public string GetDotGraph() => UmlDotGraph.Format(_processStateMachine.GetInfo());
Пример #4
0
 public string GetDiGraph()
 {
     return(UmlDotGraph.Format(this.Machine.GetInfo()));
 }
        public VirtualPaintingView()
        {
            InitializeComponent();

            Loaded += (s, e) =>
            {
                Point canvasViewTopLeftPoint = this.canvasView.TranslatePoint(new Point(), this);
                this.bodyPresenceArea = new Rect(canvasViewTopLeftPoint.X, canvasViewTopLeftPoint.Y, this.canvasView.ActualWidth, this.canvasView.ActualHeight);

                if (Settings.IsDebugViewEnabled)
                {
                    DrawRect(this.bodyPresenceArea, this.hitTestingFrame);
                }

                Skeleton.CanvasScreen = this.userPointerCanvas;
                Skeleton.CameraView   = this.bodyPresenceArea;

                for (int i = 0; i < this.skeletons.Count; i++)
                {
                    this.skeletons[i] = new Skeleton();
                }
            };

            Unloaded += (s, e) =>
            {
                this.timer?.Stop();
                this.countdownTimer?.Stop();

                this.colorReader?.Dispose();
                this.bodyReader?.Dispose();
                this.sensor?.Close();
            };

            this.timer.Tick += (s, e) =>
            {
                this.StateMachine.Fire(Trigger.TimerTick);
            };

            ConfigureStateMachine();

            if (Settings.GenerateStateMachineGraph)
            {
                string stateMachineGraph = UmlDotGraph.Format(this.StateMachine.GetInfo());
                Debug.WriteLine(stateMachineGraph);
            }

            this.sensor = KinectSensor.GetDefault();

            if (this.sensor != null)
            {
                this.sensor.Open();

                this.width  = this.sensor.ColorFrameSource.FrameDescription.Width;
                this.height = this.sensor.ColorFrameSource.FrameDescription.Height;

                this.colorReader = this.sensor.ColorFrameSource.OpenReader();
                this.colorReader.FrameArrived += ColorReader_FrameArrived;

                this.bodyReader = this.sensor.BodyFrameSource.OpenReader();
                this.bodyReader.FrameArrived += BodyReader_FrameArrived;

                this.pixels = new byte[this.width * this.height * 4];
                this.bitmap = new WriteableBitmap(this.width, this.height, 96.0, 96.0, PixelFormats.Bgra32, null);

                this.bodies    = new Body[this.sensor.BodyFrameSource.BodyCount];
                this.skeletons = new Skeleton[this.bodies.Count];

                this.camera.Source = this.bitmap;
            }

            Skeleton.ParentVP = this;
            this.DataContext  = this;
        }
Пример #6
0
 /// <summary>
 /// Returns workflow representation in a DotGraph format.
 /// </summary>
 /// <returns></returns>
 public virtual string ToDotGraph()
 {
     return(UmlDotGraph.Format(_stateMachine.GetInfo()));
 }
 public override string ToString()
 {
     return(UmlDotGraph.Format(_stM.GetInfo()));
 }