Class WaitTask

  • All Implemented Interfaces:
    Task, ManagedTask

    public class WaitTask
    extends java.lang.Object
    implements Task
    • Constructor Detail

      • WaitTask

        public WaitTask​(long delay)
    • Method Detail

      • getElements

        public ModbusElement<?>[] getElements()
        Description copied from interface: Task
        Gets the ModbusElements.
        Specified by:
        getElements in interface Task
        Returns:
        an array of ModbusElements
      • getStartAddress

        public int getStartAddress()
        Description copied from interface: Task
        Gets the start Modbus register address.
        Specified by:
        getStartAddress in interface Task
        Returns:
        the address
      • getLength

        public int getLength()
        Description copied from interface: Task
        Gets the length from first to last Modbus register address.
        Specified by:
        getLength in interface Task
        Returns:
        the address
      • deactivate

        public void deactivate()
        Description copied from interface: Task
        This is called on deactivate of the Modbus-Bridge. It can be used to clear any references like listeners.
        Specified by:
        deactivate in interface Task
      • execute

        public <T> int execute​(AbstractModbusBridge bridge)
                        throws OpenemsException
        Description copied from interface: Task
        Executes the tasks - i.e. sends the query of a ReadTask or writes a WriteTask.
        Specified by:
        execute in interface Task
        Type Parameters:
        T - the Modbus-Element
        Parameters:
        bridge - the Modbus-Bridge
        Returns:
        the number of executed Sub-Tasks
        Throws:
        OpenemsException - on error
      • hasBeenExecuted

        public boolean hasBeenExecuted()
        Description copied from interface: Task
        Gets whether this ReadTask has been successfully executed before.
        Specified by:
        hasBeenExecuted in interface Task
        Returns:
        true if this Task has been executed successfully at least once
      • getExecuteDuration

        public long getExecuteDuration()
        Description copied from interface: Task
        Gets the execution duration of the last execution (successful or not not successful) in [ms].
        Specified by:
        getExecuteDuration in interface Task
        Returns:
        the duration in [ms]