Esempio n. 1
0
        private void button_read_Click(object sender, EventArgs e)
        {
            var path = this.fileOpenControl1.FilePath;

            if (!File.Exists(path))
            {
                Geo.Utils.FormUtil.ShowWarningMessageBox("请选择文件后再试。");
                return;
            }
            if (path.ToLower().EndsWith(Setting.BinaryMatrixFileExtension.ToLower()))//二进制
            {
                BinaryMatrixReader matrixReader = new BinaryMatrixReader(path);
                var mat = matrixReader.Read();
                this.DataBind(mat);
            }
            else
            {
                TextMatrixReader matrixReader = new TextMatrixReader(path);
                var mat = matrixReader.Read();
                this.DataBind(mat);
            }
        }
Esempio n. 2
0
        private void button_read_Click(object sender, EventArgs e)
        {
            DateTime start = DateTime.Now;

            var isMulti = this.checkBox_isMulti.Checked;
            var path    = this.fileOpenControl_eqPath.FilePath;

            if (!File.Exists(path))
            {
                Geo.Utils.FormUtil.ShowWarningMessageBox("请选择文件后再试。");
                return;
            }
            if (path.ToLower().EndsWith(Setting.BinaryMatrixEquationFileExtension.ToLower()))//二进制
            {
                BinaryMatrixReader matrixReader = new BinaryMatrixReader(path);
                var mat = matrixReader.Read();
                //this.DataBind(mat);
            }
            else
            {
                if (isMulti)
                {
                    var matrixReader = new TextMatrixEquationsReader(path);
                    var mat          = matrixReader.Read();
                    this.DataBind(mat);
                }
                else
                {
                    var matrixReader = new TextMatrixEquationReader(path);
                    var mat          = matrixReader.Read();
                    this.DataBind(mat);
                }
            }

            var span = DateTime.Now - start;

            log.Info("计算完毕,耗时:" + span.TotalSeconds.ToString("0.00") + "s = " + span.ToString());
        }