----------------------------------------------------------------------------- Sets the user-friendly label for the value -----------------------------------------------------------------------------
| 1775 | // Sets the user-friendly label for the value |
| 1776 | //----------------------------------------------------------------------------- |
| 1777 | void Manager::SetValueLabel |
| 1778 | ( |
| 1779 | ValueID const& _id, |
| 1780 | string const& _value, |
| 1781 | int32 _pos |
| 1782 | ) |
| 1783 | { |
| 1784 | if( Driver* driver = GetDriver( _id.GetHomeId() ) ) |
| 1785 | { |
| 1786 | LockGuard LG(driver->m_nodeMutex); |
| 1787 | if (_pos != -1) { |
| 1788 | if (_id.GetType() != ValueID::ValueType_BitSet) { |
| 1789 | OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "ValueID passed to SetValueLabel is not a BitSet but a position was requested"); |
| 1790 | return; |
| 1791 | } |
| 1792 | ValueBitSet *value = static_cast<ValueBitSet *>(driver->GetValue( _id )); |
| 1793 | value->SetBitLabel(_pos, _value); |
| 1794 | value->Release(); |
| 1795 | return; |
| 1796 | } else { |
| 1797 | if( Value* value = driver->GetValue( _id ) ) |
| 1798 | { |
| 1799 | value->SetLabel( _value ); |
| 1800 | value->Release(); |
| 1801 | return; |
| 1802 | } |
| 1803 | } |
| 1804 | OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to SetValueLabel"); |
| 1805 | } |
| 1806 | } |
| 1807 | |
| 1808 | //----------------------------------------------------------------------------- |
| 1809 | // <Manager::GetValueUnits> |
no test coverage detected