forked from travisgoodspeed/maskromtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathromruleambiguous.cpp
33 lines (27 loc) · 1.07 KB
/
romruleambiguous.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "romruleambiguous.h"
#include "maskromtool.h"
RomRuleAmbiguous::RomRuleAmbiguous()
{
}
/* We trust the bit to tell us whether it's ambiguous.
* Later on, this will need to account for damage and
* forcing.
*/
void RomRuleAmbiguous::evaluate(MaskRomTool *mrt){
//We walk them in order so errors are per row.
RomBitItem* bit = mrt->markBitTable(); //Current bit in row.
RomBitItem* bitfirst=bit; //First bit in the current row.
while(bit){
if(bit->bitAmbiguous() && !bit->isFixed()){
RomRuleViolation* violation=new RomRuleViolation(bit->pos(),
QString("Ambiguous bit %1,%2").arg(bit->row).arg(bit->col),
"This bit is close to the threshold. Try fixing it to the value that you see?");
violation->error=false;
mrt->addViolation(violation);
}
if(bit->nexttoright)
bit=bit->nexttoright;
else
bit=bitfirst=bitfirst->nextrow;
}
}