|
|
@ -39,6 +39,7 @@ import org.nl.logger.BusinessLogger; |
|
|
|
import org.nl.start.auto.run.NDCSocketConnectionAutoRun; |
|
|
|
import org.nl.utils.SpringContextHolder; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.text.DateFormat; |
|
|
@ -52,6 +53,9 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
protected BusinessLogger execute_log; |
|
|
|
|
|
|
|
@Value("${agvToAcs.addr}") |
|
|
|
private String addr; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
DeviceAppService deviceAppService; |
|
|
|
@Autowired |
|
|
@ -1570,24 +1574,57 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
public JSONArray createBlocksData(Instruction inst) { |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("blockId",String.valueOf(ja.size()+1)); |
|
|
|
jo.put("location",inst.getStart_point_code() + "IN"); |
|
|
|
jo.put("operation","Wait"); |
|
|
|
jo.put("operation","script"); |
|
|
|
jo.put("id",inst.getStart_point_code() + "IN"); |
|
|
|
jo.put("script_name","interact.py"); |
|
|
|
JSONObject script_args = new JSONObject(); |
|
|
|
script_args.put("addr",addr); |
|
|
|
JSONObject data = new JSONObject(); |
|
|
|
JSONObject reach = new JSONObject(); |
|
|
|
reach.put("task_code",inst.getInstruction_code()); |
|
|
|
reach.put("address",inst.getStart_point_code() + "IN"); |
|
|
|
data.put("reach",reach); |
|
|
|
script_args.put("data",data); |
|
|
|
script_args.put("protocol","HTTP"); |
|
|
|
jo.put("script_args",script_args); |
|
|
|
ja.add(jo); |
|
|
|
|
|
|
|
JSONObject jo1 = new JSONObject(); |
|
|
|
jo1.put("blockId",String.valueOf(ja.size()+1)); |
|
|
|
jo1.put("location",inst.getStart_point_code()); |
|
|
|
jo1.put("operation","Jackload"); |
|
|
|
ja.add(jo1); |
|
|
|
|
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("blockId",String.valueOf(ja.size()+1)); |
|
|
|
jo2.put("location",inst.getStart_point_code() + "OUT"); |
|
|
|
jo2.put("operation","Wait"); |
|
|
|
jo2.put("operation","script"); |
|
|
|
jo2.put("id",inst.getStart_point_code() + "OUT"); |
|
|
|
jo2.put("script_name","interact.py"); |
|
|
|
JSONObject script_args2 = new JSONObject(); |
|
|
|
script_args2.put("addr",addr); |
|
|
|
JSONObject data2 = new JSONObject(); |
|
|
|
JSONObject reach2 = new JSONObject(); |
|
|
|
reach2.put("task_code",inst.getInstruction_code()); |
|
|
|
reach2.put("address",inst.getStart_point_code() + "OUT"); |
|
|
|
data2.put("reach",reach2); |
|
|
|
script_args2.put("data",data2); |
|
|
|
script_args2.put("protocol","HTTP"); |
|
|
|
jo2.put("script_args",script_args2); |
|
|
|
ja.add(jo2); |
|
|
|
|
|
|
|
JSONObject jo3 = new JSONObject(); |
|
|
|
jo3.put("blockId",String.valueOf(ja.size()+1)); |
|
|
|
jo3.put("location",inst.getNext_point_code() + "IN"); |
|
|
|
jo3.put("operation","Wait"); |
|
|
|
jo3.put("operation","script"); |
|
|
|
jo3.put("id",inst.getNext_point_code() + "IN"); |
|
|
|
jo3.put("script_name","interact.py"); |
|
|
|
JSONObject script_args3 = new JSONObject(); |
|
|
|
script_args3.put("addr",addr); |
|
|
|
JSONObject data3 = new JSONObject(); |
|
|
|
JSONObject reach3 = new JSONObject(); |
|
|
|
reach3.put("task_code",inst.getInstruction_code()); |
|
|
|
reach3.put("address",inst.getNext_point_code() + "IN"); |
|
|
|
data3.put("reach",reach3); |
|
|
|
script_args3.put("data",data3); |
|
|
|
script_args3.put("protocol","HTTP"); |
|
|
|
jo3.put("script_args",script_args3); |
|
|
|
ja.add(jo3); |
|
|
|
JSONObject jo4 = new JSONObject(); |
|
|
|
jo4.put("blockId",String.valueOf(ja.size()+1)); |
|
|
@ -1595,10 +1632,21 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
jo4.put("operation","JackUnload"); |
|
|
|
ja.add(jo4); |
|
|
|
JSONObject jo5 = new JSONObject(); |
|
|
|
jo5.put("blockId",String.valueOf(ja.size()+1)); |
|
|
|
jo5.put("location",inst.getNext_point_code() + "OUT"); |
|
|
|
jo5.put("operation","Wait"); |
|
|
|
jo5.put("operation","script"); |
|
|
|
jo5.put("id",inst.getStart_point_code() + "OUT"); |
|
|
|
jo5.put("script_name","interact.py"); |
|
|
|
JSONObject script_args5 = new JSONObject(); |
|
|
|
script_args5.put("addr",addr); |
|
|
|
JSONObject data5 = new JSONObject(); |
|
|
|
JSONObject reach5 = new JSONObject(); |
|
|
|
reach5.put("task_code",inst.getInstruction_code()); |
|
|
|
reach5.put("address",inst.getStart_point_code() + "OUT"); |
|
|
|
data5.put("reach",reach5); |
|
|
|
script_args5.put("data",data5); |
|
|
|
script_args5.put("protocol","HTTP"); |
|
|
|
jo5.put("script_args",script_args5); |
|
|
|
ja.add(jo5); |
|
|
|
System.out.println(ja); |
|
|
|
return ja; |
|
|
|
} |
|
|
|
|
|
|
|