Skip to content

Commit afd4f3c

Browse files
author
rodriguez-facundo
committed
#135 Flexlaout functional
1 parent a07c04b commit afd4f3c

14 files changed

Lines changed: 91 additions & 78 deletions

File tree

netpyne_ui/netpyne_model_interpreter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import pygeppetto.model as pygeppetto
77
from pygeppetto.model.model_factory import GeppettoModelFactory
88
from pygeppetto.model.values import Point, ArrayElement, ArrayValue
9+
from pygeppetto.services.model_interpreter import ModelInterpreter
910

10-
11-
class NetPyNEModelInterpreter():
11+
class NetPyNEModelInterpreter(ModelInterpreter):
1212

1313
def __init__(self):
1414
self.factory = GeppettoModelFactory()

webapp/Main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jQuery(function () {
6666
GEPPETTO.on(GEPPETTO.Events.Model_loaded, () => {
6767
store.dispatch(modelLoaded);
6868
});
69-
ReactDOM.render(<App data={data} />, document.querySelector('#mainContainer'));
69+
ReactDOM.render(<App data={data} />, document.querySelector('#mainContainer'), store.dispatch(modelLoaded));
7070
GEPPETTO.trigger("spinner:hide");
7171
})
7272
});

webapp/components/definition/cellRules/NetPyNECellRule.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default class NetPyNECellRule extends React.Component {
108108
</div>
109109

110110
<NetPyNEField id={"netParams.cellParams.conds.cellType"} >
111-
<SelectField
111+
<NetPyNESelectField
112112
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellType']"}
113113
method={"netpyne_geppetto.getAvailableCellTypes"}
114114
postProcessItems={this.postProcessMenuItems}
@@ -117,7 +117,7 @@ export default class NetPyNECellRule extends React.Component {
117117
</NetPyNEField>
118118

119119
<NetPyNEField id={"netParams.cellParams.conds.cellModel"} >
120-
<SelectField
120+
<NetPyNESelectField
121121
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['cellModel']"}
122122
method={"netpyne_geppetto.getAvailableCellModels"}
123123
postProcessItems={this.postProcessMenuItems}
@@ -126,7 +126,7 @@ export default class NetPyNECellRule extends React.Component {
126126
</NetPyNEField>
127127

128128
<NetPyNEField id={"netParams.cellParams.conds.pop"} >
129-
<SelectField
129+
<NetPyNESelectField
130130
model={"netParams.cellParams['" + this.state.currentName + "']['conds']['pop']"}
131131
method={"netpyne_geppetto.getAvailablePops"}
132132
postProcessItems={this.postProcessMenuItems}

webapp/components/definition/connectivity/NetPyNEConnectivityRule.js

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
2+
import TextField from '@material-ui/core/TextField';
33
import FontIcon from "@material-ui/core/Icon";
44
import CardContent from "@material-ui/core/CardContent";
55
import { BottomNavigation, BottomNavigationAction } from "@material-ui/core";
@@ -14,6 +14,7 @@ import MenuItem from "@material-ui/core/MenuItem";
1414
import {
1515
NetPyNESelectField,
1616
NetPyNEField,
17+
NetPyNETextField,
1718
ListComponent,
1819
NetPyNECoordsRange
1920
} from "netpyne/components";
@@ -155,7 +156,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
155156
</NetPyNEField>
156157

157158
<NetPyNEField id={"netParams.connParams.synMech"}>
158-
<SelectField
159+
<NetPyNESelectField
159160
model={
160161
"netParams.connParams['" + this.props.name + "']['synMech']"
161162
}
@@ -171,61 +172,31 @@ export default class NetPyNEConnectivityRule extends React.Component {
171172
</NetPyNEField>
172173

173174
<NetPyNEField id="netParams.connParams.convergence">
174-
<TextField
175-
model={
176-
"netParams.connParams['" + this.props.name + "']['convergence']"
177-
}
178-
/>
175+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['convergence']"}/>
179176
</NetPyNEField>
180177

181178
<NetPyNEField id="netParams.connParams.divergence">
182-
<TextField
183-
model={
184-
"netParams.connParams['" + this.props.name + "']['divergence']"
185-
}
186-
/>
179+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['divergence']"}/>
187180
</NetPyNEField>
188181

189182
<NetPyNEField id="netParams.connParams.probability">
190-
<TextField
191-
model={
192-
"netParams.connParams['" + this.props.name + "']['probability']"
193-
}
194-
/>
183+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['probability']"}/>
195184
</NetPyNEField>
196185

197186
<NetPyNEField id="netParams.connParams.synsPerConn">
198-
<TextField
199-
model={
200-
"netParams.connParams['" + this.props.name + "']['synsPerConn']"
201-
}
202-
/>
187+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['synsPerConn']"}/>
203188
</NetPyNEField>
204189

205190
<NetPyNEField id="netParams.connParams.weight">
206-
<TextField
207-
model={
208-
"netParams.connParams['" + this.props.name + "']['weight']"
209-
}
210-
/>
191+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['weight']"}/>
211192
</NetPyNEField>
212193

213-
<NetPyNEField
214-
id="netParams.connParams.delay"
215-
className="listStyle"
216-
noStyle
217-
>
218-
<TextField
219-
model={"netParams.connParams['" + this.props.name + "']['delay']"}
220-
/>
194+
<NetPyNEField id="netParams.connParams.delay">
195+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['delay']"} />
221196
</NetPyNEField>
222197

223198
<NetPyNEField id="netParams.connParams.plasticity">
224-
<TextField
225-
model={
226-
"netParams.connParams['" + this.props.name + "']['plasticity']"
227-
}
228-
/>
199+
<NetPyNETextField model={"netParams.connParams['" + this.props.name + "']['plasticity']"}/>
229200
</NetPyNEField>
230201
{dialogPop}
231202
</div>
@@ -234,7 +205,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
234205
var content = (
235206
<div>
236207
<NetPyNEField id={"netParams.connParams.preConds.pop"}>
237-
<SelectField
208+
<NetPyNESelectField
238209
model={
239210
"netParams.connParams['"
240211
+ this.props.name
@@ -246,7 +217,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
246217
/>
247218
</NetPyNEField>
248219
<NetPyNEField id={"netParams.connParams.preConds.cellModel"}>
249-
<SelectField
220+
<NetPyNESelectField
250221
model={
251222
"netParams.connParams['"
252223
+ this.props.name
@@ -258,7 +229,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
258229
/>
259230
</NetPyNEField>
260231
<NetPyNEField id={"netParams.connParams.preConds.cellType"}>
261-
<SelectField
232+
<NetPyNESelectField
262233
model={
263234
"netParams.connParams['"
264235
+ this.props.name
@@ -308,7 +279,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
308279
var content = (
309280
<div>
310281
<NetPyNEField id={"netParams.connParams.postConds.pop"}>
311-
<SelectField
282+
<NetPyNESelectField
312283
model={
313284
"netParams.connParams['"
314285
+ this.props.name
@@ -320,7 +291,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
320291
/>
321292
</NetPyNEField>
322293
<NetPyNEField id={"netParams.connParams.postConds.cellModel"}>
323-
<SelectField
294+
<NetPyNESelectField
324295
model={
325296
"netParams.connParams['"
326297
+ this.props.name
@@ -332,7 +303,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
332303
/>
333304
</NetPyNEField>
334305
<NetPyNEField id={"netParams.connParams.postConds.cellType"}>
335-
<SelectField
306+
<NetPyNESelectField
336307
model={
337308
"netParams.connParams['"
338309
+ this.props.name

webapp/components/definition/plots/NetPyNEInclude.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import React, { Component } from 'react';
2-
import Menu from '@material-ui/core/Menu';
2+
33
import Divider from '@material-ui/core/Divider';
44
import MenuItem from '@material-ui/core/MenuItem';
55
import TextField from '@material-ui/core/TextField';
6-
import Popover from '@material-ui/core/Popover/Popover';
6+
import Popover from '@material-ui/core/Popover';
77
import Utils from '../../../Utils';
8-
import NetPyNEField from '../../general/NetPyNEField';
98

109
import ListItem from '@material-ui/core/ListItem';
1110
import ListItemIcon from '@material-ui/core/ListItemIcon';
1211
import CheckIcon from '@material-ui/icons/Check';
1312
import List from '@material-ui/core/List';
1413
import ListItemText from '@material-ui/core/ListItemText';
14+
15+
import { NetPyNEField, } from 'netpyne/components';
16+
1517
export default class NetPyNEInclude extends Component {
1618

1719
constructor (props) {
@@ -135,7 +137,7 @@ export default class NetPyNEInclude extends Component {
135137

136138
collectInfo = async () => {
137139
const numberOfCellsByPopulation = await Utils.evalPythonMessage("netpyne_geppetto.getGIDs", [])
138-
140+
console.log(numberOfCellsByPopulation)
139141
if (numberOfCellsByPopulation) {
140142
const dataInPythonFormat = await Utils.evalPythonMessage("netpyne_geppetto.getInclude", [this.props.model.split("'")[1]])
141143
let included

webapp/components/definition/plots/plotTypes/Plot2Dnet.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import React, { Component } from 'react';
33
import {
44
NetPyNEInclude,
55
NetPyNEField,
6-
SelectField
6+
NetPyNESelectField,
7+
NetPyNECheckbox
78
} from 'netpyne/components';
89

910

@@ -25,7 +26,7 @@ export default class Plot2Dnet extends React.Component {
2526
/>
2627

2728
<NetPyNEField id="simConfig.analysis.plot2Dnet.view" className="listStyle" >
28-
<SelectField model={tag + "['view']"} />
29+
<NetPyNESelectField model={tag + "['view']"} />
2930
</NetPyNEField>
3031

3132
<NetPyNEField id="simConfig.analysis.plot2Dnet.showConns" className={"netpyneCheckbox"} >

webapp/components/definition/plots/plotTypes/PlotConn.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { Component } from 'react';
33
import {
44
NetPyNEInclude,
55
NetPyNEField,
6-
SelectField
6+
NetPyNESelectField
77
} from 'netpyne/components';
88

99

@@ -25,15 +25,15 @@ export default class plotConn extends React.Component {
2525
/>
2626

2727
<NetPyNEField id="simConfig.analysis.plotConn.feature" className="listStyle" >
28-
<SelectField model={tag + "['feature']"} />
28+
<NetPyNESelectField model={tag + "['feature']"} />
2929
</NetPyNEField>
3030

3131
<NetPyNEField id="simConfig.analysis.plotConn.groupBy" className="listStyle" >
32-
<SelectField model={tag + "['groupBy']"} />
32+
<NetPyNESelectField model={tag + "['groupBy']"} />
3333
</NetPyNEField>
3434

3535
<NetPyNEField id="simConfig.analysis.plotConn.orderBy" className="listStyle" >
36-
<SelectField model={tag + "['orderBy']"} />
36+
<NetPyNESelectField model={tag + "['orderBy']"} />
3737
</NetPyNEField>
3838
</div>
3939
}

webapp/components/definition/plots/plotTypes/PlotLFP.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
2-
2+
import TimeRange from '../TimeRange'
33
import {
44
NetPyNEField,
55
NetPyNECheckbox,
66
NetPyNETextField,
77
NetPyNESelectField,
8-
ListComponent
8+
ListComponent,
99
} from 'netpyne/components';
1010

1111
export default class PlotLFP extends React.Component {

webapp/components/definition/plots/plotTypes/PlotSpikeHist.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
NetPyNEInclude,
66
NetPyNEField,
77
NetPyNECheckbox,
8-
NetPyNETextField
8+
NetPyNETextField,
9+
NetPyNESelectField
910
} from 'netpyne/components';
1011

1112
export default class PlotSpikeHist extends React.Component {

webapp/components/definition/plots/plotTypes/PlotTraces.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
NetPyNEInclude,
66
NetPyNEField,
77
NetPyNESelectField,
8+
NetPyNECheckbox
89
} from 'netpyne/components';
910

1011
export default class PlotTraces extends React.Component {

0 commit comments

Comments
 (0)