Skip to content

Commit

Permalink
feat(debugger): Make the change reactor be inside the reactor state w…
Browse files Browse the repository at this point in the history
…idget

This looks much nicer so why not?
  • Loading branch information
symbiont-daniel-gustafsson committed Apr 7, 2021
1 parent a702e7c commit 9244b7f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/debugger/cmd/detsys-debug/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func main() {

da := MakeDebugApplication(lib.TestId{testId}, lib.RunId{runId})

textView.SetBorderPadding(1, 1, 2, 0).SetBorder(true).SetTitle("Reactor State")
messageView.SetBorderPadding(1, 1, 2, 0).SetBorder(true).SetTitle("Current Message")
diagram.SetBorderPadding(1, 1, 2, 0).SetBorder(true).SetTitle("Sequence Diagram")
logView.SetBorderPadding(1, 1, 2, 0).SetBorder(true).SetTitle("Reactor Log")
Expand Down Expand Up @@ -217,9 +216,14 @@ func main() {
da.redraw()
})

longestReactor := 0
for i, c := range da.reactors {
theRune := ' '

if len(c) > longestReactor {
longestReactor = len(c)
}

if i < 9 {
theRune = rune(i + 49) // 48 is '0', but we skip that one
}
Expand All @@ -228,8 +232,11 @@ func main() {

stateWidget := tview.NewFlex().
SetDirection(tview.FlexColumn).
AddItem(reactorsWidget, 10, 0, false).
AddItem(textView, 0, 4, false)
AddItem(reactorsWidget, longestReactor+1+2+4, 0, false).
AddItem(textView, 0, 1, false)

reactorsWidget.SetBorderPadding(1, 1, 1, 2)
stateWidget.SetBorder(true).SetTitle("Reactor State")

layout := tview.NewFlex().
SetDirection(tview.FlexRow).
Expand Down

0 comments on commit 9244b7f

Please sign in to comment.