コード例 #1
0
        public void Cancelling(EventTokenTriggerToolDragging token)
        {
            if (CurrentParts == null)
            {
                return;
            }

            Parts.Remove(PaneJitParts, CurrentParts, LAYER.JitProcess);  // delete temporary parts
            CurrentParts = null;
            Redraw();
        }
コード例 #2
0
        public void Positioning(EventTokenTriggerToolDragging token)
        {
            if (CurrentParts == null)
            {
                return;
            }

            CurrentParts.DesignState = PartsJitBase.DesignStates.Positioning;
            CurrentParts.Location    = GetCoderPos(PaneJitParts, token.Pointer);
            Redraw();
        }
コード例 #3
0
        public void Creating(EventTokenTriggerToolDragging token)
        {
            if (CurrentParts != null)
            {
                return;
            }

            CurrentParts = new PartsJitProcess
            {
                Location    = GetCoderPos(PaneJitParts, token.Pointer),
                Width       = Distance.FromMeter(2.0),
                Height      = Distance.FromMeter(2.0),
                PositionerX = DistancePositionerX,
                PositionerY = DistancePositionerY,
                CoderX      = DistanceCoderX,
                CoderY      = DistanceCoderY,
            };
            Parts.Add(PaneJitParts, CurrentParts, LAYER.JitProcess);
        }
コード例 #4
0
        public void Finished(EventTokenTriggerToolDragging token)
        {
            if (CurrentParts == null)
            {
                return;
            }

            CurrentParts.DesignState = PartsJitBase.DesignStates.Normal;
            CurrentParts.Location    = GetCoderPos(PaneJitParts, token.Pointer);
            var processID = JacInterpreter.MakeID("Process");

            CurrentParts.ID = processID;

            var jacredo =
                $@"
                TheStage
                    Procs
                        add new Process
                            ID = '{processID}'
                            LocationX = {CurrentParts.Location.X.Cx.m}m
                            LocationY = {CurrentParts.Location.Y.Cy.m}m
                            Width = {CurrentParts.Width.m}m
                            Height = {CurrentParts.Height.m}m
                Gui.ClearAllSelection = true
                Gui.CreateProcess = {processID}
            ";
            var jacundo =
                $@"
                Gui.RemoveProcess = {processID}
                TheStage
                    Procs
                        remove {processID}
            ";

            SetNewAction(token, jacredo, jacundo);

            // remove toolbox parts. (Expecting to be created by REDO processor)
            Parts.Remove(PaneJitParts, CurrentParts, LAYER.JitProcess);
            CurrentParts = null;
        }
コード例 #5
0
        public void Finished(EventTokenTriggerToolDragging token)
        {
            if (CreatingParts == null)
            {
                return;
            }

            CreatingParts.DesignState = PartsJitBase.DesignStates.Normal;
            CreatingParts.Location    = GetCoderPos(PaneJitParts, token.Pointer);
            var workID = JacInterpreter.MakeID("Work");

            CreatingParts.ID = workID;

            var jacredo =
                $@"
                TheStage
                    Works
                        add datetime('{Now.ToString(TimeUtil.FormatYMDHMSms)}'):new Work
                            ID = '{workID}'
                            LocationX = {CreatingParts.Location.X.Cx.m}m
                            LocationY = {CreatingParts.Location.Y.Cy.m}m
                            Width = {CreatingParts.Width.m}m
                            Height = {CreatingParts.Height.m}m
                Gui.ClearAllSelection = true
                Gui.CreateWork = {workID}
            ";
            var jacundo =
                $@"
                Gui.RemoveWork = {workID}
                TheStage
                    Works
                        remove {workID}
            ";

            SetNewAction(token, jacredo, jacundo);

            // remove toolbox parts. (Expecting to be created by REDO processor)
            Parts.Remove(PaneJitParts, CreatingParts, LAYER.JitWork);
            CreatingParts = null;
        }