@Override public void customize ( final Item item ) { final int phase1 = this.level * 2 - 1; final int phase2 = this.level * 2; // add the first summary which summarizes up all entry "error" attributes final org.eclipse.scada.configuration.world.osgi.AttributesSummary feature1 = OsgiFactory.eINSTANCE.createAttributesSummary (); feature1.setItem ( item ); feature1.setName ( "sum.phase1" ); feature1.getAttributes ().add ( "error" ); feature1.setOutputPrefix ( String.format ( "phase%d", phase1 ) ); DefaultFeatures.registerFeature ( item, feature1 ); /* * Between phase1 and phase2 the master handlers must be processed. This includes the manual override which would override an error attribute * summarized in phase1. Still if the output of the master handlers contains an "error" it will again be summarized in phase2. */ // add the second summary which summarizes up all attributes after the master handlers have been processed final org.eclipse.scada.configuration.world.osgi.AttributesSummary feature2 = OsgiFactory.eINSTANCE.createAttributesSummary (); feature2.setItem ( item ); feature2.setName ( "sum.phase2" ); feature2.getAttributes ().addAll ( Arrays.asList ( "manual", "error", "alarm", "warning", "info", "error.ackRequired", "alarm.ackRequired", "warning.ackRequired", "blocked" ) ); feature2.setOutputPrefix ( String.format ( "phase%d", phase2 ) ); DefaultFeatures.registerFeature ( item, feature2 ); } }
@Override public void customize ( final Item item ) { final int phase1 = this.level * 2 - 1; final int phase2 = this.level * 2; // add the first summary which summarizes up all entry "error" attributes final org.eclipse.scada.configuration.world.osgi.AttributesSummary feature1 = OsgiFactory.eINSTANCE.createAttributesSummary (); feature1.setItem ( item ); feature1.setName ( "sum.phase1" ); feature1.getAttributes ().add ( "error" ); feature1.setOutputPrefix ( String.format ( "phase%d", phase1 ) ); DefaultFeatures.registerFeature ( item, feature1 ); /* * Between phase1 and phase2 the master handlers must be processed. This includes the manual override which would override an error attribute * summarized in phase1. Still if the output of the master handlers contains an "error" it will again be summarized in phase2. */ // add the second summary which summarizes up all attributes after the master handlers have been processed final org.eclipse.scada.configuration.world.osgi.AttributesSummary feature2 = OsgiFactory.eINSTANCE.createAttributesSummary (); feature2.setItem ( item ); feature2.setName ( "sum.phase2" ); feature2.getAttributes ().addAll ( Arrays.asList ( "manual", "error", "alarm", "warning", "info", "error.ackRequired", "alarm.ackRequired", "warning.ackRequired", "blocked" ) ); feature2.setOutputPrefix ( String.format ( "phase%d", phase2 ) ); DefaultFeatures.registerFeature ( item, feature2 ); } }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors ( Collection<Object> newChildDescriptors, Object object ) { super.collectNewChildDescriptors ( newChildDescriptors, object ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__INFORMATION, OsgiFactory.eINSTANCE.createItemInformation () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createLevelMonitor () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createManualOverride () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createAttributesSummary () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createEventLogger () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createValueMapper () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createScale () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createNegate () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createRounding () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createBooleanMonitor () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createListMonitor () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createBlockHandler () ) ); newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.ITEM__ITEM_FEATURES, OsgiFactory.eINSTANCE.createBlock () ) ); }