Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit db9f527e
由
张东亮
编写于
2023-09-04 16:59:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
运行时更改为4.6.2
1 个父辈
11641ad4
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
97 行增加
和
83 行删除
Common/Common.csproj
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/Camera.cs
DeviceLibrary/packages.config
DeviceLibrary/theMachine/BoxTransport.cs
LoadCVSLibrary/LoadCSVLibrary.csproj
TheMachine/App.config
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/TheMachine.csproj
Common/Common.csproj
查看文件 @
db9f527
...
...
@@ -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>
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
db9f527
...
...
@@ -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" />
...
...
DeviceLibrary/DeviceLibrary/Camera.cs
查看文件 @
db9f527
...
...
@@ -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
()
...
...
DeviceLibrary/packages.config
查看文件 @
db9f527
<?
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
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
db9f527
...
...
@@ -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;
//
}
}
}
LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
db9f527
...
...
@@ -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>
...
...
TheMachine/App.config
查看文件 @
db9f527
...
...
@@ -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"
>
...
...
TheMachine/Form1.Designer.cs
查看文件 @
db9f527
...
...
@@ -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
);
...
...
TheMachine/Form1.cs
查看文件 @
db9f527
...
...
@@ -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();
//}
}
}
}
TheMachine/TheMachine.csproj
查看文件 @
db9f527
...
...
@@ -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!
Cancel
请
注册
或
登录
后发表评论