Commit c7518c52ca8049f48879625aa5c6967d391aa3af

Authored by David Graeff
Committed by David Gräff
1 parent e6297cf5

More swtrigger consts

openhantek/src/glgenerator.cpp
@@ -140,7 +140,8 @@ GlGenerator::PrePostStartTriggerSamples GlGenerator::computeSoftwareTriggerTY(co @@ -140,7 +140,8 @@ GlGenerator::PrePostStartTriggerSamples GlGenerator::computeSoftwareTriggerTY(co
140 preTrigSamples = (unsigned)(settings->trigger.position * samplesDisplay); 140 preTrigSamples = (unsigned)(settings->trigger.position * samplesDisplay);
141 postTrigSamples = (unsigned)sampleCount - ((unsigned)samplesDisplay - preTrigSamples); 141 postTrigSamples = (unsigned)sampleCount - ((unsigned)samplesDisplay - preTrigSamples);
142 142
143 - const int threshold = 7; 143 + const int swTriggerThreshold = 7;
  144 + const int swTriggerSampleSet = 11;
144 double prev; 145 double prev;
145 bool (*opcmp)(double,double,double); 146 bool (*opcmp)(double,double,double);
146 bool (*smplcmp)(double,double); 147 bool (*smplcmp)(double,double);
@@ -158,10 +159,10 @@ GlGenerator::PrePostStartTriggerSamples GlGenerator::computeSoftwareTriggerTY(co @@ -158,10 +159,10 @@ GlGenerator::PrePostStartTriggerSamples GlGenerator::computeSoftwareTriggerTY(co
158 double value = samples[i]; 159 double value = samples[i];
159 if (opcmp(value, level, prev)) { 160 if (opcmp(value, level, prev)) {
160 int rising = 0; 161 int rising = 0;
161 - for (unsigned int k = i + 1; k < i + 11 && k < sampleCount; k++) { 162 + for (unsigned int k = i + 1; k < i + swTriggerSampleSet && k < sampleCount; k++) {
162 if (smplcmp(samples[k], value)) { rising++; } 163 if (smplcmp(samples[k], value)) { rising++; }
163 } 164 }
164 - if (rising > threshold) { 165 + if (rising > swTriggerThreshold) {
165 swTriggerStart = i; 166 swTriggerStart = i;
166 break; 167 break;
167 } 168 }