SVN-Revision: r937
This commit is contained in:
wyf
2025-08-08 02:46:39 +00:00
parent 35d404e510
commit 8d2e4c5792
2 changed files with 431 additions and 300 deletions
+297 -244
View File
@@ -30,9 +30,27 @@ namespace LadfDataApp
private void InitializeComponent()
{
this.loginInfoPanel = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.tipsTextBox = new System.Windows.Forms.TextBox();
this.startBtn = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.panelNext = new System.Windows.Forms.Panel();
this.nextStartDate = new System.Windows.Forms.DateTimePicker();
this.timeUnitLab = new System.Windows.Forms.Label();
this.timeIntervalLab = new System.Windows.Forms.Label();
this.timeIntervalBox = new System.Windows.Forms.TextBox();
this.panel5 = new System.Windows.Forms.Panel();
this.radioNext = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.panelFix = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.fixEndDate = new System.Windows.Forms.DateTimePicker();
this.fixStartDate = new System.Windows.Forms.DateTimePicker();
this.panel3 = new System.Windows.Forms.Panel();
this.radioFix = new System.Windows.Forms.RadioButton();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.projectComboBox = new System.Windows.Forms.ComboBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.linkBtn = new System.Windows.Forms.Button();
this.dataBaseLab = new System.Windows.Forms.Label();
this.dataBaseBox = new System.Windows.Forms.TextBox();
this.serverLab = new System.Windows.Forms.Label();
@@ -41,42 +59,31 @@ namespace LadfDataApp
this.loginPasswordBox = new System.Windows.Forms.TextBox();
this.loginNameLab = new System.Windows.Forms.Label();
this.loginNameBox = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.radioNext = new System.Windows.Forms.RadioButton();
this.panel3 = new System.Windows.Forms.Panel();
this.radioFix = new System.Windows.Forms.RadioButton();
this.panelFix = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.fixEndDate = new System.Windows.Forms.DateTimePicker();
this.fixStartDate = new System.Windows.Forms.DateTimePicker();
this.panel5 = new System.Windows.Forms.Panel();
this.panelNext = new System.Windows.Forms.Panel();
this.nextStartDate = new System.Windows.Forms.DateTimePicker();
this.timeUnitLab = new System.Windows.Forms.Label();
this.timeIntervalLab = new System.Windows.Forms.Label();
this.timeIntervalBox = new System.Windows.Forms.TextBox();
this.linkBtn = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.projectComboBox = new System.Windows.Forms.ComboBox();
this.startBtn = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.tipsTextBox = new System.Windows.Forms.TextBox();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.panelNow = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.radioNow = new System.Windows.Forms.RadioButton();
this.loginInfoPanel.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.panel3.SuspendLayout();
this.panelFix.SuspendLayout();
this.panel5.SuspendLayout();
this.panelNext.SuspendLayout();
this.panel5.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panelFix.SuspendLayout();
this.panel3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox5.SuspendLayout();
this.panel4.SuspendLayout();
this.SuspendLayout();
//
// loginInfoPanel
//
this.loginInfoPanel.BackColor = System.Drawing.SystemColors.Control;
this.loginInfoPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.loginInfoPanel.Controls.Add(this.groupBox5);
this.loginInfoPanel.Controls.Add(this.startBtn);
this.loginInfoPanel.Controls.Add(this.groupBox3);
this.loginInfoPanel.Controls.Add(this.groupBox2);
@@ -85,29 +92,197 @@ namespace LadfDataApp
this.loginInfoPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.loginInfoPanel.Location = new System.Drawing.Point(0, 0);
this.loginInfoPanel.Name = "loginInfoPanel";
this.loginInfoPanel.Size = new System.Drawing.Size(614, 303);
this.loginInfoPanel.Size = new System.Drawing.Size(614, 356);
this.loginInfoPanel.TabIndex = 0;
//
// panel2
// startBtn
//
this.panel2.Controls.Add(this.tipsTextBox);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 303);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(614, 332);
this.panel2.TabIndex = 1;
this.startBtn.Location = new System.Drawing.Point(483, 317);
this.startBtn.Name = "startBtn";
this.startBtn.Size = new System.Drawing.Size(102, 31);
this.startBtn.TabIndex = 18;
this.startBtn.Text = "开始同步";
this.startBtn.UseVisualStyleBackColor = true;
//
// tipsTextBox
// groupBox3
//
this.tipsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tipsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.tipsTextBox.Location = new System.Drawing.Point(0, 0);
this.tipsTextBox.Multiline = true;
this.tipsTextBox.Name = "tipsTextBox";
this.tipsTextBox.ReadOnly = true;
this.tipsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tipsTextBox.Size = new System.Drawing.Size(614, 332);
this.tipsTextBox.TabIndex = 0;
this.groupBox3.Controls.Add(this.panelNext);
this.groupBox3.Controls.Add(this.panel5);
this.groupBox3.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox3.Location = new System.Drawing.Point(0, 205);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(612, 54);
this.groupBox3.TabIndex = 16;
this.groupBox3.TabStop = false;
//
// panelNext
//
this.panelNext.Controls.Add(this.nextStartDate);
this.panelNext.Controls.Add(this.timeUnitLab);
this.panelNext.Controls.Add(this.timeIntervalLab);
this.panelNext.Controls.Add(this.timeIntervalBox);
this.panelNext.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelNext.Location = new System.Drawing.Point(83, 17);
this.panelNext.Name = "panelNext";
this.panelNext.Size = new System.Drawing.Size(526, 34);
this.panelNext.TabIndex = 23;
//
// nextStartDate
//
this.nextStartDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.nextStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.nextStartDate.Location = new System.Drawing.Point(6, 8);
this.nextStartDate.Name = "nextStartDate";
this.nextStartDate.ShowUpDown = true;
this.nextStartDate.Size = new System.Drawing.Size(200, 21);
this.nextStartDate.TabIndex = 25;
//
// timeUnitLab
//
this.timeUnitLab.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.timeUnitLab.Location = new System.Drawing.Point(457, 7);
this.timeUnitLab.Name = "timeUnitLab";
this.timeUnitLab.Size = new System.Drawing.Size(45, 25);
this.timeUnitLab.TabIndex = 24;
this.timeUnitLab.Text = "分钟";
this.timeUnitLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// timeIntervalLab
//
this.timeIntervalLab.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.timeIntervalLab.Location = new System.Drawing.Point(226, 7);
this.timeIntervalLab.Name = "timeIntervalLab";
this.timeIntervalLab.Size = new System.Drawing.Size(70, 25);
this.timeIntervalLab.TabIndex = 23;
this.timeIntervalLab.Text = "间 隔:";
this.timeIntervalLab.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// timeIntervalBox
//
this.timeIntervalBox.Location = new System.Drawing.Point(302, 7);
this.timeIntervalBox.Name = "timeIntervalBox";
this.timeIntervalBox.Size = new System.Drawing.Size(149, 21);
this.timeIntervalBox.TabIndex = 22;
//
// panel5
//
this.panel5.Controls.Add(this.radioNext);
this.panel5.Dock = System.Windows.Forms.DockStyle.Left;
this.panel5.Location = new System.Drawing.Point(3, 17);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(80, 34);
this.panel5.TabIndex = 22;
//
// radioNext
//
this.radioNext.AutoSize = true;
this.radioNext.Location = new System.Drawing.Point(3, 12);
this.radioNext.Name = "radioNext";
this.radioNext.Size = new System.Drawing.Size(71, 16);
this.radioNext.TabIndex = 17;
this.radioNext.TabStop = true;
this.radioNext.Text = "间隔查询";
this.radioNext.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.panelFix);
this.groupBox2.Controls.Add(this.panel3);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox2.Location = new System.Drawing.Point(0, 151);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(612, 54);
this.groupBox2.TabIndex = 15;
this.groupBox2.TabStop = false;
//
// panelFix
//
this.panelFix.Controls.Add(this.label3);
this.panelFix.Controls.Add(this.fixEndDate);
this.panelFix.Controls.Add(this.fixStartDate);
this.panelFix.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelFix.Location = new System.Drawing.Point(83, 17);
this.panelFix.Name = "panelFix";
this.panelFix.Size = new System.Drawing.Size(526, 34);
this.panelFix.TabIndex = 22;
//
// label3
//
this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(226, 6);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(70, 25);
this.label3.TabIndex = 23;
this.label3.Text = "到";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// fixEndDate
//
this.fixEndDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.fixEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.fixEndDate.Location = new System.Drawing.Point(302, 7);
this.fixEndDate.Name = "fixEndDate";
this.fixEndDate.ShowUpDown = true;
this.fixEndDate.Size = new System.Drawing.Size(200, 21);
this.fixEndDate.TabIndex = 22;
//
// fixStartDate
//
this.fixStartDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.fixStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.fixStartDate.Location = new System.Drawing.Point(6, 7);
this.fixStartDate.Name = "fixStartDate";
this.fixStartDate.ShowUpDown = true;
this.fixStartDate.Size = new System.Drawing.Size(200, 21);
this.fixStartDate.TabIndex = 21;
//
// panel3
//
this.panel3.Controls.Add(this.radioFix);
this.panel3.Dock = System.Windows.Forms.DockStyle.Left;
this.panel3.Location = new System.Drawing.Point(3, 17);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(80, 34);
this.panel3.TabIndex = 21;
//
// radioFix
//
this.radioFix.AutoSize = true;
this.radioFix.Location = new System.Drawing.Point(3, 11);
this.radioFix.Name = "radioFix";
this.radioFix.Size = new System.Drawing.Size(71, 16);
this.radioFix.TabIndex = 21;
this.radioFix.Text = "固定查询";
this.radioFix.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.label2);
this.groupBox4.Controls.Add(this.projectComboBox);
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox4.Location = new System.Drawing.Point(0, 109);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(612, 42);
this.groupBox4.TabIndex = 17;
this.groupBox4.TabStop = false;
//
// label2
//
this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(13, 13);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 25);
this.label2.TabIndex = 23;
this.label2.Text = "项 目:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// projectComboBox
//
this.projectComboBox.FormattingEnabled = true;
this.projectComboBox.Location = new System.Drawing.Point(89, 15);
this.projectComboBox.Name = "projectComboBox";
this.projectComboBox.Size = new System.Drawing.Size(200, 20);
this.projectComboBox.TabIndex = 22;
//
// groupBox1
//
@@ -127,6 +302,15 @@ namespace LadfDataApp
this.groupBox1.TabIndex = 14;
this.groupBox1.TabStop = false;
//
// linkBtn
//
this.linkBtn.Location = new System.Drawing.Point(483, 70);
this.linkBtn.Name = "linkBtn";
this.linkBtn.Size = new System.Drawing.Size(102, 31);
this.linkBtn.TabIndex = 21;
this.linkBtn.Text = "连接";
this.linkBtn.UseVisualStyleBackColor = true;
//
// dataBaseLab
//
this.dataBaseLab.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -196,228 +380,93 @@ namespace LadfDataApp
this.loginNameBox.Size = new System.Drawing.Size(200, 21);
this.loginNameBox.TabIndex = 11;
//
// groupBox2
// panel2
//
this.groupBox2.Controls.Add(this.panelFix);
this.groupBox2.Controls.Add(this.panel3);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox2.Location = new System.Drawing.Point(0, 151);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(612, 54);
this.groupBox2.TabIndex = 15;
this.groupBox2.TabStop = false;
this.panel2.Controls.Add(this.tipsTextBox);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 356);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(614, 305);
this.panel2.TabIndex = 1;
//
// groupBox3
// tipsTextBox
//
this.groupBox3.Controls.Add(this.panelNext);
this.groupBox3.Controls.Add(this.panel5);
this.groupBox3.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox3.Location = new System.Drawing.Point(0, 205);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(612, 54);
this.groupBox3.TabIndex = 16;
this.groupBox3.TabStop = false;
this.tipsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tipsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.tipsTextBox.Location = new System.Drawing.Point(0, 0);
this.tipsTextBox.Multiline = true;
this.tipsTextBox.Name = "tipsTextBox";
this.tipsTextBox.ReadOnly = true;
this.tipsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tipsTextBox.Size = new System.Drawing.Size(614, 305);
this.tipsTextBox.TabIndex = 0;
//
// radioNext
// groupBox5
//
this.radioNext.AutoSize = true;
this.radioNext.Location = new System.Drawing.Point(3, 12);
this.radioNext.Name = "radioNext";
this.radioNext.Size = new System.Drawing.Size(71, 16);
this.radioNext.TabIndex = 17;
this.radioNext.TabStop = true;
this.radioNext.Text = "间隔查询";
this.radioNext.UseVisualStyleBackColor = true;
this.groupBox5.Controls.Add(this.panelNow);
this.groupBox5.Controls.Add(this.panel4);
this.groupBox5.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox5.Location = new System.Drawing.Point(0, 259);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(612, 54);
this.groupBox5.TabIndex = 19;
this.groupBox5.TabStop = false;
//
// panel3
// panelNow
//
this.panel3.Controls.Add(this.radioFix);
this.panel3.Dock = System.Windows.Forms.DockStyle.Left;
this.panel3.Location = new System.Drawing.Point(3, 17);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(80, 34);
this.panel3.TabIndex = 21;
this.panelNow.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelNow.Location = new System.Drawing.Point(83, 17);
this.panelNow.Name = "panelNow";
this.panelNow.Size = new System.Drawing.Size(526, 34);
this.panelNow.TabIndex = 23;
//
// radioFix
// panel4
//
this.radioFix.AutoSize = true;
this.radioFix.Location = new System.Drawing.Point(3, 11);
this.radioFix.Name = "radioFix";
this.radioFix.Size = new System.Drawing.Size(71, 16);
this.radioFix.TabIndex = 21;
this.radioFix.Text = "固定查询";
this.radioFix.UseVisualStyleBackColor = true;
this.panel4.Controls.Add(this.radioNow);
this.panel4.Dock = System.Windows.Forms.DockStyle.Left;
this.panel4.Location = new System.Drawing.Point(3, 17);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(80, 34);
this.panel4.TabIndex = 22;
//
// panelFix
// radioNow
//
this.panelFix.Controls.Add(this.label3);
this.panelFix.Controls.Add(this.fixEndDate);
this.panelFix.Controls.Add(this.fixStartDate);
this.panelFix.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelFix.Location = new System.Drawing.Point(83, 17);
this.panelFix.Name = "panelFix";
this.panelFix.Size = new System.Drawing.Size(526, 34);
this.panelFix.TabIndex = 22;
//
// label3
//
this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(226, 6);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(70, 25);
this.label3.TabIndex = 23;
this.label3.Text = "到";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// fixEndDate
//
this.fixEndDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.fixEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.fixEndDate.Location = new System.Drawing.Point(302, 7);
this.fixEndDate.Name = "fixEndDate";
this.fixEndDate.ShowUpDown = true;
this.fixEndDate.Size = new System.Drawing.Size(200, 21);
this.fixEndDate.TabIndex = 22;
//
// fixStartDate
//
this.fixStartDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.fixStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.fixStartDate.Location = new System.Drawing.Point(6, 7);
this.fixStartDate.Name = "fixStartDate";
this.fixStartDate.ShowUpDown = true;
this.fixStartDate.Size = new System.Drawing.Size(200, 21);
this.fixStartDate.TabIndex = 21;
//
// panel5
//
this.panel5.Controls.Add(this.radioNext);
this.panel5.Dock = System.Windows.Forms.DockStyle.Left;
this.panel5.Location = new System.Drawing.Point(3, 17);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(80, 34);
this.panel5.TabIndex = 22;
//
// panelNext
//
this.panelNext.Controls.Add(this.nextStartDate);
this.panelNext.Controls.Add(this.timeUnitLab);
this.panelNext.Controls.Add(this.timeIntervalLab);
this.panelNext.Controls.Add(this.timeIntervalBox);
this.panelNext.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelNext.Location = new System.Drawing.Point(83, 17);
this.panelNext.Name = "panelNext";
this.panelNext.Size = new System.Drawing.Size(526, 34);
this.panelNext.TabIndex = 23;
//
// nextStartDate
//
this.nextStartDate.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.nextStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.nextStartDate.Location = new System.Drawing.Point(6, 8);
this.nextStartDate.Name = "nextStartDate";
this.nextStartDate.ShowUpDown = true;
this.nextStartDate.Size = new System.Drawing.Size(200, 21);
this.nextStartDate.TabIndex = 25;
//
// timeUnitLab
//
this.timeUnitLab.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.timeUnitLab.Location = new System.Drawing.Point(457, 7);
this.timeUnitLab.Name = "timeUnitLab";
this.timeUnitLab.Size = new System.Drawing.Size(45, 25);
this.timeUnitLab.TabIndex = 24;
this.timeUnitLab.Text = "分钟";
this.timeUnitLab.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// timeIntervalLab
//
this.timeIntervalLab.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.timeIntervalLab.Location = new System.Drawing.Point(226, 7);
this.timeIntervalLab.Name = "timeIntervalLab";
this.timeIntervalLab.Size = new System.Drawing.Size(70, 25);
this.timeIntervalLab.TabIndex = 23;
this.timeIntervalLab.Text = "间 隔:";
this.timeIntervalLab.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// timeIntervalBox
//
this.timeIntervalBox.Location = new System.Drawing.Point(302, 7);
this.timeIntervalBox.Name = "timeIntervalBox";
this.timeIntervalBox.Size = new System.Drawing.Size(149, 21);
this.timeIntervalBox.TabIndex = 22;
//
// linkBtn
//
this.linkBtn.Location = new System.Drawing.Point(483, 70);
this.linkBtn.Name = "linkBtn";
this.linkBtn.Size = new System.Drawing.Size(102, 31);
this.linkBtn.TabIndex = 21;
this.linkBtn.Text = "连接";
this.linkBtn.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.label2);
this.groupBox4.Controls.Add(this.projectComboBox);
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox4.Location = new System.Drawing.Point(0, 109);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(612, 42);
this.groupBox4.TabIndex = 17;
this.groupBox4.TabStop = false;
//
// label2
//
this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(13, 13);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 25);
this.label2.TabIndex = 23;
this.label2.Text = "项 目:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// projectComboBox
//
this.projectComboBox.FormattingEnabled = true;
this.projectComboBox.Location = new System.Drawing.Point(89, 15);
this.projectComboBox.Name = "projectComboBox";
this.projectComboBox.Size = new System.Drawing.Size(200, 20);
this.projectComboBox.TabIndex = 22;
//
// startBtn
//
this.startBtn.Location = new System.Drawing.Point(483, 263);
this.startBtn.Name = "startBtn";
this.startBtn.Size = new System.Drawing.Size(102, 31);
this.startBtn.TabIndex = 18;
this.startBtn.Text = "开始同步";
this.startBtn.UseVisualStyleBackColor = true;
this.radioNow.AutoSize = true;
this.radioNow.Location = new System.Drawing.Point(3, 12);
this.radioNow.Name = "radioNow";
this.radioNow.Size = new System.Drawing.Size(71, 16);
this.radioNow.TabIndex = 17;
this.radioNow.TabStop = true;
this.radioNow.Text = "实时查询";
this.radioNow.UseVisualStyleBackColor = true;
//
// FrmMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(614, 635);
this.ClientSize = new System.Drawing.Size(614, 661);
this.Controls.Add(this.panel2);
this.Controls.Add(this.loginInfoPanel);
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "朗速科技物联网同步平台";
this.loginInfoPanel.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panelFix.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
this.panelNext.ResumeLayout(false);
this.panelNext.PerformLayout();
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.panelFix.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.ResumeLayout(false);
}
@@ -438,4 +487,8 @@ namespace LadfDataApp
private System.Windows.Forms.Label loginNameLab;
private System.Windows.Forms.TextBox loginNameBox;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.R
private System.Windows.Forms.RadioButton radioNext;
private System.Windows.Forms.Panel panelFix;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.DateTimePicker fixEndDate;
private System.Windows
+134 -56
View File
@@ -31,12 +31,13 @@ namespace LadfDataApp
this.startBtn.Click += OnStartBtnClick;
this.radioFix.CheckedChanged += OnCheckedChanged;
this.radioNext.CheckedChanged += OnCheckedChanged;
this.radioNow.CheckedChanged += OnCheckedChanged;
}
private void OnFrmMainLoad(object sender, EventArgs e)
{
startBtn.Enabled = false;
radioFix.Checked = true;
radioNow.Checked = true;
DateTime nowDateTime = DateTime.Now;
fixStartDate.Value = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, 0, 0, 0, 0);
fixEndDate.Value = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, 23, 59, 59, 999);
@@ -56,15 +57,27 @@ namespace LadfDataApp
if (sender == radioFix && radioFix.Checked)
{
radioNext.Checked = false;
panelFix.Enabled = true;
panelNext.Enabled = false;
radioNow.Checked = false;
panelNow.Enabled = false;
panelFix.Enabled = true;
}
if (sender == radioNext && radioNext.Checked)
{
radioFix.Checked = false;
panelFix.Enabled = false;
radioNow.Checked = false;
panelNow.Enabled = false;
panelNext.Enabled = true;
}
if (sender == radioNow && radioNow.Checked)
{
radioFix.Checked = false;
panelFix.Enabled = false;
radioNext.Checked = false;
panelNext.Enabled = false;
panelNow.Enabled = true;
}
}
/// <summary>
/// 加载项目下拉框数据源
@@ -179,6 +192,10 @@ namespace LadfDataApp
timer.Interval = 100;
timer.Start();
}
else if (radioNow.Checked)
{
GetDataOnlyOneWithOutHisData();
}
}
else
{
@@ -232,6 +249,52 @@ namespace LadfDataApp
}
}
/// <summary>
/// 获取数据事件(不查询历史数据)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void GetDataOnlyOneWithOutHisData()
{
try
{
this.Invoke(new Action(() =>
{
this.groupBox5.Enabled = false;
this.panelNow.Enabled = false;
this.linkBtn.Enabled = false;
this.startBtn.Enabled = false;
this.loginNameBox.Enabled = false;
this.loginPasswordBox.Enabled = false;
this.serverBox.Enabled = false;
this.dataBaseBox.Enabled = false;
this.timeIntervalBox.Enabled = false;
this.projectComboBox.Enabled = false;
}));
ClearMsg();
QueryProjectList();
UpdateMsg("同步完成,所有数据已成功写入\r\n");
}
catch (Exception)
{
}
finally
{
this.Invoke(new Action(() =>
{
this.groupBox5.Enabled = true;
this.panelNow.Enabled = true;
this.loginNameBox.Enabled = true;
this.loginPasswordBox.Enabled = true;
this.linkBtn.Enabled = true;
this.startBtn.Enabled = true;
this.serverBox.Enabled = true;
this.dataBaseBox.Enabled = true;
this.timeIntervalBox.Enabled = true;
this.projectComboBox.Enabled = true;
}));
}
}
/// <summary>
/// 获取数据事件
/// </summary>
/// <param name="sender"></param>
@@ -484,7 +547,10 @@ namespace LadfDataApp
SqlHelper.ExecuteNonQuery(projectSqlStrBuilder.ToString());
}
QueryDeviceParamStatus(deviceModel);
QueryDeviceParamStatusHistory(deviceModel);
if (!radioNow.Checked)
{
QueryDeviceParamStatusHistory(deviceModel);
}
}
catch (Exception ex)
{
@@ -535,67 +601,80 @@ namespace LadfDataApp
string code = resultJObject["code"] + "";
if (code.Equals("200"))
{
JObject deviceParamJObject = (JObject)resultJObject["data"];
DeviceParamModel deviceParamModel = new DeviceParamModel();
deviceParamModel.deviceTypeId = deviceParamJObject["deviceType"]["id"] + "";
deviceParamModel.deviceTypeName = deviceParamJObject["deviceType"]["name"] + "";
deviceParamModel.deviceId = deviceParamJObject["deviceId"] + "";
deviceParamModel.deviceName = deviceParamJObject["deviceName"] + "";
deviceParamModel.workload = deviceParamJObject["workload"] + "";
deviceParamModel.elec = deviceParamJObject["elec"] + "";
deviceParamModel.errorParamNum = deviceParamJObject["errorParamNum"] + "";
deviceParamModel.warnParamNum = deviceParamJObject["warnParamNum"] + "";
deviceParamModel.errorTimeSum = deviceParamJObject["errorTimeSum"] + "";
deviceParamModel.runTimeSum = deviceParamJObject["runTimeSum"] + "";
deviceParamModel.warnEventSum = deviceParamJObject["warnEventSum"] + "";
deviceParamModel.errorEventSum = deviceParamJObject["errorEventSum"] + "";
deviceParamModel.projectId = deviceParamJObject["projectId"] + "";
deviceParamModel.status = deviceParamJObject["status"] + "";
deviceParamModel.timestamp = deviceParamJObject["timestamp"] + "";
StringBuilder deviceParamInsertKeys = new StringBuilder();
StringBuilder deviceParamInsertValues = new StringBuilder();
PropertyInfo[] deviceParamPropertyInfos = deviceParamModel.GetType().GetProperties();
foreach (System.Reflection.PropertyInfo deviceParamPropertyInfo in deviceParamPropertyInfos)
if (resultJObject.ContainsKey("data"))
{
deviceParamInsertKeys.Append($"{deviceParamPropertyInfo.Name},");
deviceParamInsertValues.Append($"'{(deviceParamPropertyInfo.GetValue(deviceParamModel, null) + "").Replace("'", "''")}',");
}
projectSqlStrBuilder.Append($"delete from LadfDeviceParamTab where projectid = '{deviceModel.projectId}' and deviceId = '{deviceModel.deviceId}';\r\n");
projectSqlStrBuilder.Append($"insert into LadfDeviceParamTab ({deviceParamInsertKeys.ToString().TrimEnd(',')}) values ({deviceParamInsertValues.ToString().TrimEnd(',')});\r\n");
projectSqlStrBuilder.Append($"delete from LadfDeviceParamStatusTab where projectid = '{deviceModel.projectId}' and deviceId = '{deviceModel.deviceId}';\r\n");
JArray devicePmsArray = (JArray)deviceParamJObject["jsonParams"];
foreach (JObject devicePmsJObject in devicePmsArray)
{
try
JObject deviceParamJObject = (JObject)resultJObject["data"];
DeviceParamModel deviceParamModel = new DeviceParamModel();
deviceParamModel.deviceTypeId = deviceParamJObject["deviceType"]["id"] + "";
deviceParamModel.deviceTypeName = deviceParamJObject["deviceType"]["name"] + "";
deviceParamModel.deviceId = deviceParamJObject["deviceId"] + "";
deviceParamModel.deviceName = deviceParamJObject["deviceName"] + "";
deviceParamModel.workload = deviceParamJObject["workload"] + "";
deviceParamModel.elec = deviceParamJObject["elec"] + "";
deviceParamModel.errorParamNum = deviceParamJObject["errorParamNum"] + "";
deviceParamModel.warnParamNum = deviceParamJObject["warnParamNum"] + "";
deviceParamModel.errorTimeSum = deviceParamJObject["errorTimeSum"] + "";
deviceParamModel.runTimeSum = deviceParamJObject["runTimeSum"] + "";
deviceParamModel.warnEventSum = deviceParamJObject["warnEventSum"] + "";
deviceParamModel.errorEventSum = deviceParamJObject["errorEventSum"] + "";
deviceParamModel.projectId = deviceParamJObject["projectId"] + "";
deviceParamModel.status = deviceParamJObject["status"] + "";
deviceParamModel.timestamp = deviceParamJObject["timestamp"] + "";
StringBuilder deviceParamInsertKeys = new StringBuilder();
StringBuilder deviceParamInsertValues = new StringBuilder();
PropertyInfo[] deviceParamPropertyInfos = deviceParamModel.GetType().GetProperties();
foreach (System.Reflection.PropertyInfo deviceParamPropertyInfo in deviceParamPropertyInfos)
{
DeviceParamStatusModel devicePmsModel = new DeviceParamStatusModel();
devicePmsModel.projectId = deviceModel.projectId;
devicePmsModel.deviceId = deviceModel.deviceId;
devicePmsModel.qs = devicePmsJObject["qs"] + "";
devicePmsModel.realValue = devicePmsJObject["realValue"] + "";
devicePmsModel.flag = devicePmsJObject["flag"] + "";
devicePmsModel.id = devicePmsJObject["id"] + "";
devicePmsModel.paramName = devicePmsJObject["paramName"] + "";
devicePmsModel.value = devicePmsJObject["value"] + "";
devicePmsModel.unitName = devicePmsJObject["unitName"] + "";
devicePmsModel.dataType = devicePmsJObject["dataType"] + "";
StringBuilder devicePmsInsertKeys = new StringBuilder();
StringBuilder devicePmsInsertValues = new StringBuilder();
PropertyInfo[] devicePmsPropertyInfos = devicePmsModel.GetType().GetProperties();
foreach (System.Reflection.PropertyInfo devicePmsPropertyInfo in devicePmsPropertyInfos)
deviceParamInsertKeys.Append($"{deviceParamPropertyInfo.Name},");
deviceParamInsertValues.Append($"'{(deviceParamPropertyInfo.GetValue(deviceParamModel, null) + "").Replace("'", "''")}',");
}
projectSqlStrBuilder.Append($"delete from LadfDeviceParamTab where projectid = '{deviceModel.projectId}' and deviceId = '{deviceModel.deviceId}';\r\n");
projectSqlStrBuilder.Append($"insert into LadfDeviceParamTab ({deviceParamInsertKeys.ToString().TrimEnd(',')}) values ({deviceParamInsertValues.ToString().TrimEnd(',')});\r\n");
projectSqlStrBuilder.Append($"delete from LadfDeviceParamStatusTab where projectid = '{deviceModel.projectId}' and deviceId = '{deviceModel.deviceId}';\r\n");
JArray devicePmsArray = (JArray)deviceParamJObject["jsonParams"];
foreach (JObject devicePmsJObject in devicePmsArray)
{
try
{
DeviceParamStatusModel devicePmsModel = new DeviceParamStatusModel();
devicePmsModel.projectId = deviceModel.projectId;
devicePmsModel.deviceId = deviceModel.deviceId;
devicePmsModel.qs = devicePmsJObject["qs"] + "";
devicePmsModel.realValue = devicePmsJObject["realValue"] + "";
devicePmsModel.flag = devicePmsJObject["flag"] + "";
devicePmsModel.id = devicePmsJObject["id"] + "";
devicePmsModel.paramName = devicePmsJObject["paramName"] + "";
devicePmsModel.value = devicePmsJObject["value"] + "";
devicePmsModel.unitName = devicePmsJObject["unitName"] + "";
devicePmsModel.dataType = devicePmsJObject["dataType"] + "";
StringBuilder devicePmsInsertKeys = new StringBuilder();
StringBuilder devicePmsInsertValues = new StringBuilder();
PropertyInfo[] devicePmsPropertyInfos = devicePmsModel.GetType().GetProperties();
foreach (System.Reflection.PropertyInfo devicePmsPropertyInfo in devicePmsPropertyInfos)
{
devicePmsInsertKeys.Append($"{devicePmsPropertyInfo.Name},");
devicePmsInsertValues.Append($"'{(devicePmsPropertyInfo.GetValue(devicePmsModel, null) + "").Replace("'", "''")}',");
}
projectSqlStrBuilder.Append($"insert into LadfDeviceParamStatusTab ({devicePmsInsertKeys.ToString().TrimEnd(',')}) values ({devicePmsInsertValues.ToString().TrimEnd(',')});\r\n");
}
catch (Exception)
{
devicePmsInsertKeys.Append($"{devicePmsPropertyInfo.Name},");
devicePmsInsertValues.Append($"'{(devicePmsPropertyInfo.GetValue(devicePmsModel, null) + "").Replace("'", "''")}',");
}
projectSqlStrBuilder.Append($"insert into LadfDeviceParamStatusTab ({devicePmsInsertKeys.ToString().TrimEnd(',')}) values ({devicePmsInsertValues.ToString().TrimEnd(',')});\r\n");
}
catch (Exception)
if (!string.IsNullOrEmpty(projectSqlStrBuilder.ToString()))
{
SqlHelper.ExecuteNonQuery(projectSqlStrBuilder.ToString());
}
UpdateMsg($"读取设备:{deviceModel.name}{deviceModel.deviceTypeName}的属性成功\r\n");
}
if (!string.IsNullOrEmpty(projectSqlStrBuilder.ToString()))
else
{
SqlHelper.ExecuteNonQuery(projectSqlStrBuilder.ToString());
projectSqlStrBuilder.Append($"update LadfDeviceParamTab set status = '3' where projectid = '{deviceModel.projectId}' and deviceId = '{deviceModel.deviceId}';\r\n");
if (!string.IsNullOrEmpty(projectSqlStrBuilder.ToString()))
{
SqlHelper.ExecuteNonQuery(projectSqlStrBuilder.ToString());
}
UpdateMsg($"读取设备:{deviceModel.name}{deviceModel.deviceTypeName}的属性成功,但设备已离线\r\n");
}
}
else if (code.Equals("4012"))
@@ -604,7 +683,6 @@ namespace LadfDataApp
Login();
QueryDeviceParamStatus(deviceModel);
}
UpdateMsg($"读取设备:{deviceModel.name}{deviceModel.deviceTypeName}的属性成功\r\n");
}
}
catch (Exception ex)