#include <acsexmplFridgeImpl.h>
Inheritance diagram for FridgeControl:
Public Member Functions | |
FridgeControl (const ACE_CString &name, maci::ContainerServices *containerServices) | |
virtual | ~FridgeControl () |
virtual void | cleanUp () |
void | updateTemperature () |
virtual void | on () |
virtual void | off () |
virtual void | open () |
virtual void | close () |
virtual ACS::RWdouble_ptr | refTemperature () |
virtual FRIDGE::ROOnOffStates_ptr | powerStatus () |
virtual FRIDGE::ROOpClStates_ptr | doorStatus () |
virtual ACS::ROdouble_ptr | currTemperature () |
Private Member Functions | |
virtual void | loadData () |
void | operator= (const FridgeControl &) |
Private Attributes | |
baci::SmartPropertyPointer< baci::RWdouble > | m_refTemperature_sp |
baci::SmartPropertyPointer< ROEnumImpl< ACS_ENUM_T(FRIDGE::OnOffStates), POA_FRIDGE::ROOnOffStates > | m_powerStatus_sp ) |
baci::SmartPropertyPointer< ROEnumImpl< ACS_ENUM_T(FRIDGE::OpClStates), POA_FRIDGE::ROOpClStates > | m_doorStatus_sp ) |
baci::SmartPropertyPointer< baci::ROdouble > | m_currTemperature_sp |
FridgeThread * | m_controlLoop_p |
nc::SimpleSupplier * | m_FridgeSupplier_p |
|
Constructor
|
|
Destructor |
|
Called after the last functional call to the component has finished. The component should then orderly release resources etc. As required by the CharacteristicComponentImpl class, I call explicitly the cleanUp() of the parent class. This makes sure that all threads are stopped and the Component's state set. Depending on what resources are used by a class implementing a Component and by the implementation of the parent class (if it does not inherit directly from acscomponent::ACSComponentImpl or baci:: CharacteristicComponentImpl) it might be necessary to call the cleanuUp() method of the base class AFTER having released resources allocated by the current class. This is demonstrated in this example where we want to make sure that the powerStatus is FRIDGE::OFF before letting the cleanUp() of the base class stopping all the threads, including the one that regulates the temperature. For an example where the cleanUp() of the parent class is called before any other step, see the Building class. Always check the documentation of the parent class and consider what resources are allocated by this class to extablish the requirements for the execution of lifecycle chained methods.
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Close the door.
|
|
Property currTemperature shows the fridge's actual temperature.
|
|
Property doorStatus shows the position of the door.
|
|
Converts this devices useful data into a temperatureDataBlockEvent structure and then publishes that onto an event channel.
|
|
Turn off the fridge.
|
|
Turn on the fridge.
|
|
Open the door.
|
|
ALMA C++ coding standards state copy operators should be disabled. |
|
Property powerStatus shows whether the power is on or off.
|
|
Property refTemperature is like a thermostat for the fridge.
|
|
Updates the temperature from the physical device
|
|
m_controlLoop_p is only started once the fridge has been turned on(). This thread is used to simulate the fridge's temperature trying to reach equillibrium with the reference temperature. Once the fridge has been turned off(), this thread is suspended. |
|
m_currTemperature_p is the temperature the fridge actually is. |
|
The fridge's door can be either opened or closed. |
|
This is the Supplier derived class used to publish data to the event channel. |
|
The fridge can be either turned on or off. |
|
m_refTemperature_sp is the temperature we want the fridge to be. |