@@ -171,6 +171,7 @@ struct PlotEventData
171171 py::array_t <double > resample;
172172 py::array_t <double > dataPresent;
173173 std::string modelType;
174+ py::list contrastNames;
174175};
175176
176177class EventBridge
@@ -271,6 +272,13 @@ class EventBridge
271272 eventData.resampledLayers = unpackDataToCell (pEvent->data ->nContrast , (pEvent->data ->nLayers2 == NULL ) ? 1 : 2 ,
272273 pEvent->data ->layers , pEvent->data ->nLayers ,
273274 pEvent->data ->layers2 , pEvent->data ->nLayers2 , true );
275+
276+ int offset = 0 ;
277+ for (int i = 0 ; i < pEvent->data ->nContrast ; i++){
278+ eventData.contrastNames .append (std::string (pEvent->data ->contrastNames + offset,
279+ pEvent->data ->nContrastNames [i]));
280+ offset += pEvent->data ->nContrastNames [i];
281+ }
274282 this ->callback (event.type , eventData);
275283 }
276284 };
@@ -445,6 +453,7 @@ struct Cells {
445453 py::list f18;
446454 py::list f19;
447455 py::list f20;
456+ py::list f21;
448457};
449458
450459struct ProblemDefinition {
@@ -835,7 +844,7 @@ RAT::cell_7 createCell7(const Cells& cells)
835844 cells_struct.f2 = customCaller (" Cells.f2" , pyListToRatCellWrap3, cells.f2 );
836845 cells_struct.f3 = customCaller (" Cells.f3" , pyListToRatCellWrap2, cells.f3 );
837846 cells_struct.f4 = customCaller (" Cells.f4" , pyListToRatCellWrap2, cells.f4 );
838- cells_struct.f5 = customCaller (" Cells.f5" , pyListToRatCellWrap4, cells.f5 ); // improve this error
847+ cells_struct.f5 = customCaller (" Cells.f5" , pyListToRatCellWrap4, cells.f5 );
839848 cells_struct.f6 = customCaller (" Cells.f6" , pyListToRatCellWrap5, cells.f6 );
840849 cells_struct.f7 = customCaller (" Cells.f7" , pyListToRatCellWrap6, cells.f7 );
841850 cells_struct.f8 = customCaller (" Cells.f8" , pyListToRatCellWrap6, cells.f8 );
@@ -851,6 +860,7 @@ RAT::cell_7 createCell7(const Cells& cells)
851860 cells_struct.f18 = customCaller (" Cells.f18" , pyListToRatCellWrap2, cells.f18 );
852861 cells_struct.f19 = customCaller (" Cells.f19" , pyListToRatCellWrap4, cells.f19 );
853862 cells_struct.f20 = customCaller (" Cells.f20" , pyListToRatCellWrap6, cells.f20 );
863+ cells_struct.f21 = customCaller (" Cells.f21" , pyListToRatCellWrap6, cells.f21 );
854864
855865 return cells_struct;
856866}
@@ -1257,7 +1267,8 @@ PYBIND11_MODULE(rat_core, m) {
12571267 .def_readwrite (" subRoughs" , &PlotEventData::subRoughs)
12581268 .def_readwrite (" resample" , &PlotEventData::resample)
12591269 .def_readwrite (" dataPresent" , &PlotEventData::dataPresent)
1260- .def_readwrite (" modelType" , &PlotEventData::modelType);
1270+ .def_readwrite (" modelType" , &PlotEventData::modelType)
1271+ .def_readwrite (" contrastNames" , &PlotEventData::contrastNames);
12611272
12621273 py::class_<ProgressEventData>(m, " ProgressEventData" )
12631274 .def (py::init<>())
@@ -1402,7 +1413,8 @@ PYBIND11_MODULE(rat_core, m) {
14021413 .def_readwrite (" f17" , &Cells::f17)
14031414 .def_readwrite (" f18" , &Cells::f18)
14041415 .def_readwrite (" f19" , &Cells::f19)
1405- .def_readwrite (" f20" , &Cells::f20);
1416+ .def_readwrite (" f20" , &Cells::f20)
1417+ .def_readwrite (" f21" , &Cells::f21);
14061418
14071419 py::class_<Control>(m, " Control" )
14081420 .def (py::init<>())
0 commit comments