Subversion Repositories svn1

Rev

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

Rev 224 Rev 380
Line 1... Line 1...
1
#include "qmdialogloadexternalteams.h"
1
#include "qmdialogloadexternalteams.h"
2
#include "ui_qmdialogloadexternalteams.h"
2
//#include "ui_qmdialogloadexternalteams.h"
3
#include "QFile"
3
#include "QFile"
4
#include "QTextStream"
4
#include "QTextStream"
5
#include "mainwindow.h"
5
#include "mainwindow.h"
6
#include <QRegExp>
6
#include <QRegExp>
7
#include <QtGui/QHBoxLayout>
7
#include <QtGui/QHBoxLayout>
8
#include <QtGui/QVBoxLayout>
8
#include <QtGui/QVBoxLayout>
9
#include <QtGui/QWidget>
9
#include <QtGui/QWidget>
-
 
10
#include <QHeaderView>
-
 
11
#include <QtWebKit/QtWebKit>
10
 
12
 
11
#include    "consts.h"
13
#include    "consts.h"
12
#include    "structs.h"
14
#include    "structs.h"
13
#include    "proto.h"
15
#include    "proto.h"
14
 
16
 
-
 
17
/*----------------------------------------------------------------------------
-
 
18
** FUNCTION           : QmDialogLoadExternalTeams
-
 
19
**
-
 
20
** DESCRIPTION        : Load team data from a CSV file
-
 
21
**
-
 
22
**
-
 
23
** INPUTS             : efile       - name of file
-
 
24
**                      parent      - parent widget
-
 
25
**
-
 
26
** RETURNS            :
-
 
27
**
-
 
28
----------------------------------------------------------------------------*/
-
 
29
 
15
QmDialogLoadExternalTeams::QmDialogLoadExternalTeams(const QString &efile,QWidget *parent) :
30
QmDialogLoadExternalTeams::QmDialogLoadExternalTeams(const QString &efile,QWidget *parent) :
16
    QDialog(parent)
31
        QDialog(parent)
17
{
32
{
18
 
33
 
19
    //
34
    //
20
    // Create Windows
35
    // Create Windows
21
    //
36
    //
-
 
37
    createWindow();
-
 
38
    fileName->setText(efile);
-
 
39
 
-
 
40
    // Open the users file
-
 
41
 
-
 
42
    QFile file(efile);
-
 
43
    if ( ! file.open(QIODevice::ReadOnly | QIODevice::Text) )
-
 
44
    {
-
 
45
        MainWindow::showMessage("Cannot open external data file");
-
 
46
        return;
-
 
47
    }
-
 
48
    MainWindow::showMessage("Loading External Data");
-
 
49
 
-
 
50
    // Process Each line of the file
-
 
51
    QTextStream in(&file);
-
 
52
    QRegExp csv_split("\"?,\"?");
-
 
53
    while (!in.atEnd())
-
 
54
    {
-
 
55
        QString line = in.readLine();
-
 
56
        line = line.trimmed();             // Remove leading and training White Space
-
 
57
        line.remove(0xA0);                 // M$ special uglyness
-
 
58
        line.remove(0xC2);                 // M$ special uglyness
-
 
59
 
-
 
60
        bool has_RefError = hasRefError(line);
-
 
61
        QStringList parts = splitCsvData(line);
-
 
62
        insertParts( parts, has_RefError );
-
 
63
        
-
 
64
    }
-
 
65
 
-
 
66
    // Post Load fix up
-
 
67
    tableWidget->resizeColumnsToContents();
-
 
68
    reportErrors( bad_cat, bad_refs);
-
 
69
}
-
 
70
 
-
 
71
/*----------------------------------------------------------------------------
-
 
72
** FUNCTION           : QmDialogLoadExternalTeams
-
 
73
**
-
 
74
** DESCRIPTION        : Load team data from a Web Page
-
 
75
**
-
 
76
**
-
 
77
** INPUTS             : efile       - name of file (display only)
-
 
78
**                      data        - Address of the webpage data loaded in memory
-
 
79
**                      parent      - parent widget
-
 
80
**
-
 
81
** RETURNS            :
-
 
82
**
-
 
83
----------------------------------------------------------------------------*/
-
 
84
 
-
 
85
QmDialogLoadExternalTeams::QmDialogLoadExternalTeams(const QString &efile, QByteArray *data ,QWidget *parent) :
-
 
86
        QDialog(parent)
-
 
87
{
-
 
88
    // Create the basic Window
-
 
89
    createWindow();
-
 
90
    fileName->setText(efile);
-
 
91
 
-
 
92
    // Parse the data. It is an html file
-
 
93
    //
-
 
94
    MainWindow::showMessage("Parsing HTML");
-
 
95
    //qDebug("Data size: %d", data->length());
-
 
96
 
-
 
97
    QWebPage page;
-
 
98
    QWebFrame * frame = page.mainFrame();
-
 
99
    frame->setContent(*data);
-
 
100
 
-
 
101
    /*
-
 
102
    **  Get the first table
-
 
103
    **      Get all rows
-
 
104
    **      Get all data items in each row
-
 
105
    */
-
 
106
    QWebElement document = frame->documentElement();
-
 
107
    QWebElement firstTable = document.findFirst("table");
-
 
108
    QWebElementCollection elements = firstTable.findAll("tr");
-
 
109
 
-
 
110
    foreach(QWebElement e, elements){
-
 
111
 
-
 
112
        //qDebug()<< "e element" <<e.tagName() << ":" << e.toPlainText();
-
 
113
        //qDebug("-----Row");
-
 
114
        bool has_RefError = hasRefError(e.toPlainText());
-
 
115
 
-
 
116
        QWebElementCollection td = e.findAll("td");
-
 
117
        QStringList parts;
-
 
118
        
-
 
119
        foreach(QWebElement e, td)
-
 
120
        {
-
 
121
            //qDebug()<< e.tagName() << ":" << e.toPlainText();
-
 
122
            parts.append(e.toPlainText());
-
 
123
        }
-
 
124
        insertParts( parts, has_RefError );
-
 
125
    }
-
 
126
 
-
 
127
    // Post Load fix up
-
 
128
    tableWidget->resizeColumnsToContents();
-
 
129
    reportErrors( bad_cat, bad_refs);
-
 
130
}
-
 
131
 
-
 
132
/*----------------------------------------------------------------------------
-
 
133
** FUNCTION           : createWindow
-
 
134
**
-
 
135
** DESCRIPTION        : Create the basic window
-
 
136
**                      Used in multiple places
-
 
137
**
-
 
138
**
-
 
139
** INPUTS             :
-
 
140
**
-
 
141
** RETURNS            :
-
 
142
**
-
 
143
----------------------------------------------------------------------------*/
-
 
144
 
-
 
145
void QmDialogLoadExternalTeams::createWindow(void)
-
 
146
{
-
 
147
    bad_cat = 0;
-
 
148
    bad_refs = 0;
-
 
149
 
22
    resize(550, 500);
150
    resize(550, 500);
23
    setSizeGripEnabled(true);
151
    setSizeGripEnabled(true);
24
    setWindowTitle("Load External Team Data");
152
    setWindowTitle("Load External Team Data");
25
 
153
 
26
    QVBoxLayout *verticalLayout;
154
    QVBoxLayout *verticalLayout;
27
    verticalLayout = new QVBoxLayout(this);
155
    verticalLayout = new QVBoxLayout(this);
28
    verticalLayout->setContentsMargins(0, 0, 0, 0);
156
    verticalLayout->setContentsMargins(0, 0, 0, 0);
29
 
157
 
30
    QVBoxLayout *verticalLayout2;
158
    QVBoxLayout *verticalLayout2;
31
    verticalLayout2 = new QVBoxLayout(this);
159
    verticalLayout2 = new QVBoxLayout();
32
    verticalLayout2->setContentsMargins(5, 5, 5, 5);
160
    verticalLayout2->setContentsMargins(5, 5, 5, 5);
33
 
161
 
34
    QHBoxLayout *horizontalLayout;
162
    QHBoxLayout *horizontalLayout;
35
    horizontalLayout = new QHBoxLayout();
163
    horizontalLayout = new QHBoxLayout();
36
 
164
 
Line 50... Line 178...
50
 
178
 
51
    fileName = new QLineEdit(this);
179
    fileName = new QLineEdit(this);
52
    fileName->setObjectName(QString::fromUtf8("fileName"));
180
    fileName->setObjectName(QString::fromUtf8("fileName"));
53
    fileName->setGeometry(QRect(20, 470, 331, 20));
181
    fileName->setGeometry(QRect(20, 470, 331, 20));
54
    fileName->setReadOnly(true);
182
    fileName->setReadOnly(true);
55
    fileName->setText(efile);
-
 
56
    horizontalLayout->addWidget(fileName);
183
    horizontalLayout->addWidget(fileName);
57
 
184
 
58
 
-
 
59
 
-
 
60
    load = new QPushButton(this);
185
    load = new QPushButton(this);
61
    load->setObjectName(QString::fromUtf8("load"));
186
    load->setObjectName(QString::fromUtf8("load"));
62
    load->setGeometry(QRect(370, 470, 75, 23));
187
    load->setGeometry(QRect(370, 470, 75, 23));
63
    load->setText("Load");
188
    load->setText("Load");
64
    horizontalLayout->addWidget(load);
189
    horizontalLayout->addWidget(load);
Line 70... Line 195...
70
    cancel->setText("Cancel");
195
    cancel->setText("Cancel");
71
    horizontalLayout->addWidget(cancel);
196
    horizontalLayout->addWidget(cancel);
72
 
197
 
73
    verticalLayout->addLayout(horizontalLayout);
198
    verticalLayout->addLayout(horizontalLayout);
74
 
199
 
75
 
-
 
76
    // Open the users file
-
 
77
 
-
 
78
    QFile file(efile);
-
 
79
    if ( ! file.open(QIODevice::ReadOnly | QIODevice::Text) )
-
 
80
    {
-
 
81
        MainWindow::showMessage("Cannot open external data file");
-
 
82
        return;
-
 
83
    }
-
 
84
    MainWindow::showMessage("Loading External Data");
-
 
85
 
-
 
86
    // Insert column headers
200
    // Insert column headers
87
    tableWidget->setColumnCount(3 + ( 2 * config.num_legs) );
201
    tableWidget->setColumnCount(3 + ( 2 * config.num_legs) );
88
    QStringList labels;
202
    QStringList labels;
89
    labels << "Team" << "Team Name" << "Cat";
203
    labels << "Team" << "Team Name" << "Cat";
90
    for (int ii = 1; ii <= config.num_legs; ii++ )
204
    for (int ii = 1; ii <= config.num_legs; ii++ )
91
    {
205
    {
92
        labels += QString("Leg:%1").arg(QString::number(ii));
206
        labels += QString("Leg:%1").arg(QString::number(ii));
93
        labels += QString("Age:%1").arg(QString::number(ii));
207
        labels += QString("Age:%1").arg(QString::number(ii));
94
    }
208
    }
95
    tableWidget->setHorizontalHeaderLabels(labels);
209
    tableWidget->setHorizontalHeaderLabels(labels);
-
 
210
    
96
 
211
 
97
    // Process Each line of the file
212
    // Connect up buttons
98
    QTextStream in(&file);
213
    connect (load, SIGNAL(clicked()), this, SLOT(loadData()));
99
    int ii = 0;
-
 
100
    int bad_cat = 0;
-
 
101
    QRegExp csv_split("\"?,\"?");
214
    connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
102
    while (!in.atEnd())
-
 
103
    {
215
}
104
        QString line = in.readLine();
-
 
105
        line = line.trimmed();             // Remove leading and training White Space
-
 
106
        line.remove(0xA0);                 // M$ special uglyness
-
 
107
 
216
 
108
        QStringList parts = splitCsvData(line);
217
/*----------------------------------------------------------------------------
109
        QString first = parts.value(0);
218
** FUNCTION           : insertParts
110
        bool ok;
219
**
111
        if ( first.isEmpty() )
220
** DESCRIPTION        : Insert raw data into the display table
-
 
221
**
112
            continue;
222
**
113
        int team = first.toInt(&ok);
223
** INPUTS             : parts           - Ref to a list of parts
114
        if ( ! ok || team <= 0 )
224
**                      has_RefError    - Data has Ref Error
-
 
225
**
115
            continue;
226
** RETURNS            :
-
 
227
**
116
        tableWidget->setRowCount(1+ii);
228
----------------------------------------------------------------------------*/
117
 
229
 
-
 
230
void QmDialogLoadExternalTeams::insertParts(QStringList &parts, bool has_RefError)
-
 
231
{
118
        // Insert Team number
232
    QString first = parts.value(0);
-
 
233
    bool ok;
119
        tableWidget->setItem(ii, 0, new QTableWidgetItem(first));
234
    if ( first.isEmpty() )
120
        parts.removeFirst();
235
        return;
121
 
236
 
122
        // Extract Team Name
237
    int team = first.toInt(&ok);
123
        tableWidget->setItem(ii, 1, new QTableWidgetItem( parts.value(0) ) );
238
    if ( ! ok || team <= 0 )
124
        parts.removeFirst();
239
        return;
125
 
240
 
126
        // Extract Team Cat
241
    int ii = tableWidget->rowCount();
127
        QTableWidgetItem *item = new QTableWidgetItem( parts.value(0)) ;
-
 
128
        tableWidget->setItem(ii, 2, item );
242
    tableWidget->setRowCount(1 + ii );
129
 
243
 
-
 
244
    // Insert Team number
-
 
245
    QTableWidgetItem *item = new QTableWidgetItem(first);
-
 
246
    tableWidget->setItem(ii, 0, item );
-
 
247
    parts.removeFirst();
-
 
248
    if ( has_RefError )
-
 
249
    {
-
 
250
        item->setBackgroundColor(QColor(0,0,200,50));
-
 
251
        bad_refs++;
-
 
252
    }
-
 
253
 
-
 
254
    // Extract Team Name
-
 
255
    item = new QTableWidgetItem( parts.value(0) );
-
 
256
    tableWidget->setItem(ii, 1, item );
-
 
257
    if ( hasRefError(parts.value(0)) )
-
 
258
    {
-
 
259
        item->setBackgroundColor(QColor(0,0,200,50));
-
 
260
    }
-
 
261
    parts.removeFirst();
-
 
262
 
-
 
263
    // Extract Team Cat
-
 
264
    item = new QTableWidgetItem( parts.value(0)) ;
-
 
265
    tableWidget->setItem(ii, 2, item );
-
 
266
 
130
        if (config.lookup_class(qPrintable(parts.value(0)) ) <= 0 )
267
    if (config.lookup_class(qPrintable(parts.value(0)) ) <= 0 )
-
 
268
    {
-
 
269
        item->setBackgroundColor(QColor(200,0,0,50));
-
 
270
        bad_cat++;
-
 
271
    }
-
 
272
    if ( hasRefError(parts.value(0)) )
-
 
273
    {
-
 
274
        item->setBackgroundColor(QColor(0,0,200,50));
-
 
275
    }
-
 
276
    parts.removeFirst();
-
 
277
 
-
 
278
    int yy = 0;
-
 
279
    while ( parts.count() > 0)
-
 
280
    {
-
 
281
        // Name of competitor
-
 
282
        item = new QTableWidgetItem( parts.value(0));
-
 
283
        tableWidget->setItem(ii, 3+yy, item);
-
 
284
        if ( hasRefError(parts.value(0)) )
131
        {
285
        {
132
            item->setBackgroundColor(QColor(200,0,0,50));
286
            item->setBackgroundColor(QColor(0,0,200,50));
133
            bad_cat++;
-
 
134
        }
287
        }
135
        parts.removeFirst();
288
        parts.removeFirst();
136
 
289
 
137
        int yy = 0;
-
 
138
        while ( parts.count() > 0)
-
 
139
        {
-
 
140
            // Name of competitor
-
 
141
            tableWidget->setItem(ii, 3+yy, new QTableWidgetItem( parts.value(0)));
-
 
142
            parts.removeFirst();
-
 
143
 
290
 
144
// Not loading age at the moment
291
        // Not loading age at the moment
145
// Reason: The CSV file is being create with a '0' for the NE teams
292
        // Reason: The CSV file is being create with a '0' for the NE teams
146
#if DO_AGE_LOAD
293
#if DO_AGE_LOAD
147
            // Posible age - if its a number
294
        // Posible age - if its a number
148
            int age = parts.value(0).toInt(&ok);
295
        int age = parts.value(0).toInt(&ok);
149
            if ( ok )
296
        if ( ok )
-
 
297
        {
-
 
298
            if ( age > 0 )
150
            {
299
            {
151
                if ( age > 0 )
-
 
152
                {
-
 
153
                    tableWidget->setItem(ii, 4+yy, new QTableWidgetItem( parts.value(0)));
300
                tableWidget->setItem(ii, 4+yy, new QTableWidgetItem( parts.value(0)));
154
                }
-
 
155
                parts.removeFirst();
-
 
156
            }
301
            }
157
#endif
-
 
158
            yy += 2;
302
            parts.removeFirst();
159
        }
303
        }
160
        ii++;
-
 
161
    }
304
#endif
162
    tableWidget->resizeColumnsToContents();
-
 
163
 
-
 
164
    // Report errors
-
 
165
    if (bad_cat)
305
        yy += 2;
166
    {
-
 
167
        MainWindow::showMessage("Invalid Categories in data");
-
 
168
    }
306
    }
169
 
-
 
170
    // Connect up buttons
-
 
171
 
307
    
172
    connect (load, SIGNAL(clicked()), this, SLOT(loadData()));
-
 
173
    connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
-
 
174
}
308
}
-
 
309
/*----------------------------------------------------------------------------
-
 
310
** FUNCTION           : ~QmDialogLoadExternalTeams
-
 
311
**
-
 
312
** DESCRIPTION        : Class destructor
-
 
313
**
-
 
314
**
-
 
315
** INPUTS             :
-
 
316
**
-
 
317
** RETURNS            :
-
 
318
**
-
 
319
----------------------------------------------------------------------------*/
175
 
320
 
176
QmDialogLoadExternalTeams::~QmDialogLoadExternalTeams()
321
QmDialogLoadExternalTeams::~QmDialogLoadExternalTeams()
177
{
322
{
178
 
323
 
179
}
324
}
180
 
325
 
-
 
326
/*----------------------------------------------------------------------------
-
 
327
** FUNCTION           : loadData
-
 
328
**
-
 
329
** DESCRIPTION        : Store the data from the table into the database
-
 
330
**
-
 
331
**
-
 
332
** INPUTS             :
-
 
333
**
-
 
334
** RETURNS            :
-
 
335
**
-
 
336
----------------------------------------------------------------------------*/
-
 
337
 
181
void QmDialogLoadExternalTeams::loadData(void)
338
void QmDialogLoadExternalTeams::loadData(void)
182
{
339
{
183
    qDebug ("LoadData");
340
    qDebug ("LoadData");
184
    team_type team_buf;
341
    team_type team_buf;
185
    int bad_cat = 0;
342
    int bad_cat = 0;
-
 
343
    int bad_refs = 0;
186
    for ( int ii = 0; ii < tableWidget->rowCount(); ii++)
344
    for ( int ii = 0; ii < tableWidget->rowCount(); ii++)
187
    {
345
    {
188
        if ( tableWidget->isRowHidden(ii))
346
        if ( tableWidget->isRowHidden(ii))
189
        {
347
        {
190
            continue;
348
            continue;
Line 232... Line 390...
232
                    }
390
                    }
233
                    item = tableWidget->item(ii,yy);
391
                    item = tableWidget->item(ii,yy);
234
                    if (item)
392
                    if (item)
235
                    {
393
                    {
236
                        strncpy(team_buf.members[member].name , qPrintable(item->data(Qt::EditRole).toString()), sizeof(team_buf.members[member].name));
394
                        strncpy(team_buf.members[member].name , qPrintable(item->data(Qt::EditRole).toString()), sizeof(team_buf.members[member].name));
-
 
395
                        if ( hasRefError(item->data(Qt::EditRole).toString()) )
-
 
396
                        {
-
 
397
                            bad = true;
-
 
398
                            bad_refs++;
-
 
399
                        }
237
                    }
400
                    }
238
                    item = tableWidget->item(ii,1+yy);
401
                    item = tableWidget->item(ii,1+yy);
239
                    if (item)
402
                    if (item)
240
                    {
403
                    {
241
                        int age = item->data(Qt::EditRole).toInt();
404
                        int age = item->data(Qt::EditRole).toInt();
Line 244... Line 407...
244
                            team_buf.members[member].age = age;
407
                            team_buf.members[member].age = age;
245
                        }
408
                        }
246
                    }
409
                    }
247
                }
410
                }
248
 
411
 
-
 
412
                team_buf.flags.valid = TRUE;
249
                put_team_record( team, &team_buf );
413
                put_team_record( team, &team_buf );
250
            }
414
            }
251
            else
415
            else
252
            {
416
            {
253
                bad = true;
417
                bad = true;
Line 262... Line 426...
262
            tableWidget->hideRow(ii);
426
            tableWidget->hideRow(ii);
263
        }
427
        }
264
    }
428
    }
265
 
429
 
266
    // Report errors
430
    // Report errors
-
 
431
    reportErrors( bad_cat, bad_refs);
-
 
432
}
-
 
433
 
-
 
434
/*----------------------------------------------------------------------------
-
 
435
** FUNCTION           : reportErrors
-
 
436
**
-
 
437
** DESCRIPTION        : Report errors on the main window
-
 
438
**
-
 
439
**
-
 
440
** INPUTS             : bad_cat - count of category erors
-
 
441
**                      bad_refs - count of Reference errors
-
 
442
**
-
 
443
** RETURNS            :
-
 
444
**
-
 
445
----------------------------------------------------------------------------*/
-
 
446
 
-
 
447
void QmDialogLoadExternalTeams::reportErrors( int bad_cat, int bad_refs )
-
 
448
{
-
 
449
    if ( bad_cat && bad_refs )
-
 
450
    {
-
 
451
        MainWindow::showMessage("Invalid Categories in data and bad REFs");
-
 
452
    }
267
    if (bad_cat)
453
    else if (bad_cat)
268
    {
454
    {
269
        MainWindow::showMessage("Invalid Categories in data");
455
        MainWindow::showMessage("Invalid Categories in data");
270
    }
456
    }
-
 
457
    else if (bad_refs)
-
 
458
    {
-
 
459
        MainWindow::showMessage("Imported data has bad REFs");
-
 
460
    }
-
 
461
    
271
}
462
}
272
 
463
 
273
/*========================================================================
464
/*========================================================================
274
 *
465
 *
275
 *  Generate team name file
466
 *  Generate team name file
Line 361... Line 552...
361
 
552
 
362
            data++;
553
            data++;
363
 
554
 
364
            /*
555
            /*
365
            ** Ugly character from MS CSV files
556
            ** Ugly character from MS CSV files
-
 
557
            ** Not too sure what the 194 is. It looks like a 0xA0 in the raw data
366
            */
558
            */
367
            if ( uch == (char) 0xA0 )
559
            if ( uch == (char) 0xA0 || uch == (char)194 )
368
            {
560
            {
369
                continue;
561
                continue;
370
            }
562
            }
371
 
563
 
372
            if ( !quoted && uch == ',' )
564
            if ( !quoted && uch == ',' )
Line 408... Line 600...
408
 
600
 
409
        /*
601
        /*
410
        **  Clean up the extracted string
602
        **  Clean up the extracted string
411
        */
603
        */
412
        results += result.trimmed();
604
        results += result.trimmed();
413
     }
605
    }
414
    return results;
606
    return results;
415
}
607
}
-
 
608
/*----------------------------------------------------------------------------
-
 
609
** FUNCTION           : hasRefError
-
 
610
**
-
 
611
** DESCRIPTION        : Determine if a string contains an Excel Reference
-
 
612
**                      error: #REF!
-
 
613
**
-
 
614
**
-
 
615
** INPUTS             : data - String to test
-
 
616
**
-
 
617
** RETURNS            : True: Is an error
-
 
618
**
-
 
619
----------------------------------------------------------------------------*/
-
 
620
 
-
 
621
bool QmDialogLoadExternalTeams::hasRefError( const QString data)
-
 
622
{
-
 
623
    return data.contains("#REF!");
-
 
624
}
416
 
625
 
417
/*========================================================================
626
/*========================================================================
418
 *
627
 *
419
 *  Generate team name file
628
 *  Generate team name file
420
 *
629
 *
Line 440... Line 649...
440
        MainWindow::showMessage("Cannot open external team info file");
649
        MainWindow::showMessage("Cannot open external team info file");
441
        return;
650
        return;
442
    }
651
    }
443
    QTextStream out(&file);
652
    QTextStream out(&file);
444
 
653
 
445
     /*
654
    /*
446
     * Put the data into the file
655
     * Put the data into the file
447
     */
656
     */
448
    team_type   team_buf;
657
    team_type   team_buf;
449
    for(int i = config.min_team; i <= config.max_team; i++ )
658
    for(int i = config.min_team; i <= config.max_team; i++ )
450
    {
659
    {