Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ds/frontPanelIndicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,12 @@ uint32_t FrontPanelIndicator::getColor()
*/
void FrontPanelIndicator::setColor(const FrontPanelIndicator::Color & color,bool toPersist)
{
INT_INFO("[%s:%d] 17349:Color id = %d, color name = %s", __FUNCTION__, __LINE__, color.getId(), color.getName().c_str());

bool IsPersist = toPersist;
if(_colorMode == 0 || _colorMode == 1)
{
INT_INFO("[%s:%d] 17349:Color mode is %d, API not supported", __FUNCTION__, __LINE__, _colorMode);
throw UnsupportedOperationException("This API not supported for the color mode");
}
else if(_colorMode == 2)
Expand All @@ -488,6 +490,7 @@ void FrontPanelIndicator::setColor(const FrontPanelIndicator::Color & color,bool
const List<FrontPanelIndicator::Color> supportedColors = FrontPanelConfig::getInstance().getColors();
for (uint j = 0; j < supportedColors.size(); j++)
{
INT_INFO("[%s:%d] 17349:Supported color id = %d, color id = %d", __FUNCTION__, __LINE__, supportedColors.at(j).getId(), color.getId());
if( supportedColors.at(j).getId() == color.getId())
Comment thread
nanimatta marked this conversation as resolved.
{
isValidColor = true;
Expand All @@ -496,13 +499,15 @@ void FrontPanelIndicator::setColor(const FrontPanelIndicator::Color & color,bool
}
if(!isValidColor)
{
INT_INFO("[%s:%d] 17349:Invalid color id = %d", __FUNCTION__, __LINE__, color.getId());
throw IllegalArgumentException("Invalid color object");
Comment thread
nanimatta marked this conversation as resolved.
}
}
dsFPDColor_t colorValue = _colorsValues[color.getId()];

if (dsERR_NONE != dsSetFPDColor((dsFPDIndicator_t)_id, (dsFPDColor_t)colorValue,IsPersist) )
{
INT_INFO("[%s:%d] 17349: dsSetFPDColor failed--", __FUNCTION__, __LINE__);
throw IllegalArgumentException("dsSetFPDColor failed");
}
_color_rgb32 = colorValue;
Expand All @@ -525,10 +530,12 @@ void FrontPanelIndicator::setColor(uint32_t color,bool toPersist)
bool isValidColor = false;
if(_colorMode == 0 || _colorMode == 2)
{
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log message says "setLED" but this is FrontPanelIndicator::setColor(uint32_t). This looks like a copy/paste error and will confuse diagnostics. Also, since INT_INFO already prints file/line/function, drop the embedded "[%s:%d]" prefix and include the actual _colorMode value in the message if needed for troubleshooting.

Suggested change
{
INT_INFO("setColor(uint32_t): API not supported for color mode %d", _colorMode);

Copilot uses AI. Check for mistakes.
INT_INFO("[%s:%d] 17349: This API not supported for the color mode", __FUNCTION__, __LINE__);
throw UnsupportedOperationException("This API not supported for the color mode");
}
if (dsERR_NONE != dsSetFPDColor((dsFPDIndicator_t)_id, (dsFPDColor_t) color,IsPersist) )
{
INT_INFO("[%s:%d] 17349: dsSetFPDColor failed ", __FUNCTION__, __LINE__);
throw IllegalArgumentException();
}
_color_rgb32 = (dsFPDColor_t) color;
Expand Down
Loading