Beispiel #1
0
 private void PB_Stop_Click(object sender, EventArgs e)
 {
     MCCLManager.ServoOff();
     MCCLManager.SpindleOff();
     ServerStatus_Picture = false;
     ServerStatus();
 }
Beispiel #2
0
 private void JogMouseUp()
 {
     if (CBox_JOG.SelectedIndex == 0)
     {
         MCCLManager.MCC_AbortMotionEx();
     }
 }
Beispiel #3
0
 private void PB_ToolRelease_Click(object sender, EventArgs e)
 {
     MCCLManager.UnClampTool();
     //鬆開刀具
     ToolStatus_Picture = false;
     StatusDisplay();
 }
Beispiel #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            CBox_JOG.SelectedIndex = 0;
            MCCL.MCC_EnableLimitSwitchCheck(0);

            //連線EMP-Z
            MCCLManager.ConnectEMPZ();
            PB_PowerLight.Image = Image.FromFile(Application.StartupPath + "\\Picture\\Power_Light2.png");

            //執行緒
            bgwThred.RunWorkerAsync();

            //將所有分頁加載入MainPanel
            MainPanel.Controls.Add(coordinate);
            MainPanel.Controls.Add(gCode);
            MainPanel.Controls.Add(information);
            MainPanel.Controls.Add(monitor);
            MainPanel.Controls.Add(tool);

            //顯示所有分頁
            coordinate.Show();
            gCode.Show();
            information.Show();
            monitor.Show();
            tool.Show();

            //僅先顯示coordinate頁面
            coordinate.Visible  = true;
            gCode.Visible       = false;
            information.Visible = false;
            monitor.Visible     = false;
            tool.Visible        = false;
        }
Beispiel #5
0
 private void PB_ToolClamp_Click(object sender, EventArgs e)
 {
     MCCLManager.ClampTool();
     //夾緊刀具
     ToolStatus_Picture = true;
     StatusDisplay();
 }
Beispiel #6
0
        private void PB_JogZ2_Click(object sender, EventArgs e)
        {
            sbyte axis = 2, direction = -1;

            if (CBox_JOG.SelectedIndex == 1)
            {
                MCCLManager.JogSpace(axis, direction);
            }
        }
Beispiel #7
0
 private void PB_Start_Click(object sender, EventArgs e)
 {
     MCCLManager.ConnectEMPZ();
     MCCLManager.SetMachineParameter();
     MCCLManager.StartEMPZ();
     MCCLManager.ServoOn();
     ServerStatus_Picture = true;
     ServerStatus();
     PB_PowerLight.Image = Image.FromFile(Application.StartupPath + "\\Picture\\Power_Light2.png");
 }
Beispiel #8
0
        private void PB_JogZ2_MouseDown(object sender, MouseEventArgs e)
        {
            sbyte axis = 2, direction = -1;

            if (CBox_JOG.SelectedIndex == 0)
            {
                MCCLManager.JogConti(axis, direction);
            }
            PB_JogZ2.Image = Image.FromFile(Application.StartupPath + "\\Picture\\REDUCE2.png");
        }
Beispiel #9
0
 private void BtnEGS_Click(object sender, EventArgs e)
 {
     MCCLManager.ServoOff();
     MCCLManager.EndEMPZ();
     MCCLManager.DisConnectEMPZ();
     MCCLManager.SpindleOff();
     ServerStatus_Picture = false;
     ServerStatus();
     PB_PowerLight.Image = Image.FromFile(Application.StartupPath + "\\Picture\\Power_Light.png");
 }
Beispiel #10
0
        private void PB_JogX1_MouseDown(object sender, MouseEventArgs e)
        {
            sbyte axis = 0, direction = 1;

            if (CBox_JOG.SelectedIndex == 0)
            {
                MCCLManager.JogConti(axis, direction);
            }
            //更換圖片
            PB_JogX1.Image = Image.FromFile(Application.StartupPath + "\\Picture\\ADD2.png");
        }
Beispiel #11
0
 private void Btn_SpindleStop_Click(object sender, EventArgs e)
 {
     if (MCCLManager.isSpindleOn == true)
     {
         MCCLManager.SpindleOff();
         SpeedValue = 0;
     }
     else
     {
         MessageBox.Show("Have off");
     }
 }
Beispiel #12
0
 private void Btn_SpindleRun_Click(object sender, EventArgs e)
 {
     if (MCCLManager.isSpindleOn == false)
     {
         MCCLManager.SpindleOn();
         SpeedValue = 5000;
     }
     else
     {
         MessageBox.Show("Have on");
     }
 }
Beispiel #13
0
        private void bgwThred_DoWork(object sender, DoWorkEventArgs e)
        {
            //Reciev work here
            while (true)
            {
                Thread.Sleep(10);
                if (bgwThred.CancellationPending)
                {
                    e.Cancel = true;
                    break;
                }
                else
                {
                    //dowork here
                    MCCLManager.GetMCCLData();

                    DateTime.Now.ToShortDateString();
                    DateTime.Now.ToString("HH:mm:ss");

                    bgwThred.ReportProgress(1);
                }
            }
        }
Beispiel #14
0
 private void btnSpeed_Click(object sender, EventArgs e)
 {
     MCCLManager.ToolRPMChange(Convert.ToInt32(Txt_Speed.Text) / 5000);
     SpeedValue = Convert.ToInt32(Txt_Speed.Text);
 }
Beispiel #15
0
 private void Lb_Speed_TextChanged(object sender, EventArgs e)
 {
     MCCLManager.ToolRPMChange(SpeedValue / 5000);
 }
Beispiel #16
0
 private void Btn_DefineMachining_Click(object sender, EventArgs e)
 {
     MCCLManager.MCC_DefineMachining();
 }
Beispiel #17
0
 private void Btn_GoHome_Click(object sender, EventArgs e)
 {
     MCCLManager.MCC_GoHome();
 }