ngscopeclient 0.1-dev+51fbda87c
CDRNRZPatternTrigger.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 CDRNRZPatternTrigger_h
37#define CDRNRZPatternTrigger_h
38
39#include "CDRTrigger.h"
40
49{
50public:
52 virtual ~CDRNRZPatternTrigger();
53
54 static std::string GetTriggerName();
55 TRIGGER_INITPROC(CDRNRZPatternTrigger);
56
57 /*
58 enum PatternMode
59 {
60 PATTERN_SEQUENCE,
61 PATTERN_LIST
62 };
63
64 enum MatchMode
65 {
66 MATCH_INCLUDE,
67 MATCH_EXCLUDE
68 };
69
70 void SetMatchMode(MatchMode mode)
71 { m_parameters[m_matchModeName].SetIntVal(mode); }
72
73 MatchMode GetMatchMode()
74 { return static_cast<MatchMode>(m_parameters[m_matchModeName].GetIntVal()); }
75
76 void SetPatternMode(PatternMode mode)
77 { m_parameters[m_patternModeName].SetIntVal(mode); }
78
79 PatternMode GetPatternMode()
80 { return static_cast<PatternMode>(m_parameters[m_patternModeName].GetIntVal()); }
81
82 void SetSymbolCount(size_t i)
83 { m_parameters[m_patternLengthName].SetIntVal(i); }
84
85 size_t GetSymbolCount()
86 { return m_parameters[m_patternLengthName].GetIntVal(); }
87
88 std::vector<TNRZPatternSymbol> GetPattern()
89 { return m_parameters[m_patternName].GetNRZPatternPattern(); }
90
91 void SetPattern(const std::vector<TNRZPatternSymbol>& pattern)
92 { return m_parameters[m_patternName].SetNRZPatternPattern(pattern); }
93 */
94
95protected:
96 /*
97 void OnLengthChanged();
98 void OnModeChanged();
99
100 std::string m_patternModeName;
101 std::string m_patternName;
102 std::string m_patternLengthName;
103 std::string m_matchModeName;
104 */
105};
106
107#endif
Declaration of CDRTrigger.
A hardware NRZ pattern trigger.
Definition: CDRNRZPatternTrigger.h:49
Base class for triggers involving hardware clock/data recovery pattern matching.
Definition: CDRTrigger.h:44
Generic representation of an oscilloscope, logic analyzer, or spectrum analyzer.
Definition: Oscilloscope.h:50