Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 58320050
由
张东亮
编写于
2023-05-24 14:10:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
校准库位料盘顶起检查功能
1 个父辈
d98f9a8c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
104 行增加
和
4 行删除
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
DeviceLibrary/DeviceLibrary/VisionHelper.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/MoveStep.cs
TheMachine/Program.cs
TheMachine/WindowManager.cs
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
5832005
...
...
@@ -84,6 +84,7 @@
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="DeviceLibrary\ServerCommunication_AgvProcess.cs" />
<Compile Include="DeviceLibrary\VisionHelper.cs" />
<Compile Include="theMachine\BoxTransport.cs" />
<Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\JobList.cs" />
...
...
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
查看文件 @
5832005
...
...
@@ -256,14 +256,14 @@ namespace DeviceLibrary
if
(
moveInfo1
.
WaitList
[
0
].
WaitType
==
WaitEnum
.
W013_Action
)
{
var
wt
=
moveInfo1
.
WaitList
[
0
];
for
(
int
i
=
0
;
i
<
100
0
;
i
++)
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
var
w
=
wt
.
Action
?.
Invoke
(
moveInfo1
.
WaitList
[
0
]);
if
(
w
==
null
)
return
;
if
(
w
.
Value
)
break
;
Task
.
Delay
(
10
).
Wait
();
Task
.
Delay
(
10
0
).
Wait
();
}
}
}
...
...
DeviceLibrary/DeviceLibrary/VisionHelper.cs
0 → 100644
查看文件 @
5832005
using
Common
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Diagnostics.Eventing.Reader
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
DeviceLibrary
{
public
class
VisionHelper
{
static
string
visionUrl
=
ConfigHelper
.
Config
.
Get
(
"VisionUrl"
,
"http://localhost:8089/vision/eyem"
);
public
static
bool
ReelStatusCheck
()
{
string
cameraName
=
ConfigHelper
.
Config
.
Get
(
"MonitorCamName"
,
"cam1"
);
string
url
=
visionUrl
+
"/reelStatusCheck/cam?camName="
+
cameraName
;
try
{
CheckAndRunServer
();
string
json
=
HttpHelper
.
Get
(
url
);
Result
result
=
JsonHelper
.
DeserializeJsonToObject
<
Result
>(
json
);
if
(
result
!=
null
&&
result
.
code
==
0
)
{
LogUtil
.
info
(
"料盘放置正常"
);
return
true
;
}
else
{
LogUtil
.
info
(
"料盘放置异常"
);
return
false
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"ReelStatusCheck"
,
ex
);
}
return
false
;
}
static
Process
EyemFeatureSet
=
new
Process
();
static
int
webclienttimeout
=
30000
;
public
static
void
CheckAndRunServer
()
{
lock
(
EyemFeatureSet
)
{
Process
[]
processesByName
=
Process
.
GetProcessesByName
(
"EyemFeatureSet"
);
if
(
processesByName
.
Length
!=
0
)
{
return
;
}
string
text
=
"Modules\\EyemFeatureSet\\EyemFeatureSet.exe"
;
if
(!
File
.
Exists
(
text
))
{
throw
new
Exception
(
"找不到算法服务器文件"
);
}
EyemFeatureSet
=
ProcessUtil
.
StartProcess
(
"EyemFeatureSet"
,
Application
.
StartupPath
+
"\\Modules\\EyemFeatureSet\\"
);
int
num
=
5
;
while
(
num
>
0
)
{
num
--;
Thread
.
Sleep
(
1000
);
MyWebClient
myWebClient
=
new
MyWebClient
(
webclienttimeout
);
string
text2
=
myWebClient
.
DownloadString
(
visionUrl
+
"/alive"
);
if
(
text2
.
Trim
()
==
"\"1\""
)
{
return
;
}
}
throw
new
Exception
(
"算法服务器文件打开失败"
);
}
}
public
class
Result
{
/// <summary>
/// 状态码,0为正常
/// </summary>
public
int
code
{
get
;
set
;
}
=
0
;
/// <summary>
/// 返回数据
/// </summary>
public
Dictionary
<
string
,
string
>
data
{
get
;
set
;
}
/// <summary>
/// 提示信息
/// </summary>
public
string
msg
{
get
;
set
;
}
=
"ok"
;
}
}
}
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
5832005
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
5832005
...
...
@@ -138,6 +138,10 @@ namespace DeviceLibrary
StoreFIX02
,
StoreFIX03
,
StoreFIX04
,
StoreFIX04_01_InoutBackToP1
,
StoreFIX04_02_CheckLocation
,
StoreFIX04_03_ReloadPos
,
StoreFIX04_04_InoutToPos
,
StoreFIX05
,
StoreFIX06
,
StoreTS10
,
...
...
TheMachine/Program.cs
查看文件 @
5832005
...
...
@@ -73,8 +73,8 @@ namespace TheMachine
var t = stopwatch.ElapsedMilliseconds / 1000d;
b.Save(@"D:\rick\vs\SO1069MIMO_PLUS\11-57-09-156_11.bmp");
*/
DeviceLibrary
.
VisionHelper
.
CheckAndRunServer
();
_
=
new
Mutex
(
true
,
Application
.
ProductName
,
out
bool
ret
);
if
(!
ret
)
...
...
TheMachine/WindowManager.cs
查看文件 @
5832005
...
...
@@ -13,7 +13,7 @@ namespace TheMachine
internal
class
WindowManager
{
public
static
List
<
WindInfo
>
windInfos
=
new
List
<
WindInfo
>();
static
string
baseDir
=
@".
\Modules\"
;
static
string
baseDir
=
Application
.
StartupPath
+
@"
\Modules\"
;
public
static
void
Start
()
{
foreach
(
var
item
in
windInfos
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论