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 140 preTrigSamples = (unsigned)(settings->trigger.position * samplesDisplay);
141 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 145 double prev;
145 146 bool (*opcmp)(double,double,double);
146 147 bool (*smplcmp)(double,double);
... ... @@ -158,10 +159,10 @@ GlGenerator::PrePostStartTriggerSamples GlGenerator::computeSoftwareTriggerTY(co
158 159 double value = samples[i];
159 160 if (opcmp(value, level, prev)) {
160 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 163 if (smplcmp(samples[k], value)) { rising++; }
163 164 }
164   - if (rising > threshold) {
  165 + if (rising > swTriggerThreshold) {
165 166 swTriggerStart = i;
166 167 break;
167 168 }
... ...