Skip to content

Creating Library for ToolDAQ #6

@mileslucas

Description

@mileslucas

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions