Ejemplo n.º 1
0
        public PierceBroker(PierceConfig config)
        {
            this.config  = config;
            this.Pierces = new List <PierceParameters>();
            switch (config.Level)
            {
            case PierceLevels.Level3:
                this.Pierces.Add(config.Level3Para);
                this.Pierces.Add(config.Level2Para);
                this.Pierces.Add(config.Level1Para);
                break;

            case PierceLevels.Level2:
                this.Pierces.Add(config.Level2Para);
                this.Pierces.Add(config.Level1Para);
                break;

            case PierceLevels.Level1:
                this.Pierces.Add(config.Level1Para);
                break;
            }
            this.MachineInfo = new MachineInformation();
            if (this.Pierces.Any())
            {
                this.MachineInfo.PiercingTimes = 1;
            }
            foreach (var m in this.Pierces)
            {
                this.UpdateMachineInfo(this.MachineInfo, m);
            }
        }
Ejemplo n.º 2
0
        private void MakeMovementBefore()
        {
            if (!manualPara.IsPointMoveCut)
            {
                return;
            }

            bool pierceNeeded = this.pointMovePara.PierceLevel != PierceLevels.None;

            if (pierceNeeded)
            {
                var config = new PierceConfig
                {
                    Level      = this.pointMovePara.PierceLevel,
                    Level1Para = this.pointMovePara.PierceLevel1,
                    Level2Para = this.pointMovePara.PierceLevel2,
                    Level3Para = this.pointMovePara.PierceLevel3
                };
                var broker = new PierceBroker(config);
                broker.OnLaserEnabledChanged   += x => OperationEngine.Instance.NotifyLaserEnabled(x);
                broker.OnLaserParaChanged      += x => OperationEngine.Instance.NotifyLaserParaChanged(x);
                broker.OnBlowingEnabledChanged += x => OperationEngine.Instance.NotifyBlowingEnabled(x);
                broker.OnFollowChanged         += x => OperationEngine.Instance.NotifyFollowEnabled(x);
                broker.Execute(this.token);
            }

            this.MoveZ(this.pointMovePara.NozzleHeight);
            this.BlowingOn();
            this.LaserOn();
        }