Skip to content

Commit

Permalink
add more columns
Browse files Browse the repository at this point in the history
  • Loading branch information
spddl committed Oct 6, 2021
1 parent 5083635 commit 18dcad7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 7 deletions.
40 changes: 38 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func main() {
case IrqPolicySpreadMessagesAcrossAllProcessors: // 0x05
return "Spread Messages Across All Proc"
default:
return fmt.Sprintf("%d", value.(int))
return fmt.Sprintf("%d", value.(uint32))
}
},
},
Expand All @@ -112,10 +112,46 @@ func main() {
case 3:
return "High"
default:
return fmt.Sprintf("%d", value.(int))
return fmt.Sprintf("%d", value.(uint32))
}
},
},
{
Name: "InterrupTypeMap",
Title: "Interrup Type",
FormatFunc: func(value interface{}) string {
return interrupType(value.(Bits))

},
},
{
Name: "MessageNumberLimit",
Title: "MSI Limit",
FormatFunc: func(value interface{}) string {
switch value.(uint32) {
case 0:
return ""
default:
return fmt.Sprintf("%d", value.(uint32))
}
},
},
{
Name: "MaxMSILimit",
Title: "Max MSI Limit",
FormatFunc: func(value interface{}) string {
switch value.(uint32) {
case 0:
return ""
default:
return fmt.Sprintf("%d", value.(uint32))
}
},
},
{
Name: "DevObjName",
Title: "DevObj Name",
},
{
Name: "LastChange",
Title: "Last Change",
Expand Down
6 changes: 4 additions & 2 deletions dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"log"
"os/exec"
"sort"
"strings"

"github.com/lxn/walk"
Expand Down Expand Up @@ -149,7 +150,7 @@ func RunDialog(owner walk.Form, device *Device) (int, error) {
},

Label{
Text: interrupType(device.InterrupTypeMap),
Text: "Interrup Type: " + interrupType(device.InterrupTypeMap),
},

Label{
Expand Down Expand Up @@ -332,5 +333,6 @@ func interrupType(b Bits) string {
types = append(types, name)
}
}
return "Interrup Type: " + strings.Join(types, ", ")
sort.Strings(types)
return strings.Join(types, ", ")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ go 1.16
require (
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ github.com/lxn/walk v0.0.0-20210112085537-c389da54e794/go.mod h1:E23UucZGqpuUANJ
github.com/lxn/win v0.0.0-20210218163916-a377121e959e h1:H+t6A/QJMbhCSEH5rAuRxh+CtW96g0Or0Fxa9IKr4uc=
github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef h1:fPxZ3Umkct3LZ8gK9nbk+DWDJ9fstZa2grBn+lWVKPs=
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc=
gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E=

0 comments on commit 18dcad7

Please sign in to comment.