Skip to content

Commit

Permalink
Command line: Fix [n] [at] [1] [x] [x]
Browse files Browse the repository at this point in the history
FIx issue where repeating last number where ignored
  • Loading branch information
marcusbirkin committed Jun 24, 2018
1 parent 2e35f37 commit dbd5517
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commandline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ void CommandLine::processStack()
numberEntry *= 10;
numberEntry += numeric;

m_text.append(QString::number(numeric));

if(state==stChannel || state==stThruStart || state==stThruEnd)
{
if(numberEntry>MAX_DMX_ADDRESS)
{
// Not a valid entry, would be >512
state = stError;
m_errorText = E_RANGE;
m_keyStack.pop_back();
return;
}

Expand All @@ -153,9 +152,12 @@ void CommandLine::processStack()
// Not a valid entry, would be >max
state = stError;
m_errorText = E_RANGE;
m_keyStack.pop_back();
return;
}
}

m_text.append(QString::number(numeric));
break;

case THRU:
Expand All @@ -173,6 +175,7 @@ void CommandLine::processStack()
// [@] [@] = [@] [Full]
if (
m_keyStack.count() > 1 &&
m_keyStack.last() == Key::AT &&
m_keyStack.last() == m_keyStack[m_keyStack.count() - 2]
)
{
Expand Down

0 comments on commit dbd5517

Please sign in to comment.