Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix XML export for relays. #984

Merged
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
8 changes: 8 additions & 0 deletions libquickevent/libquickeventcore/src/runstatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ class QUICKEVENTCORE_DECL_EXPORT RunStatus
QString toHtmlExportString() const;
QString toString() const;

void setDisqualified(bool value) { m_disqualified = value; }
void setDisqualifiedByOrganizer(bool value) { m_disqualifiedByOrganizer = value; }
void setNotCompeting(bool value) { m_notCompeting = value; }
void setMissingPunch(bool value) { m_missingPunch = value; }
void setDidNotStart(bool value) { m_didNotStart = value; }
void setDidNotFinish(bool value) { m_didNotFinish = value; }
void setOverTime(bool value) { m_overTime = value; }

bool idDisqualified() const { return m_disqualified; }
bool isDisqualifiedByOrganizer() const { return m_disqualifiedByOrganizer; }
bool isNotCompeting() const { return m_notCompeting; }
Expand Down
26 changes: 25 additions & 1 deletion quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,31 @@ QString RelaysPlugin::resultsIofXml30()
const qf::core::utils::TreeTableRow tt_leg_row = tt_legs.row(k);
auto time = quickevent::core::og::TimeMs::fromVariant(tt_leg_row.value("time"));
// omit from export if leg does not exist (rundId == 0) or runner with OK status did not finish yet
if (tt_leg_row.value("runId").toInt() == 0 || (time.isValid() && time.msec() == 0))
if (tt_leg_row.value("runId").toInt() == 0) {
// empty TeamMemberResult if leg does not exists - defined in IOF XML v3
// https://github.com/international-orienteering-federation/datastandard-v3/blob/24eb108e4c6b5e2904e5f8f0e49142e45e2c5230/IOF.xsd#L2580
qfDebug() << "Empty LEG for : Leg " << k+1 << ", Bib " << QString::number(relay_number) + '.' + QString::number(k+1);
QVariantList member_result{"TeamMemberResult"};
QVariantList person_result{"Result"};
append_list(person_result, QVariantList{"Leg", k+1 } );
append_list(person_result, QVariantList{"BibNumber", QString::number(relay_number) + '.' + QString::number(k+1)});
quickevent::core::RunStatus dns;
dns.setDisqualified(true);
dns.setDidNotStart(true);
append_list(person_result, QVariantList{"Status", dns.toXmlExportString()});
QVariantList overall_result{"OverallResult"};
{
quickevent::core::RunStatus dnf;
dnf.setDisqualified(true);
dnf.setDidNotFinish(true);
append_list(overall_result, QVariantList{"Status", dnf.toXmlExportString()});
}
append_list(person_result, overall_result);
append_list(member_result, person_result);
append_list(team_result, member_result);
continue;
}
else if (time.isValid() && time.msec() == 0)
continue;
QVariantList member_result{"TeamMemberResult"};
QVariantList person{"Person"};
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 "2.6.29"
#define APP_VERSION "2.6.30"

Loading