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

Creating Library for ToolDAQ #6

Open
mileslucas opened this issue Nov 30, 2018 · 1 comment
Open

Creating Library for ToolDAQ #6

mileslucas opened this issue Nov 30, 2018 · 1 comment
Assignees

Comments

@mileslucas
Copy link
Member

mileslucas commented Nov 30, 2018

the SuMo library needs to get rewritten so that it is easily interface-able with the ANNIE ToolDAQ. To accomplish this, we need to create a spec that defines the usage of the PSEC electronics in terms of library methods. I propose the following methods and members and will work on reimplementing the code to reflect it

class SuMoInterface {
    SuMoInterface();
    ~SuMoInterface();
    void configure(string filename);
    void getStatus();
    void calibrate();
    bool hasTriggered();
    void forceTrigger();
    DataClass getData();
    void reset(); 
    private:
        SuMo sumo;
};

The corresponding code for ToolDAQ would look someting like this:

void initialise() {
    SuMoInterface s;
    s.configure("myconfig.yaml");
    s.calibrate();
}

void execute() {
    if (someGlobalTrigger) {
        s.forceTrigger()
        DataClass data = s.getData();
        parseData(data);
    else if (s.hasTriggered()) {
        DataClass data = s.getData();
        parseData(data);
    }
}

void finalise() {}

void parseData(DataClass data) {
    // Whatever code needed to put data into the data-model
}

I would really appreciate additions and comments.

@mileslucas mileslucas self-assigned this Nov 30, 2018
@mileslucas
Copy link
Member Author

I have an implementation that seems to be working with both software and hardware triggers.
See commit 5a33c77 for the implementation in lib/SuMoInterface.cpp as well as src/daq.cpp for basic driver

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

No branches or pull requests

1 participant