增加6点和19点对照相机的参数进行设置的功能

This commit is contained in:
春风过客 2023-09-12 08:53:40 +08:00
parent 85c12aa994
commit 602eda76ff
14 changed files with 119 additions and 12 deletions

View File

@ -13,8 +13,8 @@ namespace ZTTMS_Manage_yibayiyi_20230320
{ {
class MySQL class MySQL
{ {
//public static string connectionString = @"server=41.244.68.54;port=3306;user=root;password=zttZTT123!;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;AllowPublicKeyRetrieval=true;"; public static string connectionString = @"server=41.244.68.54;port=3306;user=root;password=zttZTT123!;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;AllowPublicKeyRetrieval=true;";
public static string connectionString = @"server=127.0.0.1;port=3306;user=root;password=ztt12345;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;"; //public static string connectionString = @"server=127.0.0.1;port=3306;user=root;password=ztt12345;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;";
#region #region

View File

@ -108,17 +108,17 @@ namespace ZTTMS_Manage_yibayiyi_20230320
public static string ftpCTDDataPath = @"/File/SensorData/CTDData"; public static string ftpCTDDataPath = @"/File/SensorData/CTDData";
public static string ftpRecordData = @"/File/RecordData"; public static string ftpRecordData = @"/File/RecordData";
//public static string totalPath = @"E:\Output\"; public static string totalPath = @"E:\Output\";
//public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe";
//public static string picPath = @"E:\Output\Image\Image_01\";
//public static string picPathShow = @"E:\Output\Image\Image_01";
//public static string vidPathShow = @"E:\Output\Video\Video_01";
public static string picPathShow = @"F:\Code\text\daojiao\Image\Image_01";
public static string vidPathShow = @"F:\Code\text\daojiao\Video\Video_01";
public static string picPath = @"F:\Code\text\daojiao\Image\Image_01\";
public static string totalPath = @"F:\Code\text\daojiao\";
public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe"; public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe";
public static string picPath = @"E:\Output\Image\Image_01\";
public static string picPathShow = @"E:\Output\Image\Image_01";
public static string vidPathShow = @"E:\Output\Video\Video_01";
//public static string picPathShow = @"F:\Code\text\daojiao\Image\Image_01";
//public static string vidPathShow = @"F:\Code\text\daojiao\Video\Video_01";
//public static string picPath = @"F:\Code\text\daojiao\Image\Image_01\";
//public static string totalPath = @"F:\Code\text\daojiao\";
//public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe";
//标记设备是否使能 //标记设备是否使能

View File

@ -66,6 +66,8 @@
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.timerSendHeart = new System.Windows.Forms.Timer(this.components); this.timerSendHeart = new System.Windows.Forms.Timer(this.components);
this.timerChangeConnectState = new System.Windows.Forms.Timer(this.components); this.timerChangeConnectState = new System.Windows.Forms.Timer(this.components);
this.timerLight = new System.Windows.Forms.Timer(this.components);
this.timerNight = new System.Windows.Forms.Timer(this.components);
this.pnlPicture.SuspendLayout(); this.pnlPicture.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picOpenCamera)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picOpenCamera)).BeginInit();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
@ -478,6 +480,14 @@
// //
this.timerChangeConnectState.Tick += new System.EventHandler(this.timerChangeConnectState_Tick); this.timerChangeConnectState.Tick += new System.EventHandler(this.timerChangeConnectState_Tick);
// //
// timerLight
//
this.timerLight.Tick += new System.EventHandler(this.timerLight_Tick);
//
// timerNight
//
this.timerNight.Tick += new System.EventHandler(this.timerNight_Tick);
//
// PictureTakeForm // PictureTakeForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(16F, 31F); this.AutoScaleDimensions = new System.Drawing.SizeF(16F, 31F);
@ -559,5 +569,7 @@
public System.Windows.Forms.TextBox txtLight; public System.Windows.Forms.TextBox txtLight;
public System.Windows.Forms.Label label5; public System.Windows.Forms.Label label5;
private System.Windows.Forms.Timer timerChangeConnectState; private System.Windows.Forms.Timer timerChangeConnectState;
private System.Windows.Forms.Timer timerLight;
private System.Windows.Forms.Timer timerNight;
} }
} }

View File

@ -192,6 +192,14 @@ namespace ZTTMS_Manage_yibayiyi_20230320
g_timerSetLight.Interval = 20000; g_timerSetLight.Interval = 20000;
g_timerSetLight.AutoReset = false; g_timerSetLight.AutoReset = false;
g_timerSetLight.Elapsed += new System.Timers.ElapsedEventHandler(methodSetLight); g_timerSetLight.Elapsed += new System.Timers.ElapsedEventHandler(methodSetLight);
timerLight.Enabled = true;
timerLight.Interval = 50000;
timerLight.Start();
timerNight.Enabled = true;
timerNight.Interval = 50000;
timerNight.Start();
} }
@ -2767,6 +2775,84 @@ namespace ZTTMS_Manage_yibayiyi_20230320
timerChangeConnectState.Stop(); timerChangeConnectState.Stop();
} }
} }
private void timerLight_Tick(object sender, EventArgs e)
{
Thread thSetParamLight = new Thread(SetParamLight);
thSetParamLight.IsBackground = true;
thSetParamLight.Start();
}
private void SetParamLight()
{
try
{
DateTime NowDate = DateTime.Now;
if (NowDate.Hour == 6 && NowDate.Minute == 0)
{
EveryDayLog.WriteADCP("照相机将在2min后设置白天参数");
Console.WriteLine("照相机将在2min后设置白天参数");
timerLight.Enabled = false;
timerLight.Stop();
Thread.Sleep(2 * 1000);
timerLight.Enabled = true;
timerLight.Start();
}
else
return;
txtExposure.Text = "";
txtFrameRate.Text = "";
txtGain.Text = "";
SetParam();
}
catch(Exception ex)
{
EveryDayLog.WriteErrorCamAndVid("SetParamLightError:" + ex.Message);
Console.WriteLine("SetParamLightError:" + ex.Message);
}
}
private void timerNight_Tick(object sender, EventArgs e)
{
Thread thSetParamNight = new Thread(SetParamNight);
thSetParamNight.IsBackground = true;
thSetParamNight.Start();
}
private void SetParamNight()
{
try
{
DateTime NowDate = DateTime.Now;
if (NowDate.Hour == 19 && NowDate.Minute == 0)
{
EveryDayLog.WriteADCP("照相机将在2min后设置晚上参数");
Console.WriteLine("照相机将在2min后设置晚上参数");
timerNight.Enabled = false;
timerNight.Stop();
Thread.Sleep(2 * 1000);
timerNight.Enabled = true;
timerNight.Start();
}
else
return;
txtExposure.Text = "";
txtFrameRate.Text = "";
txtGain.Text = "";
SetParam();
}
catch (Exception ex)
{
EveryDayLog.WriteErrorCamAndVid("SetParamNightError:" + ex.Message);
Console.WriteLine("SetParamNightError:" + ex.Message);
}
}
} }
} }

View File

@ -123,10 +123,19 @@
<metadata name="timerCycleGet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerCycleGet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>152, 17</value>
</metadata>
<metadata name="timerSendHeart.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerSendHeart.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>253, 17</value> <value>253, 17</value>
</metadata> </metadata>
<metadata name="timerChangeConnectState.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timerChangeConnectState.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>398, 17</value> <value>398, 17</value>
</metadata> </metadata>
<metadata name="timerLight.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>605, 17</value>
</metadata>
<metadata name="timerNight.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>717, 17</value>
</metadata>
</root> </root>