mirror of https://github.com/openXC7/prjxray.git
segmatch: Allow candidate output threshold to be set by flag
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net> Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
parent
0f68a516bb
commit
edc665d6df
|
|
@ -152,9 +152,10 @@ int main(int argc, char **argv)
|
|||
{
|
||||
const char *outfile = nullptr;
|
||||
int min_each = 0, min_total = 0;
|
||||
int candidate_output_limit = 4;
|
||||
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "io:m:M:")) != -1)
|
||||
while ((opt = getopt(argc, argv, "c:io:m:M:")) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case 'o':
|
||||
|
|
@ -169,6 +170,9 @@ int main(int argc, char **argv)
|
|||
case 'i':
|
||||
mode_inv = true;
|
||||
break;
|
||||
case 'c':
|
||||
candidate_output_limit = atoi(optarg);
|
||||
break;
|
||||
default:
|
||||
goto help;
|
||||
}
|
||||
|
|
@ -190,6 +194,10 @@ help:
|
|||
fprintf(stderr, " -i\n");
|
||||
fprintf(stderr, " add inverted tags\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, " -c <int>\n");
|
||||
fprintf(stderr, " threshold under which candidates are output\n");
|
||||
fprintf(stderr, " set to -1 to output all\n");
|
||||
fprintf(stderr, "\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -294,7 +302,9 @@ help:
|
|||
cnt_candidates += 1;
|
||||
}
|
||||
|
||||
if (0 < num_candidates && num_candidates <= 4) {
|
||||
if (candidate_output_limit < 0 ||
|
||||
(0 < num_candidates &&
|
||||
num_candidates <= candidate_output_limit)) {
|
||||
std::vector<std::string> out_tags;
|
||||
for (int bit_idx = 0; bit_idx < num_bits; bit_idx++)
|
||||
if (mask.at(bit_idx))
|
||||
|
|
|
|||
Loading…
Reference in New Issue