-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.kv
448 lines (358 loc) · 11.3 KB
/
Test.kv
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
WindowManager:
InputWindow:
ShearWindow:
MomentWindow:
AxialWindow:
DeflectionWindow:
<BackgroundColor@Widget>
background_color: 1, 1, 1, 1
canvas.before:
Color:
rgba: root.background_color
Rectangle:
size: self.size
pos: self.pos
<BackgroundLabel@Label+BackgroundColor>
background_color: 0, 0, 0, 0
<MomentButton@Button>
size_hint: (0.2, 0.2)
text: "Bending Moment graph"
on_release: app.root.current = "Moment"
<AxialButton@Button>
size_hint: (0.2, 0.2)
text: "Axial Stress graph"
on_release: app.root.current = "Axial"
<ShearButton@Button>
size_hint: (0.2, 0.2)
text: "Shear stress graph"
on_release: app.root.current = "Shear"
<DeflectionButton@Button>
size_hint: (0.2, 0.2)
text: "Deflection graph"
on_release: app.root.current = "Deflection"
<Indeterminate_load>
Label:
text: "At least either a Fixed support or a Pin Support (with another) are required"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Lengthchange_Error>
Label:
text: "Length can't be changed after it has been entered"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Non_Float_Error>
Label:
text: "Only numbers are allowed"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Length_Error>
Label:
text: "The length inputted must be greater than 0"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Position_Error>
Label:
text: "The distance inputted must be between 0 and the length of the beam"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Before_Length_Error>
Label:
text: "A length must be specified before adding supports or loads"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Non_Equation_Error>
Label:
text: "Only numbers are allowed"
size_hint: (1,1)
pos_hint: {'x':0,'y':0}
<Support_Input>
support_dis: support_dis_input
Label:
text: "Distance from LHS of support (m)"
size_hint:(1, 0.3)
pos_hint: {'top': 1, 'x': 0}
TextInput:
size_hint: (1, 0.3)
pos_hint: {'y': 0.4, 'x': 0}
id: support_dis_input
Button:
size_hint: (1, 0.4)
pos_hint: {'y': 0, 'x': 0}
text: "Input Support"
on_release: root.inputsupport()
<Moment_Input>
moment_mag: moment_mag_input
moment_dis: moment_dis_input
Label:
size_hint: (0.5, 0.3)
pos_hint: {'top': 1, 'x': 0}
text: "Distance from LHS of moment (m)"
TextInput:
id: moment_dis_input
pos_hint: {'top': 1, 'x': 0.5}
size_hint: (0.5, 0.3)
Label:
size_hint: (0.5, 0.3)
pos_hint: {'x': 0, 'y': 0.4}
text: "Magnitude of Moment (kNm)"
TextInput:
id: moment_mag_input
pos_hint: {'x': 0.5, 'y': 0.4}
size_hint: (0.5, 0.3)
Button:
pos_hint: {'x': 0, 'y': 0}
size_hint: (1, 0.4)
text: "Input Moment"
on_release: root.inputmoment()
<Point_Input>
point_mag: point_mag_input
point_dis: point_dis_input
point_angle: point_angle_input
Label:
size_hint: (0.5, 0.25)
pos_hint: {'top': 1, 'x': 0}
text: "Distance from LHS of load (m)"
TextInput:
id: point_dis_input
pos_hint: {'top': 1, 'x': 0.5}
size_hint: (0.5, 0.25)
Label:
size_hint: (0.5, 0.25)
pos_hint: {'x': 0, 'y': 0.5}
text: "Magnitude of Point Load (kN)"
TextInput:
id: point_mag_input
pos_hint: {'x': 0.5, 'y': 0.5}
size_hint: (0.5, 0.25)
Label:
text: "Angle of Point load (degrees)"
size_hint: (0.5, 0.25)
pos_hint: {'x': 0 , 'y': 0.25}
TextInput:
id: point_angle_input
size_hint: (0.5, 0.25)
pos_hint: {'x': 0.5 , 'y': 0.25}
Button:
pos_hint: {'x': 0, 'y': 0}
size_hint: (1, 0.25)
text: "Input Point Load"
on_release: root.inputpoint()
<Distributed_Input>
dis_start: dis_start_input
dis_end: dis_end_input
dis_startv: dis_startv_input
dis_endv: dis_endv_input
Label:
text: "Distributed Load Start (from LHS in m)"
size_hint: (0.5, 0.25)
pos_hint: {'top': 1, 'x': 0}
TextInput:
id: dis_start_input
size_hint: (0.5, 0.25)
pos_hint: {'top': 1, 'x': 0.5}
Label:
text: "Distributed Load End (from LHS in m)"
pos_hint: {'y': 0.5, 'x': 0}
size_hint: (0.5, 0.25)
TextInput:
id: dis_end_input
pos_hint: {'y': 0.5, 'x': 0.5}
size_hint: (0.5, 0.25)
Label:
text: "Start value (kN)"
pos_hint: {'y': 0.25, 'x': 0}
size_hint: (0.25, 0.25)
TextInput:
id: dis_startv_input
pos_hint: {'y': 0.25, 'x': 0.25}
size_hint: (0.25, 0.25)
Label:
text: "End value (kN)"
pos_hint: {'y': 0.25, 'x': 0.5}
size_hint: (0.25, 0.25)
TextInput:
id: dis_endv_input
pos_hint: {'y': 0.25, 'x': 0.75}
size_hint: (0.25, 0.25)
Button:
text: "Input distributed loads"
pos_hint: {'y': 0, 'x': 0}
size_hint: (1, 0.25)
on_release: root.inputdis()
<InputWindow>:
on_enter: root.clear()
name: "input"
length: lengthinput
FloatLayout:
BackgroundLabel:
pos_hint: {'top': 1,'x': 0}
size_hint: (0.6, 0.15)
background_color: 0.1, 0.0, 0.6, 1
text: "Current Beam"
Button:
pos_hint: {'x':0, 'y':0.75}
size_hint: (0.2,0.1)
text: "Update Drawing"
on_release: root.update_drawing()
Button:
pos_hint: {'x':0.4, 'y':0.75}
size_hint: (0.2, 0.1)
text: "Reset"
on_release: root.clear()
BackgroundLabel:
pos_hint: {'top': 1,'x': 0.6}
size_hint: (0.4, 0.15)
background_color: 0, 0.4, 0.5, 1
text: "Input:"
GridLayout:
size_hint: (0.4, 0.65)
pos_hint: {'x': 0.6, 'y': 0.2}
cols: 2
Button:
text: "Fixed Support"
on_release: root.supportbtn("Fixed")
Button:
text: "Pin Support"
on_release: root.supportbtn("Pin")
Button:
text: "Roller Support"
on_release: root.supportbtn("Roller")
Button:
on_release: root.pointbtn()
text: "Point Load"
Button:
text: "Moment"
on_release: root.momentbtn()
Button:
on_release: root.DLbtn()
text: "Distributed Load"
Button:
text: "Length (m) :"
on_release: root.lengthbtn()
TextInput:
id: lengthinput
Button:
pos_hint: {'x': 0.6, 'y':0}
size_hint: (0.4, 0.2)
text: "Calculate"
on_release: root.load_check()
<ShearWindow>:
name: "Shear"
min_value: min_value
max_value: max_value
on_enter: root.eqprint()
on_leave: root.eqremove()
FloatLayout:
Label:
pos_hint: {'x': 0.8, 'y': 0.8}
size_hint: (0.2, 0.1)
id: min_value
Label:
pos_hint: {'x': 0.0, 'y':0.0}
size_hint: (0.7, 0.05)
text: "Negative: Shear stress is downwards | Positive: Shear stress is upwards"
Label:
pos_hint: {'x': 0.8, 'y': 0.9}
size_hint: (0.2, 0.1)
id: max_value
AxialButton:
pos_hint: {'x': 0.8, 'y': 0.6}
MomentButton:
pos_hint: {'x': 0.8, 'y': 0.4}
DeflectionButton:
pos_hint: {'x': 0.8, 'y': 0.2}
Button:
pos_hint: {'x': 0.8, 'y': 0}
size_hint: (0.2, 0.2)
text: "Calculate Another Beam"
on_release: app.root.current = "input"
<MomentWindow>:
name: "Moment"
min_value: min_value
max_value: max_value
on_enter: root.eqprint()
on_leave: root.eqremove()
FloatLayout:
Label:
pos_hint: {'x': 0.0, 'y':0.0}
size_hint: (0.7, 0.05)
text: "Negative: Hogging (curves in U shape) | Positive: Sagging (curves in n shape)"
Label:
pos_hint: {'x': 0.8, 'y': 0.8}
size_hint: (0.2, 0.1)
id: min_value
Label:
pos_hint: {'x': 0.8, 'y': 0.9}
size_hint: (0.2, 0.1)
id: max_value
ShearButton:
pos_hint: {'x': 0.8, 'y': 0.4}
AxialButton:
pos_hint: {'x': 0.8, 'y': 0.6}
DeflectionButton:
pos_hint: {'x': 0.8, 'y': 0.2}
Button:
pos_hint: {'x': 0.8, 'y': 0}
size_hint: (0.2, 0.2)
text: "Calculate Another Beam"
on_release: app.root.current = "input"
<DeflectionWindow>:
name: "Deflection"
min_value: min_value
max_value: max_value
on_enter: root.eqprint()
on_leave: root.eqremove()
FloatLayout:
Label:
pos_hint: {'x': 0.8, 'y': 0.8}
size_hint: (0.2, 0.1)
id: min_value
Label:
pos_hint: {'x': 0.8, 'y': 0.9}
size_hint: (0.2, 0.1)
id: max_value
Label:
pos_hint: {'x': 0.0, 'y':0.0}
size_hint: (0.7, 0.05)
text: "Negative: Distance deflected below beam | Positive: Distance deflected above beam"
ShearButton:
pos_hint: {'x': 0.8, 'y': 0.4}
MomentButton:
pos_hint: {'x': 0.8, 'y': 0.2}
AxialButton:
pos_hint: {'x': 0.8, 'y': 0.6}
Button:
pos_hint: {'x': 0.8, 'y': 0}
size_hint: (0.2, 0.2)
text: "Calculate Another Beam"
on_release: app.root.current = "input"
<AxialWindow>:
name: "Axial"
min_value: min_value
max_value: max_value
on_enter: root.eqprint()
on_leave: root.eqremove()
FloatLayout:
Label:
pos_hint: {'x': 0.0, 'y':0.0}
size_hint: (0.7, 0.05)
text: "Negative: Axial stress is towards LHS | Positive: Axial stress is towards RHS"
Label:
pos_hint: {'x': 0.8, 'y': 0.8}
size_hint: (0.2, 0.1)
id: min_value
Label:
pos_hint: {'x': 0.8, 'y': 0.9}
size_hint: (0.2, 0.1)
id: max_value
ShearButton:
pos_hint: {'x': 0.8, 'y': 0.6}
MomentButton:
pos_hint: {'x': 0.8, 'y': 0.4}
DeflectionButton:
pos_hint: {'x': 0.8, 'y': 0.2}
Button:
pos_hint: {'x': 0.8, 'y': 0}
size_hint: (0.2, 0.2)
text: "Calculate Another Beam"
on_release: app.root.current = "input"