bool ClimateControlBehaviour::accessField(PropertyAccessMode aMode, ApiValuePtr aPropValue, PropertyDescriptorPtr aPropertyDescriptor) { if (aPropertyDescriptor->hasObjectKey(climatecontrol_key)) { if (aMode==access_read) { // read properties switch (aPropertyDescriptor->fieldKey()) { // Description properties case activeCoolingMode_key+descriptions_key_offset: aPropValue->setBoolValue(climateDeviceKind==climatedevice_fancoilunit); // FCUs can cool actively return true; // Settings properties case heatingSystemCapability_key+settings_key_offset: aPropValue->setUint8Value(heatingSystemCapability); return true; case heatingSystemType_key+settings_key_offset: aPropValue->setUint8Value(heatingSystemType); return true; } } else { // write properties switch (aPropertyDescriptor->fieldKey()) { // Settings properties case heatingSystemCapability_key+settings_key_offset: setPVar(heatingSystemCapability, (VdcHeatingSystemCapability)aPropValue->uint8Value()); return true; case heatingSystemType_key+settings_key_offset: setPVar(heatingSystemType, (VdcHeatingSystemType)aPropValue->uint8Value()); return true; } } } // not my field, let base class handle it return inherited::accessField(aMode, aPropValue, aPropertyDescriptor); }
bool OutputBehaviour::accessField(PropertyAccessMode aMode, ApiValuePtr aPropValue, PropertyDescriptorPtr aPropertyDescriptor) { if (aPropertyDescriptor->hasObjectKey(output_groups_key)) { if (aMode==access_read) { // read group membership if (isMember((DsGroup)aPropertyDescriptor->fieldKey())) { aPropValue->setBoolValue(true); return true; } return false; } else { // write group setGroupMembership((DsGroup)aPropertyDescriptor->fieldKey(), aPropValue->boolValue()); return true; } } else if (aPropertyDescriptor->hasObjectKey(output_key)) { if (aMode==access_read) { // read properties switch (aPropertyDescriptor->fieldKey()) { // Description properties case outputFunction_key+descriptions_key_offset: aPropValue->setUint8Value(outputFunction); return true; case outputUsage_key+descriptions_key_offset: aPropValue->setUint16Value(outputUsage); return true; case variableRamp_key+descriptions_key_offset: aPropValue->setBoolValue(variableRamp); return true; case maxPower_key+descriptions_key_offset: aPropValue->setDoubleValue(maxPower); return true; // Settings properties case mode_key+settings_key_offset: aPropValue->setUint8Value(actualOutputMode()); // return actual mode, never outputmode_default return true; case pushChanges_key+settings_key_offset: aPropValue->setBoolValue(pushChanges); return true; // State properties case localPriority_key+states_key_offset: aPropValue->setBoolValue(localPriority); return true; } } else { // write properties switch (aPropertyDescriptor->fieldKey()) { // Settings properties case mode_key+settings_key_offset: setOutputMode((DsOutputMode)aPropValue->int32Value()); return true; case pushChanges_key+settings_key_offset: setPVar(pushChanges, aPropValue->boolValue()); return true; // State properties case localPriority_key+states_key_offset: setPVar(localPriority, aPropValue->boolValue()); return true; } } } // not my field, let base class handle it return inherited::accessField(aMode, aPropValue, aPropertyDescriptor); }