@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 ); }
c.localTags ( "NUM" ).customizationTags ( "analog", "input" ); c.information ( "Number of entries in data mapper", null, null ); c.create (); c.localTags ( "ERR" ).customizationTags ( "digital", "input" ); c.information ( "Data loading error", null, null ); c.create (); c.localTags ( "LOADING" ).customizationTags ( "digital", "input" ); c.information ( "Loading data", null, null ); c.create (); c.localTags ( "RELOAD" ).customizationTags ( "command" ); c.information ( "Perform reload", null, null ); c.create ();
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 () ); }
protected void processGroup ( final MasterServer app, final SummaryGroup group, final AbstractComponentItemCreator creator ) { final SummaryItem item = OsgiFactory.eINSTANCE.createSummaryItem (); item.setGroup ( group ); item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); item.getInformation ().setDescription ( String.format ( "Summary group information: %s", Names.makeId ( group ) ) ); item.getInformation ().getHierarchy ().addAll ( Names.makeHierarchy ( group ) ); item.getInformation ().setSystem ( "SCADA" ); final CreationRequest<SummaryItem> c = creator.addItem ( item ); c.localTags ( "SUMMARY" ); c.customizationTags ( "summary" ); final SummaryItem sumItem = c.create (); /* * FIXME: next thing is a bit wonky * actually the summary group should be used for generating sub items * but since the customization process can rename the item, the generator * cannot create a name for this later on. So for now all items * that are SummaryItem will be treated as sub-summary items. */ if ( group.eContainer () instanceof SummaryGroup ) { ( (SummaryGroup)group.eContainer () ).getItems ().add ( sumItem ); } }
@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.customizationTags ( output.getCustomizationTags () ); // the output of a calculation module is an input for the system c.localTags ( output.getLocalTag () );
c.customizationTags ( output.getCustomizationTags () ); // the output of a calculation module is an input for the system c.dataType ( outputSpec.getDataType () );