Subversion Repositories tpanel

Rev

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

Rev 433 Rev 435
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2020 to 2023 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2020 to 2024 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 5829... Line 5829...
5829
        for (mapIter = buttons.begin(); mapIter != buttons.end(); ++mapIter)
5829
        for (mapIter = buttons.begin(); mapIter != buttons.end(); ++mapIter)
5830
        {
5830
        {
5831
            Button::TButton *bt = *mapIter;
5831
            Button::TButton *bt = *mapIter;
5832
            MSG_DEBUG("Evaluating button " << handleToString(bt->getHandle()))
5832
            MSG_DEBUG("Evaluating button " << handleToString(bt->getHandle()))
5833
 
5833
 
5834
            if (bt->getButtonType() != JOYSTICK && bt->isBargraphInverted())
-
 
5835
                level = (bt->getBarRangeHigh() - bt->getBarRangeLow()) - level;
-
 
5836
 
-
 
5837
            if (bt->getButtonType() == BARGRAPH && bt->getLevelChannel() == c)
5834
            if (bt->getButtonType() == BARGRAPH && bt->getLevelChannel() == c)
5838
            {
5835
            {
-
 
5836
                if (bt->isBargraphInverted())
-
 
5837
                    level = (bt->getRangeHigh() - bt->getRangeLow()) - level;
-
 
5838
 
5839
                bt->drawBargraph(bt->getActiveInstance(), level);
5839
                bt->drawBargraph(bt->getActiveInstance(), level);
5840
#if TESTMODE == 1
5840
#if TESTMODE == 1
5841
                if (_gTestMode)
5841
                if (_gTestMode)
5842
                    _gTestMode->setResult(intToString(bt->getLevelValue()));
5842
                    _gTestMode->setResult(intToString(bt->getLevelValue()));
5843
#endif
5843
#endif
Line 5846... Line 5846...
5846
            {
5846
            {
5847
                int x = (bt->getLevelChannel() == c ? level : bt->getLevelAxisX());
5847
                int x = (bt->getLevelChannel() == c ? level : bt->getLevelAxisX());
5848
                int y = (bt->getLevelChannel() == c ? bt->getLevelAxisY() : level);
5848
                int y = (bt->getLevelChannel() == c ? bt->getLevelAxisY() : level);
5849
 
5849
 
5850
                if (bt->isBargraphInverted())
5850
                if (bt->isBargraphInverted())
5851
                    x = (bt->getBarRangeHigh() - bt->getBarRangeLow()) - x;
5851
                    x = (bt->getRangeHigh() - bt->getRangeLow()) - x;
5852
 
5852
 
5853
                if (bt->isJoystickAuxInverted())
5853
                if (bt->isJoystickAuxInverted())
5854
                    y = (bt->getBarRangeHigh() - bt->getBarRangeLow()) - y;
5854
                    y = (bt->getRangeHigh() - bt->getRangeLow()) - y;
5855
 
5855
 
5856
                bt->drawJoystick(x, y);
5856
                bt->drawJoystick(x, y);
5857
            }
5857
            }
5858
            else if (bt->getButtonType() == MULTISTATE_BARGRAPH && bt->getLevelChannel() == c)
5858
            else if (bt->getButtonType() == MULTISTATE_BARGRAPH && bt->getLevelChannel() == c)
5859
            {
5859
            {