Ejemplo n.º 1
0
        private void btImport_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                Title  = "请选择项目文件",
                Filter = "Excel工作簿(*xls*)|*.xls*"
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string file = dialog.FileName;//返回文件的完整路径
                ExcelAdapter.GetGirdersFromExcel(file, ref Entity);
                ShowBulkheads(Entity.Type);
            }
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Entity = new Girders();
            //初始化加载
            //ShowBeads(0, 0, Robot.Left);
            ShowBulkheads("A");
            ShowBeads();
            ParasBind();
            //todo:状态展示
            picLeftState.Image  = Properties.Resources.Image2;
            picRightState.Image = Properties.Resources.Image2;
            picPLCState.Image   = Properties.Resources.Image2;
            monitor.StartMonitor();
            monitor.subscription.DataChanged += new Opc.Da.DataChangedEventHandler(this.OnMonitorChange);
            monitor.Readall(ref PLCPara);
            DialogResult res = MessageBox.Show("是否打开上一次的项目", "提示", MessageBoxButtons.YesNo);

            if (res == DialogResult.Yes)
            {
                ExcelAdapter.GetGirdersFromExcel(System.IO.Directory.GetCurrentDirectory() + @"\cache.xlsm", ref Entity);
            }
        }