chore: move sensor definition to sensor.go

This commit is contained in:
Eli Yip 2025-05-27 14:07:30 +08:00
parent b530d63237
commit ce63b28e24
No known key found for this signature in database
GPG Key ID: C98B69D4CF7D7EC5
2 changed files with 12 additions and 12 deletions

View File

@ -11,18 +11,6 @@ import (
"time" "time"
) )
// 传感器数据结构体
type SensorData struct {
Interface string `json:"interface"`
Thumb int `json:"thumb"`
Index int `json:"index"`
Middle int `json:"middle"`
Ring int `json:"ring"`
Pinky int `json:"pinky"`
PalmPosition []byte `json:"palmPosition"`
LastUpdate time.Time `json:"lastUpdate"`
}
// 手型配置结构体 // 手型配置结构体
type HandConfig struct { type HandConfig struct {
HandType string `json:"handType"` HandType string `json:"handType"`

View File

@ -7,6 +7,18 @@ import (
"time" "time"
) )
// 传感器数据结构体
type SensorData struct {
Interface string `json:"interface"`
Thumb int `json:"thumb"`
Index int `json:"index"`
Middle int `json:"middle"`
Ring int `json:"ring"`
Pinky int `json:"pinky"`
PalmPosition []byte `json:"palmPosition"`
LastUpdate time.Time `json:"lastUpdate"`
}
var ( var (
SensorDataMap map[string]*SensorData // 每个接口的传感器数据 SensorDataMap map[string]*SensorData // 每个接口的传感器数据
SensorMutex sync.RWMutex SensorMutex sync.RWMutex