diff --git a/solarApp/Service/procSensorSvc.cs b/solarApp/Service/procSensorSvc.cs index e1ec277..e4c307d 100644 --- a/solarApp/Service/procSensorSvc.cs +++ b/solarApp/Service/procSensorSvc.cs @@ -213,7 +213,7 @@ namespace solarApp.Service sql = @"insert into sensor_history_hour( `PowerStationId`, `TIMESTAMP`, Irradiance, Temperature, EnvTemperature, Humidity, Vane, Dust) select a.powerstationID, a.reportdate, ifnull(b.irrAvg, 0) irrAvg, a.Temperature, a.envTemperature, a.humidity, a.Vane, a.Dust from ( - select @powerStationID powerstationID, FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') reportdate, avg(" + modelTempCol + @") Temperature, + select @powerStationID powerstationID, FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') reportdate, round(avg(" + modelTempCol + @"), 4) Temperature, avg(" + evnTempCol + @") envTemperature, avg(" + humCol + @") humidity, avg(" + windCol + @") Vane, avg(" + dustCol + @") Dust from " + _siteDB + ".s" + _siteID01 + @"_sensorAvg where FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') = @date1 diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index c0fe1a2..397770b 100644 --- a/solarApp/fmArchive.Designer.cs +++ b/solarApp/fmArchive.Designer.cs @@ -32,6 +32,7 @@ namespace solarApp this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.bt_meter = new System.Windows.Forms.Button(); this.lbmsg = new System.Windows.Forms.Label(); this.dtSelect2 = new System.Windows.Forms.DateTimePicker(); this.bt_archive = new System.Windows.Forms.Button(); @@ -50,7 +51,6 @@ namespace solarApp this.lbSiteID_sensor = new System.Windows.Forms.Label(); this.lbSiteName_sensor = new System.Windows.Forms.Label(); this.tabPage2 = new System.Windows.Forms.TabPage(); - this.bt_meter = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -68,20 +68,18 @@ namespace solarApp this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Margin = new System.Windows.Forms.Padding(2); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1386, 752); + this.tabControl1.Size = new System.Drawing.Size(1782, 953); this.tabControl1.TabIndex = 0; // // tabPage1 // this.tabPage1.Controls.Add(this.splitContainer1); - this.tabPage1.Location = new System.Drawing.Point(4, 27); - this.tabPage1.Margin = new System.Windows.Forms.Padding(2); + this.tabPage1.Location = new System.Drawing.Point(4, 31); this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(2); - this.tabPage1.Size = new System.Drawing.Size(1378, 721); + this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tabPage1.Size = new System.Drawing.Size(1774, 918); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "tabPage1"; this.tabPage1.UseVisualStyleBackColor = true; @@ -89,8 +87,7 @@ namespace solarApp // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(2, 2); - this.splitContainer1.Margin = new System.Windows.Forms.Padding(2); + this.splitContainer1.Location = new System.Drawing.Point(3, 3); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 @@ -113,36 +110,44 @@ namespace solarApp // this.splitContainer1.Panel2.Controls.Add(this.dataGridView1); this.splitContainer1.Panel2.Controls.Add(this.panel1); - this.splitContainer1.Size = new System.Drawing.Size(1374, 717); - this.splitContainer1.SplitterDistance = 233; - this.splitContainer1.SplitterWidth = 8; + this.splitContainer1.Size = new System.Drawing.Size(1768, 912); + this.splitContainer1.SplitterDistance = 299; + this.splitContainer1.SplitterWidth = 10; this.splitContainer1.TabIndex = 0; // + // bt_meter + // + this.bt_meter.Location = new System.Drawing.Point(156, 786); + this.bt_meter.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.bt_meter.Name = "bt_meter"; + this.bt_meter.Size = new System.Drawing.Size(135, 56); + this.bt_meter.TabIndex = 11; + this.bt_meter.Text = "Meter歸檔"; + this.bt_meter.UseVisualStyleBackColor = true; + this.bt_meter.Click += new System.EventHandler(this.bt_meter_Click); + // // lbmsg // this.lbmsg.AutoSize = true; - this.lbmsg.Location = new System.Drawing.Point(7, 410); - this.lbmsg.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lbmsg.Location = new System.Drawing.Point(10, 569); this.lbmsg.Name = "lbmsg"; - this.lbmsg.Size = new System.Drawing.Size(16, 15); + this.lbmsg.Size = new System.Drawing.Size(20, 19); this.lbmsg.TabIndex = 10; this.lbmsg.Text = "~"; // // dtSelect2 // - this.dtSelect2.Location = new System.Drawing.Point(7, 429); - this.dtSelect2.Margin = new System.Windows.Forms.Padding(2); + this.dtSelect2.Location = new System.Drawing.Point(10, 593); this.dtSelect2.Name = "dtSelect2"; - this.dtSelect2.Size = new System.Drawing.Size(114, 23); + this.dtSelect2.Size = new System.Drawing.Size(145, 27); this.dtSelect2.TabIndex = 9; // // bt_archive // this.bt_archive.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_archive.Location = new System.Drawing.Point(7, 651); - this.bt_archive.Margin = new System.Windows.Forms.Padding(2); + this.bt_archive.Location = new System.Drawing.Point(9, 846); this.bt_archive.Name = "bt_archive"; - this.bt_archive.Size = new System.Drawing.Size(219, 56); + this.bt_archive.Size = new System.Drawing.Size(282, 61); this.bt_archive.TabIndex = 8; this.bt_archive.Text = "單日歸檔"; this.bt_archive.UseVisualStyleBackColor = true; @@ -152,10 +157,9 @@ namespace solarApp // this.bt_clear_sensor.Enabled = false; this.bt_clear_sensor.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_clear_sensor.Location = new System.Drawing.Point(3, 466); - this.bt_clear_sensor.Margin = new System.Windows.Forms.Padding(2); + this.bt_clear_sensor.Location = new System.Drawing.Point(10, 635); this.bt_clear_sensor.Name = "bt_clear_sensor"; - this.bt_clear_sensor.Size = new System.Drawing.Size(105, 35); + this.bt_clear_sensor.Size = new System.Drawing.Size(135, 44); this.bt_clear_sensor.TabIndex = 7; this.bt_clear_sensor.Text = "clear data"; this.bt_clear_sensor.UseVisualStyleBackColor = true; @@ -165,10 +169,9 @@ namespace solarApp // this.bt_clear_station.Enabled = false; this.bt_clear_station.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_clear_station.Location = new System.Drawing.Point(3, 545); - this.bt_clear_station.Margin = new System.Windows.Forms.Padding(2); + this.bt_clear_station.Location = new System.Drawing.Point(10, 735); this.bt_clear_station.Name = "bt_clear_station"; - this.bt_clear_station.Size = new System.Drawing.Size(105, 35); + this.bt_clear_station.Size = new System.Drawing.Size(135, 44); this.bt_clear_station.TabIndex = 6; this.bt_clear_station.Text = "clear data"; this.bt_clear_station.UseVisualStyleBackColor = true; @@ -178,10 +181,9 @@ namespace solarApp // this.bt_clear_inv.Enabled = false; this.bt_clear_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_clear_inv.Location = new System.Drawing.Point(3, 506); - this.bt_clear_inv.Margin = new System.Windows.Forms.Padding(2); + this.bt_clear_inv.Location = new System.Drawing.Point(10, 686); this.bt_clear_inv.Name = "bt_clear_inv"; - this.bt_clear_inv.Size = new System.Drawing.Size(105, 35); + this.bt_clear_inv.Size = new System.Drawing.Size(135, 44); this.bt_clear_inv.TabIndex = 5; this.bt_clear_inv.Text = "clear data"; this.bt_clear_inv.UseVisualStyleBackColor = true; @@ -191,27 +193,24 @@ namespace solarApp // this.fp_site.Dock = System.Windows.Forms.DockStyle.Top; this.fp_site.Location = new System.Drawing.Point(0, 0); - this.fp_site.Margin = new System.Windows.Forms.Padding(2); this.fp_site.Name = "fp_site"; - this.fp_site.Size = new System.Drawing.Size(233, 380); + this.fp_site.Size = new System.Drawing.Size(299, 530); this.fp_site.TabIndex = 4; // // dtSelect1 // - this.dtSelect1.Location = new System.Drawing.Point(7, 384); - this.dtSelect1.Margin = new System.Windows.Forms.Padding(2); + this.dtSelect1.Location = new System.Drawing.Point(10, 536); this.dtSelect1.Name = "dtSelect1"; - this.dtSelect1.Size = new System.Drawing.Size(114, 23); + this.dtSelect1.Size = new System.Drawing.Size(145, 27); this.dtSelect1.TabIndex = 3; this.dtSelect1.ValueChanged += new System.EventHandler(this.dtSelect_ValueChanged); // // bt_site // this.bt_site.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_site.Location = new System.Drawing.Point(119, 545); - this.bt_site.Margin = new System.Windows.Forms.Padding(2); + this.bt_site.Location = new System.Drawing.Point(159, 735); this.bt_site.Name = "bt_site"; - this.bt_site.Size = new System.Drawing.Size(105, 35); + this.bt_site.Size = new System.Drawing.Size(135, 44); this.bt_site.TabIndex = 2; this.bt_site.Text = "Site 歸檔"; this.bt_site.UseVisualStyleBackColor = true; @@ -220,10 +219,9 @@ namespace solarApp // bt_Inv // this.bt_Inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_Inv.Location = new System.Drawing.Point(117, 506); - this.bt_Inv.Margin = new System.Windows.Forms.Padding(2); + this.bt_Inv.Location = new System.Drawing.Point(156, 686); this.bt_Inv.Name = "bt_Inv"; - this.bt_Inv.Size = new System.Drawing.Size(105, 35); + this.bt_Inv.Size = new System.Drawing.Size(135, 44); this.bt_Inv.TabIndex = 1; this.bt_Inv.Text = "Inv 歸檔"; this.bt_Inv.UseVisualStyleBackColor = true; @@ -232,10 +230,9 @@ namespace solarApp // bt_Sensor // this.bt_Sensor.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.bt_Sensor.Location = new System.Drawing.Point(117, 466); - this.bt_Sensor.Margin = new System.Windows.Forms.Padding(2); + this.bt_Sensor.Location = new System.Drawing.Point(156, 635); this.bt_Sensor.Name = "bt_Sensor"; - this.bt_Sensor.Size = new System.Drawing.Size(105, 35); + this.bt_Sensor.Size = new System.Drawing.Size(135, 44); this.bt_Sensor.TabIndex = 0; this.bt_Sensor.Text = "Sensor 歸檔"; this.bt_Sensor.UseVisualStyleBackColor = true; @@ -245,12 +242,11 @@ namespace solarApp // this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridView1.Location = new System.Drawing.Point(0, 99); - this.dataGridView1.Margin = new System.Windows.Forms.Padding(2); + this.dataGridView1.Location = new System.Drawing.Point(0, 125); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.RowHeadersWidth = 51; this.dataGridView1.RowTemplate.Height = 29; - this.dataGridView1.Size = new System.Drawing.Size(1133, 618); + this.dataGridView1.Size = new System.Drawing.Size(1459, 787); this.dataGridView1.TabIndex = 1; // // panel1 @@ -262,18 +258,16 @@ namespace solarApp this.panel1.Controls.Add(this.lbSiteName_sensor); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Margin = new System.Windows.Forms.Padding(2); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1133, 99); + this.panel1.Size = new System.Drawing.Size(1459, 125); this.panel1.TabIndex = 0; // // btVerifyData // this.btVerifyData.Font = new System.Drawing.Font("Microsoft JhengHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.btVerifyData.Location = new System.Drawing.Point(494, 6); - this.btVerifyData.Margin = new System.Windows.Forms.Padding(2); + this.btVerifyData.Location = new System.Drawing.Point(635, 8); this.btVerifyData.Name = "btVerifyData"; - this.btVerifyData.Size = new System.Drawing.Size(123, 35); + this.btVerifyData.Size = new System.Drawing.Size(158, 44); this.btVerifyData.TabIndex = 12; this.btVerifyData.Text = "檢核結果"; this.btVerifyData.UseVisualStyleBackColor = true; @@ -283,9 +277,10 @@ namespace solarApp // this.lbSiteDB_sensor.AutoSize = true; this.lbSiteDB_sensor.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lbSiteDB_sensor.Location = new System.Drawing.Point(38, 15); + this.lbSiteDB_sensor.Location = new System.Drawing.Point(49, 19); + this.lbSiteDB_sensor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbSiteDB_sensor.Name = "lbSiteDB_sensor"; - this.lbSiteDB_sensor.Size = new System.Drawing.Size(62, 19); + this.lbSiteDB_sensor.Size = new System.Drawing.Size(79, 24); this.lbSiteDB_sensor.TabIndex = 11; this.lbSiteDB_sensor.Text = "Site_DB"; this.lbSiteDB_sensor.Click += new System.EventHandler(this.lbSiteDB_sensor_Click); @@ -294,9 +289,10 @@ namespace solarApp // this.lbSiteID_sensor.AutoSize = true; this.lbSiteID_sensor.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lbSiteID_sensor.Location = new System.Drawing.Point(156, 15); + this.lbSiteID_sensor.Location = new System.Drawing.Point(201, 19); + this.lbSiteID_sensor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbSiteID_sensor.Name = "lbSiteID_sensor"; - this.lbSiteID_sensor.Size = new System.Drawing.Size(57, 19); + this.lbSiteID_sensor.Size = new System.Drawing.Size(72, 24); this.lbSiteID_sensor.TabIndex = 10; this.lbSiteID_sensor.Text = "Site_ID"; // @@ -304,40 +300,29 @@ namespace solarApp // this.lbSiteName_sensor.AutoSize = true; this.lbSiteName_sensor.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.lbSiteName_sensor.Location = new System.Drawing.Point(280, 15); + this.lbSiteName_sensor.Location = new System.Drawing.Point(360, 19); + this.lbSiteName_sensor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbSiteName_sensor.Name = "lbSiteName_sensor"; - this.lbSiteName_sensor.Size = new System.Drawing.Size(84, 19); + this.lbSiteName_sensor.Size = new System.Drawing.Size(107, 24); this.lbSiteName_sensor.TabIndex = 9; this.lbSiteName_sensor.Text = "Site_Name"; // // tabPage2 // - this.tabPage2.Location = new System.Drawing.Point(4, 27); - this.tabPage2.Margin = new System.Windows.Forms.Padding(2); + this.tabPage2.Location = new System.Drawing.Point(4, 31); this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(2); - this.tabPage2.Size = new System.Drawing.Size(1378, 721); + this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tabPage2.Size = new System.Drawing.Size(1774, 918); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // - // bt_meter - // - this.bt_meter.Location = new System.Drawing.Point(117, 585); - this.bt_meter.Name = "bt_meter"; - this.bt_meter.Size = new System.Drawing.Size(105, 44); - this.bt_meter.TabIndex = 11; - this.bt_meter.Text = "Meter歸檔"; - this.bt_meter.UseVisualStyleBackColor = true; - this.bt_meter.Click += new System.EventHandler(this.bt_meter_Click); - // // fmArchive // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1386, 752); + this.ClientSize = new System.Drawing.Size(1782, 953); this.Controls.Add(this.tabControl1); - this.Margin = new System.Windows.Forms.Padding(2); this.Name = "fmArchive"; this.Text = "fmArchive"; this.Load += new System.EventHandler(this.fmArchive_Load);