激光联动控制完成

This commit is contained in:
2025-03-12 19:13:35 +08:00
parent 1e0119c5c4
commit 752446e502
11 changed files with 184 additions and 49 deletions

65
pkg/oscx/osc.go Normal file
View File

@@ -0,0 +1,65 @@
package oscx
import (
"github.com/hypebeast/go-osc/osc"
)
type Client struct {
o *osc.Client
}
func New(host string, port int) *Client {
return &Client{
o: osc.NewClient(host, port),
}
}
func (c *Client) StartCue(data string) error {
msg := osc.NewMessage("/beyond/general/StartCue", data)
return c.o.Send(msg)
}
func (c *Client) EnableLaserOutput() error {
msg := osc.NewMessage("/beyond/general/EnableLaserOutput")
return c.o.Send(msg)
}
func (c *Client) DisableLaserOutput() error {
msg := osc.NewMessage("/beyond/general/DisableLaserOutput")
return c.o.Send(msg)
}
func (c *Client) SetLaserOutput(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutput", data)
return c.o.Send(msg)
}
func (c *Client) SetLaserOutputColor(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputColor", data)
return c.o.Send(msg)
}
func (c *Client) SetLaserOutputIntensity(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputIntensity", data)
return c.o.Send(msg)
}
func (c *Client) SetLaserOutputPosition(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputPosition", data)
return c.o.Send(msg)
}
func (c *Client) SetLaserOutputSize(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputSize", data)
return c.o.Send(msg)
}
func (c *Client) SetLaserOutputSpeed(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputSpeed", data)
return c.o.Send(msg)
}
func (c *Client) Status() error {
msg := osc.NewMessage("/beyond/general/Status")
return c.o.Send(msg)
}