package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;

import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
import org.nl.acs.device.enums.DeviceType;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
import java.util.List;

/**
 * 输送机-控制点-PLC扫码器驱动定义
 */
@Service
public class StandardConveyorControlWithPlcScannerDefination implements OpcDeviceDriverDefination {
    @Override
    public String getDriverCode() {
        return "standard_conveyor_control_with_plcscanner";
    }

    @Override
    public String getDriverName() {
        return "标准版-输送机-控制点-PLC扫码器";
    }

    @Override
    public String getDriverDescription() {
        return "标准版-输送机-控制点-PLC扫码器";
    }

    @Override
    public DeviceDriver getDriverInstance(Device device) {
        return (new StandardCoveyorControlWithPlcScannerDeviceDriver()).setDevice(device).setDriverDefination(this);

    }

    @Override
    public Class<? extends DeviceDriver> getDeviceDriverType() {
        return StandardCoveyorControlWithPlcScannerDeviceDriver.class;
    }

    @Override
    public List<DeviceType> getFitDeviceTypes() {
        List<DeviceType> types = new LinkedList();
        types.add(DeviceType.conveyor);
        return types;
    }

    @Override
    public List<ItemDto> getReadableItemDtos() {
        return ItemProtocol.getReadableItemDtos();
    }


    @Override
    public List<ItemDto> getWriteableItemDtos() {
        return ItemProtocol.getWriteableItemDtos();
    }

}
