Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
Laisi_AutoMES2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiawei.su
Laisi_AutoMES2
Commits
8b5780e4
Commit
8b5780e4
authored
Feb 05, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixedbug
parent
03e7e3a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
16 deletions
+37
-16
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+35
-14
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+2
-2
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
8b5780e4
...
...
@@ -381,20 +381,31 @@ namespace Siger.ApiACC.Controllers
if
(
tasklist
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空"
);
return
;
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空,查找设备Monitor
{
cleanMachine
.
section
}
状态"
);
var
machineMonitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
cleanMachine
.
section
);
if
(
machineMonitor
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空"
);
return
;
}
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
machineMonitor
.
fixtureguid
,
machineMonitor
.
ordernumber
,
machineMonitor
.
sn
,
""
,
machineMonitor
.
productId
,
machineMonitor
.
productCode
,
machineMonitor
.
locationId
,
machineMonitor
.
route
);
}
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
locationid
==
tasklist
.
locationid
);
if
(
locationObj
==
null
)
else
{
Logger
.
WriteLineError
(
$"AutoProcess 立库 为空"
);
return
;
}
//工件回到立库
locationObj
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
locationObj
);
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
locationid
==
tasklist
.
locationid
);
if
(
locationObj
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess 立库 为空"
);
return
;
}
//工件回到立库
locationObj
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
locationObj
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
"无程序"
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
locationid
,
tasklist
.
route
);
return
;
//完成当前任务 退出
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
"无程序"
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
locationid
,
tasklist
.
route
);
return
;
//完成当前任务 退出
}
}
}
//优先级2 :其他设备待上料 (立库->加工中心)
...
...
@@ -443,10 +454,20 @@ namespace Siger.ApiACC.Controllers
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,创建普通设备下料到清洗机Task "
);
if
(
tasklist
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空"
);
return
;
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空,查找设备Monitor
{
fullMachine
.
section
}
状态"
);
var
machineMonitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
fullMachine
.
section
);
if
(
machineMonitor
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空"
);
return
;
}
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
machineMonitor
.
fixtureguid
,
machineMonitor
.
ordernumber
,
machineMonitor
.
sn
,
""
,
machineMonitor
.
productId
,
machineMonitor
.
productCode
,
machineMonitor
.
locationId
,
machineMonitor
.
route
);
}
else
{
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
tasklist
.
programnumber
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
locationid
,
tasklist
.
route
);
}
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
tasklist
.
programnumber
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
locationid
,
tasklist
.
route
);
return
;
//完成当前任务 退出
}
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
8b5780e4
...
...
@@ -23,6 +23,7 @@ using Siger.Middlelayer.Common.Helpers;
using
Newtonsoft.Json
;
using
NPOI.SS.Formula
;
using
static
Siger
.
Middlelayer
.
Share
.
Enum
.
ModuleEnum
.
Automation
;
using
Siger.ApiCommon.Result
;
namespace
Siger.ApiACC.Controllers
{
...
...
@@ -232,8 +233,7 @@ namespace Siger.ApiACC.Controllers
var
result
=
PushTask
(
host
,
sendToPLC
,
out
string
message
);
if
(!
result
)
{
Logger
.
WriteLineError
(
$"TASK 下发失败 :
{
message
}
"
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
return
new
ImportObjectResult
((
int
)
CommonEnum
.
Fail
,
message
);
}
taskobj
.
send
=
1
;
_automationTaskList
.
Update
(
taskobj
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment