starblade.kv 4.48 KB
Newer Older
Jakob Knollmueller's avatar
Jakob Knollmueller committed
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#:kivy 1.0.9
TextInput:
    on_parent:self.focus = True

<MyWidget>:
    image_widget: image_widget
    menu_widget: menu_widget
    data_path: 'hst_05195_01_wfpc2_f702w_pc_sci.fits'
    result_path: ''
    alpha: 1.5
    spacing: 10
    orientation: 'horizontal'

    MenuWidget:
        id: menu_widget
        size_hint: 0.5,1


    ImageWidget:
        id: image_widget
        size_hint: 1,1


<MyAlphaWidget>:
    orientation: 'horizontal'
    Label:
        text: unichr(945)
    FloatInput
        text: '1.5'
        on_text: app.set_alpha(self.text)
<IterationWidget>:
    orientation: 'horizontal'
    Label:
        text: 'iterations'
    IntInput
        text: '3'
        on_text: app.set_iterations(self.text)

<FloatInput>:
    multiline: False
<IntInput>:
    multiline: False

<MyImage>:
    text: self.text
    source: self.source
    img: img
    orientation: 'vertical'
    spacing: 10

    Label:
        text: self.parent.text
        size_hint: 1,0.1
    Image:
        id: img
        source: self.parent.source
<AllImageWidget>:
    data: data
    points: points
    diffuse: diffuse
    power:power
    orientation: 'vertical'
    spacing: 10
    BoxLayout
        spacing: 10
        orientation: 'horizontal'
        MyImage:
            id: data
            text: 'data'
            source: app.data_image
        MyImage:
            id: diffuse
            source: app.diffuse_image
            text: 'diffuse'
    BoxLayout:
        spacing: 10
        orientation: 'horizontal'
        MyImage:
            id:points
            source: app.points_image
            text: 'points'
        MyImage:
            id: power
            source: app.power_image
            text: 'power'
<DisplayWidget>
    all: all
    points: points
    diffuse: diffuse
    data: data
    power: power
    AllImageScreen:
        id:all
        name: 'all'
        on_pre_enter: self.reload()

    SingleImageScreen:
        id:data
        name: 'data'
        text: 'data'
        source: app.data_image
        on_pre_enter: self.reload()

    SingleImageScreen:
        id: diffuse
        name: 'diffuse'
        text: 'diffuse'
        source: app.diffuse_image
        on_pre_enter: self.reload()

    SingleImageScreen:
        id: points
        name: 'points'
        text: 'points'
        source: app.points_image
        on_pre_enter: self.reload()

    SingleImageScreen:
        id:power
        name: 'power'
        text: 'power'
        source: app.power_image
        on_pre_enter: self.reload()


<SingleImageScreen>
    img: img
    name: ''
    source: self.source
    text: ''
    MyImage
        id: img
        text: self.parent.text
        source: self.parent.source

<AllImageScreen>
    name: ''
    all : all
    AllImageWidget
        id:all

<MenuWidget>:
    orientation: 'vertical'
    MyAlphaWidget:
        size_hint: 1,0.1
    IterationWidget:
        size_hint: 1,0.1


    ActionWidget

<ActionWidget>:
    orientation: 'horizontal'
    Button:
        text: 'load data'
        on_press:  app.root.current = 'file'
    Button:
        text: 'run separation'
        on_press: app.run_separation()
    Button:
        text: 'save results'
        on_press:  app.save_results()

<DisplayChoiceWidget>:
    orientation: 'horizontal'
    Button:
        text: 'all'
        on_press: app.image_widget.current = 'all'
    Button:
        text: 'data'
        on_press: app.image_widget.current = 'data'
    Button:
        text: 'diffuse'
        on_press: app.image_widget.current = 'diffuse'
    Button:
        text: 'points'
        on_press: app.image_widget.current = 'points'
    Button:
        text: 'power'
        on_press: app.image_widget.current = 'power'
<ImageWidget>:
    orientation: 'vertical'
    image_widget : image_widget

    DisplayChoiceWidget:
        size_hint: 1, 0.1
    DisplayWidget:
        id: image_widget


<MyPathBrowser>:
    id: _filebrowser
    dirselect: True

<MyFileBrowser>:

<GlobalScreenManager>:
    file: file
    main: main
    path: path

    MainScreen:
        id: main
        name: 'main'

    FileScreen:
        id:file
        name: 'file'

    PathScreen:
        id: path
        name: 'path'


<FileScreen>:
    MyFileBrowser:
        on_success: app.load_data(self.selection)
        on_canceled: app.root.current = 'main'

<MainScreen>:
    image_widget: image_widget
    MyWidget:
        id:image_widget
<PathScreen>:
    MyPathBrowser
        filters: [root.is_dir]
        on_success: app.select_path(self.selection)
        on_canceled: app.root.current = 'main'