Back to index

fet  5.18.0
timetable_defs.h
Go to the documentation of this file.
00001 /*
00002 File timetable_defs.h
00003 */
00004 
00005 /***************************************************************************
00006                           timetable_defs.h  -  description
00007                              -------------------
00008     begin                : Sat Mar 15 2003
00009     copyright            : (C) 2003 by Lalescu Liviu
00010     email                : Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 #ifndef TIMETABLE_DEFS_H
00023 #define TIMETABLE_DEFS_H
00024 
00025 #ifdef NDEBUG
00026 #undef NDEBUG
00027 #endif
00028 #include <cassert>
00029 
00030 #include <QString>
00031 
00032 #include <QtGlobal>
00033 
00034 #include "centerwidgetonscreen.h"
00035 
00036 class QWidget;
00037 
00041 extern const QString FET_VERSION;
00042 
00046 extern QString FET_LANGUAGE;
00047 
00048 extern bool LANGUAGE_STYLE_RIGHT_TO_LEFT;
00049 
00050 extern QString LANGUAGE_FOR_HTML;
00051 
00055 extern int TIMETABLE_HTML_LEVEL;
00056 
00057 extern bool PRINT_NOT_AVAILABLE_TIME_SLOTS;
00058 
00059 extern bool PRINT_BREAK_TIME_SLOTS;
00060 
00061 extern bool DIVIDE_HTML_TIMETABLES_WITH_TIME_AXIS_BY_DAYS;
00062 
00063 extern bool PRINT_ACTIVITIES_WITH_SAME_STARTING_TIME;
00064 
00065 extern bool USE_GUI_COLORS;
00066 
00067 extern bool SHOW_SHORTCUTS_ON_MAIN_WINDOW;
00068 
00069 extern bool ENABLE_ACTIVITY_TAG_MAX_HOURS_DAILY;
00070 extern bool ENABLE_STUDENTS_MAX_GAPS_PER_DAY;
00071 
00072 extern bool SHOW_WARNING_FOR_NOT_PERFECT_CONSTRAINTS;
00073 
00074 extern bool ENABLE_STUDENTS_MIN_HOURS_DAILY_WITH_ALLOW_EMPTY_DAYS;
00075 extern bool SHOW_WARNING_FOR_STUDENTS_MIN_HOURS_DAILY_WITH_ALLOW_EMPTY_DAYS;
00076 
00077 extern bool CONFIRM_ACTIVITY_PLANNING;
00078 extern bool CONFIRM_SPREAD_ACTIVITIES;
00079 extern bool CONFIRM_REMOVE_REDUNDANT;
00080 extern bool CONFIRM_SAVE_TIMETABLE;
00081 
00085 const int MAX_TOTAL_SUBGROUPS=30000;//MAX_YEARS*MAX_GROUPS_PER_YEAR*MAX_SUBGROUPS_PER_GROUP;
00086 
00087 const int MAX_ROOM_CAPACITY=30000;
00088 
00092 const int MAX_TEACHERS=6000;
00093 
00097 const int MAX_SUBJECTS=6000;
00098 
00104 const int MAX_ACTIVITIES=30000;
00105 
00106 //if you want to increase this, you also need to modify the add/modify activity dialogs, to permit larger values
00107 //(add more pages in the subactivities tab).
00108 const int MAX_SPLIT_OF_AN_ACTIVITY=35;
00109 
00115 const int MAX_ROOMS=6000;
00116 
00120 const int MAX_BUILDINGS=6000;
00121 
00125 const qint16 UNALLOCATED_ACTIVITY = MAX_ACTIVITIES;
00126 
00132 const int MAX_HOURS_PER_DAY=60;
00133 
00139 const int MAX_DAYS_PER_WEEK=35;
00140 
00144 extern const QString PREDEFINED_DAYS_OF_THE_WEEK[];
00145 
00161 const int MAX_HOURS_PER_WEEK = MAX_HOURS_PER_DAY * MAX_DAYS_PER_WEEK;
00162 
00166 const qint16 UNALLOCATED_TIME = MAX_HOURS_PER_WEEK;
00167 
00171 const qint16 UNALLOCATED_SPACE = MAX_ROOMS;
00172 
00173 const qint16 UNSPECIFIED_ROOM = MAX_ROOMS+1;
00174 
00178 //const int MAX_TIME_CONSTRAINTS = 60000;
00179 
00183 //const int MAX_SPACE_CONSTRAINTS = 60000;
00184 
00188 extern const QString FILE_SEP;
00189 
00193 extern QString INPUT_FILENAME_XML;
00194 
00198 extern QString WORKING_DIRECTORY;
00199 
00203 extern QString IMPORT_DIRECTORY;
00204 
00205 //OUTPUT FILES
00206 
00213 extern QString OUTPUT_DIR;
00214 
00218 extern const QString XML_PARSING_LOG_FILENAME;
00219 
00223 QString protect(const QString& str);
00224 
00228 QString protect2(const QString& str);
00229 
00233 QString protect2vert(const QString& str);
00234 
00238 QString protect2id(const QString& str);
00239 
00243 QString protect2java(const QString& str);
00244 
00248 const qint16 TEACHER_HAS_SINGLE_GAP = 0;
00249 const qint16 TEACHER_HAS_BORDER_GAP = 1;
00250 const qint16 TEACHER_HAS_BIG_GAP = 2;
00251 
00252 const qint16 TEACHER_MUST_COME_EARLIER = 4;
00253 const qint16 TEACHER_MUST_COME_MUCH_EARLIER = 6;
00254 
00255 const qint16 TEACHER_MUST_STAY_LONGER = 3;
00256 const qint16 TEACHER_MUST_STAY_MUCH_LONGER = 5;         // BE CAREFULL, I just print into LESS_DETAILED timetable, if it's smaller then TEACHER_MUST_STAY_MUCH_LONGER
00257 
00258 const qint16 TEACHER_HAS_A_FREE_DAY = 7;
00259 
00260 const qint16 TEACHER_IS_NOT_AVAILABLE = 8;
00261 
00262 const int TEACHERS_FREE_PERIODS_N_CATEGORIES = 9;
00263 
00264 extern bool checkForUpdates;
00265 
00266 extern QString internetVersion;
00267 
00269 const int CUSTOM_DOUBLE_PRECISION=6; //number of digits after the decimal dot for the weights
00270 
00271 void weight_sscanf(const QString& str, const char* fmt, double* result);
00272 
00273 class CustomFETString{
00274 public:
00275        static QString number(int n);
00276        static QString number(double x);
00277 };
00278 
00279 double customFETStrToDouble(const QString& str, bool* ok=0);
00281 
00282 //for random Knuth - from Knuth TAOCP Vol. 2 Seminumerical Algorithms section 3.6
00283 //these numbers are really important - please do not change them, NEVER!!!
00284 //if you want, write a new random number generator routine, with other name
00285 //I think I found a minor possible improvement, the author said: if(Z<=0) then Z+=MM,
00286 //but I think this would be better: if(Z<=0) then Z+=MM-1. - Yes, the author confirmed
00287 //extern int XX;
00288 //extern int YY;
00289 const int MM=2147483647;
00290 const int AA=48271;
00291 const int QQ=44488;
00292 const int RR=3399;
00293 
00294 const int MMM=2147483399;
00295 const int AAA=40692;
00296 const int QQQ=52774;
00297 const int RRR=3791;
00298 
00299 void initRandomKnuth();
00300 int randomKnuth1MM1(); //a random between 1 and MM-1
00301 int randomKnuth(int k); //a random between 0 and k-1
00302 
00303 #endif