|
@@ -6,6 +6,25 @@ import { LIGHT_NORMAL, LIGHT_OPEN, LIGHT_CLOSE, LIGHT_ALARM, LIGHT_RESTART } fro
|
|
|
* @param {string} command - 控制命令,支持 'OPEN', 'SHOTOPEN', 'CLOSE', 'REBOOT', 'ALARM'
|
|
* @param {string} command - 控制命令,支持 'OPEN', 'SHOTOPEN', 'CLOSE', 'REBOOT', 'ALARM'
|
|
|
* @returns {Promise<void>} 异步操作结果
|
|
* @returns {Promise<void>} 异步操作结果
|
|
|
*/
|
|
*/
|
|
|
|
|
+
|
|
|
|
|
+const photo = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: 'http://127.0.0.1:10088/api/AGVResource/cancelTask',
|
|
|
|
|
+ method: 'GET',
|
|
|
|
|
+ contentType: 'application/json',
|
|
|
|
|
+ success: function (response) {
|
|
|
|
|
+ console.log('控制拍照成功:', response);
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function (error) {
|
|
|
|
|
+ console.error('控制拍照失败:', error);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('拍照失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const gateController = command => {
|
|
const gateController = command => {
|
|
|
try {
|
|
try {
|
|
|
// 验证输入参数
|
|
// 验证输入参数
|
|
@@ -21,6 +40,10 @@ const gateController = command => {
|
|
|
if (command === 'OPEN' || command === 'SHOTOPEN') {
|
|
if (command === 'OPEN' || command === 'SHOTOPEN') {
|
|
|
// 开门命令:控制灯光显示开门状态(绿灯常亮)
|
|
// 开门命令:控制灯光显示开门状态(绿灯常亮)
|
|
|
plugin.gateConfig.controlLight(JSON.stringify(LIGHT_OPEN));
|
|
plugin.gateConfig.controlLight(JSON.stringify(LIGHT_OPEN));
|
|
|
|
|
+
|
|
|
|
|
+ //开门拍照
|
|
|
|
|
+ photo();
|
|
|
|
|
+
|
|
|
} else if (command === 'CLOSE') {
|
|
} else if (command === 'CLOSE') {
|
|
|
// 关门命令:控制灯光显示关门状态(红灯常亮)
|
|
// 关门命令:控制灯光显示关门状态(红灯常亮)
|
|
|
plugin.gateConfig.controlLight(JSON.stringify(LIGHT_CLOSE));
|
|
plugin.gateConfig.controlLight(JSON.stringify(LIGHT_CLOSE));
|