MeOS version 3.5.978 Update 3
This commit is contained in:
parent
ef53f6da74
commit
6119dc88f1
@ -2361,7 +2361,7 @@ void TabCompetition::copyrightLine(gdioutput &gdi) const
|
|||||||
|
|
||||||
gdi.dropLine(0.4);
|
gdi.dropLine(0.4);
|
||||||
gdi.fillDown();
|
gdi.fillDown();
|
||||||
gdi.addString("", 0, makeDash(L"#Copyright © 2007-2018 Melin Software HB"));
|
gdi.addString("", 0, makeDash(L"#Copyright © 2007-2019 Melin Software HB"));
|
||||||
gdi.dropLine(1);
|
gdi.dropLine(1);
|
||||||
gdi.popX();
|
gdi.popX();
|
||||||
|
|
||||||
@ -2374,7 +2374,7 @@ void TabCompetition::loadAboutPage(gdioutput &gdi) const
|
|||||||
gdi.clearPage(false);
|
gdi.clearPage(false);
|
||||||
gdi.addString("", 2, makeDash(L"Om MeOS - ett Mycket Enkelt OrienteringsSystem")).setColor(colorDarkBlue);
|
gdi.addString("", 2, makeDash(L"Om MeOS - ett Mycket Enkelt OrienteringsSystem")).setColor(colorDarkBlue);
|
||||||
gdi.dropLine(2);
|
gdi.dropLine(2);
|
||||||
gdi.addStringUT(1, makeDash(L"Copyright © 2007-2018 Melin Software HB"));
|
gdi.addStringUT(1, makeDash(L"Copyright © 2007-2019 Melin Software HB"));
|
||||||
gdi.dropLine();
|
gdi.dropLine();
|
||||||
gdi.addStringUT(10, "The database connection used is MySQL++\nCopyright "
|
gdi.addStringUT(10, "The database connection used is MySQL++\nCopyright "
|
||||||
"(c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by MySQL AB,"
|
"(c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by MySQL AB,"
|
||||||
|
|||||||
@ -3684,8 +3684,8 @@ oClub *TabSI::extractClub(gdioutput &gdi) const {
|
|||||||
oClub *dbClub = nullptr;
|
oClub *dbClub = nullptr;
|
||||||
if (gdi.hasField("Club")) {
|
if (gdi.hasField("Club")) {
|
||||||
int clubId = gdi.getExtraInt("Club");
|
int clubId = gdi.getExtraInt("Club");
|
||||||
if (clubId >= 0) {
|
if (clubId > 0) {
|
||||||
dbClub = db.getClub(clubId);
|
dbClub = db.getClub(clubId-1);
|
||||||
if (dbClub && !stringMatch(dbClub->getName(), gdi.getText("Club")))
|
if (dbClub && !stringMatch(dbClub->getName(), gdi.getText("Club")))
|
||||||
dbClub = nullptr;
|
dbClub = nullptr;
|
||||||
}
|
}
|
||||||
@ -3702,8 +3702,8 @@ RunnerWDBEntry *TabSI::extractRunner(gdioutput &gdi) const {
|
|||||||
int rId = gdi.getExtraInt("Name");
|
int rId = gdi.getExtraInt("Name");
|
||||||
wstring name = gdi.getText("Name");
|
wstring name = gdi.getText("Name");
|
||||||
RunnerWDBEntry *dbR = nullptr;
|
RunnerWDBEntry *dbR = nullptr;
|
||||||
if (rId >= 0) {
|
if (rId > 0) {
|
||||||
dbR = db.getRunnerByIndex(rId);
|
dbR = db.getRunnerByIndex(rId-1);
|
||||||
if (dbR) {
|
if (dbR) {
|
||||||
wstring fname = dbR->getFamilyName();
|
wstring fname = dbR->getFamilyName();
|
||||||
wstring gname = dbR->getGivenName();
|
wstring gname = dbR->getGivenName();
|
||||||
@ -3847,8 +3847,9 @@ void TabSI::handleAutoComplete(gdioutput &gdi, AutoCompleteInfo &info) {
|
|||||||
auto bi = gdi.setText(info.getTarget(), info.getCurrent().c_str());
|
auto bi = gdi.setText(info.getTarget(), info.getCurrent().c_str());
|
||||||
if (bi) {
|
if (bi) {
|
||||||
int ix = info.getCurrentInt();
|
int ix = info.getCurrentInt();
|
||||||
bi->setExtra(ix);
|
|
||||||
if (bi->id == "Name") {
|
bi->setExtra(ix+1);
|
||||||
|
if (bi->id == "Name" && ix >= 0) {
|
||||||
auto r = oe->getRunnerDatabase().getRunnerByIndex(ix);
|
auto r = oe->getRunnerDatabase().getRunnerByIndex(ix);
|
||||||
int year = r ? r->getBirthYear() : 0;
|
int year = r ? r->getBirthYear() : 0;
|
||||||
if (year > 0) {
|
if (year > 0) {
|
||||||
|
|||||||
@ -888,7 +888,7 @@ void csvparser::checkSIConfigHeader(const vector<wstring> &sp) {
|
|||||||
else if (key == L"First name") {
|
else if (key == L"First name") {
|
||||||
siconfigmap[sicFirstName] = k;
|
siconfigmap[sicFirstName] = k;
|
||||||
}
|
}
|
||||||
else if (key == L"Last name") {
|
else if (key == L"Last name" || key == L"name") {
|
||||||
siconfigmap[sicLastName] = k;
|
siconfigmap[sicLastName] = k;
|
||||||
}
|
}
|
||||||
else if (key == L"No. of records" || key == L"No. of punches") {
|
else if (key == L"No. of records" || key == L"No. of punches") {
|
||||||
|
|||||||
@ -287,7 +287,8 @@ void Download::postFile(const wstring &url, const wstring &file, const wstring &
|
|||||||
|
|
||||||
InternetCrackUrl(url.c_str(), url.length(), ICU_ESCAPE, &uc);
|
InternetCrackUrl(url.c_str(), url.length(), ICU_ESCAPE, &uc);
|
||||||
int port = INTERNET_DEFAULT_HTTP_PORT;
|
int port = INTERNET_DEFAULT_HTTP_PORT;
|
||||||
if (uc.nScheme == INTERNET_SCHEME_HTTPS)
|
bool https = uc.nScheme == INTERNET_SCHEME_HTTPS;
|
||||||
|
if (https)
|
||||||
port = INTERNET_DEFAULT_HTTPS_PORT;
|
port = INTERNET_DEFAULT_HTTPS_PORT;
|
||||||
else if (uc.nPort>0)
|
else if (uc.nPort>0)
|
||||||
port = uc.nPort;
|
port = uc.nPort;
|
||||||
@ -296,7 +297,7 @@ void Download::postFile(const wstring &url, const wstring &file, const wstring &
|
|||||||
bool vsuccess = false;
|
bool vsuccess = false;
|
||||||
int errorCode = 0;
|
int errorCode = 0;
|
||||||
try {
|
try {
|
||||||
vsuccess = httpSendReqEx(hConnect, path, headers, file, fileOut, pw, errorCode);
|
vsuccess = httpSendReqEx(hConnect, https, path, headers, file, fileOut, pw, errorCode);
|
||||||
}
|
}
|
||||||
catch (std::exception &) {
|
catch (std::exception &) {
|
||||||
InternetCloseHandle(hConnect);
|
InternetCloseHandle(hConnect);
|
||||||
@ -315,7 +316,7 @@ void Download::postFile(const wstring &url, const wstring &file, const wstring &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Download::httpSendReqEx(HINTERNET hConnect, const wstring &dest,
|
bool Download::httpSendReqEx(HINTERNET hConnect, bool https, const wstring &dest,
|
||||||
const vector< pair<wstring, wstring> > &headers,
|
const vector< pair<wstring, wstring> > &headers,
|
||||||
const wstring &upFile, const wstring &outFile,
|
const wstring &upFile, const wstring &outFile,
|
||||||
ProgressWindow &pw,
|
ProgressWindow &pw,
|
||||||
@ -324,8 +325,19 @@ bool Download::httpSendReqEx(HINTERNET hConnect, const wstring &dest,
|
|||||||
INTERNET_BUFFERS BufferIn;
|
INTERNET_BUFFERS BufferIn;
|
||||||
memset(&BufferIn, 0, sizeof(BufferIn));
|
memset(&BufferIn, 0, sizeof(BufferIn));
|
||||||
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS );
|
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS );
|
||||||
|
TCHAR szAccept[] = L"*/*";
|
||||||
|
LPCTSTR AcceptTypes[2] = { 0, 0 };
|
||||||
|
AcceptTypes[0] = szAccept;
|
||||||
|
DWORD flags = INTERNET_FLAG_NO_CACHE_WRITE |
|
||||||
|
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID |
|
||||||
|
INTERNET_FLAG_IGNORE_CERT_CN_INVALID |
|
||||||
|
INTERNET_FLAG_KEEP_CONNECTION;
|
||||||
|
|
||||||
HINTERNET hRequest = HttpOpenRequest (hConnect, L"POST", dest.c_str(), NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0);
|
if (https)
|
||||||
|
flags |= INTERNET_FLAG_SECURE;
|
||||||
|
|
||||||
|
HINTERNET hRequest = HttpOpenRequest (hConnect, L"POST", dest.c_str(), HTTP_VERSION, NULL, AcceptTypes,
|
||||||
|
flags, 0);
|
||||||
|
|
||||||
DWORD dwBytesRead = 0;
|
DWORD dwBytesRead = 0;
|
||||||
DWORD dwBytesWritten = 0;
|
DWORD dwBytesWritten = 0;
|
||||||
@ -397,11 +409,14 @@ bool Download::httpSendReqEx(HINTERNET hConnect, const wstring &dest,
|
|||||||
errorCode = error;
|
errorCode = error;
|
||||||
if (error == ERROR_INTERNET_FORCE_RETRY)
|
if (error == ERROR_INTERNET_FORCE_RETRY)
|
||||||
retry--;
|
retry--;
|
||||||
else if (error == ERROR_INTERNET_TIMEOUT) {
|
|
||||||
throw std::exception("Fick inget svar i tid (ERROR_INTERNET_TIMEOUT)");
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
InternetCloseHandle(hRequest);
|
InternetCloseHandle(hRequest);
|
||||||
|
if (error == ERROR_INTERNET_TIMEOUT) {
|
||||||
|
throw std::exception("Fick inget svar i tid (ERROR_INTERNET_TIMEOUT)");
|
||||||
|
}
|
||||||
|
else if (error == ERROR_INTERNET_CONNECTION_RESET) {
|
||||||
|
throw std::exception("Inget svar (ERROR_INTERNET_CONNECTION_RESET)");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ private:
|
|||||||
bool success;
|
bool success;
|
||||||
void initThread();
|
void initThread();
|
||||||
|
|
||||||
bool httpSendReqEx(HINTERNET hConnect, const wstring &dest, const vector< pair<wstring, wstring> > &headers,
|
bool httpSendReqEx(HINTERNET hConnect, bool https, const wstring &dest, const vector< pair<wstring, wstring> > &headers,
|
||||||
const wstring &upFile, const wstring &outFile, ProgressWindow &pw, int &errroCode) const;
|
const wstring &upFile, const wstring &outFile, ProgressWindow &pw, int &errroCode) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -1329,6 +1329,7 @@ void DynamicResult::debugDumpVariables(gdioutput &gdi, bool includeSymbols) cons
|
|||||||
void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
||||||
const pair<int, int> & controlId,
|
const pair<int, int> & controlId,
|
||||||
bool totalResults,
|
bool totalResults,
|
||||||
|
bool inclForestRunners,
|
||||||
const string &resTag,
|
const string &resTag,
|
||||||
oListInfo::ResultType resType,
|
oListInfo::ResultType resType,
|
||||||
int inputNumber,
|
int inputNumber,
|
||||||
@ -1347,10 +1348,19 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
for (pRunner r : runners) {
|
for (pRunner r : runners) {
|
||||||
ri.status = r->getStatus();
|
ri.status = r->getStatus();
|
||||||
if (ri.status == StatusUnknown) {
|
if (ri.status == StatusUnknown) {
|
||||||
if (r->getFinishTime() == 0)
|
if (r->getFinishTime() == 0) {
|
||||||
|
if (!inclForestRunners)
|
||||||
continue;
|
continue;
|
||||||
|
else {
|
||||||
|
if (r->getClubId() == cVacantId)
|
||||||
|
continue;
|
||||||
|
ri.status = StatusUnknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
ri.status = StatusOK; // Preliminary status
|
ri.status = StatusOK; // Preliminary status
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ri.status == StatusOK)
|
if (ri.status == StatusOK)
|
||||||
ri.place = r->getPlace();
|
ri.place = r->getPlace();
|
||||||
else
|
else
|
||||||
@ -1367,10 +1377,19 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
for (pRunner r : runners) {
|
for (pRunner r : runners) {
|
||||||
ri.status = r->getTotalStatus();
|
ri.status = r->getTotalStatus();
|
||||||
if (ri.status == StatusUnknown && r->getInputStatus() == StatusOK) {
|
if (ri.status == StatusUnknown && r->getInputStatus() == StatusOK) {
|
||||||
if (r->getFinishTime() == 0)
|
if (r->getFinishTime() == 0) {
|
||||||
|
if (!inclForestRunners)
|
||||||
continue;
|
continue;
|
||||||
|
else {
|
||||||
|
if (r->getClubId() == cVacantId)
|
||||||
|
continue;
|
||||||
|
ri.status = StatusUnknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
ri.status = StatusOK; // Preliminary status
|
ri.status = StatusOK; // Preliminary status
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ri.status == StatusOK)
|
if (ri.status == StatusOK)
|
||||||
ri.place = r->getTotalPlace();
|
ri.place = r->getTotalPlace();
|
||||||
else
|
else
|
||||||
@ -1439,8 +1458,11 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
const auto &tmp = r->getTempResult(0);
|
const auto &tmp = r->getTempResult(0);
|
||||||
ri.status = tmp.getStatus();
|
ri.status = tmp.getStatus();
|
||||||
if (ri.status == StatusUnknown) {
|
if (ri.status == StatusUnknown) {
|
||||||
if (r->getFinishTime() == 0)
|
if (r->getFinishTime() == 0) {
|
||||||
|
if (!inclForestRunners)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
ri.status = StatusOK; // Preliminary status
|
ri.status = StatusOK; // Preliminary status
|
||||||
}
|
}
|
||||||
if (ri.status == StatusOK)
|
if (ri.status == StatusOK)
|
||||||
@ -1450,6 +1472,7 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
|
|
||||||
if ((controlId.first != oPunch::PunchStart ||
|
if ((controlId.first != oPunch::PunchStart ||
|
||||||
controlId.second != oPunch::PunchFinish) && ri.status == StatusMP && r->getStatus() != StatusMP) {
|
controlId.second != oPunch::PunchFinish) && ri.status == StatusMP && r->getStatus() != StatusMP) {
|
||||||
|
if (!inclForestRunners)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -122,6 +122,7 @@ public:
|
|||||||
static void calculateIndividualResults(vector<pRunner> &runners,
|
static void calculateIndividualResults(vector<pRunner> &runners,
|
||||||
const pair<int, int> &controlId,
|
const pair<int, int> &controlId,
|
||||||
bool totalResults,
|
bool totalResults,
|
||||||
|
bool inclForestRunners,
|
||||||
const string &resTag,
|
const string &resTag,
|
||||||
oListInfo::ResultType resType,
|
oListInfo::ResultType resType,
|
||||||
int inputNumber,
|
int inputNumber,
|
||||||
|
|||||||
@ -85,6 +85,9 @@ InfoRadioControl::InfoRadioControl(int id) : InfoBase(id) {
|
|||||||
InfoClass::InfoClass(int id) : InfoBase(id) {
|
InfoClass::InfoClass(int id) : InfoBase(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InfoMeosStatus::InfoMeosStatus() : InfoBase(0) {
|
||||||
|
}
|
||||||
|
|
||||||
InfoOrganization::InfoOrganization(int id) : InfoBase(id) {
|
InfoOrganization::InfoOrganization(int id) : InfoBase(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,6 +384,23 @@ void InfoClass::serialize(xmlbuffer &xml, bool diffOnly) const {
|
|||||||
xml.write("cls", prop, name);
|
xml.write("cls", prop, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InfoMeosStatus::setOnDatabase(const bool flag) {
|
||||||
|
onDatabase = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InfoMeosStatus::setEventNameId(const wstring & str) {
|
||||||
|
eventNameId = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InfoMeosStatus::serialize(xmlbuffer &xml, bool diffOnly) const {
|
||||||
|
vector<pair<string, wstring>> prop;
|
||||||
|
prop.push_back(make_pair("version", getMeosCompectVersion()));
|
||||||
|
prop.push_back(make_pair("eventNameId", eventNameId));
|
||||||
|
prop.push_back(make_pair("onDatabase", itow(onDatabase))); // 1 is true, 0 is false
|
||||||
|
|
||||||
|
xml.write("status", prop, L"");
|
||||||
|
}
|
||||||
|
|
||||||
bool InfoOrganization::synchronize(oClub &c) {
|
bool InfoOrganization::synchronize(oClub &c) {
|
||||||
const wstring &n = c.getDisplayName();
|
const wstring &n = c.getDisplayName();
|
||||||
if (n == name)
|
if (n == name)
|
||||||
@ -445,6 +465,10 @@ bool InfoBaseCompetitor::synchronizeBase(oAbstractRunner &bc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int s = bc.getStatus();
|
int s = bc.getStatus();
|
||||||
|
int rt = bc.getRunningTime() * 10;
|
||||||
|
if (rt > 0 && s == RunnerStatus::StatusUnknown)
|
||||||
|
s = RunnerStatus::StatusOK;
|
||||||
|
|
||||||
if (status != s) {
|
if (status != s) {
|
||||||
status = s;
|
status = s;
|
||||||
ch = true;
|
ch = true;
|
||||||
@ -459,7 +483,6 @@ bool InfoBaseCompetitor::synchronizeBase(oAbstractRunner &bc) {
|
|||||||
ch = true;
|
ch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rt = bc.getRunningTime() * 10;
|
|
||||||
if (rt != runningTime) {
|
if (rt != runningTime) {
|
||||||
runningTime = rt;
|
runningTime = rt;
|
||||||
ch = true;
|
ch = true;
|
||||||
|
|||||||
@ -125,6 +125,18 @@ class InfoClass : public InfoBase {
|
|||||||
friend class InfoCompetition;
|
friend class InfoCompetition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class InfoMeosStatus : public InfoBase {
|
||||||
|
protected:
|
||||||
|
wstring eventNameId; // event Name Id, actual name of the database, can also be matched in oevent table of meosmain
|
||||||
|
bool onDatabase; // true if currently on database
|
||||||
|
public:
|
||||||
|
void serialize(xmlbuffer &xml, bool diffOnly) const;
|
||||||
|
InfoMeosStatus();
|
||||||
|
virtual ~InfoMeosStatus() {}
|
||||||
|
void setEventNameId(const wstring &);
|
||||||
|
void setOnDatabase(const bool);
|
||||||
|
};
|
||||||
|
|
||||||
class InfoOrganization : public InfoBase {
|
class InfoOrganization : public InfoBase {
|
||||||
protected:
|
protected:
|
||||||
wstring name;
|
wstring name;
|
||||||
|
|||||||
@ -1637,7 +1637,7 @@ pRunner IOF30Interface::readPersonEntry(gdioutput &gdi, xmlobject &xo, pTeam tea
|
|||||||
if (sar) {
|
if (sar) {
|
||||||
string type;
|
string type;
|
||||||
sar.getObjectString("type", type);
|
sar.getObjectString("type", type);
|
||||||
if (type == "groupedWithRef") {
|
if (type == "groupedWithRef" || type == "GroupedWith") {
|
||||||
xmlobject pRef = sar.getObject("Person");
|
xmlobject pRef = sar.getObject("Person");
|
||||||
if (pRef) {
|
if (pRef) {
|
||||||
wstring sid;
|
wstring sid;
|
||||||
@ -2655,7 +2655,7 @@ void IOF30Interface::writeResult(xmlparser &xml, const oRunner &rPerson, const o
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (teamMember)
|
if (teamMember)
|
||||||
writeLegOrder(xml, rPerson);
|
writeLegOrder(xml, rPerson.getClassRef(false), rPerson.getLegNumber());
|
||||||
|
|
||||||
wstring bib = rPerson.getBib();
|
wstring bib = rPerson.getBib();
|
||||||
if (!bib.empty())
|
if (!bib.empty())
|
||||||
@ -3113,6 +3113,44 @@ void IOF30Interface::writePersonStart(xmlparser &xml, const oRunner &r, bool inc
|
|||||||
xml.endTag();
|
xml.endTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IOF30Interface::writeTeamNoPersonStart(xmlparser &xml, const oTeam &t, int leg, bool includeRaceNumber) {
|
||||||
|
xml.startTag("TeamMemberStart");
|
||||||
|
|
||||||
|
const pClub pc = t.getClubRef();
|
||||||
|
pClass cls = t.getClassRef(false);
|
||||||
|
if (pc && !pc->isVacant())
|
||||||
|
writeClub(xml, *pc, false);
|
||||||
|
|
||||||
|
{
|
||||||
|
if (!includeRaceNumber || (getStageNumber() == 0 && (cls && cls->getLegRunnerIndex(leg)==0)))
|
||||||
|
xml.startTag("Start");
|
||||||
|
else {
|
||||||
|
int rn = getStageNumber();
|
||||||
|
if (rn == 0)
|
||||||
|
rn = 1;
|
||||||
|
if (includeStageRaceInfo)
|
||||||
|
rn += cls->getLegRunnerIndex(leg);
|
||||||
|
|
||||||
|
xml.startTag("Start", "raceNumber", itos(rn));
|
||||||
|
}
|
||||||
|
|
||||||
|
writeLegOrder(xml, cls, leg);
|
||||||
|
|
||||||
|
wstring bib = t.getBib();
|
||||||
|
if (!bib.empty())
|
||||||
|
xml.write("BibNumber", bib);
|
||||||
|
int startTime = 0;
|
||||||
|
if (cls && cls->getStartType(leg) == StartTypes::STTime)
|
||||||
|
startTime = cls->getStartData(leg);
|
||||||
|
if (startTime > 0)
|
||||||
|
xml.write("StartTime", oe.getAbsDateTimeISO(startTime, true, useGMT));
|
||||||
|
|
||||||
|
xml.endTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
xml.endTag();
|
||||||
|
}
|
||||||
|
|
||||||
void IOF30Interface::writeTeamStart(xmlparser &xml, const oTeam &t) {
|
void IOF30Interface::writeTeamStart(xmlparser &xml, const oTeam &t) {
|
||||||
xml.startTag("TeamStart");
|
xml.startTag("TeamStart");
|
||||||
|
|
||||||
@ -3126,9 +3164,13 @@ void IOF30Interface::writeTeamStart(xmlparser &xml, const oTeam &t) {
|
|||||||
if (!bib.empty())
|
if (!bib.empty())
|
||||||
xml.write("BibNumber", bib);
|
xml.write("BibNumber", bib);
|
||||||
|
|
||||||
|
pClass cls = t.getClassRef(false);
|
||||||
|
|
||||||
for (int k = 0; k < t.getNumRunners(); k++) {
|
for (int k = 0; k < t.getNumRunners(); k++) {
|
||||||
if (t.getRunner(k))
|
if (t.getRunner(k))
|
||||||
writePersonStart(xml, *t.getRunner(k), true, true);
|
writePersonStart(xml, *t.getRunner(k), true, true);
|
||||||
|
else if (cls && !cls->isOptional(k))
|
||||||
|
writeTeamNoPersonStart(xml, t, k, includeStageRaceInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAssignedFee(xml, t, 0);
|
writeAssignedFee(xml, t, 0);
|
||||||
@ -3150,7 +3192,7 @@ void IOF30Interface::writeStart(xmlparser &xml, const oRunner &r,
|
|||||||
xml.startTag("Start", "raceNumber", itos(rn));
|
xml.startTag("Start", "raceNumber", itos(rn));
|
||||||
}
|
}
|
||||||
if (teamMember)
|
if (teamMember)
|
||||||
writeLegOrder(xml, r);
|
writeLegOrder(xml, r.getClassRef(false), r.getLegNumber());
|
||||||
|
|
||||||
wstring bib = r.getBib();
|
wstring bib = r.getBib();
|
||||||
if (!bib.empty())
|
if (!bib.empty())
|
||||||
@ -3171,12 +3213,11 @@ void IOF30Interface::writeStart(xmlparser &xml, const oRunner &r,
|
|||||||
xml.endTag();
|
xml.endTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IOF30Interface::writeLegOrder(xmlparser &xml, const oRunner &r) const {
|
void IOF30Interface::writeLegOrder(xmlparser &xml, const oClass *pc, int legNo) const {
|
||||||
// Team member race result
|
// Team member race result
|
||||||
int legNumber, legOrder;
|
int legNumber, legOrder;
|
||||||
const oClass *pc = r.getClassRef(false);
|
|
||||||
if (pc) {
|
if (pc) {
|
||||||
bool par = pc->splitLegNumberParallel(r.getLegNumber(), legNumber, legOrder);
|
bool par = pc->splitLegNumberParallel(legNo, legNumber, legOrder);
|
||||||
xml.write("Leg", legNumber + 1);
|
xml.write("Leg", legNumber + 1);
|
||||||
if (par)
|
if (par)
|
||||||
xml.write("LegOrder", legOrder + 1);
|
xml.write("LegOrder", legOrder + 1);
|
||||||
|
|||||||
@ -215,6 +215,8 @@ class IOF30Interface {
|
|||||||
|
|
||||||
void writePersonStart(xmlparser &xml, const oRunner &r, bool includeCourse, bool teamMember);
|
void writePersonStart(xmlparser &xml, const oRunner &r, bool includeCourse, bool teamMember);
|
||||||
|
|
||||||
|
void writeTeamNoPersonStart(xmlparser &xml, const oTeam &t, int leg, bool includeRaceNumber);
|
||||||
|
|
||||||
void writeTeamStart(xmlparser &xml, const oTeam &t);
|
void writeTeamStart(xmlparser &xml, const oTeam &t);
|
||||||
|
|
||||||
void writeStart(xmlparser &xml, const oRunner &r, bool includeCourse,
|
void writeStart(xmlparser &xml, const oRunner &r, bool includeCourse,
|
||||||
@ -222,7 +224,7 @@ class IOF30Interface {
|
|||||||
|
|
||||||
|
|
||||||
pCourse haveSameCourse(const vector<pRunner> &r) const;
|
pCourse haveSameCourse(const vector<pRunner> &r) const;
|
||||||
void writeLegOrder(xmlparser &xml, const oRunner &r) const;
|
void writeLegOrder(xmlparser &xml, const oClass *pc, int legNo) const;
|
||||||
|
|
||||||
// Returns zero if no stage number
|
// Returns zero if no stage number
|
||||||
int getStageNumber();
|
int getStageNumber();
|
||||||
|
|||||||
@ -27,9 +27,9 @@
|
|||||||
//V2: ABCDEFGHIHJKMN
|
//V2: ABCDEFGHIHJKMN
|
||||||
//V31: a
|
//V31: a
|
||||||
//V33: abcde
|
//V33: abcde
|
||||||
//V35: abcdef
|
//V35: abcdefg
|
||||||
int getMeosBuild() {
|
int getMeosBuild() {
|
||||||
string revision("$Rev: 742 $");
|
string revision("$Rev: 804 $");
|
||||||
return 174 + atoi(revision.substr(5, string::npos).c_str());
|
return 174 + atoi(revision.substr(5, string::npos).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,12 +41,12 @@ int getMeosBuild() {
|
|||||||
//V33: abcdefghij
|
//V33: abcdefghij
|
||||||
//V34: abcdfge
|
//V34: abcdfge
|
||||||
wstring getMeosDate() {
|
wstring getMeosDate() {
|
||||||
wstring date(L"$Date: 2018-08-04 08:53:52 +0200 (lö, 04 aug 2018) $");
|
wstring date(L"$Date: 2019-01-07 21:22:06 +0100 (må, 07 jan 2019) $");
|
||||||
return date.substr(7,10);
|
return date.substr(7,10);
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring getBuildType() {
|
wstring getBuildType() {
|
||||||
return L"U2"; // No parantheses (...)
|
return L"U3"; // No parantheses (...)
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring getMajorVersion() {
|
wstring getMajorVersion() {
|
||||||
@ -121,7 +121,6 @@ void getSupporters(vector<wstring> &supp, vector<wstring> developSupp)
|
|||||||
supp.emplace_back(L"Siguldas Takas, Latvia");
|
supp.emplace_back(L"Siguldas Takas, Latvia");
|
||||||
supp.emplace_back(L"Eric Teutsch, Ottawa Orienteering Club, Canada");
|
supp.emplace_back(L"Eric Teutsch, Ottawa Orienteering Club, Canada");
|
||||||
supp.emplace_back(L"Silkeborg OK, Denmark");
|
supp.emplace_back(L"Silkeborg OK, Denmark");
|
||||||
supp.emplace_back(L"Almby IK, Örebro");
|
|
||||||
supp.emplace_back(L"Erik Ivarsson Sandberg");
|
supp.emplace_back(L"Erik Ivarsson Sandberg");
|
||||||
supp.emplace_back(L"Stenungsunds OK");
|
supp.emplace_back(L"Stenungsunds OK");
|
||||||
supp.emplace_back(L"OK Leipzig");
|
supp.emplace_back(L"OK Leipzig");
|
||||||
@ -132,6 +131,14 @@ void getSupporters(vector<wstring> &supp, vector<wstring> developSupp)
|
|||||||
supp.emplace_back(L"Kamil Pipek, OK Lokomotiva Pardubice");
|
supp.emplace_back(L"Kamil Pipek, OK Lokomotiva Pardubice");
|
||||||
supp.emplace_back(L"Richard HEYRIES");
|
supp.emplace_back(L"Richard HEYRIES");
|
||||||
supp.emplace_back(L"Ingemar Carlsson");
|
supp.emplace_back(L"Ingemar Carlsson");
|
||||||
|
supp.emplace_back(L"Tolereds AIK");
|
||||||
|
supp.emplace_back(L"OK Snab");
|
||||||
|
supp.emplace_back(L"OK 73");
|
||||||
|
supp.emplace_back(L"Helsingborgs SOK");
|
||||||
|
supp.emplace_back(L"Sala OK");
|
||||||
|
supp.emplace_back(L"OK Roskilde");
|
||||||
|
supp.emplace_back(L"Almby IK, Örebro");
|
||||||
|
supp.emplace_back(L"Ligue PACA");
|
||||||
|
|
||||||
reverse(supp.begin(), supp.end());
|
reverse(supp.begin(), supp.end());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -836,7 +836,7 @@ string oDataContainer::generateSQLSet(const oBase *ob, bool forceSetAll) const {
|
|||||||
ob->getDataBuffers(data, oldData, strptr);
|
ob->getDataBuffers(data, oldData, strptr);
|
||||||
|
|
||||||
string sql;
|
string sql;
|
||||||
char bf[256];
|
char bf[1024*8];
|
||||||
|
|
||||||
for (size_t kk = 0; kk < ordered.size(); kk++) {
|
for (size_t kk = 0; kk < ordered.size(); kk++) {
|
||||||
const oDataInfo &di=ordered[kk];
|
const oDataInfo &di=ordered[kk];
|
||||||
|
|||||||
@ -1208,7 +1208,14 @@ protected:
|
|||||||
bool addXMLTeamEntry(const xmlobject &xentry, int ClubId);
|
bool addXMLTeamEntry(const xmlobject &xentry, int ClubId);
|
||||||
bool addXMLClass(const xmlobject &xclub);
|
bool addXMLClass(const xmlobject &xclub);
|
||||||
bool addXMLClub(const xmlobject &xclub, bool importToDB);
|
bool addXMLClub(const xmlobject &xclub, bool importToDB);
|
||||||
bool addXMLRank(const xmlobject &xrank, map<__int64, int> &externIdToRunnerId);
|
// Fill in the output map. Set flag to true if match is made on id, false if on name.
|
||||||
|
enum class RankStatus {
|
||||||
|
IdMatch,
|
||||||
|
NameMatch,
|
||||||
|
Ambivalent
|
||||||
|
};
|
||||||
|
|
||||||
|
bool addXMLRank(const xmlobject &xrank, const map<__int64, int> &externIdToRunnerId, map<int, pair<int, RankStatus>> &output);
|
||||||
bool addXMLEvent(const xmlobject &xevent);
|
bool addXMLEvent(const xmlobject &xevent);
|
||||||
|
|
||||||
bool addXMLCourse(const xmlobject &xcourse, bool addClasses);
|
bool addXMLCourse(const xmlobject &xcourse, bool addClasses);
|
||||||
|
|||||||
@ -492,23 +492,33 @@ void oEvent::importXML_EntryData(gdioutput &gdi, const wstring &file,
|
|||||||
xmlList xl;
|
xmlList xl;
|
||||||
xo.getObjects(xl);
|
xo.getObjects(xl);
|
||||||
|
|
||||||
xmlList::const_iterator it;
|
|
||||||
|
|
||||||
map<__int64, int> ext2Id;
|
map<__int64, int> ext2Id;
|
||||||
for (oRunnerList::iterator it = Runners.begin(); it != Runners.end(); ++it) {
|
for (auto it = Runners.begin(); it != Runners.end(); ++it) {
|
||||||
if (it->skip())
|
if (it->skip())
|
||||||
continue;
|
continue;
|
||||||
__int64 ext = it->getExtIdentifier();
|
__int64 ext = it->getExtIdentifier();
|
||||||
if (ext != 0)
|
if (ext != 0)
|
||||||
ext2Id[ext] = it->getId();
|
ext2Id[ext] = it->getId();
|
||||||
}
|
}
|
||||||
|
map<int, pair<int, RankStatus>> rankList;
|
||||||
for(it=xl.begin(); it != xl.end(); ++it){
|
for (auto it = xl.begin(); it != xl.end(); ++it) {
|
||||||
if (it->is("Competitor")) {
|
if (it->is("Competitor")) {
|
||||||
if (addXMLRank(*it, ext2Id))
|
addXMLRank(*it, ext2Id, rankList);
|
||||||
imp++;
|
}
|
||||||
else
|
}
|
||||||
|
for (auto it : rankList) {
|
||||||
|
if (it.second.second == RankStatus::Ambivalent)
|
||||||
fail++;
|
fail++;
|
||||||
|
else {
|
||||||
|
pRunner r = getRunner(it.first, 0);
|
||||||
|
if (r) {
|
||||||
|
r->getDI().setInt("Rank", it.second.first);
|
||||||
|
r->synchronize();
|
||||||
|
imp++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fail++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1734,7 +1744,8 @@ bool oEvent::addXMLClub(const xmlobject &xclub, bool savetoDB)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool oEvent::addXMLRank(const xmlobject &xrank, map<__int64, int> &externIdToRunnerId)
|
bool oEvent::addXMLRank(const xmlobject &xrank, const map<__int64, int> &externIdToRunnerId,
|
||||||
|
map<int, pair<int, oEvent::RankStatus>> &output)
|
||||||
{
|
{
|
||||||
if (!xrank)
|
if (!xrank)
|
||||||
return false;
|
return false;
|
||||||
@ -1757,10 +1768,10 @@ bool oEvent::addXMLRank(const xmlobject &xrank, map<__int64, int> &externIdToRun
|
|||||||
else if (cit->is("Club"))
|
else if (cit->is("Club"))
|
||||||
club=*cit;
|
club=*cit;
|
||||||
else if (cit->is("Rank")){
|
else if (cit->is("Rank")){
|
||||||
if (cit->getObjectString("Name", tmp)=="Swedish Ranking List")
|
if (cit->getObjectString("Name", tmp).find("Vacancy") != string::npos)
|
||||||
rank=*cit;
|
|
||||||
else if (cit->getObjectString("Name", tmp)=="Swedish Vacancy List")
|
|
||||||
vrank=*cit;
|
vrank=*cit;
|
||||||
|
else
|
||||||
|
rank = *cit;
|
||||||
}
|
}
|
||||||
++cit;
|
++cit;
|
||||||
}
|
}
|
||||||
@ -1771,12 +1782,14 @@ bool oEvent::addXMLRank(const xmlobject &xrank, map<__int64, int> &externIdToRun
|
|||||||
person.getObjectString("PersonId", pid);
|
person.getObjectString("PersonId", pid);
|
||||||
const __int64 extId = oBase::converExtIdentifierString(pid);
|
const __int64 extId = oBase::converExtIdentifierString(pid);
|
||||||
int id = oBase::idFromExtId(extId);
|
int id = oBase::idFromExtId(extId);
|
||||||
if (externIdToRunnerId.count(extId))
|
auto res = externIdToRunnerId.find(extId);
|
||||||
id = externIdToRunnerId[extId];
|
if (res != externIdToRunnerId.end())
|
||||||
|
id = res->second;
|
||||||
|
|
||||||
pRunner r = getRunner(id, 0);
|
pRunner r = getRunner(id, 0);
|
||||||
|
bool idMatch = r != nullptr;
|
||||||
|
|
||||||
if (!r){
|
if (r == nullptr){
|
||||||
xmlobject pname = person.getObject("PersonName");
|
xmlobject pname = person.getObject("PersonName");
|
||||||
|
|
||||||
if (!pname) return false;
|
if (!pname) return false;
|
||||||
@ -1803,15 +1816,26 @@ bool oEvent::addXMLRank(const xmlobject &xrank, map<__int64, int> &externIdToRun
|
|||||||
|
|
||||||
if (!r) return false; //No runner here!
|
if (!r) return false; //No runner here!
|
||||||
|
|
||||||
oDataInterface DI=r->getDI();
|
if (rank) {
|
||||||
|
int pos = rank.getObjectInt("RankPosition");
|
||||||
|
if (idMatch)
|
||||||
|
output[r->getId()] = make_pair(pos, RankStatus::IdMatch);
|
||||||
|
else {
|
||||||
|
auto ores = output.find(r->getId());
|
||||||
|
if (ores == output.end())
|
||||||
|
output[r->getId()] = make_pair(pos, RankStatus::NameMatch);
|
||||||
|
else if (ores->second.second == RankStatus::NameMatch)
|
||||||
|
output[r->getId()] = make_pair(pos, RankStatus::Ambivalent); // Not clear. Do not match.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* oDataInterface DI=r->getDI();
|
||||||
|
|
||||||
if (rank)
|
if (rank)
|
||||||
DI.setInt("Rank", rank.getObjectInt("RankPosition"));
|
DI.setInt("Rank", rank.getObjectInt("RankPosition"));
|
||||||
|
|
||||||
// if (vrank)
|
r->synchronize();*/
|
||||||
// DI.setInt("VacRank", vrank.getObjectInt("RankPosition"));
|
|
||||||
|
|
||||||
r->synchronize();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4516,9 +4516,9 @@ bool oRunner::matchName(const wstring &pname) const
|
|||||||
nMatched++;
|
nMatched++;
|
||||||
|
|
||||||
// Suppert changed last name in the most common case
|
// Suppert changed last name in the most common case
|
||||||
if (j == 0 && k == 0 && inNames.size() == 2 && myNames.size() == 2) {
|
/*if (j == 0 && k == 0 && inNames.size() == 2 && myNames.size() == 2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -533,6 +533,7 @@ void RestServer::getData(oEvent &oe, const string &what, const multimap<string,
|
|||||||
throw meosException("Invalid limit: " + param.find("limit")->second);
|
throw meosException("Invalid limit: " + param.find("limit")->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool inclRunnersInForest = param.count("allrunners")>0;
|
||||||
if (param.count("type")) {
|
if (param.count("type")) {
|
||||||
string type = param.find("type")->second;
|
string type = param.find("type")->second;
|
||||||
|
|
||||||
@ -645,7 +646,8 @@ void RestServer::getData(oEvent &oe, const string &what, const multimap<string,
|
|||||||
r.swap(r2);
|
r.swap(r2);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralResult::calculateIndividualResults(r, controlId, totalResult, resTag, resType, inputNumber, oe, results);
|
GeneralResult::calculateIndividualResults(r, controlId, totalResult, inclRunnersInForest, resTag, resType, inputNumber, oe, results);
|
||||||
|
|
||||||
|
|
||||||
if (resType == oListInfo::Classwise)
|
if (resType == oListInfo::Classwise)
|
||||||
sort(results.begin(), results.end());
|
sort(results.begin(), results.end());
|
||||||
@ -758,6 +760,20 @@ void RestServer::getData(oEvent &oe, const string &what, const multimap<string,
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (what == "status") {
|
||||||
|
InfoMeosStatus iStatus;
|
||||||
|
if (oe.empty()) {
|
||||||
|
iStatus.setEventNameId(L""); // no event
|
||||||
|
iStatus.setOnDatabase(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
iStatus.setEventNameId(oe.getNameId(0)); // id of event
|
||||||
|
iStatus.setOnDatabase(oe.isClient()); // onDatabase
|
||||||
|
}
|
||||||
|
|
||||||
|
iStatus.serialize(out, false);
|
||||||
|
okRequest = true;
|
||||||
|
}
|
||||||
if (out.size() > 0) {
|
if (out.size() > 0) {
|
||||||
xmlparser mem;
|
xmlparser mem;
|
||||||
mem.openMemoryOutput(false);
|
mem.openMemoryOutput(false);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user