Esempio n. 1
0
 private void BBI_Reg_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (BET_ToolCode.EditValue.ToString().Trim() == string.Empty)
     {
         MessageBox.Show("注册码格式不正确!");
         return;
     }
     if (!PublicFunc.CompareCode(BET_ToolCode.EditValue.ToString().Trim()))
     {
         MessageBox.Show("注册码不正确!");
         return;
     }
     // db.SetRange();
     //  MessageBox.Show(BET_ToolCode.EditValue.ToString().Length.ToString());
     if (!db.EditRegCode(BET_ToolCode.EditValue.ToString().Trim()))
     {
         MessageBox.Show("保存数据不正确!");
         return;
     }
     else
     {
         MessageBox.Show("感谢您的注册!");
         TxtData.XMLConfigure.Reged = true;
         BBI_Reg.Enabled            = BET_ToolCode.Enabled = !TxtData.XMLConfigure.Reged;
         BSI_RegStatus.Caption      = TxtData.XMLConfigure.Reged ? "已注册" : "未注册";
     }
     //  Frm_Main_Load(this, null);
 }
Esempio n. 2
0
        /// <summary>
        /// 把机器码生成文本
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BBI_SaveToolCodeTxt_ItemClick(object sender, ItemClickEventArgs e)
        {
            string FileName;

            if ((FileName = PublicFunc.SfD_Show("LasMAN注册码.txt", "TXT文件(*.txt)|*.txt")) == null)
            {
                return;
            }
            PublicFunc.SaveTxt(FileName, BSI_ToolCode.Caption);
        }
Esempio n. 3
0
        private void Frm_Main_Load(object sender, EventArgs e)
        {
            BBI_Reg.Enabled       = BET_ToolCode.Enabled = !TxtData.XMLConfigure.Reged;
            BSI_RegStatus.Caption = TxtData.XMLConfigure.Reged ? "已注册" : "未注册";
            BSI_ToolCode.Caption  = PublicFunc.GetDiskVolumeSerialNumber() + PublicFunc.GetCpuSerialNumber();

            BI_RobotImfor_LinkClicked(this, null);


            //  TxtData.XMLConfigure.Login = true;
        }
Esempio n. 4
0
 private void Frm_Axis_Load(object sender, EventArgs e)
 {
     db.SaveCs8cConfigure();
     if (PublicFunc.ReadCs8CConfigure())
     {
         TE_S1.EditValue = TxtData.CS8CConfigure.Axis[0];
         TE_S2.EditValue = TxtData.CS8CConfigure.Axis[1];
         // TE_S3.EditValue = TxtData.CS8CConfigure.Axis[2];
         //  RB_C1.Checked = TxtData.CS8CConfigure.EnableItem[5];
     }
 }
Esempio n. 5
0
        private void timer_log_Tick(object sender, EventArgs e)
        {
            try
            {
                string[] date = null;
                string[] Txt  = null;
                if (!TxtData.DataBase.SoapStaus)
                {
                    return;
                }
                FtpClient ftp;
                if (RB_Master.Checked)
                {
                    ftp         = new FtpClient(TxtData.XMLConfigure.IpAddress);
                    GB_Log.Text = "主控机械手臂日志记录";
                }
                else
                {
                    ftp         = new FtpClient(TxtData.XMLConfigure.SlaveIpAddress);
                    GB_Log.Text = "从控机械手臂日志记录";
                }

                if (ftp.DownLoadLog() && PublicFunc.ReadCs8CLog(out date, out Txt))
                {
                    string[] datebuff = date;
                    string[] Txtbuff  = Txt;

                    if (datebuff != null && Txtbuff != null && datebuff.Length > 1 && Txtbuff.Length > 1)
                    {
                        DataView dv = new DataView();
                        dv.Table = new System.Data.DataTable("Sequen");
                        dv.Table.Columns.Add();
                        dv.Table.Columns.Add();
                        dv.Table.Rows.Clear();

                        for (int i = datebuff.Length - 1; i >= 0; i--)
                        {
                            if (Txtbuff[i].IndexOf("COM-PC: destroy session") < 0 && Txtbuff[i].IndexOf("COM-PC: create session") < 0)
                            {
                                dv.Table.Rows.Add((object[])new string[] { datebuff[i], Txtbuff[i] });
                            }
                        }


                        GC_Alarm.DataSource   = dv;
                        gv.Columns[0].Caption = "日期";
                        gv.Columns[1].Caption = "日志信息";
                    }
                }
            }
            catch
            {
            }
        }
Esempio n. 6
0
        private void BT_ImportDB_Click(object sender, EventArgs e)
        {
            string FileName;

            if ((FileName = PublicFunc.OpenDir_Show(Application.StartupPath, "数据库文件(*.mdb)|*.mdb")) == null)
            {
                return;
            }
            if (System.IO.File.Exists(FileName))
            {
                System.IO.File.Copy(FileName, Application.StartupPath + "\\LasMAN.mdb", true);
            }
        }
Esempio n. 7
0
        private void BT_BackupDB_Click(object sender, EventArgs e)
        {
            string FileName;

            if ((FileName = PublicFunc.SfD_Show("LasMAN.mdb", "数据库文件(*.mdb)|*.mdb")) == null)
            {
                return;
            }
            if (System.IO.File.Exists(Application.StartupPath + "\\LasMAN.mdb"))
            {
                System.IO.File.Copy(Application.StartupPath + "\\LasMAN.mdb", FileName, true);
            }
        }
Esempio n. 8
0
        public Frm_Main()
        {
            //卸载与安装
            if (!File.Exists(Application.StartupPath + "\\LasMAN.mdb") && File.Exists(Application.StartupPath + "\\Backup\\LasMAN.mdb"))
            {
                File.Copy(Application.StartupPath + "\\Backup\\LasMAN.mdb", Application.StartupPath + "\\LasMAN.mdb", true);
            }
            if (!Directory.Exists(Application.StartupPath + "\\Log"))
            {
                Directory.CreateDirectory(Application.StartupPath + "\\Log");
            }

            DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection = true;
            // PublicFunc.ReadXMLConfigure();

            InitializeComponent();
            BI_ListClose_ItemClick(this, null);
            //     TE_Title.Text = "机器人与装备集成实验系统";
            RC_Main.DefaultPageCategory.Expanded = true;
            RC_Main.Minimized = true;
            InitSkinGallery();



            db = new DataBaseManage();
            db.SaveCs8cConfigure();
            // PublicFunc.ReadCs8CConfigure();

            db.GetRegCode(ref TxtData.XMLConfigure.RegCode);
            db.GetIp(ref TxtData.XMLConfigure.IpAddress, ref TxtData.XMLConfigure.RestrictCode);
            db.GetPopedom(ref TxtData.PublicData.ScreenEnable);

            TxtData.XMLConfigure.User = db.GetAutoLogin();


            if (TxtData.XMLConfigure.User != null)
            {
                TxtData.XMLConfigure.Login   = true;
                TxtData.XMLConfigure.PopeDom = db.GetUserPopm(TxtData.XMLConfigure.User);
                db.AddLog(TxtData.XMLConfigure.User + "登录");
            }
            PublicFunc.ReadXMLConfigure();


            poll = new Thread(new ThreadStart(PublicFunc.Poll));
            poll.Start();
        }