-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationToRunParams_test.go
More file actions
46 lines (42 loc) · 1.41 KB
/
AnimationToRunParams_test.go
File metadata and controls
46 lines (42 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package animatedledstrip
import (
"encoding/json"
"testing"
)
func TestAnimationToRunParams(t *testing.T) {
//a := AnimationToRunParams("", []*colorContainer{}, "", "", 0, map[string]int{}, map[string]float64{}, map[string]string{}, map[string]*location{}, map[string]*distance{}, map[string]*rotation{"x": RadiansRotation(5.0, 4.0, 3.0, []string{})}, map[string]*equation{})
//println(a)
//r, e := json.Marshal(a)
//println(string(r))
//println(e)
c := ALSHttpClient("10.0.0.91")
var p []int
p = append(p, 1)
p = append(p, 2)
//s := Section("section9", p, "")
//ns, _ := c.CreateNewSection(s)
//println(ns.Name)
//n, _ := c.GetSections()
//println(n[7].Name)
var col []*colorContainer
var colInts []int
colInts = append(colInts, 0xFF)
col = append(col, ColorContainer(colInts))
a := AnimationToRunParams("ripple", col, "", "", 5, map[string]int{}, map[string]float64{}, map[string]string{}, map[string]*location{}, map[string]*distance{}, map[string]*rotation{}, map[string]*equation{})
b, e := json.Marshal(a)
if e != nil {
println(e.Error())
}
println(string(b))
n, err := c.StartAnimation(a)
println(n)
if err != nil {
println(err.Error())
}
//i, _:= c.GetAnimationInfo("fireworks")
//println(location(*(i.DistanceParams[0].Default)))
//p := s.GetRunningAnimationParams("6898263")
//println(p.AnimationName)
//println(p.Colors[0].Colors[0])
//println(p.RotationParams["rotation"].RotationType)
}