IGWiki Main Page

Ricerca pagine
Guida ricerche




IGSuiteJavaCode function provided I/O Hooks (Bozza)
  Modifica PaginaWiki ViewStorico paginaProprietàGet PdfCalcTranslatorVisualizza il documento in formato stampabile.PreferitesPosso Aiutarti

This advanced JSup feature enable a I/O Channel to get its I/O hooks from a JavaCode function that will decide which tag (for instance based according to the tag class) will be bound to which device item and if in read/write only mode.

The JavaCode function must accept an unique parameter: ChannelInfo ch
And must return an Iterable<IOHookCodeCreatedInfo> object.
Its signature should be:
Iterable<IOHookCodeCreatedInfo> functionName ( ChannelInfo ch ) throws JException;

The JavaCode function can determine which tag to include be enumerating the tags that belong to a certain tag class. The following example provides MQTT I/O hook for the tag of tag class named /device/onoff:

final Vector<IOHookCodeCreatedInfo> v = new Vector<>();
for( final TagRef tag : getTagClass( "/device/onoff" ).tags() ) {
  v.add( new IOHookCodeCreatedInfo.N.Adapter(
     tag, "/JSupTest/device/onoff/"+tag.getName(), true, false, null, null, false )
  );
}


An I/O Channel can have both I/O hooks statically entered in the tag dialog and JavaCode function provided ones.

The name of the JavaCode function that will provide I/O hooks to a channel have to be specified in the Auto I/O hook JavaCode fun: in the I/O channel dialog dialog.


Nome: JavaCode function provided IOHooks - Revisione: 0 - Autore: Alessandro Forlani (24.07.2022) - Modificata da: Alessandro Forlani (01.02.2024) - Categoria: JSup - Scadenza: 24.07.2023 - Permessi di visualizzazione: Tutti indistintamente - Permessi di modifica: Solo al proprietario - Copyright © Administrator All right reserved

Need account? Non hai un account?
Login
Password
Secure connection

Documenti correlati
   

Ultimi documenti modificati
   
getrss

Documenti recenti
   
    Nessuna corrispondenza trovata