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(){
// 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
// Assume this slot is first one available
@ -2120,14 +2120,29 @@ export default {
// Determine last free slot following this one in the layer
for(let i = this.slotindex + 1; i <= this.page.periods; i++){
if(this.line.slots && this.line.slots[i] && this.line.slots[i].courses){
const l = this.line.slots[i].courses;
const f = this.line.slots[i-1].filters; // next filter is in the same slot
if(l[this.layer] || f[this.layer]) {
// slot is busy in this layer.
break;
} else {
freeIndex = i;
const clist = this.line.slots[i].courses;
const flist = this.line.slots[i-1].filters; // next filter is in the same slot
let busy = false;
for(const ix in clist) {
if( clist[ix].layer == this.layer) {
busy = true; // slot is busy in this layer.
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 {
break; // stop processing
}