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
6a16043d
Commit
6a16043d
authored
Feb 09, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
0dff8f18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+24
-10
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+3
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
6a16043d
...
...
@@ -241,6 +241,7 @@ namespace Siger.ApiACC.Controllers
{
//2.更新状态
taskObj
.
status
=
status
;
taskObj
.
operatetime
=
DateTime
.
Now
;
taskObj
.
completetime
=
DateTime
.
Now
;
...
...
@@ -480,6 +481,13 @@ namespace Siger.ApiACC.Controllers
Logger
.
WriteLineInfo
(
$"AutoProcess 设备属性未配置"
);
return
;
}
var
invenSection
=
_automationSectionProperty
.
Get
(
f
=>
f
.
propertytype
==
5
);
if
(
invenSection
==
null
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 工站立库未找到"
);
return
;
}
var
cncStations
=
sectionPropertys
.
Where
(
s
=>
s
.
propertytype
==
2
).
Select
(
s
=>
s
.
sectionid
).
ToList
();
// 获取可用 设备状态列表 排除上料工位
var
machineStatusList
=
_automationMachineStatus
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
cncStations
.
Contains
(
f
.
section
)
&&
f
.
enable
==
1
);
...
...
@@ -502,19 +510,23 @@ namespace Siger.ApiACC.Controllers
}
else
{
//优先级1 :清洗机完成 。待下料
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
Logger
.
WriteLineError
(
$"AutoProcess 有清洗机
{
cleanMachine
.
section
}
完成,创建清洗机Task"
);
//取最近完成的 Task
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
extend1
==
cleanMachine
.
section
.
ToString
()
&&
f
.
status
==
(
int
)
Automation
.
TaskResultStatus
.
Complated
,
"id"
,
true
).
FirstOrDefault
();
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
cleanMachine
.
section
,
"id"
,
true
).
FirstOrDefault
();
if
(
lastTask
!=
null
)
{
lastTask
.
extend1
=
string
.
Empty
;
_automationTaskList
.
Update
(
lastTask
);
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
cleanMachine
.
section
}
task:
{
TaskAction
.
Step_QXJ_LK
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
lastTask
.
fixtureguid
,
lastTask
.
ordercode
,
lastTask
.
sn
,
"无程序"
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
locationid
,
lastTask
.
route
);
return
;
//完成当前任务 退出
if
(
lastTask
.
status
==
(
int
)
TaskResultStatus
.
Complated
)
{
lastTask
.
extend1
=
string
.
Empty
;
_automationTaskList
.
Update
(
lastTask
);
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
cleanMachine
.
section
}
task:
{
TaskAction
.
Step_QXJ_LK
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
CreateTask
(
invenSection
.
sectionid
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
lastTask
.
fixtureguid
,
lastTask
.
fixturename
,
lastTask
.
ordercode
,
lastTask
.
sn
,
"无程序"
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
productname
,
lastTask
.
locationid
,
lastTask
.
route
);
return
;
//完成当前任务 退出
}
}
}
}
...
...
@@ -527,7 +539,7 @@ namespace Siger.ApiACC.Controllers
if
(
location
!=
null
)
{
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
location
.
section
}
task:
{
TaskAction
.
Step_LK_JGZX
.
ToStr
()}
sn
{
location
.
sn
}
"
);
CreateTask
(
location
.
section
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
,
location
.
fixture
,
location
.
ordernumber
,
location
.
sn
,
location
.
pn
,
location
.
productId
,
location
.
productCod
e
,
location
.
location
,
location
.
route
);
CreateTask
(
location
.
section
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
,
location
.
fixture
,
location
.
fixturename
,
location
.
ordernumber
,
location
.
sn
,
location
.
pn
,
location
.
productId
,
location
.
productCode
,
location
.
productNam
e
,
location
.
location
,
location
.
route
);
}
}
...
...
@@ -552,7 +564,7 @@ namespace Siger.ApiACC.Controllers
return
;
}
//创建CNC 下料到清洗机
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
tasklist
.
programnumber
,
tasklist
.
productid
,
tasklist
.
productcod
e
,
tasklist
.
locationid
,
tasklist
.
route
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
tasklist
.
fixtureguid
,
tasklist
.
fixturename
,
tasklist
.
ordercode
,
tasklist
.
sn
,
tasklist
.
programnumber
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
productnam
e
,
tasklist
.
locationid
,
tasklist
.
route
);
return
;
//完成当前任务 退出
}
else
...
...
@@ -565,7 +577,7 @@ namespace Siger.ApiACC.Controllers
if
(
lastTask
!=
null
)
{
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
fullMachine
.
section
}
task:
{
TaskAction
.
Step_JGZX_QXJ
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
lastTask
.
fixtureguid
,
lastTask
.
ordercode
,
lastTask
.
sn
,
lastTask
.
programnumber
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
locationid
,
lastTask
.
route
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
lastTask
.
fixtureguid
,
lastTask
.
fixturename
,
lastTask
.
ordercode
,
lastTask
.
sn
,
lastTask
.
programnumber
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
productname
,
lastTask
.
locationid
,
lastTask
.
route
);
}
}
}
...
...
@@ -585,7 +597,7 @@ namespace Siger.ApiACC.Controllers
/// <param name="sn">工件</param>
/// <param name="productCode">产品CODE</param>
/// <param name="locationid">储位ID</param>
void
CreateTask
(
int
section
,
TaskActionType
actionType
,
TaskAction
taskAction
,
string
guid
,
string
orderno
,
string
sn
,
string
program
,
int
productId
,
string
productCod
e
,
int
locationid
,
int
route
)
void
CreateTask
(
int
section
,
TaskActionType
actionType
,
TaskAction
taskAction
,
string
guid
,
string
fixtruename
,
string
orderno
,
string
sn
,
string
program
,
int
productId
,
string
productCode
,
string
productNam
e
,
int
locationid
,
int
route
)
{
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Auto
);
...
...
@@ -605,7 +617,9 @@ namespace Siger.ApiACC.Controllers
operater
=
0
,
status
=
1
,
fixtureguid
=
guid
,
fixturename
=
fixtruename
,
productid
=
productId
,
productname
=
productName
,
productcode
=
productCode
,
programnumber
=
program
,
locationid
=
locationid
,
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
6a16043d
...
...
@@ -381,7 +381,7 @@ namespace Siger.ApiACC.Controllers
programnumber
=
""
,
remark
=
"手动任务-准备上料"
,
route
=
route
.
id
,
extend1
=
unixtime
.
ToString
()
extend1
=
""
});
...
...
@@ -454,9 +454,11 @@ namespace Siger.ApiACC.Controllers
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
projectId
=
ProjectId
,
productid
=
monitor
.
productId
,
productname
=
monitor
.
productName
,
sn
=
monitor
.
sn
,
ordercode
=
monitor
.
ordernumber
,
fixtureguid
=
monitor
.
fixtureguid
,
fixturename
=
monitor
.
fixturename
,
locationid
=
monitor
.
locationId
,
productcode
=
monitor
.
productCode
,
processid
=
0
,
...
...
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