6 Copyright (C) 2009-2010 8 RT-Synthesis Research Group 9 Intelligent Systems Research Institute, 10 National Institute of Advanced Industrial Science and Technology (AIST), 13 Licensed under the Eclipse Public License -v 1.0 (EPL) 14 http://www.opensource.org/licenses/eclipse-1.0.txt 16 File: composite_type.py 18 Enumeration for composite types. 20 This module stores the possible types of component composition. 23 NONE: The component is not in a composite component. 24 ALLSHARED: Composition sharing all attributes. All attributes (execution 25 context and status) are shared amongst all components in the composition. 26 This is the strongest type of composition. 27 ECSHARED: Only the execution context is shared amongst components in the 29 NONSHARED: Nothing is shared amongst components in the composition. This is the 30 weakest type of composition. 34 __version__ =
'$Revision: $' 41 PERIODIC_EC_SHARED =
'PeriodicECShared' 42 PERIODIC_STATE_SHARED =
'PeriodicStateShared' 44 FSM_EC_SHARED =
'FsmECSHared' 45 FSM_STATE_SHARED =
'FsmStateShared' 53 '''Returns the correct constant for a given string. 55 @raises InvalidCompositeTypeError 58 if type_string == NONE:
60 elif type_string == PERIODIC_EC_SHARED:
61 return PERIODC_EC_SHARED
62 elif type_string == PERIODIC_STATE_SHARED:
63 return PERIODIC_STATE_SHARED
64 elif type_string == GROUPING:
66 elif type_string == FSM_EC_SHARED:
68 elif type_string == FSM_STATE_SHARED:
69 return FSM_STATE_SHARED
75 '''Returns the correct string for a given composite type. 77 @raises InvalidCompositeTypeError 82 elif comp_type== PERIODIC_EC_SHARED:
83 return PERIODC_EC_SHARED
84 elif comp_type == PERIODIC_STATE_SHARED:
85 return PERIODIC_STATE_SHARED
86 elif comp_type == GROUPING:
88 elif comp_type == FSM_EC_SHARED:
90 elif comp_type == FSM_STATE_SHARED:
91 return FSM_STATE_SHARED
def from_string(type_string)