|
From: Radu C. <rc...@us...> - 2016-11-19 00:09:18
|
Update of /cvsroot/gcx/gcx/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11081/src Modified Files: initparams.c interface.c params.h reduce.c reduce.h reducegui.c Log Message: add dry run, remove spurious ing ref from ccdr Index: params.h =================================================================== RCS file: /cvsroot/gcx/gcx/src/params.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** params.h 7 Mar 2013 20:49:33 -0000 1.21 --- params.h 19 Nov 2016 00:09:15 -0000 1.22 *************** *** 439,446 **** }; ! #define PAR_CHOICE_ALIGN_METHODS { "shift", "full", NULL } enum { PAR_ALIGN_SHIFT_ONLY, ! PAR_ALIGN_FULL }; --- 439,447 ---- }; ! #define PAR_CHOICE_ALIGN_METHODS { "shift", "full", "none", NULL } enum { PAR_ALIGN_SHIFT_ONLY, ! PAR_ALIGN_FULL, ! PAR_ALIGN_NONE, }; Index: reduce.h =================================================================== RCS file: /cvsroot/gcx/gcx/src/reduce.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** reduce.h 1 Oct 2016 20:07:16 -0000 1.8 --- reduce.h 19 Nov 2016 00:09:15 -0000 1.9 *************** *** 40,43 **** --- 40,44 ---- #define IMG_OP_OVERSCAN 0x400000 #define IMG_OP_CENTER_CROP 0x800000 + #define IMG_OP_DRY 0x1000000 //#define IMG_BAYER_MASK 0xf000000 *************** *** 68,71 **** --- 69,73 ---- gpointer multiband; /* multiband dialog (used for adding phot output) */ char * recipe; /* malloced name of recipe file */ + int stop_request; /* a stop of the batch reduce was requested */ }; Index: reduce.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/reduce.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** reduce.c 1 Oct 2016 20:07:16 -0000 1.37 --- reduce.c 19 Nov 2016 00:09:15 -0000 1.38 *************** *** 1658,1662 **** if (progress) { ! snprintf(msg, 255, " [%.1f, %.1f]", dx, dy); (* progress)(msg, data); } --- 1658,1662 ---- if (progress) { ! snprintf(msg, 255, " [x:%-6.1f y:%-6.1f]", dx, dy); (* progress)(msg, data); } *************** *** 1667,1671 **** if (progress) { ! snprintf(msg, 255, " [x:%-4.1f y:%-4.1f ds:%-4.1f dt:%-4.1f]", dx, dy, ds, dt); (* progress)(msg, data); --- 1667,1671 ---- if (progress) { ! snprintf(msg, 255, " [x:%-6.1f y:%-6.1f ds:%-4.1f dt:%-4.1f]", dx, dy, ds, dt); (* progress)(msg, data); Index: reducegui.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/reducegui.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** reducegui.c 1 Oct 2016 20:07:16 -0000 1.20 --- reducegui.c 19 Nov 2016 00:09:15 -0000 1.21 *************** *** 87,90 **** --- 87,91 ---- static void imf_update_status_label(GtkTreeModel *list, GtkTreeIter *iter); static void imf_red_browse_cb(GtkWidget *wid, gpointer dialog); + static void ccdred_stop_cb(GtkWidget *wid, gpointer dialog); *************** *** 247,250 **** --- 248,253 ---- G_CALLBACK (close_processing_window), window); + set_named_callback (G_OBJECT (dialog), "stop_button", "clicked", + G_CALLBACK (ccdred_stop_cb)); set_named_callback (G_OBJECT (dialog), "bias_browse", "clicked", G_CALLBACK (imf_red_browse_cb)); *************** *** 443,446 **** --- 446,452 ---- set_named_checkb_val(dialog, "overwrite_checkb", 1); } + if ((ccdr->ops & IMG_OP_DRY)) { + set_named_checkb_val(dialog, "dry_checkb", 1); + } } *************** *** 869,873 **** files = g_slist_next(files); imf->filename = strdup(text); ! image_file_ref(imf); imfl->imlist = g_list_append(imfl->imlist, imf); --- 875,879 ---- files = g_slist_next(files); imf->filename = strdup(text); ! //image_file_ref(imf); imfl->imlist = g_list_append(imfl->imlist, imf); *************** *** 1353,1356 **** --- 1359,1374 ---- } + if (get_named_checkb_val(dialog, "dry_checkb")) { + ccdr->ops |= IMG_OP_DRY; + } else { + ccdr->ops &= ~IMG_OP_DRY; + } + + if (get_named_checkb_val(dialog, "overwrite_checkb")) { + ccdr->ops |= IMG_OP_INPLACE; + } else { + ccdr->ops &= ~IMG_OP_INPLACE; + } + if (get_named_checkb_val(dialog, "stack_checkb")) { ccdr->ops |= IMG_OP_STACK; *************** *** 1376,1379 **** --- 1394,1421 ---- } + static void ccdred_stop_cb(GtkWidget *widget, gpointer dialog) + { + struct ccd_reduce *ccdr; + struct image_file_list *imfl; + + imfl = g_object_get_data(G_OBJECT(dialog), "imfl"); + g_return_if_fail (imfl != NULL); + ccdr = g_object_get_data(G_OBJECT(dialog), "ccdred"); + if (ccdr == NULL) + return; + d1_printf("stop requested\n"); + ccdr->stop_request = 1; + } + + static int stop_poll(struct ccd_reduce *ccdr) + { + while (gtk_events_pending()) + gtk_main_iteration(); + if (ccdr->stop_request == 0) + return 0; + ccdr->stop_request = 0; + return 1; + } + static void ccdred_run_cb(GtkAction *action, gpointer dialog) { *************** *** 1405,1408 **** --- 1447,1452 ---- d3_printf("outf is |%s|\n", outf); + ccdr->stop_request = 0; + menubar = g_object_get_data(G_OBJECT(dialog), "menubar"); gtk_widget_set_sensitive(menubar, 0); *************** *** 1434,1440 **** continue; ret = reduce_frame(imf, ccdr, progress_pr, dialog); if (ret) continue; ! if (ccdr->ops & IMG_OP_INPLACE) { save_image_file(imf, outf, 1, NULL, progress_pr, dialog); imf->flags &= ~(IMG_LOADED); --- 1478,1490 ---- continue; ret = reduce_frame(imf, ccdr, progress_pr, dialog); + if (stop_poll(ccdr)) + goto end; if (ret) continue; ! if (ccdr->ops & IMG_OP_DRY) { ! imf->flags &= ~(IMG_LOADED); ! release_frame(imf->fr); ! imf->fr = NULL; ! } else if (ccdr->ops & IMG_OP_INPLACE) { save_image_file(imf, outf, 1, NULL, progress_pr, dialog); imf->flags &= ~(IMG_LOADED); *************** *** 1454,1457 **** --- 1504,1509 ---- imf->fr = NULL; } + if (stop_poll(ccdr)) + goto end; } update_status_labels(dialog); *************** *** 1484,1487 **** --- 1536,1540 ---- release_frame(fr); end: + update_status_labels(dialog); gtk_widget_set_sensitive(menubar, 1); return; Index: initparams.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/initparams.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** initparams.c 7 Mar 2013 20:49:33 -0000 1.31 --- initparams.c 19 Nov 2016 00:09:15 -0000 1.32 *************** *** 1171,1175 **** "Method used for aligning images. Shift will only perform " "translations whereas full will also account for scale and " ! "rotations."); add_par_int(CCDRED_RESAMPLE_METHOD, PAR_CCDRED, 0, "resample_method", "Resampling algorithm", PAR_RESAMPLE_MITCHELL); --- 1171,1175 ---- "Method used for aligning images. Shift will only perform " "translations whereas full will also account for scale and " ! "rotations. None will not align the frame, but only calculate the required shift"); add_par_int(CCDRED_RESAMPLE_METHOD, PAR_CCDRED, 0, "resample_method", "Resampling algorithm", PAR_RESAMPLE_MITCHELL); Index: interface.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/interface.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** interface.c 1 Oct 2016 20:07:16 -0000 1.36 --- interface.c 19 Nov 2016 00:09:15 -0000 1.37 *************** *** 2338,2341 **** --- 2338,2342 ---- GtkWidget *log_file_browse; GtkWidget *overwrite_checkb; + GtkWidget *dry_checkb; GtkWidget *frame6; GtkWidget *hbox18; *************** *** 2398,2401 **** --- 2399,2404 ---- GtkWidget *center_crop_spin; + GtkWidget *stop_button; + image_processing = gtk_window_new (GTK_WINDOW_TOPLEVEL); *************** *** 2756,2760 **** gtk_widget_set_tooltip_text (output_file_browse, "Browse"); ! /// frame_log = gtk_frame_new ("Reduction Log File"); g_object_ref (frame_log); --- 2759,2782 ---- gtk_widget_set_tooltip_text (output_file_browse, "Browse"); ! overwrite_checkb = gtk_check_button_new_with_label ("Overwrite"); ! g_object_ref (overwrite_checkb); ! g_object_set_data_full (G_OBJECT (image_processing), "overwrite_checkb", overwrite_checkb, ! (GDestroyNotify) g_object_unref); ! gtk_box_pack_start (GTK_BOX (hbox28), overwrite_checkb, FALSE, FALSE, 0); ! gtk_container_set_border_width (GTK_CONTAINER (overwrite_checkb), 3); ! // gtk_widget_set_sensitive (overwrite_checkb, FALSE); ! gtk_widget_set_tooltip_text (overwrite_checkb, "Save processed frames over the original ones"); ! gtk_widget_show (overwrite_checkb); ! ! stop_button = gtk_button_new_with_label ("STOP"); ! g_object_ref (stop_button); ! g_object_set_data_full (G_OBJECT (image_processing), "stop_button", stop_button, ! (GDestroyNotify) g_object_unref); ! gtk_widget_show (stop_button); ! gtk_table_attach (GTK_TABLE (table25), stop_button, 1, 2, 8, 9, ! (GtkAttachOptions) (GTK_FILL), ! (GtkAttachOptions) (0), 0, 0); ! gtk_widget_set_tooltip_text (stop_button, "Stop Batch Reduction"); ! frame_log = gtk_frame_new ("Reduction Log File"); g_object_ref (frame_log); *************** *** 2789,2801 **** gtk_container_set_border_width (GTK_CONTAINER (log_file_browse), 3); gtk_widget_set_tooltip_text (log_file_browse, "Browse"); ! /// ! overwrite_checkb = gtk_check_button_new_with_label ("Overwrite"); ! g_object_ref (overwrite_checkb); ! g_object_set_data_full (G_OBJECT (image_processing), "overwrite_checkb", overwrite_checkb, (GDestroyNotify) g_object_unref); ! gtk_box_pack_start (GTK_BOX (hbox28), overwrite_checkb, FALSE, FALSE, 0); ! gtk_container_set_border_width (GTK_CONTAINER (overwrite_checkb), 3); ! gtk_widget_set_sensitive (overwrite_checkb, FALSE); ! gtk_widget_set_tooltip_text (overwrite_checkb, "Save processed frames over the original ones"); //Demosaic --- 2811,2826 ---- gtk_container_set_border_width (GTK_CONTAINER (log_file_browse), 3); gtk_widget_set_tooltip_text (log_file_browse, "Browse"); ! ! dry_checkb = gtk_check_button_new_with_label ("Dry Run "); ! g_object_ref (dry_checkb); ! g_object_set_data_full (G_OBJECT (image_processing), "dry_checkb", dry_checkb, (GDestroyNotify) g_object_unref); ! gtk_box_pack_start (GTK_BOX (hbox_log), dry_checkb, FALSE, FALSE, 0); ! gtk_container_set_border_width (GTK_CONTAINER (dry_checkb), 3); ! // gtk_widget_set_sensitive (overwrite_checkb, FALSE); ! gtk_widget_set_tooltip_text (dry_checkb, "Dry run - discard files when not stacking"); ! gtk_widget_show (dry_checkb); ! ! /// //Demosaic *************** *** 3256,3259 **** --- 3281,3286 ---- gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook3), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook3), 1), label80); + gtk_notebook_set_current_page(GTK_NOTEBOOK (notebook3), 1); + return image_processing; } |