Skip to content

Commit 3a264e5

Browse files
authored
Merge pull request #110 from open-ephys/issue-69
Show structs that are like data frames
2 parents d619fef + 5b6db2d commit 3a264e5

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

template/ManagedReference.extension.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ function extractConstituentOperatorsData(model) {
7373
}
7474

7575
function extractOperatorData(model) {
76-
7776
const checkForCategory = (category) => model.syntax?.content[0].value.includes(`[WorkflowElementCategory(ElementCategory.${category})]`);
7877
const checkInheritance = (inheritance) => model.inheritance?.some(inherited => inherited.uid.includes(inheritance));
7978
source = checkForCategory('Source') || checkInheritance('Bonsai.Source');
@@ -83,19 +82,14 @@ function extractOperatorData(model) {
8382
hub = checkInheritance('OpenEphys.Onix1.MultiDeviceFactory');
8483
configureDevice = checkInheritance('OpenEphys.Onix1.SingleDeviceFactory');
8584
type = model.uid.includes('DeviceFactory') ? false : sink ? 'sink' : combinator ? 'combinator' : source ? 'source' : transform ? 'transform' : false;
86-
87-
if (hub) {
88-
model = model.__global._shared['~/api/OpenEphys.Onix1.MultiDeviceFactory.yml'];
89-
}
90-
85+
if (hub) {model = model.__global._shared['~/api/OpenEphys.Onix1.MultiDeviceFactory.yml'];}
9186
overloads = model.children
9287
.filter(child => child.name[0].value.includes('Process') || child.name[0].value.includes('Generate'))
9388
.map(child => ({
9489
'overloadsDescription': [child.summary, child.remarks].join(''),
9590
'input': [child.syntax?.parameters[0].description, child.syntax?.parameters[0].remarks].join(''),
9691
'output': [child.syntax.return.description, child.syntax.return.remarks].join(''),
9792
}));
98-
9993
return {
10094
'type': type,
10195
'hub': hub,
@@ -109,7 +103,7 @@ function extractOperatorData(model) {
109103
* This method will be called at the start of exports.transform in ManagedReference.html.primary.js
110104
*/
111105
exports.preTransform = function (model) {
112-
if (model.type === 'class') {
106+
if (model.type === 'class' || model.type === 'struct') {
113107
operator = extractOperatorData(model);
114108
if (operator.hub) {
115109
properties = extractConstituentOperatorsData(model);

template/ManagedReference.html.primary.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{{!master(layout/_master.tmpl)}}
44

55
{{#isClass}}
6-
{{^inStruct}}
7-
{{>partials/class}}
8-
{{/inStruct}}
6+
{{>partials/class}}
97
{{/isClass}}
108

119
{{#isEnum}}

0 commit comments

Comments
 (0)