Subversion Repositories tpanel

Rev

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

Rev 327 Rev 330
Line 5980... Line 5980...
5980
    DECL_TRACER("TPageManager::doBAT(int port, vector<int> &channels, vector<string> &pars)");
5980
    DECL_TRACER("TPageManager::doBAT(int port, vector<int> &channels, vector<string> &pars)");
5981
 
5981
 
5982
    if (pars.size() < 1)
5982
    if (pars.size() < 1)
5983
    {
5983
    {
5984
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
5984
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
5985
#if TESTMODE == 1
-
 
5986
        __done = true;
-
 
5987
#endif
5985
        return;
5988
        return;
5986
    }
5989
    }
5987
 
5990
 
5988
    TError::clear();
5991
    TError::clear();
5989
    int btState = atoi(pars[0].c_str());
5992
    int btState = atoi(pars[0].c_str());
Line 5993... Line 5996...
5993
        text = pars[1];
5996
        text = pars[1];
5994
 
5997
 
5995
    vector<TMap::MAP_T> map = findButtons(port, channels);
5998
    vector<TMap::MAP_T> map = findButtons(port, channels);
5996
 
5999
 
5997
    if (TError::isError() || map.empty())
6000
    if (TError::isError() || map.empty())
-
 
6001
    {
-
 
6002
#if TESTMODE == 1
-
 
6003
        __done = true;
-
 
6004
#endif
5998
        return;
6005
        return;
-
 
6006
    }
5999
 
6007
 
6000
    vector<Button::TButton *> buttons = collectButtons(map);
6008
    vector<Button::TButton *> buttons = collectButtons(map);
6001
 
6009
 
6002
    if (buttons.empty())
6010
    if (buttons.empty())
-
 
6011
    {
-
 
6012
#if TESTMODE == 1
-
 
6013
        __done = true;
-
 
6014
#endif
6003
        return;
6015
        return;
-
 
6016
    }
6004
 
6017
 
6005
    vector<Button::TButton *>::iterator mapIter;
6018
    vector<Button::TButton *>::iterator mapIter;
6006
 
6019
 
6007
    for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6020
    for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6008
    {
6021
    {
6009
        Button::TButton *bt = *mapIter;
6022
        Button::TButton *bt = *mapIter;
6010
//        setButtonCallbacks(bt);
-
 
6011
 
6023
 
6012
        if (btState == 0)       // All instances?
6024
        if (btState == 0)       // All instances?
6013
        {
6025
        {
6014
            int bst = bt->getNumberInstances();
6026
            int bst = bt->getNumberInstances();
6015
 
6027
 
6016
            for (int i = 0; i < bst; i++)
6028
            for (int i = 0; i < bst; i++)
-
 
6029
            {
6017
                bt->appendText(text, i);
6030
                bt->appendText(text, i);
-
 
6031
#if TESTMODE == 1
-
 
6032
                if (_gTestMode)
-
 
6033
                    _gTestMode->setResult(bt->getText(i));
-
 
6034
 
-
 
6035
                __success = true;
-
 
6036
#endif
-
 
6037
            }
6018
        }
6038
        }
6019
        else
6039
        else
-
 
6040
        {
6020
            bt->appendText(text, btState - 1);
6041
            bt->appendText(text, btState - 1);
-
 
6042
#if TESTMODE == 1
-
 
6043
            if (_gTestMode)
-
 
6044
                _gTestMode->setResult(bt->getText(btState - 1));
-
 
6045
 
-
 
6046
            __success = true;
-
 
6047
#endif
-
 
6048
        }
6021
    }
6049
    }
-
 
6050
#if TESTMODE == 1
-
 
6051
    __done = true;
-
 
6052
#endif
6022
}
6053
}
6023
 
6054
 
6024
/**
6055
/**
6025
 * @brief Append unicode text. Same format as ^UNI.
6056
 * @brief Append unicode text. Same format as ^UNI.
6026
 * This command allows to set up to 50 characters of ASCII code. The unicode
6057
 * This command allows to set up to 50 characters of ASCII code. The unicode
Line 6031... Line 6062...
6031
    DECL_TRACER("TPageManager::doBAU(int port, vector<int>& channels, vector<string>& pars)");
6062
    DECL_TRACER("TPageManager::doBAU(int port, vector<int>& channels, vector<string>& pars)");
6032
 
6063
 
6033
    if (pars.size() < 1)
6064
    if (pars.size() < 1)
6034
    {
6065
    {
6035
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
6066
        MSG_ERROR("Expecting 1 parameters but got none! Ignoring command.");
-
 
6067
#if TESTMODE == 1
-
 
6068
        __done = true;
-
 
6069
#endif
6036
        return;
6070
        return;
6037
    }
6071
    }
6038
 
6072
 
6039
    TError::clear();
6073
    TError::clear();
6040
    int btState = atoi(pars[0].c_str());
6074
    int btState = atoi(pars[0].c_str());
Line 6088... Line 6122...
6088
            text = CharConvert::UtfConv<std::string>(uniText);
6122
            text = CharConvert::UtfConv<std::string>(uniText);
6089
        }
6123
        }
6090
        catch (std::exception const & e)
6124
        catch (std::exception const & e)
6091
        {
6125
        {
6092
            MSG_ERROR("Character conversion error: " << e.what());
6126
            MSG_ERROR("Character conversion error: " << e.what());
-
 
6127
#if TESTMODE == 1
-
 
6128
            __done = true;
-
 
6129
#endif
6093
            return;
6130
            return;
6094
        }
6131
        }
6095
    }
6132
    }
6096
 
6133
 
6097
    vector<TMap::MAP_T> map = findButtons(port, channels);
6134
    vector<TMap::MAP_T> map = findButtons(port, channels);
Line 6106... Line 6143...
6106
        vector<Button::TButton *>::iterator mapIter;
6143
        vector<Button::TButton *>::iterator mapIter;
6107
 
6144
 
6108
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6145
        for (mapIter = buttons.begin(); mapIter != buttons.end(); mapIter++)
6109
        {
6146
        {
6110
            Button::TButton *bt = *mapIter;
6147
            Button::TButton *bt = *mapIter;
6111
//            setButtonCallbacks(bt);
-
 
6112
 
6148
 
6113
            if (btState == 0)       // All instances?
6149
            if (btState == 0)       // All instances?
6114
            {
6150
            {
6115
                int bst = bt->getNumberInstances();
6151
                int bst = bt->getNumberInstances();
6116
 
6152
 
6117
                for (int i = 0; i < bst; i++)
6153
                for (int i = 0; i < bst; i++)
-
 
6154
                {
6118
                    bt->appendText(text, i);
6155
                    bt->appendText(text, i);
-
 
6156
#if TESTMODE == 1
-
 
6157
                    if (_gTestMode)
-
 
6158
                        _gTestMode->setResult(bt->getText(i));
-
 
6159
 
-
 
6160
                    __success = true;
-
 
6161
#endif
-
 
6162
                }
6119
            }
6163
            }
6120
            else
6164
            else
-
 
6165
            {
6121
                bt->appendText(text, btState - 1);
6166
                bt->appendText(text, btState - 1);
-
 
6167
#if TESTMODE == 1
-
 
6168
                if (_gTestMode)
-
 
6169
                    _gTestMode->setResult(bt->getText(btState - 1));
-
 
6170
 
-
 
6171
                __success = true;
-
 
6172
#endif
-
 
6173
            }
6122
        }
6174
        }
6123
    }
6175
    }
-
 
6176
#if TESTMODE == 1
-
 
6177
    __done = true;
-
 
6178
#endif
6124
}
6179
}
6125
 
6180
 
6126
/**
6181
/**
6127
 * @brief TPageManager::doBCB Set the border color.
6182
 * @brief TPageManager::doBCB Set the border color.
6128
 * Set the border color to the specified color. Only if the specified border
6183
 * Set the border color to the specified color. Only if the specified border