Commit db9f527e 张东亮

运行时更改为4.6.2

1 个父辈 11641ad4
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>MyCommon</AssemblyName> <AssemblyName>MyCommon</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace> <RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName> <AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
...@@ -66,9 +66,6 @@ ...@@ -66,9 +66,6 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Vision.Video">
<HintPath>..\DLL\Vision.Video.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="DeviceLibrary\AcSerialBean.cs" /> <Compile Include="DeviceLibrary\AcSerialBean.cs" />
......
...@@ -21,54 +21,54 @@ public class HIKCamera ...@@ -21,54 +21,54 @@ public class HIKCamera
public string DeviceName = "monitor1"; public string DeviceName = "monitor1";
public PictureBox picture = new PictureBox(); public PictureBox picture = new PictureBox();
bool enableCamera = ConfigHelper.Config.Get("Func_EnableCam", true); bool enableCamera = ConfigHelper.Config.Get("Func_EnableCam", true);
public bool LoadCameraConfig(out string msg, object preview = null) //public bool LoadCameraConfig(out string msg, object preview = null)
{ //{
msg = ""; // msg = "";
if (!enableCamera) return true; // if (!enableCamera) return true;
string path = $".\\Config\\IPCamera.json"; // string path = $".\\Config\\IPCamera.json";
if (!File.Exists(path)) // if (!File.Exists(path))
{ // {
msg = crc.GetString(L.monitor_config_not_exist, "找不到监控相机配置文件"); // msg = crc.GetString(L.monitor_config_not_exist, "找不到监控相机配置文件");
LogUtil.error("找不到监控相机配置文件" + path); // LogUtil.error("找不到监控相机配置文件" + path);
return false; // return false;
} // }
try // try
{ // {
if (!VideoManager.LoadCamera(path, out string loadmsg)) // if (!VideoManager.LoadCamera(path, out string loadmsg))
{ // {
msg = loadmsg; // msg = loadmsg;
} // }
} // }
catch (Exception e) // catch (Exception e)
{ // {
msg = crc.GetString(L.monitor_config_load_fail, "加载监控相机配置文件失败:") + e.ToString(); // msg = crc.GetString(L.monitor_config_load_fail, "加载监控相机配置文件失败:") + e.ToString();
LogUtil.error("加载监控相机配置文件失败:" + e.ToString()); // LogUtil.error("加载监控相机配置文件失败:" + e.ToString());
return false; // return false;
} // }
if (VideoManager.CamNames != null && VideoManager.CamNames.Count > 0) // if (VideoManager.CamNames != null && VideoManager.CamNames.Count > 0)
{ // {
Name = VideoManager.CamNames[0]; // Name = VideoManager.CamNames[0];
if (preview == null) // if (preview == null)
{ // {
VideoManager.Open(new Dictionary<string, IntPtr> { { Name, picture.Handle } }); // VideoManager.Open(new Dictionary<string, IntPtr> { { Name, picture.Handle } });
} // }
else // else
{ // {
VideoManager.Open(new Dictionary<string, IntPtr> { { Name, (IntPtr)preview } }); // VideoManager.Open(new Dictionary<string, IntPtr> { { Name, (IntPtr)preview } });
} // }
VideoManager.GrabOneImg(Name, out Bitmap bmp); // VideoManager.GrabOneImg(Name, out Bitmap bmp);
if (bmp == null) // if (bmp == null)
{ // {
msg = Name + crc.GetString(L.monitor_open_fail, "监控相机打开失败"); // msg = Name + crc.GetString(L.monitor_open_fail, "监控相机打开失败");
LogUtil.error(Name + $"监控相机打开失败"); // LogUtil.error(Name + $"监控相机打开失败");
return false; // return false;
} // }
VideoManager.StartRecord(Name, "Auto1"); // VideoManager.StartRecord(Name, "Auto1");
camera_event?.Invoke(this, bmp); // camera_event?.Invoke(this, bmp);
return true; // return true;
} // }
return false; // return false;
} //}
int errortimes = 0; int errortimes = 0;
bool camerathreadrun = true; bool camerathreadrun = true;
public void startCamera() public void startCamera()
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" requireReinstallation="true" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
</packages> </packages>
\ No newline at end of file \ No newline at end of file
...@@ -418,10 +418,10 @@ namespace DeviceLibrary ...@@ -418,10 +418,10 @@ namespace DeviceLibrary
InOutEndProcessEvent?.Invoke(posid, storeMoveType, true); InOutEndProcessEvent?.Invoke(posid, storeMoveType, true);
} }
HIKCamera GetCamera(int pos) //HIKCamera GetCamera(int pos)
{ //{
//return pos > 0 ? RobotManage.CameraA : RobotManage.CameraB; // //return pos > 0 ? RobotManage.CameraA : RobotManage.CameraB;
return RobotManage.CameraA; // return RobotManage.CameraA;
} //}
} }
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</root>--> </root>-->
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
......
...@@ -54,11 +54,11 @@ namespace TheMachine ...@@ -54,11 +54,11 @@ namespace TheMachine
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox(); this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.btn_IgnoreX09 = new System.Windows.Forms.Button(); this.btn_IgnoreX09 = new System.Windows.Forms.Button();
this.btn_PauseBuzzer = new System.Windows.Forms.Button(); this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.tabMonitor = new System.Windows.Forms.TabPage();
this.panelVideo = new System.Windows.Forms.Panel();
this.listView1 = new System.Windows.Forms.ListView(); this.listView1 = new System.Windows.Forms.ListView();
this.btn_stop = new System.Windows.Forms.Button(); this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button(); this.btn_run = new System.Windows.Forms.Button();
this.tabMonitor = new System.Windows.Forms.TabPage();
this.panelVideo = new System.Windows.Forms.Panel();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.tabc.SuspendLayout(); this.tabc.SuspendLayout();
this.tabP1.SuspendLayout(); this.tabP1.SuspendLayout();
...@@ -185,6 +185,7 @@ namespace TheMachine ...@@ -185,6 +185,7 @@ namespace TheMachine
this.tabc.SelectedIndex = 0; this.tabc.SelectedIndex = 0;
this.tabc.Size = new System.Drawing.Size(1008, 600); this.tabc.Size = new System.Drawing.Size(1008, 600);
this.tabc.TabIndex = 1; this.tabc.TabIndex = 1;
this.tabc.SelectedIndexChanged += new System.EventHandler(this.tabc_SelectedIndexChanged);
// //
// tabP1 // tabP1
// //
...@@ -318,6 +319,24 @@ namespace TheMachine ...@@ -318,6 +319,24 @@ namespace TheMachine
this.btn_PauseBuzzer.Visible = false; this.btn_PauseBuzzer.Visible = false;
this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click); this.btn_PauseBuzzer.Click += new System.EventHandler(this.btn_PauseBuzzer_Click);
// //
// tabMonitor
//
this.tabMonitor.Controls.Add(this.panelVideo);
this.tabMonitor.Location = new System.Drawing.Point(4, 36);
this.tabMonitor.Name = "tabMonitor";
this.tabMonitor.Size = new System.Drawing.Size(1000, 560);
this.tabMonitor.TabIndex = 1;
this.tabMonitor.Text = "监控";
this.tabMonitor.UseVisualStyleBackColor = true;
//
// panelVideo
//
this.panelVideo.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelVideo.Location = new System.Drawing.Point(0, 0);
this.panelVideo.Name = "panelVideo";
this.panelVideo.Size = new System.Drawing.Size(1000, 560);
this.panelVideo.TabIndex = 274;
//
// listView1 // listView1
// //
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
...@@ -357,24 +376,6 @@ namespace TheMachine ...@@ -357,24 +376,6 @@ namespace TheMachine
this.btn_run.UseVisualStyleBackColor = true; this.btn_run.UseVisualStyleBackColor = true;
this.btn_run.Click += new System.EventHandler(this.btn_run_Click); this.btn_run.Click += new System.EventHandler(this.btn_run_Click);
// //
// tabMonitor
//
this.tabMonitor.Controls.Add(this.panelVideo);
this.tabMonitor.Location = new System.Drawing.Point(4, 36);
this.tabMonitor.Name = "tabMonitor";
this.tabMonitor.Size = new System.Drawing.Size(1000, 560);
this.tabMonitor.TabIndex = 1;
this.tabMonitor.Text = "监控";
this.tabMonitor.UseVisualStyleBackColor = true;
//
// panelVideo
//
this.panelVideo.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelVideo.Location = new System.Drawing.Point(0, 0);
this.panelVideo.Name = "panelVideo";
this.panelVideo.Size = new System.Drawing.Size(1000, 560);
this.panelVideo.TabIndex = 274;
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
......
...@@ -144,6 +144,7 @@ namespace TheMachine ...@@ -144,6 +144,7 @@ namespace TheMachine
// Application.DoEvents(); // Application.DoEvents();
//} //}
LoadWindow(); LoadWindow();
tabc.Enabled = false;
pnl.Enabled = false; pnl.Enabled = false;
} }
private void CameraB_camera_event(object sender, Bitmap e) private void CameraB_camera_event(object sender, Bitmap e)
...@@ -282,6 +283,7 @@ namespace TheMachine ...@@ -282,6 +283,7 @@ namespace TheMachine
} }
启用调试模式ToolStripMenuItem.Enabled = true; 启用调试模式ToolStripMenuItem.Enabled = true;
pnl.Enabled = true; pnl.Enabled = true;
tabc.Enabled = true;
if (state) if (state)
{ {
CodeManager.LoadCamera(true); CodeManager.LoadCamera(true);
...@@ -315,7 +317,7 @@ namespace TheMachine ...@@ -315,7 +317,7 @@ namespace TheMachine
lm.Add(m); lm.Add(m);
} }
SetMsg(lm); SetMsg(lm);
WindowManager.Show(); //WindowManager.Show();
} }
void SetMsg(List<Msg> msgs) void SetMsg(List<Msg> msgs)
{ {
...@@ -724,5 +726,19 @@ namespace TheMachine ...@@ -724,5 +726,19 @@ namespace TheMachine
if (obj.Dock == DockStyle.Fill) if (obj.Dock == DockStyle.Fill)
obj.Dock = DockStyle.None; obj.Dock = DockStyle.None;
} }
private void tabc_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabc.SelectedIndex == 1)
{
WindowManager.Show();
panelVideo.Refresh();
}
//else
//{
// WindowManager.Hide();
// panelVideo.Refresh();
//}
}
} }
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>TheMachine</RootNamespace> <RootNamespace>TheMachine</RootNamespace>
<AssemblyName>MIMO_G2</AssemblyName> <AssemblyName>MIMO_G2</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>false</Deterministic> <Deterministic>false</Deterministic>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!