Subversion Repositories tpanel

Rev

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

Rev 350 Rev 351
Line 6041... Line 6041...
6041
    DECL_TRACER("TPageManager::doPPT(int port, vector<int>& channels, vector<string>& pars)");
6041
    DECL_TRACER("TPageManager::doPPT(int port, vector<int>& channels, vector<string>& pars)");
6042
 
6042
 
6043
    if (pars.size() < 2)
6043
    if (pars.size() < 2)
6044
    {
6044
    {
6045
        MSG_ERROR("Expecting 2 parameters!");
6045
        MSG_ERROR("Expecting 2 parameters!");
-
 
6046
#if TESTMODE == 1
-
 
6047
        setAllDone();
-
 
6048
#endif
6046
        return;
6049
        return;
6047
    }
6050
    }
6048
 
6051
 
6049
    TError::clear();
6052
    TError::clear();
6050
    TSubPage *pg = deliverSubPage(pars[0]);
6053
    TSubPage *pg = deliverSubPage(pars[0]);
6051
 
6054
 
6052
    if (!pg)
6055
    if (!pg)
-
 
6056
    {
-
 
6057
#if TESTMODE == 1
-
 
6058
        setAllDone();
-
 
6059
#endif
6053
        return;
6060
        return;
-
 
6061
    }
6054
 
6062
 
6055
    pg->setTimeout(atoi(pars[1].c_str()));
6063
    pg->setTimeout(atoi(pars[1].c_str()));
-
 
6064
#if TESTMODE == 1
-
 
6065
    if (_gTestMode)
-
 
6066
        _gTestMode->setResult(intToString(pg->getTimeout()));
-
 
6067
 
-
 
6068
    __success = true;
-
 
6069
    setAllDone();
-
 
6070
#endif
6056
}
6071
}
6057
 
6072
 
6058
/**
6073
/**
6059
 * Close all popups on all pages. This command works in the same way as the
6074
 * Close all popups on all pages. This command works in the same way as the
6060
 * 'Clear All' command in TPDesign 4.
6075
 * 'Clear All' command in TPDesign 4.
Line 6070... Line 6085...
6070
    {
6085
    {
6071
        TSubPage *sub = chain->page->getFirstSubPage();
6086
        TSubPage *sub = chain->page->getFirstSubPage();
6072
 
6087
 
6073
        while (sub)
6088
        while (sub)
6074
        {
6089
        {
6075
            MSG_DEBUG("Dopping subpage " << sub->getNumber() << ", \"" << sub->getName() << "\".");
6090
            MSG_DEBUG("Dropping subpage " << sub->getNumber() << ", \"" << sub->getName() << "\".");
6076
            sub->drop();
6091
            sub->drop();
6077
            sub = chain->page->getNextSubPage();
6092
            sub = chain->page->getNextSubPage();
6078
        }
6093
        }
6079
 
6094
 
6080
        chain = chain->next;
6095
        chain = chain->next;
Line 6083... Line 6098...
6083
    TPage *page = getPage(mActualPage);
6098
    TPage *page = getPage(mActualPage);
6084
 
6099
 
6085
    if (!page)
6100
    if (!page)
6086
    {
6101
    {
6087
        MSG_ERROR("No active page found! Internal error.");
6102
        MSG_ERROR("No active page found! Internal error.");
-
 
6103
#if TESTMODE == 1
-
 
6104
        setAllDone();
-
 
6105
#endif
6088
        return;
6106
        return;
6089
    }
6107
    }
6090
 
6108
 
6091
    page->resetZOrder();
6109
    page->resetZOrder();
-
 
6110
#if TESTMODE == 1
-
 
6111
    setDone();
-
 
6112
#endif
6092
}
6113
}
6093
 
6114
 
6094
/**
6115
/**
6095
 * Set the show effect for the specified popup page to the named show effect.
6116
 * Set the show effect for the specified popup page to the named show effect.
6096
 */
6117
 */
Line 6099... Line 6120...
6099
    DECL_TRACER("TPageManager::doPSE(int port, vector<int>& channels, vector<string>& pars)");
6120
    DECL_TRACER("TPageManager::doPSE(int port, vector<int>& channels, vector<string>& pars)");
6100
 
6121
 
6101
    if (pars.size() < 2)
6122
    if (pars.size() < 2)
6102
    {
6123
    {
6103
        MSG_ERROR("Less than 2 parameters!");
6124
        MSG_ERROR("Less than 2 parameters!");
-
 
6125
#if TESTMODE == 1
-
 
6126
        setAllDone();
-
 
6127
#endif
6104
        return;
6128
        return;
6105
    }
6129
    }
6106
 
6130
 
6107
    TError::clear();
6131
    TError::clear();
6108
    TSubPage *pg = deliverSubPage(pars[0]);
6132
    TSubPage *pg = deliverSubPage(pars[0]);
6109
 
6133
 
6110
    if (!pg)
6134
    if (!pg)
-
 
6135
    {
-
 
6136
#if TESTMODE == 1
-
 
6137
        setAllDone();
-
 
6138
#endif
6111
        return;
6139
        return;
-
 
6140
    }
6112
 
6141
 
6113
    if (strCaseCompare(pars[1], "fade") == 0)
6142
    if (strCaseCompare(pars[1], "fade") == 0)
6114
        pg->setShowEffect(SE_FADE);
6143
        pg->setShowEffect(SE_FADE);
6115
    else if (strCaseCompare(pars[1], "slide to left") == 0)
6144
    else if (strCaseCompare(pars[1], "slide to left") == 0)
6116
        pg->setShowEffect(SE_SLIDE_LEFT);
6145
        pg->setShowEffect(SE_SLIDE_LEFT);
Line 6128... Line 6157...
6128
        pg->setShowEffect(SE_SLIDE_TOP_FADE);
6157
        pg->setShowEffect(SE_SLIDE_TOP_FADE);
6129
    else if (strCaseCompare(pars[1], "slide to bottom fade") == 0)
6158
    else if (strCaseCompare(pars[1], "slide to bottom fade") == 0)
6130
        pg->setShowEffect(SE_SLIDE_BOTTOM_FADE);
6159
        pg->setShowEffect(SE_SLIDE_BOTTOM_FADE);
6131
    else
6160
    else
6132
        pg->setShowEffect(SE_NONE);
6161
        pg->setShowEffect(SE_NONE);
-
 
6162
#if TESTMODE == 1
-
 
6163
    if (_gTestMode)
-
 
6164
        _gTestMode->setResult(intToString(pg->getShowEffect()));
-
 
6165
 
-
 
6166
    __success = true;
-
 
6167
    setAllDone();
-
 
6168
#endif
6133
}
6169
}
6134
 
6170
 
6135
/**
6171
/**
6136
 * Set the show effect position. Only 1 coordinate is ever needed for an effect;
6172
 * Set the show effect position. Only 1 coordinate is ever needed for an effect;
6137
 * however, the command will specify both. This command sets the location at
6173
 * however, the command will specify both. This command sets the location at
Line 6142... Line 6178...
6142
    DECL_TRACER("TPageManager::doPSP(int port, vector<int>& channels, vector<string>& pars)");
6178
    DECL_TRACER("TPageManager::doPSP(int port, vector<int>& channels, vector<string>& pars)");
6143
 
6179
 
6144
    if (pars.size() < 2)
6180
    if (pars.size() < 2)
6145
    {
6181
    {
6146
        MSG_ERROR("Less than 2 parameters!");
6182
        MSG_ERROR("Less than 2 parameters!");
-
 
6183
#if TESTMODE == 1
-
 
6184
        setAllDone();
-
 
6185
#endif
6147
        return;
6186
        return;
6148
    }
6187
    }
6149
 
6188
 
6150
    TError::clear();
6189
    TError::clear();
6151
    size_t pos = pars[1].find(",");
6190
    size_t pos = pars[1].find(",");
Line 6163... Line 6202...
6163
    }
6202
    }
6164
 
6203
 
6165
    TSubPage *pg = deliverSubPage(pars[0]);
6204
    TSubPage *pg = deliverSubPage(pars[0]);
6166
 
6205
 
6167
    if (!pg)
6206
    if (!pg)
-
 
6207
    {
-
 
6208
#if TESTMODE == 1
-
 
6209
        setAllDone();
-
 
6210
#endif
6168
        return;
6211
        return;
-
 
6212
    }
6169
 
6213
 
6170
    pg->setShowEndPosition(x, y);
6214
    pg->setShowEndPosition(x, y);
-
 
6215
#if TESTMODE == 1
-
 
6216
    pg->getShowEndPosition(&x, &y);
-
 
6217
 
-
 
6218
    if (_gTestMode)
-
 
6219
        _gTestMode->setResult(intToString(x) + "," + intToString(y));
-
 
6220
 
-
 
6221
    __success = true;
-
 
6222
    setAllDone();
-
 
6223
#endif
6171
}
6224
}
6172
 
6225
 
6173
/**
6226
/**
6174
 * Set the show effect time for the specified popup page.
6227
 * Set the show effect time for the specified popup page.
6175
 */
6228
 */
Line 6178... Line 6231...
6178
    DECL_TRACER("TPageManager::doPST(int port, vector<int>& channels, vector<string>& pars)");
6231
    DECL_TRACER("TPageManager::doPST(int port, vector<int>& channels, vector<string>& pars)");
6179
 
6232
 
6180
    if (pars.size() < 2)
6233
    if (pars.size() < 2)
6181
    {
6234
    {
6182
        MSG_ERROR("Less than 2 parameters!");
6235
        MSG_ERROR("Less than 2 parameters!");
-
 
6236
#if TESTMODE == 1
-
 
6237
        setAllDone();
-
 
6238
#endif
6183
        return;
6239
        return;
6184
    }
6240
    }
6185
 
6241
 
6186
    TError::clear();
6242
    TError::clear();
6187
    TSubPage *pg = deliverSubPage(pars[0]);
6243
    TSubPage *pg = deliverSubPage(pars[0]);
6188
 
6244
 
6189
    if (!pg)
6245
    if (!pg)
-
 
6246
    {
-
 
6247
#if TESTMODE == 1
-
 
6248
        setAllDone();
-
 
6249
#endif
6190
        return;
6250
        return;
-
 
6251
    }
6191
 
6252
 
6192
    pg->setShowTime(atoi(pars[1].c_str()));
6253
    pg->setShowTime(atoi(pars[1].c_str()));
-
 
6254
#if TESTMODE == 1
-
 
6255
    if (_gTestMode)
-
 
6256
        _gTestMode->setResult(intToString(pg->getShowTime()));
-
 
6257
 
-
 
6258
    __success = 1;
-
 
6259
    setAllDone();
-
 
6260
#endif
6193
}
6261
}
6194
 
6262
 
6195
/**
6263
/**
6196
 * Flips to a page with a specified page name. If the page is currently active,
6264
 * Flips to a page with a specified page name. If the page is currently active,
6197
 * it will not redraw the page.
6265
 * it will not redraw the page.
Line 6201... Line 6269...
6201
    DECL_TRACER("TPageManager::doPAGE(int port, std::vector<int>& channels, std::vector<std::string>& pars)");
6269
    DECL_TRACER("TPageManager::doPAGE(int port, std::vector<int>& channels, std::vector<std::string>& pars)");
6202
 
6270
 
6203
    if (pars.empty())
6271
    if (pars.empty())
6204
    {
6272
    {
6205
        MSG_WARNING("Got no page parameter!");
6273
        MSG_WARNING("Got no page parameter!");
-
 
6274
#if TESTMODE == 1
-
 
6275
        setAllDone();
-
 
6276
#endif
6206
        return;
6277
        return;
6207
    }
6278
    }
6208
 
6279
 
6209
    TError::clear();
6280
    TError::clear();
6210
    setPage(pars[0]);
6281
    setPage(pars[0]);
-
 
6282
#if TESTMODE == 1
-
 
6283
    if (_gTestMode)
-
 
6284
        _gTestMode->setResult(intToString(getActualPageNumber()));
-
 
6285
 
-
 
6286
    setDone();
-
 
6287
#endif
6211
}
6288
}
6212
 
6289
 
6213
/**
6290
/**
6214
 * @brief TPageManager::doANI Run a button animation (in 1/10 second).
6291
 * @brief TPageManager::doANI Run a button animation (in 1/10 second).
6215
 * Syntax:
6292
 * Syntax:
Line 6257... Line 6334...
6257
        {
6334
        {
6258
            Button::TButton *bt = *mapIter;
6335
            Button::TButton *bt = *mapIter;
6259
            bt->startAnimation(stateStart, endState, runTime);
6336
            bt->startAnimation(stateStart, endState, runTime);
6260
        }
6337
        }
6261
    }
6338
    }
-
 
6339
#if TESTMODE == 1
-
 
6340
    if (_gTestMode)
-
 
6341
        _gTestMode->setResult(intToString(stateStart) + "," + intToString(endState) + "," + intToString(runTime));
-
 
6342
 
-
 
6343
    setDone();
-
 
6344
#endif
6262
}
6345
}
6263
 
6346
 
6264
/**
6347
/**
6265
 * Add page flip action to a button if it does not already exist.
6348
 * Add page flip action to a button if it does not already exist.
6266
 */
6349
 */
Line 6269... Line 6352...
6269
    DECL_TRACER("TPageManager::doAPF(int port, vector<int>& channels, vector<string>& pars)");
6352
    DECL_TRACER("TPageManager::doAPF(int port, vector<int>& channels, vector<string>& pars)");
6270
 
6353
 
6271
    if (pars.size() < 2)
6354
    if (pars.size() < 2)
6272
    {
6355
    {
6273
        MSG_ERROR("Expecting 2 parameters but got " << pars.size() << "! Ignoring command.");
6356
        MSG_ERROR("Expecting 2 parameters but got " << pars.size() << "! Ignoring command.");
-
 
6357
#if TESTMODE == 1
-
 
6358
        setAllDone();
-
 
6359
#endif
6274
        return;
6360
        return;
6275
    }
6361
    }
6276
 
6362
 
6277
    TError::clear();
6363
    TError::clear();
6278
    string action = pars[0];
6364
    string action = pars[0];
6279
    string pname = pars[1];
6365
    string pname = pars[1];
6280
 
6366
 
6281
    vector<TMap::MAP_T> map = findButtons(port, channels);
6367
    vector<TMap::MAP_T> map = findButtons(port, channels);
6282
 
6368
 
6283
    if (TError::isError() || map.empty())
6369
    if (TError::isError() || map.empty())
-
 
6370
    {
-
 
6371
#if TESTMODE == 1
-
 
6372
        setAllDone();
-
 
6373
#endif
6284
        return;
6374
        return;
-
 
6375
    }
6285
 
6376
 
6286
    vector<Button::TButton *> buttons = collectButtons(map);
6377
    vector<Button::TButton *> buttons = collectButtons(map);
6287
 
6378
 
6288
    if (buttons.size() > 0)
6379
    if (buttons.size() > 0)
6289
    {
6380
    {
Line 6293... Line 6384...
6293
        {
6384
        {
6294
            Button::TButton *bt = *mapIter;
6385
            Button::TButton *bt = *mapIter;
6295
            bt->addPushFunction(action, pname);
6386
            bt->addPushFunction(action, pname);
6296
        }
6387
        }
6297
    }
6388
    }
-
 
6389
#if TESTMODE == 1
-
 
6390
    if (_gTestMode)
-
 
6391
        _gTestMode->setResult(toUpper(action) + "," + toUpper(pname));
-
 
6392
 
-
 
6393
    __success = true;
-
 
6394
    setAllDone();
-
 
6395
#endif
6298
}
6396
}
6299
 
6397
 
6300
/**
6398
/**
6301
 * Append non-unicode text.
6399
 * Append non-unicode text.
6302
 */
6400
 */
Line 6372... Line 6470...
6372
    DECL_TRACER("TPageManager::doBAU(int port, vector<int>& channels, vector<string>& pars)");
6470
    DECL_TRACER("TPageManager::doBAU(int port, vector<int>& channels, vector<string>& pars)");
6373
 
6471
 
6374
    if (pars.size() < 1)
6472
    if (pars.size() < 1)
6375
    {
6473
    {
6376
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6474
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6475
#if TESTMODE == 1
-
 
6476
        setAllDone();
-
 
6477
#endif
6377
        return;
6478
        return;
6378
    }
6479
    }
6379
 
6480
 
6380
    TError::clear();
6481
    TError::clear();
6381
    int btState = atoi(pars[0].c_str());
6482
    int btState = atoi(pars[0].c_str());
Line 6459... Line 6560...
6459
            delete[] numstr;
6560
            delete[] numstr;
6460
        }
6561
        }
6461
        catch (std::exception const & e)
6562
        catch (std::exception const & e)
6462
        {
6563
        {
6463
            MSG_ERROR("Character conversion error: " << e.what());
6564
            MSG_ERROR("Character conversion error: " << e.what());
-
 
6565
#if TESTMODE == 1
-
 
6566
            setAllDone();
-
 
6567
#endif
6464
            return;
6568
            return;
6465
        }
6569
        }
6466
    }
6570
    }
6467
    else
6571
    else
6468
    {
6572
    {
6469
        MSG_WARNING("No or invalid UTF16 string: " << text);
6573
        MSG_WARNING("No or invalid UTF16 string: " << text);
-
 
6574
#if TESTMODE == 1
-
 
6575
        setAllDone();
-
 
6576
#endif
6470
        return;
6577
        return;
6471
    }
6578
    }
6472
 
6579
 
6473
    vector<TMap::MAP_T> map = findButtons(port, channels);
6580
    vector<TMap::MAP_T> map = findButtons(port, channels);
6474
 
6581
 
6475
    if (TError::isError() || map.empty())
6582
    if (TError::isError() || map.empty())
-
 
6583
    {
-
 
6584
#if TESTMODE == 1
-
 
6585
        setAllDone();
-
 
6586
#endif
6476
        return;
6587
        return;
-
 
6588
    }
6477
 
6589
 
6478
    vector<Button::TButton *> buttons = collectButtons(map);
6590
    vector<Button::TButton *> buttons = collectButtons(map);
6479
 
6591
 
6480
    if (buttons.size() > 0)
6592
    if (buttons.size() > 0)
6481
    {
6593
    {
Line 6511... Line 6623...
6511
    DECL_TRACER("TPageManager::doBCB(int port, vector<int> &channels, vector<string> &pars)");
6623
    DECL_TRACER("TPageManager::doBCB(int port, vector<int> &channels, vector<string> &pars)");
6512
 
6624
 
6513
    if (pars.size() < 1)
6625
    if (pars.size() < 1)
6514
    {
6626
    {
6515
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6627
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6628
#if TESTMODE == 1
-
 
6629
        setAllDone();
-
 
6630
#endif
6516
        return;
6631
        return;
6517
    }
6632
    }
6518
 
6633
 
6519
    TError::clear();
6634
    TError::clear();
6520
    int btState = atoi(pars[0].c_str());
6635
    int btState = atoi(pars[0].c_str());
Line 6524... Line 6639...
6524
        color = pars[1];
6639
        color = pars[1];
6525
 
6640
 
6526
    vector<TMap::MAP_T> map = findButtons(port, channels);
6641
    vector<TMap::MAP_T> map = findButtons(port, channels);
6527
 
6642
 
6528
    if (TError::isError() || map.empty())
6643
    if (TError::isError() || map.empty())
-
 
6644
    {
-
 
6645
#if TESTMODE == 1
-
 
6646
        setAllDone();
-
 
6647
#endif
6529
        return;
6648
        return;
-
 
6649
    }
6530
 
6650
 
6531
    vector<Button::TButton *> buttons = collectButtons(map);
6651
    vector<Button::TButton *> buttons = collectButtons(map);
6532
 
6652
 
6533
    if (buttons.size() > 0)
6653
    if (buttons.size() > 0)
6534
    {
6654
    {
6535
        vector<Button::TButton *>::iterator mapIter;
6655
        vector<Button::TButton *>::iterator mapIter;
6536
 
6656
 
6537
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6657
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6538
        {
6658
        {
6539
            Button::TButton *bt = *mapIter;
6659
            Button::TButton *bt = *mapIter;
6540
//            setButtonCallbacks(bt);
-
 
6541
 
-
 
6542
            if (btState == 0)       // All instances?
-
 
6543
            {
-
 
6544
                int bst = bt->getNumberInstances();
-
 
6545
 
-
 
6546
                for (int i = 0; i < bst; i++)
-
 
6547
                    bt->setBorderColor(color, i);
6660
            bt->setBorderColor(color, btState - 1);
6548
            }
6661
#if TESTMODE == 1
6549
            else
6662
            if (_gTestMode)
6550
                bt->setBorderColor(color, btState - 1);
6663
                _gTestMode->setResult(bt->getBorderColor(btState == 0 ? 0 : btState - 1));
-
 
6664
#endif
6551
        }
6665
        }
6552
    }
6666
    }
-
 
6667
#if TESTMODE == 1
-
 
6668
    setDone();
-
 
6669
#endif
6553
}
6670
}
6554
 
6671
 
-
 
6672
/*
-
 
6673
 * Get the border color and send it as a custom event.
-
 
6674
 */
6555
void TPageManager::getBCB(int port, vector<int> &channels, vector<string> &pars)
6675
void TPageManager::getBCB(int port, vector<int> &channels, vector<string> &pars)
6556
{
6676
{
6557
    DECL_TRACER("TPageManager::getBCB(int port, vector<int> &channels, vector<string> &pars)");
6677
    DECL_TRACER("TPageManager::getBCB(int port, vector<int> &channels, vector<string> &pars)");
6558
 
6678
 
6559
    if (pars.size() < 1)
6679
    if (pars.size() < 1)
6560
    {
6680
    {
6561
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6681
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6682
#if TESTMODE == 1
-
 
6683
        setAllDone();
-
 
6684
#endif
6562
        return;
6685
        return;
6563
    }
6686
    }
6564
 
6687
 
6565
    TError::clear();
6688
    TError::clear();
6566
    int btState = atoi(pars[0].c_str());
6689
    int btState = atoi(pars[0].c_str());
6567
    string color;
6690
    string color;
6568
 
6691
 
6569
    vector<TMap::MAP_T> map = findButtons(port, channels);
6692
    vector<TMap::MAP_T> map = findButtons(port, channels);
6570
 
6693
 
6571
    if (TError::isError() || map.empty())
6694
    if (TError::isError() || map.empty())
-
 
6695
    {
-
 
6696
#if TESTMODE == 1
-
 
6697
        setAllDone();
-
 
6698
#endif
6572
        return;
6699
        return;
-
 
6700
    }
6573
 
6701
 
6574
    vector<Button::TButton *> buttons = collectButtons(map);
6702
    vector<Button::TButton *> buttons = collectButtons(map);
6575
 
6703
 
6576
    if (buttons.size() > 0)
6704
    if (buttons.empty())
6577
    {
6705
    {
-
 
6706
#if TESTMODE == 1
-
 
6707
        setAllDone();
-
 
6708
#endif
-
 
6709
        return;
-
 
6710
    }
-
 
6711
 
-
 
6712
    vector<Button::TButton *>::iterator iter;
-
 
6713
 
-
 
6714
    for (iter = buttons.begin(); iter != buttons.end(); ++iter)
-
 
6715
    {
6578
        Button::TButton *bt = buttons[0];
6716
        Button::TButton *bt = *iter;
6579
 
6717
 
6580
        if (btState == 0)       // All instances?
6718
        if (btState == 0)       // All instances?
6581
        {
6719
        {
6582
            int bst = bt->getNumberInstances();
6720
            int bst = bt->getNumberInstances();
6583
 
6721
 
Line 6587... Line 6725...
6587
 
6725
 
6588
                if (color.empty())
6726
                if (color.empty())
6589
                    continue;
6727
                    continue;
6590
 
6728
 
6591
                sendCustomEvent(i + 1, (int)color.length(), 0, color, 1011, bt->getChannelPort(), bt->getChannelNumber());
6729
                sendCustomEvent(i + 1, (int)color.length(), 0, color, 1011, bt->getChannelPort(), bt->getChannelNumber());
-
 
6730
#if TESTMODE == 1
-
 
6731
                __success = true;
-
 
6732
 
-
 
6733
                if (_gTestMode)
-
 
6734
                    _gTestMode->setResult(color);
-
 
6735
#endif
6592
            }
6736
            }
6593
        }
6737
        }
6594
        else
6738
        else
6595
        {
6739
        {
6596
            color = bt->getBorderColor(btState - 1);
6740
            color = bt->getBorderColor(btState - 1);
6597
 
6741
 
6598
            if (color.empty())
6742
            if (color.empty())
6599
                return;
6743
                continue;
6600
 
6744
 
6601
            sendCustomEvent(btState, (int)color.length(), 0, color, 1011, bt->getChannelPort(), bt->getChannelNumber());
6745
            sendCustomEvent(btState, (int)color.length(), 0, color, 1011, bt->getChannelPort(), bt->getChannelNumber());
-
 
6746
#if TESTMODE == 1
-
 
6747
            __success = true;
-
 
6748
 
-
 
6749
            if (_gTestMode)
-
 
6750
                _gTestMode->setResult(color);
-
 
6751
#endif
6602
        }
6752
        }
6603
    }
6753
    }
-
 
6754
#if TESTMODE == 1
-
 
6755
    setAllDone();
-
 
6756
#endif
6604
}
6757
}
6605
 
6758
 
6606
/**
6759
/**
6607
 * @brief Set the fill color to the specified color.
6760
 * @brief Set the fill color to the specified color.
6608
 * Only if the specified fill color is not the same as the current color.
6761
 * Only if the specified fill color is not the same as the current color.
Line 6613... Line 6766...
6613
    DECL_TRACER("TPageManager::doBCF(int port, vector<int>& channels, vector<std::string>& pars)");
6766
    DECL_TRACER("TPageManager::doBCF(int port, vector<int>& channels, vector<std::string>& pars)");
6614
 
6767
 
6615
    if (pars.size() < 1)
6768
    if (pars.size() < 1)
6616
    {
6769
    {
6617
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6770
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6771
#if TESTMODE == 1
-
 
6772
        setAllDone();
-
 
6773
#endif
6618
        return;
6774
        return;
6619
    }
6775
    }
6620
 
6776
 
6621
    TError::clear();
6777
    TError::clear();
6622
    int btState = atoi(pars[0].c_str());
6778
    int btState = atoi(pars[0].c_str());
Line 6626... Line 6782...
6626
        color = pars[1];
6782
        color = pars[1];
6627
 
6783
 
6628
    vector<TMap::MAP_T> map = findButtons(port, channels);
6784
    vector<TMap::MAP_T> map = findButtons(port, channels);
6629
 
6785
 
6630
    if (TError::isError() || map.empty())
6786
    if (TError::isError() || map.empty())
-
 
6787
    {
-
 
6788
#if TESTMODE == 1
-
 
6789
        setAllDone();
-
 
6790
#endif
6631
        return;
6791
        return;
-
 
6792
    }
6632
 
6793
 
6633
    vector<Button::TButton *> buttons = collectButtons(map);
6794
    vector<Button::TButton *> buttons = collectButtons(map);
6634
 
6795
 
6635
    if (buttons.size() > 0)
6796
    if (buttons.size() > 0)
6636
    {
6797
    {
6637
        vector<Button::TButton *>::iterator mapIter;
6798
        vector<Button::TButton *>::iterator mapIter;
6638
 
6799
 
6639
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6800
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6640
        {
6801
        {
6641
            Button::TButton *bt = *mapIter;
6802
            Button::TButton *bt = *mapIter;
6642
//            setButtonCallbacks(bt);
-
 
6643
 
-
 
6644
            if (btState == 0)       // All instances?
-
 
6645
            {
-
 
6646
                int bst = bt->getNumberInstances();
-
 
6647
 
-
 
6648
                for (int i = 0; i < bst; i++)
-
 
6649
                    bt->setFillColor(color, i);
6803
            bt->setFillColor(color, btState - 1);
6650
            }
6804
#if TESTMODE == 1
6651
            else
6805
            if (_gTestMode)
6652
                bt->setFillColor(color, btState - 1);
6806
                _gTestMode->setResult(bt->getFillColor(btState == 0 ? 0 : btState - 1));
-
 
6807
#endif
6653
        }
6808
        }
6654
    }
6809
    }
-
 
6810
#if TESTMODE == 1
-
 
6811
    setDone();
-
 
6812
#endif
6655
}
6813
}
6656
 
6814
 
-
 
6815
/*
-
 
6816
 * Get the fill color and send it via a custom event to the NetLinx.
-
 
6817
 */
6657
void TPageManager::getBCF(int port, vector<int> &channels, vector<string> &pars)
6818
void TPageManager::getBCF(int port, vector<int> &channels, vector<string> &pars)
6658
{
6819
{
6659
    DECL_TRACER("TPageManager::getBCF(int port, vector<int> &channels, vector<string> &pars)");
6820
    DECL_TRACER("TPageManager::getBCF(int port, vector<int> &channels, vector<string> &pars)");
6660
 
6821
 
6661
    if (pars.size() < 1)
6822
    if (pars.size() < 1)
6662
    {
6823
    {
6663
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6824
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6825
#if TESTMODE == 1
-
 
6826
        setAllDone();
-
 
6827
#endif
6664
        return;
6828
        return;
6665
    }
6829
    }
6666
 
6830
 
6667
    TError::clear();
6831
    TError::clear();
6668
    int btState = atoi(pars[0].c_str());
6832
    int btState = atoi(pars[0].c_str());
6669
    string color;
6833
    string color;
6670
 
6834
 
6671
    vector<TMap::MAP_T> map = findButtons(port, channels);
6835
    vector<TMap::MAP_T> map = findButtons(port, channels);
6672
 
6836
 
6673
    if (TError::isError() || map.empty())
6837
    if (TError::isError() || map.empty())
-
 
6838
    {
-
 
6839
#if TESTMODE == 1
-
 
6840
        setAllDone();
-
 
6841
#endif
6674
        return;
6842
        return;
-
 
6843
    }
6675
 
6844
 
6676
    vector<Button::TButton *> buttons = collectButtons(map);
6845
    vector<Button::TButton *> buttons = collectButtons(map);
6677
 
6846
 
6678
    if (buttons.size() > 0)
6847
    if (buttons.empty())
-
 
6848
    {
-
 
6849
#if TESTMODE == 1
-
 
6850
        setAllDone();
-
 
6851
#endif
-
 
6852
        return;
-
 
6853
    }
-
 
6854
 
-
 
6855
    vector<Button::TButton *>::iterator iter;
-
 
6856
 
-
 
6857
    for (iter = buttons.begin(); iter != buttons.end(); ++iter)
6679
    {
6858
    {
6680
        Button::TButton *bt = buttons[0];
6859
        Button::TButton *bt = *iter;
6681
 
6860
 
6682
        if (btState == 0)       // All instances?
6861
        if (btState == 0)       // All instances?
6683
        {
6862
        {
6684
            int bst = bt->getNumberInstances();
6863
            int bst = bt->getNumberInstances();
6685
 
6864
 
Line 6689... Line 6868...
6689
 
6868
 
6690
                if (color.empty())
6869
                if (color.empty())
6691
                    continue;
6870
                    continue;
6692
 
6871
 
6693
                sendCustomEvent(i + 1, (int)color.length(), 0, color, 1012, bt->getChannelPort(), bt->getChannelNumber());
6872
                sendCustomEvent(i + 1, (int)color.length(), 0, color, 1012, bt->getChannelPort(), bt->getChannelNumber());
-
 
6873
#if TESTMODE == 1
-
 
6874
                __success = true;
-
 
6875
 
-
 
6876
                if (_gTestMode)
-
 
6877
                    _gTestMode->setResult(color);
-
 
6878
#endif
6694
            }
6879
            }
6695
        }
6880
        }
6696
        else
6881
        else
6697
        {
6882
        {
6698
            color = bt->getFillColor(btState-1);
6883
            color = bt->getFillColor(btState-1);
-
 
6884
 
-
 
6885
            if (color.empty())
-
 
6886
                continue;
-
 
6887
 
6699
            sendCustomEvent(btState, (int)color.length(), 0, color, 1012, bt->getChannelPort(), bt->getChannelNumber());
6888
            sendCustomEvent(btState, (int)color.length(), 0, color, 1012, bt->getChannelPort(), bt->getChannelNumber());
-
 
6889
#if TESTMODE == 1
-
 
6890
            __success = true;
-
 
6891
 
-
 
6892
            if (_gTestMode)
-
 
6893
                _gTestMode->setResult(color);
-
 
6894
#endif
6700
        }
6895
        }
6701
    }
6896
    }
-
 
6897
#if TESTMODE == 1
-
 
6898
    setAllDone();
-
 
6899
#endif
6702
}
6900
}
6703
 
6901
 
6704
/**
6902
/**
6705
 * @brief Set the text color to the specified color.
6903
 * @brief Set the text color to the specified color.
6706
 * Only if the specified text color is not the same as the current color.
6904
 * Only if the specified text color is not the same as the current color.
Line 6711... Line 6909...
6711
    DECL_TRACER("TPageManager::doBCT(int port, vector<int>& channels, vector<string>& pars)");
6909
    DECL_TRACER("TPageManager::doBCT(int port, vector<int>& channels, vector<string>& pars)");
6712
 
6910
 
6713
    if (pars.size() < 1)
6911
    if (pars.size() < 1)
6714
    {
6912
    {
6715
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6913
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6914
#if TESTMODE == 1
-
 
6915
        setAllDone();
-
 
6916
#endif
6716
        return;
6917
        return;
6717
    }
6918
    }
6718
 
6919
 
6719
    TError::clear();
6920
    TError::clear();
6720
    int btState = atoi(pars[0].c_str());
6921
    int btState = atoi(pars[0].c_str());
Line 6724... Line 6925...
6724
        color = pars[1];
6925
        color = pars[1];
6725
 
6926
 
6726
    vector<TMap::MAP_T> map = findButtons(port, channels);
6927
    vector<TMap::MAP_T> map = findButtons(port, channels);
6727
 
6928
 
6728
    if (TError::isError() || map.empty())
6929
    if (TError::isError() || map.empty())
-
 
6930
    {
-
 
6931
#if TESTMODE == 1
-
 
6932
        setAllDone();
-
 
6933
#endif
6729
        return;
6934
        return;
-
 
6935
    }
6730
 
6936
 
6731
    vector<Button::TButton *> buttons = collectButtons(map);
6937
    vector<Button::TButton *> buttons = collectButtons(map);
6732
 
6938
 
6733
    if (buttons.size() > 0)
6939
    if (buttons.size() > 0)
6734
    {
6940
    {
6735
        vector<Button::TButton *>::iterator mapIter;
6941
        vector<Button::TButton *>::iterator mapIter;
6736
 
6942
 
6737
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6943
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6738
        {
6944
        {
6739
            Button::TButton *bt = *mapIter;
6945
            Button::TButton *bt = *mapIter;
6740
//            setButtonCallbacks(bt);
-
 
6741
 
-
 
6742
            if (btState == 0)       // All instances?
-
 
6743
            {
-
 
6744
                int bst = bt->getNumberInstances();
-
 
6745
 
-
 
6746
                for (int i = 0; i < bst; i++)
-
 
6747
                    bt->setTextColor(color, i);
6946
            bt->setTextColor(color, btState - 1);
6748
            }
6947
#if TESTMODE == 1
6749
            else
6948
            if (_gTestMode)
6750
                bt->setTextColor(color, btState - 1);
6949
                _gTestMode->setResult(bt->getTextColor(btState == 0 ? 0 : btState - 1));
-
 
6950
#endif
6751
        }
6951
        }
6752
    }
6952
    }
-
 
6953
#if TESTMODE == 1
-
 
6954
    setDone();
-
 
6955
#endif
6753
}
6956
}
6754
 
6957
 
-
 
6958
/*
-
 
6959
 * Get the text color of a button and send it via a custom event to the NetLinx.
-
 
6960
 */
6755
void TPageManager::getBCT(int port, vector<int> &channels, vector<string> &pars)
6961
void TPageManager::getBCT(int port, vector<int> &channels, vector<string> &pars)
6756
{
6962
{
6757
    DECL_TRACER("TPageManager::getBCT(int port, vector<int> &channels, vector<string> &pars)");
6963
    DECL_TRACER("TPageManager::getBCT(int port, vector<int> &channels, vector<string> &pars)");
6758
 
6964
 
6759
    if (pars.size() < 1)
6965
    if (pars.size() < 1)
6760
    {
6966
    {
6761
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6967
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6968
#if TESTMODE == 1
-
 
6969
        setAllDone();
-
 
6970
#endif
6762
        return;
6971
        return;
6763
    }
6972
    }
6764
 
6973
 
6765
    TError::clear();
6974
    TError::clear();
6766
    int btState = atoi(pars[0].c_str());
6975
    int btState = atoi(pars[0].c_str());
6767
    string color;
6976
    string color;
6768
 
6977
 
6769
    vector<TMap::MAP_T> map = findButtons(port, channels);
6978
    vector<TMap::MAP_T> map = findButtons(port, channels);
6770
 
6979
 
6771
    if (TError::isError() || map.empty())
6980
    if (TError::isError() || map.empty())
-
 
6981
    {
-
 
6982
#if TESTMODE == 1
-
 
6983
        setAllDone();
-
 
6984
#endif
6772
        return;
6985
        return;
-
 
6986
    }
6773
 
6987
 
6774
    vector<Button::TButton *> buttons = collectButtons(map);
6988
    vector<Button::TButton *> buttons = collectButtons(map);
6775
 
6989
 
6776
    if (buttons.size() > 0)
6990
    if (buttons.empty())
-
 
6991
    {
-
 
6992
#if TESTMODE == 1
-
 
6993
        setAllDone();
-
 
6994
#endif
-
 
6995
        return;
-
 
6996
    }
-
 
6997
 
-
 
6998
    vector<Button::TButton *>::iterator iter;
-
 
6999
 
-
 
7000
    for (iter = buttons.begin(); iter != buttons.end(); ++iter)
6777
    {
7001
    {
6778
        Button::TButton *bt = buttons[0];
7002
        Button::TButton *bt = *iter;
6779
 
7003
 
6780
        if (btState == 0)       // All instances?
7004
        if (btState == 0)       // All instances?
6781
        {
7005
        {
6782
            int bst = bt->getNumberInstances();
7006
            int bst = bt->getNumberInstances();
6783
 
7007
 
Line 6787... Line 7011...
6787
 
7011
 
6788
                if (color.empty())
7012
                if (color.empty())
6789
                    continue;
7013
                    continue;
6790
 
7014
 
6791
                sendCustomEvent(i + 1, (int)color.length(), 0, color, 1013, bt->getChannelPort(), bt->getChannelNumber());
7015
                sendCustomEvent(i + 1, (int)color.length(), 0, color, 1013, bt->getChannelPort(), bt->getChannelNumber());
-
 
7016
#if TESTMODE == 1
-
 
7017
                __success = true;
-
 
7018
 
-
 
7019
                if (_gTestMode)
-
 
7020
                    _gTestMode->setResult(color);
-
 
7021
#endif
6792
            }
7022
            }
6793
        }
7023
        }
6794
        else
7024
        else
6795
        {
7025
        {
6796
            color = bt->getTextColor(btState - 1);
7026
            color = bt->getTextColor(btState - 1);
-
 
7027
 
-
 
7028
            if (color.empty())
-
 
7029
                continue;
-
 
7030
 
6797
            sendCustomEvent(btState, (int)color.length(), 0, color, 1013, bt->getChannelPort(), bt->getChannelNumber());
7031
            sendCustomEvent(btState, (int)color.length(), 0, color, 1013, bt->getChannelPort(), bt->getChannelNumber());
-
 
7032
#if TESTMODE == 1
-
 
7033
            __success = true;
-
 
7034
 
-
 
7035
            if (_gTestMode)
-
 
7036
                _gTestMode->setResult(color);
-
 
7037
#endif
6798
        }
7038
        }
6799
    }
7039
    }
-
 
7040
#if TESTMODE == 1
-
 
7041
    setAllDone();
-
 
7042
#endif
6800
}
7043
}
6801
 
7044
 
6802
/**
7045
/**
6803
 * Set the button draw order
7046
 * Set the button draw order
6804
 * Determines what order each layer of the button is drawn.
7047
 * Determines what order each layer of the button is drawn.
Line 6808... Line 7051...
6808
    DECL_TRACER("TPageManager::doBDO(int port, vector<int>& channels, vector<std::string>& pars)");
7051
    DECL_TRACER("TPageManager::doBDO(int port, vector<int>& channels, vector<std::string>& pars)");
6809
 
7052
 
6810
    if (pars.size() < 1)
7053
    if (pars.size() < 1)
6811
    {
7054
    {
6812
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
7055
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
7056
#if TESTMODE == 1
-
 
7057
        setAllDone();
-
 
7058
#endif
6813
        return;
7059
        return;
6814
    }
7060
    }
6815
 
7061
 
6816
    TError::clear();
7062
    TError::clear();
6817
    int btState = atoi(pars[0].c_str());
7063
    int btState = atoi(pars[0].c_str());
Line 6844... Line 7090...
6844
    }
7090
    }
6845
 
7091
 
6846
    vector<TMap::MAP_T> map = findButtons(port, channels);
7092
    vector<TMap::MAP_T> map = findButtons(port, channels);
6847
 
7093
 
6848
    if (TError::isError() || map.empty())
7094
    if (TError::isError() || map.empty())
-
 
7095
    {
-
 
7096
#if TESTMODE == 1
-
 
7097
        setAllDone();
-
 
7098
#endif
6849
        return;
7099
        return;
-
 
7100
    }
6850
 
7101
 
6851
    vector<Button::TButton *> buttons = collectButtons(map);
7102
    vector<Button::TButton *> buttons = collectButtons(map);
6852
 
7103
 
6853
    if (buttons.size() > 0)
7104
    if (buttons.size() > 0)
6854
    {
7105
    {
6855
        vector<Button::TButton *>::iterator mapIter;
7106
        vector<Button::TButton *>::iterator mapIter;
6856
 
7107
 
6857
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
7108
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6858
        {
7109
        {
6859
            Button::TButton *bt = *mapIter;
7110
            Button::TButton *bt = *mapIter;
6860
//            setButtonCallbacks(bt);
-
 
6861
 
-
 
6862
            if (btState == 0)       // All instances?
-
 
6863
            {
-
 
6864
                int bst = bt->getNumberInstances();
-
 
6865
 
-
 
6866
                for (int i = 0; i < bst; i++)
-
 
6867
                    bt->setDrawOrder(order, i);
7111
            bt->setDrawOrder(order, btState - 1);
6868
            }
7112
#if TESTMODE == 1
6869
            else
7113
            if (_gTestMode)
6870
                bt->setDrawOrder(order, btState - 1);
7114
                _gTestMode->setResult(bt->getDrawOrder(btState == 0 ? 0 : btState - 1));
-
 
7115
#endif
6871
        }
7116
        }
6872
    }
7117
    }
-
 
7118
#if TESTMODE == 1
-
 
7119
    setDone();
-
 
7120
#endif
6873
}
7121
}
6874
 
7122
 
6875
/**
7123
/**
6876
 * Set the feedback type of the button.
7124
 * Set the feedback type of the button.
6877
 * ONLY works on General-type buttons.
7125
 * ONLY works on General-type buttons.
Line 6881... Line 7129...
6881
    DECL_TRACER("TPageManager::doBFB(int port, vector<int>& channels, vector<std::string>& pars)");
7129
    DECL_TRACER("TPageManager::doBFB(int port, vector<int>& channels, vector<std::string>& pars)");
6882
 
7130
 
6883
    if (pars.size() < 1)
7131
    if (pars.size() < 1)
6884
    {
7132
    {
6885
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
7133
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
7134
#if TESTMODE == 1
-
 
7135
        setAllDone();
-
 
7136
#endif
6886
        return;
7137
        return;
6887
    }
7138
    }
6888
 
7139
 
6889
    TError::clear();
7140
    TError::clear();
6890
    Button::FEEDBACK type = Button::FB_NONE;
7141
    Button::FEEDBACK type = Button::FB_NONE;
Line 6905... Line 7156...
6905
    }
7156
    }
6906
 
7157
 
6907
    vector<TMap::MAP_T> map = findButtons(port, channels);
7158
    vector<TMap::MAP_T> map = findButtons(port, channels);
6908
 
7159
 
6909
    if (TError::isError() || map.empty())
7160
    if (TError::isError() || map.empty())
-
 
7161
    {
-
 
7162
#if TESTMODE == 1
-
 
7163
        setAllDone();
-
 
7164
#endif
6910
        return;
7165
        return;
-
 
7166
    }
6911
 
7167
 
6912
    vector<Button::TButton *> buttons = collectButtons(map);
7168
    vector<Button::TButton *> buttons = collectButtons(map);
6913
 
7169
 
6914
    if (buttons.size() > 0)
7170
    if (buttons.size() > 0)
6915
    {
7171
    {
Line 6917... Line 7173...
6917
 
7173
 
6918
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
7174
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6919
        {
7175
        {
6920
            Button::TButton *bt = *mapIter;
7176
            Button::TButton *bt = *mapIter;
6921
            bt->setFeedback(type);
7177
            bt->setFeedback(type);
-
 
7178
#if TESTMODE == 1
-
 
7179
            if (_gTestMode)
-
 
7180
                _gTestMode->setResult(intToString(bt->getFeedback()));
-
 
7181
#endif
6922
        }
7182
        }
6923
    }
7183
    }
6924
#if TESTMODE == 1
7184
#if TESTMODE == 1
6925
    setDone();
7185
    setDone();
6926
#endif
7186
#endif
Line 6934... Line 7194...
6934
    DECL_TRACER("TPageManager::doBIM(int port, vector<int>& channels, vector<std::string>& pars)");
7194
    DECL_TRACER("TPageManager::doBIM(int port, vector<int>& channels, vector<std::string>& pars)");
6935
 
7195
 
6936
    if (pars.size() < 1)
7196
    if (pars.size() < 1)
6937
    {
7197
    {
6938
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
7198
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
7199
#if TESTMODE == 1
-
 
7200
        setAllDone();
-
 
7201
#endif
6939
        return;
7202
        return;
6940
    }
7203
    }
6941
 
7204
 
6942
    TError::clear();
7205
    TError::clear();
6943
    string mask = pars[0];
7206
    string mask = pars[0];
6944
    vector<TMap::MAP_T> map = findButtons(port, channels);
7207
    vector<TMap::MAP_T> map = findButtons(port, channels);
6945
 
7208
 
6946
    if (TError::isError() || map.empty())
7209
    if (TError::isError() || map.empty())
-
 
7210
    {
-
 
7211
#if TESTMODE == 1
-
 
7212
        setAllDone();
-
 
7213
#endif
6947
        return;
7214
        return;
-
 
7215
    }
6948
 
7216
 
6949
    vector<Button::TButton *> buttons = collectButtons(map);
7217
    vector<Button::TButton *> buttons = collectButtons(map);
6950
 
7218
 
6951
    if (buttons.size() > 0)
7219
    if (buttons.size() > 0)
6952
    {
7220
    {
Line 6954... Line 7222...
6954
 
7222
 
6955
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
7223
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6956
        {
7224
        {
6957
            Button::TButton *bt = *mapIter;
7225
            Button::TButton *bt = *mapIter;
6958
            bt->setInputMask(mask);
7226
            bt->setInputMask(mask);
-
 
7227
#if TESTMODE == 1
-
 
7228
            if (_gTestMode)
-
 
7229
                _gTestMode->setResult(bt->getInputMask());
-
 
7230
#endif
6959
        }
7231
        }
6960
    }
7232
    }
-
 
7233
#if TESTMODE == 1
-
 
7234
    setDone();
-
 
7235
#endif
6961
}
7236
}
6962
 
7237
 
-
 
7238
/**
-
 
7239
 * @brief Button copy command.
-
 
7240
 * Copy attributes of the source button to all the
-
 
7241
 * destination buttons. Note that the source is a single button state. Each
-
 
7242
 * state must be copied as a separate command. The <codes> section represents
-
 
7243
 * what attributes will be copied. All codes are 2 char pairs that can be
-
 
7244
 * separated by comma, space, percent or just ran together.
-
 
7245
 */
6963
void TPageManager::doBMC(int port, vector<int>& channels, vector<std::string>& pars)
7246
void TPageManager::doBMC(int port, vector<int>& channels, vector<std::string>& pars)
6964
{
7247
{
6965
    DECL_TRACER("TPageManager::doBMC(int port, vector<int>& channels, vector<std::string>& pars)");
7248
    DECL_TRACER("TPageManager::doBMC(int port, vector<int>& channels, vector<std::string>& pars)");
6966
 
7249
 
6967
    if (pars.size() < 5)
7250
    if (pars.size() < 5)
6968
    {
7251
    {
6969
        MSG_ERROR("Expecting 5 parameters but got " << pars.size() << ". Ignoring command.");
7252
        MSG_ERROR("Expecting 5 parameters but got " << pars.size() << ". Ignoring command.");
-
 
7253
#if TESTMODE == 1
-
 
7254
        setAllDone();
-
 
7255
#endif
6970
        return;
7256
        return;
6971
    }
7257
    }
6972
 
7258
 
6973
    TError::clear();
7259
    TError::clear();
6974
    int btState = atoi(pars[0].c_str());
7260
    int btState = atoi(pars[0].c_str());
Line 6982... Line 7268...
6982
    vector<TMap::MAP_T> src_map = findButtons(src_port, src_channel);
7268
    vector<TMap::MAP_T> src_map = findButtons(src_port, src_channel);
6983
 
7269
 
6984
    if (src_map.size() == 0)
7270
    if (src_map.size() == 0)
6985
    {
7271
    {
6986
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " does not exist!");
7272
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " does not exist!");
-
 
7273
#if TESTMODE == 1
-
 
7274
        setAllDone();
-
 
7275
#endif
6987
        return;
7276
        return;
6988
    }
7277
    }
6989
 
7278
 
6990
    vector<Button::TButton *>src_buttons = collectButtons(src_map);
7279
    vector<Button::TButton *>src_buttons = collectButtons(src_map);
6991
 
7280
 
6992
    if (src_buttons.size() == 0)
7281
    if (src_buttons.size() == 0)
6993
    {
7282
    {
6994
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " does not exist!");
7283
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " does not exist!");
-
 
7284
#if TESTMODE == 1
-
 
7285
        setAllDone();
-
 
7286
#endif
6995
        return;
7287
        return;
6996
    }
7288
    }
6997
 
7289
 
6998
    if (src_buttons[0]->getNumberInstances() < src_state)
7290
    if (src_buttons[0]->getNumberInstances() < src_state)
6999
    {
7291
    {
7000
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " has less then " << src_state << " elements.");
7292
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " has less then " << src_state << " elements.");
-
 
7293
#if TESTMODE == 1
-
 
7294
        setAllDone();
-
 
7295
#endif
7001
        return;
7296
        return;
7002
    }
7297
    }
7003
 
7298
 
7004
    if (src_state < 1)
7299
    if (src_state < 1)
7005
    {
7300
    {
7006
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " has invalid source state " << src_state << ".");
7301
        MSG_WARNING("Button <" << TConfig::getChannel() << ":" << src_port << ":" << TConfig::getSystem() << ">:" << src_addr << " has invalid source state " << src_state << ".");
-
 
7302
#if TESTMODE == 1
-
 
7303
        setAllDone();
-
 
7304
#endif
7007
        return;
7305
        return;
7008
    }
7306
    }
7009
 
7307
 
7010
    src_state--;
7308
    src_state--;
7011
 
7309