Skip to content

Commit 73ff415

Browse files
authored
get_unit_tags() methods for manual or OTA aliases (#1077)
* add get functions for unit tags * add functions to system level
1 parent e01795c commit 73ff415

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

trunk-recorder/systems/system.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ class System {
151151
virtual std::vector<double> get_channels() = 0;
152152
virtual std::vector<double> get_control_channels() = 0;
153153
virtual std::vector<Talkgroup *> get_talkgroups() = 0;
154+
virtual std::vector<UnitTag *> get_unit_tags() = 0;
155+
virtual std::vector<UnitTagOTA *> get_unit_tags_ota() = 0;
154156
virtual void set_bandplan(std::string) = 0;
155157
virtual std::string get_bandplan() = 0;
156158
virtual void set_bandfreq(int) = 0;

trunk-recorder/systems/system_impl.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,21 @@ std::vector<double> System_impl::get_channels() {
400400
std::vector<Talkgroup *> System_impl::get_talkgroups() {
401401
return talkgroups->get_talkgroups();
402402
}
403+
404+
std::vector<UnitTag *> System_impl::get_unit_tags() {
405+
if (unit_tags) {
406+
return unit_tags->get_unit_tags();
407+
}
408+
return std::vector<UnitTag *>();
409+
}
410+
411+
std::vector<UnitTagOTA *> System_impl::get_unit_tags_ota() {
412+
if (unit_tags) {
413+
return unit_tags->get_unit_tags_ota();
414+
}
415+
return std::vector<UnitTagOTA *>();
416+
}
417+
403418
int System_impl::channel_count() {
404419
return channels.size();
405420
}

trunk-recorder/systems/system_impl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ class System_impl : public System {
215215
std::vector<double> get_channels() override;
216216
std::vector<double> get_control_channels() override;
217217
std::vector<Talkgroup *> get_talkgroups() override;
218+
std::vector<UnitTag *> get_unit_tags() override;
219+
std::vector<UnitTagOTA *> get_unit_tags_ota() override;
218220
gr::msg_queue::sptr msg_queue;
219221
System_impl(int sys_id);
220222
void set_bandplan(std::string) override;

trunk-recorder/unit_tags.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,11 @@ void UnitTags::set_mode(UnitTagMode mode) {
344344
UnitTagMode UnitTags::get_mode() {
345345
return this->mode;
346346
}
347+
348+
std::vector<UnitTag *> UnitTags::get_unit_tags() {
349+
return unit_tags;
350+
}
351+
352+
std::vector<UnitTagOTA *> UnitTags::get_unit_tags_ota() {
353+
return unit_tags_ota;
354+
}

trunk-recorder/unit_tags.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@ class UnitTags {
2828
bool add_ota(const OTAAlias& ota_alias);
2929
void set_mode(UnitTagMode mode);
3030
UnitTagMode get_mode();
31+
std::vector<UnitTag *> get_unit_tags();
32+
std::vector<UnitTagOTA *> get_unit_tags_ota();
3133
};
3234
#endif // UNIT_TAGS_H

0 commit comments

Comments
 (0)