1 == TI Thermostat Demo ==
3 Summary:
4 This software provides a demo thermostat application. All values are
5 initialized to hard-coded values first and then updated from the web
6 if internet options have been enabled. Each class defines a different
7 part of the user interface. They are defined as follows:
8 - Keyboard: provides a touch screen soft keyboard
9 This keyboard was looped in from another application and was
10 not written by me personally. It is the only part of the application
11 that uses a .ui file created using Qt Designer.
12 - awayscreen: provides the screen that defines the thermostat's function
13 when in AWAY MODE
14 - mainwindow: this base class provides the main screen. It acts as a
15 container for the themostatwidget, weatherwidget, and optionswidget
16 - optionswidget: this class provides a container for the 3 options buttons
17 allowing the user to pass control to the awayscreen, schedulescreen,
18 or settingscreen
19 - schedulescreen: this is by far the most complex class. It is the only
20 one which implements a graphics view in the place of traditional
21 widgets. It allows the user to set a weekly schedule
22 - settingscreen: this class allows the user to pick between a set of
23 predefined cities across the world and alternate between Celsius
24 and Fahrenheit
25 - schedulepoint: this class defines each of the 28 individual time points
26 within the schedulescreen. It is the only class derived from a
27 graphics item rather than a widget
28 - thermostatwidget: this class provides the widget that allows the user
29 to change the setpoint temperature and monitors the current indoor
30 temperature
31 - weatherwidget: this class provides the current outdoor temperature and
32 weather conditions along with a 3 day forecast
33 - webdata: this class is the only one that does not provide a ui element.
34 This class is reponsible for providing the underlying web functionality
35 More information can be found within each class definition.
37 Style:
38 Many of the style options were implemented using a style sheet. The style sheet
39 allows you to define the look and feel of the application. These parameters
40 are contained within thermostatdemo.qss
42 Possible contributions:
43 If you would like to contribute to this code, there are several areas that need
44 improvement.
45 - add error handling: at the current time, the program implements no error
46 handling. I simply ran out of time to add it. If the user enters any
47 invalid parameter (i.e. an incorrect proxy setting), the program will
48 simply crash. To the user, this appears as an unexplained program exit.
49 At the very least, some helpful dialog should be provided explaining
50 the nature of the crash
51 - provide better size control: this demo was specifically developed for the
52 AM335X Starter Kit which uses a 4.3" resistive touch screen. When
53 porting the demo to other screen sizes, the widgets will maintain their
54 size leaving lots of open space on larger screens. A mechanism should
55 be provided that allows the widgets to grow and shrink with the screen
56 size
57 - add 24 hour time option to settingscreen: just as the user can alternate
58 between Celsius and Fahrenheit, he or she should be able to change to a
59 24 hour clock. This is more difficult than it sounds. Before trying to
60 do this, study the way the C/F shift is implemented. It requires
61 communication between several classes and will also require exploring
62 the QTime API
63 - have temperature buttons change colors: an easy way to get introduced to
64 using Qt graphics would be to provide a function within schedulepoint
65 that causes the points to get more red as the set temperature is
66 increased and more blue as it is decreased
67 - add functionality to buttons at bottom of mainwindow (i.e. have energy
68 Button pop up a screen with a dial that shows current consumption)