-
Notifications
You must be signed in to change notification settings - Fork 0
/
score_addon_pico.cpp
95 lines (86 loc) · 2.98 KB
/
score_addon_pico.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "score_addon_pico.hpp"
#include <score/plugins/FactorySetup.hpp>
#include <score/plugins/application/GUIApplicationPlugin.hpp>
#include <score/plugins/documentdelegate/plugin/DocumentPluginBase.hpp>
#include <Avnd/Factories.hpp>
#include <Pico/ApplicationPlugin.hpp>
// clang-format off
#include <Avnd/Factories.hpp>
#include "include.score_addon_pico.cpp"
// clang-format on
#include <score_plugin_engine.hpp>
/**
* This file instantiates the classes that are provided by this plug-in.
*/
/**
* 1/ Execution filter that finds all the nodes that talk to
* an embedded device explicitly.. Maybe we can just look inside
* a specific interval
*
* 2/ Compile the nodes as avendish object patch
*
* 3/ Establish a communication channel e.g. through wifi
*
* 4/ Flash the patch
*
* 5/ In the "normal" score exec graph, capture the inputs of the nodes
* that are at the "border" between score and the device, e.g.
* they get their input from something that cannot be executed on a pico
* or from some external input.
*
* 6/ Blast them through CBOR or some specific encoding
*
* Note: we can do the same for inputs!
*
* if there's e.g.
*
* sensor > calibrator > filter > mapper > sqrt > lfo
*
* we can try to cut at the "sqrt" stage before the LFO.
* goal: limit as much as possible the data transmission rate
*
*
* - Processes should have "affinity" ? dpeneding on if they blast data or not basically
* => if they blast *to an output GPIO* we want them running on the embedded
* => if they blast *from an input GPIO* we want them running on score (or do we? depends on the
* reading rate no?)
*
* - We need to save the .hpp of each avnd process?
*
* For the paper: do it manually
* - Asssign a tag to the objects
* - "target device"
*
* NOTE: we could also do this with WASM :') compile the objects as wasm blobs and send them
* to a webpage device!!!!!
*
* => add the ability to assign a device to groups (they act like a client? or not? should work
* even without a network context)
*
* - A device can have multiple things happening in parallel, e.g. 2 automations
* which run each on a GPIO: we need some sort of scheduler on the board
* => freertos tasks for independent subgraphs
*
* - Note: a process could realistically use both inputs and output from the board
*/
score_addon_pico::score_addon_pico() = default;
score_addon_pico::~score_addon_pico() = default;
score::GUIApplicationPlugin* score_addon_pico::make_guiApplicationPlugin(
const score::GUIApplicationContext& app)
{
return new Pico::AppPlug{app};
}
std::vector<score::InterfaceBase*> score_addon_pico::factories(
const score::ApplicationContext& ctx,
const score::InterfaceKey& key) const
{
std::vector<score::InterfaceBase*> fx;
all_custom_factories(fx, ctx, key);
return fx;
}
std::vector<score::PluginKey> score_addon_pico::required() const
{
return {score_plugin_engine::static_key()};
}
#include <score/plugins/PluginInstances.hpp>
SCORE_EXPORT_PLUGIN(score_addon_pico)