/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public EList<OutputSpecification> getKnownOutputs () { if ( this.knownOutputs == null ) { final BasicEList<OutputSpecification> outputs = ECollections.newBasicEList (); for ( final MovingAverageReferenceType type : MovingAverageReferenceType.values () ) { outputs.add ( Components.createOutput ( type.getLiteral (), DataType.FLOAT ) ); } this.knownOutputs = ECollections.unmodifiableEList ( outputs ); } return this.knownOutputs; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public EList<OutputSpecification> getKnownOutputs () { if ( this.knownOutputs == null ) { final BasicEList<OutputSpecification> outputs = ECollections.newBasicEList (); for ( final MovingAverageReferenceType type : MovingAverageReferenceType.values () ) { outputs.add ( Components.createOutput ( type.getLiteral (), DataType.FLOAT ) ); } this.knownOutputs = ECollections.unmodifiableEList ( outputs ); } return this.knownOutputs; }
@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 (); } }