Bugfix in course span selector

This commit is contained in:
PMKuipers 2023-08-31 21:10:30 +02:00
parent ee7e3ba61e
commit 213ad3703e
3 changed files with 25 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2112,7 +2112,7 @@ export default {
}, },
maxSpan(){ maxSpan(){
// Determine the maximum span for components in this slot // Determine the maximum span for components in this slot
// Used for setting the max in the timing adjustment screen (s) // Used for setting the max in the timing adjustment screen(s)
// And for checking the filter types // And for checking the filter types
// Assume this slot is first one available // Assume this slot is first one available
@ -2120,14 +2120,29 @@ export default {
// Determine last free slot following this one in the layer // Determine last free slot following this one in the layer
for(let i = this.slotindex + 1; i <= this.page.periods; i++){ for(let i = this.slotindex + 1; i <= this.page.periods; i++){
if(this.line.slots && this.line.slots[i] && this.line.slots[i].courses){ if(this.line.slots && this.line.slots[i] && this.line.slots[i].courses){
const l = this.line.slots[i].courses; const clist = this.line.slots[i].courses;
const f = this.line.slots[i-1].filters; // next filter is in the same slot const flist = this.line.slots[i-1].filters; // next filter is in the same slot
if(l[this.layer] || f[this.layer]) { let busy = false;
// slot is busy in this layer. for(const ix in clist) {
break; if( clist[ix].layer == this.layer) {
} else { busy = true; // slot is busy in this layer.
freeIndex = i; break;
}
} }
for(const ix in flist) {
if( flist[ix].layer == this.layer) {
busy = true; // slot is busy in this layer.
break;
}
}
if(! busy) {
// slot is free in this layer
freeIndex = i;
} else {
break; // stop checking next slots
}
} else { } else {
break; // stop processing break; // stop processing
} }