package org.nl.acs.agv.server;

import cn.hutool.http.HttpResponse;
import org.nl.acs.agv.server.dto.AgvDto;
import org.nl.acs.instruction.domain.Instruction;

import java.util.Map;

/**
 * @Author: lyd
 * @Description:
 * @Date: 2022-08-15
 */
public interface MagicAgvService {

    Map<String, AgvDto> findAllAgvFromCache();
    /**
     * 查询自动门状态
     *
     * @param device
     * @return
     */
    public String queryDoorStatus(String device);

    /**
     * 根据指令号查询AGV指令状态
     * @param instCode
     * @return
     */
    public HttpResponse queryAgvInstStatus(String instCode);

    /**
     * 下发agv任务
     *
     * @param inst 指令对象
     */
    public HttpResponse sendAgvInstToMagic(Instruction inst) throws Exception;


    public HttpResponse sendAgvInstToMagic(String code) throws Exception;


    //查询AGV状态，故障、充电等
    public HttpResponse queryMagicAgvDeviceStatus();

    /**
     * 删除magic任务
     *
     * @param instCode
     * @return
     */
    public HttpResponse deleteAgvInst(String instCode);


    /**
     * 查询Magic AGV任务状态调用
     *
     * @param jobno
     * @param type
     * @param address
     * @param action
     * @param processingVehicle
     * @return
     */
    public String process(String jobno, String type, String address, String action, String processingVehicle);


    /**
     * Magic AGV 请求离开调用
     *
     * @param device
     * @return
     */
    public String requestAck(String device);


    /**
     * magic 全部暂停车辆
     */
    public HttpResponse pause() throws Exception;

    /**
     * magic 暂停指定车辆
     */
    public HttpResponse pause(String device_code) throws Exception;

    /**
     * magic 全部恢复车辆
     */
    public HttpResponse resume() throws Exception;

    /**
     * magic 恢复指定车辆
     */
    public HttpResponse resume(String device_code) throws Exception;


}
