-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputerClassroom.cpp
More file actions
37 lines (34 loc) · 1.26 KB
/
Copy pathComputerClassroom.cpp
File metadata and controls
37 lines (34 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "computer_classroom.h"
ComputerClassroom::ComputerClassroom(){}
ComputerClassroom::ComputerClassroom(Computer computer[5][10],std::list<ClassSchInf> CSI):Class_Scheduling_Information(CSI){
for(int i=0;i<10;++i){
for(int j=0;j<5;++j){
computers[j][i]=computer[j][i];
}
}
}
void ComputerClassroom::handleSaveCourseData(int week, int time, QString& classname,QString& teacher){
std::string Classname=classname.toStdString();
std::string Teacher=teacher.toStdString();
for (auto it = Class_Scheduling_Information.begin(); it != Class_Scheduling_Information.end(); ++it) {
if((it->gettime()==time)&&(it->getweek()==week)){
it->setclassname(Classname);
it->setteacher(Teacher);
return;
}
}
ClassSchInf a(week,time,Classname,Teacher);
Class_Scheduling_Information.push_back(a);
}
Computer ComputerClassroom::getcomputer(int h,int l) const{
return computers[h-1][l-1];
}
Computer& ComputerClassroom::getcomputers(int h ,int l){
return computers[h-1][l-1];
}
std::list<ClassSchInf> ComputerClassroom::getCSI()const {
return Class_Scheduling_Information;
}
void ComputerClassroom::setcomputer(Computer computer,int hor,int ver){
computers[hor][ver]=computer;
}