Subversion Repositories public iLand

Rev

Rev 170 | Rev 176 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 170 Rev 171
Line 101... Line 101...
101
}
101
}
102
102
103
void ModelController::runYear()
103
void ModelController::runYear()
104
{
104
{
105
    if (!canRun()) return;
105
    if (!canRun()) return;
106
    if (GlobalSettings::instance()->settings().paramValue("debug_clear",0.)==1.)
-
 
-
 
106
    if (GlobalSettings::instance()->settings().paramValueBool("debug_clear"))
107
        GlobalSettings::instance()->clearDebugLists();  // clear debug data
107
        GlobalSettings::instance()->clearDebugLists();  // clear debug data
108
108
109
    try {
109
    try {
110
        mModel->runYear();
110
        mModel->runYear();
111
        fetchDynamicOutput();
111
        fetchDynamicOutput();
Line 121... Line 121...
121
// dynamic outut
121
// dynamic outut
122
//////////////////////////////////////
122
//////////////////////////////////////
123
//////////////////////////////////////
123
//////////////////////////////////////
124
void ModelController::setupDynamicOutput(QString fieldList)
124
void ModelController::setupDynamicOutput(QString fieldList)
125
{
125
{
126
    if (fieldList.isEmpty()) {
-
 
127
        mDynFieldList.clear();
-
 
128
    } else {
-
 
129
        mDynFieldList = fieldList.split(QRegExp("\\s+"), QString::SkipEmptyParts);
-
 
-
 
126
    mDynFieldList.clear();
-
 
127
    if (!fieldList.isEmpty()) {
-
 
128
        QRegExp rx("((?:\\[.+\\]|\\w+)\\.\\w+)");
-
 
129
        int pos=0;
-
 
130
        while ((pos = rx.indexIn(fieldList, pos)) != -1) {
-
 
131
            mDynFieldList.append(rx.cap(1));
-
 
132
            pos += rx.matchedLength();
-
 
133
        }
-
 
134
-
 
135
        //mDynFieldList = fieldList.split(QRegExp("(?:\\[.+\\]|\\w+)\\.\\w+"), QString::SkipEmptyParts);
130
        mDynFieldList.prepend("count");
136
        mDynFieldList.prepend("count");
131
        mDynFieldList.prepend("year"); // fixed fields.
137
        mDynFieldList.prepend("year"); // fixed fields.
132
    }
138
    }
133
    mDynData.clear();
139
    mDynData.clear();
134
    mDynData.append(mDynFieldList.join(";"));
140
    mDynData.append(mDynFieldList.join(";"));