private void button_run_Click(object sender, EventArgs e) { var start = DateTime.Now; var isSingleFile = this.checkBox_singleFIle.Checked; EquationComposer = new MultiMatrixEquationComputer(); if (!isSingleFile)//多文件 { var pathes = this.fileOpenControl_filePath.FilePathes; EquationComposer.PostFixName = Path.GetFileNameWithoutExtension(pathes[0]) + "s"; foreach (var path in pathes) { MatrixEquationReader reader = new MatrixEquationReader(path); var obj = reader.Read(); EquationComposer.AddSubMatrix(obj); } } else//单文件 { var path = this.fileOpenControl_filePath.FilePath; EquationComposer.PostFixName = Path.GetFileNameWithoutExtension(path); var matrixReader = new TextMatrixEquationsReader(path); var mat = matrixReader.Read(); mat.AddNumbersToObs(); foreach (var obj in mat) { EquationComposer.AddSubMatrix(obj); } } var result = EquationComposer.Build(); DataBind(result); var span = DateTime.Now - start; log.Info("耗时:" + span.TotalSeconds.ToString("0.000") + " s = " + span); Geo.Utils.FormUtil.ShowOkAndOpenDirectory(this.OutputDirectory); }
private void button_run_Click(object sender, EventArgs e) { var isMultiEqsInOneFile = this.checkBox_multiEquation.Checked; EquationComposer = new MatrixEquationComposer(); if (!isMultiEqsInOneFile)//多文件叠加第一个 { var pathes = this.fileOpenControl_filePath.FilePathes; foreach (var path in pathes) { MatrixEquationReader reader = new MatrixEquationReader(path); var obj = reader.Read(); EquationComposer.AddSubMatrix(obj); } } else//单文件或多文件叠加所有 { var pathes = this.fileOpenControl_filePath.FilePathes; int i = 0; foreach (var path in pathes) { var matrixReader = new TextMatrixEquationsReader(path); var mat = matrixReader.Read(); i = mat.AddNumbersToObs(i); foreach (var obj in mat) { EquationComposer.AddSubMatrix(obj); } } } var result = EquationComposer.Build(); DataBind(result); //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); //} }