Esempio n. 1
0
        public void RunSingleOut(bool bUseCalibrate, IBeamScan beamScan, ushort focusADD)
        {
            if (_beamScan != null)
            {
                _beamScan.X           = beamScan.X;
                _beamScan.Y           = beamScan.Y;
                _beamScan.BeamCurrent = beamScan.BeamCurrent;
                if (bUseCalibrate)
                {
                    _beamScan.Astig1 = (ushort)StaticTool.CaculateLinerVal(beamScan.X, beamScan.Y, true);
                    _beamScan.Astig2 = (ushort)StaticTool.CaculateLinerVal(beamScan.X, beamScan.Y, false);
                    _beamScan.Focus  = (ushort)(StaticTool.CaculateFocus((uint)StaticTool.GetRadius(beamScan.X, beamScan.Y)) + focusADD);
                }
                else
                {
                    _beamScan.Astig1 = beamScan.Astig1;
                    _beamScan.Astig2 = beamScan.Astig2;
                    _beamScan.Focus  = beamScan.Focus;
                }
                BeamStart(SignalCardModeEnum.SingleOut);
                OnPowerOn?.Invoke(null, null);
                OnOperation?.Invoke("直流下束...");

                _isDirecStop = false;
            }
        }
Esempio n. 2
0
        public override void Handle(object sender, object args)
        {
            Button button = (Button)args;

            if (button.Tag is Operation)
            {
                OnOperation?.Invoke(this, button.Tag);
            }
            else
            {
                switch (button.Tag.GetType().Name.ToLower())
                {
                case "string":
                    switch ((string)button.Tag)
                    {
                    case "digit":
                        OnDigit?.Invoke(this, button.Text);
                        break;

                    case "control":
                        OnControl?.Invoke(this, button.AccessibleName);
                        break;
                    }
                    break;
                }
            }
        }
Esempio n. 3
0
 public void RunPeaHeatOut(ref ScanParamters paramters, bool isX)
 {
     try
     {
         _iDummySweep.Speed    = (float)Parameter.PreHeat.Speed;
         _beamSetup.DummySweep = _iDummySweep;
         if (beamScanFactory != null)
         {
             _beamScan.X = _beamScan.Y = _beamScan.Focus = _beamScan.Astig1 = _beamScan.Astig2 = 32767;
             beamScanFactory.SetBeamScan(_beamScan);
             _beamSetup.Rate = (int)Parameter.Frequency;
             beamScanFactory.SetBeamSetup(_beamSetup);
             beamScanFactory.SetBeamState(_beamState);
         }
         if (isX)
         {
             beamScanFactory.CreatePreHeatLinesX(
                 (ushort)Parameter.PreHeat.Size
                 , (int)Parameter.PreHeat.LineOrder
                 , (float)Parameter.PreHeat.LineOffset
                 , (float)Parameter.PreHeat.Speed
                 , Parameter.Frequency
                 , paramters.scanCount
                 , paramters.scanVolt
                 , paramters.focusOffset
                 , true
                 );
         }
         else
         {
             beamScanFactory.CreatePreHeatLinesY(
                 (ushort)Parameter.PreHeat.Size
                 , (int)Parameter.PreHeat.LineOrder
                 , (float)Parameter.PreHeat.LineOffset
                 , (float)Parameter.PreHeat.Speed
                 , Parameter.Frequency
                 , paramters.scanCount
                 , paramters.scanVolt
                 , paramters.focusOffset
                 , true
                 );
         }
         if (_beamScan != null)
         {
             if (!_isBeamOn)
             {
                 BeamStart(SignalCardModeEnum.BufferedOut);
                 _isBeamOn = true;
             }
             OnPowerOn?.Invoke(null, null);
             OnOperation?.Invoke(isX ? "X向预热..." : "Y向预热...");
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Удаляет клиента.
 /// </summary>
 /// <param name="client">Клиент, который надо удалить.</param>
 /// <returns></returns>
 public bool RemoveClient(ClientBase client)
 {
     if (Clients.Remove(client))
     {
         OnOperation?.Invoke(this, new DepartmentEventArgs(DateTime.Now, $"Выполняется удаление клиента {client.Name}.", Name));
         return(true);
     }
     return(false);
 }
Esempio n. 5
0
        public override void Handle(object sender, object args)
        {
            if (args == null)
            {
                throw new ArgumentNullException();
            }
            KeyPressEventArgs e = (KeyPressEventArgs)args;

            if (char.IsDigit(e.KeyChar) ||
                e.KeyChar == ',')
            {
                OnDigit?.Invoke(this, e.KeyChar);
            }
            else
            {
                switch (e.KeyChar)
                {
                case (char)Keys.Back:
                    OnControl?.Invoke(this, "backspace");
                    break;

                case (char)Keys.Escape:
                    OnControl?.Invoke(this, "clear");
                    break;

                case '+':
                    OnOperation?.Invoke(this, new Summation());
                    break;

                case '-':
                    OnOperation?.Invoke(this, new Subtraction());
                    break;

                case '*':
                    OnOperation?.Invoke(this, new Multiplication());
                    break;

                case '/':
                    OnOperation?.Invoke(this, new Division());
                    break;

                case (char)Keys.Return:
                case '=':
                    OnOperation?.Invoke(this, new Equals());
                    break;

                case '^':
                    OnOperation?.Invoke(this, new Power());
                    break;
                }
            }
        }
Esempio n. 6
0
 public void RunCADOut(uint count, DxfcadReader dxfcad)
 {
     try
     {
         _iDummySweep.Speed    = (float)Parameter.cadFilescanPara.Speed;
         _beamSetup.DummySweep = _iDummySweep;
         if (beamScanFactory != null)
         {
             _beamScan.X = _beamScan.Y = _beamScan.Focus = _beamScan.Astig1 = _beamScan.Astig2 = 32767;
             beamScanFactory.SetBeamScan(_beamScan);
             _beamSetup.Rate = (int)Parameter.Frequency;
             beamScanFactory.SetBeamSetup(_beamSetup);
             beamScanFactory.SetBeamState(_beamState);
         }
         double        speed         = Parameter.cadFilescanPara.Speed;
         double        focusOffs     = Parameter.cadFilescanPara.FocusOffset;
         double        beamVal       = Parameter.cadFilescanPara.BeamValue;
         DxfcadPackage dxfcadPackage = new DxfcadPackage(dxfcad);
         for (int i = 0; i < count; i++)
         {
             beamScanFactory.AddPackage(dxfcadPackage);
         }
         if (_beamScan != null)
         {
             if (!_isBeamOn)
             {
                 BeamStart(SignalCardModeEnum.BufferedOut);
                 _isBeamOn = true;
             }
             OnPowerOn?.Invoke(null, null);
             OnOperation?.Invoke("cad  扫描");
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 7
0
        public void StopBeamOut()
        {
            try
            {
                //if (rbCircle.Checked) {
                if (beamScanFactory != null)
                {
                    _beamScan.X     = 32767;
                    _beamScan.Y     = 32767;
                    _beamScan.Focus = 32767;

                    /* if (rbDirec.Checked)
                     * {
                     *   _beamScan.Focus = 32767;
                     * }*/
                    _beamScan.Astig1      = 32767;
                    _beamScan.Astig2      = 32767;
                    _beamScan.BeamCurrent = 32000; //32767;
                    beamScanFactory.Shutdown();
                    beamScanFactory.Reset();       //停止时候清空包里的数据
                    _isBeamOn    = false;
                    _isDirecStop = true;
                    OnPowerOff?.Invoke(null, null);
                    OnOperation?.Invoke("停止");
                    //BtnStop.Enabled = false;
                    //BtnPreHeat.Enabled = btnScan.Enabled = true;


                    //Parameter.ActualPreHeatCount = 0;
                }
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
                // LogHelper.Error(ex.ToString());
            }
        }
Esempio n. 8
0
 public void DummySweep(float speed)
 {
     this._iDummySweep.Speed = speed;
     _beamSetup.DummySweep   = _iDummySweep;
     if (beamScanFactory != null)
     {
         _beamScan.X = _beamScan.Y = _beamScan.Focus = _beamScan.Astig1 = _beamScan.Astig2 = 32767;
         beamScanFactory.SetBeamScan(_beamScan);
         _beamSetup.Rate = (int)Parameter.Frequency;
         beamScanFactory.SetBeamSetup(_beamSetup);
         beamScanFactory.SetBeamState(_beamState);
     }
     if (_beamScan != null)
     {
         ///*************暂时去掉
         if (!_isBeamOn)
         {
             BeamStart(SignalCardModeEnum.BufferedOut);
             _isBeamOn = true;
         }
         OnPowerOn?.Invoke(null, null);
         OnOperation?.Invoke("空扫...");
     }
 }
Esempio n. 9
0
 /// <summary>
 /// Добавляет клиента.
 /// </summary>
 /// <param name="client"></param>
 public void AddClient(ClientBase client)
 {
     Clients.Add(client);
     OnOperation?.Invoke(this, new DepartmentEventArgs(DateTime.Now, $"Выполняется добавление клиента {client.Name}.", Name));
 }