Changeset 192e299 in thomson for elec/CrO2/software/gui.cpp
- Timestamp:
- Feb 3, 2012, 7:37:06 PM (12 years ago)
- Branches:
- main
- Children:
- c2a9854
- Parents:
- f9263dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
elec/CrO2/software/gui.cpp
rf9263dd r192e299 14 14 15 15 // Start status poller "thread" 16 int pollStatus(Ihandle* ih) 17 { 16 int pollStatus(Ihandle* ih) 17 { 18 try { 18 19 Ihandle* motoron = (Ihandle*)IupGetAttribute(ih, "target"); 19 20 … … 23 24 else 24 25 IupSetAttribute(motoron, "VALUE", "1"); // motor ON 25 return IUP_DEFAULT; 26 } catch(const char*) { 27 // Silently ignore exception if device is not available - not a good 28 // idea to handle it from a timer... 29 // Keep the timer running so it starts working when the device is 30 // plugged 26 31 } 32 return IUP_DEFAULT; 33 } 27 34 28 35 void startPolling(Ihandle* target) { … … 37 44 38 45 /* UI */ 39 40 int Gui::menu_exit()41 {42 return IUP_CLOSE;43 }44 46 45 47 Gui::Gui(int* argc, char*** argv) … … 66 68 ); 67 69 68 69 70 // CONTROL 70 71 Ihandle* motoron = IupProgressBar(); … … 81 82 IupSetAttribute(blocklist, "EXPAND", "VERTICAL"); 82 83 84 Ihandle* playToggle = IupToggle("play", NULL); 85 Callback<Gui, int>::create(playToggle, "ACTION", this, &Gui::setPlaying); 86 83 87 Ihandle* tabs = IupTabs( 84 88 IupVbox( … … 89 93 ), 90 94 IupHbox( 91 IupToggle("play",NULL),95 playToggle, 92 96 IupToggle("REC",NULL), 93 97 NULL … … 136 140 } 137 141 142 138 143 int Gui::menu_open() 139 144 { … … 147 152 return IUP_DEFAULT; 148 153 } 154 155 int Gui::menu_exit() 156 { 157 return IUP_CLOSE; 158 } 159 160 int Gui::setPlaying(int state) 161 { 162 if (state == 0) 163 { 164 // pause 165 } else { 166 // play 167 Device::getDevice().write(*file); 168 } 169 170 return IUP_DEFAULT; 171 }
Note:
See TracChangeset
for help on using the changeset viewer.