本地驱动开门
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
package com.sv.barcode.button;
|
package com.sv.barcode.button;
|
||||||
|
|
||||||
|
import com.sv.intergration.DoorService;
|
||||||
|
import com.sv.intergration.impl.OldDoorService;
|
||||||
import com.sv.netty.ClientHandler;
|
import com.sv.netty.ClientHandler;
|
||||||
import com.sv.netty.ClientThread;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -14,6 +15,8 @@ public class EnterClick implements ActionListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
DoorService doorService = new OldDoorService();
|
||||||
|
doorService.enterOpenDoor();
|
||||||
// 开门
|
// 开门
|
||||||
logger.error("开门成功!!!!!!!");
|
logger.error("开门成功!!!!!!!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.sv.barcode.button;
|
package com.sv.barcode.button;
|
||||||
|
|
||||||
|
import com.sv.intergration.DoorService;
|
||||||
|
import com.sv.intergration.impl.OldDoorService;
|
||||||
import com.sv.netty.ClientHandler;
|
import com.sv.netty.ClientHandler;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -13,6 +15,8 @@ public class OutClick implements ActionListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
DoorService doorService = new OldDoorService();
|
||||||
|
doorService.outOpenDoor();
|
||||||
// 开门
|
// 开门
|
||||||
logger.error("开门成功!!!!!!!");
|
logger.error("开门成功!!!!!!!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.sv.intergration;
|
package com.sv.intergration;
|
||||||
|
|
||||||
|
import com.sv.intergration.impl.OldDoorService;
|
||||||
import com.sv.netty.config.VenueMessage;
|
import com.sv.netty.config.VenueMessage;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -49,6 +50,8 @@ public class MessageService {
|
|||||||
* 门禁开门
|
* 门禁开门
|
||||||
*/
|
*/
|
||||||
public void enterDoor() {
|
public void enterDoor() {
|
||||||
|
DoorService doorService = new OldDoorService();
|
||||||
|
doorService.enterOpenDoor();
|
||||||
// 开门
|
// 开门
|
||||||
logger.info("开门成功!!!");
|
logger.info("开门成功!!!");
|
||||||
}
|
}
|
||||||
@@ -57,6 +60,8 @@ public class MessageService {
|
|||||||
* 门禁开门
|
* 门禁开门
|
||||||
*/
|
*/
|
||||||
public void outDoor() {
|
public void outDoor() {
|
||||||
|
DoorService doorService = new OldDoorService();
|
||||||
|
doorService.outOpenDoor();
|
||||||
// 开门
|
// 开门
|
||||||
logger.info("开门成功!!!");
|
logger.info("开门成功!!!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,17 +21,19 @@ public class OldDoorService implements DoorService {
|
|||||||
connector.OpenForciblyConnect(tcpClientDetial);
|
connector.OpenForciblyConnect(tcpClientDetial);
|
||||||
CommandDetial detial = new CommandDetial();
|
CommandDetial detial = new CommandDetial();
|
||||||
detial.Connector = tcpClientDetial;
|
detial.Connector = tcpClientDetial;
|
||||||
detial.Identity = new FC8800Identity("MC-5824T28085603", "FFFFFFFF", E_ControllerType.FC8900);
|
detial.Identity = new FC8800Identity("MC-5824T23014127", "12345678", E_ControllerType.FC8900);
|
||||||
OpenDoor_Parameter openDoorParameter = new OpenDoor_Parameter(detial);
|
OpenDoor_Parameter openDoorParameter = new OpenDoor_Parameter(detial);
|
||||||
|
|
||||||
openDoorParameter.Door.SetDoor(1, 1);
|
openDoorParameter.Door.SetDoor(1, 1);
|
||||||
OpenDoor openDoor = new OpenDoor(openDoorParameter);
|
OpenDoor openDoor = new OpenDoor(openDoorParameter);
|
||||||
boolean command = connector.AddCommand(openDoor);
|
boolean command = connector.AddCommand(openDoor);
|
||||||
|
if (!command) {
|
||||||
|
logger.error("入场开门命令执行失败");
|
||||||
|
}
|
||||||
if (openDoor.getIsTimeout()) {
|
if (openDoor.getIsTimeout()) {
|
||||||
logger.info("----open door timeout ----");
|
logger.info("----in open door timeout ----");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("----open door error ----", e);
|
logger.error("----in open door error ----", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,17 +47,27 @@ public class OldDoorService implements DoorService {
|
|||||||
connector.OpenForciblyConnect(tcpClientDetial);
|
connector.OpenForciblyConnect(tcpClientDetial);
|
||||||
CommandDetial detial = new CommandDetial();
|
CommandDetial detial = new CommandDetial();
|
||||||
detial.Connector = tcpClientDetial;
|
detial.Connector = tcpClientDetial;
|
||||||
detial.Identity = new FC8800Identity("MC-5824T28085603", "FFFFFFFF", E_ControllerType.FC8900);
|
detial.Identity = new FC8800Identity("MC-5824T23014127", "12345678", E_ControllerType.FC8900);
|
||||||
OpenDoor_Parameter openDoorParameter = new OpenDoor_Parameter(detial);
|
OpenDoor_Parameter openDoorParameter = new OpenDoor_Parameter(detial);
|
||||||
|
|
||||||
openDoorParameter.Door.SetDoor(2, 1);
|
openDoorParameter.Door.SetDoor(2, 1);
|
||||||
OpenDoor openDoor = new OpenDoor(openDoorParameter);
|
OpenDoor openDoor = new OpenDoor(openDoorParameter);
|
||||||
boolean command = connector.AddCommand(openDoor);
|
boolean command = connector.AddCommand(openDoor);
|
||||||
|
System.out.println(command);
|
||||||
|
if (!command) {
|
||||||
|
logger.error("出场开门命令执行失败");
|
||||||
|
}
|
||||||
if (openDoor.getIsTimeout()) {
|
if (openDoor.getIsTimeout()) {
|
||||||
logger.info("----open door timeout ----");
|
logger.info("----out open door timeout ----");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("----open door error ----", e);
|
logger.error("----out open door error ----", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 测试
|
||||||
|
public static void main(String[] args) {
|
||||||
|
OldDoorService oldDoorService = new OldDoorService();
|
||||||
|
oldDoorService.enterOpenDoor();
|
||||||
|
oldDoorService.outOpenDoor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user