Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c8f60a39
由
LN
编写于
2025-09-09 09:29:21 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
料串需要离开时播放提示音。
1 个父辈
571a69d5
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
85 行增加
和
14 行删除
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/theMachine/SoundsController.cs
TheMachine/TheMachine.csproj
TheMachine/sounds/stringIsFull.wav
TheMachineNView/TheMachineNView.csproj
TheMachineNView/sounds/stringIsFull.wav
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
c8f60a3
...
@@ -695,5 +695,28 @@ namespace DeviceLibrary
...
@@ -695,5 +695,28 @@ namespace DeviceLibrary
return
inside
;
return
inside
;
}
}
public
static
bool
HasRightCode
(
List
<
CodeInfo
>
codeInfos
)
{
foreach
(
var
codeInfo
in
codeInfos
)
{
if
(
HasRightCode
(
codeInfo
.
CodeStr
))
{
return
true
;
}
}
return
false
;
}
public
static
bool
HasRightCode
(
string
codestr
)
{
if
(
codestr
.
Length
==
12
&&
codestr
.
Contains
(
"-"
))
{
LogUtil
.
info
(
"找到有效条码:"
+
codestr
);
return
true
;
}
return
false
;
}
}
}
}
}
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
c8f60a3
...
@@ -415,6 +415,7 @@ namespace DeviceLibrary
...
@@ -415,6 +415,7 @@ namespace DeviceLibrary
runStatus
=
RunStatus
.
HomeReset
;
runStatus
=
RunStatus
.
HomeReset
;
ResetMoveInfo
.
NewMove
(
MoveStep
.
H01_HomeReset
);
ResetMoveInfo
.
NewMove
(
MoveStep
.
H01_HomeReset
);
ResetMoveInfo
.
log
(
"开始回原,记录最后一次回原时间"
);
ResetMoveInfo
.
log
(
"开始回原,记录最后一次回原时间"
);
SoundsController
.
StopPlay
();
RobotManage
.
LastResetTime
=
DateTime
.
Now
;
RobotManage
.
LastResetTime
=
DateTime
.
Now
;
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
}
...
...
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
c8f60a3
...
@@ -202,7 +202,7 @@ namespace DeviceLibrary
...
@@ -202,7 +202,7 @@ namespace DeviceLibrary
if
(
ScanTask
.
IsCompleted
)
if
(
ScanTask
.
IsCompleted
)
{
{
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
HIGH
);
var
x
=
ScanTask
.
Result
;
var
x
=
ScanTask
.
Result
;
if
(
x
.
Count
==
0
)
if
(
x
.
Count
==
0
)
{
{
...
@@ -214,22 +214,38 @@ namespace DeviceLibrary
...
@@ -214,22 +214,38 @@ namespace DeviceLibrary
ClampMoveInfo
.
MoveParam
.
NgMsg
=
crc
.
GetString
(
L
.
not_detect_reel_code
,
"未识别到有效二维码"
);
ClampMoveInfo
.
MoveParam
.
NgMsg
=
crc
.
GetString
(
L
.
not_detect_reel_code
,
"未识别到有效二维码"
);
return
;
return
;
}
}
else
{
else
{
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
ReelClamp_10
);
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
LOW
);
scantrytimes
++;
scantrytimes
++;
ClampMoveInfo
.
log
(
$
"未识别到有效二维码,重新扫码,第{scantrytimes}次"
);
ScanCode
();
ScanCode
();
return
;
return
;
}
}
}
}
else
else
{
{
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
InWaitServerCallback
);
scantrytimes
++;
ClampMoveInfo
.
log
(
$
"已完成扫码,等待服务器反馈库位 Count={x.Count}"
);
//bool hasRight = CodeManager.HasRightCode(x);
ClampMoveInfo
.
MoveParam
.
IsNg
=
false
;
//if (!hasRight&& scantrytimes < 3)
ClampMoveInfo
.
MoveParam
.
codeInfos
=
x
;
//{
var
cc
=
x
.
Select
((
a
)
=>
a
.
CodeStr
);
// ClampMoveInfo.NextMoveStep(MoveStep.ReelClamp_10);
LastCode
=
String
.
Join
(
"##"
,
cc
);
// IOMove(IO_Type.Device_Led, IO_VALUE.LOW);
ServerCM
.
SendInStoreRequest
(
cc
.
ToArray
(),
ClampMoveInfo
.
MoveParam
,
true
);
// ClampMoveInfo.log($"未找到正确条码,重新扫码,第{scantrytimes}次");
// ScanCode();
// return;
//}else
{
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
InWaitServerCallback
);
ClampMoveInfo
.
log
(
$
"已完成扫码,等待服务器反馈库位 Count={x.Count}"
);
ClampMoveInfo
.
MoveParam
.
IsNg
=
false
;
ClampMoveInfo
.
MoveParam
.
codeInfos
=
x
;
var
cc
=
x
.
Select
((
a
)
=>
a
.
CodeStr
);
LastCode
=
String
.
Join
(
"##"
,
cc
);
ServerCM
.
SendInStoreRequest
(
cc
.
ToArray
(),
ClampMoveInfo
.
MoveParam
,
true
);
}
}
}
}
}
else
if
(
ClampMoveInfo
.
IsTimeOut
(
15
))
else
if
(
ClampMoveInfo
.
IsTimeOut
(
15
))
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
c8f60a3
...
@@ -65,7 +65,8 @@ namespace DeviceLibrary
...
@@ -65,7 +65,8 @@ namespace DeviceLibrary
if
(
StringState
==
StringStateE
.
OutStore
&&
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
)
if
(
StringState
==
StringStateE
.
OutStore
&&
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
)
{
{
StringMoveInfo
.
log
(
$
"升起待机料串"
);
StringMoveInfo
.
log
(
$
"升起待机料串"
);
SoundsController
.
StopPlay
();
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_03
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_03
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
HIGH
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
HIGH
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringFix_Bottom
,
IO_Type
.
StringFix_Top
,
IO_VALUE
.
HIGH
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringFix_Bottom
,
IO_Type
.
StringFix_Top
,
IO_VALUE
.
HIGH
);
...
@@ -486,12 +487,17 @@ namespace DeviceLibrary
...
@@ -486,12 +487,17 @@ namespace DeviceLibrary
if
(
IOValue
(
IO_Type
.
StringBack_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
StringBack_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
SoundsController
.
StopPlay
();
LastStringState
=
StringStateE
.
None
;
LastStringState
=
StringStateE
.
None
;
StringState
=
StringStateE
.
None
;
StringState
=
StringStateE
.
None
;
StringMoveInfo
.
log
(
$
"料串已离开"
);
StringMoveInfo
.
log
(
$
"料串已离开
,关闭提示音
"
);
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
}
}
break
;
else
{
SoundsController
.
StartStringIsFull
();
}
break
;
// StringOut11_OpenDoor,
// StringOut11_OpenDoor,
//StringOut12_LineRun,
//StringOut12_LineRun,
//StringOut13_WaitLeave,
//StringOut13_WaitLeave,
...
@@ -596,7 +602,8 @@ namespace DeviceLibrary
...
@@ -596,7 +602,8 @@ namespace DeviceLibrary
if
(
StringMoveInfo
.
IsStep
(
MoveStep
.
StringOut_Released
))
if
(
StringMoveInfo
.
IsStep
(
MoveStep
.
StringOut_Released
))
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut10_WaitOut
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut10_WaitOut
);
StringMoveInfo
.
log
(
$
"{msg},料串开始离开,500秒后打开折叠门"
);
StringMoveInfo
.
log
(
$
"{msg},料串开始离开,500秒后打开折叠门,关闭提示音"
);
SoundsController
.
StopPlay
();
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
return
true
;
return
true
;
...
...
DeviceLibrary/theMachine/SoundsController.cs
查看文件 @
c8f60a3
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
private
static
string
openDoorFile
=
@"\sounds\doorOpen.wav"
;
private
static
string
openDoorFile
=
@"\sounds\doorOpen.wav"
;
private
static
string
closeDoorFile
=
@"\sounds\doorClose.wav"
;
private
static
string
closeDoorFile
=
@"\sounds\doorClose.wav"
;
private
static
string
stringIsFullFile
=
@"\sounds\stringIsFull.wav"
;
private
static
SoundPlayer
alarmPlayer
=
new
SoundPlayer
();
private
static
SoundPlayer
alarmPlayer
=
new
SoundPlayer
();
private
static
bool
InPlay
=
false
;
private
static
bool
InPlay
=
false
;
...
@@ -32,6 +33,11 @@ namespace DeviceLibrary
...
@@ -32,6 +33,11 @@ namespace DeviceLibrary
public
static
void
StartClose
()
{
public
static
void
StartClose
()
{
StartPlay
(
closeDoorFile
);
StartPlay
(
closeDoorFile
);
}
}
public
static
void
StartStringIsFull
()
{
StartPlay
(
stringIsFullFile
);
}
private
static
void
StartPlay
(
string
fileName
)
private
static
void
StartPlay
(
string
fileName
)
{
{
...
...
TheMachine/TheMachine.csproj
查看文件 @
c8f60a3
...
@@ -309,6 +309,15 @@
...
@@ -309,6 +309,15 @@
<EmbeddedResource Include="ledColor\yellow.txt">
<EmbeddedResource Include="ledColor\yellow.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</EmbeddedResource>
<Content Include="sounds\doorClose.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="sounds\doorOpen.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="sounds\stringIsFull.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="更新记录.txt" />
<Content Include="更新记录.txt" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
TheMachine/sounds/stringIsFull.wav
0 → 100644
查看文件 @
c8f60a3
此文件类型无法预览
TheMachineNView/TheMachineNView.csproj
查看文件 @
c8f60a3
...
@@ -307,6 +307,15 @@
...
@@ -307,6 +307,15 @@
<EmbeddedResource Include="ledColor\yellow.txt">
<EmbeddedResource Include="ledColor\yellow.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</EmbeddedResource>
<Content Include="sounds\doorClose.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="sounds\doorOpen.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="sounds\stringIsFull.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="更新记录.txt" />
<Content Include="更新记录.txt" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
TheMachineNView/sounds/stringIsFull.wav
0 → 100644
查看文件 @
c8f60a3
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论