All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.api.model.function.ServoMoveQueryFunction Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
package org.bidib.wizard.api.model.function;

import org.bidib.jbidibc.exchange.lcmacro.LcMacroPointType;
import org.bidib.jbidibc.exchange.lcmacro.ServoMoveQueryPoint;
import org.bidib.wizard.model.ports.ServoPort;
import org.bidib.wizard.model.status.BidibStatus;

public class ServoMoveQueryFunction extends SystemFunction implements PortAware {
    private ServoPort port;

    public ServoMoveQueryFunction() {
        this(null);
    }

    public ServoMoveQueryFunction(ServoPort port) {
        super(null, KEY_SERVO_MOVE_QUERY);
        this.port = port;
    }

    public ServoPort getPort() {
        return port;
    }

    public void setPort(ServoPort port) {
        this.port = port;
    }

    public String getDebugString() {
        int id = 0;

        if (getPort() != null) {
            id = getPort().getId();
        }
        return "ServoModeQuery, Port=" + id;
    }

    @Override
    public LcMacroPointType toLcMacroPoint() {
        // prepare macro point
        ServoMoveQueryPoint servoMoveQueryPoint = new ServoMoveQueryPoint().withOutputNumber(getPort().getId());
        return servoMoveQueryPoint;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy