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

[0pt,6pt] Clean up the prototype code for presenting to wider GR audience #45

Closed
8 tasks done
Tracked by #42
Assignees

Comments

@ivan-cukic
Copy link
Contributor

ivan-cukic commented Feb 1, 2023

Background

We need two types of processing: a) synchronous stream- as well as b) asynchronous message-type processing (i.e. chunked and/or DataSet based data). The original OpenDigitizer draft design intended that the latter would be done using RxCpp. However, since the RxCpp development somewhat stalled and because both processing types are graph-type problems, the proposal was to rationalise and merge both designs into one using GNU Radio in it's 4.0 version incarnation.

The graph-prototype is targeted as an enhancement and replacement of the low-level GNU Radio 4.0 API to enable such message-type processing using graphs.

Immediate things to be refactored prior to merging with GR 4.0 -- 'Step one'

using namespace gr;
struct node_settings { // node domain object specialised/derived/modified (as needed)
    float samp_rate = 44100.f;
    int scaling_factor = 1;
};
ENABLE_REFLECTION_FOR(node_settings, samp_rate, scaling_factor) // <- refl::cpp macro

template<typename T>
class my_node : public node<my_node<T>>, Setting<node_settings> {
public:
    IN<T> in0;
    IN<T> in1;
    OUT<T> out;
    
    [[nodiscard]] constexpr T process_one(T value1, T value2) const noexcept {
        return  settings.scaling_factor * some_math_func(value1, value2); // ... do some operation with values from ports in[0,1]
    }
};
ENABLE_REFLECTION_FOR((my_node, float, double, int), in0, in1, out) // <- refl::cpp macro for my_node

Steps afterward (EPIC: #42)

@ivan-cukic ivan-cukic changed the title Clean up the prototype code for presenting to wider GR audience [0pt] Clean up the prototype code for presenting to wider GR audience Feb 1, 2023
@ivan-cukic
Copy link
Contributor Author

  • the implementation is split into separate header files
  • refactored the code
  • implemented a nicer connection API
  • split the work function into several reusable parts
  • delay the connection logic until graph is explicitly initialized

@ivan-cukic ivan-cukic self-assigned this Feb 1, 2023
@ivan-cukic ivan-cukic added this to the CALL#1 - Generic Digitizer milestone Feb 1, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Ideas (∞) in Digitizer Reimplementation Feb 1, 2023
@RalphSteinhagen RalphSteinhagen moved this from 🆕 Ideas (∞) to 🏗 In progress in Digitizer Reimplementation Feb 1, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to 🔖 Selected (3) in Digitizer Reimplementation Feb 1, 2023
@RalphSteinhagen RalphSteinhagen moved this from 🔖 Selected (3) to 🏗 In progress in Digitizer Reimplementation Feb 1, 2023
@RalphSteinhagen RalphSteinhagen moved this from 🏗 In progress to Finished Implementation (2) in Digitizer Reimplementation Feb 14, 2023
@ivan-cukic ivan-cukic changed the title [0pt] Clean up the prototype code for presenting to wider GR audience [0pt,6pt] Clean up the prototype code for presenting to wider GR audience Feb 16, 2023
@RalphSteinhagen
Copy link
Member

Done. Thanks a lot to @ivan-cukic and the good work he put into this!

@RalphSteinhagen RalphSteinhagen moved this from Finished Implementation (2) to ✅ QA-Accepted/Merged (∞) in Digitizer Reimplementation Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment