deleted useless code
This commit is contained in:
@@ -23,7 +23,6 @@ func NewCDashService(logger *slog.Logger) *CDashService {
|
||||
CDash: nil,
|
||||
DevClerk: peripheral.NewPeripheralDeviceClerk(),
|
||||
Messages: sharedChannel,
|
||||
// iRacingTelemetry: NewIRacingService(sharedChannel),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,35 +92,3 @@ func (cds *CDashService) MoveWindow(win *models.UIWindow, vec *helper.Vector) er
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// func (cds *CDashService) StartStream() {
|
||||
// // We need to get a channel from the telemetry agent to listen to and
|
||||
// // propogate the data to the clients
|
||||
// dataStream := cds.iRacingTelemetry.StartStream()
|
||||
//
|
||||
// // Custom types to be able to actually send data to the device
|
||||
// type CDashDisplayUIWindowStreamData struct {
|
||||
// IDX int16
|
||||
// Data [32]byte
|
||||
// }
|
||||
//
|
||||
// type CDashDisplayStreamData struct {
|
||||
// Data []CDashDisplayUIWindowStreamData
|
||||
// }
|
||||
//
|
||||
// // We will need a mechanism to kill this channel too I reckon
|
||||
// go func() {
|
||||
// for data := range dataStream {
|
||||
// // We have to send this data to the device
|
||||
// cds.Messages <- fmt.Sprintf("%d %d %d\n", data.Speed[:], data.Gear[:], data.RPM[:])
|
||||
// }
|
||||
// }()
|
||||
// }
|
||||
|
||||
// func (cds *CDashService) GetStream() <-chan string {
|
||||
// return cds.iRacingTelemetry.GetStream()
|
||||
// }
|
||||
//
|
||||
// func (cds *CDashService) StopStream() {
|
||||
// cds.iRacingTelemetry.StopStream()
|
||||
// }
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
package services
|
||||
|
||||
// NOTE: I have to think about how to implement this, for now I'm bruteforcing
|
||||
// iracing support only. But I should have a generic service that can gather
|
||||
// telemetry from multiples sims and just publish it in an internal format
|
||||
|
||||
// Car data lengths
|
||||
const (
|
||||
SpeedLen = 5
|
||||
GearLen = 3
|
||||
RpmLen = 6
|
||||
BrakeBiasLen = 6
|
||||
)
|
||||
|
||||
type StreamState int
|
||||
|
||||
const (
|
||||
StreamStatePaused StreamState = 0
|
||||
StreamStateRunning StreamState = 1
|
||||
StreamStateOff StreamState = 2
|
||||
)
|
||||
|
||||
// type IRacingService struct {
|
||||
// Message chan string
|
||||
// // Timers
|
||||
// LastMessageTime time.Time
|
||||
// InitialTime time.Time
|
||||
// LastTime time.Time
|
||||
// ticker *time.Ticker
|
||||
// // Data vessels
|
||||
// data *esdi.SimulationData
|
||||
// dataView *esdi.DataPacket
|
||||
// // Data access control
|
||||
// Mut sync.Mutex
|
||||
// // Source
|
||||
// Irsdk *goirsdk.IBT
|
||||
// // Stream control
|
||||
// isRunning bool
|
||||
// UIStream chan string
|
||||
// DataStream chan *esdi.DataPacket
|
||||
// StreamCancel context.CancelFunc
|
||||
// }
|
||||
|
||||
// func NewIRacingService(msg chan string) *IRacingService {
|
||||
// // Open the telemetry file
|
||||
// file, err := os.Open("/home/esilva/Desktop/projetos/simracing_peripherals/testTelemetry/supercars_indianapolis.ibt")
|
||||
// if err != nil {
|
||||
// log.Fatalf("Failed to open IBT file: %v", err)
|
||||
// }
|
||||
//
|
||||
// irsdk, err := goirsdk.Init(file, "./out.ibt", "./out.yaml")
|
||||
// if err != nil {
|
||||
// log.Fatalf("Failed to load iRacing data")
|
||||
// }
|
||||
//
|
||||
// return &IRacingService{
|
||||
// Message: msg,
|
||||
// ticker: time.NewTicker(time.Second / 60),
|
||||
// Irsdk: irsdk,
|
||||
// UIStream: make(chan string, 10),
|
||||
// DataStream: make(chan *esdi.DataPacket),
|
||||
// data: &esdi.SimulationData{},
|
||||
// dataView: &esdi.DataPacket{},
|
||||
// isRunning: false,
|
||||
// }
|
||||
// }
|
||||
|
||||
// func (irs *IRacingService) GetStream() <-chan string {
|
||||
// return irs.UIStream
|
||||
// }
|
||||
//
|
||||
// func (irs *IRacingService) StartStream() <-chan *esdi.DataPacket {
|
||||
// if irs.isRunning {
|
||||
// return nil
|
||||
// }
|
||||
//
|
||||
// var ctx context.Context
|
||||
// ctx, irs.StreamCancel = context.WithCancel(context.Background())
|
||||
//
|
||||
// irs.startStream(ctx)
|
||||
// irs.isRunning = true
|
||||
//
|
||||
// return irs.DataStream
|
||||
// }
|
||||
|
||||
// func (irs *IRacingService) StopStream() {
|
||||
// if irs.StreamCancel != nil {
|
||||
// irs.StreamCancel()
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user