mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-30 17:20:32 +01:00
Fixed regression in scheduler when using two schedule codes.
This commit is contained in:
@@ -18632,3 +18632,5 @@
|
|||||||
2019-05-01 Fred Gleason <fredg@paravelsystems.com>
|
2019-05-01 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed bugs in the 'Import' Web API call that caused import of
|
* Fixed bugs in the 'Import' Web API call that caused import of
|
||||||
filenames containing multibyte UTF-8 characters to fail.
|
filenames containing multibyte UTF-8 characters to fail.
|
||||||
|
2019-05-02 Patrick Linstruth <patrick@deltecent.com>
|
||||||
|
* Fixed regression in scheduler when using two schedule codes.
|
||||||
|
|||||||
@@ -656,7 +656,12 @@ bool RDEventLine::generateLog(QString logname,const QString &svcname,
|
|||||||
// Reduce schedCL to match requested scheduler code
|
// Reduce schedCL to match requested scheduler code
|
||||||
if(event_have_code!=""||event_have_code2!="") {
|
if(event_have_code!=""||event_have_code2!="") {
|
||||||
QStringList codes;
|
QStringList codes;
|
||||||
codes << event_have_code << event_have_code2;
|
if(event_have_code!="") {
|
||||||
|
codes << event_have_code;
|
||||||
|
}
|
||||||
|
if(event_have_code2!="") {
|
||||||
|
codes << event_have_code2;
|
||||||
|
}
|
||||||
for(counter=0;counter<schedCL->getNumberOfItems();counter++) {
|
for(counter=0;counter<schedCL->getNumberOfItems();counter++) {
|
||||||
if(!schedCL->itemHasCodes(counter,codes)) {
|
if(!schedCL->itemHasCodes(counter,codes)) {
|
||||||
schedCL->removeItem(counter);
|
schedCL->removeItem(counter);
|
||||||
@@ -890,8 +895,7 @@ bool RDEventLine::generateLog(QString logname,const QString &svcname,
|
|||||||
//
|
//
|
||||||
// Pick a random cart from those that are remaining.
|
// Pick a random cart from those that are remaining.
|
||||||
//
|
//
|
||||||
int r=rand();
|
int schedpos=rand()%schedCL->getNumberOfItems();
|
||||||
int schedpos=r%schedCL->getNumberOfItems();
|
|
||||||
sql=QString("insert into LOG_LINES set ")+
|
sql=QString("insert into LOG_LINES set ")+
|
||||||
"LOG_NAME=\""+RDEscapeString(logname)+"\","+
|
"LOG_NAME=\""+RDEscapeString(logname)+"\","+
|
||||||
QString().sprintf("LINE_ID=%d,",count)+
|
QString().sprintf("LINE_ID=%d,",count)+
|
||||||
|
|||||||
@@ -74,12 +74,14 @@ bool RDSchedCartList::itemHasCode(int itemnumber,const QString &test_code)
|
|||||||
|
|
||||||
bool RDSchedCartList::itemHasCodes(int itemnumber,const QStringList &test_codes)
|
bool RDSchedCartList::itemHasCodes(int itemnumber,const QStringList &test_codes)
|
||||||
{
|
{
|
||||||
|
int matches=0;
|
||||||
|
|
||||||
for(int i=0;i<test_codes.size();i++) {
|
for(int i=0;i<test_codes.size();i++) {
|
||||||
if(itemHasCode(itemnumber,test_codes.at(i))) {
|
if(itemHasCode(itemnumber,test_codes.at(i))) {
|
||||||
return true;
|
matches++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return(matches==test_codes.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user