Check-in [4e4c79c176]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Did place holder work on the configuration panel.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:4e4c79c176dbfdc60be62e65c0c316f1252628a460f431c9fe6d81327e15b50a
User & Date: gwlester 2018-02-06 04:58:42
Context
2018-02-06
21:30
Partial changes to GUI. check-in: cbfaf8f537 user: gwlester tags: trunk
04:58
Did place holder work on the configuration panel. check-in: 4e4c79c176 user: gwlester tags: trunk
2018-02-02
01:58
Corrected typos. check-in: 519803a9b5 user: gwlester tags: trunk
Changes

Changes to Multisensor_Example.tcl.

42
43
44
45
46
47
48




































49
50
51
52
53
54
55
...
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
    gyro,y,axis 0x16
    gyro,z,axis 0x18
    rate 50
    digits 5
    decimals 1
    minChange 0.1
}





































set i2cbus 1
set dIMUaddress 0x28
set range 2000dps


foreach type {gyroscope accelerometer magnetometer gravity linearAcceleration quaternion prh} {
................................................................................
    CreateGravityFrame .main.gravity
    CreateLinearAccelerationFrame .main.linearAcceleration
    CreateQuaternionFrame .main.quaternion
    CreatePitchRollHeadingFrame .main.prh
}

proc CreateConfigurationFrame {w} {


























    ttk::label $w.busLbl \
        -text {I2C Bus:}
    ttk::combobox $w.busCMB \
        -textvariable ::i2cbus \
        -values [list 1] \
        -state readonly
    ttk::label $w.addrLbl \
        -text {iDMU Address:}
    ttk::entry $w.addrEnt \
        -width 5 \
        -textvariable ::dIMUaddress \
        -state readonly
    ttk::label $w.rangeLbl \
        -text {Range:}
    ttk::combobox $w.rangeCMB \
        -textvariable ::range \
        -values [list 250dps 500dps 2000dps] \
        -state readonly
    ttk::label $w.rateLbl1 \
        -text {Refresh Rate:}
    ttk::spinbox $w.rateEnt \
        -from 50.0 \
        -to 500.0 \
        -increment 10.0 \
        -format {%3.0f} \
        -wrap no \
        -command [format {set ::GyroValues(rate) [expr {entier([%1$s get])}]}  $w.rateEnt]


    $w.rateEnt set 50.0









    ttk::label $w.rateLbl2 \
        -text { in microseconds}




    ttk::label $w.numDigitsLbl \
        -text {Digits before decimal}


































    ttk::combobox $w.numDigitsCMB \






        -textvariable ::GyroValues(digits) \
        -values [list 3 4] \
        -state readonly
    ttk::label $w.numDecimalsLbl \
        -text {Digits after decimal}
    ttk::combobox $w.numDecimalsCMB \
        -textvariable ::GyroValues(decimals) \
        -values [list 1 2 3 4] \
        -state readonly
    ttk::label $w.minChangeLbl1 \
        -text {Ignore less than}
    ttk::spinbox $w.minChangeEnt \
        -from 0.1 \
        -to 200.0 \
        -increment 0.1 \
        -format {%5.1f} \
        -wrap no \
        -textvariable ::GyroValues(minChange)
    ttk::label $w.minChangeLbl2 \
        -text {dps change}
    ttk::frame $w.buttons


















































    ttk::button $w.buttons.start \
        -text {Start} \
        -width 6 \
        -command StartReading
    ttk::button $w.buttons.stop \
        -state disabled \
        -text {Stop} \
        -width 6 \
        -command StopReading
    
    $w.minChangeEnt set $::GyroValues(minChange)
        
    grid configure $w.busLbl $w.busCMB $w.addrLbl $w.addrEnt $w.rangeLbl $w.rangeCMB x -padx 2 -sticky ew
    grid configure $w.rateLbl1 $w.rateEnt $w.rateLbl2 x x x x -padx 2 -sticky ew
    grid configure $w.numDigitsLbl $w.numDigitsCMB $w.numDecimalsLbl $w.numDecimalsCMB x x x -padx 2 -sticky ew
    grid configure $w.minChangeLbl1 $w.minChangeEnt $w.minChangeLbl2 x x x x -padx 2 -sticky ew
    grid configure $w.buttons -columnspan 7 -sticky ew -pady 3
    grid configure x $w.buttons.start x  $w.buttons.stop x  -sticky ew
    grid columnconfigure $w.buttons {0 2 4} -weight 1

    grid columnconfigure $w 4 -weight 1
        
}

proc CreateGyroFrame {w} {
    ttk::labelframe $w.readings \
        -text {Current Readings}
    ttk::labelframe $w.history \







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

|



|

|



|
<
<
<
<
<
<

|





|
>
>
|
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>



|

|



|

|






|

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|



|




<
<
<
<
<
<
<
<
<
<
>
|







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
...
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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481










482
483
484
485
486
487
488
489
490
    gyro,y,axis 0x16
    gyro,z,axis 0x18
    rate 50
    digits 5
    decimals 1
    minChange 0.1
}

array set AccelValues {
    250dps  0x00
    500dps  0x10
    2000dps 0x30
    250dps,divisor 128.0
    500dps,divisor 64.0
    2000dps,divisor 16.0
    divisor 16.0
    full_scale_range 0x30
    gyro,x,axis 0x14
    gyro,y,axis 0x16
    gyro,z,axis 0x18
    rate 50
    digits 5
    decimals 1
    minChange 0.1
}

array set MagValues {
    250dps  0x00
    500dps  0x10
    2000dps 0x30
    250dps,divisor 128.0
    500dps,divisor 64.0
    2000dps,divisor 16.0
    divisor 16.0
    full_scale_range 0x30
    gyro,x,axis 0x14
    gyro,y,axis 0x16
    gyro,z,axis 0x18
    rate 50
    digits 5
    decimals 1
    minChange 0.1
}

set i2cbus 1
set dIMUaddress 0x28
set range 2000dps


foreach type {gyroscope accelerometer magnetometer gravity linearAcceleration quaternion prh} {
................................................................................
    CreateGravityFrame .main.gravity
    CreateLinearAccelerationFrame .main.linearAcceleration
    CreateQuaternionFrame .main.quaternion
    CreatePitchRollHeadingFrame .main.prh
}

proc CreateConfigurationFrame {w} {
    set general $w.gen
    set accel $w.acc
    set gyro $w.gyro
    set mag $w.mag
    set control $w.controls

    ttk::labelframe $general \
        -text "General"
    ttk::labelframe $accel \
        -text "Accelerometer"
    ttk::labelframe $gyro \
        -text "Gyrometer"
    ttk::labelframe $mag \
        -text "Magnetometer"
    ttk::frame $control
    grid configure $general -sticky nsew -pady 2
    grid configure $accel -sticky nsew -pady 2
    grid configure $gyro -sticky nsew -pady 2
    grid configure $mag -sticky nsew -pady 2
    grid configure $control -sticky nsew -pady 4
    grid columnconfigure $w $mag -weight 1
    grid rowconfigure $w 5 -weight 1

    ##
    ## General Configuration group
    ##
    ttk::label $general.busLbl \
        -text {I2C Bus:}
    ttk::combobox $general.busCMB \
        -textvariable ::i2cbus \
        -values [list 1] \
        -state readonly
    ttk::label $general.addrLbl \
        -text {iDMU Address:}
    ttk::entry $general.addrEnt \
        -width 5 \
        -textvariable ::dIMUaddress \
        -state readonly
    ttk::label $general.rateLbl1 \






        -text {Refresh Rate:}
    ttk::spinbox $general.rateEnt \
        -from 50.0 \
        -to 500.0 \
        -increment 10.0 \
        -format {%3.0f} \
        -wrap no \
        -command [format {set ::GyroValues(rate) [expr {entier([%1$s get])}]}  $control.rateEnt]
    ttk::label $general.rateLbl2 \
        -text { in microseconds}
    $general.rateEnt set 50.0
    grid configure $general.busLbl $general.busCMB x x -padx 2 -sticky ew
    grid configure $general.addrLbl $general.addrEnt x x -padx 2 -sticky ew
    grid configure $general.rateLbl1 $general.rateEnt $general.rateLbl2 x -padx 2 -sticky ew
    grid columnconfigure $general $general.addrEnt -uniform entry
    grid columnconfigure $general 3 -weight 1

    ##
    ## Accelerometer group
    ##
    ttk::label $accel.rangeLbl \
        -text {Range:}
    ttk::combobox $accel.rangeCMB \
        -textvariable ::range \
        -values [list 250dps 500dps 2000dps] \
        -state readonly
    ttk::label $accel.numDigitsLbl \
        -text {Digits before decimal}
    ttk::combobox $accel.numDigitsCMB \
        -textvariable ::AccelValues(digits) \
        -values [list 3 4] \
        -state readonly
    ttk::label $accel.numDecimalsLbl \
        -text {Digits after decimal}
    ttk::combobox $accel.numDecimalsCMB \
        -textvariable ::AccelValues(decimals) \
        -values [list 1 2 3 4] \
        -state readonly
    ttk::label $accel.minChangeLbl1 \
        -text {Ignore less than}
    ttk::spinbox $accel.minChangeEnt \
        -from 0.1 \
        -to 200.0 \
        -increment 0.1 \
        -format {%5.1f} \
        -wrap no \
        -textvariable ::AccelValues(minChange)
    ttk::label $accel.minChangeLbl2 \
        -text {dps change}
    grid configure $accel.rangeLbl $accel.rangeCMB x x -padx 2 -sticky ew
    grid configure $accel.numDigitsLbl $accel.numDigitsCMB x x -padx 2 -sticky ew
    grid configure $accel.numDecimalsLbl $accel.numDecimalsCMB x x -padx 2 -sticky ew
    grid configure $accel.minChangeLbl1 $accel.minChangeEnt $accel.minChangeLbl2 x -padx 2 -sticky ew
    grid columnconfigure $accel 3 -weight 1

    $accel.minChangeEnt set $::AccelValues(minChange)
    
    ##
    ## Gyrometer
    ##
    ttk::label $gyro.rangeLbl \
        -text {Range:}
    ttk::combobox $gyro.rangeCMB \
        -textvariable ::range \
        -values [list 250dps 500dps 2000dps] \
        -state readonly
    ttk::label $gyro.numDigitsLbl \
        -text {Digits before decimal}
    ttk::combobox $gyro.numDigitsCMB \
        -textvariable ::GyroValues(digits) \
        -values [list 3 4] \
        -state readonly
    ttk::label $gyro.numDecimalsLbl \
        -text {Digits after decimal}
    ttk::combobox $gyro.numDecimalsCMB \
        -textvariable ::GyroValues(decimals) \
        -values [list 1 2 3 4] \
        -state readonly
    ttk::label $gyro.minChangeLbl1 \
        -text {Ignore less than}
    ttk::spinbox $gyro.minChangeEnt \
        -from 0.1 \
        -to 200.0 \
        -increment 0.1 \
        -format {%5.1f} \
        -wrap no \
        -textvariable ::GyroValues(minChange)
    ttk::label $gyro.minChangeLbl2 \
        -text {dps change}
    grid configure $gyro.rangeLbl $gyro.rangeCMB x x -padx 2 -sticky ew
    grid configure $gyro.numDigitsLbl $gyro.numDigitsCMB x x -padx 2 -sticky ew
    grid configure $gyro.numDecimalsLbl $gyro.numDecimalsCMB x x -padx 2 -sticky ew
    grid configure $gyro.minChangeLbl1 $gyro.minChangeEnt $gyro.minChangeLbl2 x -padx 2 -sticky ew
    grid columnconfigure $gyro 3 -weight 1

    $gyro.minChangeEnt set $::GyroValues(minChange)

    ##
    ## Magnetometer group
    ##
    ttk::label $mag.rangeLbl \
        -text {Range:}
    ttk::combobox $mag.rangeCMB \
        -textvariable ::range \
        -values [list 250dps 500dps 2000dps] \
        -state readonly
    ttk::label $mag.numDigitsLbl \
        -text {Digits before decimal}
    ttk::combobox $mag.numDigitsCMB \
        -textvariable ::MagValues(digits) \
        -values [list 3 4] \
        -state readonly
    ttk::label $mag.numDecimalsLbl \
        -text {Digits after decimal}
    ttk::combobox $mag.numDecimalsCMB \
        -textvariable ::MagValues(decimals) \
        -values [list 1 2 3 4] \
        -state readonly
    ttk::label $mag.minChangeLbl1 \
        -text {Ignore less than}
    ttk::spinbox $mag.minChangeEnt \
        -from 0.1 \
        -to 200.0 \
        -increment 0.1 \
        -format {%5.1f} \
        -wrap no \
        -textvariable ::MagValues(minChange)
    ttk::label $mag.minChangeLbl2 \
        -text {dps change}
    grid configure $mag.rangeLbl $mag.rangeCMB x x -padx 2 -sticky ew
    grid configure $mag.numDigitsLbl $mag.numDigitsCMB x x -padx 2 -sticky ew
    grid configure $mag.numDecimalsLbl $mag.numDecimalsCMB x x -padx 2 -sticky ew
    grid configure $mag.minChangeLbl1 $mag.minChangeEnt $mag.minChangeLbl2 x -padx 2 -sticky ew
    grid columnconfigure $mag 3 -weight 1

    $mag.minChangeEnt set $::MagValues(minChange)
    
    ##
    ## Buttons Group
    ##
    ttk::button $control.start \
        -text {Start} \
        -width 6 \
        -command StartReading
    ttk::button $control.stop \
        -state disabled \
        -text {Stop} \
        -width 6 \
        -command StopReading










    grid configure x $control.start x  $control.stop x  -sticky ew
    grid columnconfigure $control {0 2 4} -weight 1
        
}

proc CreateGyroFrame {w} {
    ttk::labelframe $w.readings \
        -text {Current Readings}
    ttk::labelframe $w.history \