@Override public void createItems ( final ItemCreator itemCreator ) { final DanglingItemReference source = this.mappedSourceValue.getInput ().createReference (); final CreationRequest<ReferenceItem> c = itemCreator.createReferenceItem ( source ); c.customizationTags ( this.mappedSourceValue.getCustomizationTags () ); c.localTags ( this.mappedSourceValue.getName () ); c.dataType ( this.mappedSourceValue.getDataType () ); final ReferenceItem item = c.create (); this.refs.add ( item ); }
protected void createForConnection ( final ItemCreator creator, final ConnectionProvider connectionProvider ) { { final CreationRequest<SourceItem> c = creator.createSelfItem ( null ); c.localTags ( "CON" ); c.dataType ( DataType.BOOLEAN ); c.customizationTags ( "input" ); c.addMasterListener ( new ConnectionMasterHandlerImpl ( NAME_FORMAT_CONNECTED, connectionProvider ) ); c.create (); } { final CreationRequest<SourceItem> c = creator.createSelfItem ( null ); c.localTags ( "STATE" ); c.dataType ( DataType.STRING ); c.customizationTags ( "input" ); c.addMasterListener ( new ConnectionMasterHandlerImpl ( NAME_FORMAT_STATE, connectionProvider ) ); c.create (); } } }
@Override public void createItems ( final ItemCreator itemCreator ) { final CreationRequest<ChangeCounterItem> request = itemCreator.createChangeCounterItem ( this.changeCounter.getType (), this.changeCounter.getOnError (), this.changeCounter.getValues () ); // FIXME: implement parameters request.localTags ( this.changeCounter.getName () ); request.customizationTags ( this.changeCounter.getCustomizationTags () ); request.dataType ( DataType.INT64 ); request.information ( this.changeCounter.getShortDescription (), null, null ); this.mapping.put ( this.changeCounter.getBuffer ().getName (), request.create () ); }
@Override public void createItems ( final ItemCreator itemCreator ) { final CreationRequest<?> request = createRequest ( itemCreator ); request.localTags ( this.singleValue.getName () ); request.dataType ( this.singleValue.getDataType () ); request.customizationTags ( this.singleValue.getCustomizationTags () ); request.information ( this.singleValue.getShortDescription (), null, null ); request.direction ( this.singleValue.isReadable (), this.singleValue.isWritable () ); request.create (); }
@Override public void createItems ( final ItemCreator creator, final AverageModule implementation ) { for ( final OutputDefinition output : this.calculationComponent.getOutputs () ) { final OutputSpecification outputSpec = Calculations.findSpecification ( implementation, output ); final AverageReferenceType type = AverageReferenceType.get ( output.getName () ); if ( type == null ) { throw new IllegalStateException ( String.format ( "Average reference type %s is unknown. Use any of: %s.", output.getName (), StringHelper.join ( AverageReferenceType.values (), ", " ) ) ); } final CreationRequest<AverageItem> c = createAverageItem ( creator, type ); c.localTags ( output.getLocalTag () ); c.customizationTags ( output.getCustomizationTags () );// the output of a calculation module is an input for the system c.dataType ( outputSpec.getDataType () ); c.addMasterListener ( new MasterListener<AverageItem> () { @Override public void setMaster ( final AverageItem item, final MasterContext master ) { final Average average = AverageModuleGenerator.this.map.get ( master.getImplementation () ); item.setSource ( average ); } } ); c.create (); } }
@Override public void createItems ( final ItemCreator creator, final MovingAverageModule implementation ) { for ( final OutputDefinition output : this.calculationComponent.getOutputs () ) { final OutputSpecification outputSpec = Calculations.findSpecification ( implementation, output ); final MovingAverageReferenceType type = MovingAverageReferenceType.get ( output.getName () ); if ( type == null ) { throw new IllegalStateException ( String.format ( "Moving average reference type %s is unknown. Use any of: %s.", output.getName (), StringHelper.join ( MovingAverageReferenceType.values (), ", " ) ) ); } final CreationRequest<MovingAverageItem> c = createAverageItem ( creator, type ); c.localTags ( output.getLocalTag () ); c.customizationTags ( output.getCustomizationTags () );// the output of a calculation module is an input for the system c.dataType ( outputSpec.getDataType () ); c.addMasterListener ( new MasterListener<MovingAverageItem> () { @Override public void setMaster ( final MovingAverageItem item, final MasterContext master ) { final MovingAverage average = MovingAverageModuleGenerator.this.map.get ( master.getImplementation () ); item.setSource ( average ); } } ); c.create (); } }
c.dataType ( outputSpec.getDataType () );
c.localTags ( output.getLocalTag () ); c.dataType ( outputSpec.getDataType () );