数据输入窗体及相关代码

This commit is contained in:
2026-06-16 11:04:45 +08:00 Unverified
parent ae55eaad44
commit 5cfb336f46
5 changed files with 196 additions and 18 deletions
+35 -3
View File
@@ -1,4 +1,6 @@
using System;
using kcsj.Models;
using kcsj.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -7,12 +9,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using kcsj.Services;
namespace kcsj.Forms
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
@@ -45,7 +47,12 @@ namespace kcsj.Forms
{
FileInputForm form = new FileInputForm();
form.ShowDialog();
if (form.ShowDialog() == DialogResult.OK)
{
LogService.AddLog("主窗体已接收文件导入数据。");
LogService.AddLog($"已知点数量:{DataStore.KnownPoints.Count}");
LogService.AddLog($"观测数据数量:{DataStore.Observations.Count}");
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -74,5 +81,30 @@ namespace kcsj.Forms
{
}
private void btnDataInspect_Click(object sender, EventArgs e)
{
DataCheckResult result = DataCheck.Check(DataStore.KnownPoints, DataStore.Observations);
LogService.AddLog(result.ToLogText());
LogService.AddLog(Environment.NewLine);
if (!result.IsValid)
{
MessageBox.Show(
"数据检查未通过,请查看日志信息。",
"数据检查",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return;
}
MessageBox.Show(
"数据检查通过,可以进行平差计算。",
"数据检查",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}
}