Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature trigger class definition #90

Merged
merged 39 commits into from
Jul 9, 2019
Merged

Conversation

LukasWikander
Copy link
Collaborator

@LukasWikander LukasWikander commented Jul 4, 2019

I've defined three classes here:

  • An abstract class Trigger, which contains all general functionality expected from a trigger (e.g. it should have a type, an ID and should be able to accept configuration parameters)
  • An abstract class BooleanTrigger inheriting from Trigger, which contains all general functionality expected from a trigger based on a boolean signal (e.g. it should accept flank triggering, as well as high/low triggering and the triggering mechanism is the same for all boolean signals)
  • A class BrakeTrigger, inheriting from BooleanTrigger, which contains functionality specific to brake trigger (e.g. the type should be BRAKE, it should allow PRESSED as boolean parameter as well)

My thinking is that another type can be defined for acceleration which naturally inherits from yet another type handling e.g. floating point signals.

Copy link
Contributor

@viktorjo viktorjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. Only problem I had was that the entire module expect c++11 to be used. This caused the compiler to fail the building of the code. I suggest that you add set (CMAKE_CXX_STANDARD 11) to the CMakeLists.txt file. Just add it here
https://github.com/RI-SE/Maestro/blob/b6c42401153f52590f39417f1a655516b9ce7a7c/modules/ScenarioControl/CMakeLists.txt#L6

I also have some comment about the documentation of the class, might be worth to just check them out to see what you think.


private:
TriggerID_t triggerID;
std::vector<TriggerParameter_t> parameters;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it hard to understand what this is and what is intended to be used for. Is the list a general description of a trigger on a high level? If this is the case is there an example of an intended use?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some opinions on this. I intended it to store the ISO parameters (e.g. ACCELERATION, GREATER_THAN, VALUE) for parsing into an operation mode for the trigger. Perhaps it is not interesting to conform to ISO here? Currently, it is used by e.g. BooleanTrigger to select between flank triggering and high/low etc. . But eventually we will read this from a file...

modules/ScenarioControl/inc/trigger.h Show resolved Hide resolved
modules/ScenarioControl/src/booleantrigger.cpp Outdated Show resolved Hide resolved
modules/ScenarioControl/inc/trigger.h Show resolved Hide resolved
@LukasWikander LukasWikander requested a review from viktorjo July 5, 2019 14:58
Copy link
Member

@konglobemeralt konglobemeralt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. Seems like the points raised by Viktor have been addressed and I have noting new to add.

@LukasWikander LukasWikander merged commit b8cc7ee into dev Jul 9, 2019
@LukasWikander LukasWikander deleted the feature_triggerClassDefinition branch July 9, 2019 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants