Commit 5ecfb4c7 LN

dll更新

1 个父辈 9f50a417
......@@ -130,6 +130,8 @@
<!--禁用 继续未完成工作功能-->
<add key ="DisContinueWorking" value ="1"/>
<add key ="DisShowScreenAlarm" value ="1"/>
<!--显示实时视频浮窗-->
<add key ="VideoForm_Show" value ="1"/>
</appSettings>
<log4net>
<appender name="defaultAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -389,19 +389,19 @@ namespace TSA_V
private void ShowCameraPlay()
{
if (WorkModeUtil.SelectOk())
{
if (!FrmCameraPlay.instance.ISShow)
{
Thread t2 = new Thread(x =>
{
FrmCameraPlay.instance.ISShow = true;
FrmCameraPlay.instance.ShowForm();
});
t2.SetApartmentState(ApartmentState.STA);
t2.Start();
}
}
//if (WorkModeUtil.SelectOk())
//{
// if (!FrmCameraPlay.instance.ISShow)
// {
// Thread t2 = new Thread(x =>
// {
// FrmCameraPlay.instance.ISShow = true;
// FrmCameraPlay.instance.ShowForm();
// });
// t2.SetApartmentState(ApartmentState.STA);
// t2.Start();
// }
//}
}
private void openForms()
{
......
......@@ -115,13 +115,13 @@ namespace TSA_V
DialogResult dr = frm.ShowDialog();
if (dr == DialogResult.OK)
{
Thread t2 = new Thread(x =>
{
FrmCameraPlay.instance.ISShow = true;
FrmCameraPlay.instance.ShowForm();
});
t2.SetApartmentState(ApartmentState.STA);
t2.Start();
//Thread t2 = new Thread(x =>
//{
// FrmCameraPlay.instance.ISShow = true;
// FrmCameraPlay.instance.ShowForm();
//});
//t2.SetApartmentState(ApartmentState.STA);
//t2.Start();
//Application.Run(new FrmMenu());
Thread t1 = new Thread(x =>
......
......@@ -55,7 +55,7 @@
<ItemGroup>
<Reference Include="AccAOI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AccAOI\AccAOI\bin\Debug\AccAOI.dll</HintPath>
<HintPath>..\..\EyemAOI_v2\AOIProject\bin\Debug\AccAOI.dll</HintPath>
</Reference>
<Reference Include="AccImageBox, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -63,7 +63,7 @@
</Reference>
<Reference Include="AOI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\AccAOI\AOI\bin\Debug\AOI.dll</HintPath>
<HintPath>..\..\EyemAOI_v2\AOIProject\bin\Debug\AOI.dll</HintPath>
</Reference>
<Reference Include="Asa.Theme">
<HintPath>..\dll\Asa.Theme.dll</HintPath>
......@@ -115,12 +115,6 @@
</ItemGroup>
<ItemGroup>
<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">
<SubType>Form</SubType>
</Compile>
......@@ -323,9 +317,6 @@
<Compile Include="FrmDeviceConfig.Designer.cs">
<DependentUpon>FrmDeviceConfig.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="cameraPlay\FrmCameraPlay.resx">
<DependentUpon>FrmCameraPlay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="deviceDebug\FrmUpdatePwd.resx">
<DependentUpon>FrmUpdatePwd.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -64,6 +64,7 @@
this.Text = "Live video";
this.TopMost = true;
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.Shown += new System.EventHandler(this.FrmCameraPlay_Shown);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
......
......@@ -17,13 +17,13 @@ namespace TSA_V
{
public partial class FrmCameraPlay : Form
{
public bool ISShow = false ;
public int ScreenIndex = ConfigAppSettings.GetIntValue(Setting_Init.VideoFrom_Index,2);
public bool NeedShow = ConfigAppSettings.GetBoolValue(Setting_Init.VideoForm_Show );
public bool ISShow = false;
public int ScreenIndex = ConfigAppSettings.GetIntValue(Setting_Init.VideoFrom_Index, 2);
public bool NeedShow = ConfigAppSettings.GetBoolValue(Setting_Init.VideoForm_Show);
public static FrmCameraPlay instance = new FrmCameraPlay();
public FrmCameraPlay()
{
NeedShow = false ;
//NeedShow = false;
InitializeComponent();
}
......@@ -60,7 +60,7 @@ namespace TSA_V
screen = sc[0];
this.StartPosition = FormStartPosition.Manual;
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();
LogUtil.info("实时视频界面显示:屏幕索引=" + ScreenIndex + " !");
return true;
......@@ -77,40 +77,77 @@ namespace TSA_V
{
timer1.Start();
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 timer1_Tick(object sender, EventArgs e)
{
if(this.Visible )
private void CameraManager_camera_event(object sender, Bitmap e)
{
try
{
string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName);
if (camera == "")
if (e != null)
{
camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault();
}
Image currImage = CameraManager.GetCamerImage(camera);
if (currImage == null)
if (pictureBox1.Image != null)
{
string file = @"G:\test.bmp";
if (File.Exists(file))
pictureBox1.Image.Dispose();
}
pictureBox1.Image = e;
}
}
catch (Exception ex)
{
//从本地加载图片
Bitmap aa = new Bitmap(file);
currImage = ImageManager.DeepClone(aa);
LogUtil.error("CameraManager_camera_event 出错:" + ex.ToString());
}
}
if (currImage != null)
private string CameraName()
{
if (pictureBox1.Image != null)
string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName);
if (camera == "")
{
pictureBox1.Image.Dispose();
camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault();
}
pictureBox1.Image = currImage;
return camera;
}
private void timer1_Tick(object sender, EventArgs e)
{
if(this.Visible )
{
try
{
//string camera = ConfigAppSettings.GetValue(Setting_Init.CameraName);
//if (camera == "")
//{
// camera = AccAOI.camera.CameraManager.hikNameList.ToArray().FirstOrDefault();
//}
//Image currImage = CameraManager.GetCamerImage(camera);
//if (currImage == null)
//{
// string file = @"G:\test.bmp";
// if (File.Exists(file))
// {
// //从本地加载图片
// Bitmap aa = new Bitmap(file);
// currImage = ImageManager.DeepClone(aa);
// }
//}
//if (currImage != null)
//{
// if (pictureBox1.Image != null)
// {
// pictureBox1.Image.Dispose();
// }
// pictureBox1.Image = currImage;
//}
}
catch (Exception ex)
{
......@@ -124,24 +161,10 @@ namespace TSA_V
e.Cancel = true;
}
public const int HWND_TOP = 0;
public const int HWND_BOTTOM = 1;
public const int HWND_TOPMOST = -1;
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
private void FrmCameraPlay_FormClosed(object sender, FormClosedEventArgs e)
{
public int Left;
public int Top;
public int Right;
public int Bottom;
CameraManager.StopGetImage();
}
}
}
......@@ -46,21 +46,21 @@ namespace TSA_V
this.panel3 = new System.Windows.Forms.Panel();
this.btnUpdateImg = new System.Windows.Forms.Button();
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.label2 = new System.Windows.Forms.Label();
this.picCurr = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
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.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.panelImg.SuspendLayout();
this.panel3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picCurr)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picStand)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// timer1
......@@ -190,6 +190,8 @@ namespace TSA_V
this.picResult.BackColor = System.Drawing.Color.Black;
this.picResult.Dock = System.Windows.Forms.DockStyle.Fill;
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.Location = new System.Drawing.Point(0, 0);
this.picResult.Name = "picResult";
......@@ -243,6 +245,20 @@ namespace TSA_V
this.listErrorView.View = System.Windows.Forms.View.List;
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
//
this.chbAllShow.AutoSize = true;
......@@ -268,7 +284,7 @@ namespace TSA_V
// picCurr
//
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.Name = "picCurr";
this.picCurr.Size = new System.Drawing.Size(327, 263);
......@@ -289,7 +305,7 @@ namespace TSA_V
// picStand
//
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.Name = "picStand";
this.picStand.Size = new System.Drawing.Size(327, 261);
......@@ -297,20 +313,6 @@ namespace TSA_V
this.picStand.TabIndex = 297;
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
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -329,9 +331,9 @@ namespace TSA_V
this.panelImg.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picCurr)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picStand)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
......
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!