Commit db9f527e 张东亮

运行时更改为4.6.2

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