Subversion Repositories svn1-original

Rev

Rev 371 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 371 Rev 373
Line 68... Line 68...
68
    cb_class = new QCheckBox("Class");
68
    cb_class = new QCheckBox("Class");
69
    cb_class->setChecked(true);
69
    cb_class->setChecked(true);
70
    cb_class->setToolTip("Check that teams have a valid class");
70
    cb_class->setToolTip("Check that teams have a valid class");
71
    horizontalLayout1->addWidget(cb_class);
71
    horizontalLayout1->addWidget(cb_class);
72
 
72
 
-
 
73
    cb_compNames = new QCheckBox("Names");
-
 
74
    cb_compNames->setChecked(true);
-
 
75
    cb_compNames->setToolTip("Check that competitors have names");
-
 
76
    horizontalLayout1->addWidget(cb_compNames);
73
 
77
 
74
    cb_eqNames = new QCheckBox("EQ/Names");
78
    cb_eqNames = new QCheckBox("EQ/Names");
75
    cb_eqNames->setChecked(true);
79
    cb_eqNames->setChecked(true);
76
    cb_eqNames->setToolTip("Check that Equestrian teams do have a\nteam member for the equestrian leg");
80
    cb_eqNames->setToolTip("Check that Equestrian teams do have a\nteam member for the equestrian leg");
77
    horizontalLayout1->addWidget(cb_eqNames);
81
    horizontalLayout1->addWidget(cb_eqNames);
Line 148... Line 152...
148
    /*
152
    /*
149
     * Start the testing
153
     * Start the testing
150
     * Read each team into memory and start the testing
154
     * Read each team into memory and start the testing
151
     */
155
     */
152
    int count_bad = 0;
156
    int count_bad = 0;
-
 
157
    int neindex = config.equestrian_leg - 1;
-
 
158
 
153
    for( int tm = config.min_team; tm <= config.max_team; tm++ )
159
    for( int tm = config.min_team; tm <= config.max_team; tm++ )
154
    {
160
    {
155
        int badData = 0;
161
        int badData = 0;
156
        team_type team_buf;
162
        team_type team_buf;
157
        if( valid_field( tm ) )
163
        if( valid_field( tm ) )
Line 170... Line 176...
170
                {
176
                {
171
                    addItem(tm, 0, QString("Team %1, No Team Name specified").arg(QString::number(tm) ) );
177
                    addItem(tm, 0, QString("Team %1, No Team Name specified").arg(QString::number(tm) ) );
172
                    badData = 1;
178
                    badData = 1;
173
                }
179
                }
174
 
180
 
175
                if ( !team_buf.flags.disqualified )
181
                if (cb_compNames->isChecked() ) {
176
                    {
-
 
177
                    // Test for NE Team with a team name
182
                    for (int leg = 0; leg <= config.num_legs; leg++) {
-
 
183
 
178
                    if ((cb_neNames->isChecked() || cb_eqNames->isChecked()) && config.equestrian_leg )
184
                        if (config.equestrian_leg && leg == neindex) {
179
                    {
185
                            continue;
180
                        int neindex = config.equestrian_leg - 1;
186
                        }
-
 
187
 
181
                        char *nptr = team_buf.members[neindex].name;
188
                        char *nptr = team_buf.members[leg].name;
182
                        bool validTeamName = ( *nptr && strcmp(nptr, "0") != 0
189
                        bool validTeamName = ( *nptr && strcmp(nptr, "0") != 0
183
                                            && strcmp(nptr, "-") != 0
190
                                            && strcmp(nptr, "-") != 0
184
                                            && stricmp(nptr, "N/A") != 0 );
191
                                            && stricmp(nptr, "N/A") != 0 );
185
 
192
 
186
                        if (cb_neNames->isChecked() && team_buf.flags.non_equestrian && validTeamName && stricmp(nptr, "NE") != 0 )
-
 
187
                        {
193
                       if (!validTeamName) {
188
                            addItem(tm, 0, QString("Team %1, NE with named competitor: %2").arg(QString::number(tm)).arg(nptr) );
194
                            QString msg = QString("Team %1, No competitor name for leg: %2").arg(QString::number(tm)).arg(config.leg_name[leg]);
189
                            badData = 1;
195
                            if (nptr && strlen(nptr)) {
190
                        }
-
 
191
                        if (cb_eqNames->isChecked() && !team_buf.flags.non_equestrian && !validTeamName )
196
                                msg.append(QString(". Have \"%1\"").arg(nptr) );
192
                        {
197
                            }
193
                            addItem(tm, 0, QString("Team %1, possible NE team").arg(QString::number(tm)) );
198
                            addItem(tm, 0, msg );
194
                            badData = 1;
199
                            badData = 1;
195
                        }
200
                        }
196
                    }
201
                    }
-
 
202
                }
-
 
203
 
-
 
204
 
-
 
205
                // Test for NE Team with a team name
-
 
206
 
-
 
207
                if ((cb_neNames->isChecked() || cb_eqNames->isChecked()) && config.equestrian_leg )
-
 
208
                {
-
 
209
                    char *nptr = team_buf.members[neindex].name;
-
 
210
                    bool validTeamName = ( *nptr && strcmp(nptr, "0") != 0
-
 
211
                                        && strcmp(nptr, "-") != 0
-
 
212
                                        && stricmp(nptr, "N/A") != 0 );
-
 
213
 
-
 
214
                    if (cb_neNames->isChecked() && team_buf.flags.non_equestrian && validTeamName && stricmp(nptr, "NE") != 0 )
-
 
215
                    {
-
 
216
                        addItem(tm, 0, QString("Team %1, NE with named competitor: %2").arg(QString::number(tm)).arg(nptr) );
-
 
217
                        badData = 1;
-
 
218
                    }
197
 
219
 
198
                    // Test Leg Data if required
-
 
199
                    if (cb_checkLegs->isChecked() && leg_end)
220
                    if (cb_eqNames->isChecked() && !team_buf.flags.non_equestrian && !validTeamName )
200
                    {
221
                    {
-
 
222
                        addItem(tm, 0, QString("Team %1, possible NE team").arg(QString::number(tm)) );
-
 
223
                        badData = 1;
-
 
224
                    }
-
 
225
 
-
 
226
                    // Test for Equestrain Team with NE name - perhaps is really an NE team
-
 
227
                    if (cb_eqNames->isChecked() && !team_buf.flags.non_equestrian && stricmp(nptr, "NE") == 0 )
-
 
228
                    {
-
 
229
                        addItem(tm, 0, QString("Team %1, possible NE team as competitor is called %2").arg(QString::number(tm)).arg(nptr) );
-
 
230
                        badData = 1;
-
 
231
                    }
-
 
232
                }
-
 
233
 
-
 
234
                // Test Leg Data if required
-
 
235
                if (cb_checkLegs->isChecked() && leg_end &&  !team_buf.flags.disqualified)
-
 
236
                {
201
                        test_times( &team_buf, leg_end );
237
                    test_times( &team_buf, leg_end );
202
                        if( check_error.type > 0 )
238
                    if( check_error.type > 0 )
203
                        {
239
                    {
204
                            addItem(tm, check_error.leg, QString("Team %1, Leg %2: %3").arg(QString::number(tm)).arg(QString::number(check_error.leg)).arg(qck_err_mess[check_error.type]));
240
                        addItem(tm, check_error.leg, QString("Team %1, Leg %2: %3").arg(QString::number(tm)).arg(QString::number(check_error.leg)).arg(qck_err_mess[check_error.type]));
205
                            badData = 1;
241
                        badData = 1;
206
                        }
-
 
207
                    }
242
                    }
208
                }
243
                }
209
            }
244
            }
210
        }
245
        }
211
        else
246
        else
Line 264... Line 299...
264
    cb_checkLegs->setChecked(all_state);
299
    cb_checkLegs->setChecked(all_state);
265
    cb_class->setChecked(all_state);
300
    cb_class->setChecked(all_state);
266
    cb_eqNames->setChecked(all_state);
301
    cb_eqNames->setChecked(all_state);
267
    cb_neNames->setChecked(all_state);
302
    cb_neNames->setChecked(all_state);
268
    cb_teamName->setChecked(all_state);
303
    cb_teamName->setChecked(all_state);
-
 
304
    cb_compNames->setChecked(all_state);
269
}
305
}
270
 
306