233 { |
233 { |
234 if(!designwinexists) |
234 if(!designwinexists) |
235 { |
235 { |
236 double attraction, propulsation; |
236 double attraction, propulsation; |
237 int iterations; |
237 int iterations; |
238 gd_canvas->get_design_data(attraction, propulsation, iterations); |
238 mapstorage.get_design_data(attraction, propulsation, iterations); |
239 designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this); |
239 designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this); |
240 |
240 |
241 designwin->signal_attraction().connect(sigc::mem_fun(*this, &NoteBookTab::attraction_ch)); |
241 designwin->signal_attraction().connect(sigc::mem_fun(mapstorage, &MapStorage::set_attraction)); |
242 designwin->signal_propulsation().connect(sigc::mem_fun(*this, &NoteBookTab::propulsation_ch)); |
242 designwin->signal_propulsation().connect(sigc::mem_fun(mapstorage, &MapStorage::set_propulsation)); |
243 designwin->signal_iteration().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::set_iteration)); |
243 designwin->signal_iteration().connect(sigc::mem_fun(mapstorage, &MapStorage::set_iteration)); |
244 designwin->close_run().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::reDesignGraph)); |
244 designwin->close_run().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::reDesignGraph)); |
245 |
245 |
246 designwin->signal_delete_event().connect(sigc::mem_fun(*this, &NoteBookTab::closeDesignWin)); |
246 designwin->signal_delete_event().connect(sigc::mem_fun(*this, &NoteBookTab::closeDesignWin)); |
|
247 |
|
248 mapst2designwin=mapstorage.signal_design_win_ch().connect(sigc::mem_fun(*designwin, &DesignWin::set_data)); |
247 |
249 |
248 designwin->show(); |
250 designwin->show(); |
249 designwinexists=true; |
251 designwinexists=true; |
250 } |
252 } |
251 } |
253 } |
260 bool NoteBookTab::closeDesignWin(GdkEventAny * e) |
262 bool NoteBookTab::closeDesignWin(GdkEventAny * e) |
261 { |
263 { |
262 if(e->type==GDK_DELETE) |
264 if(e->type==GDK_DELETE) |
263 { |
265 { |
264 designwinexists=false; |
266 designwinexists=false; |
|
267 mapst2designwin.disconnect(); |
265 delete designwin; |
268 delete designwin; |
266 } |
269 } |
267 } |
270 } |
268 |
271 |
269 sigc::signal<void, std::string> NoteBookTab::signal_title_ch() |
272 sigc::signal<void, std::string> NoteBookTab::signal_title_ch() |
284 void NoteBookTab::reDesignGraph() |
287 void NoteBookTab::reDesignGraph() |
285 { |
288 { |
286 gd_canvas->reDesignGraph(); |
289 gd_canvas->reDesignGraph(); |
287 } |
290 } |
288 |
291 |
289 void NoteBookTab::attraction_ch(double v) |
|
290 { |
|
291 gd_canvas->set_attraction(v); |
|
292 } |
|
293 |
|
294 void NoteBookTab::propulsation_ch(double v) |
|
295 { |
|
296 gd_canvas->set_propulsation(v); |
|
297 } |
|
298 |
|
299 void NoteBookTab::iteration_ch(int v) |
|
300 { |
|
301 gd_canvas->set_iteration(v); |
|
302 } |
|
303 |
|
304 void NoteBookTab::active_maps_needed() |
292 void NoteBookTab::active_maps_needed() |
305 { |
293 { |
306 mapstorage.broadcastActiveMaps(); |
294 mapstorage.broadcastActiveMaps(); |
307 } |
295 } |