Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void EmmaClient::exportStartListIofXml3()

QString str = is_relays
? getPlugin<RelaysPlugin>()->startListIofXml30()
: getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage);
: getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage, false);

QFile f(file_name);
if(f.open(QFile::WriteOnly)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void OFeedClient::exportStartListIofXml3(std::function<void()> on_success)

QString str = is_relays
? getPlugin<RelaysPlugin>()->startListIofXml30()
: getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage);
: getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage, false);

sendFile("start list upload", "/rest/v1/upload/iof", str, on_success);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void OResultsClient::exportStartListIofXml3(std::function<void()> on_success)

QString str = is_relays
? getPlugin<RelaysPlugin>()->startListIofXml30()
: getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage);
: getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage, false);

sendFile("start list upload", "/start-lists", str, on_success);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void QxClientService::postStartListIofXml3(QObject *context, std::function<void
int current_stage = ep->currentStageId();
bool is_relays = ep->eventConfig()->isRelays();
if (!is_relays) {
auto xml = getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage);
auto xml = getPlugin<RunsPlugin>()->startListStageIofXml30(current_stage, false);
uploadSpecFile(SpecFile::StartListIofXml3, xml.toUtf8(), context, call_back);
}
}
Expand Down Expand Up @@ -538,6 +538,7 @@ EventInfo QxClientService::eventInfo() const
return ei;
}

namespace {
auto query_to_json_csv(QSqlQuery &q)
{
QVariantList csv;
Expand All @@ -560,6 +561,7 @@ auto query_to_json_csv(QSqlQuery &q)
}
return csv;
}
}

int QxClientService::currentConnectionId()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ QString RelaysPlugin::startListIofXml30()
{
QDateTime start00 = getPlugin<EventPlugin>()->stageStartDateTime(1);
qfDebug() << "creating table";
qf::core::utils::TreeTable tt_classes = startListByClassesTableData(QString(),false);
qf::core::utils::TreeTable tt_classes = startListByClassesTableData(QString(), false);
QVariantList start_list{
"StartList",
QVariantMap{
Expand Down
14 changes: 6 additions & 8 deletions quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2622,14 +2622,12 @@ QString RunsPlugin::getClubAbbrFromName(QString name)
return "";
}

QString RunsPlugin::startListStageIofXml30(int stage_id)
QString RunsPlugin::startListStageIofXml30(int stage_id, bool with_vacants)
{
QDateTime start00 = getPlugin<EventPlugin>()->stageStartDateTime(stage_id);
Event::EventConfig *event_config = getPlugin<EventPlugin>()->eventConfig();
bool last_handicap_stage = event_config->stageCount() == selectedStageId() && event_config->isHandicap();
bool print_vacants = !last_handicap_stage;
//console.debug("print_vacants", print_vacants);
auto tt1 = startListClassesTable("", print_vacants, quickevent::gui::ReportOptionsDialog::StartTimeFormat::RelativeToClassStart);
auto tt1 = startListClassesTable("", with_vacants, quickevent::gui::ReportOptionsDialog::StartTimeFormat::RelativeToClassStart);
bool is_iof_race = event_config->isIofRace();
int iof_xml_race_number = event_config->iofXmlRaceNumber();

Expand All @@ -2652,7 +2650,7 @@ QString RunsPlugin::startListStageIofXml30(int stage_id)
QVariantList{"Time", start00.time().toString(Qt::ISODate)}
}
);
append_list(xml_event,
append_list(xml_event,
QVariantList{"Official",
QVariantMap{{"type", "Director"}},
QVariantList{"Person",
Expand All @@ -2663,7 +2661,7 @@ QString RunsPlugin::startListStageIofXml30(int stage_id)
},
}
);
append_list(xml_event,
append_list(xml_event,
QVariantList{"Official",
QVariantMap{{"type", "MainReferee"}},
QVariantList{"Person",
Expand Down Expand Up @@ -2764,14 +2762,14 @@ QString RunsPlugin::startListStageIofXml30(int stage_id)
return qf::core::utils::HtmlUtils::fromXmlList(xml_root, opts);
}

bool RunsPlugin::exportStartListStageIofXml30(int stage_id, const QString &file_name)
bool RunsPlugin::exportStartListStageIofXml30(int stage_id, const QString &file_name, bool with_vacants)
{
QFile f(file_name);
if(!f.open(QIODevice::WriteOnly)) {
qfError() << "Cannot open file" << f.fileName() << "for writing.";
return false;
}
QString str = startListStageIofXml30(stage_id);
QString str = startListStageIofXml30(stage_id, with_vacants);
f.write(str.toUtf8());
qfInfo() << "exported:" << file_name;
return true;
Expand Down
4 changes: 2 additions & 2 deletions quickevent/app/quickevent/plugins/Runs/src/runsplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RunsPlugin : public qf::gui::framework::Plugin

Q_INVOKABLE QVariantMap printAwardsOptionsWithDialog(const QVariantMap &opts);

bool exportStartListStageIofXml30(int stage_id, const QString &file_name);
bool exportStartListStageIofXml30(int stage_id, const QString &file_name, bool with_vacants);
bool exportStartListCurrentStageCsvSime(const QString &file_name, bool bibs, QString sql_where);
bool exportStartListCurrentStageTvGraphics(const QString &file_name);

Expand Down Expand Up @@ -121,7 +121,7 @@ class RunsPlugin : public qf::gui::framework::Plugin
QString export_resultsHtmlStage(bool with_laps = false);
void export_resultsHtmlStageWithLaps();
void export_resultsHtmlNStages();
QString startListStageIofXml30(int stage_id);
QString startListStageIofXml30(int stage_id, bool with_vacants);
QString resultsIofXml30Stage(int stage_id);
int competitorForRun(int run_id);
private:
Expand Down
11 changes: 8 additions & 3 deletions quickevent/app/quickevent/plugins/Runs/src/runswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ void RunsWidget::settleDownInPartWidget(::PartWidget *part_widget)
{
{
auto *a = new qfw::Action(tr("&IOF-XML 3.0"));
connect(a, &qfw::Action::triggered, this, &RunsWidget::export_startList_stage_iofxml30);
connect(a, &qfw::Action::triggered, this, [this]() { export_startList_stage_iofxml30(false); });
m_export_stlist_xml->addActionInto(a);
}
{
auto *a = new qfw::Action(tr("IOF-XML 3.0 with &vacants"));
connect(a, &qfw::Action::triggered, this, [this]() { export_startList_stage_iofxml30(true); });
m_export_stlist_xml->addActionInto(a);
}
}
Expand Down Expand Up @@ -986,13 +991,13 @@ int RunsWidget::selectedStageId()
return getPlugin<RunsPlugin>()->selectedStageId();
}

void RunsWidget::export_startList_stage_iofxml30()
void RunsWidget::export_startList_stage_iofxml30(bool with_vacants)
{
int stage_id = selectedStageId();
QString fn = getSaveFileName(Event::START_LIST_IOFXML3_FILE, stage_id);
if(fn.isEmpty())
return;
getPlugin<RunsPlugin>()->exportStartListStageIofXml30(stage_id, fn);
getPlugin<RunsPlugin>()->exportStartListStageIofXml30(stage_id, fn, with_vacants);
}


Expand Down
2 changes: 1 addition & 1 deletion quickevent/app/quickevent/plugins/Runs/src/runswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RunsWidget : public QFrame

Q_INVOKABLE int selectedStageId();
public:
void export_startList_stage_iofxml30();
void export_startList_stage_iofxml30(bool with_vacants);
void export_startList_stage_csv_sime();
void export_startList_stage_tv_graphics();

Expand Down
2 changes: 1 addition & 1 deletion quickevent/app/quickevent/src/appversion.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

#define APP_VERSION "3.4.19"
#define APP_VERSION "3.4.20"