Commit 5ecfb4c7 LN

dll更新

1 个父辈 9f50a417
...@@ -130,6 +130,8 @@ ...@@ -130,6 +130,8 @@
<!--禁用 继续未完成工作功能--> <!--禁用 继续未完成工作功能-->
<add key ="DisContinueWorking" value ="1"/> <add key ="DisContinueWorking" value ="1"/>
<add key ="DisShowScreenAlarm" value ="1"/> <add key ="DisShowScreenAlarm" value ="1"/>
<!--显示实时视频浮窗-->
<add key ="VideoForm_Show" value ="1"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="defaultAppender" type="log4net.Appender.RollingFileAppender"> <appender name="defaultAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -389,19 +389,19 @@ namespace TSA_V ...@@ -389,19 +389,19 @@ namespace TSA_V
private void ShowCameraPlay() private void ShowCameraPlay()
{ {
if (WorkModeUtil.SelectOk()) //if (WorkModeUtil.SelectOk())
{ //{
if (!FrmCameraPlay.instance.ISShow) // if (!FrmCameraPlay.instance.ISShow)
{ // {
Thread t2 = new Thread(x => // Thread t2 = new Thread(x =>
{ // {
FrmCameraPlay.instance.ISShow = true; // FrmCameraPlay.instance.ISShow = true;
FrmCameraPlay.instance.ShowForm(); // FrmCameraPlay.instance.ShowForm();
}); // });
t2.SetApartmentState(ApartmentState.STA); // t2.SetApartmentState(ApartmentState.STA);
t2.Start(); // t2.Start();
} // }
} //}
} }
private void openForms() private void openForms()
{ {
......
...@@ -115,13 +115,13 @@ namespace TSA_V ...@@ -115,13 +115,13 @@ namespace TSA_V
DialogResult dr = frm.ShowDialog(); DialogResult dr = frm.ShowDialog();
if (dr == DialogResult.OK) if (dr == DialogResult.OK)
{ {
Thread t2 = new Thread(x => //Thread t2 = new Thread(x =>
{ //{
FrmCameraPlay.instance.ISShow = true; // FrmCameraPlay.instance.ISShow = true;
FrmCameraPlay.instance.ShowForm(); // FrmCameraPlay.instance.ShowForm();
}); //});
t2.SetApartmentState(ApartmentState.STA); //t2.SetApartmentState(ApartmentState.STA);
t2.Start(); //t2.Start();
//Application.Run(new FrmMenu()); //Application.Run(new FrmMenu());
Thread t1 = new Thread(x => Thread t1 = new Thread(x =>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="AccAOI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="AccAOI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AccAOI\AccAOI\bin\Debug\AccAOI.dll</HintPath> <HintPath>..\..\EyemAOI_v2\AOIProject\bin\Debug\AccAOI.dll</HintPath>
</Reference> </Reference>
<Reference Include="AccImageBox, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="AccImageBox, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</Reference> </Reference>
<Reference Include="AOI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="AOI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AccAOI\AOI\bin\Debug\AOI.dll</HintPath> <HintPath>..\..\EyemAOI_v2\AOIProject\bin\Debug\AOI.dll</HintPath>
</Reference> </Reference>
<Reference Include="Asa.Theme"> <Reference Include="Asa.Theme">
<HintPath>..\dll\Asa.Theme.dll</HintPath> <HintPath>..\dll\Asa.Theme.dll</HintPath>
...@@ -115,12 +115,6 @@ ...@@ -115,12 +115,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AOIManager.cs" /> <Compile Include="AOIManager.cs" />
<Compile Include="cameraPlay\FrmCameraPlay.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="cameraPlay\FrmCameraPlay.Designer.cs">
<DependentUpon>FrmCameraPlay.cs</DependentUpon>
</Compile>
<Compile Include="DataCalculate.cs"> <Compile Include="DataCalculate.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -323,9 +317,6 @@ ...@@ -323,9 +317,6 @@
<Compile Include="FrmDeviceConfig.Designer.cs"> <Compile Include="FrmDeviceConfig.Designer.cs">
<DependentUpon>FrmDeviceConfig.cs</DependentUpon> <DependentUpon>FrmDeviceConfig.cs</DependentUpon>
</Compile> </Compile>
<EmbeddedResource Include="cameraPlay\FrmCameraPlay.resx">
<DependentUpon>FrmCameraPlay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="deviceDebug\FrmUpdatePwd.resx"> <EmbeddedResource Include="deviceDebug\FrmUpdatePwd.resx">
<DependentUpon>FrmUpdatePwd.cs</DependentUpon> <DependentUpon>FrmUpdatePwd.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
this.Text = "Live video"; this.Text = "Live video";
this.TopMost = true; this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmCameraPlay_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmCameraPlay_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmCameraPlay_FormClosed);
this.Load += new System.EventHandler(this.FrmCameraPlay_Load); this.Load += new System.EventHandler(this.FrmCameraPlay_Load);
this.Shown += new System.EventHandler(this.FrmCameraPlay_Shown); this.Shown += new System.EventHandler(this.FrmCameraPlay_Shown);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
......
...@@ -17,13 +17,13 @@ namespace TSA_V ...@@ -17,13 +17,13 @@ namespace TSA_V
{ {
public partial class FrmCameraPlay : Form public partial class FrmCameraPlay : Form
{ {
public bool ISShow = false ; public bool ISShow = false;
public int ScreenIndex = ConfigAppSettings.GetIntValue(Setting_Init.VideoFrom_Index,2); public int ScreenIndex = ConfigAppSettings.GetIntValue(Setting_Init.VideoFrom_Index, 2);
public bool NeedShow = ConfigAppSettings.GetBoolValue(Setting_Init.VideoForm_Show ); public bool NeedShow = ConfigAppSettings.GetBoolValue(Setting_Init.VideoForm_Show);
public static FrmCameraPlay instance = new FrmCameraPlay(); public static FrmCameraPlay instance = new FrmCameraPlay();
public FrmCameraPlay() public FrmCameraPlay()
{ {
NeedShow = false ; //NeedShow = false;
InitializeComponent(); InitializeComponent();
} }
...@@ -57,10 +57,10 @@ namespace TSA_V ...@@ -57,10 +57,10 @@ namespace TSA_V
} }
else if (sc.Count() > 0) else if (sc.Count() > 0)
{ {
screen = sc[0]; screen = sc[0];
this.StartPosition = FormStartPosition.Manual; this.StartPosition = FormStartPosition.Manual;
this.Size = new Size(400, 300); this.Size = new Size(400, 300);
this.Location = new Point(screen.Bounds.Left+ screen.Bounds.Width - this.Width, screen.Bounds.Top+ 5); this.Location = new Point(screen.Bounds.Left + screen.Bounds.Width - this.Width, screen.Bounds.Top + 5);
this.ShowDialog(); this.ShowDialog();
LogUtil.info("实时视频界面显示:屏幕索引=" + ScreenIndex + " !"); LogUtil.info("实时视频界面显示:屏幕索引=" + ScreenIndex + " !");
return true; return true;
...@@ -77,40 +77,77 @@ namespace TSA_V ...@@ -77,40 +77,77 @@ namespace TSA_V
{ {
timer1.Start(); timer1.Start();
this.TopMost = true; this.TopMost = true;
CameraManager.camera_event += CameraManager_camera_event;
CameraManager.LoadCamera();
CameraManager.StartGetImage(CameraName());
//CameraManager.LoadCamera();
//HIKCamera.Instance.camera_event += CameraManager_camera_event;
//CameraManager.StartCallBackGrabImage(CameraName());
} }
private void CameraManager_camera_event(object sender, Bitmap e)
{
try
{
if (e != null)
{
if (pictureBox1.Image != null)
{
pictureBox1.Image.Dispose();
}
pictureBox1.Image = e;
}
}
catch (Exception ex)
{
LogUtil.error("CameraManager_camera_event 出错:" + ex.ToString());
}
}
private string CameraName()
{
string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName);
if (camera == "")
{
camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault();
}
return camera;
}
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
if(this.Visible ) if(this.Visible )
{ {
try try
{ {
string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName); //string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName);
if (camera == "") //if (camera == "")
{ //{
camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault(); // camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault();
} //}
Image currImage = CameraManager.GetCamerImage(camera); //Image currImage = CameraManager.GetCamerImage(camera);
if (currImage == null) //if (currImage == null)
{ //{
string file = @"G:\test.bmp"; // string file = @"G:\test.bmp";
if (File.Exists(file)) // if (File.Exists(file))
{ // {
//从本地加载图片 // //从本地加载图片
Bitmap aa = new Bitmap(file); // Bitmap aa = new Bitmap(file);
currImage = ImageManager.DeepClone(aa); // currImage = ImageManager.DeepClone(aa);
} // }
} //}
if (currImage != null) //if (currImage != null)
{ //{
if (pictureBox1.Image != null) // if (pictureBox1.Image != null)
{ // {
pictureBox1.Image.Dispose(); // pictureBox1.Image.Dispose();
} // }
pictureBox1.Image = currImage; // pictureBox1.Image = currImage;
} //}
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -123,25 +160,11 @@ namespace TSA_V ...@@ -123,25 +160,11 @@ namespace TSA_V
{ {
e.Cancel = true; e.Cancel = true;
} }
public const int HWND_TOP = 0; private void FrmCameraPlay_FormClosed(object sender, FormClosedEventArgs e)
public const int HWND_BOTTOM = 1; {
public const int HWND_TOPMOST = -1; CameraManager.StopGetImage();
public const int HWND_NOTOPMOST = -2; }
}
[DllImport("user32.dll")]
public static extern IntPtr SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint wFlags);
[DllImport("user32.dll")]
public static extern bool GetWindowRect(IntPtr hWnd, out WindowRect lpRect);
}
public struct WindowRect
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
} }
...@@ -46,21 +46,21 @@ namespace TSA_V ...@@ -46,21 +46,21 @@ namespace TSA_V
this.panel3 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel();
this.btnUpdateImg = new System.Windows.Forms.Button(); this.btnUpdateImg = new System.Windows.Forms.Button();
this.listErrorView = new System.Windows.Forms.ListView(); this.listErrorView = new System.Windows.Forms.ListView();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.修正ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.chbAllShow = new System.Windows.Forms.CheckBox(); this.chbAllShow = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.picCurr = new System.Windows.Forms.PictureBox(); this.picCurr = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.picStand = new System.Windows.Forms.PictureBox(); this.picStand = new System.Windows.Forms.PictureBox();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.修正ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.panel4.SuspendLayout(); this.panel4.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.panelImg.SuspendLayout(); this.panelImg.SuspendLayout();
this.panel3.SuspendLayout(); this.panel3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picCurr)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picCurr)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picStand)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picStand)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// timer1 // timer1
...@@ -190,6 +190,8 @@ namespace TSA_V ...@@ -190,6 +190,8 @@ namespace TSA_V
this.picResult.BackColor = System.Drawing.Color.Black; this.picResult.BackColor = System.Drawing.Color.Black;
this.picResult.Dock = System.Windows.Forms.DockStyle.Fill; this.picResult.Dock = System.Windows.Forms.DockStyle.Fill;
this.picResult.DragHandleSize = 9; this.picResult.DragHandleSize = 9;
this.picResult.GridColor = System.Drawing.Color.Black;
this.picResult.GridColorAlternate = System.Drawing.Color.Black;
this.picResult.ImageBorderColor = System.Drawing.SystemColors.ActiveCaptionText; this.picResult.ImageBorderColor = System.Drawing.SystemColors.ActiveCaptionText;
this.picResult.Location = new System.Drawing.Point(0, 0); this.picResult.Location = new System.Drawing.Point(0, 0);
this.picResult.Name = "picResult"; this.picResult.Name = "picResult";
...@@ -243,6 +245,20 @@ namespace TSA_V ...@@ -243,6 +245,20 @@ namespace TSA_V
this.listErrorView.View = System.Windows.Forms.View.List; this.listErrorView.View = System.Windows.Forms.View.List;
this.listErrorView.SelectedIndexChanged += new System.EventHandler(this.listErrorView_SelectedIndexChanged); this.listErrorView.SelectedIndexChanged += new System.EventHandler(this.listErrorView_SelectedIndexChanged);
// //
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.修正ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(101, 26);
//
// 修正ToolStripMenuItem
//
this.修正ToolStripMenuItem.Name = "修正ToolStripMenuItem";
this.修正ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.修正ToolStripMenuItem.Text = "修正";
this.修正ToolStripMenuItem.Click += new System.EventHandler(this.修正ToolStripMenuItem_Click);
//
// chbAllShow // chbAllShow
// //
this.chbAllShow.AutoSize = true; this.chbAllShow.AutoSize = true;
...@@ -268,7 +284,7 @@ namespace TSA_V ...@@ -268,7 +284,7 @@ namespace TSA_V
// picCurr // picCurr
// //
this.picCurr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.picCurr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.picCurr.BackgroundImage = global::TSA_V.Properties.Resources.backImage; this.picCurr.BackColor = System.Drawing.Color.Black;
this.picCurr.Location = new System.Drawing.Point(5, 583); this.picCurr.Location = new System.Drawing.Point(5, 583);
this.picCurr.Name = "picCurr"; this.picCurr.Name = "picCurr";
this.picCurr.Size = new System.Drawing.Size(327, 263); this.picCurr.Size = new System.Drawing.Size(327, 263);
...@@ -289,7 +305,7 @@ namespace TSA_V ...@@ -289,7 +305,7 @@ namespace TSA_V
// picStand // picStand
// //
this.picStand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.picStand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.picStand.BackgroundImage = global::TSA_V.Properties.Resources.backImage; this.picStand.BackColor = System.Drawing.Color.Black;
this.picStand.Location = new System.Drawing.Point(5, 304); this.picStand.Location = new System.Drawing.Point(5, 304);
this.picStand.Name = "picStand"; this.picStand.Name = "picStand";
this.picStand.Size = new System.Drawing.Size(327, 261); this.picStand.Size = new System.Drawing.Size(327, 261);
...@@ -297,20 +313,6 @@ namespace TSA_V ...@@ -297,20 +313,6 @@ namespace TSA_V
this.picStand.TabIndex = 297; this.picStand.TabIndex = 297;
this.picStand.TabStop = false; this.picStand.TabStop = false;
// //
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.修正ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(101, 26);
//
// 修正ToolStripMenuItem
//
this.修正ToolStripMenuItem.Name = "修正ToolStripMenuItem";
this.修正ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.修正ToolStripMenuItem.Text = "修正";
this.修正ToolStripMenuItem.Click += new System.EventHandler(this.修正ToolStripMenuItem_Click);
//
// FrmAOICheck // FrmAOICheck
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -329,9 +331,9 @@ namespace TSA_V ...@@ -329,9 +331,9 @@ namespace TSA_V
this.panelImg.ResumeLayout(false); this.panelImg.ResumeLayout(false);
this.panel3.ResumeLayout(false); this.panel3.ResumeLayout(false);
this.panel3.PerformLayout(); this.panel3.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picCurr)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picCurr)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picStand)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picStand)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
......
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!