83 lines
1.9 KiB
C++
Executable File
83 lines
1.9 KiB
C++
Executable File
|
|
|
|
|
|
#include "TimelineWidget.h"
|
|
#include "TestTimelineModel.h"
|
|
|
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
|
#include <nglapplication/nglapplication.h>
|
|
#include <Services/ProjectDataManagement/pdm_enums.hpp>
|
|
#include <Services/ProjectDataManagement/pdm_translation.h>
|
|
|
|
#include <time.h>
|
|
#include <QVBoxLayout>
|
|
#include <QPushButton>
|
|
#include <QDebug>
|
|
|
|
|
|
LtsTimelineClassic::TestTimelineModel *ttm;
|
|
|
|
|
|
void add(qint64 time_offset)
|
|
{
|
|
qint64 time = 1505292189000;
|
|
time += time_offset;
|
|
|
|
ttm->addTestEvent(new LtsTimelineClassic::Event(0, (int)ProjectDataManagement::EventType_def::Hit, time, 0, 0, 0, 0,
|
|
QStringList() << QStringLiteral("Test"),
|
|
LtsTimelineClassic::Event::drawCustomEventGraphicEllipse, QColor("green"), QString()));
|
|
}
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
qputenv("TDS_DEVEL", "yes, of course");
|
|
qWarning() << "LtsTimelineClassicTest";
|
|
NGLApplication app(argc, argv);
|
|
app.createLogger("Timeline", "log4cxx_timeline.props");
|
|
|
|
STARTUP_LOG(app.baseLogger());
|
|
|
|
int ret = 0;
|
|
|
|
#if 1
|
|
QWidget *widget = new QWidget();
|
|
widget->setMinimumWidth(500);
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout();
|
|
widget->setLayout(layout);
|
|
|
|
LtsTimelineClassic::TimelineWidget *timelineWidget = new LtsTimelineClassic::TimelineWidget();
|
|
layout->addWidget(timelineWidget);
|
|
|
|
QHBoxLayout *btnLayout = new QHBoxLayout();
|
|
QWidget *btnLayoutWidget = new QWidget();
|
|
btnLayoutWidget->setLayout(btnLayout);
|
|
layout->addWidget(btnLayoutWidget);
|
|
|
|
btnLayout->addWidget(new QPushButton(QStringLiteral("Filter")));
|
|
btnLayout->addWidget(new QPushButton(QStringLiteral("CSV Export")));
|
|
btnLayout->addStretch(1);
|
|
|
|
widget->show();
|
|
|
|
ttm = new LtsTimelineClassic::TestTimelineModel();
|
|
timelineWidget->setTimelineModel(ttm);
|
|
|
|
|
|
|
|
|
|
|
|
add(0);
|
|
add(100 * 60 * 1000);
|
|
add(3000 * 60 * 1000);
|
|
|
|
|
|
|
|
ret = app.exec();
|
|
SHUTDOWN_LOG(app.baseLogger());
|
|
#endif
|
|
|
|
return ret;
|
|
}
|