package com.zy.core.thread.impl;
|
|
import com.zy.core.thread.StationThread;
|
import com.zy.asrs.entity.DeviceConfig;
|
import com.zy.common.utils.RedisUtil;
|
import com.zy.core.network.ZyStationConnectDriver;
|
import com.zy.core.model.CommandResponse;
|
import com.zy.core.model.command.StationCommand;
|
import com.zy.core.network.entity.ZyStationStatusEntity;
|
import java.util.Collections;
|
import java.util.List;
|
|
import lombok.Data;
|
import lombok.extern.slf4j.Slf4j;
|
|
/**
|
* 输送站线程
|
*/
|
@Data
|
@Slf4j
|
public class ZyStationThread implements Runnable, StationThread {
|
|
private DeviceConfig deviceConfig;
|
private RedisUtil redisUtil;
|
private ZyStationConnectDriver zyStationConnectDriver;
|
|
public ZyStationThread(DeviceConfig deviceConfig, RedisUtil redisUtil) {
|
this.deviceConfig = deviceConfig;
|
this.redisUtil = redisUtil;
|
}
|
|
@Override
|
public boolean connect() {
|
return true;
|
}
|
|
@Override
|
public void close() {
|
}
|
|
@Override
|
public List<ZyStationStatusEntity> getStatus() {
|
if (zyStationConnectDriver == null) {
|
return Collections.emptyList();
|
}
|
return zyStationConnectDriver.getStatus();
|
}
|
|
@Override
|
public StationCommand getMoveCommand() {
|
return null;
|
}
|
|
@Override
|
public CommandResponse sendCommand(StationCommand command) {
|
return new CommandResponse(true);
|
}
|
|
@Override
|
public void run() {
|
}
|
}
|