Пример #1
0
 private void LoginSucceed()
 {
     OnLoginResult(this, new MyEvent {
         Result = true
     });
     //MontionControlForm.Result = true;
     ShowMsg("登录成功!");
     m_mainForm.AddLog("当前用户:" + m_name, false, false);
 }
Пример #2
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            bool result = m_main.MotionCard.WaitForAllAxisMotionDone();

            if (result)
            {
                Close();
            }
            else
            {
                m_main.AddLog("正在执行回零操作,请稍等!", false, true);
            }
        }
Пример #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            exListView1.SelectedIndexChanged += exListView1_SelectedIndexChanged;

            List <string> lines = new List <string>();

            if (exListView1.SelectedIndices.Count <= 0)
            {
                MessageBox.Show("你未选择任何数据!");
                return;
            }

            //MessageBox.Show(exListView1.SelectedIndices.Count + "....");

            try
            {
                for (int i = 0; i < this.exListView1.SelectedIndices.Count; i++)
                {
                    int index = exListView1.SelectedIndices[i];

                    EXListViewItem itemName = exListView1.Items[index] as EXListViewItem;

                    EXControlListViewSubItem itemCmbox  = itemName.SubItems[1] as EXControlListViewSubItem;
                    EXControlListViewSubItem itemTxtBox = itemName.SubItems[2] as EXControlListViewSubItem;
                    EXControlListViewSubItem itemLaser  = itemName.SubItems[3] as EXControlListViewSubItem;
                    EXControlListViewSubItem itemDelay  = itemName.SubItems[4] as EXControlListViewSubItem;

                    ComboBox      cbBox    = itemCmbox.MyControl as ComboBox;
                    TextBox       txtBox   = itemTxtBox.MyControl as TextBox;
                    Button        btnLaser = itemLaser.MyControl as Button;
                    NumericUpDown numDelay = itemDelay.MyControl as NumericUpDown;

                    lines.Add(String.Format("序号#{0}\r\n指令#{1}\r\n代码#{2}\r\n激光状态#{3}\r\n延迟时间#{4}",
                                            itemName.Text, cbBox.Text, txtBox.Text, btnLaser.Text, numDelay.Text));
                }
            }
            catch (Exception ex)
            {
                m_main.AddLog(ex.Message, true, true);
                return;
            }

            SaveFileDialog dialog = new SaveFileDialog();

            dialog.Title            = "保存";
            dialog.Filter           = "文本 |*.txt|所有文件 |*.*";
            dialog.RestoreDirectory = true;
            dialog.InitialDirectory = Application.StartupPath;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string fileName = dialog.FileName;

                    File.WriteAllLines(fileName, lines);

                    m_main.ListParams = m_listParams;
                    labSum.Text       = labSum.Text + ",保存成功!";
                }
                catch (Exception ex)
                {
                    m_main.AddLog(ex.Message, true, true);
                }
            }
        }