adding exam schedule

This commit is contained in:
liranbg 2014-10-08 00:16:27 +03:00
parent a87c5abb2c
commit f3e65503b8
9 changed files with 250 additions and 220 deletions

View file

@ -53,7 +53,8 @@ HEADERS += \
src/jceData/Calendar/calendarDialog.h \ src/jceData/Calendar/calendarDialog.h \
src/appDatabase/jce_logger.h \ src/appDatabase/jce_logger.h \
src/jceData/Grades/graph/qcustomplot.h \ src/jceData/Grades/graph/qcustomplot.h \
src/jceData/Grades/graph/gradegraph.h src/jceData/Grades/graph/gradegraph.h \
src/jceData/Calendar/calendarExam.h
SOURCES += \ SOURCES += \
main/CalendarTab/CalendarManager.cpp \ main/CalendarTab/CalendarManager.cpp \
@ -76,4 +77,5 @@ SOURCES += \
src/jceData/Calendar/calendarDialog.cpp \ src/jceData/Calendar/calendarDialog.cpp \
src/appDatabase/jce_logger.cpp \ src/appDatabase/jce_logger.cpp \
src/jceData/Grades/graph/qcustomplot.cpp \ src/jceData/Grades/graph/qcustomplot.cpp \
src/jceData/Grades/graph/gradegraph.cpp src/jceData/Grades/graph/gradegraph.cpp \
src/jceData/Calendar/calendarExam.cpp

View file

@ -19,10 +19,7 @@ coursesTableManager::coursesTableManager(QTableWidget *ptr, user *usrPtr)
courseTBL->setShowGrid(true); courseTBL->setShowGrid(true);
courseTBL->setStyleSheet("QTableView {selection-background-color: red;}"); courseTBL->setStyleSheet("QTableView {selection-background-color: red;}");
/* graph = new gradegraph(NULL);
*
*/
graph = new gradegraph(NULL,gp);
} }
coursesTableManager::~coursesTableManager() coursesTableManager::~coursesTableManager()

View file

@ -2,20 +2,22 @@
calendarCourse::calendarCourse(int serial, QString name, QString type, QString lecturer, double points, calendarCourse::calendarCourse(int serial, QString name, QString type, QString lecturer, double points,
double semesterHours, QString dayAndHour, double semesterHours, QString dayAndHour,
QString room) : Course(serial,name, type,points) QString room, calendarCourse::CourseCalendarType type) : Course(serial,name, type,points)
{ {
this->lecturer = lecturer; this->lecturer = lecturer;
this->semesterHours = semesterHours; this->semesterHours = semesterHours;
this->room = room; this->room = room;
setDayAndHour(dayAndHour); setDayAndHour(dayAndHour.type);
} }
/** /**
* @brief calendarCourse::setDayAndHour * @brief calendarCourse::setDayAndHour
* given a string of time and day - parsing it into day, hour it begins and hour it ends seperated * given a string of time and day - parsing it into day, hour it begins and hour it ends seperated
* @param parse - * @param parse -
*/ */
void calendarCourse::setDayAndHour(QString parse) void calendarCourse::setDayAndHour(QString parse, calendarCourse::CourseCalendarType type)
{ {
if (type == calendarCourse::CourseCalendarType::CoursesSchedule)
{
int ctr = 0; int ctr = 0;
QString temp = ""; QString temp = "";
QTime timetemp; QTime timetemp;
@ -45,6 +47,11 @@ void calendarCourse::setDayAndHour(QString parse)
ctr++; ctr++;
tok = strtok(NULL, " -"); tok = strtok(NULL, " -");
} }
}
if (type == calendarCourse::CourseCalendarType::ExamSchedule)
{
}
} }
QString calendarCourse::getLecturer() const QString calendarCourse::getLecturer() const

View file

@ -9,6 +9,12 @@
class calendarCourse : public Course class calendarCourse : public Course
{ {
public: public:
enum CourseCalendarType
{
ExamSchedule,
CoursesSchedule
};
enum CourseScheme enum CourseScheme
{ {
SERIAL, SERIAL,
@ -21,7 +27,8 @@ public:
ROOM ROOM
}; };
calendarCourse(int serial, QString name, QString type, QString lecturer, calendarCourse(int serial, QString name, QString type, QString lecturer,
double points, double semesterHours, QString dayAndHour, QString room); double points, double semesterHours, QString dayAndHour,
QString room, calendarCourse::CourseCalendarType type = calendarCourse::CourseCalendarType::CoursesSchedule);
~calendarCourse(){} ~calendarCourse(){}
int getDay() const; int getDay() const;
@ -47,7 +54,7 @@ public:
private: private:
void setDayAndHour(QString parse); void setDayAndHour(QString parse, CourseCalendarType type);
QString lecturer; QString lecturer;
double semesterHours; double semesterHours;

View file

@ -0,0 +1,5 @@
#include "calendarExam.h"
calendarExam::calendarExam()
{
}

View file

@ -0,0 +1,12 @@
#ifndef CALENDAREXAM_H
#define CALENDAREXAM_H
#include "../page.h"
class calendarExam : public Page
{
public:
calendarExam();
};
#endif // CALENDAREXAM_H

View file

@ -28,7 +28,6 @@ private:
QString tempHtml; QString tempHtml;
std::list<calendarCourse*>* courses; std::list<calendarCourse*>* courses;
}; };
#endif // CALENDARPAGE_H #endif // CALENDARPAGE_H

View file

@ -1,12 +1,12 @@
#include "gradegraph.h" #include "gradegraph.h"
#include "ui_gradegraph.h" #include "ui_gradegraph.h"
gradegraph::gradegraph(QWidget *parent, GradePage *gpPTR) : gradegraph::gradegraph(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::gradegraph) ui(new Ui::gradegraph)
{ {
ui->setupUi(this); ui->setupUi(this);
this->gp = gpPTR; this->gp = NULL;
} }
@ -16,6 +16,7 @@ void gradegraph::showGraph(GradePage *gpPTR)
setVisualization(); setVisualization();
setGraphsData(); setGraphsData();
this->show(); this->show();
} }
gradegraph::~gradegraph() gradegraph::~gradegraph()
@ -25,12 +26,12 @@ gradegraph::~gradegraph()
void gradegraph::setGraphsData() void gradegraph::setGraphsData()
{ {
int minYearInList = gp->getMinYearInList(); //2012 int minYearInList = gp->getMinYearInList();
int maxYearInList = gp->getMaxYearInList()+1; //2016 int maxYearInList = gp->getMaxYearInList()+1;
int xRangeForYear = (maxYearInList - minYearInList+2)*3; //6*3=18 int xRangeForYear = (maxYearInList - minYearInList+2)*3;
QVector<double> SemesterialAvg(xRangeForYear),yearlyAvg(xRangeForYear),sem(xRangeForYear); QVector<double> SemesterialAvg(xRangeForYear),yearlyAvg(xRangeForYear),sem(xRangeForYear);
for (int yearCount=0,i=1; i<xRangeForYear; ++i) for (int yearCount=0,i=1; i<xRangeForYear; ++i) //filling data
{ {
double lastAvg = 0; double lastAvg = 0;
sem[i] = i; sem[i] = i;
@ -137,12 +138,12 @@ void gradegraph::setVisualization()
ui->graphwidget->xAxis->setLabel(tr("Years")); ui->graphwidget->xAxis->setLabel(tr("Years"));
ui->graphwidget->xAxis->setAutoTickLabels(false); ui->graphwidget->xAxis->setAutoTickLabels(false);
ui->graphwidget->xAxis->setTickVectorLabels(xStrings);
ui->graphwidget->xAxis->setTickLabelFont(QFont(QFont().family(), 7)); ui->graphwidget->xAxis->setTickLabelFont(QFont(QFont().family(), 7));
ui->graphwidget->xAxis->setAutoTickStep(false); ui->graphwidget->xAxis->setAutoTickStep(false);
ui->graphwidget->xAxis->setTickStep(1); ui->graphwidget->xAxis->setTickStep(1);
ui->graphwidget->xAxis->setAutoSubTicks(false); ui->graphwidget->xAxis->setAutoSubTicks(false);
ui->graphwidget->xAxis->setSubTickCount(1); ui->graphwidget->xAxis->setSubTickCount(1);
ui->graphwidget->xAxis->setTickVectorLabels(xStrings);
ui->graphwidget->xAxis->setRange(1,xRangeForYear); ui->graphwidget->xAxis->setRange(1,xRangeForYear);
ui->graphwidget->legend->setVisible(true); //show graph name on top right ui->graphwidget->legend->setVisible(true); //show graph name on top right

View file

@ -14,7 +14,7 @@ class gradegraph : public QDialog
Q_OBJECT Q_OBJECT
public: public:
gradegraph(QWidget *parent = 0, GradePage *gpPTR = 0); gradegraph(QWidget *parent = 0);
void showGraph(GradePage *gpPTR); void showGraph(GradePage *gpPTR);
~gradegraph(); ~gradegraph();