激光联动控制完成
This commit is contained in:
65
pkg/oscx/osc.go
Normal file
65
pkg/oscx/osc.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user