Skip to content

Commit

Permalink
move movig around
Browse files Browse the repository at this point in the history
  • Loading branch information
roffe committed Dec 13, 2024
1 parent 871bcbe commit 9fe3f90
Show file tree
Hide file tree
Showing 20 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pkg/datalogger/wideband.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/roffe/gocan"
"github.com/roffe/gocan/adapter"
"github.com/roffe/txlogger/pkg/ecumaster"
"github.com/roffe/txlogger/pkg/wbl/aem"
"github.com/roffe/txlogger/pkg/wbl/ecumaster"
"github.com/roffe/txlogger/pkg/wbl/innovate"
)

Expand Down
22 changes: 13 additions & 9 deletions pkg/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ import (
"os"
"path/filepath"
"runtime"
"sync"
"time"
)

func init() {
var initOnce sync.Once
var fh *os.File

func start() {
var err error
f, err = os.OpenFile("debug.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
fh, err = os.OpenFile("debug.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
if err != nil {
log.Printf("error opening file: %v", err)
}
}

func Log(msg string) {
initOnce.Do(start)

timeStr := time.Now().Format("2006-01-02 15:04:05.000")
_, fullPath, line, ok := runtime.Caller(2)
filename := filepath.Base(fullPath)
Expand All @@ -28,20 +34,18 @@ func Log(msg string) {
}
}

var f *os.File

func LogRaw(msg string) {
if f == nil {
if fh == nil {
var err error
f, err = os.OpenFile("debug.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
fh, err = os.OpenFile("debug.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
if err == nil {
log.Println("error opening file: %w", err)
return
}
}
f.WriteString(msg + "\n")
fh.WriteString(msg + "\n")
}
func Close() {
f.Sync()
f.Close()
fh.Sync()
fh.Close()
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/widgets/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/roffe/txlogger/pkg/datalogger"
"github.com/roffe/txlogger/pkg/ecumaster"
"github.com/roffe/txlogger/pkg/wbl/aem"
"github.com/roffe/txlogger/pkg/wbl/ecumaster"
"github.com/roffe/txlogger/pkg/wbl/innovate"
"github.com/roffe/txlogger/pkg/widgets/cansettings"
sdialog "github.com/sqweek/dialog"
Expand Down
2 changes: 1 addition & 1 deletion pkg/windows/logplayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/roffe/txlogger/pkg/layout"
"github.com/roffe/txlogger/pkg/logfile"
"github.com/roffe/txlogger/pkg/mainmenu"
"github.com/roffe/txlogger/pkg/plotter"
"github.com/roffe/txlogger/pkg/widgets/dashboard"
"github.com/roffe/txlogger/pkg/widgets/plotter"
)

const TIME_FORMAT = "02-01-2006 15:04:05.999"
Expand Down
2 changes: 1 addition & 1 deletion pkg/windows/mainWindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"github.com/roffe/txlogger/pkg/debug"
"github.com/roffe/txlogger/pkg/ecu"
"github.com/roffe/txlogger/pkg/mainmenu"
"github.com/roffe/txlogger/pkg/multiwindow"
"github.com/roffe/txlogger/pkg/presets"
"github.com/roffe/txlogger/pkg/widgets/dashboard"
"github.com/roffe/txlogger/pkg/widgets/multiwindow"
"github.com/roffe/txlogger/pkg/widgets/progressmodal"
"github.com/roffe/txlogger/pkg/widgets/settings"
"github.com/roffe/txlogger/pkg/widgets/symbollist"
Expand Down
2 changes: 1 addition & 1 deletion pkg/windows/mainWindow_buttons.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/roffe/gocan"
"github.com/roffe/txlogger/pkg/datalogger"
"github.com/roffe/txlogger/pkg/ebus"
"github.com/roffe/txlogger/pkg/snd"
"github.com/roffe/txlogger/pkg/internal/snd"
"github.com/roffe/txlogger/pkg/widgets/dashboard"
sdialog "github.com/sqweek/dialog"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/windows/mainWindow_multiwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync"

"fyne.io/fyne/v2"
"github.com/roffe/txlogger/pkg/multiwindow"
"github.com/roffe/txlogger/pkg/widgets/multiwindow"
)

type innerWindow struct {
Expand Down

0 comments on commit 9fe3f90

Please sign in to comment.