Continues migration with DDS, Common

This commit is contained in:
torsten committed 2026-07-17 12:41:42 +02:00
1 parent 9b15cee841
commit fa48db111e
668 files changed
+111841 -2

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
/**
* @RDE_HEADER@
* Convert DSS enumerations to translatable strings
* $Id$
* $HeadURL$
* $Author$
*/
{% autoescape off %}
// filename: {{ namespace_abbr }}_translation.cpp
#include "{{ namespace_abbr }}_translation.h"
#include <QCoreApplication>
namespace {{ namespace }}
{
{% for idl_enum in idl_enums %}
//
// {{ idl_enum.name }}
//
QString toString({{ idl_enum.name }} state)
{
switch(state.underlying())
{{% for idl_member in idl_enum.member %}
case {{ idl_enum.name }}_def::{{ idl_member.key }}: return QCoreApplication::translate("{{ idl_enum.name }}", "{{ idl_member.key }}");
{% endfor %}
default: break;
}
return QCoreApplication::translate("{{ idl_enum.name }}", "Unknown (%1)").arg(state.underlying());
}
{% endfor %}
{% for dt in dataTopics.member %}{% if dt.hasTrColumns %}{% for tr in dt.trColumns %}
// {{ dt.name }}::{{ tr.name }}
QString tr{{ dt.name }}{{ tr.nameCc }}(const std::string &text)
{
return QCoreApplication::translate("{{ dt.name }}", text.c_str(), "{{ tr.name }}");
}
{% endfor %}{% endif %}{% endfor %}
} // namespace {{ namespace }}
{% endautoescape %}