From 038f882591f2f3d7a3c457d48e7825aa11aea188 Mon Sep 17 00:00:00 2001 From: cesar liu Date: Wed, 7 Sep 2022 11:07:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BC=E4=BD=88=E6=96=B0=E7=89=88=20?= =?UTF-8?q?=E7=95=B0=E5=B8=B8=E6=9F=A5=E8=A9=A2=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Helper/DatabaseHelper.cs | 11 +- SolarPower/Program.cs | 25 +++- SolarPower/Properties/launchSettings.json | 10 +- SolarPower/Quartz/Jobs/ExceptionSchedule.cs | 10 +- .../Implement/OverviewRepository.cs | 59 +++++---- SolarPower/Startup.cs | 112 +++++++++--------- SolarPower/appsettings.Staging.json | 64 ++++++++++ SolarPower/appsettings.json | 6 +- solarApp/Service/procSyncError.cs | 69 +++++++---- solarApp/fmArchive.Designer.cs | 34 +++--- solarApp/fmArchive.cs | 10 +- solarApp/fmMain.Designer.cs | 92 +++++++++++--- solarApp/solarApp.csproj | 1 - 13 files changed, 338 insertions(+), 165 deletions(-) create mode 100644 SolarPower/appsettings.Staging.json diff --git a/SolarPower/Helper/DatabaseHelper.cs b/SolarPower/Helper/DatabaseHelper.cs index 5d3b384..b71b846 100644 --- a/SolarPower/Helper/DatabaseHelper.cs +++ b/SolarPower/Helper/DatabaseHelper.cs @@ -44,11 +44,12 @@ namespace SolarPower.Helper //var passwordStr = ed.AESEncrypt("P@ssw0rd"); y4uPqlH9ncTgR/I07qpwaA== // FIC 測試機 2 - //var serverStr = ed.AESEncrypt("localhost"); - //var portStr = ed.AESEncrypt("3306"); - //var databaseStr = ed.AESEncrypt("solar_master"); - //var rootStr = ed.AESEncrypt("webUser"); - //var passwordStr = ed.AESEncrypt("ficAdmin99"); + //var serverStr = ed.AESEncrypt("localhost"); // MWAxcj1mgmbZ8tB6NgApnQ== + //var portStr = ed.AESEncrypt("3306"); // CY1x+1WYXRCBab3wKnBCOQ== + //var databaseStr = ed.AESEncrypt("solar_master"); // CEyYZnO8B5+yTXQcFSsiBA== + //var rootStr = ed.AESEncrypt("root"); // 4koIJVzfp6veImONCwQy3A== + //var passwordStr = ed.AESEncrypt("P@ssw0rd"); // bOlWkSFsV3qNLkZTJ3UPog== + // server=MWAxcj1mgmbZ8tB6NgApnQ==;port=CY1x+1WYXRCBab3wKnBCOQ==;database=CEyYZnO8B5+yTXQcFSsiBA==;user=pBX64+ALGFnLiHGRFXNh7w==;password=bOlWkSFsV3qNLkZTJ3UPog==;charset=utf8;Allow User Variables=True; var connStr = $"server={serverStr};port={portStr};database={databaseStr};user={rootStr};password={passwordStr};charset=utf8;Allow User Variables=True;"; diff --git a/SolarPower/Program.cs b/SolarPower/Program.cs index f858035..8254f9f 100644 --- a/SolarPower/Program.cs +++ b/SolarPower/Program.cs @@ -17,10 +17,25 @@ namespace SolarPower } public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + //Host.CreateDefaultBuilder(args) + // .ConfigureWebHostDefaults(webBuilder => + // { + // webBuilder.UseStartup(); + // }) + // .ConfigureAppConfiguration((context, configuration) => + // { + // configuration.Sources.Clear(); + // var envName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + // configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); + // configuration.AddJsonFile($"appsettings{envName}.json", optional: true, reloadOnChange: true); + // configuration.AddCommandLine(args); + // }); + + } } diff --git a/SolarPower/Properties/launchSettings.json b/SolarPower/Properties/launchSettings.json index b75bf12..b3dd8ad 100644 --- a/SolarPower/Properties/launchSettings.json +++ b/SolarPower/Properties/launchSettings.json @@ -21,10 +21,18 @@ "commandName": "Project", "launchBrowser": true, "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_ENVIRONMENT": "Product", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" }, "applicationUrl": "https://localhost:5001;http://localhost:5000" + }, + "Staging": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Staging", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" + } } } } \ No newline at end of file diff --git a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs index 4f84366..723f5d4 100644 --- a/SolarPower/Quartz/Jobs/ExceptionSchedule.cs +++ b/SolarPower/Quartz/Jobs/ExceptionSchedule.cs @@ -45,14 +45,14 @@ namespace SolarPower.Quartz.Jobs var ExceptionList = await overviewRepository.GetEmailExceptionList(); if(ExceptionList.Count > 0 ) { + // 立刻發報 var ExceptionListex = ExceptionList.Where(x => x.sourceState == 1 && - x.priority == 1 && - (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority1).ToList(); - + x.priority == 1 ).ToList(); + // 12小時後發報 var ExceptionListex2 = ExceptionList.Where(x => x.sourceState == 1 && x.priority == 2 && - (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority2).ToList(); - + (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalMinutes/ 60) >= ExceptionTimes_Priority2).ToList(); + // 24小時後發報 var ExceptionListex3 = ExceptionList.Where(x => x.sourceState == 1 && x.priority == 3 && (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority3).ToList(); ExceptionListex.AddRange(ExceptionListex2); diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index 9119df5..e9f5174 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -350,9 +350,7 @@ namespace SolarPower.Repository.Implement } public async Task> GetExceptionTable(ExceptionSent post) - { - - + { List result; using (IDbConnection conn = this._databaseHelper.GetConnection()) { @@ -360,10 +358,32 @@ namespace SolarPower.Repository.Implement { DateTime start; DateTime end; - //var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, - // a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName, - // errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, - // case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg + var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , + a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, + a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, + FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, + errMsg + from err_main a + left join alarmorion_orionalarmclass b on a.alarmclass = b.id + left join power_station ps on ps.Code = site_id + left join operation_record pr on pr.ErrorCode = a.id + WHERE a.sourceState = @Status AND ps.Id = @PowerStationId "; + //var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , + // a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, + // a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw, + // case when c.errMsg_tw is null then + // case when err_valueKind = 'b' then d.errMsg_tw + // when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2)) + // when d.errMsg_tw is null then a.errValue + // when a.errValue is null then d.errMsg_tw + // else CONCAT(a.errValue, ', ' , ifNull(d.errMsg_tw, '')) end + // else + // case when err_valueKind = 'b' then c.errMsg_tw + // when err_valueKind = 'd' then CONCAT(c.errMsg_tw, ': ', round(a.errValue, 2)) + // when c.errMsg_tw is null then a.errValue + // when a.errValue is null then c.errMsg_tw + // else CONCAT(a.errValue, ', ' , ifNull(c.errMsg_tw, '')) end + // end errMsg // from err_main a // left join alarmorion_orionalarmclass b on a.alarmclass = b.id // left join ref_err_device c on trim(b.alarmClass) = c.deviceType @@ -373,31 +393,6 @@ namespace SolarPower.Repository.Implement // left join power_station ps on ps.Code = site_id // left join operation_record pr on pr.ErrorCode = a.id // WHERE a.sourceState = @Status AND ps.Id = @PowerStationId "; - var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , - a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, - a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw, - case when c.errMsg_tw is null then - case when err_valueKind = 'b' then d.errMsg_tw - when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2)) - when d.errMsg_tw is null then a.errValue - when a.errValue is null then d.errMsg_tw - else CONCAT(a.errValue, ', ' , ifNull(d.errMsg_tw, '')) end - else - case when err_valueKind = 'b' then c.errMsg_tw - when err_valueKind = 'd' then CONCAT(c.errMsg_tw, ': ', round(a.errValue, 2)) - when c.errMsg_tw is null then a.errValue - when a.errValue is null then c.errMsg_tw - else CONCAT(a.errValue, ', ' , ifNull(c.errMsg_tw, '')) end - end errMsg - from err_main a - left join alarmorion_orionalarmclass b on a.alarmclass = b.id - left join ref_err_device c on trim(b.alarmClass) = c.deviceType - left join ref_err_inv d on lower(b.alarmClass) = d.deviceType - # and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode - and a.errDeviceBrand = d.brend and a.errDeviceModel = d.model and a.errValue = d.errCode - left join power_station ps on ps.Code = site_id - left join operation_record pr on pr.ErrorCode = a.id - WHERE a.sourceState = @Status AND ps.Id = @PowerStationId "; if (!string.IsNullOrEmpty(post.Range)) { diff --git a/SolarPower/Startup.cs b/SolarPower/Startup.cs index 14c7a0d..a7dbf60 100644 --- a/SolarPower/Startup.cs +++ b/SolarPower/Startup.cs @@ -29,6 +29,7 @@ using System.Threading.Tasks; namespace SolarPower { + // ref https://ithelp.ithome.com.tw/articles/10185314 public class Startup { public IConfiguration Configuration { get; } @@ -39,6 +40,11 @@ namespace SolarPower { CurrentEnvironment = env; Configuration = configuration; + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); dBConfig.Server = Configuration.GetValue("DBConfig:Server"); dBConfig.Port = Configuration.GetValue("DBConfig:Port"); @@ -96,66 +102,66 @@ namespace SolarPower #region [JI //services.AddHostedService(); //if (envName == "Production") - //if (envName != "Production") - //{ + if (envName != "Production") + { ////K[QuartzA services.AddSingleton(); services.AddSingleton(); - ////K[Job - //#region wpe / C email A - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:OperationScheduleJob")) - ); - //#endregion - - //#region pqfܾT(CI2}l15@Ӵ`) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(CalcInverter15minJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcInverter15minJob")) - ); - //#endregion - - ////#region pqoqqT(CI5) - //services.AddSingleton(); - //services.AddSingleton( - //new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcPowerStationJob")) - ////new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: "0/10 * * * * ?") - //); - ////#endregion - - //#region pqoqqT(CI5) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcPowerStationJobV2")) - //new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: "0/10 * * * * ?") - ); - //#endregion - - //#region pqӶqBPRBkWP 30饭B(Cѭ2I) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcAvgPowerStationJob")) - //new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: "0 03 7 ? * * *") - ); - //#endregion - - //#region HeEmail(Cѭ2I) - services.AddSingleton(); - services.AddSingleton( - new JobSchedule(jobType: typeof(SendEmailJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:SendEmailJob")) - ); - //#endregion - - //#region d߲`sWEmail - services.AddSingleton(); + ////K[Job + //#region wpe / C email A + services.AddSingleton(); services.AddSingleton( - new JobSchedule(jobType: typeof(ExceptionSchedule), cronExpression: Configuration.GetValue("BackgroundServiceCron:ExceptionSchedule")) + new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:OperationScheduleJob")) ); //#endregion - services.AddHostedService(); - //} + //#region pqfܾT(CI2}l15@Ӵ`) + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(CalcInverter15minJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcInverter15minJob")) + ); + //#endregion + + ////#region pqoqqT(CI5) + //services.AddSingleton(); + //services.AddSingleton( + //new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcPowerStationJob")) + ////new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: "0/10 * * * * ?") + //); + ////#endregion + + //#region pqoqqT(CI5) + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcPowerStationJobV2")) + //new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: "0/10 * * * * ?") + ); + //#endregion + + //#region pqӶqBPRBkWP 30饭B(Cѭ2I) + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:CalcAvgPowerStationJob")) + //new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: "0 03 7 ? * * *") + ); + //#endregion + + //#region HeEmail(Cѭ2I) + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(SendEmailJob), cronExpression: Configuration.GetValue("BackgroundServiceCron:SendEmailJob")) + ); + //#endregion + + //#region d߲`sWEmail + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(ExceptionSchedule), cronExpression: Configuration.GetValue("BackgroundServiceCron:ExceptionSchedule")) + ); + //#endregion + + services.AddHostedService(); + } #endregion services.AddApplicationInsightsTelemetry(); diff --git a/SolarPower/appsettings.Staging.json b/SolarPower/appsettings.Staging.json new file mode 100644 index 0000000..e4f3a12 --- /dev/null +++ b/SolarPower/appsettings.Staging.json @@ -0,0 +1,64 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "LoginExpireMinute": 60, //nJɶA() + "GoBackDay": 1, //v(I(C))A^Ѽ + //"DBConfig": { + // "Server": "MVgHWzR3rGDgD57TUoFunA==", + // "port": "r4AoXMUDodcQjIzofGNCcg==", + // "Database": "z8TVtiXZ6MwgWbUEAOXA/fiHzd7c0iUhFqn1mHzxhKo=", + // "Root": "mWlR2HshQNhRRE34jg4kdg==", + // "Password": "y4uPqlH9ncTgR/I07qpwaA==" + //}, + //"mySql": "server=210.61.91.43;user=idafenweb;Database=solar_master;Port=10068;password=P@ssw0rd;charset='utf8';pooling=true;sslmode=none;", + "mySql": "server=60.251.164.103;user=webuser;Database=solar_master;Port=11306;password=FICadmin99;charset='utf8';pooling=true;sslmode=none;", + // + "DBConfig": { + "Server": "MWAxcj1mgmbZ8tB6NgApnQ==", + "port": "CY1x+1WYXRCBab3wKnBCOQ==", + "Database": "CEyYZnO8B5+yTXQcFSsiBA==", + "Root": "pBX64+ALGFnLiHGRFXNh7w==", + "Password": "y4uPqlH9ncTgR/I07qpwaA==" + }, + // FIC woG + //"DBConfig": { + // "Server": "MWAxcj1mgmbZ8tB6NgApnQ==", + // "port": "CY1x+1WYXRCBab3wKnBCOQ==", + // "Database": "CEyYZnO8B5+yTXQcFSsiBA==", + // "Root": "4koIJVzfp6veImONCwQy3A==", + // "Password": "y4uPqlH9ncTgR/I07qpwaA==" + //}, + "BackgroundServiceCron": { + "CalcPowerStationJob": "0 05 * * * ?", + "CalcPowerStationJobV2": "0 05 * * * ?", + "CalcAvgPowerStationJob": "0 12 0 * * ?", + "OperationScheduleJob": "0 0 8 * * ?", + "CalcInverter15minJob": "0 2/15 * * * ?", + "SendEmailJob": "0 0/5 * * * ?", + "ExceptionSchedule": "0 0/5 * * * ?" + }, + "SMTPConfig": { + "Host": "smtp.gmail.com", + "Port": 25, + "UserName": "shanghohui@gmail.com", + "Password": "wswgnluvoodfexrb", + "EnableSsl": true + }, + "ExceptionTimes": 240, //`qɶA() + "ExceptionTimes_Priority1": 1440, + "ExceptionTimes_Priority2": 720, + "ExceptionTimes_Priority3": 0 + + //"SMTPConfig": { + // "Host": "smtp.gmail.com", + // "Port": 25, + // "UserName": "ficgreen01@gmail.com", + // "Password": "qwe2015qwe", + // "EnableSsl": true + //} +} diff --git a/SolarPower/appsettings.json b/SolarPower/appsettings.json index 28bb471..94acfda 100644 --- a/SolarPower/appsettings.json +++ b/SolarPower/appsettings.json @@ -47,11 +47,11 @@ "Host": "smtp.gmail.com", "Port": 25, "UserName": "ficgreen01@gmail.com", - "Password": "opuisjyxgyjbjtha", //2022-09-02 update by jiahao + "Password": "opuisjyxgyjbjtha", //2022-09-02 update by jiahao "EnableSsl": true }, "ExceptionTimes": 240, //`qɶA() - "ExceptionTimes_Priority1": 1440, + "ExceptionTimes_Priority1": 0, "ExceptionTimes_Priority2": 720, - "ExceptionTimes_Priority3": 0 + "ExceptionTimes_Priority3": 1440 } diff --git a/solarApp/Service/procSyncError.cs b/solarApp/Service/procSyncError.cs index d22819a..be5abc7 100644 --- a/solarApp/Service/procSyncError.cs +++ b/solarApp/Service/procSyncError.cs @@ -36,34 +36,42 @@ namespace solarApp.Service conn.Open(); #region 更新 Normal time dt_start = DateTime.Now; - string sql = $@" update`err_main` a join alarmorion_orionalarmrecord b on a.id = b.id set - a.`sourcestate` = b.`sourcestate`, - a.`ackstate` = b.`ackstate`, - a.`priority` = b.`priority`, - a.`normaltime` = b.`normaltime`, - a.`acktime` = b.`acktime`, - a.`lastupdate` = b.`lastupdate` - where a.sourcestate = 1 and b.datestamp >= '{ System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'";// and a.site_id is not null "; // ;"; - int rowCount = conn.Execute(sql, commandTimeout: 600); + //string sql = $@" update`err_main` a join alarmorion_orionalarmrecord b on a.id = b.id set + // a.`sourcestate` = b.`sourcestate`, + // a.`ackstate` = b.`ackstate`, + // a.`priority` = b.`priority`, + // a.`normaltime` = b.`normaltime`, + // a.`acktime` = b.`acktime`, + // a.`lastupdate` = b.`lastupdate` + // where b.datestamp >= '{ System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'";// and a.site_id is not null "; // ;"; + string ss = $@" update`err_main` a join alarmorion_orionalarmrecord b on a.id = b.id set + a.`sourcestate` = b.`sourcestate`, + a.`ackstate` = b.`ackstate`, + a.`priority` = b.`priority`, + a.`normaltime` = b.`normaltime`, + a.`acktime` = b.`acktime`, + a.`lastupdate` = b.`lastupdate` + where FROM_UNIXTIME(b.normaltime/1000, '%Y-%m-%d') >= '{ System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'"; + int rowCount = conn.Execute(ss, commandTimeout: 600); TimeSpan durationSec = DateTime.Now - dt_start; arclog.insert_log("0", "syncError s0 normaltime", durationSec.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCount.ToString(), conn, null); #endregion #region 取得尚未同步的異常資料 - sql = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id + ss = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id from alarmorion_orionalarmrecord "; - var ds_max = conn.Query(sql, commandTimeout: 600).AsList(); + var ds_max = conn.Query(ss, commandTimeout: 600).AsList(); if (ds_max.Count == 0 ) return false; // 查無資料 if (ds_max[0].new_id == ds_max[0].old_id) return true; // 無新資料 - sql = $@" select * from alarmorion_orionalarmrecord + ss = $@" select * from alarmorion_orionalarmrecord where id > {ds_max[0].old_id}"; // and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'"; //sql = $@"select * from err_main // where site_id is null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'"; - var ds = conn.Query(sql, commandTimeout: 600).AsList(); + var ds = conn.Query(ss, commandTimeout: 600).AsList(); StringBuilder sb = new StringBuilder(); bool isfirst = true; foreach (var item in ds) @@ -81,7 +89,7 @@ namespace solarApp.Service if (ds.Count > 0) { #region 新增異常值 err_main - sql = ""; + string sql = ""; string sql_header = "INSERT INTO `err_main`(`id`, `timestamp`, `datestamp`, `uuidHash`, `uuid`, `isOpen`, `sourceState`, `ackState`, `ackRequired`, `alarmClass`, `priority`, `normalTime`, `ackTime`, `userAccount`, `alarmTransition`, `lastUpdate`) "; foreach (var item in ds) { // //{item.uuidHash}, '{Convert.ToBase64String(item.uuid)}' @@ -94,7 +102,7 @@ namespace solarApp.Service arclog.insert_log("0", "syncError s1", duration.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCT.ToString(), conn, null); #endregion - #region update site_id, inverterID + #region update site_id, inverterID 異常值 不用改 dt_start = DateTime.Now; sql = $@"update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm set err_valuekind = left(`value`, 1), @@ -108,7 +116,7 @@ namespace solarApp.Service #endregion - #region update site_id, device_id + #region update site_id, device_id ; 電站編號、設備編號 不用改 dt_start = DateTime.Now; sql = $@"update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm set err_valuekind = left(`value`, 1), @@ -125,16 +133,25 @@ namespace solarApp.Service #endregion - #region update 設備廠牌 - dt_start = DateTime.Now; - sql = $@"update err_main a join v_company_inv b on a.errDevice = b.INVERTERID set - errDeviceBrand = b.brand, - errDeviceModel = b.Model - where errDevice is not null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}';"; - rowCT = conn.Execute(sql, commandTimeout: 600); - duration = DateTime.Now - dt_start; - arclog.insert_log("0", "syncError s4 site_id", duration.TotalSeconds, "v_company_inv", "err_main", "0", "", rowCT.ToString(), conn, null); - #endregion + // #region update 設備廠牌 + // dt_start = DateTime.Now; + // sql = $@"update err_main a join v_company_inv b on a.errDevice = b.INVERTERID set + //errDeviceBrand = b.brand, + //errDeviceModel = b.Model + // where errDevice is not null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}';"; + // rowCT = conn.Execute(sql, commandTimeout: 600); + // duration = DateTime.Now - dt_start; + // arclog.insert_log("0", "syncError s4 site_id", duration.TotalSeconds, "v_company_inv", "err_main", "0", "", rowCT.ToString(), conn, null); + // #endregion + + #region update 異常訊息 + sql = $@" update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm + set errMsg = unicode_decode(`value`) + where facetName = 6 and alarm in ({sb.ToString()});"; + rowCT = conn.Execute(sql, commandTimeout: 600); + duration = DateTime.Now - dt_start; + arclog.insert_log("0", "syncError s4 errMsg", duration.TotalSeconds, "facetvalue", "err_main", "0", "", rowCT.ToString(), conn, null); + #endregion #region 更新全部的燈號 dt_start = DateTime.Now; diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs index ce9a685..31a037b 100644 --- a/solarApp/fmArchive.Designer.cs +++ b/solarApp/fmArchive.Designer.cs @@ -30,8 +30,8 @@ namespace solarApp private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); @@ -59,6 +59,7 @@ namespace solarApp this.gv_inv_detail = new System.Windows.Forms.DataGridView(); this.gv_rpt_invDay = new System.Windows.Forms.DataGridView(); this.panel1 = new System.Windows.Forms.Panel(); + this.lbMsgStatus = new System.Windows.Forms.Label(); this.lbMsgTitle = new System.Windows.Forms.Label(); this.bt_invDay = new System.Windows.Forms.Button(); this.btVerifyData = new System.Windows.Forms.Button(); @@ -89,7 +90,6 @@ namespace solarApp this.tabPage4 = new System.Windows.Forms.TabPage(); this.btSyncErr = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); - this.lbMsgStatus = new System.Windows.Forms.Label(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -395,8 +395,8 @@ namespace solarApp // this.gv_inv_detail.AllowUserToAddRows = false; this.gv_inv_detail.AllowUserToDeleteRows = false; - dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill; this.gv_inv_detail.Location = new System.Drawing.Point(768, 75); @@ -412,8 +412,8 @@ namespace solarApp // this.gv_rpt_invDay.AllowUserToAddRows = false; this.gv_rpt_invDay.AllowUserToDeleteRows = false; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left; this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75); @@ -442,6 +442,15 @@ namespace solarApp this.panel1.Size = new System.Drawing.Size(1358, 75); this.panel1.TabIndex = 0; // + // lbMsgStatus + // + this.lbMsgStatus.AutoSize = true; + this.lbMsgStatus.Location = new System.Drawing.Point(520, 49); + this.lbMsgStatus.Name = "lbMsgStatus"; + this.lbMsgStatus.Size = new System.Drawing.Size(18, 19); + this.lbMsgStatus.TabIndex = 16; + this.lbMsgStatus.Text = "..."; + // // lbMsgTitle // this.lbMsgTitle.AutoSize = true; @@ -757,15 +766,6 @@ namespace solarApp // this.timer1.Interval = 10000; // - // lbMsgStatus - // - this.lbMsgStatus.AutoSize = true; - this.lbMsgStatus.Location = new System.Drawing.Point(520, 49); - this.lbMsgStatus.Name = "lbMsgStatus"; - this.lbMsgStatus.Size = new System.Drawing.Size(18, 19); - this.lbMsgStatus.TabIndex = 16; - this.lbMsgStatus.Text = "..."; - // // fmArchive // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); @@ -773,7 +773,7 @@ namespace solarApp this.ClientSize = new System.Drawing.Size(1782, 953); this.Controls.Add(this.tabControl1); this.Name = "fmArchive"; - this.Text = "fmArchive 0822"; + this.Text = "fmArchive 0907"; this.Load += new System.EventHandler(this.fmArchive_Load); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs index 36f1fda..e707c83 100644 --- a/solarApp/fmArchive.cs +++ b/solarApp/fmArchive.cs @@ -109,9 +109,15 @@ namespace solarApp lbMsgStatus.Text = (autoTask) ? "autoTask = true" : "autoTask = false"; lbMsgStatus.Text += " timespan = " + (DateTime.Now - doTimerTaskTime).TotalMinutes.ToString(); + if (DateTime.Now.Hour >= 2 && DateTime.Now.Minute == 0) + { + doTimerTaskTime = DateTime.Now; + autoTask = false; + } + // 凌晨 2點後,如果間隔30分鐘 沒有跑異常同步 就啟動啟動 - doTaskDuratin = DateTime.Now - doTimerTaskTime; // 1200 sec = 20 分鐘 - if (System.DateTime.Now.Hour >= 2 && doTaskDuratin.TotalSeconds > 1200 && (autoTask == true)) + doTaskDuratin = DateTime.Now - doTimerTaskTime; // + if (DateTime.Now.Hour >= 2 && doTaskDuratin.TotalMinutes > 15 && (autoTask == true)) { doTimerTaskTime = DateTime.Now; autoTask = false; diff --git a/solarApp/fmMain.Designer.cs b/solarApp/fmMain.Designer.cs index 0aeb24e..c682979 100644 --- a/solarApp/fmMain.Designer.cs +++ b/solarApp/fmMain.Designer.cs @@ -83,6 +83,10 @@ namespace solarApp System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tb_inv = new System.Windows.Forms.TabPage(); this.sp_main_inv = new System.Windows.Forms.SplitContainer(); @@ -174,6 +178,7 @@ namespace solarApp this.label13 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.btLoadData = new System.Windows.Forms.Button(); + this.splitContainer4 = new System.Windows.Forms.SplitContainer(); this.gv_all_data = new System.Windows.Forms.DataGridView(); this.gv_notice_data = new System.Windows.Forms.DataGridView(); this.tabControl1.SuspendLayout(); @@ -237,6 +242,10 @@ namespace solarApp this.splitContainer3.Panel1.SuspendLayout(); this.splitContainer3.Panel2.SuspendLayout(); this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); + this.splitContainer4.Panel1.SuspendLayout(); + this.splitContainer4.Panel2.SuspendLayout(); + this.splitContainer4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gv_all_data)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gv_notice_data)).BeginInit(); this.SuspendLayout(); @@ -611,7 +620,6 @@ namespace solarApp this.panel1.Controls.Add(this.lb_inv_hour); 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(4); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(660, 38); this.panel1.TabIndex = 0; @@ -695,7 +703,6 @@ namespace solarApp this.panel2.Controls.Add(this.lb_raw_inv_hour); this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Margin = new System.Windows.Forms.Padding(4); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(690, 38); this.panel2.TabIndex = 1; @@ -1661,6 +1668,7 @@ namespace solarApp // // splitContainer3 // + this.splitContainer3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.splitContainer3.Cursor = System.Windows.Forms.Cursors.HSplit; this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer3.Location = new System.Drawing.Point(3, 3); @@ -1676,8 +1684,7 @@ namespace solarApp // // splitContainer3.Panel2 // - this.splitContainer3.Panel2.Controls.Add(this.gv_all_data); - this.splitContainer3.Panel2.Controls.Add(this.gv_notice_data); + this.splitContainer3.Panel2.Controls.Add(this.splitContainer4); this.splitContainer3.Size = new System.Drawing.Size(1729, 1017); this.splitContainer3.SplitterDistance = 91; this.splitContainer3.TabIndex = 0; @@ -1722,41 +1729,91 @@ namespace solarApp this.btLoadData.UseVisualStyleBackColor = true; this.btLoadData.Click += new System.EventHandler(this.button1_Click_1); // + // splitContainer4 + // + this.splitContainer4.Cursor = System.Windows.Forms.Cursors.VSplit; + this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer4.Location = new System.Drawing.Point(0, 0); + this.splitContainer4.Name = "splitContainer4"; + // + // splitContainer4.Panel1 + // + this.splitContainer4.Panel1.Controls.Add(this.gv_all_data); + // + // splitContainer4.Panel2 + // + this.splitContainer4.Panel2.Controls.Add(this.gv_notice_data); + this.splitContainer4.Size = new System.Drawing.Size(1727, 920); + this.splitContainer4.SplitterDistance = 733; + this.splitContainer4.SplitterWidth = 15; + this.splitContainer4.TabIndex = 1; + // // gv_all_data // this.gv_all_data.AllowUserToAddRows = false; this.gv_all_data.AllowUserToDeleteRows = false; dataGridViewCellStyle53.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); this.gv_all_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle53; + dataGridViewCellStyle54.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle54.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle54.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle54.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle54.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle54.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle54.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gv_all_data.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle54; this.gv_all_data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_all_data.Cursor = System.Windows.Forms.Cursors.Arrow; + dataGridViewCellStyle55.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle55.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle55.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle55.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle55.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle55.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle55.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.gv_all_data.DefaultCellStyle = dataGridViewCellStyle55; this.gv_all_data.Dock = System.Windows.Forms.DockStyle.Fill; this.gv_all_data.Location = new System.Drawing.Point(0, 0); this.gv_all_data.Name = "gv_all_data"; this.gv_all_data.ReadOnly = true; this.gv_all_data.RowHeadersWidth = 51; this.gv_all_data.RowTemplate.Height = 29; - this.gv_all_data.Size = new System.Drawing.Size(863, 922); - this.gv_all_data.TabIndex = 1; + this.gv_all_data.Size = new System.Drawing.Size(733, 920); + this.gv_all_data.TabIndex = 2; // // gv_notice_data // this.gv_notice_data.AllowUserToAddRows = false; this.gv_notice_data.AllowUserToDeleteRows = false; this.gv_notice_data.AllowUserToOrderColumns = true; - dataGridViewCellStyle54.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.gv_notice_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle54; + dataGridViewCellStyle56.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.gv_notice_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle56; + dataGridViewCellStyle57.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle57.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle57.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle57.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle57.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle57.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle57.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gv_notice_data.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle57; this.gv_notice_data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_notice_data.Cursor = System.Windows.Forms.Cursors.Arrow; - this.gv_notice_data.Dock = System.Windows.Forms.DockStyle.Right; - this.gv_notice_data.Location = new System.Drawing.Point(863, 0); + dataGridViewCellStyle58.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle58.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle58.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle58.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle58.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle58.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle58.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.gv_notice_data.DefaultCellStyle = dataGridViewCellStyle58; + this.gv_notice_data.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_notice_data.Location = new System.Drawing.Point(0, 0); this.gv_notice_data.Name = "gv_notice_data"; this.gv_notice_data.ReadOnly = true; this.gv_notice_data.RowHeadersWidth = 51; this.gv_notice_data.RowTemplate.Height = 29; - this.gv_notice_data.Size = new System.Drawing.Size(866, 922); - this.gv_notice_data.TabIndex = 0; - this.gv_notice_data.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.gv_notice_test_data_CellFormatting); + this.gv_notice_data.Size = new System.Drawing.Size(979, 920); + this.gv_notice_data.TabIndex = 1; // // fmMain // @@ -1848,6 +1905,10 @@ namespace solarApp this.splitContainer3.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); this.splitContainer3.ResumeLayout(false); + this.splitContainer4.Panel1.ResumeLayout(false); + this.splitContainer4.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); + this.splitContainer4.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gv_all_data)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gv_notice_data)).EndInit(); this.ResumeLayout(false); @@ -1952,10 +2013,11 @@ namespace solarApp private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.SplitContainer splitContainer3; private System.Windows.Forms.Button btLoadData; - private System.Windows.Forms.DataGridView gv_all_data; - private System.Windows.Forms.DataGridView gv_notice_data; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label12; private System.Windows.Forms.Button button1; + private System.Windows.Forms.SplitContainer splitContainer4; + private System.Windows.Forms.DataGridView gv_all_data; + private System.Windows.Forms.DataGridView gv_notice_data; } } \ No newline at end of file diff --git a/solarApp/solarApp.csproj b/solarApp/solarApp.csproj index c6ef40a..8bc98e4 100644 --- a/solarApp/solarApp.csproj +++ b/solarApp/solarApp.csproj @@ -7,7 +7,6 @@ -