mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 14:33:28 +02:00
Fixed regression in scheduler when using two schedule codes.
This commit is contained in:
parent
b0e92a7899
commit
bdc006e924
@ -18632,3 +18632,5 @@
|
||||
2019-05-01 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed bugs in the 'Import' Web API call that caused import of
|
||||
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
|
||||
if(event_have_code!=""||event_have_code2!="") {
|
||||
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++) {
|
||||
if(!schedCL->itemHasCodes(counter,codes)) {
|
||||
schedCL->removeItem(counter);
|
||||
@ -890,8 +895,7 @@ bool RDEventLine::generateLog(QString logname,const QString &svcname,
|
||||
//
|
||||
// Pick a random cart from those that are remaining.
|
||||
//
|
||||
int r=rand();
|
||||
int schedpos=r%schedCL->getNumberOfItems();
|
||||
int schedpos=rand()%schedCL->getNumberOfItems();
|
||||
sql=QString("insert into LOG_LINES set ")+
|
||||
"LOG_NAME=\""+RDEscapeString(logname)+"\","+
|
||||
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)
|
||||
{
|
||||
int matches=0;
|
||||
|
||||
for(int i=0;i<test_codes.size();i++) {
|
||||
if(itemHasCode(itemnumber,test_codes.at(i))) {
|
||||
return true;
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return(matches==test_codes.size());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user