adding exam schedule
This commit is contained in:
parent
a87c5abb2c
commit
f3e65503b8
9 changed files with 250 additions and 220 deletions
|
@ -53,7 +53,8 @@ HEADERS += \
|
|||
src/jceData/Calendar/calendarDialog.h \
|
||||
src/appDatabase/jce_logger.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 += \
|
||||
main/CalendarTab/CalendarManager.cpp \
|
||||
|
@ -76,4 +77,5 @@ SOURCES += \
|
|||
src/jceData/Calendar/calendarDialog.cpp \
|
||||
src/appDatabase/jce_logger.cpp \
|
||||
src/jceData/Grades/graph/qcustomplot.cpp \
|
||||
src/jceData/Grades/graph/gradegraph.cpp
|
||||
src/jceData/Grades/graph/gradegraph.cpp \
|
||||
src/jceData/Calendar/calendarExam.cpp
|
||||
|
|
|
@ -19,10 +19,7 @@ coursesTableManager::coursesTableManager(QTableWidget *ptr, user *usrPtr)
|
|||
courseTBL->setShowGrid(true);
|
||||
courseTBL->setStyleSheet("QTableView {selection-background-color: red;}");
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
graph = new gradegraph(NULL,gp);
|
||||
graph = new gradegraph(NULL);
|
||||
}
|
||||
|
||||
coursesTableManager::~coursesTableManager()
|
||||
|
|
|
@ -2,19 +2,21 @@
|
|||
|
||||
calendarCourse::calendarCourse(int serial, QString name, QString type, QString lecturer, double points,
|
||||
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->semesterHours = semesterHours;
|
||||
this->room = room;
|
||||
setDayAndHour(dayAndHour);
|
||||
setDayAndHour(dayAndHour.type);
|
||||
}
|
||||
/**
|
||||
* @brief calendarCourse::setDayAndHour
|
||||
* given a string of time and day - parsing it into day, hour it begins and hour it ends seperated
|
||||
* @param parse -
|
||||
*/
|
||||
void calendarCourse::setDayAndHour(QString parse)
|
||||
void calendarCourse::setDayAndHour(QString parse, calendarCourse::CourseCalendarType type)
|
||||
{
|
||||
if (type == calendarCourse::CourseCalendarType::CoursesSchedule)
|
||||
{
|
||||
int ctr = 0;
|
||||
QString temp = "";
|
||||
|
@ -46,6 +48,11 @@ void calendarCourse::setDayAndHour(QString parse)
|
|||
tok = strtok(NULL, " -");
|
||||
}
|
||||
}
|
||||
if (type == calendarCourse::CourseCalendarType::ExamSchedule)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QString calendarCourse::getLecturer() const
|
||||
{
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
class calendarCourse : public Course
|
||||
{
|
||||
public:
|
||||
enum CourseCalendarType
|
||||
{
|
||||
ExamSchedule,
|
||||
CoursesSchedule
|
||||
};
|
||||
|
||||
enum CourseScheme
|
||||
{
|
||||
SERIAL,
|
||||
|
@ -21,7 +27,8 @@ public:
|
|||
ROOM
|
||||
};
|
||||
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(){}
|
||||
|
||||
int getDay() const;
|
||||
|
@ -47,7 +54,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
void setDayAndHour(QString parse);
|
||||
void setDayAndHour(QString parse, CourseCalendarType type);
|
||||
|
||||
QString lecturer;
|
||||
double semesterHours;
|
||||
|
|
5
src/jceData/Calendar/calendarExam.cpp
Normal file
5
src/jceData/Calendar/calendarExam.cpp
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include "calendarExam.h"
|
||||
|
||||
calendarExam::calendarExam()
|
||||
{
|
||||
}
|
12
src/jceData/Calendar/calendarExam.h
Normal file
12
src/jceData/Calendar/calendarExam.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef CALENDAREXAM_H
|
||||
#define CALENDAREXAM_H
|
||||
|
||||
#include "../page.h"
|
||||
|
||||
class calendarExam : public Page
|
||||
{
|
||||
public:
|
||||
calendarExam();
|
||||
};
|
||||
|
||||
#endif // CALENDAREXAM_H
|
|
@ -28,7 +28,6 @@ private:
|
|||
QString tempHtml;
|
||||
std::list<calendarCourse*>* courses;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // CALENDARPAGE_H
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include "gradegraph.h"
|
||||
#include "ui_gradegraph.h"
|
||||
|
||||
gradegraph::gradegraph(QWidget *parent, GradePage *gpPTR) :
|
||||
gradegraph::gradegraph(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::gradegraph)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->gp = gpPTR;
|
||||
this->gp = NULL;
|
||||
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ void gradegraph::showGraph(GradePage *gpPTR)
|
|||
setVisualization();
|
||||
setGraphsData();
|
||||
this->show();
|
||||
|
||||
}
|
||||
|
||||
gradegraph::~gradegraph()
|
||||
|
@ -25,12 +26,12 @@ gradegraph::~gradegraph()
|
|||
|
||||
void gradegraph::setGraphsData()
|
||||
{
|
||||
int minYearInList = gp->getMinYearInList(); //2012
|
||||
int maxYearInList = gp->getMaxYearInList()+1; //2016
|
||||
int xRangeForYear = (maxYearInList - minYearInList+2)*3; //6*3=18
|
||||
int minYearInList = gp->getMinYearInList();
|
||||
int maxYearInList = gp->getMaxYearInList()+1;
|
||||
int xRangeForYear = (maxYearInList - minYearInList+2)*3;
|
||||
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;
|
||||
sem[i] = i;
|
||||
|
@ -137,12 +138,12 @@ void gradegraph::setVisualization()
|
|||
|
||||
ui->graphwidget->xAxis->setLabel(tr("Years"));
|
||||
ui->graphwidget->xAxis->setAutoTickLabels(false);
|
||||
ui->graphwidget->xAxis->setTickVectorLabels(xStrings);
|
||||
ui->graphwidget->xAxis->setTickLabelFont(QFont(QFont().family(), 7));
|
||||
ui->graphwidget->xAxis->setAutoTickStep(false);
|
||||
ui->graphwidget->xAxis->setTickStep(1);
|
||||
ui->graphwidget->xAxis->setAutoSubTicks(false);
|
||||
ui->graphwidget->xAxis->setSubTickCount(1);
|
||||
ui->graphwidget->xAxis->setTickVectorLabels(xStrings);
|
||||
ui->graphwidget->xAxis->setRange(1,xRangeForYear);
|
||||
|
||||
ui->graphwidget->legend->setVisible(true); //show graph name on top right
|
||||
|
|
|
@ -14,7 +14,7 @@ class gradegraph : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
gradegraph(QWidget *parent = 0, GradePage *gpPTR = 0);
|
||||
gradegraph(QWidget *parent = 0);
|
||||
void showGraph(GradePage *gpPTR);
|
||||
~gradegraph();
|
||||
|
||||
|
|
Loading…
Reference in a new issue