You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.1 KiB
98 lines
3.1 KiB
import Viewport from '@/core/engine/Viewport.ts'
|
|
import { Request } from '@ease-forge/shared'
|
|
import { worldModel } from '@/core/manager/WorldModel.ts'
|
|
|
|
export default class RCSScript implements RCS {
|
|
private readonly viewport: Viewport
|
|
|
|
constructor(viewport: Viewport) {
|
|
this.viewport = viewport
|
|
}
|
|
|
|
agvMove(agvId: string, targetWayPointId: string, targetDirection: '' | LLCDirection = '', option: AgvOptions = {}): Promise<ServerResponse<boolean>> {
|
|
return Request.request.post('/api/workbench/RcsController@agvMove', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId,
|
|
targetWayPointId,
|
|
targetDirection,
|
|
option
|
|
})
|
|
}
|
|
|
|
waitTaskFinish(agvId: string, option: AgvOptions = {}): Promise<ServerResponse<boolean>> {
|
|
return Request.request.post('/api/workbench/RcsController@waitTaskFinish', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId,
|
|
option
|
|
})
|
|
}
|
|
|
|
agvCarry(agvId: string, fromStoreLoc: string, targetStoreLoc: string, option: AgvOptions = {}): Promise<ServerResponse<boolean>> {
|
|
return Request.request.post('/api/workbench/RcsController@agvCarry', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId,
|
|
fromStoreLoc,
|
|
targetStoreLoc,
|
|
option
|
|
})
|
|
}
|
|
|
|
agvLoad(agvId: string, targetStoreLoc: string, option: AgvOptions = {}): Promise<ServerResponse<boolean>> {
|
|
return Request.request.post('/api/workbench/RcsController@agvLoad', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId,
|
|
targetStoreLoc,
|
|
option
|
|
})
|
|
}
|
|
|
|
agvUnload(agvId: string, targetStoreLoc: string, option: AgvOptions = {}): Promise<ServerResponse<boolean>> {
|
|
return Request.request.post('/api/workbench/RcsController@agvUnload', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId,
|
|
targetStoreLoc,
|
|
option
|
|
})
|
|
}
|
|
|
|
agvInfo(agvId: string, option: AgvOptions = {}): Promise<ServerResponse<Object>> {
|
|
return Request.request.post('/api/workbench/RcsController@agvInfo', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId: agvId,
|
|
option
|
|
})
|
|
}
|
|
|
|
cancelTasks(agvId: string, option: AgvOptions = {}): Promise<ServerResponse<boolean>> {
|
|
return Request.request.post('/api/workbench/RcsController@cancelTasks', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId: agvId,
|
|
option
|
|
})
|
|
}
|
|
|
|
agvToCharger(agvId: string, chargerId: string, option: AgvOptions = {}): Promise<ServerResponse<Object>> {
|
|
return Request.request.post('/api/workbench/RcsController@agvToCharger', {
|
|
projectUUID: worldModel.state.project_uuid,
|
|
catalogCode: worldModel.state.catalogCode,
|
|
envId: 1,
|
|
agvId: agvId,
|
|
chargerId,
|
|
option
|
|
})
|
|
}
|
|
}
|
|
|