ngscopeclient 0.1-dev+51fbda87c
GlitchTrigger.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
36#ifndef GlitchTrigger_h
37#define GlitchTrigger_h
38
39#include "EdgeTrigger.h"
40
46{
47public:
49 virtual ~GlitchTrigger();
50
51 static std::string GetTriggerName();
52 TRIGGER_INITPROC(GlitchTrigger);
53
62 { m_condition.SetIntVal(type); }
63
66 { return (Condition) m_condition.GetIntVal(); }
67
69 int64_t GetLowerBound()
70 { return m_lowerBound.GetIntVal(); }
71
77 void SetLowerBound(int64_t bound)
78 { m_lowerBound.SetIntVal(bound); }
79
81 int64_t GetUpperBound()
82 { return m_upperBound.GetIntVal(); }
83
89 void SetUpperBound(int64_t bound)
90 { m_upperBound.SetIntVal(bound); }
91
92protected:
93
96
99
102};
103
104#endif
Declaration of EdgeTrigger.
Simple edge trigger.
Definition: EdgeTrigger.h:44
A parameter to a filter.
Definition: FilterParameter.h:86
void SetIntVal(int64_t i)
Sets the parameter to an integer value.
Definition: FilterParameter.cpp:307
int64_t GetIntVal() const
Returns the value of the parameter interpreted as an integer.
Definition: FilterParameter.h:119
Trigger on a glitch meeting certain width criteria.
Definition: GlitchTrigger.h:46
static std::string GetTriggerName()
Return the constant trigger type name "Glitch".
Definition: GlitchTrigger.cpp:76
void SetLowerBound(int64_t bound)
Set the duration of the shortest pulse that will be considered a glitch.
Definition: GlitchTrigger.h:77
FilterParameter m_upperBound
Upper voltage level for glitch detector.
Definition: GlitchTrigger.h:101
int64_t GetLowerBound()
Get the lower bound, in fs, for a pulse to be considered a glitch.
Definition: GlitchTrigger.h:69
int64_t GetUpperBound()
Get the upper bound, in fs, for a pulse to be considered a glitch.
Definition: GlitchTrigger.h:81
void SetUpperBound(int64_t bound)
Set the duration of the longest pulse that will be considered a glitch.
Definition: GlitchTrigger.h:89
void SetCondition(Condition type)
Set the condition for the glitch.
Definition: GlitchTrigger.h:61
FilterParameter m_lowerBound
Lower voltage level for glitch detector.
Definition: GlitchTrigger.h:98
Condition GetCondition()
Get the desired glitch condition.
Definition: GlitchTrigger.h:65
FilterParameter m_condition
Condition to look for.
Definition: GlitchTrigger.h:95
GlitchTrigger(Oscilloscope *scope)
Initialize the trigger.
Definition: GlitchTrigger.cpp:52
Generic representation of an oscilloscope, logic analyzer, or spectrum analyzer.
Definition: Oscilloscope.h:50
Condition
Conditions for triggers that perform logical comparisons of values.
Definition: Trigger.h:69