Adds q2 repos to migrate
This commit is contained in:
1 parent
ad1f62c4ee
commit
17f1c61c9e
991 files changed
+178451
No files matched your search
@@ -0,0 +1,139 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include "LogViewTabWidget.hpp"
|
||||
#include <QFrame>
|
||||
#include <QGridLayout>
|
||||
#include "LogViewField.hpp"
|
||||
#include "LogViewTelegram.hpp"
|
||||
#include "LogViewTelegramDialog.hpp"
|
||||
#include "LogViewSpinBox.hpp"
|
||||
#include "LogViewTelegram.hpp"
|
||||
#include "LogViewTetraTelegramsParser.hpp"
|
||||
|
||||
namespace N_LogView
|
||||
{
|
||||
|
||||
|
||||
LogViewTabWidget::LogViewTabWidget(LogViewField* a_field, LogViewTelegramDialog* a_parent, LogViewSpinBox* a_spinBox)
|
||||
: QTabWidget(a_parent)
|
||||
, LogViewWidget(a_field, this, a_parent, false)
|
||||
, m_TelegramDialog(a_parent)
|
||||
, m_SpinBox(a_spinBox)
|
||||
{
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LogViewTabWidget::changeSize(const int a_newSize)
|
||||
{
|
||||
|
||||
for (int i = count(); i < a_newSize; i++)
|
||||
addTab(m_Field, true, i);
|
||||
|
||||
|
||||
while (count() > a_newSize)
|
||||
{
|
||||
QStringList path = m_Field->jsonPath();
|
||||
path += QStringLiteral("index: %1").arg(count() - 1);
|
||||
m_TelegramDialog->removeItemsFromEditInfoList(path);
|
||||
removeTab(count() - 1);
|
||||
}
|
||||
while (m_Field->childCount() > a_newSize)
|
||||
m_Field->removeLastChild();
|
||||
|
||||
|
||||
setVisible(a_newSize > 0);
|
||||
m_TelegramDialog->makePretty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool LogViewTabWidget::saveContent(LogViewTelegram* a_telegram)
|
||||
{
|
||||
if (a_telegram->isJsonTelegram())
|
||||
return true;
|
||||
|
||||
if (m_SpinBox)
|
||||
{
|
||||
if (!isValid())
|
||||
return false;
|
||||
a_telegram->setUIntX(LogViewTelegram::SIZE_CENTRAL_DYN_ARRAY_SIZE, count());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LogViewTabWidget::addTab(LogViewField* a_field, const bool a_isEmpty, int arrayIdx)
|
||||
{
|
||||
if (arrayIdx < 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Invalid array index given: " << arrayIdx;
|
||||
return;
|
||||
}
|
||||
|
||||
QFrame *frame = new QFrame;
|
||||
QGridLayout *box = new QGridLayout(frame);
|
||||
QTabWidget::addTab(frame, QStringLiteral("%1 %2").arg(a_field->cleanName()).arg(count()+1));
|
||||
if (a_isEmpty)
|
||||
a_field->setHasContent(false);
|
||||
auto *childTree = a_field->child(arrayIdx);
|
||||
while (!childTree)
|
||||
{
|
||||
const auto *first = a_field->child(0);
|
||||
if (first)
|
||||
{
|
||||
LogViewField *fNew = first->clone(arrayIdx);
|
||||
a_field->addChild(fNew);
|
||||
childTree = a_field->child(arrayIdx);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogViewTetraTelegramsParser *p = LogViewTelegram::jsonParser();
|
||||
const StructInformation si = p->structFromType(a_field->type());
|
||||
if (si.type != a_field->type())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not find type '" << a_field->type() << "' - can not add substructure";
|
||||
return;
|
||||
}
|
||||
LogViewField *tc = new LogViewField(a_field->name() + QStringLiteral("TabChild"), LogViewField::e_FieldKindTabChild, a_field->xdrElement());
|
||||
tc->setJsonPath(a_field->jsonPath());
|
||||
a_field->addChild(tc);
|
||||
const QString path(QStringLiteral("index: %1"));
|
||||
LogViewTelegram::addFieldTreeStruct(QJsonObject(), tc, si, path.arg(arrayIdx), m_logger);
|
||||
childTree = a_field->child(arrayIdx);
|
||||
}
|
||||
}
|
||||
m_TelegramDialog->showTree(childTree, box);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (m_SpinBox)
|
||||
{
|
||||
int spinValue = m_SpinBox->value();
|
||||
if (spinValue < count())
|
||||
m_SpinBox->setValue(count());
|
||||
}
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user