11/* **********************************************************************************************************************
22* *
3- * libscopehal v0.1 *
3+ * libscopehal *
44* *
5- * Copyright (c) 2012-2022 Andrew D. Zonenberg and contributors *
5+ * Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
66* All rights reserved. *
77* *
88* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
3131 @file
3232 @author Andrew D. Zonenberg
3333 @brief Declaration of Trigger
34+ @ingroup core
3435 */
3536#ifndef Trigger_h
3637#define Trigger_h
3738
3839#include " FlowGraphNode.h"
3940
4041/* *
41- @brief Abstract base class for oscilloscope / logic analyzer triggers
42+ @brief Abstract base class for oscilloscope / logic analyzer trigger inputs
43+ @ingroup core
4244 */
4345class Trigger : public FlowGraphNode
4446{
4547public:
4648 Trigger (Oscilloscope* scope);
4749 virtual ~Trigger ();
4850
51+ // /@brief Get the trigger level
4952 float GetLevel ()
5053 { return m_parameters[m_levelname].GetFloatVal (); }
5154
55+ /* *
56+ @brief Sets the trigger level
57+
58+ @param level Trigger level
59+ */
5260 void SetLevel (float level)
5361 { m_parameters[m_levelname].SetFloatVal (level); }
5462
63+ // /@brief Gets the scope this trigger is attached to
5564 Oscilloscope* GetScope ()
5665 { return m_scope; }
5766
58- // Conditions for filters
67+ // /@brief Conditions for triggers that perform logical comparisons of values
5968 enum Condition
6069 {
70+ // /@brief Match when value is equal to target
6171 CONDITION_EQUAL,
72+
73+ // /@brief Match when value is not equal to target
6274 CONDITION_NOT_EQUAL,
75+
76+ // /@brief Match when value is less than target
6377 CONDITION_LESS,
78+
79+ // /@brief Match when value is less than or equal to target
6480 CONDITION_LESS_OR_EQUAL,
81+
82+ // /@brief Match when value is greater than target
6583 CONDITION_GREATER,
84+
85+ // /@brief Match when value is greater than or equal to target
6686 CONDITION_GREATER_OR_EQUAL,
87+
88+ // /@brief Match when value is greater than one target but less than another
6789 CONDITION_BETWEEN,
90+
91+ // /@brief Match when value is not between two targets
6892 CONDITION_NOT_BETWEEN,
93+
94+ // /@brief Always match
6995 CONDITION_ANY
7096 };
7197
7298protected:
99+
100+ // /@brief The scope this trigger is part of
73101 Oscilloscope* m_scope;
102+
103+ // /@brief Name of the "trigger level" parameter
74104 std::string m_levelname;
75105
76106public:
@@ -82,16 +112,13 @@ class Trigger : public FlowGraphNode
82112 static void EnumTriggers (std::vector<std::string>& names);
83113 static Trigger* CreateTrigger (std::string name, Oscilloscope* scope);
84114
85- /* *
86- @brief Serializes this trigger's configuration to a YAML string.
87-
88- @return YAML block with this trigger's configuration
89- */
90- virtual YAML::Node SerializeConfiguration (IDTable& table);
115+ virtual YAML::Node SerializeConfiguration (IDTable& table) override ;
91116
92117protected:
93- // Class enumeration
118+ // /@brief Helper typedef for m_createprocs
94119 typedef std::map< std::string, CreateProcType > CreateMapType;
120+
121+ // /@brief Map of trigger type names to factory methods
95122 static CreateMapType m_createprocs;
96123};
97124
0 commit comments