Skip to content

Commit

Permalink
Add and get device name for basic property
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Feb 18, 2024
1 parent 7d7bc27 commit 2d988f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions libs/indidevice/property/indipropertybasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ PropertyBasic<T>::PropertyBasic(const std::shared_ptr<PropertyBasicPrivate> &dd)
: Property(std::static_pointer_cast<PropertyPrivate>(dd))
{ }

template <typename T>
void PropertyBasic<T>::setDeviceName(const char *name)
{
D_PTR(PropertyBasic);
d->typedProperty.setDeviceName(name);
}

template <typename T>
void PropertyBasic<T>::setDeviceName(const std::string &name)
{
D_PTR(PropertyBasic);
d->typedProperty.setDeviceName(name);
}

template <typename T>
void PropertyBasic<T>::setName(const char *name)
{
Expand Down Expand Up @@ -153,6 +167,13 @@ void PropertyBasic<T>::setTimestamp(const std::string &timestamp)
d->typedProperty.setTimestamp(timestamp);
}

template <typename T>
const char *PropertyBasic<T>::getDeviceName() const
{
D_PTR(const PropertyBasic);
return d->typedProperty.getDeviceName();
}

template <typename T>
const char *PropertyBasic<T>::getName() const
{
Expand Down
4 changes: 4 additions & 0 deletions libs/indidevice/property/indipropertybasic.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class PropertyBasic : public INDI::Property
~PropertyBasic();

public:
void setDeviceName(const char *name);
void setDeviceName(const std::string &name);

void setName(const char *name);
void setName(const std::string &name);

Expand All @@ -63,6 +66,7 @@ class PropertyBasic : public INDI::Property
void setTimestamp(const std::string &timestamp);

public:
const char *getDeviceName() const;
const char *getName() const;
const char *getLabel() const;
const char *getGroupName() const;
Expand Down

0 comments on commit 2d988f2

Please sign in to comment.