@@ -8,84 +8,100 @@ exports.preTransform = function (model) {
8
8
if ( model . items [ 0 ] . name === 'OpenEphys.Onix1' ) {
9
9
if ( model . items [ 0 ] . items ) {
10
10
itemsItemsLength = model . items [ 0 ] . items . length ;
11
- let items = [ {
12
- 'name' : 'Core Operators' ,
13
- 'href' : 'core.html' ,
14
- 'topicHref' : 'core.html' ,
15
- 'topicUid' : 'core' ,
16
- 'items' : [ ] } , {
17
- 'name' : 'Configuration Operators' ,
18
- 'href' : 'configure.html' ,
19
- 'topicHref' : 'configure.html' ,
20
- 'topicUid' : 'configure' ,
21
- 'items' : [ ] } , {
22
- 'name' : 'Data I/O Operators' ,
23
- 'href' : 'dataio.html' ,
24
- 'topicHref' : 'dataio.html' ,
25
- 'topicUid' : 'dataio' ,
26
- 'items' : [ ] } , {
27
- 'name' : 'Other' ,
28
- 'items' : [
11
+ let items = [
12
+ {
13
+ 'name' : 'Core Operators' ,
14
+ 'href' : 'core.html' ,
15
+ 'topicHref' : 'core.html' ,
16
+ 'topicUid' : 'core' ,
17
+ 'items' : [ ]
18
+ } ,
19
+ {
20
+ 'name' : 'Configuration Operators' ,
21
+ 'href' : 'configure.html' ,
22
+ 'topicHref' : 'configure.html' ,
23
+ 'topicUid' : 'configure' ,
24
+ 'items' : [ ]
25
+ } ,
26
+ {
27
+ 'name' : 'Data I/O Operators' ,
28
+ 'href' : 'dataio.html' ,
29
+ 'topicHref' : 'dataio.html' ,
30
+ 'topicUid' : 'dataio' ,
31
+ 'items' : [ ]
32
+ } ,
33
+ {
34
+ 'name' : 'Device Configuration Operators' ,
35
+ 'href' : 'device-configure.html' ,
36
+ 'topicHref' : 'device-configure.html' ,
37
+ 'topicUid' : 'device-configure' ,
38
+ 'items' : [ ]
39
+ } ,
40
+ {
41
+ 'name' : 'Data Frames' ,
42
+ 'href' : 'dataframes.html' ,
43
+ 'topicHref' : 'dataframes.html' ,
44
+ 'topicUid' : 'dataframes' ,
45
+ 'items' : [ ]
46
+ } ,
47
+ {
48
+ 'name' : 'Other' ,
49
+ 'href' : 'other.html' ,
50
+ 'topicHref' : 'other.html' ,
51
+ 'topicUid' : 'other' ,
52
+ 'items' :
53
+ [
54
+ {
55
+ 'name' : 'Enums' ,
56
+ 'href' : 'enums.html' ,
57
+ 'topicHref' : 'enums.html' ,
58
+ 'topicUid' : 'enums' ,
59
+ 'items' : [ ]
60
+ }
61
+ ]
62
+ }
63
+ ] ;
64
+ for ( let i = 0 ; i < itemsItemsLength ; i ++ )
65
+ {
66
+ globalYml = '~/api/' + model . items [ 0 ] . items [ i ] . topicUid + '.yml' ;
67
+ globalModel = model . __global . _shared [ globalYml ] ;
68
+ if ( globalModel ?. type === 'class' || globalModel ?. type === 'struct' )
69
+ {
70
+ if ( model . items [ 0 ] . items [ i ] . name . includes ( 'CreateContext' ) || model . items [ 0 ] . items [ i ] . name . includes ( 'StartAcquisition' ) )
29
71
{
30
- 'name' : 'Device Configuration Operators' ,
31
- 'href' : 'device-configure.html' ,
32
- 'topicHref' : 'device-configure.html' ,
33
- 'topicUid' : 'device-configure' ,
34
- 'items' : [ ] ,
72
+ items [ 0 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
35
73
}
36
- ]
37
- } ] ;
38
- for ( let i = 0 ; i < itemsItemsLength ; i ++ ) {
39
- globalYml = '~/api/' + model . items [ 0 ] . items [ i ] . topicUid + '.yml' ;
40
- if ( model . items [ 0 ] . items [ i ] . name . includes ( 'Frame' ) ||
41
- model . items [ 0 ] . items [ i ] . name . includes ( 'DeviceFactory' ) ||
42
- model . items [ 0 ] . items [ i ] . name . includes ( 'ContextTask' ) ||
43
- model . items [ 0 ] . items [ i ] . name . includes ( 'DeviceNameConverter' ) ||
44
- model . items [ 0 ] . items [ i ] . name . includes ( 'ConfigureDS90UB9x' ) ||
45
- model . items [ 0 ] . items [ i ] . name . includes ( 'ConfigureFmcLinkController' ) ||
46
- model . items [ 0 ] . items [ i ] . name . includes ( 'DeviceContext' ) ||
47
- model . items [ 0 ] . items [ i ] . name . includes ( 'NeuropixelsV2QuadShankElectrode' ) ||
48
- model . items [ 0 ] . items [ i ] . name . includes ( 'NeuropixelsV2QuadShankProbeConfiguration' ) ||
49
- model . items [ 0 ] . items [ i ] . name . includes ( 'NeuropixelsV1eAdc' ) ) {
50
- model . items [ 0 ] . items [ i ] . hide = true ;
51
- }
52
- else if ( model . __global . _shared [ globalYml ] && model . __global . _shared [ globalYml ] . type === 'enum' ) {
53
- model . items [ 0 ] . items [ i ] . hide = true ;
54
- }
55
- else {
56
- if ( model . __global . _shared [ globalYml ] && model . __global . _shared [ globalYml ] . type === 'class' ) {
57
- const inheritanceLength = model . __global . _shared [ globalYml ] . inheritance . length ;
58
- device = false ;
59
- hub = false ;
60
- for ( let j = 0 ; j < inheritanceLength ; j ++ ) {
61
- if ( model . __global . _shared [ globalYml ] . inheritance [ j ] . uid === 'OpenEphys.Onix1.SingleDeviceFactory' ) {
62
- device = true ;
63
- }
64
- else if ( model . __global . _shared [ globalYml ] . inheritance [ j ] . uid === 'OpenEphys.Onix1.MultiDeviceFactory' ) {
65
- hub = true ;
66
- }
67
- }
68
- if ( model . items [ 0 ] . items [ i ] . name . includes ( 'CreateContext' ) || model . items [ 0 ] . items [ i ] . name . includes ( 'StartAcquisition' ) ) {
69
- items [ 0 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
70
- }
71
- else if ( device ) {
72
- items [ 3 ] . items [ 0 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
73
- }
74
- else if ( hub ) {
75
- items [ 1 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
76
- }
77
- else {
78
- items [ 2 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
79
- }
74
+ else if ( globalModel ?. inheritance . some ( inherited => inherited . uid === 'OpenEphys.Onix1.MultiDeviceFactory' ) )
75
+ {
76
+ items [ 1 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
80
77
}
78
+ else if ( globalModel ?. inheritance . some ( inherited => inherited . uid === 'OpenEphys.Onix1.SingleDeviceFactory' ) )
79
+ {
80
+ items [ 3 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
81
+ }
82
+ else if ( ( globalModel . syntax ?. content [ 0 ] . value . includes ( 'ElementCategory.Source' ) ||
83
+ globalModel . syntax ?. content [ 0 ] . value . includes ( 'ElementCategory.Sink' ) ||
84
+ globalModel ?. inheritance . some ( inherited => inherited . uid . includes ( 'Bonsai.Source' ) ) ||
85
+ globalModel ?. inheritance . some ( inherited => inherited . uid . includes ( 'Bonsai.Sink' ) ) ) &&
86
+ ! globalModel . syntax ?. content [ 0 ] . value . includes ( 'abstract' ) )
87
+ {
88
+ items [ 2 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
89
+ }
90
+ else if ( model . items [ 0 ] . items [ i ] . name . includes ( 'ContextTask' ) ||
91
+ model . items [ 0 ] . items [ i ] . name . includes ( 'OutputClockParameters' ) ||
92
+ globalModel ?. inheritance . some ( inherited => inherited . uid === 'OpenEphys.Onix1.DataFrame' || inherited . uid === 'OpenEphys.Onix1.BufferedDataFrame' ) )
93
+ {
94
+ items [ 4 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
95
+ }
96
+ }
97
+ else if ( globalModel && globalModel . type === 'enum' )
98
+ {
99
+ items [ 5 ] . items [ 0 ] . items . push ( model . items [ 0 ] . items [ i ] ) ;
81
100
}
82
101
}
83
102
model . items [ 0 ] . items = items ;
84
103
}
85
104
}
86
- // if (model.items[1].name === 'OpenEphys.Onix1.Design'){
87
- // model.items.splice(1, 1);
88
- // }
89
105
return model ;
90
106
}
91
107
0 commit comments