• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revision33a5bfacf96f5c680418e353ffec5e7c083a85bf (tree)
Time2015-01-22 12:02:42
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Modify: PIONE tutorial of Loop Statement version-up with upto.
modified: SampleCode/PIONE/Advanced3/Annotation.pione
modified: SampleCode/PIONE/Advanced3/Ref3DtoRef2D.pione

Change Summary

Incremental Difference

--- a/SampleCode/PIONE/Advanced3/Annotation.pione
+++ b/SampleCode/PIONE/Advanced3/Annotation.pione
@@ -1,3 +1,3 @@
11 .@ PackageName :: "Ref3DtoRef2D"
22 .@ Editor :: "Kinoshita"
3-.@ Tag :: "v0.1.1"
3+.@ Tag :: "v0.2.0"
--- a/SampleCode/PIONE/Advanced3/Ref3DtoRef2D.pione
+++ b/SampleCode/PIONE/Advanced3/Ref3DtoRef2D.pione
@@ -1,117 +1,54 @@
11 Rule Ref3DtoRef2D
2- input '*.!*-{$val}'.all
3- input '*.ref3d-{$val}'
4- output '*.ref2d-{$val}'.all
5- output 'Ref3DtoRef2D.info-{$val}'
6- param $val
7-Flow
8- rule FlowLoop3Dto2D1 {val : $val}
9- rule Info3Dto2D {val : $val}
10-End
11-
12-Rule Info3Dto2D
13- input '*.ref2d-{$val}'.all
14- output 'Ref3DtoRef2D.info-{$val}'
15- param $val
16-Action
17- for file in $(ls *.ref2d-{$val})
18- do
19- echo "./$file" >> {$O[1]}
20- done
21-End
22-
23-Rule FlowLoop3Dto2D1
242 input '*!*!*.!Rot1-{$val}'
253 input '*!*!*.!Rot2-{$val}'
264 input '*!*!*.!Rot3-{$val}'
275 input '*.!Mode-{$val}'
286 input '*.ref3d-{$val}'
297 output '*.ref2d-{$val}'.all
8+ output 'Ref3DtoRef2D.info-{$val}'
309 $min1 := '{$I[1][1]}'.str().f()
3110 $max1 := '{$I[1][2]}'.str().f()
3211 $delta1 := '{$I[1][3]}'.str().f()
33- $loop1 := ($max1 - $min1) / $delta1
34- param $val1 := 0.0
35- param $val
36-Flow
37- rule FlowLoop3Dto2D2 {val1 : $val1, val :$val}
38-
39- if $val1 + 1.0 <= $loop1
40- rule FlowLoop3Dto2D1 {val1 : $val1 + 1.0, val :$val}
41- end
42-End
43-
44-Rule FlowLoop3Dto2D2
45- input '*!*!*.!Rot1-{$val}'
46- input '*!*!*.!Rot2-{$val}'
47- input '*!*!*.!Rot3-{$val}'
48- input '*.!Mode-{$val}'
49- input '*.ref3d-{$val}'
50- output '*.ref2d-{$val}'.all
12+ $loop1 := (($max1 - $min1) / $delta1).i()
5113 $min2 := '{$I[2][1]}'.str().f()
5214 $max2 := '{$I[2][2]}'.str().f()
5315 $delta2 := '{$I[2][3]}'.str().f()
54- $loop2 := ($max2 - $min2) / $delta2
55- param $val1
56- param $val2 := 0.0
57- param $val
58-Flow
59- rule FlowLoop3Dto2D3 {val1 : $val1, val2 : $val2, val :$val}
60-
61- if $val2 + 1.0 <= $loop2
62- rule FlowLoop3Dto2D2 {val1 : $val1, val2 : $val2 + 1.0, val :$val}
63- end
64-End
65-
66-Rule FlowLoop3Dto2D3
67- input '*!*!*.!Rot1-{$val}'
68- input '*!*!*.!Rot2-{$val}'
69- input '*!*!*.!Rot3-{$val}'
70- input '*.!Mode-{$val}'
71- input '*.ref3d-{$val}'
72- output '*.ref2d-{$val}'.all
16+ $loop2 := (($max2 - $min2) / $delta2).i()
7317 $min3 := '{$I[3][1]}'.str().f()
7418 $max3 := '{$I[3][2]}'.str().f()
7519 $delta3 := '{$I[3][3]}'.str().f()
76- $loop3 := ($max3 - $min3) / $delta3
77- param $val1
78- param $val2
79- param $val3 := 0.0
20+ $loop3 := (($max3 - $min3) / $delta3).i()
21+ $mode := '{$I[4][1]}'.str()
8022 param $val
8123 Flow
82- rule One3Dto2D {val1 : $val1, val2 : $val2, val3 : $val3, val :$val}
24+ rule One3Dto2D {rot1: $min1 + ((0.upto($loop1)).f() * $delta1), rot2: $min2 + ((0.upto($loop2)).f() * $delta2), rot3: $min3 + ((0.upto($loop3)).f() * $delta3), mode : $mode, val : $val}
25+ rule Info3Dto2D {val : $val}
26+End
8327
84- if $val3 + 1.0 <= $loop3
85- rule FlowLoop3Dto2D3 {val1 : $val1, val2 : $val2, val3 : $val3 + 1.0, val :$val}
86- end
28+Rule Info3Dto2D
29+ input '*.ref2d-{$val}'.all
30+ output 'Ref3DtoRef2D.info-{$val}'
31+ param $val
32+Action
33+ for file in $(ls *.ref2d-{$val})
34+ do
35+ echo "./$file" >> {$O[1]}
36+ done
8737 End
8838
8939 Rule One3Dto2D
90- input '*!*!*.!Rot1-{$val}'
91- input '*!*!*.!Rot2-{$val}'
92- input '*!*!*.!Rot3-{$val}'
93- input '*.!Mode-{$val}'
9440 input '*.ref3d-{$val}'
9541 output '*.ref2d-{$val}'.all
96- param $val1
97- param $val2
98- param $val3
42+ param $rot1
43+ param $rot2
44+ param $rot3
45+ param $mode
9946 param $val
10047 Action
101- min1={$I[1][1]}
102- min2={$I[2][1]}
103- min3={$I[3][1]}
104- delta1={$I[1][3]}
105- delta2={$I[2][3]}
106- delta3={$I[3][3]}
107- mode={$I[4][1]}
108- rot1=$(echo "scale=5; {$val1} * $delta1 + $min1" | bc)
109- rot2=$(echo "scale=5; {$val2} * $delta2 + $min2" | bc)
110- rot3=$(echo "scale=5; {$val3} * $delta3 + $min3" | bc)
111- output="{$I[5][1]}-$mode-$rot1-$rot2-$rot3.ref2d-{$val}"
112- mrc3Dto2D -i {$I[5]} -o $output \
113- -Rot1 $rot1 $rot1 1 \
114- -Rot2 $rot2 $rot2 1 \
115- -Rot3 $rot3 $rot3 1 \
116- -EulerMode $mode;
48+ output="{$I[1][1]}-{$mode}-{$rot1}-{$rot2}-{$rot3}.ref2d-{$val}"
49+ mrc3Dto2D -i {$I[1]} -o $output \
50+ -Rot1 {$rot1} {$rot1} 1 \
51+ -Rot2 {$rot2} {$rot2} 1 \
52+ -Rot3 {$rot3} {$rot3} 1 \
53+ -EulerMode {$mode};
11754 End
Show on old repository browser