lx
2025-07-07 c3904896ecb869d4147b749b00db9e88736bf444
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using ErrorAnalysis.Repository;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Menu;
 
namespace ErrorAnalysis.UI
{
    public partial class FrmMain : Form
    {
        private string? _connectionString;
 
        public FrmMain()
        {
            InitializeComponent();
        }
        private void btnGetAllPipe_Click(object sender, EventArgs e)
        {
            var modelRepository = new COModelRepository(_connectionString);
            var models = modelRepository.GetCOModels();
        }
 
        private void rdoMode_CheckedChanged(object sender, EventArgs e)
        {
            if (rdoLockSpeed.Checked)
            {
                pnlLockPass.Visible = false;
                pnlLockSpeed.Visible = true;
            }
            else
            {
                pnlLockPass.Visible = true;
                pnlLockSpeed.Visible = false;
            }
        }
 
        private void btnSelectDataSource_Click(object sender, EventArgs e)
        {
            var fileDlg = new OpenFileDialog();
            fileDlg.Filter = "Data source|*.db";
            fileDlg.InitialDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Projects");
            fileDlg.FilterIndex = 0;
            var result = fileDlg.ShowDialog();
 
            if (result == DialogResult.OK)
            {
                txtDataPath.Text = fileDlg.FileName;
                _connectionString = $"Data Source={fileDlg.FileName};";
            }
        }
 
        private void FrmMain_Load(object sender, EventArgs e)
        {
 
            cmbSpeedUnit.SelectedIndex = 0;
        }
 
        private void btnSelectBore_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(_connectionString))
            {
                MessageBox.Show("Please choose data source first!");
                return;
            }
            var modelRepository = new COModelRepository(_connectionString);
            var models = modelRepository.GetCOModels();
          
        }
    }
}