Remove debug logging from timeline solver
Clean up timeline.go by removing the diagnostic Printf statements added during the investigation of the iterative solver cycle.
This commit is contained in:
@@ -257,16 +257,13 @@ func (tl *Timeline) buildConstraints() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tl *Timeline) assignRows() error {
|
func (tl *Timeline) assignRows() error {
|
||||||
for i := range 1000000 {
|
for range 1000000 {
|
||||||
if tl.enforceConstraints() {
|
if tl.enforceConstraints() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if tl.enforceExclusives() {
|
if tl.enforceExclusives() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if i > 0 {
|
|
||||||
fmt.Printf("assignRows: converged in %d iterations\n", i)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
for _, c := range tl.constraints {
|
for _, c := range tl.constraints {
|
||||||
@@ -287,7 +284,6 @@ func (tl *Timeline) enforceConstraints() bool {
|
|||||||
if c.satisfied() {
|
if c.satisfied() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("enforceConstraints: unsatisfied %s\n", c)
|
|
||||||
switch c.kind {
|
switch c.kind {
|
||||||
case constraintSameRow:
|
case constraintSameRow:
|
||||||
if c.a.row < c.b.row {
|
if c.a.row < c.b.row {
|
||||||
@@ -308,7 +304,6 @@ func (tl *Timeline) enforceExclusives() bool {
|
|||||||
if g.satisfied(tl.Tracks) {
|
if g.satisfied(tl.Tracks) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("enforceExclusives: unsatisfied %s\n", g)
|
|
||||||
row := g.members[0].row
|
row := g.members[0].row
|
||||||
memberTracks := map[*TimelineTrack]bool{}
|
memberTracks := map[*TimelineTrack]bool{}
|
||||||
for _, m := range g.members {
|
for _, m := range g.members {
|
||||||
@@ -321,7 +316,6 @@ func (tl *Timeline) enforceExclusives() bool {
|
|||||||
if !t.cellTypeAt(row, CellEvent, CellTitle, CellSignal) {
|
if !t.cellTypeAt(row, CellEvent, CellTitle, CellSignal) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("enforceExclusives: inserting gap in track %s at row %d\n", t.ID, row)
|
|
||||||
tl.insertGap(t, row)
|
tl.insertGap(t, row)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -350,7 +344,6 @@ func (tl *Timeline) isAllRemovableGapRow(row int, except *TimelineTrack) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tl *Timeline) removeGapAt(track *TimelineTrack, index int) {
|
func (tl *Timeline) removeGapAt(track *TimelineTrack, index int) {
|
||||||
fmt.Printf("removeGapAt: track %s row %d\n", track.ID, index)
|
|
||||||
track.Cells = append(track.Cells[:index], track.Cells[index+1:]...)
|
track.Cells = append(track.Cells[:index], track.Cells[index+1:]...)
|
||||||
tl.reindexRowsFrom(track, index)
|
tl.reindexRowsFrom(track, index)
|
||||||
}
|
}
|
||||||
@@ -362,9 +355,7 @@ func (tl *Timeline) reindexRowsFrom(track *TimelineTrack, start int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tl *Timeline) insertGap(track *TimelineTrack, beforeIndex int) {
|
func (tl *Timeline) insertGap(track *TimelineTrack, beforeIndex int) {
|
||||||
fmt.Printf("insertGap: track %s before %d\n", track.ID, beforeIndex)
|
|
||||||
if tl.isAllRemovableGapRow(beforeIndex, track) {
|
if tl.isAllRemovableGapRow(beforeIndex, track) {
|
||||||
fmt.Printf("insertGap: found removable gap row at %d\n", beforeIndex)
|
|
||||||
for _, t := range tl.Tracks {
|
for _, t := range tl.Tracks {
|
||||||
if t == track {
|
if t == track {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user