RUIC 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +5 -0
- data/README.md +279 -270
- data/bin/ruic +0 -0
- data/gui/TODO +2 -2
- data/gui/appattributesmodel.rb +51 -51
- data/gui/appelementsmodel.rb +126 -126
- data/gui/launch.rb +19 -19
- data/gui/makefile +14 -14
- data/gui/resources/style/dark.qss +459 -459
- data/gui/window.rb +90 -90
- data/gui/window.ui +753 -753
- data/lib/ruic.rb +80 -11
- data/lib/ruic/application.rb +68 -13
- data/lib/ruic/assets.rb +289 -287
- data/lib/ruic/attributes.rb +165 -165
- data/lib/ruic/behaviors.rb +0 -0
- data/lib/ruic/interfaces.rb +7 -2
- data/lib/ruic/presentation.rb +175 -40
- data/lib/ruic/ripl-after-result.rb +11 -11
- data/lib/ruic/statemachine.rb +0 -0
- data/lib/ruic/version.rb +2 -2
- data/ruic.gemspec +25 -25
- data/test/MetaData-simple.xml +28 -28
- data/test/MetaData.xml +435 -435
- data/test/customclasses.ruic +21 -21
- data/test/filtering.ruic +43 -43
- data/test/futureassets.ruic +8 -8
- data/test/nonmaster.ruic +0 -0
- data/test/paths.ruic +18 -18
- data/test/projects/CustomClasses/CustomClasses.uia +7 -7
- data/test/projects/CustomClasses/FutureAsset.uip +17 -17
- data/test/projects/SimpleScene/SimpleScene.uia +4 -4
- data/test/projects/SimpleScene/SimpleScene.uip +35 -35
- data/test/properties.ruic +82 -82
- data/test/referencematerials.ruic +52 -52
- data/test/usage.ruic +20 -20
- metadata +6 -26
data/test/customclasses.ruic
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
#!/usr/bin/env ruic
|
2
|
-
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
-
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
4
|
-
show app.errors if app.errors?
|
5
|
-
|
6
|
-
main = app.main_presentation
|
7
|
-
|
8
|
-
effect = main/"Scene.Layer.Brush Strokes"
|
9
|
-
assert effect
|
10
|
-
assert effect.name == "Brush Strokes"
|
11
|
-
assert effect.properties.length == 11 # 6 shared asset, 1 effect, 4 from effect
|
12
|
-
assert effect['brushAngle'].value == 45
|
13
|
-
assert effect['starttime',1] == 0
|
14
|
-
assert effect['NoiseSamp'].value == 'maps/effects/brushnoise.dds'
|
15
|
-
|
16
|
-
material = main/"Scene.Layer.Rectangle.Material"
|
17
|
-
assert material.properties.length == 12 # 6 shared asset, 2 MaterialBase, 4 from material
|
18
|
-
assert material.name == "Material"
|
19
|
-
assert material['uEnvironmentMappingEnabled']
|
20
|
-
assert !material['ATTRIBUTE-DOES-NOT-EXIST']
|
21
|
-
assert material['uEnvironmentTexture',1] == 'maps/materials/spherical_checker.png'
|
1
|
+
#!/usr/bin/env ruic
|
2
|
+
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
+
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
4
|
+
show app.errors if app.errors?
|
5
|
+
|
6
|
+
main = app.main_presentation
|
7
|
+
|
8
|
+
effect = main/"Scene.Layer.Brush Strokes"
|
9
|
+
assert effect
|
10
|
+
assert effect.name == "Brush Strokes"
|
11
|
+
assert effect.properties.length == 11 # 6 shared asset, 1 effect, 4 from effect
|
12
|
+
assert effect['brushAngle'].value == 45
|
13
|
+
assert effect['starttime',1] == 0
|
14
|
+
assert effect['NoiseSamp'].value == 'maps/effects/brushnoise.dds'
|
15
|
+
|
16
|
+
material = main/"Scene.Layer.Rectangle.Material"
|
17
|
+
assert material.properties.length == 12 # 6 shared asset, 2 MaterialBase, 4 from material
|
18
|
+
assert material.name == "Material"
|
19
|
+
assert material['uEnvironmentMappingEnabled']
|
20
|
+
assert !material['ATTRIBUTE-DOES-NOT-EXIST']
|
21
|
+
assert material['uEnvironmentTexture',1] == 'maps/materials/spherical_checker.png'
|
data/test/filtering.ruic
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
metadata 'MetaData.xml'
|
2
|
-
|
3
|
-
uia 'projects/SimpleScene/SimpleScene.uia'
|
4
|
-
show app.errors if app.errors?
|
5
|
-
|
6
|
-
main = app.main_presentation
|
7
|
-
|
8
|
-
assert main.find( _type:'Model' ).length==4
|
9
|
-
assert main.find( _type:'Model', _slide:0 ).length==3
|
10
|
-
assert main.find( _type:'Model', _slide:1 ).length==4
|
11
|
-
assert main.find( _type:'Model', _slide:1, _master:false ).length==1
|
12
|
-
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
13
|
-
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
14
|
-
assert main.find( _type:'Model', position:[nil,60,nil] ).length==4
|
15
|
-
assert main.find( _type:'Model', sourcepath:'#Cube' ).length==1
|
16
|
-
assert main.find( _under:main/"Scene.Layer.Sphere1" ).length==1
|
17
|
-
assert main.find( name:'Material' ).length==4
|
18
|
-
assert main.find( name:/^Sphere/ ).length==2
|
19
|
-
|
20
|
-
# Return values are in Scene graph order
|
21
|
-
assert main.find.first == main/"Scene"
|
22
|
-
assert main.find.last == main/"Scene.Layer.NonMaster.Material"
|
23
|
-
|
24
|
-
# Any asset can be used as the 'root'
|
25
|
-
sphere = main/"Scene.Layer.Sphere1"
|
26
|
-
assert sphere.find.length==1
|
27
|
-
|
28
|
-
# Supplying a block will iterate, including the index
|
29
|
-
expected = main.find _type:'Model'
|
30
|
-
found = 0
|
31
|
-
main.find _type:'Model' do |mod,i|
|
32
|
-
found += 1
|
33
|
-
assert mod == expected[i]
|
34
|
-
end
|
35
|
-
assert found==4
|
36
|
-
|
37
|
-
#
|
38
|
-
['NOPE',false,/NOPE/,-1,[-1],nil].each do |v|
|
39
|
-
assert main.find(__type:v).length==0
|
40
|
-
assert main.find(NOPE:v).length==0
|
41
|
-
assert main.find('NOPE'=>v).length==0
|
42
|
-
end
|
43
|
-
|
1
|
+
metadata 'MetaData.xml'
|
2
|
+
|
3
|
+
uia 'projects/SimpleScene/SimpleScene.uia'
|
4
|
+
show app.errors if app.errors?
|
5
|
+
|
6
|
+
main = app.main_presentation
|
7
|
+
|
8
|
+
assert main.find( _type:'Model' ).length==4
|
9
|
+
assert main.find( _type:'Model', _slide:0 ).length==3
|
10
|
+
assert main.find( _type:'Model', _slide:1 ).length==4
|
11
|
+
assert main.find( _type:'Model', _slide:1, _master:false ).length==1
|
12
|
+
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
13
|
+
assert main.find( _type:'Model', position:[-150,60,0] ).length==2
|
14
|
+
assert main.find( _type:'Model', position:[nil,60,nil] ).length==4
|
15
|
+
assert main.find( _type:'Model', sourcepath:'#Cube' ).length==1
|
16
|
+
assert main.find( _under:main/"Scene.Layer.Sphere1" ).length==1
|
17
|
+
assert main.find( name:'Material' ).length==4
|
18
|
+
assert main.find( name:/^Sphere/ ).length==2
|
19
|
+
|
20
|
+
# Return values are in Scene graph order
|
21
|
+
assert main.find.first == main/"Scene"
|
22
|
+
assert main.find.last == main/"Scene.Layer.NonMaster.Material"
|
23
|
+
|
24
|
+
# Any asset can be used as the 'root'
|
25
|
+
sphere = main/"Scene.Layer.Sphere1"
|
26
|
+
assert sphere.find.length==1
|
27
|
+
|
28
|
+
# Supplying a block will iterate, including the index
|
29
|
+
expected = main.find _type:'Model'
|
30
|
+
found = 0
|
31
|
+
main.find _type:'Model' do |mod,i|
|
32
|
+
found += 1
|
33
|
+
assert mod == expected[i]
|
34
|
+
end
|
35
|
+
assert found==4
|
36
|
+
|
37
|
+
#
|
38
|
+
['NOPE',false,/NOPE/,-1,[-1],nil].each do |v|
|
39
|
+
assert main.find(__type:v).length==0
|
40
|
+
assert main.find(NOPE:v).length==0
|
41
|
+
assert main.find('NOPE'=>v).length==0
|
42
|
+
end
|
43
|
+
|
44
44
|
show "All #{File.basename(__FILE__)} assertions successful."
|
data/test/futureassets.ruic
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
metadata 'MetaData-simple.xml'
|
2
|
-
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
3
|
-
show app.errors if app.errors?
|
4
|
-
|
5
|
-
future = app["#future"]
|
6
|
-
|
7
|
-
assert xyzzy=future.find(_type:'XYZZY').first
|
8
|
-
assert xyzzy.type == 'XYZZY'
|
1
|
+
metadata 'MetaData-simple.xml'
|
2
|
+
uia 'projects/CustomClasses/CustomClasses.uia' # required before other commands
|
3
|
+
show app.errors if app.errors?
|
4
|
+
|
5
|
+
future = app["#future"]
|
6
|
+
|
7
|
+
assert xyzzy=future.find(_type:'XYZZY').first
|
8
|
+
assert xyzzy.type == 'XYZZY'
|
9
9
|
assert xyzzy['eyeball',0]==true # Unknown assets inherit from Asset
|
data/test/nonmaster.ruic
CHANGED
File without changes
|
data/test/paths.ruic
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
#!/usr/bin/env ruic
|
2
|
-
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
-
uia 'projects/Paths/Paths.uia' # required before other commands
|
4
|
-
|
5
|
-
show "Uh oh!", app.errors if app.errors?
|
6
|
-
|
7
|
-
main = app.main
|
8
|
-
paths = main.find _type:'Path'
|
9
|
-
assert paths.length == 5
|
10
|
-
assert paths.first == main/"Scene.Layer.Path1"
|
11
|
-
assert paths.first['width'].value == 17
|
12
|
-
|
13
|
-
assert main.find(_type:'PathAnchorPoint').length == 25
|
14
|
-
|
15
|
-
assert paths.first.anchors
|
16
|
-
assert paths.first.anchors.first == paths.first.find(_type:'PathAnchorPoint').first
|
17
|
-
|
18
|
-
|
1
|
+
#!/usr/bin/env ruic
|
2
|
+
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
+
uia 'projects/Paths/Paths.uia' # required before other commands
|
4
|
+
|
5
|
+
show "Uh oh!", app.errors if app.errors?
|
6
|
+
|
7
|
+
main = app.main
|
8
|
+
paths = main.find _type:'Path'
|
9
|
+
assert paths.length == 5
|
10
|
+
assert paths.first == main/"Scene.Layer.Path1"
|
11
|
+
assert paths.first['width'].value == 17
|
12
|
+
|
13
|
+
assert main.find(_type:'PathAnchorPoint').length == 25
|
14
|
+
|
15
|
+
assert paths.first.anchors
|
16
|
+
assert paths.first.anchors.first == paths.first.find(_type:'PathAnchorPoint').first
|
17
|
+
|
18
|
+
|
19
19
|
show "All assertions successful"
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
-
<assets initial="CustomClasses">
|
4
|
-
<presentation id="CustomClasses" src="CustomClasses.uip"/>
|
5
|
-
<presentation id="future" src="FutureAsset.uip"/>
|
6
|
-
</assets>
|
7
|
-
</application>
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
+
<assets initial="CustomClasses">
|
4
|
+
<presentation id="CustomClasses" src="CustomClasses.uip"/>
|
5
|
+
<presentation id="future" src="FutureAsset.uip"/>
|
6
|
+
</assets>
|
7
|
+
</application>
|
@@ -1,17 +1,17 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<UIP version="3" >
|
3
|
-
<Project >
|
4
|
-
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" />
|
5
|
-
<Graph >
|
6
|
-
<Scene id="Scene" >
|
7
|
-
<XYZZY id="future"/>
|
8
|
-
</Scene>
|
9
|
-
</Graph>
|
10
|
-
<Logic >
|
11
|
-
<State name="Master Slide" component="#Scene" >
|
12
|
-
<Add ref="#future" />
|
13
|
-
<State id="Scene-Slide1" name="Slide1" />
|
14
|
-
</State>
|
15
|
-
</Logic>
|
16
|
-
</Project>
|
17
|
-
</UIP>
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<UIP version="3" >
|
3
|
+
<Project >
|
4
|
+
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" />
|
5
|
+
<Graph >
|
6
|
+
<Scene id="Scene" >
|
7
|
+
<XYZZY id="future"/>
|
8
|
+
</Scene>
|
9
|
+
</Graph>
|
10
|
+
<Logic >
|
11
|
+
<State name="Master Slide" component="#Scene" >
|
12
|
+
<Add ref="#future" />
|
13
|
+
<State id="Scene-Slide1" name="Slide1" />
|
14
|
+
</State>
|
15
|
+
</Logic>
|
16
|
+
</Project>
|
17
|
+
</UIP>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
-
<assets><presentation id="main" src="SimpleScene.uip"/></assets>
|
4
|
-
</application>
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<application xmlns="http://nvidia.com/uicomposer">
|
3
|
+
<assets><presentation id="main" src="SimpleScene.uip"/></assets>
|
4
|
+
</application>
|
@@ -1,35 +1,35 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
-
<UIP version="3">
|
3
|
-
<Project>
|
4
|
-
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False"/>
|
5
|
-
<Graph>
|
6
|
-
<Scene id="Scene">
|
7
|
-
<Layer id="Layer">
|
8
|
-
<Camera id="Camera"/>
|
9
|
-
<Light id="Light"/>
|
10
|
-
<Model id="Sphere"><Material id="Material"/></Model>
|
11
|
-
<Model id="Sphere2"><Material id="Material_001"/></Model>
|
12
|
-
<Model id="Cube"><Material id="Material_002"/></Model>
|
13
|
-
<Model id="Sphere3"><Material id="Material_003"/></Model>
|
14
|
-
</Layer>
|
15
|
-
</Scene>
|
16
|
-
</Graph>
|
17
|
-
<Logic>
|
18
|
-
<State name="Master Slide" component="#Scene">
|
19
|
-
<Add ref="#Layer"/>
|
20
|
-
<Add ref="#Camera"/>
|
21
|
-
<Add ref="#Light"/>
|
22
|
-
<Add ref="#Sphere" name="Sphere1" position="-150 60 0" sourcepath="#Sphere"/>
|
23
|
-
<Add ref="#Material" diffuse="0 0.752941 0"/>
|
24
|
-
<Add ref="#Sphere2" name="Sphere2" position="150 60.0004 0" sourcepath="#Sphere"/>
|
25
|
-
<Add ref="#Material_001" diffuse="0 0.75287 0"/>
|
26
|
-
<Add ref="#Cube" name="Cube" position="0 60 0" rotation="-30 60 -20" sourcepath="#Cube"/>
|
27
|
-
<Add ref="#Material_002" name="Material" diffuse="0.5 0 0"/>
|
28
|
-
<State id="Scene-Slide1" name="Slide1">
|
29
|
-
<Add ref="#Sphere3" name="NonMaster" position="-150 60 0" sourcepath="#Sphere"/>
|
30
|
-
<Add ref="#Material_003" diffuse="0 0.752941 0"/>
|
31
|
-
</State>
|
32
|
-
</State>
|
33
|
-
</Logic>
|
34
|
-
</Project>
|
35
|
-
</UIP>
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<UIP version="3">
|
3
|
+
<Project>
|
4
|
+
<ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False"/>
|
5
|
+
<Graph>
|
6
|
+
<Scene id="Scene">
|
7
|
+
<Layer id="Layer">
|
8
|
+
<Camera id="Camera"/>
|
9
|
+
<Light id="Light"/>
|
10
|
+
<Model id="Sphere"><Material id="Material"/></Model>
|
11
|
+
<Model id="Sphere2"><Material id="Material_001"/></Model>
|
12
|
+
<Model id="Cube"><Material id="Material_002"/></Model>
|
13
|
+
<Model id="Sphere3"><Material id="Material_003"/></Model>
|
14
|
+
</Layer>
|
15
|
+
</Scene>
|
16
|
+
</Graph>
|
17
|
+
<Logic>
|
18
|
+
<State name="Master Slide" component="#Scene">
|
19
|
+
<Add ref="#Layer"/>
|
20
|
+
<Add ref="#Camera"/>
|
21
|
+
<Add ref="#Light"/>
|
22
|
+
<Add ref="#Sphere" name="Sphere1" position="-150 60 0" sourcepath="#Sphere"/>
|
23
|
+
<Add ref="#Material" diffuse="0 0.752941 0"/>
|
24
|
+
<Add ref="#Sphere2" name="Sphere2" position="150 60.0004 0" sourcepath="#Sphere"/>
|
25
|
+
<Add ref="#Material_001" diffuse="0 0.75287 0"/>
|
26
|
+
<Add ref="#Cube" name="Cube" position="0 60 0" rotation="-30 60 -20" sourcepath="#Cube"/>
|
27
|
+
<Add ref="#Material_002" name="Material" diffuse="0.5 0 0"/>
|
28
|
+
<State id="Scene-Slide1" name="Slide1">
|
29
|
+
<Add ref="#Sphere3" name="NonMaster" position="-150 60 0" sourcepath="#Sphere"/>
|
30
|
+
<Add ref="#Material_003" diffuse="0 0.752941 0"/>
|
31
|
+
</State>
|
32
|
+
</State>
|
33
|
+
</Logic>
|
34
|
+
</Project>
|
35
|
+
</UIP>
|
data/test/properties.ruic
CHANGED
@@ -1,82 +1,82 @@
|
|
1
|
-
#!/usr/bin/env ruic
|
2
|
-
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
-
uia 'projects/BMW_Cluster/BMW_Cluster.uia' # required before other commands
|
4
|
-
|
5
|
-
show "Uh oh!", app.errors if app.errors?
|
6
|
-
|
7
|
-
assert app.filename == 'BMW_Cluster.uia'
|
8
|
-
assert app.assets.length==10, "There should be 10 assets"
|
9
|
-
assert app.behaviors.length==3
|
10
|
-
assert app.presentations.length==6
|
11
|
-
|
12
|
-
assert app['#logic']
|
13
|
-
assert app['#logic'].datamodel=='{output=output}'
|
14
|
-
assert app['#logic']==app['states/logic.scxml']
|
15
|
-
assert app['#logic']==app['./states/logic.scxml']
|
16
|
-
assert app['#logic']==app['../BMW_Cluster/states/logic.scxml']
|
17
|
-
|
18
|
-
main = app['#main'] # Look up a presentation by asset id
|
19
|
-
assert main == app.main_presentation # …or ask for the main rendered presentation
|
20
|
-
assert main == app.main # …also available as a shortcut name
|
21
|
-
assert main.filename == 'BMW_Cluster.uip' # You can also ask for the full path via .file
|
22
|
-
assert main == app['BMW_Cluster.uip'] # Look up a presentation by asset id
|
23
|
-
|
24
|
-
assert !app['beejonkers'] # If an asset id doesn't exist, you'll get nil
|
25
|
-
|
26
|
-
scene = app/'main:Scene'
|
27
|
-
assert scene
|
28
|
-
assert scene==main.scene
|
29
|
-
assert scene.type == 'Scene'
|
30
|
-
assert scene.name == 'Scene'
|
31
|
-
assert scene['name'].value == 'Scene'
|
32
|
-
|
33
|
-
# Find an element based on path, prefixed with asset id
|
34
|
-
sm = app/'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
|
35
|
-
assert sm.name == 'SimpleMedia'
|
36
|
-
assert sm.type == 'Model'
|
37
|
-
assert sm.path == 'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
|
38
|
-
|
39
|
-
assert sm==main/'Scene.ClassicContent.ClassicContent.SimpleMedia'
|
40
|
-
|
41
|
-
assert sm.component == (main/'Scene.ClassicContent.ClassicContent')
|
42
|
-
assert sm.component.slides.length==2
|
43
|
-
assert sm.component.slides[0].name == 'Master Slide'
|
44
|
-
assert sm.component.slides[0].index == 0
|
45
|
-
assert sm.component.slides[2].name == 'CarStatus'
|
46
|
-
assert sm.component.slides[2].index == 2
|
47
|
-
assert sm.component.slides['CarStatus'].name == 'CarStatus'
|
48
|
-
assert sm.component.slides['CarStatus'] == sm.component.slides[2]
|
49
|
-
|
50
|
-
assert sm['endtime',0]==250
|
51
|
-
assert sm['endtime',1]==500
|
52
|
-
assert sm['endtime','SimpleMedia']==500
|
53
|
-
assert sm['endtime','CarStatus' ]==250
|
54
|
-
assert sm['endtime',99].nil?
|
55
|
-
|
56
|
-
assert sm['position'].linked?
|
57
|
-
assert !sm['endtime'].linked?
|
58
|
-
assert sm['endtime'].values == [250,500,250]
|
59
|
-
assert sm['endtime'].value == 250
|
60
|
-
|
61
|
-
assert sm['endtime',1]==500
|
62
|
-
assert sm['endtime','SimpleMedia']==500
|
63
|
-
assert sm['endtime','CarStatus' ]==250
|
64
|
-
|
65
|
-
sm['endtime','CarStatus'] = 750
|
66
|
-
assert sm['endtime','SimpleMedia']==500
|
67
|
-
assert sm['endtime','CarStatus' ]==750
|
68
|
-
|
69
|
-
sm['endtime'] = 100
|
70
|
-
assert sm['endtime',0]==100
|
71
|
-
assert sm['endtime',1]==100
|
72
|
-
assert sm['endtime',2]==100
|
73
|
-
|
74
|
-
assert sm['position',0].x==0
|
75
|
-
assert sm['scale',0].y == 2.88
|
76
|
-
|
77
|
-
sm['position',0].x=42
|
78
|
-
assert sm['position',0].x==42
|
79
|
-
|
80
|
-
sm['position',0].y=17
|
81
|
-
assert sm['position',0].y==17
|
82
|
-
assert sm['position',0].x==42
|
1
|
+
#!/usr/bin/env ruic
|
2
|
+
metadata 'MetaData.xml' # optional; also may be set via -m flag
|
3
|
+
uia 'projects/BMW_Cluster/BMW_Cluster.uia' # required before other commands
|
4
|
+
|
5
|
+
show "Uh oh!", app.errors if app.errors?
|
6
|
+
|
7
|
+
assert app.filename == 'BMW_Cluster.uia'
|
8
|
+
assert app.assets.length==10, "There should be 10 assets"
|
9
|
+
assert app.behaviors.length==3
|
10
|
+
assert app.presentations.length==6
|
11
|
+
|
12
|
+
assert app['#logic']
|
13
|
+
assert app['#logic'].datamodel=='{output=output}'
|
14
|
+
assert app['#logic']==app['states/logic.scxml']
|
15
|
+
assert app['#logic']==app['./states/logic.scxml']
|
16
|
+
assert app['#logic']==app['../BMW_Cluster/states/logic.scxml']
|
17
|
+
|
18
|
+
main = app['#main'] # Look up a presentation by asset id
|
19
|
+
assert main == app.main_presentation # …or ask for the main rendered presentation
|
20
|
+
assert main == app.main # …also available as a shortcut name
|
21
|
+
assert main.filename == 'BMW_Cluster.uip' # You can also ask for the full path via .file
|
22
|
+
assert main == app['BMW_Cluster.uip'] # Look up a presentation by asset id
|
23
|
+
|
24
|
+
assert !app['beejonkers'] # If an asset id doesn't exist, you'll get nil
|
25
|
+
|
26
|
+
scene = app/'main:Scene'
|
27
|
+
assert scene
|
28
|
+
assert scene==main.scene
|
29
|
+
assert scene.type == 'Scene'
|
30
|
+
assert scene.name == 'Scene'
|
31
|
+
assert scene['name'].value == 'Scene'
|
32
|
+
|
33
|
+
# Find an element based on path, prefixed with asset id
|
34
|
+
sm = app/'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
|
35
|
+
assert sm.name == 'SimpleMedia'
|
36
|
+
assert sm.type == 'Model'
|
37
|
+
assert sm.path == 'main:Scene.ClassicContent.ClassicContent.SimpleMedia'
|
38
|
+
|
39
|
+
assert sm==main/'Scene.ClassicContent.ClassicContent.SimpleMedia'
|
40
|
+
|
41
|
+
assert sm.component == (main/'Scene.ClassicContent.ClassicContent')
|
42
|
+
assert sm.component.slides.length==2
|
43
|
+
assert sm.component.slides[0].name == 'Master Slide'
|
44
|
+
assert sm.component.slides[0].index == 0
|
45
|
+
assert sm.component.slides[2].name == 'CarStatus'
|
46
|
+
assert sm.component.slides[2].index == 2
|
47
|
+
assert sm.component.slides['CarStatus'].name == 'CarStatus'
|
48
|
+
assert sm.component.slides['CarStatus'] == sm.component.slides[2]
|
49
|
+
|
50
|
+
assert sm['endtime',0]==250
|
51
|
+
assert sm['endtime',1]==500
|
52
|
+
assert sm['endtime','SimpleMedia']==500
|
53
|
+
assert sm['endtime','CarStatus' ]==250
|
54
|
+
assert sm['endtime',99].nil?
|
55
|
+
|
56
|
+
assert sm['position'].linked?
|
57
|
+
assert !sm['endtime'].linked?
|
58
|
+
assert sm['endtime'].values == [250,500,250]
|
59
|
+
assert sm['endtime'].value == 250
|
60
|
+
|
61
|
+
assert sm['endtime',1]==500
|
62
|
+
assert sm['endtime','SimpleMedia']==500
|
63
|
+
assert sm['endtime','CarStatus' ]==250
|
64
|
+
|
65
|
+
sm['endtime','CarStatus'] = 750
|
66
|
+
assert sm['endtime','SimpleMedia']==500
|
67
|
+
assert sm['endtime','CarStatus' ]==750
|
68
|
+
|
69
|
+
sm['endtime'] = 100
|
70
|
+
assert sm['endtime',0]==100
|
71
|
+
assert sm['endtime',1]==100
|
72
|
+
assert sm['endtime',2]==100
|
73
|
+
|
74
|
+
assert sm['position',0].x==0
|
75
|
+
assert sm['scale',0].y == 2.88
|
76
|
+
|
77
|
+
sm['position',0].x=42
|
78
|
+
assert sm['position',0].x==42
|
79
|
+
|
80
|
+
sm['position',0].y=17
|
81
|
+
assert sm['position',0].y==17
|
82
|
+
assert sm['position',0].x==42
|