/* callback.cxx --------- Co. E.Benninghaus Pfaffenhoffenstr. 1 78166 Donaueschingen created: 08.09.2000 last Work: 08.09.2000 */ #ifndef __callback_cxx #define __callback_cxx extern void threaded_grabbing(char * data); int cfgshown = 0; void cb_btn_exit(Fl_Button*, void*) { endall(); } void cb_btn_start(Fl_Button*, void*) { if(cfgshown){ return; } btn_stop->value(0); if( (! run ) && (! threaded_grab_busy ) ){ ethread = NULL; if(pthread_create(ðread, NULL, (void *)&threaded_grabbing, NULL) != 0 ){ fprintf(stderr,"\nCannot create grabbing thread\n"); } else { btn_stop->value(1); } } } void cb_btn_stop(Fl_Light_Button*, void*) { if(cfgshown){ return; } if( cfg.snap ){ cfg.snap = 0; btn_snap->value(0); } run = 0; btn_stop->value(0); } void cb_btn_showcross(Fl_Light_Button*, void*) { if(cfgshown){ return; } if(cfg.showcross){ cfg.showcross = 0; btn_showcross->value(0); } else { if(cfg.view){ cfg.showcross = 1; btn_showcross->value(1); } } } void cb_btn_realview(Fl_Light_Button*, void*) { if(cfgshown){ return; } if(cfg.savebuf){ cfg.savebuf = 0; btn_realview->value(0); } else { if(cfg.view){ cfg.savebuf = 1; btn_realview->value(1); } } } void cb_btn_snap(Fl_Light_Button*, void*) { if(cfgshown){ return; } if( cfg.snap ){ btn_snap->value(0); cfg.snap = 0; } else { btn_snap->value(1); cfg.snap = 1; } } void cb_btn_view(Fl_Light_Button*, void*) { if(cfgshown){ return; } if( cfg.view ){ btn_view->value(0); cfg.view = 0; } else { cfg.view = 1; btn_view->value(1); } } void cb_btn_control(Fl_Light_Button*, void*) { if(cfgshown){ return; } if( cfg.control ){ btn_control->value(0); cfg.control = 0; } else { if(cfg.elctr ){ cfg.control = 1; btn_control->value(1); } } } char cb_tmptxt1[20]; char cb_tmptxt2[20]; char cb_tmptxt3[20]; char cb_tmptxt5[20]; char cb_tmptxt8[84]; char cb_tmptxt9[40]; char cb_tmptxt10[20]; void cb_btn_cfg(Fl_Button*, void*) { if( run || cfgshown ){ return; } cfgshown = 1; sprintf(cb_tmptxt1,"%ld",cfg.calcstart); in_calcstart->value(cb_tmptxt1); sprintf(cb_tmptxt2,"%d",cfg.dirlock); in_dirlock->value(cb_tmptxt2); sprintf(cb_tmptxt3,"%d",cfg.coltolerance); in_coltolerance->value(cb_tmptxt3); sprintf(cb_tmptxt5,"%d",cfg.seeing); in_seeing->value(cb_tmptxt5); sprintf(cb_tmptxt8,"%s",cfg.snapprefix); in_snapprefix->value(cb_tmptxt8); sprintf(cb_tmptxt9,"%ld",cfg.maxsnap); in_maxsnap->value(cb_tmptxt9); sprintf(cb_tmptxt10,"%d",cfg.snapquality); in_snapquality->value(cb_tmptxt10); ch_snapsize->value(cfg.snapsize); btn_fruse->value( elctr.fruse ); btn_frleft->value( elctr.frleft ); btn_guide->value( cfg.guide ); cfgwin->show(); } void cb_btn_cfg_quit(Fl_Button*, void*) { cfg.calcstart = atol((char *)in_calcstart->value()); cfg.coltolerance = atoi((char *)in_coltolerance->value()); cfg.seeing = atoi((char *)in_seeing->value()); cfg.snapquality = atoi((char *)in_snapquality->value()); cfg.maxsnap = atol((char *)in_maxsnap->value()); cfg.dirlock = atoi((char *)in_dirlock->value()); cfg.snapsize = ch_snapsize->value(); elctr.fruse = btn_fruse->value(); elctr.frleft = btn_frleft->value(); cfg.guide = btn_guide->value(); if(strcmp( (const char *)in_snapprefix->value(), (const char *)cfg.snapprefix ) != 0){ sprintf(cfg.snapprefix,"%s",in_snapprefix->value()); cursnapcount = 0; } correctCfgValues(); cfgshown = 0; cfgwin->hide(); } #endif /*__callback_cxx*/