Exemple #1
0
        public CCVcrTeachControl()
        {
            InitializeComponent();

            // 將資料交由 TeachingInfoFactory 管理
            TeachingInfoFactory.RegisterTeachInfoToFactory(m_info);

            // Setup VCR Protocol
            m_VcrInterface.PortBoudrate = 9600;
            m_VcrInterface.PortStopBits = StopBits.One;
            m_VcrInterface.PortNumber   = string.Format("COM{0:d}", 5);
            m_VcrInterface.PortParity   = Parity.None;
            m_VcrInterface.PortDataBits = 8;
            //m_VcrInterface.DataReceiveHandler = new SerialDataReceivedEventHandler(m_VcrInterface.VCRDataReceived);

            try
            {
                m_VcrInterface.Open();
                //m_ConnectHandler(this, null);
            }
            catch (Exception e)
            {
                //MessageBox.Show("[" + e.Message + "]" + " Can't Open : " + m_SerialPort.PortName);
            }
        }
        private void m_btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog DialogSave = new SaveFileDialog();

            DialogSave.InitialDirectory = TeachingInfoFactory.GetTeachInfoObject("Laser Path").IniDirPath;
            DialogSave.Filter           = "Ini file (*.ini)|";
            DialogSave.DefaultExt       = "ini";

            if (DialogSave.ShowDialog() == DialogResult.OK)
            {
                if (DialogSave.FileName != "")
                {
                    IniFile iniFile = new IniFile(DialogSave.FileName);

                    iniFile.WriteValue("Laser Para", "LaserPower", m_txbLaserPower.Text);
                    iniFile.WriteValue("Laser Para", "Acc", m_txbAcc.Text);
                    iniFile.WriteValue("Laser Para", "Speed", m_txbSpeed.Text);
                    iniFile.WriteValue("Laser Para", "Dec", m_txbDec.Text);

                    for (int iIdx = 0; iIdx < m_listPath.Count; ++iIdx)
                    {
                        iniFile.WriteValue("Laser Point", String.Format("X-{0}", iIdx), m_listPath[iIdx].X);
                        iniFile.WriteValue("Laser Point", String.Format("Y-{0}", iIdx), m_listPath[iIdx].Y);
                    }
                }
            }
            DialogSave.Dispose();
            DialogSave = null;

            // Reload Ini  File List
            LoadIniFilesList();
        }
        public CCPanelParaControl()
        {
            InitializeComponent();

            // 將資料交由 TeachingInfoFactory 管理
            TeachingInfoFactory.RegisterTeachInfoToFactory(m_info);
        }
Exemple #4
0
        public CCSupportBarControl()
        {
            InitializeComponent();

            // 將資料交由 TeachingInfoFactory 管理
            TeachingInfoFactory.RegisterTeachInfoToFactory(m_info);
        }
Exemple #5
0
        public CCClampTeachControl()
        {
            InitializeComponent();

            // 將資料交由 TeachingInfoFactory 管理
            TeachingInfoFactory.RegisterTeachInfoToFactory(m_info);

            m_cbAxis.SelectedIndex = 0;
        }
        public CCLaserPathTeachControl()
        {
            InitializeComponent();

            // 將資料交由 TeachingInfoFactory 管理
            TeachingInfoFactory.RegisterTeachInfoToFactory(m_info);

            // Load Ini in order to show
            LoadIniFilesList();
        }
        private void m_btnGSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog DialogSave = new SaveFileDialog();

            DialogSave.Filter           = "Ini file (*.ini)|";
            DialogSave.DefaultExt       = "ini";
            DialogSave.InitialDirectory = TeachingInfoFactory.GetTeachInfoObject("Panel Para").IniDirPath;

            if (DialogSave.ShowDialog() == DialogResult.OK)
            {
                if (DialogSave.FileName != "")
                {
                    IniFile iniFile = new IniFile(DialogSave.FileName);

                    iniFile.WriteValue("G1", "Y", m_tbxG1Y.Text);
                    iniFile.WriteValue("G1", "Subpixel Start", m_tbxG1SubPixelStart.Text);
                    iniFile.WriteValue("G1", "Subpixel End", m_tbxG1SubPixelEnd.Text);

                    iniFile.WriteValue("G2", "Y", m_tbxG2Y.Text);
                    iniFile.WriteValue("G2", "Subpixel Start", m_tbxG2SubPixelStart.Text);
                    iniFile.WriteValue("G2", "Subpixel End", m_tbxG2SubPixelEnd.Text);

                    iniFile.WriteValue("G6", "Y", m_tbxG1Y.Text);
                    iniFile.WriteValue("G6", "Subpixel Start", m_tbxG6SubPixelStart.Text);
                    iniFile.WriteValue("G6", "Subpixel End", m_tbxG6SubPixelEnd.Text);

                    iniFile.WriteValue("G3", "X", m_tbxG3X.Text);
                    iniFile.WriteValue("G3", "X", m_tbxG3Y.Text);

                    iniFile.WriteValue("G4", "X", m_tbxG4X.Text);
                    iniFile.WriteValue("G4", "X", m_tbxG4Y.Text);

                    iniFile.WriteValue("G5", "X", m_tbxG5X.Text);
                    iniFile.WriteValue("G5", "X", m_tbxG5Y.Text);

                    iniFile.WriteValue("G7", "X", m_tbxG7X.Text);
                    iniFile.WriteValue("G7", "X", m_tbxG7Y.Text);

                    iniFile.WriteValue("Panel", "Width", m_tbxPanelWidth.Text);
                    iniFile.WriteValue("Panel", "Height", m_tbxPanelHeight.Text);
                }
            }
            DialogSave.Dispose();
            DialogSave = null;
        }
Exemple #8
0
        private void m_btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog DialogSave = new SaveFileDialog();

            DialogSave.InitialDirectory = TeachingInfoFactory.GetTeachInfoObject("VCR Teach").IniDirPath;
            DialogSave.Filter           = "Ini file (*.ini)|";
            DialogSave.DefaultExt       = "ini";

            if (DialogSave.ShowDialog() == DialogResult.OK)
            {
                if (DialogSave.FileName != "")
                {
                    IniFile iniFile = new IniFile(DialogSave.FileName);

                    iniFile.WriteValue("VCR", "G Axis", m_tbxGAxisPos.Text);
                    iniFile.WriteValue("VCR", "S Axis", m_tbxSAxisPos.Text);
                    iniFile.WriteValue("VCR", "Z Axis", m_tbxZAxisPos.Text);
                }
            }
            DialogSave.Dispose();
            DialogSave = null;
        }
Exemple #9
0
        private void m_btnAxisSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog DialogSave = new SaveFileDialog();

            DialogSave.InitialDirectory = TeachingInfoFactory.GetTeachInfoObject("Clamp Teach").IniDirPath;
            DialogSave.Filter           = "Ini file (*.ini)|";
            DialogSave.DefaultExt       = "ini";

            if (DialogSave.ShowDialog() == DialogResult.OK)
            {
                if (DialogSave.FileName != "")
                {
                    IniFile iniFile = new IniFile(DialogSave.FileName);

                    iniFile.WriteValue("Alignment C1C2", "Position", CC_C1C2_Axis.GetC1C2AxisPosition());
                    iniFile.WriteValue("Alignment SA1SA2", "Position", CC_SA1SA2_Axis.GetSA1SA2AxisPosition());
                    iniFile.WriteValue("Bar1", "Position", CC_Bar_Axis.GetBar1AxisPosition());
                    iniFile.WriteValue("Bar2", "Position", CC_Bar_Axis.GetBar2AxisPosition());
                }
            }
            DialogSave.Dispose();
            DialogSave = null;
        }