diff --git a/CONTRIBUTIONS.tavispa b/CONTRIBUTIONS.tavispa new file mode 100644 index 0000000..3645d5b --- /dev/null +++ b/CONTRIBUTIONS.tavispa @@ -0,0 +1,7 @@ +My contributions to this project involved developing the layout for the timer GUI and locating resources for us to use to develop in QT. +I also attempted to manage the repo but we had some problems with it where we couldn't it to sync correctly so we often did things through +dropbox instead. +I wrote prototype code in C and Qt's C++ to demonstrate the single timer application. +I wrote the code for the single timer application and made the decisions on the GUI architecture, and decided on its limitations for the scope of this project. + +I also tried to update the README as feedback was received. diff --git a/CONTRIBUTIONS.thomasw4 b/CONTRIBUTIONS.thomasw4 new file mode 100644 index 0000000..79fb75e --- /dev/null +++ b/CONTRIBUTIONS.thomasw4 @@ -0,0 +1,9 @@ + +I worked on some of the qt code and ui files. Made changes and updates to some of the source code. Usig github posed some problems for us, we often times +couldn't push or pull. We reverted to dropbox and email, to collaborate on the project. Most of my contribution is for the text based timer (console input and output) +and trying to link the gui to the console. As it is right now, the gui is working great, the console is working great, but still working on the interfacing between the two. +We have not pushed the console version to the repo yet. What we have now is working and in order to meet the deadline of a "working" submission, I chose to not push the +console version until later today. + + +I have added the new files for the text timer. The gui timer is now executed via the commandline using various options diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0c6cc71 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ + +CXX_FLAGS := -O2 -DNDEBUG -Wall -g -march=core2 -std=c++11 +CXX := g++ +INSTALL_DIR := ./ +export CXX +export CXX_FLAGS + +all: finalTimer timer + +finalTimer: + qmake timerGUI/finalTimer.pro -o timerGUI/Makefile + $(MAKE) -C timerGUI + #mv timerGUI/finalTimer $(INSTALL_DIR) + +timer: + $(MAKE) -C dispatcher + mv dispatcher/timer $(INSTALL_DIR) + +clean: + rm timerGUI/*.o + rm timerGUI/Makefile + rm timerGUI/moc* diff --git a/README b/README new file mode 100644 index 0000000..f849c45 --- /dev/null +++ b/README @@ -0,0 +1,74 @@ +A Timer application with three options. + + +In order to properly compile this program in a linux environment you must install the qt4 libraries if +they are not already on your system. To do this run this command from the terminal: + +sudo apt-get install libxtst-dev build-essential libqt4-dev qt4-qmake + + +To create the executable for the main directory run: + +make + +The executable for the TIMER will be called timer. + + +To clean the *.o, moc*, and Makefile from the timerGUI directory run: + +make clean + + +To Execute from command line: + +./timer [version option] [# of timers] + +version options: +1 - stand alone console timer (No GUI) +2 - stand alone GUI timer +3 - Timer that takes console input and outputs via GUI timer + +# of timers: +Number of timers needed (must be between 1 and 10) + + +Version 1 instructions: +NOTE:If you do not enter the time in the correct format, you will get a basic_string error. + + +User will be prompted to enter events and time for each event, the time must +be entered in the following format: + +HH:MM:SS + +User will be notified how long before the next event needs to be started and +notified again when to start that event + +If you use multiple timers, enter the events beginning at the LAST event: +For example, You want to cook 3 items, meat, potatoes, and corn. +Corn takes 10 seconds, potatoes takes 20 seconds, and meat takes 1 minute. +Run this command: +./timer 1 3 + +You will be prompted to 'enter timed event' and 'enter time needed.' Do this as follows: +Enter timed event: corn +Enter time needed for corn: 00:00:10 +Enter timed event: potatoes +Enter time needed for potatoes: 00:00:20 +Enter timed event: meat +Enter time needed for meat: 00:01:00 + + + + +Version 2 instructions: + +There are two buttons in the main window. The single timer button lauches a window that has a single count up or +count down timer. There are two options to choose what will occur when the timer finishes. The dependent timer button launches +a new timer that has dependencies. There is a About button for user instructions. + + +Version 3: + +Still under construction. +------------------------------------------------------------------------------------- diff --git a/dispatcher/Makefile b/dispatcher/Makefile new file mode 100644 index 0000000..5afd3bc --- /dev/null +++ b/dispatcher/Makefile @@ -0,0 +1,9 @@ + +all: timer + +timer: dispatcher.cpp + g++ -std=c++0x -g -o timer timer.cpp dispatcher.cpp + + + + diff --git a/dispatcher/dispatcher.cpp b/dispatcher/dispatcher.cpp new file mode 100644 index 0000000..8c69c3e --- /dev/null +++ b/dispatcher/dispatcher.cpp @@ -0,0 +1,97 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "timer.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + if(argc == 1 || argc ==2) + { + cout << "You must include the type of timer and the number of timers" << endl; + cout << "eg. ./timer 2 1" << endl; + cout << "See README for further documentation." << endl; + return EXIT_FAILURE; + } + + int switchCase = atoi(argv[1]); + int numberOfTimers = atoi(argv[2]); + + checkCommandLine(numberOfTimers, switchCase); + + string event; + string time; // string representation of user inputted time + int timeNumber; // variable to store timer as an integer + + vector timeDifference; //Vector of user inputted times + + int times[numberOfTimers]; // array to hold times + string events[numberOfTimers]; // array to hold events + + + + + + + if(switchCase==2) + { + execv("timerGUI/finalTimer",NULL); + } + else if(switchCase == 1) + { + //Populate vectors with user input + for(int index = 0; index < numberOfTimers; index++) + { + cout << "Enter timed event: "; + getline (cin, event); + events[index] = event; + cout << "Enter time needed for " << events[index] << " : "; + getline(cin, time); + timeNumber = convertTime(time); + times[index] = timeNumber; + } + + descendSort(times, events, numberOfTimers); // put longest times at beginning of array + + timeDifference = getTimeDifference(times, numberOfTimers); // Load time difference into vector + timeDifference.push_back(times[numberOfTimers-1]); // push the least time to the back of the timerDifference vector + + cout << "------------------------------------------------------------------------" << endl; + cout << "The timer for " << events[0] << " has started" << endl; + cout << "In " << timeDifference.at(0) << " seconds, you need to start the " << events[1] << endl; + cout << endl; + + + + for(int x = 0; x < numberOfTimers -1; x++) + { + if(newTimer(timeDifference.at(x))) + { + execute(x, numberOfTimers, timeDifference, events); + } + } + + return EXIT_SUCCESS; + } + else + { + cout << "***********************************************" << endl; + cout << "This version is still under construction" << endl; + cout << "When completed it will take input from the user" << + " and excute the gui timer interface for the provided input" << endl; + cout << "***********************************************" << endl; + pid_t pId = fork(); + exit(0); + } +return 0; + + +} + + diff --git a/dispatcher/timer.cpp b/dispatcher/timer.cpp new file mode 100644 index 0000000..c66b906 --- /dev/null +++ b/dispatcher/timer.cpp @@ -0,0 +1,186 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "timer.h" + + + +using namespace std; + + +/* + * Converts input string to seconds + * @parm inputTime - string format of time + * @return (sec + min + hour) - total time converted to seconds + */ + +int convertTime(string inputTime) +{ + int sec; + int min; + int hour; + + string secString=inputTime.substr(6,2); + string minString=inputTime.substr(3,2); + string hourString=inputTime.substr(0,2); + + //convert string to int for seconds + stringstream secTime(secString); + secTime >> sec; + //convert string to int for minutes + stringstream minTime(minString); + minTime >> min; + min = min * 60; + //convert string to int for hours + stringstream hourTime(hourString); + hourTime >> hour; + hour = hour * 3600; + + return (sec + min + hour); + +} + + +/* + * Output of timer to console + * @param number - number of timers + * @param timers - number of timers input by user + * @param timeDifference - vector of time differentials + * @param events - array of events + * + */ +void execute(int number, int timers, vector timeDifference, string events[]) +{ + if(number < timers-1) + { + cout << "Time to start " << events[number+1] << endl; + } + if(number < timers-2) + { + + cout << "In " << timeDifference.at(number+1) << " seconds, you need to start the " << events[number+2] << endl; + cout << endl; + } + if(number == timers-2 ) + { + sleep(timeDifference.at(timers)); + + cout << "***************************************************************************" << endl; + cout << "Everything is completed" << endl; + } +} + +/* + * Sorts the inputed times - longest time at first element of array + * @param sortTime[] - array of user input times + * @param sortEvent[] - array of user input events + * @param size - number of user input timers + */ + +void descendSort(int sortTime[], string sortEvent[], int size) +{ + int tempTime = 0; + string tempEvent = ""; + for (int i=0; i < size; i++) + { + for (int j=0; j <= i; j++) + { + if( sortTime[j] < sortTime[i]) + { + tempTime = sortTime[j]; + tempEvent = sortEvent[j]; + + sortTime[j] = sortTime[i]; + sortEvent[j] = sortEvent[i]; + + sortTime[i] = tempTime; + sortEvent[i] = tempEvent; + } + + } + } +} + +/* + * Check the given command line arguments for proper usage + * @param numberOfTimer - number of user input timers needed + * @param argc - number of command line arguments + * @param switchCase - value of argv[1] - used for determine which version to execute + */ + + +void checkCommandLine(int numberOfTimers, int switchCase) +{ + if(switchCase < 1 || switchCase > 3) + { + cout << "To use this application: Enter ./timer [timer option] [# of timers]" << endl; + cout << "-------------------------------------------------------------------" << endl; + cout << endl; + cout << "Timer 0ptions" << endl; + cout << "------------- " << endl; + cout << "1 - console timer" << endl; + cout << "2 - GUI timer" << endl; + cout << "3 - console input and GUI output" << endl; + exit(EXIT_FAILURE); + } + if(numberOfTimers > 10 || numberOfTimers < 1) + { + cout << "You can not use more than 10 timers on this system" << endl; + cout << "Please enter a number between 1 and 10 " << endl; + exit(EXIT_FAILURE); + } + +} + +/* + * Calculate the time difference between input timer values + * @param eventTimes[] - array of user input events + * @param size - number of user input timers + * @return delayTime - vector of times to delay. + */ + +vector getTimeDifference(int eventTimes[], int size) +{ + vector delayTime; + + if(size == 1) + { + delayTime.push_back(eventTimes[0]); + return delayTime; + } + else + { + for(int i = 0; i < size ; i ++) + { + delayTime.push_back(eventTimes[i] - eventTimes[i+1]); + } + + return delayTime; + } +} + +/* + * Simple function to sleep for given amount of time + * @param time - amount of time to sleep in seconds + * @return - 1 when sleep completes executing + */ +int newTimer(int time) +{ + int count = 0; + while(1) + { + sleep(1); + count ++; + if(count == time) + { + return 1; + } + } +} + diff --git a/dispatcher/timer.h b/dispatcher/timer.h new file mode 100644 index 0000000..c488f0c --- /dev/null +++ b/dispatcher/timer.h @@ -0,0 +1,23 @@ +#include +#include +#include +#include +#include +#include +#include +#include + + + + + +using namespace std; + +int convertTime(string inputTime); +void execute(int number, int timers, vector timeDifference, string events[]); +void descendSort(int sortTime[], string sortEvent[], int size); +void checkCommandLine(int numberOfTimers, int switchCase); +vector getTimeDifference(int eventTimes[], int size); +int newTimer(int time); + + diff --git a/finalTimer/finalTimer.pro.user b/finalTimer/finalTimer.pro.user deleted file mode 100755 index 666fc2b..0000000 --- a/finalTimer/finalTimer.pro.user +++ /dev/null @@ -1,113 +0,0 @@ - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - System - - - - ProjectExplorer.Project.Target.0 - - Desktop - Qt4ProjectManager.Target.DesktopTarget - 0 - 0 - - - qmake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - C:/Users/Xepher/Desktop/Classes/Spring 2012/ECE2524/Project/finalTimer-build-desktop - 2 - 2 - true - - - - qmake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - C:/Users/Xepher/Desktop/Classes/Spring 2012/ECE2524/Project/finalTimer-build-desktop - 2 - 2 - true - - 2 - - finalTimer - Qt4ProjectManager.Qt4RunConfiguration - 2 - - finalTimer.pro - false - false - - false - false - - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 4 - - diff --git a/finalTimer/dependent.cpp b/timerGUI/dependent.cpp similarity index 69% rename from finalTimer/dependent.cpp rename to timerGUI/dependent.cpp index 63e379e..b24ee41 100755 --- a/finalTimer/dependent.cpp +++ b/timerGUI/dependent.cpp @@ -16,7 +16,11 @@ dependent::~dependent() { delete ui; } - +/* +*on_pushStart_clicked +* On click event function for starting execution and connecting +* appropiate signals and slots. +*/ void dependent::on_pushStart_clicked() { @@ -31,17 +35,24 @@ void dependent::on_pushStart_clicked() mytimer->start(1000); } +/*stop +* Function to disconnect slots and signals when timers expire +* checks the main timer spin box values +*/ + void dependent::stop() { if(ui->spinBox_main_h->value() == 0 && ui->spinBox_main_m->value() == 0 && ui->spinBox_main_s->value() == 0){ disconnect(mytimer, SIGNAL(timeout()), this, SLOT(secDown())); } - // if(ui->spinBox_dep_h->value() == 0 && ui->spinBox_dep_m->value() == 0 && ui->spinBox_dep_s->value() == 0){ - // mytimer->disconnect(); - // mytimer->stop(); - //} + } +/*secUp +* Updates the main timer spin boxes and resets the boxes +* as dependent timer counts up +*/ + void dependent::secUp(){ ui->spinBox_main_s->stepUp(); if(ui->spinBox_main_s->value()==60){ @@ -54,6 +65,11 @@ void dependent::secUp(){ } } +/*secDown +* Updates the main timer spin boxes and reset as needed +* as dependent timer counts down +*/ + void dependent::secDown(){ ui->spinBox_main_s->stepDown(); if(ui->spinBox_main_s->value() == 0){ @@ -71,7 +87,9 @@ void dependent::secDown(){ ui->spinBox_main_s->setValue(59); } - +/*on_pushSet_Clicked +* +*/ void dependent::on_pushSet_clicked() { dep_h = ui->spinBox_main_h->value(); @@ -83,13 +101,17 @@ void dependent::on_pushSet_clicked() ui->spinBox_main_s->setValue(0); } } - +/*depSecUp +* +*/ void dependent::depSecUp(){ if(dep_h == ui->spinBox_main_h->value() && dep_m == ui->spinBox_main_m->value() && dep_s == ui->spinBox_main_s->value()){ connect(mytimer, SIGNAL(timeout()), this, SLOT(depUpStart())); } } - +/*depUpStart +* Starts the depenent timer up +*/ void dependent::depUpStart(){ ui->spinBox_dep_s->stepUp(); if(ui->spinBox_dep_s->value()==60){ @@ -102,6 +124,9 @@ void dependent::depUpStart(){ } } +/* +* Updates the dependent timer seconds spinbox +*/ void dependent::depSecDown(){ ui->spinBox_dep_s->stepDown(); if(ui->spinBox_dep_s->value() == 0){ @@ -118,21 +143,29 @@ void dependent::depSecDown(){ ui->spinBox_dep_s->setValue(59); } - +/* +* +*/ void dependent::checkToConnect(){ if(dep_h == ui->spinBox_main_h->value() && dep_m == ui->spinBox_main_m->value() && dep_s == ui->spinBox_main_s->value()-1) connect(mytimer, SIGNAL(timeout()), this, SLOT(depSecDown())); } +/* +* Function disconnects the signal from the slot and stops countings +*/ void dependent::on_pushStop_clicked() { mytimer->disconnect(); mytimer->stop(); } +/* +* Message box for user instructions +*/ void dependent::on_pushAbout_clicked() { - QMessageBox::information(this, "How to Use", - "countUp Instructions:\nSet the main timer to when you want the dependent timer to start and click 'set'.\n You can change the dependent timer after this. For example if you want to start at with the dependent timer at 5s, set the main timer, and then change the \n dependent timer spinbox to 5.\ncountDown Instructions:\nThe dependent timer can start when the main timer is 0:0:0 or you can set the dependent timer to start at specific time.\n Set the dependent timer as with the countUp instructions.\n You can then change the dependent timer.\n For example, set main timer to 5s, click set. Then\n change the dependent timer spin boxes to where you want to start."); + QMessageBox::information(this, "How to use", + "Count Up Instructions:\nSet the main timer to when you want the dependent timer to start and click 'set'.\n You can change the dependent timer after this. For example, if you want to start the dependent timer at 5s, set the main timer, and then change the\ndependent timer input box to 5.\n Count Down Instructions:\nThe dependent timer can start when the main timer is 0:0:0 or you can set the dependent timer to start at specific time.\n Set the dependent timer per the Count Up instructions.\n You can then change the dependent timer.\n For example, set main timer to 5s, click set. Then\n change the dependent timer spin boxes to where you want to start."); } diff --git a/finalTimer/dependent.h b/timerGUI/dependent.h similarity index 69% rename from finalTimer/dependent.h rename to timerGUI/dependent.h index d1cfa4b..b7e5bcc 100755 --- a/finalTimer/dependent.h +++ b/timerGUI/dependent.h @@ -33,12 +33,12 @@ public slots: private: Ui::dependent *ui; QTimer *mytimer; - int main_h; - int main_m; - int main_s; - int dep_h; - int dep_m; - int dep_s; + int main_h; // main timer hours + int main_m; // main timer minutes + int main_s; // main timer seconds + int dep_h; // dependent timer hours + int dep_m; // dependent timer minutes + int dep_s; // dependent timer seconds private slots: void on_pushAbout_clicked(); diff --git a/finalTimer/dependent.ui b/timerGUI/dependent.ui similarity index 52% rename from finalTimer/dependent.ui rename to timerGUI/dependent.ui index 58f0f85..304c3b4 100755 --- a/finalTimer/dependent.ui +++ b/timerGUI/dependent.ui @@ -1,192 +1,208 @@ - - - dependent - - - - 0 - 0 - 303 - 196 - - - - - 303 - 196 - - - - Dialog - - - - - 10 - 30 - 160 - 80 - - - - - - - - - - - - - - - - - - - - - - countUp - - - - - - - countDown - - - - - - - - - - - Start - - - - - - - Stop - - - - - - - - - - - 170 - 140 - 75 - 23 - - - - Set - - - - - - 70 - 10 - 61 - 16 - - - - Main Timer - - - - - - 50 - 120 - 91 - 16 - - - - Dependent Timer - - - - - - 180 - 170 - 91 - 17 - - - - Do Not Reset - - - - - - 9 - 140 - 161 - 22 - - - - - - - - - - - - - - - - - - 220 - 30 - 75 - 23 - - - - About - - - - - - - pushStop - clicked() - dependent - stop() - - - 237 - 156 - - - 268 - 156 - - - - - - stop() - - + + + dependent + + + + 0 + 0 + 455 + 416 + + + + Dependent Timers + + + + + 330 + 160 + 71 + 31 + + + + Set + + + + + + 120 + 20 + 121 + 16 + + + + + 16 + + + + Main Timer + + + + + + 90 + 110 + 191 + 31 + + + + + 16 + + + + Dependent Timer + + + + + + 310 + 120 + 141 + 17 + + + + Do Not Reset + + + + + + 60 + 150 + 251 + 51 + + + + + + + + + + + + + + + + + + 300 + 300 + 101 + 41 + + + + About + + + + + + 50 + 230 + 311 + 51 + + + + + + + Count Up + + + + + + + Count Down + + + + + + + + + 60 + 50 + 251 + 51 + + + + + + + + + + + + + + + + + + 20 + 300 + 121 + 41 + + + + Start + + + + + + 160 + 300 + 121 + 41 + + + + Stop + + + + + + + pushStop + clicked() + dependent + stop() + + + 237 + 156 + + + 268 + 156 + + + + + + stop() + + diff --git a/finalTimer/finalTimer.pro b/timerGUI/finalTimer.pro similarity index 100% rename from finalTimer/finalTimer.pro rename to timerGUI/finalTimer.pro diff --git a/timerGUI/finalTimer.pro.user b/timerGUI/finalTimer.pro.user new file mode 100755 index 0000000..65fce9f --- /dev/null +++ b/timerGUI/finalTimer.pro.user @@ -0,0 +1,167 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + 0 + + + + qmake + qmake + QtProjectManager.QMakeBuildStep + + false + + + Make + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + Make + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + C:/Users/Xepher/Desktop/Classes/Spring 2012/ECE2524/Project/finalTimer-build-desktop + 2 + 0 + true + + + + + qmake + qmake + QtProjectManager.QMakeBuildStep + + false + + + Make + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + Make + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + C:/Users/Xepher/Desktop/Classes/Spring 2012/ECE2524/Project/finalTimer-build-desktop + 2 + 0 + true + + 2 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + No deployment + No deployment + ProjectExplorer.DefaultDeployConfiguration + + 1 + + finalTimer + finalTimer + Qt4ProjectManager.Qt4RunConfiguration + 2 + + finalTimer.pro + false + false + + false + + 3768 + true + false + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {51d458ba-8523-45dd-b880-1e75999cdc84} + + + ProjectExplorer.Project.Updater.FileVersion + 8 + + diff --git a/finalTimer/main.cpp b/timerGUI/main.cpp similarity index 80% rename from finalTimer/main.cpp rename to timerGUI/main.cpp index a001eb2..c811da0 100755 --- a/finalTimer/main.cpp +++ b/timerGUI/main.cpp @@ -1,6 +1,8 @@ #include #include "mainwindow.h" +// Main Qt application start + int main(int argc, char *argv[]) { QApplication a(argc, argv); diff --git a/finalTimer/mainwindow.cpp b/timerGUI/mainwindow.cpp similarity index 100% rename from finalTimer/mainwindow.cpp rename to timerGUI/mainwindow.cpp diff --git a/finalTimer/mainwindow.h b/timerGUI/mainwindow.h similarity index 100% rename from finalTimer/mainwindow.h rename to timerGUI/mainwindow.h diff --git a/finalTimer/mainwindow.ui b/timerGUI/mainwindow.ui similarity index 83% rename from finalTimer/mainwindow.ui rename to timerGUI/mainwindow.ui index fd584d1..8a053dd 100755 --- a/finalTimer/mainwindow.ui +++ b/timerGUI/mainwindow.ui @@ -1,111 +1,111 @@ - - - MainWindow - - - - 0 - 0 - 136 - 128 - - - - - 136 - 128 - - - - MainWindow - - - - - - 30 - 0 - 75 - 23 - - - - Single Timer - - - - - - 10 - 30 - 121 - 41 - - - - One Main Timer -One Dependent Timer - - - - - - - 0 - 0 - 136 - 21 - - - - - - TopToolBarArea - - - false - - - - - - - - - pushButton - clicked() - MainWindow - openSingle() - - - 160 - 85 - - - 96 - 146 - - - - - pushButton_2 - clicked() - MainWindow - openDependent() - - - 225 - 104 - - - 296 - 106 - - - - - - openSingle() - openDependent() - - + + + MainWindow + + + + 0 + 0 + 224 + 228 + + + + + 224 + 228 + + + + Timer Program + + + + + + 30 + 0 + 150 + 60 + + + + Single Timer + + + + + + 10 + 80 + 200 + 60 + + + + One Main Timer +One Dependent Timer + + + + + + + 0 + 0 + 224 + 27 + + + + + + TopToolBarArea + + + false + + + + + + + + + pushButton + clicked() + MainWindow + openSingle() + + + 300 + 300 + + + 96 + 146 + + + + + pushButton_2 + clicked() + MainWindow + openDependent() + + + 225 + 104 + + + 296 + 106 + + + + + + openSingle() + openDependent() + + diff --git a/finalTimer/singletimer.cpp b/timerGUI/singletimer.cpp similarity index 100% rename from finalTimer/singletimer.cpp rename to timerGUI/singletimer.cpp diff --git a/finalTimer/singletimer.h b/timerGUI/singletimer.h similarity index 100% rename from finalTimer/singletimer.h rename to timerGUI/singletimer.h diff --git a/finalTimer/singletimer.ui b/timerGUI/singletimer.ui similarity index 62% rename from finalTimer/singletimer.ui rename to timerGUI/singletimer.ui index 8961133..29582b8 100755 --- a/finalTimer/singletimer.ui +++ b/timerGUI/singletimer.ui @@ -1,162 +1,194 @@ - - - singleTimer - - - - 0 - 0 - 319 - 166 - - - - Dialog - - - - - 20 - 10 - 161 - 51 - - - - - - - - - - - - - - - - - - 230 - 70 - 61 - 31 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">countDown</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> options</span></p></body></html> - - - Qt::RichText - - - - - - 10 - 70 - 191 - 19 - - - - - - - countUp - - - - - - - countDown - - - - - - - - - 210 - 110 - 96 - 42 - - - - - - - Show Message - - - - - - - Rollover - - - - - - - - - 20 - 100 - 161 - 25 - - - - - - - Start - - - - - - - Stop - - - - - - - - - - pushStop - clicked() - singleTimer - stop() - - - 209 - 174 - - - 211 - 186 - - - - - - countupStart() - countdownStart() - start() - stop() - - + + + singleTimer + + + + 0 + 0 + 619 + 367 + + + + Single Timer + + + + + 40 + 60 + 231 + 71 + + + + + + + + + + + + + + + + + + 360 + 150 + 201 + 31 + + + + + 12 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Bitstream Charter'; font-size:12pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:14pt;">Count Down Options</span></p></body></html> + + + Qt::RichText + + + + + + 20 + 160 + 291 + 51 + + + + + + + Count Up + + + + + + + Count Down + + + + + + + + + 360 + 190 + 211 + 101 + + + + + + + Show Message + + + + + + + Rollover + + + + + + + + + 40 + 250 + 111 + 41 + + + + + 16 + + + + Start + + + + + + 190 + 250 + 111 + 41 + + + + + 16 + + + + Stop + + + + + + 90 + 20 + 141 + 23 + + + + + 16 + + + + Single Timer + + + + + + + pushStop + clicked() + singleTimer + stop() + + + 209 + 174 + + + 211 + 186 + + + + + + countupStart() + countdownStart() + start() + stop() + + diff --git a/timerGUI/ui_dependent.h b/timerGUI/ui_dependent.h new file mode 100644 index 0000000..67bd73a --- /dev/null +++ b/timerGUI/ui_dependent.h @@ -0,0 +1,171 @@ +/******************************************************************************** +** Form generated from reading UI file 'dependent.ui' +** +** Created: Sun May 6 01:43:24 2012 +** by: Qt User Interface Compiler version 4.7.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_DEPENDENT_H +#define UI_DEPENDENT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_dependent +{ +public: + QPushButton *pushSet; + QLabel *label_2; + QLabel *label_3; + QCheckBox *checkReset; + QWidget *layoutWidget; + QHBoxLayout *horizontalLayout_4; + QSpinBox *spinBox_dep_h; + QSpinBox *spinBox_dep_m; + QSpinBox *spinBox_dep_s; + QPushButton *pushAbout; + QWidget *layoutWidget1; + QHBoxLayout *horizontalLayout_3; + QRadioButton *radioUp; + QRadioButton *radioDown; + QWidget *layoutWidget2; + QHBoxLayout *horizontalLayout; + QSpinBox *spinBox_main_h; + QSpinBox *spinBox_main_m; + QSpinBox *spinBox_main_s; + QPushButton *pushStart; + QPushButton *pushStop; + + void setupUi(QDialog *dependent) + { + if (dependent->objectName().isEmpty()) + dependent->setObjectName(QString::fromUtf8("dependent")); + dependent->resize(455, 416); + pushSet = new QPushButton(dependent); + pushSet->setObjectName(QString::fromUtf8("pushSet")); + pushSet->setGeometry(QRect(330, 160, 71, 31)); + label_2 = new QLabel(dependent); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(120, 20, 121, 16)); + QFont font; + font.setPointSize(16); + label_2->setFont(font); + label_3 = new QLabel(dependent); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(90, 110, 191, 31)); + label_3->setFont(font); + checkReset = new QCheckBox(dependent); + checkReset->setObjectName(QString::fromUtf8("checkReset")); + checkReset->setGeometry(QRect(310, 120, 141, 17)); + layoutWidget = new QWidget(dependent); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(60, 150, 251, 51)); + horizontalLayout_4 = new QHBoxLayout(layoutWidget); + horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); + horizontalLayout_4->setContentsMargins(0, 0, 0, 0); + spinBox_dep_h = new QSpinBox(layoutWidget); + spinBox_dep_h->setObjectName(QString::fromUtf8("spinBox_dep_h")); + + horizontalLayout_4->addWidget(spinBox_dep_h); + + spinBox_dep_m = new QSpinBox(layoutWidget); + spinBox_dep_m->setObjectName(QString::fromUtf8("spinBox_dep_m")); + + horizontalLayout_4->addWidget(spinBox_dep_m); + + spinBox_dep_s = new QSpinBox(layoutWidget); + spinBox_dep_s->setObjectName(QString::fromUtf8("spinBox_dep_s")); + + horizontalLayout_4->addWidget(spinBox_dep_s); + + pushAbout = new QPushButton(dependent); + pushAbout->setObjectName(QString::fromUtf8("pushAbout")); + pushAbout->setGeometry(QRect(300, 300, 101, 41)); + layoutWidget1 = new QWidget(dependent); + layoutWidget1->setObjectName(QString::fromUtf8("layoutWidget1")); + layoutWidget1->setGeometry(QRect(50, 230, 311, 51)); + horizontalLayout_3 = new QHBoxLayout(layoutWidget1); + horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); + horizontalLayout_3->setContentsMargins(0, 0, 0, 0); + radioUp = new QRadioButton(layoutWidget1); + radioUp->setObjectName(QString::fromUtf8("radioUp")); + + horizontalLayout_3->addWidget(radioUp); + + radioDown = new QRadioButton(layoutWidget1); + radioDown->setObjectName(QString::fromUtf8("radioDown")); + + horizontalLayout_3->addWidget(radioDown); + + layoutWidget2 = new QWidget(dependent); + layoutWidget2->setObjectName(QString::fromUtf8("layoutWidget2")); + layoutWidget2->setGeometry(QRect(60, 50, 251, 51)); + horizontalLayout = new QHBoxLayout(layoutWidget2); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setContentsMargins(0, 0, 0, 0); + spinBox_main_h = new QSpinBox(layoutWidget2); + spinBox_main_h->setObjectName(QString::fromUtf8("spinBox_main_h")); + + horizontalLayout->addWidget(spinBox_main_h); + + spinBox_main_m = new QSpinBox(layoutWidget2); + spinBox_main_m->setObjectName(QString::fromUtf8("spinBox_main_m")); + + horizontalLayout->addWidget(spinBox_main_m); + + spinBox_main_s = new QSpinBox(layoutWidget2); + spinBox_main_s->setObjectName(QString::fromUtf8("spinBox_main_s")); + + horizontalLayout->addWidget(spinBox_main_s); + + pushStart = new QPushButton(dependent); + pushStart->setObjectName(QString::fromUtf8("pushStart")); + pushStart->setGeometry(QRect(20, 300, 121, 41)); + pushStop = new QPushButton(dependent); + pushStop->setObjectName(QString::fromUtf8("pushStop")); + pushStop->setGeometry(QRect(160, 300, 121, 41)); + + retranslateUi(dependent); + QObject::connect(pushStop, SIGNAL(clicked()), dependent, SLOT(stop())); + + QMetaObject::connectSlotsByName(dependent); + } // setupUi + + void retranslateUi(QDialog *dependent) + { + dependent->setWindowTitle(QApplication::translate("dependent", "Dependent Timers", 0, QApplication::UnicodeUTF8)); + pushSet->setText(QApplication::translate("dependent", "Set", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("dependent", "Main Timer", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("dependent", "Dependent Timer", 0, QApplication::UnicodeUTF8)); + checkReset->setText(QApplication::translate("dependent", "Do Not Reset", 0, QApplication::UnicodeUTF8)); + pushAbout->setText(QApplication::translate("dependent", "About", 0, QApplication::UnicodeUTF8)); + radioUp->setText(QApplication::translate("dependent", "Count Up", 0, QApplication::UnicodeUTF8)); + radioDown->setText(QApplication::translate("dependent", "Count Down", 0, QApplication::UnicodeUTF8)); + pushStart->setText(QApplication::translate("dependent", "Start", 0, QApplication::UnicodeUTF8)); + pushStop->setText(QApplication::translate("dependent", "Stop", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class dependent: public Ui_dependent {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_DEPENDENT_H diff --git a/timerGUI/ui_mainwindow.h b/timerGUI/ui_mainwindow.h new file mode 100644 index 0000000..f16cf4d --- /dev/null +++ b/timerGUI/ui_mainwindow.h @@ -0,0 +1,86 @@ +/******************************************************************************** +** Form generated from reading UI file 'mainwindow.ui' +** +** Created: Sun May 6 01:43:24 2012 +** by: Qt User Interface Compiler version 4.7.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_MAINWINDOW_H +#define UI_MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MainWindow +{ +public: + QWidget *centralWidget; + QPushButton *pushButton; + QPushButton *pushButton_2; + QMenuBar *menuBar; + QToolBar *mainToolBar; + QStatusBar *statusBar; + + void setupUi(QMainWindow *MainWindow) + { + if (MainWindow->objectName().isEmpty()) + MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->resize(224, 228); + MainWindow->setMaximumSize(QSize(224, 228)); + centralWidget = new QWidget(MainWindow); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + pushButton = new QPushButton(centralWidget); + pushButton->setObjectName(QString::fromUtf8("pushButton")); + pushButton->setGeometry(QRect(30, 0, 150, 60)); + pushButton_2 = new QPushButton(centralWidget); + pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); + pushButton_2->setGeometry(QRect(10, 80, 200, 60)); + MainWindow->setCentralWidget(centralWidget); + menuBar = new QMenuBar(MainWindow); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setGeometry(QRect(0, 0, 224, 27)); + MainWindow->setMenuBar(menuBar); + mainToolBar = new QToolBar(MainWindow); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); + statusBar = new QStatusBar(MainWindow); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + MainWindow->setStatusBar(statusBar); + + retranslateUi(MainWindow); + QObject::connect(pushButton, SIGNAL(clicked()), MainWindow, SLOT(openSingle())); + QObject::connect(pushButton_2, SIGNAL(clicked()), MainWindow, SLOT(openDependent())); + + QMetaObject::connectSlotsByName(MainWindow); + } // setupUi + + void retranslateUi(QMainWindow *MainWindow) + { + MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Timer Program", 0, QApplication::UnicodeUTF8)); + pushButton->setText(QApplication::translate("MainWindow", "Single Timer", 0, QApplication::UnicodeUTF8)); + pushButton_2->setText(QApplication::translate("MainWindow", "One Main Timer\n" +"One Dependent Timer", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MainWindow: public Ui_MainWindow {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MAINWINDOW_H diff --git a/timerGUI/ui_singletimer.h b/timerGUI/ui_singletimer.h new file mode 100644 index 0000000..4129ed4 --- /dev/null +++ b/timerGUI/ui_singletimer.h @@ -0,0 +1,162 @@ +/******************************************************************************** +** Form generated from reading UI file 'singletimer.ui' +** +** Created: Sun May 6 01:43:24 2012 +** by: Qt User Interface Compiler version 4.7.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_SINGLETIMER_H +#define UI_SINGLETIMER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_singleTimer +{ +public: + QWidget *horizontalLayoutWidget; + QHBoxLayout *horizontalLayout; + QSpinBox *spinBox_h; + QSpinBox *spinBox_m; + QSpinBox *spinBox_s; + QLabel *label; + QWidget *layoutWidget; + QHBoxLayout *horizontalLayout_2; + QRadioButton *radioUp; + QRadioButton *radioDown; + QWidget *layoutWidget1; + QVBoxLayout *verticalLayout; + QCheckBox *checkMessage; + QCheckBox *checkRollover; + QPushButton *pushStart; + QPushButton *pushStop; + QLabel *label_2; + + void setupUi(QDialog *singleTimer) + { + if (singleTimer->objectName().isEmpty()) + singleTimer->setObjectName(QString::fromUtf8("singleTimer")); + singleTimer->resize(619, 367); + horizontalLayoutWidget = new QWidget(singleTimer); + horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget")); + horizontalLayoutWidget->setGeometry(QRect(40, 60, 231, 71)); + horizontalLayout = new QHBoxLayout(horizontalLayoutWidget); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setContentsMargins(0, 0, 0, 0); + spinBox_h = new QSpinBox(horizontalLayoutWidget); + spinBox_h->setObjectName(QString::fromUtf8("spinBox_h")); + + horizontalLayout->addWidget(spinBox_h); + + spinBox_m = new QSpinBox(horizontalLayoutWidget); + spinBox_m->setObjectName(QString::fromUtf8("spinBox_m")); + + horizontalLayout->addWidget(spinBox_m); + + spinBox_s = new QSpinBox(horizontalLayoutWidget); + spinBox_s->setObjectName(QString::fromUtf8("spinBox_s")); + + horizontalLayout->addWidget(spinBox_s); + + label = new QLabel(singleTimer); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(360, 150, 201, 31)); + QFont font; + font.setPointSize(12); + label->setFont(font); + label->setTextFormat(Qt::RichText); + layoutWidget = new QWidget(singleTimer); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(20, 160, 291, 51)); + horizontalLayout_2 = new QHBoxLayout(layoutWidget); + horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setContentsMargins(0, 0, 0, 0); + radioUp = new QRadioButton(layoutWidget); + radioUp->setObjectName(QString::fromUtf8("radioUp")); + + horizontalLayout_2->addWidget(radioUp); + + radioDown = new QRadioButton(layoutWidget); + radioDown->setObjectName(QString::fromUtf8("radioDown")); + + horizontalLayout_2->addWidget(radioDown); + + layoutWidget1 = new QWidget(singleTimer); + layoutWidget1->setObjectName(QString::fromUtf8("layoutWidget1")); + layoutWidget1->setGeometry(QRect(360, 190, 211, 101)); + verticalLayout = new QVBoxLayout(layoutWidget1); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setContentsMargins(0, 0, 0, 0); + checkMessage = new QCheckBox(layoutWidget1); + checkMessage->setObjectName(QString::fromUtf8("checkMessage")); + + verticalLayout->addWidget(checkMessage); + + checkRollover = new QCheckBox(layoutWidget1); + checkRollover->setObjectName(QString::fromUtf8("checkRollover")); + + verticalLayout->addWidget(checkRollover); + + pushStart = new QPushButton(singleTimer); + pushStart->setObjectName(QString::fromUtf8("pushStart")); + pushStart->setGeometry(QRect(40, 250, 111, 41)); + QFont font1; + font1.setPointSize(16); + pushStart->setFont(font1); + pushStop = new QPushButton(singleTimer); + pushStop->setObjectName(QString::fromUtf8("pushStop")); + pushStop->setGeometry(QRect(190, 250, 111, 41)); + pushStop->setFont(font1); + label_2 = new QLabel(singleTimer); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(90, 20, 141, 23)); + label_2->setFont(font1); + + retranslateUi(singleTimer); + QObject::connect(pushStop, SIGNAL(clicked()), singleTimer, SLOT(stop())); + + QMetaObject::connectSlotsByName(singleTimer); + } // setupUi + + void retranslateUi(QDialog *singleTimer) + { + singleTimer->setWindowTitle(QApplication::translate("singleTimer", "Single Timer", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("singleTimer", "\n" +"\n" +"

Count Down Options

", 0, QApplication::UnicodeUTF8)); + radioUp->setText(QApplication::translate("singleTimer", "Count Up", 0, QApplication::UnicodeUTF8)); + radioDown->setText(QApplication::translate("singleTimer", "Count Down", 0, QApplication::UnicodeUTF8)); + checkMessage->setText(QApplication::translate("singleTimer", "Show Message", 0, QApplication::UnicodeUTF8)); + checkRollover->setText(QApplication::translate("singleTimer", "Rollover", 0, QApplication::UnicodeUTF8)); + pushStart->setText(QApplication::translate("singleTimer", "Start", 0, QApplication::UnicodeUTF8)); + pushStop->setText(QApplication::translate("singleTimer", "Stop", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("singleTimer", "Single Timer", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class singleTimer: public Ui_singleTimer {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_SINGLETIMER_H