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:
|
||||||
|
|||||||
@ -140,7 +140,7 @@ void GeneralResult::calculateTeamResults(vector<oTeam *> &teams, oListInfo::Resu
|
|||||||
for (size_t k = 0; k < teams.size(); k++) {
|
for (size_t k = 0; k < teams.size(); k++) {
|
||||||
if (resType == oListInfo::Classwise) {
|
if (resType == oListInfo::Classwise) {
|
||||||
teamScore[k].principalSort = teams[k]->Class ? teams[k]->Class->getSortIndex() * 50000
|
teamScore[k].principalSort = teams[k]->Class ? teams[k]->Class->getSortIndex() * 50000
|
||||||
+ teams[k]->Class->getId() : 0;
|
+ teams[k]->Class->getId() : 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
teamScore[k].principalSort = 0;
|
teamScore[k].principalSort = 0;
|
||||||
@ -152,8 +152,8 @@ void GeneralResult::calculateTeamResults(vector<oTeam *> &teams, oListInfo::Resu
|
|||||||
teams[k]->tmpResult.points = deducePoints(*teams[k]);
|
teams[k]->tmpResult.points = deducePoints(*teams[k]);
|
||||||
|
|
||||||
teamScore[k].score = score(*teams[k], teams[k]->tmpResult.status,
|
teamScore[k].score = score(*teams[k], teams[k]->tmpResult.status,
|
||||||
teams[k]->tmpResult.runningTime,
|
teams[k]->tmpResult.runningTime,
|
||||||
teams[k]->tmpResult.points);
|
teams[k]->tmpResult.points);
|
||||||
|
|
||||||
storeOutput(teams[k]->tmpResult.outputTimes,
|
storeOutput(teams[k]->tmpResult.outputTimes,
|
||||||
teams[k]->tmpResult.outputNumbers);
|
teams[k]->tmpResult.outputNumbers);
|
||||||
@ -167,11 +167,11 @@ void GeneralResult::calculateTeamResults(vector<oTeam *> &teams, oListInfo::Resu
|
|||||||
int iPlace = 1;
|
int iPlace = 1;
|
||||||
int leadtime = 0;
|
int leadtime = 0;
|
||||||
for (size_t k = 0; k < teamScore.size(); k++) {
|
for (size_t k = 0; k < teamScore.size(); k++) {
|
||||||
if (k>0 && teamScore[k-1].principalSort != teamScore[k].principalSort) {
|
if (k > 0 && teamScore[k - 1].principalSort != teamScore[k].principalSort) {
|
||||||
place = 1;
|
place = 1;
|
||||||
iPlace = 1;
|
iPlace = 1;
|
||||||
}
|
}
|
||||||
else if (k>0 && teamScore[k-1].score != teamScore[k].score) {
|
else if (k > 0 && teamScore[k - 1].score != teamScore[k].score) {
|
||||||
place = iPlace;
|
place = iPlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ void GeneralResult::sortTeamMembers(vector<oRunner *> &runners) const {
|
|||||||
::sort(runnerScore.begin(), runnerScore.end());
|
::sort(runnerScore.begin(), runnerScore.end());
|
||||||
|
|
||||||
for (size_t k = 0; k < runners.size(); k++) {
|
for (size_t k = 0; k < runners.size(); k++) {
|
||||||
runners[k] = pRunner(runnerScore[k].tr);
|
runners[k] = pRunner(runnerScore[k].tr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ template<class T> void GeneralResult::sort(vector<T *> &rt, SortOrder so) const
|
|||||||
|
|
||||||
vector< pair<int, oAbstractRunner *> > arr(rt.size());
|
vector< pair<int, oAbstractRunner *> > arr(rt.size());
|
||||||
const int maxT = 3600 * 100;
|
const int maxT = 3600 * 100;
|
||||||
for(size_t k = 0; k < rt.size(); k++) {
|
for (size_t k = 0; k < rt.size(); k++) {
|
||||||
arr[k].first = 0;
|
arr[k].first = 0;
|
||||||
if (ps == ClassWise) {
|
if (ps == ClassWise) {
|
||||||
pClass sclass = rt[k]->getClassRef(true);
|
pClass sclass = rt[k]->getClassRef(true);
|
||||||
@ -245,12 +245,12 @@ template<class T> void GeneralResult::sort(vector<T *> &rt, SortOrder so) const
|
|||||||
const oAbstractRunner::TempResult &tr = rt[k]->getTempResult(0);
|
const oAbstractRunner::TempResult &tr = rt[k]->getTempResult(0);
|
||||||
if (so == SortByFinishTime || so == ClassFinishTime) {
|
if (so == SortByFinishTime || so == ClassFinishTime) {
|
||||||
ord = tr.getFinishTime();
|
ord = tr.getFinishTime();
|
||||||
if (ord == 0 || tr.getStatus()>1)
|
if (ord == 0 || tr.getStatus() > 1)
|
||||||
ord = maxT;
|
ord = maxT;
|
||||||
}
|
}
|
||||||
else if (so == SortByFinishTimeReverse) {
|
else if (so == SortByFinishTimeReverse) {
|
||||||
ord = tr.getFinishTime();
|
ord = tr.getFinishTime();
|
||||||
if (ord == 0 || tr.getStatus()>1)
|
if (ord == 0 || tr.getStatus() > 1)
|
||||||
ord = maxT;
|
ord = maxT;
|
||||||
else
|
else
|
||||||
ord = maxT - ord;
|
ord = maxT - ord;
|
||||||
@ -265,7 +265,7 @@ template<class T> void GeneralResult::sort(vector<T *> &rt, SortOrder so) const
|
|||||||
|
|
||||||
stable_sort(arr.begin(), arr.end());
|
stable_sort(arr.begin(), arr.end());
|
||||||
|
|
||||||
for(size_t k = 0; k < rt.size(); k++) {
|
for (size_t k = 0; k < rt.size(); k++) {
|
||||||
rt[k] = (T*)arr[k].second;
|
rt[k] = (T*)arr[k].second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -284,11 +284,11 @@ void GeneralResult::calculateIndividualResults(vector<oRunner *> &runners,
|
|||||||
const oRunner *r = runners[k];
|
const oRunner *r = runners[k];
|
||||||
if (resType == oListInfo::Classwise) {
|
if (resType == oListInfo::Classwise) {
|
||||||
runnerScore[k].principalSort = r->Class ? r->Class->getSortIndex() * 50000
|
runnerScore[k].principalSort = r->Class ? r->Class->getSortIndex() * 50000
|
||||||
+ r->Class->getId() : 0;
|
+ r->Class->getId() : 0;
|
||||||
}
|
}
|
||||||
else if (resType == oListInfo::Legwise) {
|
else if (resType == oListInfo::Legwise) {
|
||||||
runnerScore[k].principalSort = r->Class ? r->Class->getSortIndex() * 50000
|
runnerScore[k].principalSort = r->Class ? r->Class->getSortIndex() * 50000
|
||||||
+ r->Class->getId() : 0;
|
+ r->Class->getId() : 0;
|
||||||
|
|
||||||
int ln = r->getLegNumber();
|
int ln = r->getLegNumber();
|
||||||
const oTeam *pt = r->getTeam();
|
const oTeam *pt = r->getTeam();
|
||||||
@ -327,8 +327,8 @@ void GeneralResult::calculateIndividualResults(vector<oRunner *> &runners,
|
|||||||
runners[k]->tmpResult.points = deducePoints(*runners[k]);
|
runners[k]->tmpResult.points = deducePoints(*runners[k]);
|
||||||
|
|
||||||
runnerScore[k].score = score(*runners[k], runners[k]->tmpResult.status,
|
runnerScore[k].score = score(*runners[k], runners[k]->tmpResult.status,
|
||||||
runners[k]->tmpResult.runningTime,
|
runners[k]->tmpResult.runningTime,
|
||||||
runners[k]->tmpResult.points, false);
|
runners[k]->tmpResult.points, false);
|
||||||
|
|
||||||
storeOutput(runners[k]->tmpResult.outputTimes,
|
storeOutput(runners[k]->tmpResult.outputTimes,
|
||||||
runners[k]->tmpResult.outputNumbers);
|
runners[k]->tmpResult.outputNumbers);
|
||||||
@ -342,11 +342,11 @@ void GeneralResult::calculateIndividualResults(vector<oRunner *> &runners,
|
|||||||
int iPlace = 1;
|
int iPlace = 1;
|
||||||
int leadtime = 0;
|
int leadtime = 0;
|
||||||
for (size_t k = 0; k < runnerScore.size(); k++) {
|
for (size_t k = 0; k < runnerScore.size(); k++) {
|
||||||
if (k>0 && runnerScore[k-1].principalSort != runnerScore[k].principalSort) {
|
if (k > 0 && runnerScore[k - 1].principalSort != runnerScore[k].principalSort) {
|
||||||
place = 1;
|
place = 1;
|
||||||
iPlace = 1;
|
iPlace = 1;
|
||||||
}
|
}
|
||||||
else if (k>0 && runnerScore[k-1].score != runnerScore[k].score) {
|
else if (k > 0 && runnerScore[k - 1].score != runnerScore[k].score) {
|
||||||
place = iPlace;
|
place = iPlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +389,8 @@ void GeneralResult::prepareCalculations(oTeam &team) const {
|
|||||||
r->tmpResult.timeAfter = 0;//XXX?
|
r->tmpResult.timeAfter = 0;//XXX?
|
||||||
r->tmpResult.points = deducePoints(*r);
|
r->tmpResult.points = deducePoints(*r);
|
||||||
r->tmpResult.internalScore = score(*r, r->tmpResult.status,
|
r->tmpResult.internalScore = score(*r, r->tmpResult.status,
|
||||||
r->tmpResult.runningTime,
|
r->tmpResult.runningTime,
|
||||||
r->tmpResult.points, true);
|
r->tmpResult.points, true);
|
||||||
|
|
||||||
storeOutput(r->tmpResult.outputTimes,
|
storeOutput(r->tmpResult.outputTimes,
|
||||||
r->tmpResult.outputNumbers);
|
r->tmpResult.outputNumbers);
|
||||||
@ -400,9 +400,9 @@ void GeneralResult::prepareCalculations(oTeam &team) const {
|
|||||||
|
|
||||||
void GeneralResult::prepareCalculations(oRunner &runner) const {
|
void GeneralResult::prepareCalculations(oRunner &runner) const {
|
||||||
int from = getListParamTimeFromControl();
|
int from = getListParamTimeFromControl();
|
||||||
runner.tmpResult.startTime = runner.getStartTime();
|
runner.tmpResult.startTime = runner.getStartTime();
|
||||||
|
|
||||||
if (from>0) {
|
if (from > 0) {
|
||||||
int rt;
|
int rt;
|
||||||
RunnerStatus stat;
|
RunnerStatus stat;
|
||||||
runner.getSplitTime(from, stat, rt);
|
runner.getSplitTime(from, stat, rt);
|
||||||
@ -415,7 +415,7 @@ void GeneralResult::storeOutput(vector<int> ×, vector<int> &numbers) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
int GeneralResult::score(oTeam &team, RunnerStatus st, int rt, int points) const {
|
int GeneralResult::score(oTeam &team, RunnerStatus st, int rt, int points) const {
|
||||||
return (100*RunnerStatusOrderMap[st] + team.getNumShortening()) * 900000 + rt;
|
return (100 * RunnerStatusOrderMap[st] + team.getNumShortening()) * 900000 + rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunnerStatus GeneralResult::deduceStatus(oTeam &team) const {
|
RunnerStatus GeneralResult::deduceStatus(oTeam &team) const {
|
||||||
@ -435,7 +435,7 @@ int GeneralResult::score(oRunner &runner, RunnerStatus st, int time, int points,
|
|||||||
return runner.getLegNumber();
|
return runner.getLegNumber();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (RunnerStatusOrderMap[st]*100 + runner.getNumShortening()) * 900000 + time;
|
return (RunnerStatusOrderMap[st] * 100 + runner.getNumShortening()) * 900000 + time;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunnerStatus GeneralResult::deduceStatus(oRunner &runner) const {
|
RunnerStatus GeneralResult::deduceStatus(oRunner &runner) const {
|
||||||
@ -485,14 +485,14 @@ RunnerStatus TotalResultAtControl::deduceStatus(oRunner &runner) const {
|
|||||||
if (runner.getTeam() && getListParamTimeFromControl() <= 0) {
|
if (runner.getTeam() && getListParamTimeFromControl() <= 0) {
|
||||||
// Only use input time when start time is used
|
// Only use input time when start time is used
|
||||||
const pTeam t = runner.getTeam();
|
const pTeam t = runner.getTeam();
|
||||||
if (runner.getLegNumber()>0 && t->getClassRef(false)) {
|
if (runner.getLegNumber() > 0 && t->getClassRef(false)) {
|
||||||
// Find base leg
|
// Find base leg
|
||||||
int legIx = runner.getLegNumber();
|
int legIx = runner.getLegNumber();
|
||||||
const pClass cls = t->getClassRef(false);
|
const pClass cls = t->getClassRef(false);
|
||||||
while (legIx > 0 && (cls->isParallel(legIx) || cls->isOptional(legIx)))
|
while (legIx > 0 && (cls->isParallel(legIx) || cls->isOptional(legIx)))
|
||||||
legIx--;
|
legIx--;
|
||||||
if (legIx > 0)
|
if (legIx > 0)
|
||||||
inputStatus = t->getLegStatus(legIx-1, true);
|
inputStatus = t->getLegStatus(legIx - 1, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
inputStatus = t->getInputStatus();
|
inputStatus = t->getInputStatus();
|
||||||
@ -515,14 +515,14 @@ int TotalResultAtControl::deduceTime(oRunner &runner, int startTime) const {
|
|||||||
if (runner.getTeam() && getListParamTimeFromControl() <= 0) {
|
if (runner.getTeam() && getListParamTimeFromControl() <= 0) {
|
||||||
// Only use input time when start time is used
|
// Only use input time when start time is used
|
||||||
const pTeam t = runner.getTeam();
|
const pTeam t = runner.getTeam();
|
||||||
if (runner.getLegNumber()>0 && t->getClassRef(false)) {
|
if (runner.getLegNumber() > 0 && t->getClassRef(false)) {
|
||||||
// Find base leg
|
// Find base leg
|
||||||
int legIx = runner.getLegNumber();
|
int legIx = runner.getLegNumber();
|
||||||
const pClass cls = t->getClassRef(false);
|
const pClass cls = t->getClassRef(false);
|
||||||
while (legIx > 0 && (cls->isParallel(legIx) || cls->isOptional(legIx)))
|
while (legIx > 0 && (cls->isParallel(legIx) || cls->isOptional(legIx)))
|
||||||
legIx--;
|
legIx--;
|
||||||
if (legIx > 0)
|
if (legIx > 0)
|
||||||
inputTime = t->getLegRunningTime(legIx-1, true);
|
inputTime = t->getLegRunningTime(legIx - 1, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
inputTime = t->getInputTime();
|
inputTime = t->getInputTime();
|
||||||
@ -543,8 +543,8 @@ int TotalResultAtControl::score(oRunner &runner, RunnerStatus st, int time, int
|
|||||||
|
|
||||||
if (runner.getTeam()) {
|
if (runner.getTeam()) {
|
||||||
const pTeam t = runner.getTeam();
|
const pTeam t = runner.getTeam();
|
||||||
if (runner.getLegNumber()>0) {
|
if (runner.getLegNumber() > 0) {
|
||||||
inputStatus = t->getLegStatus(runner.getLegNumber()-1, true);
|
inputStatus = t->getLegStatus(runner.getLegNumber() - 1, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
inputStatus = t->getInputStatus();
|
inputStatus = t->getInputStatus();
|
||||||
@ -760,15 +760,15 @@ int DynamicResult::deducePoints(oTeam &team) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DynamicResult::score(oRunner &runner, RunnerStatus st, int time, int points, bool asTeamMember) const {
|
int DynamicResult::score(oRunner &runner, RunnerStatus st, int time, int points, bool asTeamMember) const {
|
||||||
if (getMethod(MRScore)) {
|
if (getMethod(MRScore)) {
|
||||||
parser.addSymbol("ComputedTime", time);
|
parser.addSymbol("ComputedTime", time);
|
||||||
parser.addSymbol("ComputedStatus", st);
|
parser.addSymbol("ComputedStatus", st);
|
||||||
parser.addSymbol("ComputedPoints", points);
|
parser.addSymbol("ComputedPoints", points);
|
||||||
return getMethod(MRScore)->evaluate(parser);
|
return getMethod(MRScore)->evaluate(parser);
|
||||||
}
|
}
|
||||||
else if (getMethodSource(MRScore).empty())
|
else if (getMethodSource(MRScore).empty())
|
||||||
return GeneralResult::score(runner, st, time, points, asTeamMember);
|
return GeneralResult::score(runner, st, time, points, asTeamMember);
|
||||||
else throw meosException("Syntax error");
|
else throw meosException("Syntax error");
|
||||||
}
|
}
|
||||||
|
|
||||||
RunnerStatus DynamicResult::deduceStatus(oRunner &runner) const {
|
RunnerStatus DynamicResult::deduceStatus(oRunner &runner) const {
|
||||||
@ -780,7 +780,7 @@ RunnerStatus DynamicResult::deduceStatus(oRunner &runner) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DynamicResult::deduceTime(oRunner &runner, int startTime) const {
|
int DynamicResult::deduceTime(oRunner &runner, int startTime) const {
|
||||||
if (getMethod(MDeduceRTime))
|
if (getMethod(MDeduceRTime))
|
||||||
return getMethod(MDeduceRTime)->evaluate(parser);
|
return getMethod(MDeduceRTime)->evaluate(parser);
|
||||||
else if (getMethodSource(MDeduceRTime).empty())
|
else if (getMethodSource(MDeduceRTime).empty())
|
||||||
return GeneralResult::deduceTime(runner, startTime);
|
return GeneralResult::deduceTime(runner, startTime);
|
||||||
@ -788,7 +788,7 @@ int DynamicResult::deduceTime(oRunner &runner, int startTime) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DynamicResult::deducePoints(oRunner &runner) const {
|
int DynamicResult::deducePoints(oRunner &runner) const {
|
||||||
if (getMethod(MDeduceRPoints))
|
if (getMethod(MDeduceRPoints))
|
||||||
return getMethod(MDeduceRPoints)->evaluate(parser);
|
return getMethod(MDeduceRPoints)->evaluate(parser);
|
||||||
else if (getMethodSource(MDeduceRPoints).empty())
|
else if (getMethodSource(MDeduceRPoints).empty())
|
||||||
return GeneralResult::deducePoints(runner);
|
return GeneralResult::deducePoints(runner);
|
||||||
@ -814,14 +814,14 @@ void DynamicResult::save(xmlparser &xml) const {
|
|||||||
origin = gEvent->getName() + L" (" + getLocalDate() + L")";
|
origin = gEvent->getName() + L" (" + getLocalDate() + L")";
|
||||||
xml.write("Origin", origin);
|
xml.write("Origin", origin);
|
||||||
xml.write("Date", getLocalTime());
|
xml.write("Date", getLocalTime());
|
||||||
// xml.write("Tag", tag);
|
// xml.write("Tag", tag);
|
||||||
// xml.write("UID", getUniqueId());
|
// xml.write("UID", getUniqueId());
|
||||||
|
|
||||||
for (map<string, DynamicMethods>::const_iterator it = symb2Method.begin(); it != symb2Method.end(); ++it) {
|
for (map<string, DynamicMethods>::const_iterator it = symb2Method.begin(); it != symb2Method.end(); ++it) {
|
||||||
if (!methods[it->second].source.empty()) {
|
if (!methods[it->second].source.empty()) {
|
||||||
xml.startTag("Rule", "name", it->first);
|
xml.startTag("Rule", "name", it->first);
|
||||||
xml.write("Description", methods[it->second].description);
|
xml.write("Description", methods[it->second].description);
|
||||||
xml.write("Method", methods[it->second].source);
|
xml.write("Method", methods[it->second].source);
|
||||||
xml.endTag();
|
xml.endTag();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -911,9 +911,9 @@ void DynamicResult::declareSymbols(DynamicMethods m, bool clear) const {
|
|||||||
if (clear)
|
if (clear)
|
||||||
parser.clearSymbols();
|
parser.clearSymbols();
|
||||||
const bool isRunner = m == MRScore ||
|
const bool isRunner = m == MRScore ||
|
||||||
m == MDeduceRPoints ||
|
m == MDeduceRPoints ||
|
||||||
m == MDeduceRStatus ||
|
m == MDeduceRStatus ||
|
||||||
m == MDeduceRTime;
|
m == MDeduceRTime;
|
||||||
|
|
||||||
parser.declareSymbol("Status", "Runner/team status", false);
|
parser.declareSymbol("Status", "Runner/team status", false);
|
||||||
parser.declareSymbol("Start", "Runner/team start time", false);
|
parser.declareSymbol("Start", "Runner/team start time", false);
|
||||||
@ -1047,9 +1047,9 @@ void DynamicResult::prepareCalculations(oEvent &oe, bool prepareForTeam, int inp
|
|||||||
|
|
||||||
void DynamicResult::prepareCommon(oAbstractRunner &runner) const {
|
void DynamicResult::prepareCommon(oAbstractRunner &runner) const {
|
||||||
parser.clearVariables();
|
parser.clearVariables();
|
||||||
int st = runner.getStatus();
|
int st = runner.getStatus();
|
||||||
int ft = runner.getFinishTime();
|
int ft = runner.getFinishTime();
|
||||||
if (st == StatusUnknown && ft>0)
|
if (st == StatusUnknown && ft > 0)
|
||||||
st = StatusOK;
|
st = StatusOK;
|
||||||
parser.addSymbol("Status", st);
|
parser.addSymbol("Status", st);
|
||||||
parser.addSymbol("Start", runner.getStartTime());
|
parser.addSymbol("Start", runner.getStartTime());
|
||||||
@ -1148,7 +1148,7 @@ void DynamicResult::prepareCalculations(oTeam &team) const {
|
|||||||
|
|
||||||
pClass cls = team.getClassRef(true);
|
pClass cls = team.getClassRef(true);
|
||||||
if (cls) {
|
if (cls) {
|
||||||
int nl = max<int>(1, cls->getNumStages()-1);
|
int nl = max<int>(1, cls->getNumStages() - 1);
|
||||||
parser.addSymbol("ShortestClassTime", cls->getTotalLegLeaderTime(nl, false));
|
parser.addSymbol("ShortestClassTime", cls->getTotalLegLeaderTime(nl, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1183,7 +1183,7 @@ void DynamicResult::prepareCalculations(oRunner &runner) const {
|
|||||||
|
|
||||||
pTeam t = runner.getTeam();
|
pTeam t = runner.getTeam();
|
||||||
if (t) {
|
if (t) {
|
||||||
int leg = runner.getLegNumber();
|
int leg = runner.getLegNumber();
|
||||||
t->setResultCache(oTeam::RCCCardTimes, leg, times);
|
t->setResultCache(oTeam::RCCCardTimes, leg, times);
|
||||||
t->setResultCache(oTeam::RCCCardPunches, leg, codes);
|
t->setResultCache(oTeam::RCCCardPunches, leg, codes);
|
||||||
t->setResultCache(oTeam::RCCCardControls, leg, controls);
|
t->setResultCache(oTeam::RCCCardControls, leg, controls);
|
||||||
@ -1214,12 +1214,12 @@ void DynamicResult::prepareCalculations(oRunner &runner) const {
|
|||||||
eCrs.push_back(ctrl->getFirstNumber());
|
eCrs.push_back(ctrl->getFirstNumber());
|
||||||
if (size_t(k) < sp.size()) {
|
if (size_t(k) < sp.size()) {
|
||||||
if (sp[k].status == SplitData::OK) {
|
if (sp[k].status == SplitData::OK) {
|
||||||
eAccTime.push_back(sp[k].time-start);
|
eAccTime.push_back(sp[k].time - start);
|
||||||
eSplitTime.push_back(sp[k].time-st);
|
eSplitTime.push_back(sp[k].time - st);
|
||||||
st = sp[k].time;
|
st = sp[k].time;
|
||||||
}
|
}
|
||||||
else if (sp[k].status == SplitData::NoTime) {
|
else if (sp[k].status == SplitData::NoTime) {
|
||||||
eAccTime.push_back(st-start);
|
eAccTime.push_back(st - start);
|
||||||
eSplitTime.push_back(0);
|
eSplitTime.push_back(0);
|
||||||
}
|
}
|
||||||
else if (sp[k].status == SplitData::Missing) {
|
else if (sp[k].status == SplitData::Missing) {
|
||||||
@ -1230,8 +1230,8 @@ void DynamicResult::prepareCalculations(oRunner &runner) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (runner.getFinishTime() > 0) {
|
if (runner.getFinishTime() > 0) {
|
||||||
eAccTime.push_back(runner.getFinishTime()-start);
|
eAccTime.push_back(runner.getFinishTime() - start);
|
||||||
eSplitTime.push_back(runner.getFinishTime()-st);
|
eSplitTime.push_back(runner.getFinishTime() - st);
|
||||||
}
|
}
|
||||||
else if (!eAccTime.empty()) {
|
else if (!eAccTime.empty()) {
|
||||||
eAccTime.push_back(0);
|
eAccTime.push_back(0);
|
||||||
@ -1245,7 +1245,7 @@ void DynamicResult::prepareCalculations(oRunner &runner) const {
|
|||||||
parser.addSymbol("SplitTimesAccumulated", eAccTime);
|
parser.addSymbol("SplitTimesAccumulated", eAccTime);
|
||||||
pTeam t = runner.getTeam();
|
pTeam t = runner.getTeam();
|
||||||
if (t) {
|
if (t) {
|
||||||
int leg = runner.getLegNumber();
|
int leg = runner.getLegNumber();
|
||||||
t->setResultCache(oTeam::RCCCourse, leg, eCrs);
|
t->setResultCache(oTeam::RCCCourse, leg, eCrs);
|
||||||
t->setResultCache(oTeam::RCCSplitTime, leg, eSplitTime);
|
t->setResultCache(oTeam::RCCSplitTime, leg, eSplitTime);
|
||||||
}
|
}
|
||||||
@ -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,9 +1348,18 @@ 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) {
|
||||||
continue;
|
if (!inclForestRunners)
|
||||||
ri.status = StatusOK; // Preliminary status
|
continue;
|
||||||
|
else {
|
||||||
|
if (r->getClubId() == cVacantId)
|
||||||
|
continue;
|
||||||
|
ri.status = StatusUnknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ri.status = StatusOK; // Preliminary status
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ri.status == StatusOK)
|
if (ri.status == StatusOK)
|
||||||
ri.place = r->getPlace();
|
ri.place = r->getPlace();
|
||||||
@ -1367,9 +1377,18 @@ 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) {
|
||||||
continue;
|
if (!inclForestRunners)
|
||||||
ri.status = StatusOK; // Preliminary status
|
continue;
|
||||||
|
else {
|
||||||
|
if (r->getClubId() == cVacantId)
|
||||||
|
continue;
|
||||||
|
ri.status = StatusUnknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ri.status = StatusOK; // Preliminary status
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ri.status == StatusOK)
|
if (ri.status == StatusOK)
|
||||||
ri.place = r->getTotalPlace();
|
ri.place = r->getTotalPlace();
|
||||||
@ -1421,7 +1440,7 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
gResult = &oe.getGeneralResult(resTag, srcDMY);
|
gResult = &oe.getGeneralResult(resTag, srcDMY);
|
||||||
else {
|
else {
|
||||||
if (controlId.second == oPunch::PunchFinish &&
|
if (controlId.second == oPunch::PunchFinish &&
|
||||||
controlId.first == oPunch::PunchStart && !totalResults)
|
controlId.first == oPunch::PunchStart && !totalResults)
|
||||||
specialInstance = make_shared<GeneralResult>();
|
specialInstance = make_shared<GeneralResult>();
|
||||||
else if (!totalResults)
|
else if (!totalResults)
|
||||||
specialInstance = make_shared<ResultAtControl>();
|
specialInstance = make_shared<ResultAtControl>();
|
||||||
@ -1439,9 +1458,12 @@ 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) {
|
||||||
continue;
|
if (!inclForestRunners)
|
||||||
ri.status = StatusOK; // Preliminary status
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ri.status = StatusOK; // Preliminary status
|
||||||
}
|
}
|
||||||
if (ri.status == StatusOK)
|
if (ri.status == StatusOK)
|
||||||
ri.place = tmp.getPlace();
|
ri.place = tmp.getPlace();
|
||||||
@ -1449,8 +1471,9 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
ri.place = 0;
|
ri.place = 0;
|
||||||
|
|
||||||
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) {
|
||||||
continue;
|
if (!inclForestRunners)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ri.score = tmp.getPoints();
|
ri.score = tmp.getPoints();
|
||||||
@ -1467,15 +1490,15 @@ void GeneralResult::calculateIndividualResults(vector<pRunner> &runners,
|
|||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<GeneralResult::BaseResultContext>
|
shared_ptr<GeneralResult::BaseResultContext>
|
||||||
GeneralResult::calculateTeamResults(vector<pTeam> &teams,
|
GeneralResult::calculateTeamResults(vector<pTeam> &teams,
|
||||||
int leg,
|
int leg,
|
||||||
const pair<int, int> &controlId,
|
const pair<int, int> &controlId,
|
||||||
bool totalResults,
|
bool totalResults,
|
||||||
const string &resTag,
|
const string &resTag,
|
||||||
oListInfo::ResultType resType,
|
oListInfo::ResultType resType,
|
||||||
int inputNumber,
|
int inputNumber,
|
||||||
oEvent &oe,
|
oEvent &oe,
|
||||||
vector<GeneralResultInfo> &results) {
|
vector<GeneralResultInfo> &results) {
|
||||||
shared_ptr<BaseResultContext> out = make_shared<BaseResultContext>();
|
shared_ptr<BaseResultContext> out = make_shared<BaseResultContext>();
|
||||||
out->leg = leg;
|
out->leg = leg;
|
||||||
out->controlId = controlId;
|
out->controlId = controlId;
|
||||||
@ -1572,7 +1595,7 @@ int GeneralResult::GeneralResultInfo::getNumSubresult(const BaseResultContext &c
|
|||||||
if (nb == -1)
|
if (nb == -1)
|
||||||
nb = cls->getNumStages();
|
nb = cls->getNumStages();
|
||||||
|
|
||||||
int pb = cls->getPreceedingLeg(leg)+1;
|
int pb = cls->getPreceedingLeg(leg) + 1;
|
||||||
|
|
||||||
context.resIntervalCache[cid] = make_pair(pb, nb);
|
context.resIntervalCache[cid] = make_pair(pb, nb);
|
||||||
return nb - pb;
|
return nb - pb;
|
||||||
|
|||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (auto it : rankList) {
|
||||||
|
if (it.second.second == RankStatus::Ambivalent)
|
||||||
|
fail++;
|
||||||
|
else {
|
||||||
|
pRunner r = getRunner(it.first, 0);
|
||||||
|
if (r) {
|
||||||
|
r->getDI().setInt("Rank", it.second.first);
|
||||||
|
r->synchronize();
|
||||||
imp++;
|
imp++;
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
fail++;
|
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