From 4c8b12ef2a3912c68a7d2d00448e1cb51ac82478 Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 20 May 2022 21:24:37 -0400 Subject: [PATCH 01/22] smokeview source: change some plot2d variable names to make the code clearer --- Source/smokeview/IOobjects.c | 12 +++---- Source/smokeview/glui_objects.cpp | 53 +++++++++++++++---------------- Source/smokeview/readsmv.c | 12 +++---- Source/smokeview/smokeviewvars.h | 2 +- 4 files changed, 39 insertions(+), 40 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 8925c57d74..3e2a6d3b9a 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3289,10 +3289,10 @@ void GetGlobalDeviceBounds(int type){ int HaveGenDev(void){ int i; - for(i = 0; incurve_indexes; i++){ + for(i = 0; incurve_indexes; i++){ int curve_index; - curve_index = plot2dinfo->curve_indexes[i]; + curve_index = glui_plot2d->curve_indexes[i]; if(curve_indexncurve_indexes; i++){ + for(i = 0; incurve_indexes; i++){ int curve_index; - curve_index = plot2dinfo->curve_indexes[i]; + curve_index = glui_plot2d->curve_indexes[i]; if(curve_index>=ndeviceinfo)return 1; } return 0; @@ -3532,8 +3532,8 @@ void DrawGenPlot(plot2ddata * plot2di){ /* ------------------ DrawGenPlots ------------------------ */ void DrawGenPlots(void){ - if(plot2dinfo->show==0)return; - DrawGenPlot(plot2dinfo); + if(glui_plot2d->show==0)return; + DrawGenPlot(glui_plot2d); } #endif diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 3ad01eb502..fa199671b1 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -393,7 +393,6 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ valmin = MIN(valmin, hrri->vals[j]); valmax = MAX(valmax, hrri->vals[j]); } - plot2di = plot2dinfo + j; plot2di->curve_min[i + ndeviceinfo] = valmin; plot2di->curve_max[i + ndeviceinfo] = valmax; } @@ -405,12 +404,12 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ extern "C" void AddPlot2D(void){ nplot2dinfo++; if(nplot2dinfo==1){ - NewMemory((void **)&glui_plot2dinfo, (nplot2dinfo)*sizeof(plot2ddata)); + NewMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); } else{ - ResizeMemory((void **)&glui_plot2dinfo, (nplot2dinfo)*sizeof(plot2ddata)); + ResizeMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); } - InitPlot2D(glui_plot2dinfo + nplot2dinfo - 1, nplot2dinfo); + InitPlot2D(plot2dinfo + nplot2dinfo - 1, nplot2dinfo); } /* ------------------ DeletePlot2D ------------------------ */ @@ -454,8 +453,8 @@ void AddCurve(int type){ index = LIST_devID1->get_int_val(); } have_index = 0; - for(i=0; incurve_indexes; i++){ - if(plot2dinfo->curve_indexes[i] == index+offset){ + for(i=0; incurve_indexes; i++){ + if(glui_plot2d->curve_indexes[i] == index+offset){ have_index = 1; break; } @@ -463,10 +462,10 @@ void AddCurve(int type){ if(have_index == 0){ char label[255]; - nindex = plot2dinfo->ncurve_indexes; - plot2dinfo->curve_indexes[nindex] = offset + index; + nindex = glui_plot2d->ncurve_indexes; + glui_plot2d->curve_indexes[nindex] = offset + index; nindex++; - plot2dinfo->ncurve_indexes = nindex; + glui_plot2d->ncurve_indexes = nindex; if(type == PLOT2D_DEV){ strcpy(label, "dev/"); strcat(label, deviceinfo[index].labelptr); @@ -480,16 +479,16 @@ void AddCurve(int type){ } } -/* ------------------ RemovePlot2D ------------------------ */ +/* ------------------ RemoveCurve ------------------------ */ -void RemovePlot2D(int index){ +void RemoveCurve(int index){ if(index<0){ int i; - for(i=0;incurve_indexes; i++){ - LIST_plotcurves->delete_item(plot2dinfo->curve_indexes[i]); + for(i=0;incurve_indexes; i++){ + LIST_plotcurves->delete_item(glui_plot2d->curve_indexes[i]); } - plot2dinfo->ncurve_indexes = 0; + glui_plot2d->ncurve_indexes = 0; LIST_plotcurves->set_int_val(-1); } else{ @@ -498,14 +497,14 @@ void RemovePlot2D(int index){ LIST_plotcurves->delete_item(index); ii = 0; - for(i = 0; i < plot2dinfo->ncurve_indexes; i++){ - if(plot2dinfo->curve_indexes[i] == index)continue; - if(i != ii)plot2dinfo->curve_indexes[ii] = plot2dinfo->curve_indexes[i]; + for(i = 0; i < glui_plot2d->ncurve_indexes; i++){ + if(glui_plot2d->curve_indexes[i] == index)continue; + if(i != ii)glui_plot2d->curve_indexes[ii] = glui_plot2d->curve_indexes[i]; ii++; } - (plot2dinfo->ncurve_indexes)--; - if(plot2dinfo->ncurve_indexes > 0){ - LIST_plotcurves->set_int_val(plot2dinfo->curve_indexes[0]); + (glui_plot2d->ncurve_indexes)--; + if(glui_plot2d->ncurve_indexes > 0){ + LIST_plotcurves->set_int_val(glui_plot2d->curve_indexes[0]); } else{ LIST_plotcurves->set_int_val(-1); @@ -573,11 +572,11 @@ void GenPlotCB(int var){ } break; case GENPLOT_REM_CURVE: - RemovePlot2D(glui_plot2d_curve_index); - plot2dinfo->curve_index = glui_plot2d_curve_index; + RemoveCurve(glui_plot2d_curve_index); + glui_plot2d->curve_index = glui_plot2d_curve_index; break; case GENPLOT_REM_ALLCURVES: - RemovePlot2D(-1); + RemoveCurve(-1); break; case GENPLOT_HRR1: strcpy(label, "Add "); @@ -586,12 +585,12 @@ void GenPlotCB(int var){ BUTTON_add_hrr->set_name(label); break; case GENPLOT_SHOW1: - plot2dinfo[0].show = show_genplot1; + glui_plot2d[0].show = show_genplot1; plotstate = GetPlotState(DYNAMIC_PLOTS); update_times = 1; break; case GENPLOT_XYZ: - memcpy(plot2dinfo[0].xyz, glui_plot2d_xyz, 3*sizeof(float)); + memcpy(glui_plot2d[0].xyz, glui_plot2d_xyz, 3*sizeof(float)); break; default: ASSERT(FFALSE); @@ -1120,10 +1119,10 @@ extern "C" void GluiDeviceSetup(int main_window){ LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "curve:", &glui_plot2d_curve_index, GENPLOT_COMP1, GenPlotCB); LIST_plotcurves->add_item(-1, ""); - for(i = 0; i < plot2dinfo->ncurve_indexes_ini; i++){ + for(i = 0; i < glui_plot2d->ncurve_indexes_ini; i++){ int curv_index; - curv_index = plot2dinfo->curve_indexes_ini[i]; + curv_index = glui_plot2d->curve_indexes_ini[i]; if(curv_index < ndeviceinfo){ LIST_devID1->set_int_val(curv_index); AddCurve(PLOT2D_DEV); diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index e2502f5f79..b341635537 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -10962,8 +10962,8 @@ typedef struct { // initialize 2d plot data structures #ifdef pp_PLOT2D_NEW void InitPlot2D(plot2ddata *plot2di, int plot_index); - NewMemory((void **)&plot2dinfo, sizeof(plot2ddata)); - InitPlot2D(plot2dinfo, 0); + NewMemory((void **)&glui_plot2d, sizeof(plot2ddata)); + InitPlot2D(glui_plot2d, 0); #endif PRINTF("%s", _("complete")); @@ -11450,10 +11450,10 @@ int ReadIni2(char *inifile, int localfile){ int curv_index; sscanf(token, "%i", &curv_index); - plot2dinfo->curve_indexes_ini[count++] = curv_index; + glui_plot2d->curve_indexes_ini[count++] = curv_index; token = strtok(NULL, " "); } - plot2dinfo->ncurve_indexes_ini = count; + glui_plot2d->ncurve_indexes_ini = count; update_glui_devices = 1; continue; } @@ -14813,8 +14813,8 @@ void WriteIniLocal(FILE *fileout){ fprintf(fileout, "SHOWGENPLOTS\n"); fprintf(fileout, " %f %f %f %i\n", glui_plot2d_xyz[0], glui_plot2d_xyz[1], glui_plot2d_xyz[2], show_genplot1); fprintf(fileout, " "); - for(i = 0; i < plot2dinfo->ncurve_indexes; i++){ - fprintf(fileout, " %i ", plot2dinfo->curve_indexes[i]); + for(i = 0; i < glui_plot2d->ncurve_indexes; i++){ + fprintf(fileout, " %i ", glui_plot2d->curve_indexes[i]); }; fprintf(fileout, "\n"); #endif diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index ef13df033d..83c8a03421 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1530,7 +1530,7 @@ SVEXTERN int SVDECL(deviceID1_index, 0); SVEXTERN int SVDECL(hrr1_index, 1); SVEXTERN int SVDECL(show_genplot1, 0); SVEXTERN float glui_plot2d_xyz[3]; -SVEXTERN plot2ddata SVDECL(*plot2dinfo, NULL), SVDECL(*glui_plot2dinfo, NULL);; +SVEXTERN plot2ddata SVDECL(*glui_plot2d, NULL), SVDECL(*plot2dinfo, NULL);; SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0); #endif SVEXTERN float SVDECL(plot2d_hrr_min,0.0), SVDECL(plot2d_hrr_max,1.0); From b285617f3b439b2b8f047722bbff03bf8f410b0f Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 20 May 2022 22:46:56 -0400 Subject: [PATCH 02/22] smokeview source: convert 2d plot code from single plot to multi plot - interim committ --- Source/smokeview/glui_objects.cpp | 135 ++++++++++++++++-------------- Source/smokeview/readsmv.c | 10 +-- Source/smokeview/showscene.c | 2 +- Source/smokeview/smokeviewvars.h | 3 - Source/smokeview/structures.h | 3 +- Source/smokeview/update.c | 12 +-- 6 files changed, 79 insertions(+), 86 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index fa199671b1..2a79a53f7f 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -26,18 +26,19 @@ #define RESET_FUEL_HOC 33 #ifdef pp_PLOT2D_NEW -#define GENPLOT_devID1 101 -#define GENPLOT_devtype1 102 +#define GENPLOT_SELECT_DEVICE 101 +#define GENPLOT_DEVICE_TYPE 102 #define GENPLOT_ADD_DEVCURVE 103 #define GENPLOT_ADD_HRRCURVE 104 -#define GENPLOT_COMP1 105 +#define GENPLOT_SELECT_CURVE 105 #define GENPLOT_REM_CURVE 106 #define GENPLOT_REM_ALLCURVES 107 -#define GENPLOT_HRR1 108 -#define GENPLOT_SHOW1 109 +#define GENPLOT_HRR_TYPE 108 +#define GENPLOT_SHOW_PLOT 109 #define GENPLOT_XYZ 110 #define GENPLOT_ADD_PLOT 111 #define GENPLOT_REM_PLOT 112 +#define GENPLOT_SELECT_PLOT 113 #define PLOT2D_DEV 0 #define PLOT2D_HRR 1 @@ -360,6 +361,7 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ plot2di->xyz[1] = ybar0FDS; plot2di->xyz[2] = zbar0FDS; plot2di->plot_index = plot_index; + plot2di->curve_index = 0; for(i = 0; i < ndeviceinfo; i++){ devicedata *devi; @@ -441,7 +443,7 @@ void Plot2D2Glui(void){ /* ------------------ AddCurve ------------------------ */ -void AddCurve(int type){ +void AddCurve(plot2ddata *plot2di, int type){ int i, have_index, nindex; int offset = 0, index; @@ -453,8 +455,8 @@ void AddCurve(int type){ index = LIST_devID1->get_int_val(); } have_index = 0; - for(i=0; incurve_indexes; i++){ - if(glui_plot2d->curve_indexes[i] == index+offset){ + for(i=0; i< plot2di->ncurve_indexes; i++){ + if(plot2di->curve_indexes[i] == index+offset){ have_index = 1; break; } @@ -462,10 +464,10 @@ void AddCurve(int type){ if(have_index == 0){ char label[255]; - nindex = glui_plot2d->ncurve_indexes; - glui_plot2d->curve_indexes[nindex] = offset + index; + nindex = plot2di->ncurve_indexes; + plot2di->curve_indexes[nindex] = offset + index; nindex++; - glui_plot2d->ncurve_indexes = nindex; + plot2di->ncurve_indexes = nindex; if(type == PLOT2D_DEV){ strcpy(label, "dev/"); strcat(label, deviceinfo[index].labelptr); @@ -481,14 +483,14 @@ void AddCurve(int type){ /* ------------------ RemoveCurve ------------------------ */ -void RemoveCurve(int index){ +void RemoveCurve(plot2ddata *plot2di, int index){ if(index<0){ int i; - for(i=0;incurve_indexes; i++){ - LIST_plotcurves->delete_item(glui_plot2d->curve_indexes[i]); + for(i=0;i< plot2di->ncurve_indexes; i++){ + LIST_plotcurves->delete_item(plot2di->curve_indexes[i]); } - glui_plot2d->ncurve_indexes = 0; + plot2di->ncurve_indexes = 0; LIST_plotcurves->set_int_val(-1); } else{ @@ -497,14 +499,14 @@ void RemoveCurve(int index){ LIST_plotcurves->delete_item(index); ii = 0; - for(i = 0; i < glui_plot2d->ncurve_indexes; i++){ - if(glui_plot2d->curve_indexes[i] == index)continue; - if(i != ii)glui_plot2d->curve_indexes[ii] = glui_plot2d->curve_indexes[i]; + for(i = 0; i < plot2di->ncurve_indexes; i++){ + if(plot2di->curve_indexes[i] == index)continue; + if(i != ii)plot2di->curve_indexes[ii] = plot2di->curve_indexes[i]; ii++; } - (glui_plot2d->ncurve_indexes)--; - if(glui_plot2d->ncurve_indexes > 0){ - LIST_plotcurves->set_int_val(glui_plot2d->curve_indexes[0]); + (plot2di->ncurve_indexes)--; + if(plot2di->ncurve_indexes > 0){ + LIST_plotcurves->set_int_val(plot2di->curve_indexes[0]); } else{ LIST_plotcurves->set_int_val(-1); @@ -546,24 +548,24 @@ void GenPlotCB(int var){ switch (var){ char label[256]; - case GENPLOT_devID1: + case GENPLOT_SELECT_DEVICE: strcpy(label, "Add "); strcat(label, deviceinfo[deviceID1_index].deviceID); strcat(label, " to plot"); BUTTON_add_dev->set_name(label); break; - case GENPLOT_devtype1: + case GENPLOT_DEVICE_TYPE: UpdateDevList(LIST_devID1, devtype1_index); break; case GENPLOT_ADD_DEVCURVE: - AddCurve(PLOT2D_DEV); - GenPlotCB(GENPLOT_COMP1); + AddCurve(glui_plot2d, PLOT2D_DEV); + GenPlotCB(GENPLOT_SELECT_CURVE); break; case GENPLOT_ADD_HRRCURVE: - AddCurve(PLOT2D_HRR); - GenPlotCB(GENPLOT_COMP1); + AddCurve(glui_plot2d, PLOT2D_HRR); + GenPlotCB(GENPLOT_SELECT_CURVE); break; - case GENPLOT_COMP1: + case GENPLOT_SELECT_CURVE: if(BUTTON_remove_curve != NULL){ strcpy(label, "Remove "); strcat(label, LIST_plotcurves->curr_text); @@ -572,25 +574,22 @@ void GenPlotCB(int var){ } break; case GENPLOT_REM_CURVE: - RemoveCurve(glui_plot2d_curve_index); - glui_plot2d->curve_index = glui_plot2d_curve_index; + RemoveCurve(glui_plot2d, glui_plot2d->curve_index); break; case GENPLOT_REM_ALLCURVES: - RemoveCurve(-1); + RemoveCurve(glui_plot2d, -1); break; - case GENPLOT_HRR1: + case GENPLOT_HRR_TYPE: strcpy(label, "Add "); strcat(label, hrrinfo[hrr1_index].label.shortlabel); strcat(label, " to plot"); BUTTON_add_hrr->set_name(label); break; - case GENPLOT_SHOW1: - glui_plot2d[0].show = show_genplot1; + case GENPLOT_SHOW_PLOT: plotstate = GetPlotState(DYNAMIC_PLOTS); update_times = 1; break; case GENPLOT_XYZ: - memcpy(glui_plot2d[0].xyz, glui_plot2d_xyz, 3*sizeof(float)); break; default: ASSERT(FFALSE); @@ -852,6 +851,28 @@ float GetDeviceTminTmax(void){ return return_val; } +/* ------------------ MakeCurveList ------------------------ */ + +void MakeCurveList(plot2ddata *plot2di, int option){ + int i; + + if(option == 1)LIST_plotcurves->add_item(-1, ""); + for(i = 0; i < plot2di->ncurve_indexes_ini; i++){ + int curv_index; + + curv_index = plot2di->curve_indexes_ini[i]; + if(curv_index < ndeviceinfo){ + LIST_devID1->set_int_val(curv_index); + AddCurve(plot2di, PLOT2D_DEV); + } + else{ + LIST_hrr1->set_int_val(curv_index - ndeviceinfo); + AddCurve(plot2di, PLOT2D_HRR); + } + GenPlotCB(GENPLOT_SELECT_CURVE); + } + } + /* ------------------ GluiDeviceSetup ------------------------ */ extern "C" void GluiDeviceSetup(int main_window){ @@ -1076,7 +1097,7 @@ extern "C" void GluiDeviceSetup(int main_window){ if(ndevicetypes>0){ PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "device data"); PANEL_plotdevice_select = glui_device->add_panel_to_panel(PANEL_plotgeneral_device, "", false); - LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device:", &deviceID1_index, GENPLOT_devID1, GenPlotCB); + LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device:", &deviceID1_index, GENPLOT_SELECT_DEVICE, GenPlotCB); glui_device->add_column_to_panel(PANEL_plotdevice_select,false); for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; @@ -1086,19 +1107,19 @@ extern "C" void GluiDeviceSetup(int main_window){ LIST_devID1->add_item(i, devicei->deviceID); } devicetypes_index = CLAMP(devicetypes_index, 0, ndevicetypes-1); - LIST_devtype1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device types:", &devtype1_index, GENPLOT_devtype1, GenPlotCB); + LIST_devtype1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device types:", &devtype1_index, GENPLOT_DEVICE_TYPE, GenPlotCB); LIST_devtype1->add_item(-1, "All"); for(i = 0; iadd_item(i, devicetypes[i]->quantity); } BUTTON_add_dev = glui_device->add_button_to_panel(PANEL_plotgeneral_device, _("Add to plot"), GENPLOT_ADD_DEVCURVE, GenPlotCB); - GenPlotCB(GENPLOT_devtype1); - GenPlotCB(GENPLOT_devID1); + GenPlotCB(GENPLOT_DEVICE_TYPE); + GenPlotCB(GENPLOT_SELECT_DEVICE); } if(nhrrinfo>0){ PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "hrr data"); - LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "select hrr quantity:", &hrr1_index, GENPLOT_HRR1, GenPlotCB); + LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "select hrr quantity:", &hrr1_index, GENPLOT_HRR_TYPE, GenPlotCB); for(i = 0; iadd_button_to_panel(PANEL_plotgeneral_hrr, _("Add to plot"), GENPLOT_ADD_HRRCURVE, GenPlotCB); - GenPlotCB(GENPLOT_HRR1); + GenPlotCB(GENPLOT_HRR_TYPE); } PANEL_plotgeneral_plot = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "plot"); BUTTON_add_plot = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Add plot"), GENPLOT_ADD_PLOT, GenPlotCB); BUTTON_rem_plot = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); - LIST_plots = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "select plot:", &iplot2dinfo, GENPLOT_COMP1, GenPlotCB); - - LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "curve:", &glui_plot2d_curve_index, GENPLOT_COMP1, GenPlotCB); - LIST_plotcurves->add_item(-1, ""); - for(i = 0; i < glui_plot2d->ncurve_indexes_ini; i++){ - int curv_index; + LIST_plots = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "select plot:", &iplot2dinfo, GENPLOT_SELECT_PLOT, GenPlotCB); - curv_index = glui_plot2d->curve_indexes_ini[i]; - if(curv_index < ndeviceinfo){ - LIST_devID1->set_int_val(curv_index); - AddCurve(PLOT2D_DEV); - } - else{ - LIST_hrr1->set_int_val(curv_index-ndeviceinfo); - AddCurve(PLOT2D_HRR); - } - GenPlotCB(GENPLOT_COMP1); - } + LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "curve:", &glui_plot2d->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); + MakeCurveList(glui_plot2d, 1); BUTTON_remove_curve = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove from plot"), GENPLOT_REM_CURVE, GenPlotCB); glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove all curves"), GENPLOT_REM_ALLCURVES, GenPlotCB); PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plotgeneral_plot, "plot position"); - SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2d_xyz+0, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2d_xyz+1, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2d_xyz+2, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2d->xyz+0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2d->xyz+1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2d->xyz+2, GENPLOT_XYZ, GenPlotCB); float plot_xyz_delta; plot_xyz_delta = MAX(ABS(xbarFDS - xbar0FDS), ABS(ybarFDS - ybar0FDS)); @@ -1147,9 +1154,9 @@ extern "C" void GluiDeviceSetup(int main_window){ SPINNER_genplot_x->set_float_limits(xbar0FDS - plot_xyz_delta, xbarFDS + plot_xyz_delta); SPINNER_genplot_y->set_float_limits(ybar0FDS - plot_xyz_delta, ybarFDS + plot_xyz_delta); SPINNER_genplot_z->set_float_limits(zbar0FDS - plot_xyz_delta, zbarFDS + plot_xyz_delta); - CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &show_genplot1, GENPLOT_SHOW1, GenPlotCB); - GenPlotCB(GENPLOT_devtype1); - GenPlotCB(GENPLOT_SHOW1); + CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &(glui_plot2d->show), GENPLOT_SHOW_PLOT, GenPlotCB); + GenPlotCB(GENPLOT_DEVICE_TYPE); + GenPlotCB(GENPLOT_SHOW_PLOT); } #endif diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index b341635537..0eec33278b 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -3037,12 +3037,6 @@ void UpdateMeshCoords(void){ ybarFDS = ybar; zbarFDS = zbar; -#ifdef pp_PLOT2D_NEW - glui_plot2d_xyz[0] = xbar0FDS; - glui_plot2d_xyz[1] = ybar0FDS; - glui_plot2d_xyz[2] = zbar0FDS; -#endif - geomlistdata *geomlisti; if(geominfo!=NULL&&geominfo->geomlistinfo!=NULL){ geomlisti = geominfo->geomlistinfo-1; @@ -11440,7 +11434,7 @@ int ReadIni2(char *inifile, int localfile){ int count; fgets(buffer, 255, stream); - sscanf(buffer, " %f %f %f %i", glui_plot2d_xyz, glui_plot2d_xyz+1, glui_plot2d_xyz+2, &show_genplot1); + sscanf(buffer, " %f %f %f %i", glui_plot2d->xyz, glui_plot2d->xyz+1, glui_plot2d->xyz+2, &glui_plot2d->show); fgets(buffer, 255, stream); TrimBack(buffer); @@ -14811,7 +14805,7 @@ void WriteIniLocal(FILE *fileout){ ); #ifdef pp_PLOT2D_NEW fprintf(fileout, "SHOWGENPLOTS\n"); - fprintf(fileout, " %f %f %f %i\n", glui_plot2d_xyz[0], glui_plot2d_xyz[1], glui_plot2d_xyz[2], show_genplot1); + fprintf(fileout, " %f %f %f %i\n", glui_plot2d->xyz[0], glui_plot2d->xyz[1], glui_plot2d->xyz[2], glui_plot2d->show); fprintf(fileout, " "); for(i = 0; i < glui_plot2d->ncurve_indexes; i++){ fprintf(fileout, " %i ", glui_plot2d->curve_indexes[i]); diff --git a/Source/smokeview/showscene.c b/Source/smokeview/showscene.c index 1c8c2f3a26..0099be3a7d 100644 --- a/Source/smokeview/showscene.c +++ b/Source/smokeview/showscene.c @@ -527,7 +527,7 @@ void ShowScene2(int mode){ #ifdef pp_PLOT2D_NEW if(mode == DRAWSCENE && geom_bounding_box_mousedown == 0){ - if(show_genplot1==1){ + if(glui_plot2d->show==1){ DrawGenPlots(); } } diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 83c8a03421..f07fae8245 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1524,12 +1524,9 @@ SVEXTERN float max_dev_vel; SVEXTERN int SVDECL(last_prop_display,-1); SVEXTERN int SVDECL(devicetypes_index,0); #ifdef pp_PLOT2D_NEW -SVEXTERN int SVDECL(glui_plot2d_curve_index, 0); SVEXTERN int SVDECL(devtype1_index, -1); SVEXTERN int SVDECL(deviceID1_index, 0); SVEXTERN int SVDECL(hrr1_index, 1); -SVEXTERN int SVDECL(show_genplot1, 0); -SVEXTERN float glui_plot2d_xyz[3]; SVEXTERN plot2ddata SVDECL(*glui_plot2d, NULL), SVDECL(*plot2dinfo, NULL);; SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0); #endif diff --git a/Source/smokeview/structures.h b/Source/smokeview/structures.h index 48ffb14cbf..7410007806 100644 --- a/Source/smokeview/structures.h +++ b/Source/smokeview/structures.h @@ -997,7 +997,8 @@ typedef struct _hrrdata { #define MAX_PLOT2D_CURVES 100 #ifdef pp_PLOT2D_NEW typedef struct _plot2ddata{ - int curve_indexes[MAX_PLOT2D_CURVES], curve_indexes_ini[MAX_PLOT2D_CURVES], ncurve_indexes, ncurve_indexes_ini; + int curve_indexes[MAX_PLOT2D_CURVES], ncurve_indexes; + int curve_indexes_ini[MAX_PLOT2D_CURVES], ncurve_indexes_ini; int curve_index, plot_index; float curve_min[MAX_PLOT2D_CURVES], curve_max[MAX_PLOT2D_CURVES]; float xyz[3]; diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 41f1547587..19438f7e81 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -371,9 +371,6 @@ void UpdateShow(void){ showtours=0; showdeviceflag = 0; showhrrflag = 0; -#ifdef pp_PLOT2D_NEW - show_genplot1fag = 0; -#endif visTimeParticles=1; visTimeSlice=1; visTimeBoundary=1; visTimeZone=1; visTimeIso=1; drawing_boundary_files = 0; @@ -381,9 +378,6 @@ void UpdateShow(void){ RenderTime=0; if(vis_hrr_plot==1&&hrrptr!=NULL)showhrrflag = 1; -#ifdef pp_PLOT2D_NEW - if(show_genplot1==1)show_genplot1fag = 1; -#endif if(showdevice_val==1||vis_device_plot!=DEVICE_PLOT_HIDDEN){ for(i = 0; ishow == 1 || #endif (ReadZoneFile==1&&visZone==1&&visTimeZone==1)||showvolrender==1 ) @@ -1178,7 +1172,7 @@ void UpdateTimes(void){ MergeGlobalTimes(timeptr->vals, timeptr->nvals); } #ifdef pp_PLOT2D_NEW - if(show_genplot1==1){ + if(glui_plot2d->show==1){ if(HaveGenDev()==1){ MergeGlobalTimes(deviceinfo->times, deviceinfo->nvals); } @@ -1605,7 +1599,7 @@ int GetPlotStateSub(int choice){ return DYNAMIC_PLOTS; } #ifdef pp_PLOT2D_NEW - if(show_genplot1==1){ + if(glui_plot2d->show==1){ stept = 1; return DYNAMIC_PLOTS; From 3f23df3fd1fbc8e7e9936ef1719e51a92ffb6125 Mon Sep 17 00:00:00 2001 From: gforney Date: Fri, 20 May 2022 22:55:16 -0400 Subject: [PATCH 03/22] smokeview source: remove unused variables --- Source/smokeview/glui_objects.cpp | 2 ++ Source/smokeview/update.c | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 2a79a53f7f..d9976293ff 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -851,6 +851,7 @@ float GetDeviceTminTmax(void){ return return_val; } +#ifdef pp_PLOT2D_NEW /* ------------------ MakeCurveList ------------------------ */ void MakeCurveList(plot2ddata *plot2di, int option){ @@ -872,6 +873,7 @@ void MakeCurveList(plot2ddata *plot2di, int option){ GenPlotCB(GENPLOT_SELECT_CURVE); } } +#endif /* ------------------ GluiDeviceSetup ------------------------ */ diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 19438f7e81..f223c8e466 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -343,9 +343,6 @@ void UpdateFileLoad(void){ void UpdateShow(void){ int i,evacflag,sliceflag,vsliceflag,partflag,patchflag,isoflag,smoke3dflag,tisoflag,showdeviceflag; -#ifdef pp_PLOT2D_NEW - int show_genplot1fag; -#endif int slicecolorbarflag; int shooter_flag; int showhrrflag; From 6cb7b83b4a9bc7eb61e3d5d2fc0af662d7373aa6 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 21 May 2022 23:02:39 -0400 Subject: [PATCH 04/22] smokeview source: multiple 2d plots - preliminary working version --- Source/smokeview/IOobjects.c | 20 ++- Source/smokeview/glui_objects.cpp | 261 ++++++++++++++++++------------ Source/smokeview/readsmv.c | 16 +- Source/smokeview/showscene.c | 6 +- Source/smokeview/smokeheaders.h | 1 - Source/smokeview/smokeviewvars.h | 8 +- Source/smokeview/update.c | 6 +- 7 files changed, 187 insertions(+), 131 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 3e2a6d3b9a..e63a8db3c3 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3289,10 +3289,10 @@ void GetGlobalDeviceBounds(int type){ int HaveGenDev(void){ int i; - for(i = 0; incurve_indexes; i++){ + for(i = 0; incurve_indexes; i++){ int curve_index; - curve_index = glui_plot2d->curve_indexes[i]; + curve_index = glui_plot2dinfo->curve_indexes[i]; if(curve_indexncurve_indexes; i++){ + for(i = 0; incurve_indexes; i++){ int curve_index; - curve_index = glui_plot2d->curve_indexes[i]; + curve_index = glui_plot2dinfo->curve_indexes[i]; if(curve_index>=ndeviceinfo)return 1; } return 0; @@ -3532,8 +3532,16 @@ void DrawGenPlot(plot2ddata * plot2di){ /* ------------------ DrawGenPlots ------------------------ */ void DrawGenPlots(void){ - if(glui_plot2d->show==0)return; - DrawGenPlot(glui_plot2d); + int i; + + for(i = 0; i < nplot2dinfo;i++){ + plot2ddata *plot2di; + + plot2di = plot2dinfo + i; + if(plot2di->show == 1){ + DrawGenPlot(plot2di); + } + } } #endif diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index d9976293ff..0379844366 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -401,49 +401,43 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ } } -/* ------------------ AddPlot2D ------------------------ */ - -extern "C" void AddPlot2D(void){ - nplot2dinfo++; - if(nplot2dinfo==1){ - NewMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); - } - else{ - ResizeMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); - } - InitPlot2D(plot2dinfo + nplot2dinfo - 1, nplot2dinfo); -} - -/* ------------------ DeletePlot2D ------------------------ */ +/* ------------------ RemoveCurve ------------------------ */ -void DeletePlot2D(int i){ - int ii; +void RemoveCurve(plot2ddata *plot2di, int index){ + if(index < 0){ + int i; - for(ii=i+1;iincurve_indexes; i++){ + LIST_plotcurves->delete_item(plot2di->curve_indexes[i]); + plot2di->curve_indexes[i] = -2; + } + plot2di->ncurve_indexes = 0; + LIST_plotcurves->set_int_val(-1); + } else{ - ResizeMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); - } -} - -/* ------------------ Glui2Plot2d ------------------------ */ - -void Glui2Plot2D(void){ -} + int i, ii; -/* ------------------ Plot2D2Glui ------------------------ */ + LIST_plotcurves->delete_item(index); -void Plot2D2Glui(void){ + ii = 0; + for(i = 0; i < plot2di->ncurve_indexes; i++){ + if(plot2di->curve_indexes[i] == index)continue; + if(i != ii)plot2di->curve_indexes[ii] = plot2di->curve_indexes[i]; + ii++; + } + (plot2di->ncurve_indexes)--; + if(plot2di->ncurve_indexes > 0){ + LIST_plotcurves->set_int_val(plot2di->curve_indexes[0]); + } + else{ + LIST_plotcurves->set_int_val(-1); + } + } } /* ------------------ AddCurve ------------------------ */ -void AddCurve(plot2ddata *plot2di, int type){ +void AddCurve(plot2ddata *plot2di, int type, int force){ int i, have_index, nindex; int offset = 0, index; @@ -455,10 +449,12 @@ void AddCurve(plot2ddata *plot2di, int type){ index = LIST_devID1->get_int_val(); } have_index = 0; - for(i=0; i< plot2di->ncurve_indexes; i++){ - if(plot2di->curve_indexes[i] == index+offset){ - have_index = 1; - break; + if(force = 0){ + for(i = 0; i < plot2di->ncurve_indexes; i++){ + if(plot2di->curve_indexes[i] == index + offset){ + have_index = 1; + break; + } } } if(have_index == 0){ @@ -481,39 +477,107 @@ void AddCurve(plot2ddata *plot2di, int type){ } } -/* ------------------ RemoveCurve ------------------------ */ +/* ------------------ MakeCurveList ------------------------ */ -void RemoveCurve(plot2ddata *plot2di, int index){ - if(index<0){ - int i; +void GenPlotCB(int var); +void MakeCurveList(plot2ddata *plot2di, int option){ + int i; - for(i=0;i< plot2di->ncurve_indexes; i++){ - LIST_plotcurves->delete_item(plot2di->curve_indexes[i]); + if(option == 1)LIST_plotcurves->add_item(-1, ""); + for(i = 0; i < plot2di->ncurve_indexes_ini; i++){ + int curv_index; + + curv_index = plot2di->curve_indexes_ini[i]; + if(curv_index < ndeviceinfo){ + LIST_devID1->set_int_val(curv_index); + AddCurve(plot2di, PLOT2D_DEV, 1); } - plot2di->ncurve_indexes = 0; - LIST_plotcurves->set_int_val(-1); + else{ + LIST_hrr1->set_int_val(curv_index - ndeviceinfo); + AddCurve(plot2di, PLOT2D_HRR, 1); + } + GenPlotCB(GENPLOT_SELECT_CURVE); } - else{ - int i, ii; +} - LIST_plotcurves->delete_item(index); +/* ------------------ Plot2D2Glui ------------------------ */ - ii = 0; - for(i = 0; i < plot2di->ncurve_indexes; i++){ - if(plot2di->curve_indexes[i] == index)continue; - if(i != ii)plot2di->curve_indexes[ii] = plot2di->curve_indexes[i]; - ii++; +void Plot2D2Glui(int index){ + int i; + + RemoveCurve(glui_plot2dinfo, -1); + memcpy(glui_plot2dinfo, plot2dinfo + index, sizeof(plot2ddata)); + memcpy(glui_plot2dinfo->curve_indexes_ini, glui_plot2dinfo->curve_indexes, glui_plot2dinfo->ncurve_indexes * sizeof(float)); + glui_plot2dinfo->ncurve_indexes_ini = glui_plot2dinfo->ncurve_indexes; + MakeCurveList(glui_plot2dinfo, 0); + LIST_plotcurves->set_int_val(glui_plot2dinfo->curve_index); + SPINNER_genplot_x->set_float_val(glui_plot2dinfo->xyz[0]); + SPINNER_genplot_y->set_float_val(glui_plot2dinfo->xyz[1]); + SPINNER_genplot_z->set_float_val(glui_plot2dinfo->xyz[2]); + CHECKBOX_show_genplot->set_int_val(glui_plot2dinfo->show); +} + +/* ------------------ AddPlot2D ------------------------ */ + +extern "C" void AddPlot2D(plot2ddata *plot2di){ + char label[32]; + + nplot2dinfo++; + if(nplot2dinfo==1){ + NewMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); + } + else{ + ResizeMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); + } + iplot2dinfo = nplot2dinfo - 1; + if(plot2di==NULL){ + InitPlot2D(plot2dinfo + iplot2dinfo, nplot2dinfo); + } + else{ + if(plot2dinfo + iplot2dinfo != plot2di){ + memcpy(plot2dinfo + iplot2dinfo, plot2di, sizeof(plot2ddata)); } - (plot2di->ncurve_indexes)--; - if(plot2di->ncurve_indexes > 0){ - LIST_plotcurves->set_int_val(plot2di->curve_indexes[0]); + } + Plot2D2Glui(iplot2dinfo); + sprintf(label, "%i", iplot2dinfo); + LIST_plots->add_item(iplot2dinfo, label); + LIST_plots->set_int_val(iplot2dinfo); +} + +/* ------------------ DeletePlot2D ------------------------ */ + +void DeletePlot2D(int i){ + int ii; + + for(ii=i+1;ii0){ + if(iset_int_val(-1); + iplot2dinfo = 0; } + Plot2D2Glui(iplot2dinfo); + LIST_plots->delete_item(i); + LIST_plots->set_int_val(iplot2dinfo); } } +/* ------------------ Glui2Plot2d ------------------------ */ + +void Glui2Plot2D(int index){ + if(plot2dinfo!=NULL)memcpy(plot2dinfo + index, glui_plot2dinfo, sizeof(plot2ddata)); +} + /* ------------------ UpdateDevList ------------------------ */ void UpdateDevList(GLUI_Listbox *LIST_dev, int devtype_index){ @@ -550,20 +614,22 @@ void GenPlotCB(int var){ case GENPLOT_SELECT_DEVICE: strcpy(label, "Add "); - strcat(label, deviceinfo[deviceID1_index].deviceID); + strcat(label, deviceinfo[glui_device_index].deviceID); strcat(label, " to plot"); BUTTON_add_dev->set_name(label); break; case GENPLOT_DEVICE_TYPE: - UpdateDevList(LIST_devID1, devtype1_index); + UpdateDevList(LIST_devID1, glui_device_quantity_index); break; case GENPLOT_ADD_DEVCURVE: - AddCurve(glui_plot2d, PLOT2D_DEV); + AddCurve(glui_plot2dinfo, PLOT2D_DEV, 0); GenPlotCB(GENPLOT_SELECT_CURVE); + Glui2Plot2D(iplot2dinfo); break; case GENPLOT_ADD_HRRCURVE: - AddCurve(glui_plot2d, PLOT2D_HRR); + AddCurve(glui_plot2dinfo, PLOT2D_HRR, 0); GenPlotCB(GENPLOT_SELECT_CURVE); + Glui2Plot2D(iplot2dinfo); break; case GENPLOT_SELECT_CURVE: if(BUTTON_remove_curve != NULL){ @@ -574,22 +640,35 @@ void GenPlotCB(int var){ } break; case GENPLOT_REM_CURVE: - RemoveCurve(glui_plot2d, glui_plot2d->curve_index); + RemoveCurve(glui_plot2dinfo, glui_plot2dinfo->curve_index); + Glui2Plot2D(iplot2dinfo); break; case GENPLOT_REM_ALLCURVES: - RemoveCurve(glui_plot2d, -1); + RemoveCurve(glui_plot2dinfo, -1); + Glui2Plot2D(iplot2dinfo); break; case GENPLOT_HRR_TYPE: strcpy(label, "Add "); - strcat(label, hrrinfo[hrr1_index].label.shortlabel); + strcat(label, hrrinfo[glui_hrr_index].label.shortlabel); strcat(label, " to plot"); BUTTON_add_hrr->set_name(label); break; case GENPLOT_SHOW_PLOT: + Glui2Plot2D(iplot2dinfo); plotstate = GetPlotState(DYNAMIC_PLOTS); update_times = 1; break; case GENPLOT_XYZ: + Glui2Plot2D(iplot2dinfo); + break; + case GENPLOT_SELECT_PLOT: + Plot2D2Glui(iplot2dinfo); + break; + case GENPLOT_ADD_PLOT: + AddPlot2D(NULL); + break; + case GENPLOT_REM_PLOT: + DeletePlot2D(iplot2dinfo); break; default: ASSERT(FFALSE); @@ -851,30 +930,6 @@ float GetDeviceTminTmax(void){ return return_val; } -#ifdef pp_PLOT2D_NEW -/* ------------------ MakeCurveList ------------------------ */ - -void MakeCurveList(plot2ddata *plot2di, int option){ - int i; - - if(option == 1)LIST_plotcurves->add_item(-1, ""); - for(i = 0; i < plot2di->ncurve_indexes_ini; i++){ - int curv_index; - - curv_index = plot2di->curve_indexes_ini[i]; - if(curv_index < ndeviceinfo){ - LIST_devID1->set_int_val(curv_index); - AddCurve(plot2di, PLOT2D_DEV); - } - else{ - LIST_hrr1->set_int_val(curv_index - ndeviceinfo); - AddCurve(plot2di, PLOT2D_HRR); - } - GenPlotCB(GENPLOT_SELECT_CURVE); - } - } -#endif - /* ------------------ GluiDeviceSetup ------------------------ */ extern "C" void GluiDeviceSetup(int main_window){ @@ -1099,7 +1154,7 @@ extern "C" void GluiDeviceSetup(int main_window){ if(ndevicetypes>0){ PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "device data"); PANEL_plotdevice_select = glui_device->add_panel_to_panel(PANEL_plotgeneral_device, "", false); - LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device:", &deviceID1_index, GENPLOT_SELECT_DEVICE, GenPlotCB); + LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device:", &glui_device_index, GENPLOT_SELECT_DEVICE, GenPlotCB); glui_device->add_column_to_panel(PANEL_plotdevice_select,false); for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; @@ -1109,7 +1164,7 @@ extern "C" void GluiDeviceSetup(int main_window){ LIST_devID1->add_item(i, devicei->deviceID); } devicetypes_index = CLAMP(devicetypes_index, 0, ndevicetypes-1); - LIST_devtype1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device types:", &devtype1_index, GENPLOT_DEVICE_TYPE, GenPlotCB); + LIST_devtype1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device types:", &glui_device_quantity_index, GENPLOT_DEVICE_TYPE, GenPlotCB); LIST_devtype1->add_item(-1, "All"); for(i = 0; iadd_item(i, devicetypes[i]->quantity); @@ -1121,7 +1176,7 @@ extern "C" void GluiDeviceSetup(int main_window){ if(nhrrinfo>0){ PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "hrr data"); - LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "select hrr quantity:", &hrr1_index, GENPLOT_HRR_TYPE, GenPlotCB); + LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "select hrr quantity:", &glui_hrr_index, GENPLOT_HRR_TYPE, GenPlotCB); for(i = 0; iadd_button_to_panel(PANEL_plotgeneral_plot, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); LIST_plots = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "select plot:", &iplot2dinfo, GENPLOT_SELECT_PLOT, GenPlotCB); - LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "curve:", &glui_plot2d->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); - MakeCurveList(glui_plot2d, 1); + LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "curve:", &glui_plot2dinfo->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); + RemoveCurve(glui_plot2dinfo, -1); + MakeCurveList(glui_plot2dinfo, 1); BUTTON_remove_curve = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove from plot"), GENPLOT_REM_CURVE, GenPlotCB); glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove all curves"), GENPLOT_REM_ALLCURVES, GenPlotCB); PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plotgeneral_plot, "plot position"); - SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2d->xyz+0, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2d->xyz+1, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2d->xyz+2, GENPLOT_XYZ, GenPlotCB); - - float plot_xyz_delta; - plot_xyz_delta = MAX(ABS(xbarFDS - xbar0FDS), ABS(ybarFDS - ybar0FDS)); - plot_xyz_delta = MAX(ABS(zbarFDS - zbar0FDS), plot_xyz_delta)/5.0; - SPINNER_genplot_x->set_float_limits(xbar0FDS - plot_xyz_delta, xbarFDS + plot_xyz_delta); - SPINNER_genplot_y->set_float_limits(ybar0FDS - plot_xyz_delta, ybarFDS + plot_xyz_delta); - SPINNER_genplot_z->set_float_limits(zbar0FDS - plot_xyz_delta, zbarFDS + plot_xyz_delta); - CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &(glui_plot2d->show), GENPLOT_SHOW_PLOT, GenPlotCB); + SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); + + CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); GenPlotCB(GENPLOT_DEVICE_TYPE); GenPlotCB(GENPLOT_SHOW_PLOT); + AddPlot2D(glui_plot2dinfo); } #endif diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 0eec33278b..cb23681963 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -10956,8 +10956,8 @@ typedef struct { // initialize 2d plot data structures #ifdef pp_PLOT2D_NEW void InitPlot2D(plot2ddata *plot2di, int plot_index); - NewMemory((void **)&glui_plot2d, sizeof(plot2ddata)); - InitPlot2D(glui_plot2d, 0); + NewMemory((void **)&glui_plot2dinfo, sizeof(plot2ddata)); + InitPlot2D(glui_plot2dinfo, 0); #endif PRINTF("%s", _("complete")); @@ -11434,7 +11434,7 @@ int ReadIni2(char *inifile, int localfile){ int count; fgets(buffer, 255, stream); - sscanf(buffer, " %f %f %f %i", glui_plot2d->xyz, glui_plot2d->xyz+1, glui_plot2d->xyz+2, &glui_plot2d->show); + sscanf(buffer, " %f %f %f %i", glui_plot2dinfo->xyz, glui_plot2dinfo->xyz+1, glui_plot2dinfo->xyz+2, &glui_plot2dinfo->show); fgets(buffer, 255, stream); TrimBack(buffer); @@ -11444,10 +11444,10 @@ int ReadIni2(char *inifile, int localfile){ int curv_index; sscanf(token, "%i", &curv_index); - glui_plot2d->curve_indexes_ini[count++] = curv_index; + glui_plot2dinfo->curve_indexes_ini[count++] = curv_index; token = strtok(NULL, " "); } - glui_plot2d->ncurve_indexes_ini = count; + glui_plot2dinfo->ncurve_indexes_ini = count; update_glui_devices = 1; continue; } @@ -14805,10 +14805,10 @@ void WriteIniLocal(FILE *fileout){ ); #ifdef pp_PLOT2D_NEW fprintf(fileout, "SHOWGENPLOTS\n"); - fprintf(fileout, " %f %f %f %i\n", glui_plot2d->xyz[0], glui_plot2d->xyz[1], glui_plot2d->xyz[2], glui_plot2d->show); + fprintf(fileout, " %f %f %f %i\n", glui_plot2dinfo->xyz[0], glui_plot2dinfo->xyz[1], glui_plot2dinfo->xyz[2], glui_plot2dinfo->show); fprintf(fileout, " "); - for(i = 0; i < glui_plot2d->ncurve_indexes; i++){ - fprintf(fileout, " %i ", glui_plot2d->curve_indexes[i]); + for(i = 0; i < glui_plot2dinfo->ncurve_indexes; i++){ + fprintf(fileout, " %i ", glui_plot2dinfo->curve_indexes[i]); }; fprintf(fileout, "\n"); #endif diff --git a/Source/smokeview/showscene.c b/Source/smokeview/showscene.c index 0099be3a7d..22651d6f6d 100644 --- a/Source/smokeview/showscene.c +++ b/Source/smokeview/showscene.c @@ -526,10 +526,8 @@ void ShowScene2(int mode){ /* ++++++++++++++++++++++++ draw general plots +++++++++++++++++++++++++ */ #ifdef pp_PLOT2D_NEW - if(mode == DRAWSCENE && geom_bounding_box_mousedown == 0){ - if(glui_plot2d->show==1){ - DrawGenPlots(); - } + if(mode == DRAWSCENE){ + DrawGenPlots(); } #endif diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 1a80675cc1..428c36b3f3 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -6,7 +6,6 @@ #endif #ifdef pp_PLOT2D_NEW -EXTERNCPP void AddPlot2D(void); EXTERNCPP void DrawGenPlots(void); EXTERNCPP int HaveGenDev(void); EXTERNCPP int HaveGenHrr(void); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index f07fae8245..87302587e0 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1524,10 +1524,10 @@ SVEXTERN float max_dev_vel; SVEXTERN int SVDECL(last_prop_display,-1); SVEXTERN int SVDECL(devicetypes_index,0); #ifdef pp_PLOT2D_NEW -SVEXTERN int SVDECL(devtype1_index, -1); -SVEXTERN int SVDECL(deviceID1_index, 0); -SVEXTERN int SVDECL(hrr1_index, 1); -SVEXTERN plot2ddata SVDECL(*glui_plot2d, NULL), SVDECL(*plot2dinfo, NULL);; +SVEXTERN int SVDECL(glui_device_quantity_index, -1); +SVEXTERN int SVDECL(glui_device_index, 0); +SVEXTERN int SVDECL(glui_hrr_index, 1); +SVEXTERN plot2ddata SVDECL(*glui_plot2dinfo, NULL), SVDECL(*plot2dinfo, NULL);; SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0); #endif SVEXTERN float SVDECL(plot2d_hrr_min,0.0), SVDECL(plot2d_hrr_max,1.0); diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index f223c8e466..adbe0213e7 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -624,7 +624,7 @@ void UpdateShow(void){ ( showdeviceflag==1 || showhrrflag==1 || sliceflag==1 || vsliceflag==1 || partflag==1 || patchflag==1 || shooter_flag==1|| smoke3dflag==1 || showtours==1 || evacflag==1 || #ifdef pp_PLOT2D_NEW - glui_plot2d->show == 1 || + glui_plot2dinfo->show == 1 || #endif (ReadZoneFile==1&&visZone==1&&visTimeZone==1)||showvolrender==1 ) @@ -1169,7 +1169,7 @@ void UpdateTimes(void){ MergeGlobalTimes(timeptr->vals, timeptr->nvals); } #ifdef pp_PLOT2D_NEW - if(glui_plot2d->show==1){ + if(glui_plot2dinfo->show==1){ if(HaveGenDev()==1){ MergeGlobalTimes(deviceinfo->times, deviceinfo->nvals); } @@ -1596,7 +1596,7 @@ int GetPlotStateSub(int choice){ return DYNAMIC_PLOTS; } #ifdef pp_PLOT2D_NEW - if(glui_plot2d->show==1){ + if(glui_plot2dinfo->show==1){ stept = 1; return DYNAMIC_PLOTS; From 217531b1647c592db39cb12062f2dc7e2475a662 Mon Sep 17 00:00:00 2001 From: gforney Date: Sat, 21 May 2022 23:06:18 -0400 Subject: [PATCH 05/22] smokeview source: remove unused variables --- Source/smokeview/glui_objects.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 0379844366..b72abb220d 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -503,8 +503,6 @@ void MakeCurveList(plot2ddata *plot2di, int option){ /* ------------------ Plot2D2Glui ------------------------ */ void Plot2D2Glui(int index){ - int i; - RemoveCurve(glui_plot2dinfo, -1); memcpy(glui_plot2dinfo, plot2dinfo + index, sizeof(plot2ddata)); memcpy(glui_plot2dinfo->curve_indexes_ini, glui_plot2dinfo->curve_indexes, glui_plot2dinfo->ncurve_indexes * sizeof(float)); From 4bc8be1b670ecd7a85746da5121e7d6b57f15fa1 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 22 May 2022 14:50:52 -0400 Subject: [PATCH 06/22] smokeview source: add color widget to plot2d dialog box --- Source/smokeview/IOobjects.c | 15 ++++++++------- Source/smokeview/glui_objects.cpp | 17 +++++++++++++++++ Source/smokeview/structures.h | 1 + 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index e63a8db3c3..d9adca7c6a 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3316,7 +3316,7 @@ int HaveGenHrr(void){ void DrawGenCurve(int option, float *xyz0, float factor, float *x, float *z, int n, float highlight_x, float highlight_y, - float global_valmin, float global_valmax, float *plot_color, char *label, int position){ + float global_valmin, float global_valmax, int *plot_color, char *label, int position){ float xmin, xmax, zmin, zmax, dx, dz; float xscale = 1.0, zscale = 1.0; float origin[3]; @@ -3360,7 +3360,7 @@ void DrawGenCurve(int option, float *xyz0, float factor, float *x, float *z, int glScalef(SCALE2FDS(factor), SCALE2FDS(factor), SCALE2FDS(factor)); glScalef(xscale, 1.0, zscale); glTranslatef(-xmin, 0.0, -zmin); - glColor3fv(plot_color); + glColor3ub((unsigned char)plot_color[0], (unsigned char)plot_color[1], (unsigned char)plot_color[2] ); glLineWidth(plot2d_line_width); glBegin(GL_LINES); for(i = 0; i < n - 1; i++){ @@ -3408,7 +3408,10 @@ void DrawGenCurve(int option, float *xyz0, float factor, float *x, float *z, int Output3Text(foregroundcolor, xmax - dx, 0.0, zmin - dz - 3.0 * dfont, c_tmax); } if(label != NULL){ - Output3Text(plot_color, xmax + 2.0 * dx, 0.0, zmax - (0.5 + plot2d_font_spacing * (float)position) * dfont, label); + float p2_color[3]; + + p2_color[0] =(float) plot_color[0]/255.0; + Output3Text(p2_color, xmax + 2.0 * dx, 0.0, zmax - (0.5 + plot2d_font_spacing * (float)position) * dfont, label); } } glPopMatrix(); @@ -3484,15 +3487,13 @@ void DrawGenPlot(plot2ddata * plot2di){ if(strcmp(label, "O2") == 0){ dev_min = 0.0; dev_max = 0.25; - color = blue_color; } else{ dev_min = dev_global_min; dev_max = dev_global_max; - color = foregroundcolor; } DrawGenCurve(option, plot2di->xyz, plot2d_size_factor, devi->times, devi->vals, devi->nvals, - highlight_time, highlight_val, dev_min, dev_max, color, label, position); + highlight_time, highlight_val, dev_min, dev_max, plot2di->color, label, position); position++; } } @@ -3522,7 +3523,7 @@ void DrawGenPlot(plot2ddata * plot2di){ option = PLOT_ONLY_DATA; } DrawGenCurve(option, plot2di->xyz, plot2d_size_factor, hrrinfo->vals, hrri->vals, hrri->nvals, - highlight_time, highlight_val, hrr_global_min, hrr_global_max, blue_color, hrri->label.shortlabel, position); + highlight_time, highlight_val, hrr_global_min, hrr_global_max, plot2di->color, hrri->label.shortlabel, position); position++; } } diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 0379844366..3ac2a39fe6 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -124,6 +124,7 @@ GLUI_Panel *PANEL_plotgeneral_device = NULL; GLUI_Panel *PANEL_plotgeneral_hrr = NULL; GLUI_Panel *PANEL_plotgeneral_plot = NULL; GLUI_Panel *PANEL_plotgeneral_position = NULL; +GLUI_Panel *PANEL_plotgeneral_color = NULL; #endif GLUI_Panel *PANEL_hrr_min = NULL; GLUI_Panel *PANEL_hrr_max = NULL; @@ -171,6 +172,9 @@ GLUI_Rollout *ROLLOUT_trees = NULL; GLUI_Spinner *SPINNER_genplot_x = NULL; GLUI_Spinner *SPINNER_genplot_y = NULL; GLUI_Spinner *SPINNER_genplot_z = NULL; +GLUI_Spinner *SPINNER_genplot_red = NULL; +GLUI_Spinner *SPINNER_genplot_green = NULL; +GLUI_Spinner *SPINNER_genplot_blue = NULL; #endif GLUI_Spinner *SPINNER_fuel_hoc = NULL; GLUI_Spinner *SPINNER_size_factor = NULL; @@ -360,6 +364,9 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ plot2di->xyz[0] = xbar0FDS; plot2di->xyz[1] = ybar0FDS; plot2di->xyz[2] = zbar0FDS; + plot2di->color[0] = 0; + plot2di->color[1] = 0; + plot2di->color[2] = 0; plot2di->plot_index = plot_index; plot2di->curve_index = 0; @@ -514,6 +521,9 @@ void Plot2D2Glui(int index){ SPINNER_genplot_x->set_float_val(glui_plot2dinfo->xyz[0]); SPINNER_genplot_y->set_float_val(glui_plot2dinfo->xyz[1]); SPINNER_genplot_z->set_float_val(glui_plot2dinfo->xyz[2]); + SPINNER_genplot_red->set_int_val(glui_plot2dinfo->color[0]); + SPINNER_genplot_green->set_int_val(glui_plot2dinfo->color[1]); + SPINNER_genplot_blue->set_int_val(glui_plot2dinfo->color[2]); CHECKBOX_show_genplot->set_int_val(glui_plot2dinfo->show); } @@ -1206,6 +1216,13 @@ extern "C" void GluiDeviceSetup(int main_window){ SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); + PANEL_plotgeneral_color = glui_device->add_panel_to_panel(PANEL_plotgeneral_plot, "plot color"); + SPINNER_genplot_red = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "x", GLUI_SPINNER_INT, glui_plot2dinfo->color + 0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_green = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "y", GLUI_SPINNER_INT, glui_plot2dinfo->color + 1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_blue = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "z", GLUI_SPINNER_INT, glui_plot2dinfo->color + 2, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_red->set_int_limits(0,255); + SPINNER_genplot_green->set_int_limits(0,255); + SPINNER_genplot_blue->set_int_limits(0,255); CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); GenPlotCB(GENPLOT_DEVICE_TYPE); GenPlotCB(GENPLOT_SHOW_PLOT); diff --git a/Source/smokeview/structures.h b/Source/smokeview/structures.h index 7410007806..603ae0af90 100644 --- a/Source/smokeview/structures.h +++ b/Source/smokeview/structures.h @@ -1002,6 +1002,7 @@ typedef struct _plot2ddata{ int curve_index, plot_index; float curve_min[MAX_PLOT2D_CURVES], curve_max[MAX_PLOT2D_CURVES]; float xyz[3]; + int color[3]; int show; } plot2ddata; #endif From ca1e2685e25acc3515231691569cece8b9214d15 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 22 May 2022 18:25:56 -0400 Subject: [PATCH 07/22] smokeview source: output plot2d parameters to an ini file, correct plo2d plot coloring --- Source/smokeview/IOobjects.c | 4 +- Source/smokeview/glui_objects.cpp | 64 ++++++++++++++++++++--------- Source/smokeview/readsmv.c | 67 +++++++++++++++++++++++-------- Source/smokeview/smokeviewvars.h | 4 +- 4 files changed, 99 insertions(+), 40 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index d9adca7c6a..1a99883ae3 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3410,7 +3410,9 @@ void DrawGenCurve(int option, float *xyz0, float factor, float *x, float *z, int if(label != NULL){ float p2_color[3]; - p2_color[0] =(float) plot_color[0]/255.0; + p2_color[0] = (float)plot_color[0]/255.0; + p2_color[1] = (float)plot_color[1]/255.0; + p2_color[2] = (float)plot_color[2]/255.0; Output3Text(p2_color, xmax + 2.0 * dx, 0.0, zmax - (0.5 + plot2d_font_spacing * (float)position) * dfont, label); } } diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 3b828587d3..bd2d8c0c83 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -352,24 +352,11 @@ void UpdateShowWindRoses(void) { #ifdef pp_PLOT2D_NEW -/* ------------------ InitPlot2D ------------------------ */ +/* ------------------ UpdateCurveBounds ------------------------ */ -extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ +extern "C" void UpdateCurveBounds(plot2ddata *plot2di){ int i; - if(ndeviceinfo==0 && nhrrinfo==0)return; - plot2di->ncurve_indexes = 0; - plot2di->ncurve_indexes_ini = 0; - plot2di->show = 0; - plot2di->xyz[0] = xbar0FDS; - plot2di->xyz[1] = ybar0FDS; - plot2di->xyz[2] = zbar0FDS; - plot2di->color[0] = 0; - plot2di->color[1] = 0; - plot2di->color[2] = 0; - plot2di->plot_index = plot_index; - plot2di->curve_index = 0; - for(i = 0; i < ndeviceinfo; i++){ devicedata *devi; int j; @@ -383,11 +370,11 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ for(j = 1; j < devi->nvals; j++){ valmin = MIN(valmin, devi->vals[j]); valmax = MAX(valmax, devi->vals[j]); - } + } plot2di->curve_min[i] = valmin; plot2di->curve_max[i] = valmax; + } } - } for(i = 0; i < nhrrinfo; i++){ hrrdata *hrri; int j; @@ -401,11 +388,32 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ for(j = 1; j < hrri->nvals; j++){ valmin = MIN(valmin, hrri->vals[j]); valmax = MAX(valmax, hrri->vals[j]); - } + } plot2di->curve_min[i + ndeviceinfo] = valmin; plot2di->curve_max[i + ndeviceinfo] = valmax; + } } } + +/* ------------------ InitPlot2D ------------------------ */ + +extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ + int i; + + if(ndeviceinfo==0 && nhrrinfo==0)return; + plot2di->ncurve_indexes = 0; + plot2di->ncurve_indexes_ini = 0; + plot2di->show = 0; + plot2di->xyz[0] = xbar0FDS; + plot2di->xyz[1] = ybar0FDS; + plot2di->xyz[2] = zbar0FDS; + plot2di->color[0] = 0; + plot2di->color[1] = 0; + plot2di->color[2] = 0; + plot2di->plot_index = plot_index; + plot2di->curve_index = 0; + UpdateCurveBounds(plot2di); + } /* ------------------ RemoveCurve ------------------------ */ @@ -416,7 +424,6 @@ void RemoveCurve(plot2ddata *plot2di, int index){ for(i = 0; i < plot2di->ncurve_indexes; i++){ LIST_plotcurves->delete_item(plot2di->curve_indexes[i]); - plot2di->curve_indexes[i] = -2; } plot2di->ncurve_indexes = 0; LIST_plotcurves->set_int_val(-1); @@ -514,6 +521,7 @@ void Plot2D2Glui(int index){ memcpy(glui_plot2dinfo, plot2dinfo + index, sizeof(plot2ddata)); memcpy(glui_plot2dinfo->curve_indexes_ini, glui_plot2dinfo->curve_indexes, glui_plot2dinfo->ncurve_indexes * sizeof(float)); glui_plot2dinfo->ncurve_indexes_ini = glui_plot2dinfo->ncurve_indexes; + glui_plot2dinfo->ncurve_indexes = 0; MakeCurveList(glui_plot2dinfo, 0); LIST_plotcurves->set_int_val(glui_plot2dinfo->curve_index); SPINNER_genplot_x->set_float_val(glui_plot2dinfo->xyz[0]); @@ -1222,9 +1230,25 @@ extern "C" void GluiDeviceSetup(int main_window){ SPINNER_genplot_green->set_int_limits(0,255); SPINNER_genplot_blue->set_int_limits(0,255); CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); + + if(nplot2dini>0){ + nplot2dinfo = nplot2dini; + NewMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); + memcpy(plot2dinfo, plot2dini, nplot2dinfo*sizeof(plot2ddata)); + for(i = 0; i < nplot2dini; i++){ + char label[32]; + plot2ddata *plot2di; + + plot2di = plot2dinfo + i; + sprintf(label, "%i", i); + LIST_plots->add_item(i, label); + // UpdateCurveBounds(plot2di); + } + LIST_plots->set_int_val(0); + GenPlotCB(GENPLOT_SELECT_PLOT); + } GenPlotCB(GENPLOT_DEVICE_TYPE); GenPlotCB(GENPLOT_SHOW_PLOT); - AddPlot2D(glui_plot2dinfo); } #endif diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index cb23681963..b4a6a1c7d3 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11432,22 +11432,45 @@ int ReadIni2(char *inifile, int localfile){ if(Match(buffer, "SHOWGENPLOTS") == 1){ char *token; int count; + int *color; - fgets(buffer, 255, stream); - sscanf(buffer, " %f %f %f %i", glui_plot2dinfo->xyz, glui_plot2dinfo->xyz+1, glui_plot2dinfo->xyz+2, &glui_plot2dinfo->show); fgets(buffer, 255, stream); - TrimBack(buffer); - token = strtok(buffer, " "); - count = 0; - while(token != NULL){ - int curv_index; + sscanf(buffer, " %i", &nplot2dini); + + FREEMEMORY(plot2dini); + + if(nplot2dini==0)continue; + NewMemory((void **)&plot2dini, nplot2dini*sizeof(plot2ddata)); + + + for(i=0;icolor; + fgets(buffer, 255, stream); + sscanf(buffer, " %f %f %f %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show); + fgets(buffer, 255, stream); + sscanf(buffer, " %i %i %i", color, color+1, color+2); + + fgets(buffer, 255, stream); + TrimBack(buffer); + token = strtok(buffer, " "); + count = 0; + while(token != NULL){ + int curv_index; + + sscanf(token, "%i", &curv_index); + plot2di->curve_indexes[count++] = curv_index; + token = strtok(NULL, " "); + } + plot2di->ncurve_indexes = count; +void UpdateCurveBounds(plot2ddata *plot2di); + UpdateCurveBounds(plot2di); - sscanf(token, "%i", &curv_index); - glui_plot2dinfo->curve_indexes_ini[count++] = curv_index; - token = strtok(NULL, " "); } - glui_plot2dinfo->ncurve_indexes_ini = count; update_glui_devices = 1; continue; } @@ -14805,12 +14828,22 @@ void WriteIniLocal(FILE *fileout){ ); #ifdef pp_PLOT2D_NEW fprintf(fileout, "SHOWGENPLOTS\n"); - fprintf(fileout, " %f %f %f %i\n", glui_plot2dinfo->xyz[0], glui_plot2dinfo->xyz[1], glui_plot2dinfo->xyz[2], glui_plot2dinfo->show); - fprintf(fileout, " "); - for(i = 0; i < glui_plot2dinfo->ncurve_indexes; i++){ - fprintf(fileout, " %i ", glui_plot2dinfo->curve_indexes[i]); - }; - fprintf(fileout, "\n"); + fprintf(fileout, " %i\n", nplot2dinfo); + for(i=0; icolor; + fprintf(fileout, " %f %f %f %i\n", plot2di->xyz[0], plot2di->xyz[1], plot2di->xyz[2], plot2di->show); + fprintf(fileout, " %i %i %i\n", color[0], color[1], color[2]); + fprintf(fileout, " "); + for(j = 0; j < plot2di->ncurve_indexes; j++){ + fprintf(fileout, " %i ", plot2di->curve_indexes[j]); + }; + fprintf(fileout, "\n"); + } #endif fprintf(fileout, "SHOWDEVICEVALS\n"); fprintf(fileout, " %i %i %i %i %i %i %i %i %i\n", showdevice_val, showvdevice_val, devicetypes_index, colordevice_val, vectortype, viswindrose, showdevice_type,showdevice_unit,showdevice_id); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index 87302587e0..ff2fc65ded 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1527,8 +1527,8 @@ SVEXTERN int SVDECL(devicetypes_index,0); SVEXTERN int SVDECL(glui_device_quantity_index, -1); SVEXTERN int SVDECL(glui_device_index, 0); SVEXTERN int SVDECL(glui_hrr_index, 1); -SVEXTERN plot2ddata SVDECL(*glui_plot2dinfo, NULL), SVDECL(*plot2dinfo, NULL);; -SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0); +SVEXTERN plot2ddata SVDECL(*glui_plot2dinfo, NULL), SVDECL(*plot2dinfo, NULL), SVDECL(*plot2dini, NULL); +SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0), SVDECL(nplot2dini, 0); #endif SVEXTERN float SVDECL(plot2d_hrr_min,0.0), SVDECL(plot2d_hrr_max,1.0); SVEXTERN int SVDECL(use_plot2d_hrr_min, 0); From 1c8333686fc6f5d4bbcd4ea3046e94bc8c2048a1 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 22 May 2022 18:37:52 -0400 Subject: [PATCH 08/22] smokeview source: remove unused variables --- Source/smokeview/IOobjects.c | 2 -- Source/smokeview/glui_objects.cpp | 5 ----- Source/smokeview/readsmv.c | 3 --- 3 files changed, 10 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 1a99883ae3..66becd7fd9 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3484,7 +3484,6 @@ void DrawGenPlot(plot2ddata * plot2di){ char label[256]; strcpy(label, devi->deviceID); - float *color, blue_color[3] = {0.0,0.0,1.0}; float dev_min, dev_max; if(strcmp(label, "O2") == 0){ dev_min = 0.0; @@ -3515,7 +3514,6 @@ void DrawGenPlot(plot2ddata * plot2di){ } if(hrri->nvals > 0){ int option; - float blue_color[3] = {0.0, 0.0, 1.0}; if(first == 1){ first = 0; diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index bd2d8c0c83..ebb1ff178d 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -398,8 +398,6 @@ extern "C" void UpdateCurveBounds(plot2ddata *plot2di){ /* ------------------ InitPlot2D ------------------------ */ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ - int i; - if(ndeviceinfo==0 && nhrrinfo==0)return; plot2di->ncurve_indexes = 0; plot2di->ncurve_indexes_ini = 0; @@ -1237,12 +1235,9 @@ extern "C" void GluiDeviceSetup(int main_window){ memcpy(plot2dinfo, plot2dini, nplot2dinfo*sizeof(plot2ddata)); for(i = 0; i < nplot2dini; i++){ char label[32]; - plot2ddata *plot2di; - plot2di = plot2dinfo + i; sprintf(label, "%i", i); LIST_plots->add_item(i, label); - // UpdateCurveBounds(plot2di); } LIST_plots->set_int_val(0); GenPlotCB(GENPLOT_SELECT_PLOT); diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index b4a6a1c7d3..70c44cd96e 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11432,8 +11432,6 @@ int ReadIni2(char *inifile, int localfile){ if(Match(buffer, "SHOWGENPLOTS") == 1){ char *token; int count; - int *color; - fgets(buffer, 255, stream); sscanf(buffer, " %i", &nplot2dini); @@ -11443,7 +11441,6 @@ int ReadIni2(char *inifile, int localfile){ if(nplot2dini==0)continue; NewMemory((void **)&plot2dini, nplot2dini*sizeof(plot2ddata)); - for(i=0;i Date: Sun, 22 May 2022 21:03:27 -0400 Subject: [PATCH 09/22] smokkeview source: improve layout of 2d plot dialog box --- Source/smokeview/glui_objects.cpp | 68 +++++++++++++++++++------------ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index ebb1ff178d..4c5f71804a 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -119,6 +119,9 @@ GLUI_Listbox *LIST_open=NULL; GLUI_Listbox *LIST_hrrdata=NULL; #ifdef pp_PLOT2D_NEW +GLUI_Panel *PANEL_plot1 = NULL; +GLUI_Panel *PANEL_plot2 = NULL; +GLUI_Panel *PANEL_plot3 = NULL; GLUI_Panel *PANEL_plotdevice_select = NULL; GLUI_Panel *PANEL_plotgeneral_device = NULL; GLUI_Panel *PANEL_plotgeneral_hrr = NULL; @@ -1165,69 +1168,80 @@ extern "C" void GluiDeviceSetup(int main_window){ #ifdef pp_PLOT2D_NEW if(nhrrinfo>0||ndevicetypes>0){ ROLLOUT_plotgeneral = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "device+hrr", false); - if(ndevicetypes>0){ - PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "device data"); + + PANEL_plot1 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + LIST_plots = glui_device->add_listbox_to_panel(PANEL_plot1, "select plot:", &iplot2dinfo, GENPLOT_SELECT_PLOT, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plot1, false); + BUTTON_add_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Add plot"), GENPLOT_ADD_PLOT, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plot1, false); + BUTTON_rem_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plot1, false); + CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plot1, "show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); + + if(ndevicetypes > 0){ + PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); PANEL_plotdevice_select = glui_device->add_panel_to_panel(PANEL_plotgeneral_device, "", false); - LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device:", &glui_device_index, GENPLOT_SELECT_DEVICE, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plotdevice_select,false); + LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device ID:", &glui_device_index, GENPLOT_SELECT_DEVICE, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plotdevice_select, false); + BUTTON_add_dev = glui_device->add_button_to_panel(PANEL_plotdevice_select, _("Add to plot"), GENPLOT_ADD_DEVCURVE, GenPlotCB); for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; devicei = deviceinfo + i; devicei->inlist1 = 1; LIST_devID1->add_item(i, devicei->deviceID); - } - devicetypes_index = CLAMP(devicetypes_index, 0, ndevicetypes-1); + } + devicetypes_index = CLAMP(devicetypes_index, 0, ndevicetypes - 1); +#ifdef pp_DEVICE_TYPEX LIST_devtype1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device types:", &glui_device_quantity_index, GENPLOT_DEVICE_TYPE, GenPlotCB); LIST_devtype1->add_item(-1, "All"); - for(i = 0; iadd_item(i, devicetypes[i]->quantity); } - BUTTON_add_dev = glui_device->add_button_to_panel(PANEL_plotgeneral_device, _("Add to plot"), GENPLOT_ADD_DEVCURVE, GenPlotCB); +#endif GenPlotCB(GENPLOT_DEVICE_TYPE); GenPlotCB(GENPLOT_SELECT_DEVICE); } - - if(nhrrinfo>0){ - PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "hrr data"); + if(nhrrinfo > 0){ + PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "select hrr quantity:", &glui_hrr_index, GENPLOT_HRR_TYPE, GenPlotCB); - for(i = 0; ilabel.shortlabel!=NULL){ - if(strcmp(hi->label.shortlabel, "Time")==0)continue; + hi = hrrinfo + i; + if(hi->label.shortlabel != NULL){ + if(strcmp(hi->label.shortlabel, "Time") == 0)continue; LIST_hrr1->add_item(i, hi->label.shortlabel); + } } - } + glui_device->add_column_to_panel(PANEL_plotgeneral_hrr, false); BUTTON_add_hrr = glui_device->add_button_to_panel(PANEL_plotgeneral_hrr, _("Add to plot"), GENPLOT_ADD_HRRCURVE, GenPlotCB); GenPlotCB(GENPLOT_HRR_TYPE); } - PANEL_plotgeneral_plot = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "plot"); - BUTTON_add_plot = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Add plot"), GENPLOT_ADD_PLOT, GenPlotCB); - BUTTON_rem_plot = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); - LIST_plots = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "select plot:", &iplot2dinfo, GENPLOT_SELECT_PLOT, GenPlotCB); - - LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plotgeneral_plot, "curve:", &glui_plot2dinfo->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); + PANEL_plot2 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plot2, "plot curve:", &glui_plot2dinfo->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plot2, false); RemoveCurve(glui_plot2dinfo, -1); MakeCurveList(glui_plot2dinfo, 1); + BUTTON_remove_curve = glui_device->add_button_to_panel(PANEL_plot2, _("Remove from plot"), GENPLOT_REM_CURVE, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plot2, false); + glui_device->add_button_to_panel(PANEL_plot2, _("Remove all curves from plot"), GENPLOT_REM_ALLCURVES, GenPlotCB); - BUTTON_remove_curve = glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove from plot"), GENPLOT_REM_CURVE, GenPlotCB); - glui_device->add_button_to_panel(PANEL_plotgeneral_plot, _("Remove all curves"), GENPLOT_REM_ALLCURVES, GenPlotCB); - PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plotgeneral_plot, "plot position"); + PANEL_plot3 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plot3, "plot position"); SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+0, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); + glui_device->add_column_to_panel(PANEL_plot3, false); - PANEL_plotgeneral_color = glui_device->add_panel_to_panel(PANEL_plotgeneral_plot, "plot color"); + PANEL_plotgeneral_color = glui_device->add_panel_to_panel(PANEL_plot3, "plot color"); SPINNER_genplot_red = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "x", GLUI_SPINNER_INT, glui_plot2dinfo->color + 0, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_green = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "y", GLUI_SPINNER_INT, glui_plot2dinfo->color + 1, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_blue = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "z", GLUI_SPINNER_INT, glui_plot2dinfo->color + 2, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_red->set_int_limits(0,255); SPINNER_genplot_green->set_int_limits(0,255); SPINNER_genplot_blue->set_int_limits(0,255); - CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plotgeneral_plot,"show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); if(nplot2dini>0){ nplot2dinfo = nplot2dini; From 5e4b38334107809d172c997dafe07ebd69c4b20d Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 22 May 2022 21:30:46 -0400 Subject: [PATCH 10/22] smokeview source: minor formating edit to 2d plot dialog box --- Source/smokeview/glui_objects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 4c5f71804a..079ae75471 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -1181,7 +1181,7 @@ extern "C" void GluiDeviceSetup(int main_window){ if(ndevicetypes > 0){ PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); PANEL_plotdevice_select = glui_device->add_panel_to_panel(PANEL_plotgeneral_device, "", false); - LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "select device ID:", &glui_device_index, GENPLOT_SELECT_DEVICE, GenPlotCB); + LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device ID:", &glui_device_index, GENPLOT_SELECT_DEVICE, GenPlotCB); glui_device->add_column_to_panel(PANEL_plotdevice_select, false); BUTTON_add_dev = glui_device->add_button_to_panel(PANEL_plotdevice_select, _("Add to plot"), GENPLOT_ADD_DEVCURVE, GenPlotCB); for(i = 0; i < ndeviceinfo; i++){ @@ -1204,7 +1204,7 @@ extern "C" void GluiDeviceSetup(int main_window){ } if(nhrrinfo > 0){ PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); - LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "select hrr quantity:", &glui_hrr_index, GENPLOT_HRR_TYPE, GenPlotCB); + LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "hrr quantity:", &glui_hrr_index, GENPLOT_HRR_TYPE, GenPlotCB); for(i = 0; i < nhrrinfo + nhrrhcinfo; i++){ hrrdata *hi; From c409aef93431f6b4d00fe946dd0319c8603903c6 Mon Sep 17 00:00:00 2001 From: gforney Date: Sun, 22 May 2022 22:04:04 -0400 Subject: [PATCH 11/22] smokeview source: fix a couple of crashes when removing or adding 2d plots --- Source/smokeview/glui_objects.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 079ae75471..5ef84c5989 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -518,6 +518,7 @@ void MakeCurveList(plot2ddata *plot2di, int option){ /* ------------------ Plot2D2Glui ------------------------ */ void Plot2D2Glui(int index){ + if(index >= nplot2dinfo)return; RemoveCurve(glui_plot2dinfo, -1); memcpy(glui_plot2dinfo, plot2dinfo + index, sizeof(plot2ddata)); memcpy(glui_plot2dinfo->curve_indexes_ini, glui_plot2dinfo->curve_indexes, glui_plot2dinfo->ncurve_indexes * sizeof(float)); @@ -566,6 +567,7 @@ extern "C" void AddPlot2D(plot2ddata *plot2di){ void DeletePlot2D(int i){ int ii; + if(nplot2dinfo <= 0)return; for(ii=i+1;ii Date: Mon, 23 May 2022 11:41:19 -0400 Subject: [PATCH 12/22] smokeview source: fixex to plot index dialog display --- Source/smokeview/glui_objects.cpp | 53 +++++++++++++++++++------------ Source/smokeview/readsmv.c | 3 ++ Source/smokeview/smokeviewvars.h | 2 +- Source/smokeview/structures.h | 1 + 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 5ef84c5989..34d447ceae 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -535,9 +535,9 @@ void Plot2D2Glui(int index){ CHECKBOX_show_genplot->set_int_val(glui_plot2dinfo->show); } -/* ------------------ AddPlot2D ------------------------ */ +/* ------------------ AddPlot ------------------------ */ -extern "C" void AddPlot2D(plot2ddata *plot2di){ +extern "C" void AddPlot(plot2ddata *plot2di){ char label[32]; nplot2dinfo++; @@ -552,22 +552,31 @@ extern "C" void AddPlot2D(plot2ddata *plot2di){ InitPlot2D(plot2dinfo + iplot2dinfo, nplot2dinfo); } else{ + plot2di->plot_index = nplot2dinfo-1; if(plot2dinfo + iplot2dinfo != plot2di){ memcpy(plot2dinfo + iplot2dinfo, plot2di, sizeof(plot2ddata)); } } Plot2D2Glui(iplot2dinfo); - sprintf(label, "%i", iplot2dinfo); + plot2d_count++; + sprintf(label, "%i", plot2d_count); + strcpy(plot2dinfo[iplot2dinfo].plot_label, label); LIST_plots->add_item(iplot2dinfo, label); LIST_plots->set_int_val(iplot2dinfo); } -/* ------------------ DeletePlot2D ------------------------ */ +/* ------------------ RemovePlot ------------------------ */ -void DeletePlot2D(int i){ +void RemovePlot(int i){ int ii; - if(nplot2dinfo <= 0)return; + if(nplot2dinfo <= 0||i==-1)return; + for(ii = 0; ii < nplot2dinfo; ii++){ + plot2ddata *plot2di; + + plot2di = plot2dinfo + ii; + LIST_plots->delete_item(plot2di->plot_label); + } for(ii=i+1;ii0){ - if(iadd_item(ii, plot2di->plot_label); } Plot2D2Glui(iplot2dinfo); - LIST_plots->delete_item(i); + LIST_plots->set_int_val(-1); + iplot2dinfo = 0; LIST_plots->set_int_val(iplot2dinfo); } + else{ + LIST_plots->set_int_val(-1); + } } /* ------------------ Glui2Plot2d ------------------------ */ @@ -684,10 +696,10 @@ void GenPlotCB(int var){ Plot2D2Glui(iplot2dinfo); break; case GENPLOT_ADD_PLOT: - AddPlot2D(NULL); + AddPlot(NULL); break; case GENPLOT_REM_PLOT: - DeletePlot2D(iplot2dinfo); + RemovePlot(iplot2dinfo); break; default: ASSERT(FFALSE); @@ -1179,6 +1191,7 @@ extern "C" void GluiDeviceSetup(int main_window){ BUTTON_rem_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); glui_device->add_column_to_panel(PANEL_plot1, false); CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plot1, "show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); + LIST_plots->add_item(-1, ""); if(ndevicetypes > 0){ PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); @@ -1250,10 +1263,10 @@ extern "C" void GluiDeviceSetup(int main_window){ NewMemory((void **)&plot2dinfo, nplot2dinfo*sizeof(plot2ddata)); memcpy(plot2dinfo, plot2dini, nplot2dinfo*sizeof(plot2ddata)); for(i = 0; i < nplot2dini; i++){ - char label[32]; + plot2ddata *plot2di; - sprintf(label, "%i", i); - LIST_plots->add_item(i, label); + plot2di = plot2dinfo + i; + LIST_plots->add_item(i, plot2di->plot_label); } LIST_plots->set_int_val(0); GenPlotCB(GENPLOT_SELECT_PLOT); diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 70c44cd96e..8416d6e0ab 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11446,6 +11446,9 @@ int ReadIni2(char *inifile, int localfile){ int *color; plot2di = plot2dini + i; + plot2di->plot_index = i; + sprintf(plot2di->plot_label, "%i", i + 1); + plot2d_count++; color = plot2di->color; fgets(buffer, 255, stream); sscanf(buffer, " %f %f %f %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index ff2fc65ded..e59273885f 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1528,7 +1528,7 @@ SVEXTERN int SVDECL(glui_device_quantity_index, -1); SVEXTERN int SVDECL(glui_device_index, 0); SVEXTERN int SVDECL(glui_hrr_index, 1); SVEXTERN plot2ddata SVDECL(*glui_plot2dinfo, NULL), SVDECL(*plot2dinfo, NULL), SVDECL(*plot2dini, NULL); -SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0), SVDECL(nplot2dini, 0); +SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0), SVDECL(nplot2dini, 0), SVDECL(plot2d_count, 0); #endif SVEXTERN float SVDECL(plot2d_hrr_min,0.0), SVDECL(plot2d_hrr_max,1.0); SVEXTERN int SVDECL(use_plot2d_hrr_min, 0); diff --git a/Source/smokeview/structures.h b/Source/smokeview/structures.h index 603ae0af90..903eb00bee 100644 --- a/Source/smokeview/structures.h +++ b/Source/smokeview/structures.h @@ -1000,6 +1000,7 @@ typedef struct _plot2ddata{ int curve_indexes[MAX_PLOT2D_CURVES], ncurve_indexes; int curve_indexes_ini[MAX_PLOT2D_CURVES], ncurve_indexes_ini; int curve_index, plot_index; + char plot_label[32]; float curve_min[MAX_PLOT2D_CURVES], curve_max[MAX_PLOT2D_CURVES]; float xyz[3]; int color[3]; From 4c17097da46d213cacbfa6512b32307b91bdf951 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 23 May 2022 16:38:09 -0400 Subject: [PATCH 13/22] smokeview source: for 2d plots, allow one to specify curve colors --- Source/smokeview/IOobjects.c | 4 +-- Source/smokeview/glui_objects.cpp | 38 +++++++++++++++++--------- Source/smokeview/readsmv.c | 44 ++++++++++++------------------- Source/smokeview/smokeviewvars.h | 1 + Source/smokeview/structures.h | 2 +- 5 files changed, 47 insertions(+), 42 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 66becd7fd9..57f6700f33 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3494,7 +3494,7 @@ void DrawGenPlot(plot2ddata * plot2di){ dev_max = dev_global_max; } DrawGenCurve(option, plot2di->xyz, plot2d_size_factor, devi->times, devi->vals, devi->nvals, - highlight_time, highlight_val, dev_min, dev_max, plot2di->color, label, position); + highlight_time, highlight_val, dev_min, dev_max, plot2di->curve_colors+3*curve_index, label, position); position++; } } @@ -3523,7 +3523,7 @@ void DrawGenPlot(plot2ddata * plot2di){ option = PLOT_ONLY_DATA; } DrawGenCurve(option, plot2di->xyz, plot2d_size_factor, hrrinfo->vals, hrri->vals, hrri->nvals, - highlight_time, highlight_val, hrr_global_min, hrr_global_max, plot2di->color, hrri->label.shortlabel, position); + highlight_time, highlight_val, hrr_global_min, hrr_global_max, plot2di->curve_colors+3*curve_index, hrri->label.shortlabel, position); position++; } } diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 34d447ceae..e26102fa38 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -357,7 +357,7 @@ void UpdateShowWindRoses(void) { /* ------------------ UpdateCurveBounds ------------------------ */ -extern "C" void UpdateCurveBounds(plot2ddata *plot2di){ +extern "C" void UpdateCurveBounds(plot2ddata *plot2di, int option){ int i; for(i = 0; i < ndeviceinfo; i++){ @@ -365,6 +365,11 @@ extern "C" void UpdateCurveBounds(plot2ddata *plot2di){ int j; devi = deviceinfo + i; + if(option == 1){ + plot2di->curve_colors[3*i + 0] = 0; + plot2di->curve_colors[3*i + 1] = 0; + plot2di->curve_colors[3*i + 2] = 0; + } if(devi->nvals > 0){ float valmin, valmax; @@ -383,6 +388,11 @@ extern "C" void UpdateCurveBounds(plot2ddata *plot2di){ int j; hrri = hrrinfo + i; + if(option == 1){ + plot2di->curve_colors[3*i + 3*ndeviceinfo + 0] = 0; + plot2di->curve_colors[3*i + 3*ndeviceinfo + 1] = 0; + plot2di->curve_colors[3*i + 3*ndeviceinfo + 2] = 0; + } if(hrri->nvals > 0){ float valmin, valmax; @@ -408,12 +418,9 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ plot2di->xyz[0] = xbar0FDS; plot2di->xyz[1] = ybar0FDS; plot2di->xyz[2] = zbar0FDS; - plot2di->color[0] = 0; - plot2di->color[1] = 0; - plot2di->color[2] = 0; plot2di->plot_index = plot_index; plot2di->curve_index = 0; - UpdateCurveBounds(plot2di); + UpdateCurveBounds(plot2di, 1); } @@ -529,9 +536,11 @@ void Plot2D2Glui(int index){ SPINNER_genplot_x->set_float_val(glui_plot2dinfo->xyz[0]); SPINNER_genplot_y->set_float_val(glui_plot2dinfo->xyz[1]); SPINNER_genplot_z->set_float_val(glui_plot2dinfo->xyz[2]); - SPINNER_genplot_red->set_int_val(glui_plot2dinfo->color[0]); - SPINNER_genplot_green->set_int_val(glui_plot2dinfo->color[1]); - SPINNER_genplot_blue->set_int_val(glui_plot2dinfo->color[2]); + + memcpy(glui_curve_colors, glui_plot2dinfo->curve_colors + 3*glui_plot2dinfo->curve_index, 3*sizeof(int)); + SPINNER_genplot_red->set_int_val(glui_curve_colors[0]); + SPINNER_genplot_green->set_int_val(glui_curve_colors[1]); + SPINNER_genplot_blue->set_int_val(glui_curve_colors[2]); CHECKBOX_show_genplot->set_int_val(glui_plot2dinfo->show); } @@ -663,6 +672,10 @@ void GenPlotCB(int var){ Glui2Plot2D(iplot2dinfo); break; case GENPLOT_SELECT_CURVE: + memcpy(glui_curve_colors, glui_plot2dinfo->curve_colors + 3*glui_plot2dinfo->curve_index, 3*sizeof(int)); + SPINNER_genplot_red->set_int_val(glui_curve_colors[0]); + SPINNER_genplot_green->set_int_val(glui_curve_colors[1]); + SPINNER_genplot_blue->set_int_val(glui_curve_colors[2]); if(BUTTON_remove_curve != NULL){ strcpy(label, "Remove "); strcat(label, LIST_plotcurves->curr_text); @@ -690,6 +703,7 @@ void GenPlotCB(int var){ update_times = 1; break; case GENPLOT_XYZ: + memcpy(glui_plot2dinfo->curve_colors + 3*glui_plot2dinfo->curve_index, glui_curve_colors, 3*sizeof(int)); Glui2Plot2D(iplot2dinfo); break; case GENPLOT_SELECT_PLOT: @@ -1250,10 +1264,10 @@ extern "C" void GluiDeviceSetup(int main_window){ SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); glui_device->add_column_to_panel(PANEL_plot3, false); - PANEL_plotgeneral_color = glui_device->add_panel_to_panel(PANEL_plot3, "plot color"); - SPINNER_genplot_red = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "x", GLUI_SPINNER_INT, glui_plot2dinfo->color + 0, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_green = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "y", GLUI_SPINNER_INT, glui_plot2dinfo->color + 1, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_blue = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "z", GLUI_SPINNER_INT, glui_plot2dinfo->color + 2, GENPLOT_XYZ, GenPlotCB); + PANEL_plotgeneral_color = glui_device->add_panel_to_panel(PANEL_plot3, "plot curve color"); + SPINNER_genplot_red = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "red", GLUI_SPINNER_INT, glui_curve_colors + 0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_green = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "green", GLUI_SPINNER_INT, glui_curve_colors + 1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_blue = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "blue", GLUI_SPINNER_INT, glui_curve_colors + 2, GENPLOT_XYZ, GenPlotCB); SPINNER_genplot_red->set_int_limits(0,255); SPINNER_genplot_green->set_int_limits(0,255); SPINNER_genplot_blue->set_int_limits(0,255); diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 8416d6e0ab..31e54e6a8a 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11443,32 +11443,24 @@ int ReadIni2(char *inifile, int localfile){ for(i=0;iplot_index = i; - sprintf(plot2di->plot_label, "%i", i + 1); plot2d_count++; - color = plot2di->color; - fgets(buffer, 255, stream); - sscanf(buffer, " %f %f %f %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show); - fgets(buffer, 255, stream); - sscanf(buffer, " %i %i %i", color, color+1, color+2); - + sprintf(plot2di->plot_label, "%i", plot2d_count); fgets(buffer, 255, stream); - TrimBack(buffer); - token = strtok(buffer, " "); - count = 0; - while(token != NULL){ - int curv_index; + sscanf(buffer, " %f %f %f %i %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show, &plot2di->ncurve_indexes); + for(j=0; jncurve_indexes; j++){ + int color[3], *color2; - sscanf(token, "%i", &curv_index); - plot2di->curve_indexes[count++] = curv_index; - token = strtok(NULL, " "); - } - plot2di->ncurve_indexes = count; -void UpdateCurveBounds(plot2ddata *plot2di); - UpdateCurveBounds(plot2di); + fgets(buffer, 255, stream); + sscanf(buffer, " %i %i %i %i", plot2di->curve_indexes + j, color, color+1, color+2); + color2 = plot2di->curve_colors + 3 * plot2di->curve_indexes[j]; + memcpy(color2, color, 3 * sizeof(int)); + } +void UpdateCurveBounds(plot2ddata *plot2di, int option); + UpdateCurveBounds(plot2di, 0); } update_glui_devices = 1; @@ -14831,18 +14823,16 @@ void WriteIniLocal(FILE *fileout){ fprintf(fileout, " %i\n", nplot2dinfo); for(i=0; icolor; - fprintf(fileout, " %f %f %f %i\n", plot2di->xyz[0], plot2di->xyz[1], plot2di->xyz[2], plot2di->show); - fprintf(fileout, " %i %i %i\n", color[0], color[1], color[2]); - fprintf(fileout, " "); + fprintf(fileout, " %f %f %f %i %i\n", plot2di->xyz[0], plot2di->xyz[1], plot2di->xyz[2], plot2di->show, plot2di->ncurve_indexes); for(j = 0; j < plot2di->ncurve_indexes; j++){ - fprintf(fileout, " %i ", plot2di->curve_indexes[j]); + int *color; + + color = plot2di->curve_colors+3*plot2di->curve_indexes[j]; + fprintf(fileout, " %i %i %i %i\n", plot2di->curve_indexes[j], color[0], color[1], color[2]); }; - fprintf(fileout, "\n"); } #endif fprintf(fileout, "SHOWDEVICEVALS\n"); diff --git a/Source/smokeview/smokeviewvars.h b/Source/smokeview/smokeviewvars.h index e59273885f..16c404c9da 100644 --- a/Source/smokeview/smokeviewvars.h +++ b/Source/smokeview/smokeviewvars.h @@ -1527,6 +1527,7 @@ SVEXTERN int SVDECL(devicetypes_index,0); SVEXTERN int SVDECL(glui_device_quantity_index, -1); SVEXTERN int SVDECL(glui_device_index, 0); SVEXTERN int SVDECL(glui_hrr_index, 1); +SVEXTERN int glui_curve_colors[3]; SVEXTERN plot2ddata SVDECL(*glui_plot2dinfo, NULL), SVDECL(*plot2dinfo, NULL), SVDECL(*plot2dini, NULL); SVEXTERN int SVDECL(nplot2dinfo, 0), SVDECL(iplot2dinfo, 0), SVDECL(nplot2dini, 0), SVDECL(plot2d_count, 0); #endif diff --git a/Source/smokeview/structures.h b/Source/smokeview/structures.h index 903eb00bee..5369079398 100644 --- a/Source/smokeview/structures.h +++ b/Source/smokeview/structures.h @@ -1002,8 +1002,8 @@ typedef struct _plot2ddata{ int curve_index, plot_index; char plot_label[32]; float curve_min[MAX_PLOT2D_CURVES], curve_max[MAX_PLOT2D_CURVES]; + int curve_colors[3*MAX_PLOT2D_CURVES]; float xyz[3]; - int color[3]; int show; } plot2ddata; #endif From 6bbb497ab904f0c9b0d63876e91718fe463f46e5 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 23 May 2022 17:12:19 -0400 Subject: [PATCH 14/22] smokeview source: fix problem with coloring 2d hrr plot cuurves --- Source/smokeview/IOobjects.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 57f6700f33..929b2cb1a3 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3501,8 +3501,7 @@ void DrawGenPlot(plot2ddata * plot2di){ else{ hrrdata *hrri; - curve_index -= ndeviceinfo; - hrri = hrrinfo + curve_index; + hrri = hrrinfo + curve_index - ndeviceinfo; if(global_times != NULL){ int itime; From 1b6912e10ac11c9835507188970f3b401f1240a6 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 23 May 2022 18:02:27 -0400 Subject: [PATCH 15/22] smokeview source: minor formatting edits to 2d plot dialog box --- Source/smokeview/glui_objects.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index e26102fa38..8db25cbbd0 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -708,6 +708,9 @@ void GenPlotCB(int var){ break; case GENPLOT_SELECT_PLOT: Plot2D2Glui(iplot2dinfo); + strcpy(label, "Remove plot "); + strcat(label, plot2dinfo[iplot2dinfo].plot_label); + BUTTON_rem_plot->set_name(label); break; case GENPLOT_ADD_PLOT: AddPlot(NULL); @@ -1195,7 +1198,7 @@ extern "C" void GluiDeviceSetup(int main_window){ #ifdef pp_PLOT2D_NEW if(nhrrinfo>0||ndevicetypes>0){ - ROLLOUT_plotgeneral = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "device+hrr", false); + ROLLOUT_plotgeneral = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "device and/or hrr data", false); PANEL_plot1 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); LIST_plots = glui_device->add_listbox_to_panel(PANEL_plot1, "select plot:", &iplot2dinfo, GENPLOT_SELECT_PLOT, GenPlotCB); @@ -1219,7 +1222,7 @@ extern "C" void GluiDeviceSetup(int main_window){ devicei = deviceinfo + i; devicei->inlist1 = 1; LIST_devID1->add_item(i, devicei->deviceID); - } + } devicetypes_index = CLAMP(devicetypes_index, 0, ndevicetypes - 1); #ifdef pp_DEVICE_TYPEX LIST_devtype1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device types:", &glui_device_quantity_index, GENPLOT_DEVICE_TYPE, GenPlotCB); @@ -1291,7 +1294,7 @@ extern "C" void GluiDeviceSetup(int main_window){ #endif if(ndevicetypes>0){ - ROLLOUT_plotdevice = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "device", false); + ROLLOUT_plotdevice = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "device data", false); RADIO_vis_device_plot = glui_device->add_radiogroup_to_panel(ROLLOUT_plotdevice, &vis_device_plot, SHOWDEVICEPLOT, DeviceCB); glui_device->add_radiobutton_to_group(RADIO_vis_device_plot, "hide"); glui_device->add_radiobutton_to_group(RADIO_vis_device_plot, "show selected"); @@ -1317,7 +1320,7 @@ extern "C" void GluiDeviceSetup(int main_window){ } if(nhrrinfo>0){ - ROLLOUT_plothrr = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "hrr", false); + ROLLOUT_plothrr = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "hrr data", false); CHECKBOX_vis_hrr_plot = glui_device->add_checkbox_to_panel(ROLLOUT_plothrr, _("show"), &vis_hrr_plot, HRRPUV2_PLOT, DeviceCB); LIST_hrrdata = glui_device->add_listbox_to_panel(ROLLOUT_plothrr, "type:", &glui_hrr, DEVICE_TIMEAVERAGE, DeviceCB); for(i = 0; i Date: Mon, 23 May 2022 22:26:10 -0400 Subject: [PATCH 16/22] smokeview source: formatting chages to 2d plot dialog box - interim commit --- Source/smokeview/IOobjects.c | 9 ++- Source/smokeview/glui_objects.cpp | 91 ++++++++++++++++++++++++------- Source/smokeview/readsmv.c | 8 +-- Source/smokeview/structures.h | 2 +- 4 files changed, 83 insertions(+), 27 deletions(-) diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 929b2cb1a3..9886162339 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -3316,7 +3316,7 @@ int HaveGenHrr(void){ void DrawGenCurve(int option, float *xyz0, float factor, float *x, float *z, int n, float highlight_x, float highlight_y, - float global_valmin, float global_valmax, int *plot_color, char *label, int position){ + float global_valmin, float global_valmax, int *plot_color, char *label, int position, char *title, int show_title){ float xmin, xmax, zmin, zmax, dx, dz; float xscale = 1.0, zscale = 1.0; float origin[3]; @@ -3406,6 +3406,9 @@ void DrawGenCurve(int option, float *xyz0, float factor, float *x, float *z, int Float2String(c_tmax, x[n - 1], ndigits, force_fixedpoint); Output3Text(foregroundcolor, xmax - dx, 0.0, zmin - dz - 3.0 * dfont, c_tmax); + if(show_title==1){ + Output3Text(foregroundcolor, xmin, 0.0, zmax + 1.5*dz, title); + } } if(label != NULL){ float p2_color[3]; @@ -3494,7 +3497,7 @@ void DrawGenPlot(plot2ddata * plot2di){ dev_max = dev_global_max; } DrawGenCurve(option, plot2di->xyz, plot2d_size_factor, devi->times, devi->vals, devi->nvals, - highlight_time, highlight_val, dev_min, dev_max, plot2di->curve_colors+3*curve_index, label, position); + highlight_time, highlight_val, dev_min, dev_max, plot2di->curve_colors+3*curve_index, label, position, plot2di->plot_label, plot2di->show_title); position++; } } @@ -3522,7 +3525,7 @@ void DrawGenPlot(plot2ddata * plot2di){ option = PLOT_ONLY_DATA; } DrawGenCurve(option, plot2di->xyz, plot2d_size_factor, hrrinfo->vals, hrri->vals, hrri->nvals, - highlight_time, highlight_val, hrr_global_min, hrr_global_max, plot2di->curve_colors+3*curve_index, hrri->label.shortlabel, position); + highlight_time, highlight_val, hrr_global_min, hrr_global_max, plot2di->curve_colors+3*curve_index, hrri->label.shortlabel, position, plot2di->plot_label, plot2di->show_title); position++; } } diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 8db25cbbd0..98750c5736 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -39,6 +39,7 @@ #define GENPLOT_ADD_PLOT 111 #define GENPLOT_REM_PLOT 112 #define GENPLOT_SELECT_PLOT 113 +#define GENPLOT_PLOT_LABEL 114 #define PLOT2D_DEV 0 #define PLOT2D_HRR 1 @@ -75,6 +76,8 @@ char gluiopen_filter2[sizeof(GLUI_String)]; GLUI *glui_device=NULL; #ifdef pp_PLOT2D_NEW +GLUI_EditText *EDIT_plot_label = NULL; + GLUI_Button *BUTTON_add_dev=NULL ; GLUI_Button *BUTTON_add_hrr=NULL ; GLUI_Button *BUTTON_remove_curve=NULL ; @@ -89,6 +92,7 @@ GLUI_Button *BUTTON_reset_fuel_hoc = NULL; #ifdef pp_PLOT2D_NEW GLUI_Checkbox *CHECKBOX_show_genplot = NULL; +GLUI_Checkbox *CHECKBOX_show_title = NULL; #endif GLUI_Checkbox *CHECKBOX_device_1=NULL; GLUI_Checkbox *CHECKBOX_showdevice_val=NULL; @@ -122,6 +126,8 @@ GLUI_Listbox *LIST_hrrdata=NULL; GLUI_Panel *PANEL_plot1 = NULL; GLUI_Panel *PANEL_plot2 = NULL; GLUI_Panel *PANEL_plot3 = NULL; +GLUI_Panel *PANEL_plot4 = NULL; +GLUI_Panel *PANEL_plot5 = NULL; GLUI_Panel *PANEL_plotdevice_select = NULL; GLUI_Panel *PANEL_plotgeneral_device = NULL; GLUI_Panel *PANEL_plotgeneral_hrr = NULL; @@ -415,13 +421,14 @@ extern "C" void InitPlot2D(plot2ddata *plot2di, int plot_index){ plot2di->ncurve_indexes = 0; plot2di->ncurve_indexes_ini = 0; plot2di->show = 0; + plot2di->show_title = 0; plot2di->xyz[0] = xbar0FDS; plot2di->xyz[1] = ybar0FDS; plot2di->xyz[2] = zbar0FDS; plot2di->plot_index = plot_index; + sprintf(plot2di->plot_label, "plot %i", plot_index); plot2di->curve_index = 0; UpdateCurveBounds(plot2di, 1); - } /* ------------------ RemoveCurve ------------------------ */ @@ -542,6 +549,8 @@ void Plot2D2Glui(int index){ SPINNER_genplot_green->set_int_val(glui_curve_colors[1]); SPINNER_genplot_blue->set_int_val(glui_curve_colors[2]); CHECKBOX_show_genplot->set_int_val(glui_plot2dinfo->show); + EDIT_plot_label->set_text(glui_plot2dinfo->plot_label); + CHECKBOX_show_title->set_int_val(glui_plot2dinfo->show_title); } /* ------------------ AddPlot ------------------------ */ @@ -568,7 +577,7 @@ extern "C" void AddPlot(plot2ddata *plot2di){ } Plot2D2Glui(iplot2dinfo); plot2d_count++; - sprintf(label, "%i", plot2d_count); + sprintf(label, "plot %i", plot2d_count); strcpy(plot2dinfo[iplot2dinfo].plot_label, label); LIST_plots->add_item(iplot2dinfo, label); LIST_plots->set_int_val(iplot2dinfo); @@ -646,6 +655,21 @@ void UpdateDevList(GLUI_Listbox *LIST_dev, int devtype_index){ } } } + +/* ------------------ UpdatePlotList ------------------------ */ + +void UpdatePlotList(void){ + int i; + + for(i = 0; i < nplot2dinfo; i++){ + plot2ddata *plot2di; + + plot2di = plot2dinfo + i; + LIST_plots->delete_item(i); + LIST_plots->add_item(i, plot2di->plot_label); + } +} + /* ------------------ GenPlotCB ------------------------ */ void GenPlotCB(int var){ @@ -655,7 +679,6 @@ void GenPlotCB(int var){ case GENPLOT_SELECT_DEVICE: strcpy(label, "Add "); strcat(label, deviceinfo[glui_device_index].deviceID); - strcat(label, " to plot"); BUTTON_add_dev->set_name(label); break; case GENPLOT_DEVICE_TYPE: @@ -679,7 +702,6 @@ void GenPlotCB(int var){ if(BUTTON_remove_curve != NULL){ strcpy(label, "Remove "); strcat(label, LIST_plotcurves->curr_text); - strcat(label, " from plot"); BUTTON_remove_curve->set_name(label); } break; @@ -694,7 +716,6 @@ void GenPlotCB(int var){ case GENPLOT_HRR_TYPE: strcpy(label, "Add "); strcat(label, hrrinfo[glui_hrr_index].label.shortlabel); - strcat(label, " to plot"); BUTTON_add_hrr->set_name(label); break; case GENPLOT_SHOW_PLOT: @@ -706,17 +727,44 @@ void GenPlotCB(int var){ memcpy(glui_plot2dinfo->curve_colors + 3*glui_plot2dinfo->curve_index, glui_curve_colors, 3*sizeof(int)); Glui2Plot2D(iplot2dinfo); break; + case GENPLOT_PLOT_LABEL: + UpdatePlotList(); + Glui2Plot2D(iplot2dinfo); + { + int iplot2dinfo_save = iplot2dinfo; + LIST_plots->set_int_val(-1); + LIST_plots->set_int_val(iplot2dinfo_save); + } + break; case GENPLOT_SELECT_PLOT: - Plot2D2Glui(iplot2dinfo); - strcpy(label, "Remove plot "); - strcat(label, plot2dinfo[iplot2dinfo].plot_label); - BUTTON_rem_plot->set_name(label); + if(iplot2dinfo >= 0){ + Plot2D2Glui(iplot2dinfo); + strcpy(label, "Remove plot: "); + strcat(label, plot2dinfo[iplot2dinfo].plot_label); + BUTTON_rem_plot->set_name(label); + } break; case GENPLOT_ADD_PLOT: AddPlot(NULL); + { + int iplot2dinfo_save = iplot2dinfo; + LIST_plots->set_int_val(-1); + LIST_plots->set_int_val(iplot2dinfo_save); + } + strcpy(label, "Remove plot: "); + strcat(label, plot2dinfo[iplot2dinfo].plot_label); + BUTTON_rem_plot->set_name(label); break; case GENPLOT_REM_PLOT: RemovePlot(iplot2dinfo); + { + int iplot2dinfo_save = iplot2dinfo; + LIST_plots->set_int_val(-1); + LIST_plots->set_int_val(iplot2dinfo_save); + strcpy(label, "Remove plot: "); + strcat(label, plot2dinfo[iplot2dinfo].plot_label); + BUTTON_rem_plot->set_name(label); + } break; default: ASSERT(FFALSE); @@ -1210,12 +1258,19 @@ extern "C" void GluiDeviceSetup(int main_window){ CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plot1, "show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); LIST_plots->add_item(-1, ""); + EDIT_plot_label = glui_device->add_edittext_to_panel(PANEL_plot1, "title:", GLUI_EDITTEXT_TEXT, glui_plot2dinfo->plot_label, GENPLOT_PLOT_LABEL, GenPlotCB); + CHECKBOX_show_title = glui_device->add_checkbox_to_panel(PANEL_plot1, "show plot title", &(glui_plot2dinfo->show_title), GENPLOT_PLOT_LABEL, GenPlotCB); + glui_device->add_button_to_panel(PANEL_plot1, _("Apply"), GENPLOT_PLOT_LABEL, GenPlotCB); + + PANEL_plot5 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", 0); + PANEL_plot4 = glui_device->add_panel_to_panel(PANEL_plot5, "add curve to plot"); + glui_device->add_column_to_panel(PANEL_plot5, false); + if(ndevicetypes > 0){ - PANEL_plotgeneral_device = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + PANEL_plotgeneral_device = glui_device->add_panel_to_panel(PANEL_plot4, "", false); PANEL_plotdevice_select = glui_device->add_panel_to_panel(PANEL_plotgeneral_device, "", false); LIST_devID1 = glui_device->add_listbox_to_panel(PANEL_plotdevice_select, "device ID:", &glui_device_index, GENPLOT_SELECT_DEVICE, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plotdevice_select, false); - BUTTON_add_dev = glui_device->add_button_to_panel(PANEL_plotdevice_select, _("Add to plot"), GENPLOT_ADD_DEVCURVE, GenPlotCB); + BUTTON_add_dev = glui_device->add_button_to_panel(PANEL_plotdevice_select, _("Add"), GENPLOT_ADD_DEVCURVE, GenPlotCB); for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; @@ -1235,7 +1290,7 @@ extern "C" void GluiDeviceSetup(int main_window){ GenPlotCB(GENPLOT_SELECT_DEVICE); } if(nhrrinfo > 0){ - PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + PANEL_plotgeneral_hrr = glui_device->add_panel_to_panel(PANEL_plot4, "", false); LIST_hrr1 = glui_device->add_listbox_to_panel(PANEL_plotgeneral_hrr, "hrr quantity:", &glui_hrr_index, GENPLOT_HRR_TYPE, GenPlotCB); for(i = 0; i < nhrrinfo + nhrrhcinfo; i++){ hrrdata *hi; @@ -1246,19 +1301,17 @@ extern "C" void GluiDeviceSetup(int main_window){ LIST_hrr1->add_item(i, hi->label.shortlabel); } } - glui_device->add_column_to_panel(PANEL_plotgeneral_hrr, false); - BUTTON_add_hrr = glui_device->add_button_to_panel(PANEL_plotgeneral_hrr, _("Add to plot"), GENPLOT_ADD_HRRCURVE, GenPlotCB); + BUTTON_add_hrr = glui_device->add_button_to_panel(PANEL_plotgeneral_hrr, _("Add"), GENPLOT_ADD_HRRCURVE, GenPlotCB); GenPlotCB(GENPLOT_HRR_TYPE); } + glui_device->add_column_to_panel(PANEL_plot4, false); - PANEL_plot2 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + PANEL_plot2 = glui_device->add_panel_to_panel(PANEL_plot5, "remove curve from plot"); LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plot2, "plot curve:", &glui_plot2dinfo->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plot2, false); RemoveCurve(glui_plot2dinfo, -1); MakeCurveList(glui_plot2dinfo, 1); BUTTON_remove_curve = glui_device->add_button_to_panel(PANEL_plot2, _("Remove from plot"), GENPLOT_REM_CURVE, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plot2, false); - glui_device->add_button_to_panel(PANEL_plot2, _("Remove all curves from plot"), GENPLOT_REM_ALLCURVES, GenPlotCB); + glui_device->add_button_to_panel(PANEL_plot2, _("Remove all curves"), GENPLOT_REM_ALLCURVES, GenPlotCB); PANEL_plot3 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plot3, "plot position"); diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 31e54e6a8a..6f8616faae 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11448,9 +11448,9 @@ int ReadIni2(char *inifile, int localfile){ plot2di = plot2dini + i; plot2di->plot_index = i; plot2d_count++; - sprintf(plot2di->plot_label, "%i", plot2d_count); + sprintf(plot2di->plot_label, "plot %i", plot2d_count); fgets(buffer, 255, stream); - sscanf(buffer, " %f %f %f %i %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show, &plot2di->ncurve_indexes); + sscanf(buffer, " %f %f %f %i %i %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show, &plot2di->show_title, &plot2di->ncurve_indexes); for(j=0; jncurve_indexes; j++){ int color[3], *color2; @@ -11458,7 +11458,7 @@ int ReadIni2(char *inifile, int localfile){ sscanf(buffer, " %i %i %i %i", plot2di->curve_indexes + j, color, color+1, color+2); color2 = plot2di->curve_colors + 3 * plot2di->curve_indexes[j]; memcpy(color2, color, 3 * sizeof(int)); - } + } void UpdateCurveBounds(plot2ddata *plot2di, int option); UpdateCurveBounds(plot2di, 0); @@ -14826,7 +14826,7 @@ void WriteIniLocal(FILE *fileout){ int j; plot2di = plot2dinfo + i; - fprintf(fileout, " %f %f %f %i %i\n", plot2di->xyz[0], plot2di->xyz[1], plot2di->xyz[2], plot2di->show, plot2di->ncurve_indexes); + fprintf(fileout, " %f %f %f %i %i %i\n", plot2di->xyz[0], plot2di->xyz[1], plot2di->xyz[2], plot2di->show, plot2di->show_title, plot2di->ncurve_indexes); for(j = 0; j < plot2di->ncurve_indexes; j++){ int *color; diff --git a/Source/smokeview/structures.h b/Source/smokeview/structures.h index 5369079398..6fb4b78db3 100644 --- a/Source/smokeview/structures.h +++ b/Source/smokeview/structures.h @@ -1004,7 +1004,7 @@ typedef struct _plot2ddata{ float curve_min[MAX_PLOT2D_CURVES], curve_max[MAX_PLOT2D_CURVES]; int curve_colors[3*MAX_PLOT2D_CURVES]; float xyz[3]; - int show; + int show, show_title; } plot2ddata; #endif From 4dfe928c60edbcff3a1d31b2d814011d609c84d1 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 24 May 2022 12:22:12 -0400 Subject: [PATCH 17/22] smokeview source: improve 2d plot dialog layout --- Source/smokeview/glui_objects.cpp | 63 +++++++++++++++++++------------ Source/smokeview/readsmv.c | 8 +++- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 98750c5736..539f16af18 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -128,6 +128,10 @@ GLUI_Panel *PANEL_plot2 = NULL; GLUI_Panel *PANEL_plot3 = NULL; GLUI_Panel *PANEL_plot4 = NULL; GLUI_Panel *PANEL_plot5 = NULL; +GLUI_Panel *PANEL_plot6 = NULL; +GLUI_Panel *PANEL_plot7 = NULL; +GLUI_Panel *PANEL_plot8 = NULL; + GLUI_Panel *PANEL_plotdevice_select = NULL; GLUI_Panel *PANEL_plotgeneral_device = NULL; GLUI_Panel *PANEL_plotgeneral_hrr = NULL; @@ -699,11 +703,17 @@ void GenPlotCB(int var){ SPINNER_genplot_red->set_int_val(glui_curve_colors[0]); SPINNER_genplot_green->set_int_val(glui_curve_colors[1]); SPINNER_genplot_blue->set_int_val(glui_curve_colors[2]); + //xxx if(BUTTON_remove_curve != NULL){ strcpy(label, "Remove "); strcat(label, LIST_plotcurves->curr_text); BUTTON_remove_curve->set_name(label); } + if(PANEL_plotgeneral_color != NULL){ + strcpy(label, LIST_plotcurves->curr_text); + strcat(label, " color"); + PANEL_plotgeneral_color->set_name(label); + } break; case GENPLOT_REM_CURVE: RemoveCurve(glui_plot2dinfo, glui_plot2dinfo->curve_index); @@ -1248,19 +1258,28 @@ extern "C" void GluiDeviceSetup(int main_window){ if(nhrrinfo>0||ndevicetypes>0){ ROLLOUT_plotgeneral = glui_device->add_rollout_to_panel(ROLLOUT_device2Dplots, "device and/or hrr data", false); - PANEL_plot1 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); + PANEL_plot8 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", 0); + PANEL_plot6 = glui_device->add_panel_to_panel(PANEL_plot8, "plots"); + PANEL_plot1 = glui_device->add_panel_to_panel(PANEL_plot6, "", false); LIST_plots = glui_device->add_listbox_to_panel(PANEL_plot1, "select plot:", &iplot2dinfo, GENPLOT_SELECT_PLOT, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plot1, false); - BUTTON_add_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Add plot"), GENPLOT_ADD_PLOT, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plot1, false); - BUTTON_rem_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plot1, false); - CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plot1, "show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); + BUTTON_add_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Add plot"), GENPLOT_ADD_PLOT, GenPlotCB); + BUTTON_rem_plot = glui_device->add_button_to_panel(PANEL_plot1, _("Remove plot"), GENPLOT_REM_PLOT, GenPlotCB); + + glui_device->add_column_to_panel(PANEL_plot6, false); + + PANEL_plot7 = glui_device->add_panel_to_panel(PANEL_plot6, "", false); + CHECKBOX_show_genplot = glui_device->add_checkbox_to_panel(PANEL_plot7, "show plot", &(glui_plot2dinfo->show), GENPLOT_SHOW_PLOT, GenPlotCB); LIST_plots->add_item(-1, ""); - EDIT_plot_label = glui_device->add_edittext_to_panel(PANEL_plot1, "title:", GLUI_EDITTEXT_TEXT, glui_plot2dinfo->plot_label, GENPLOT_PLOT_LABEL, GenPlotCB); - CHECKBOX_show_title = glui_device->add_checkbox_to_panel(PANEL_plot1, "show plot title", &(glui_plot2dinfo->show_title), GENPLOT_PLOT_LABEL, GenPlotCB); - glui_device->add_button_to_panel(PANEL_plot1, _("Apply"), GENPLOT_PLOT_LABEL, GenPlotCB); + EDIT_plot_label = glui_device->add_edittext_to_panel(PANEL_plot7, "plot title:", GLUI_EDITTEXT_TEXT, glui_plot2dinfo->plot_label, GENPLOT_PLOT_LABEL, GenPlotCB); + glui_device->add_button_to_panel(PANEL_plot7, _("Apply plot title"), GENPLOT_PLOT_LABEL, GenPlotCB); + CHECKBOX_show_title = glui_device->add_checkbox_to_panel(PANEL_plot7, "show plot title", &(glui_plot2dinfo->show_title), GENPLOT_PLOT_LABEL, GenPlotCB); + + glui_device->add_column_to_panel(PANEL_plot8, false); + PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plot8, "plot position"); + SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); PANEL_plot5 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", 0); PANEL_plot4 = glui_device->add_panel_to_panel(PANEL_plot5, "add curve to plot"); @@ -1306,27 +1325,21 @@ extern "C" void GluiDeviceSetup(int main_window){ } glui_device->add_column_to_panel(PANEL_plot4, false); - PANEL_plot2 = glui_device->add_panel_to_panel(PANEL_plot5, "remove curve from plot"); - LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plot2, "plot curve:", &glui_plot2dinfo->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); + PANEL_plot2 = glui_device->add_panel_to_panel(PANEL_plot5, "plot curves"); + LIST_plotcurves = glui_device->add_listbox_to_panel(PANEL_plot2, "", &glui_plot2dinfo->curve_index, GENPLOT_SELECT_CURVE, GenPlotCB); RemoveCurve(glui_plot2dinfo, -1); MakeCurveList(glui_plot2dinfo, 1); BUTTON_remove_curve = glui_device->add_button_to_panel(PANEL_plot2, _("Remove from plot"), GENPLOT_REM_CURVE, GenPlotCB); glui_device->add_button_to_panel(PANEL_plot2, _("Remove all curves"), GENPLOT_REM_ALLCURVES, GenPlotCB); - PANEL_plot3 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", false); - PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plot3, "plot position"); - SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+0, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); - glui_device->add_column_to_panel(PANEL_plot3, false); - + PANEL_plot3 = glui_device->add_panel_to_panel(PANEL_plot2, "", false); PANEL_plotgeneral_color = glui_device->add_panel_to_panel(PANEL_plot3, "plot curve color"); - SPINNER_genplot_red = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "red", GLUI_SPINNER_INT, glui_curve_colors + 0, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_green = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "green", GLUI_SPINNER_INT, glui_curve_colors + 1, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_blue = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "blue", GLUI_SPINNER_INT, glui_curve_colors + 2, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_red->set_int_limits(0,255); - SPINNER_genplot_green->set_int_limits(0,255); - SPINNER_genplot_blue->set_int_limits(0,255); + SPINNER_genplot_red = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "red", GLUI_SPINNER_INT, glui_curve_colors + 0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_green = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "green", GLUI_SPINNER_INT, glui_curve_colors + 1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_blue = glui_device->add_spinner_to_panel(PANEL_plotgeneral_color, "blue", GLUI_SPINNER_INT, glui_curve_colors + 2, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_red->set_int_limits(0, 255); + SPINNER_genplot_green->set_int_limits(0, 255); + SPINNER_genplot_blue->set_int_limits(0, 255); if(nplot2dini>0){ nplot2dinfo = nplot2dini; diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index 6f8616faae..a27daab4ba 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11443,12 +11443,17 @@ int ReadIni2(char *inifile, int localfile){ for(i=0;iplot_index = i; plot2d_count++; - sprintf(plot2di->plot_label, "plot %i", plot2d_count); + fgets(buffer, 255, stream); + TrimBack(buffer); + labelptr = TrimFront(buffer); + strcpy(plot2di->plot_label, labelptr); + fgets(buffer, 255, stream); sscanf(buffer, " %f %f %f %i %i %i", plot2di->xyz, plot2di->xyz+1, plot2di->xyz+2, &plot2di->show, &plot2di->show_title, &plot2di->ncurve_indexes); for(j=0; jncurve_indexes; j++){ @@ -14826,6 +14831,7 @@ void WriteIniLocal(FILE *fileout){ int j; plot2di = plot2dinfo + i; + fprintf(fileout, " %s\n", plot2di->plot_label); fprintf(fileout, " %f %f %f %i %i %i\n", plot2di->xyz[0], plot2di->xyz[1], plot2di->xyz[2], plot2di->show, plot2di->show_title, plot2di->ncurve_indexes); for(j = 0; j < plot2di->ncurve_indexes; j++){ int *color; From a65fc464b049b0ba8791490f25034eed1c6a976b Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 24 May 2022 13:48:18 -0400 Subject: [PATCH 18/22] smokeview source: add option to use device position for 2d plot locations --- Source/smokeview/glui_objects.cpp | 35 ++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 539f16af18..221687da22 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -40,6 +40,7 @@ #define GENPLOT_REM_PLOT 112 #define GENPLOT_SELECT_PLOT 113 #define GENPLOT_PLOT_LABEL 114 +#define GENPLOT_SET_POS 115 #define PLOT2D_DEV 0 #define PLOT2D_HRR 1 @@ -78,6 +79,7 @@ GLUI *glui_device=NULL; #ifdef pp_PLOT2D_NEW GLUI_EditText *EDIT_plot_label = NULL; +GLUI_Button *BUTTON_plot_position = NULL; GLUI_Button *BUTTON_add_dev=NULL ; GLUI_Button *BUTTON_add_hrr=NULL ; GLUI_Button *BUTTON_remove_curve=NULL ; @@ -714,6 +716,20 @@ void GenPlotCB(int var){ strcat(label, " color"); PANEL_plotgeneral_color->set_name(label); } + if(BUTTON_plot_position != NULL){ + if(glui_plot2dinfo->curve_indexenable(); + strcpy(label, "Set to "); + strcat(label, LIST_plotcurves->curr_text); + strcat(label, " location"); + BUTTON_plot_position->set_name(label); + } + else{ + BUTTON_plot_position->disable(); + strcpy(label, "Set to device location"); + BUTTON_plot_position->set_name(label); + } + } break; case GENPLOT_REM_CURVE: RemoveCurve(glui_plot2dinfo, glui_plot2dinfo->curve_index); @@ -746,6 +762,18 @@ void GenPlotCB(int var){ LIST_plots->set_int_val(iplot2dinfo_save); } break; + case GENPLOT_SET_POS: + if(glui_plot2dinfo->curve_indexcurve_index].xyz; + memcpy(glui_plot2dinfo->xyz, plot_xyz, 3 * sizeof(float)); + SPINNER_genplot_x->set_float_val(plot_xyz[0]); + SPINNER_genplot_y->set_float_val(plot_xyz[1]); + SPINNER_genplot_z->set_float_val(plot_xyz[2]); + Glui2Plot2D(iplot2dinfo); + } + break; case GENPLOT_SELECT_PLOT: if(iplot2dinfo >= 0){ Plot2D2Glui(iplot2dinfo); @@ -1277,9 +1305,10 @@ extern "C" void GluiDeviceSetup(int main_window){ glui_device->add_column_to_panel(PANEL_plot8, false); PANEL_plotgeneral_position = glui_device->add_panel_to_panel(PANEL_plot8, "plot position"); - SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+0, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); - SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_x = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "x", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+0, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_y = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "y", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+1, GENPLOT_XYZ, GenPlotCB); + SPINNER_genplot_z = glui_device->add_spinner_to_panel(PANEL_plotgeneral_position, "z", GLUI_SPINNER_FLOAT, glui_plot2dinfo->xyz+2, GENPLOT_XYZ, GenPlotCB); + BUTTON_plot_position = glui_device->add_button_to_panel(PANEL_plotgeneral_position, _("Set to device location"), GENPLOT_SET_POS, GenPlotCB); PANEL_plot5 = glui_device->add_panel_to_panel(ROLLOUT_plotgeneral, "", 0); PANEL_plot4 = glui_device->add_panel_to_panel(PANEL_plot5, "add curve to plot"); From 699ad893be3b6a206c453a2b7d13ecc3d1c0db57 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 24 May 2022 13:52:34 -0400 Subject: [PATCH 19/22] smokeview source: remove unused variables --- Source/smokeview/glui_objects.cpp | 1 - Source/smokeview/readsmv.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index 221687da22..4891ee2d0e 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -612,7 +612,6 @@ void RemovePlot(int i){ iplot2dinfo = 0; for(ii = 0; ii < nplot2dinfo; ii++){ plot2ddata *plot2di; - char label[32]; plot2di = plot2dinfo + ii; LIST_plots->add_item(ii, plot2di->plot_label); diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index a27daab4ba..1576caa3d8 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -11430,9 +11430,6 @@ int ReadIni2(char *inifile, int localfile){ } #ifdef pp_PLOT2D_NEW if(Match(buffer, "SHOWGENPLOTS") == 1){ - char *token; - int count; - fgets(buffer, 255, stream); sscanf(buffer, " %i", &nplot2dini); From a05132335f10a935fa31ad4274e3032e711078e0 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 24 May 2022 16:13:17 -0400 Subject: [PATCH 20/22] smv build: revert back to icl and ifort (bugs in new icx and ifx compiler) --- Build/smokeview/Makefile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Build/smokeview/Makefile b/Build/smokeview/Makefile index d38c50fb75..9078d2bf4e 100644 --- a/Build/smokeview/Makefile +++ b/Build/smokeview/Makefile @@ -184,9 +184,15 @@ ifeq ($(GLUT),freeglut) intel_win_64_db : CFLAGS += -D FREEGLUT_STATIC endif intel_win_64_db : LFLAGS = /F32768000 /traceback /Zi /DEBUG -intel_win_64_db : CC = $(I_CC) -intel_win_64_db : CPP = $(I_CC) -intel_win_64_db : FC = $(I_IFORT) +# icx and ifx +# needed for icx -D pp_WIN_CLANG +#intel_win_64_db : CC = $(I_CC) +#intel_win_64_db : CPP = $(I_CC) +#intel_win_64_db : FC = $(I_IFORT) +intel_win_64_db : CC = icl +intel_win_64_db : CPP = icl +intel_win_64_db : FC = ifort + intel_win_64_db : exe = smokeview_win_$(SMV_TESTSTRING)64_db intel_win_64_db : $(objwin) @@ -196,7 +202,7 @@ intel_win_64_db : $(objwin) intel_win_64 : INC += $(WININC) -I $(SOURCE_DIR)/shared -I $(SOURCE_DIR)/smokeview intel_win_64 : FFLAGS = -O2 /iface:stdref /fpp -D WIN32 /fpscomp:general /stand:f18 -intel_win_64 : CFLAGS = -O1 -D pp_INTEL -D pp_WIN_CLANG -D WIN32 -D _CONSOLE -D X64 -D GLEW_STATIC -D PTW32_STATIC_LIB $(SMV_TESTFLAG) $(GITINFO) $(INTEL_COMPINFO) +intel_win_64 : CFLAGS = -O1 -D pp_INTEL -D WIN32 -D _CONSOLE -D X64 -D GLEW_STATIC -D PTW32_STATIC_LIB $(SMV_TESTFLAG) $(GITINFO) $(INTEL_COMPINFO) ifeq ($(GLUT),freeglut) intel_win_64 : CFLAGS += -D FREEGLUT_STATIC endif @@ -206,9 +212,14 @@ intel_win_64 : SMV_LIBS_WIN += $(SMV_WIN_LIBDIR)\liblua.lib intel_win_64 : SMVLUACORE_FILES += $(SMV_WIN_LIBDIR)\lpeg.dll endif intel_win_64 : LFLAGS = /F32768000 -D FREEGLUT_STATIC -intel_win_64 : CC = $(I_CC) -intel_win_64 : CPP = $(I_CC) -intel_win_64 : FC = $(I_IFORT) +# icx and ifx +# needed for icx -D pp_WIN_CLANG +#intel_win_64 : CC = $(I_CC) +#intel_win_64 : CPP = $(I_CC) +#intel_win_64 : FC = $(I_IFORT) +intel_win_64 : CC = icl +intel_win_64 : CPP = icl +intel_win_64 : FC = ifort intel_win_64 : exe = smokeview_win_$(SMV_TESTSTRING)64 intel_win_64 : $(objwin) From ad3b314f2075e16bc4c4c895ce2a6219680e35a3 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 24 May 2022 16:22:12 -0400 Subject: [PATCH 21/22] smv build: revert back to icl and ifort - Linux smokevie builds --- Build/smokeview/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Build/smokeview/Makefile b/Build/smokeview/Makefile index 9078d2bf4e..24055e2d6f 100644 --- a/Build/smokeview/Makefile +++ b/Build/smokeview/Makefile @@ -287,9 +287,9 @@ intel_linux_64 : SMVLUACORE_FILES += $(LIB_DIR_PLAT)/lpeg.so intel_linux_64 : LIBLUA += $(LIB_DIR_PLAT)/liblua.a -ldl endif intel_linux_64 : LFLAGS = -m64 $(INTEL_LIBS_LINUX) $(SMV_PROFILEFLAG) -intel_linux_64 : CC = $(I_ICC) -intel_linux_64 : CPP = $(I_ICPP) -intel_linux_64 : FC = $(I_IFORT) +intel_linux_64 : CC = icc +intel_linux_64 : CPP = icpc +intel_linux_64 : FC = ifort intel_linux_64 : exe = smokeview_linux_$(SMV_TESTSTRING)64$(SMV_PROFILESTRING) intel_linux_64 : $(obj) $(if $(LUA_SCRIPTING),smvluacore) @@ -302,9 +302,9 @@ intel_linux_64_db : CFLAGS = -O0 -g -m64 $(SMV_TESTFLAG) -D _DEBUG -D pp_LINU -Wall -Wextra -Wuninitialized -Wunused-function -Wunused-variable -Wno-sign-compare \ -Wno-unused-parameter $(GITINFO) $(INTEL_COMPINFO) intel_linux_64_db : LFLAGS = -m64 -static-intel $(INTEL_LIBS_LINUX) $(SMV_PROFILEFLAG) -intel_linux_64_db : CC = $(I_ICC) -intel_linux_64_db : CPP = $(I_ICPP) -intel_linux_64_db : FC = $(I_IFORT) +intel_linux_64_db : CC = icc +intel_linux_64_db : CPP = icpc +intel_linux_64_db : FC = ifort intel_linux_64_db : exe = smokeview_linux_$(SMV_TESTSTRING)64_db$(SMV_PROFILESTRING) intel_linux_64_db : $(obj) From 838acb29543a7fd7346379e7fdd5ba1cced64844 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 24 May 2022 16:55:07 -0400 Subject: [PATCH 22/22] smv vv: correct ini files for wind_test2 case so that device arrows and device profiles display properly --- Verification/WUI/wind_test2.ssf | 2 - Verification/WUI/wind_test2_arrow.ini | 114 ++++++++++++----------- Verification/WUI/wind_test2_profile.ini | 116 +++++++++++++----------- 3 files changed, 127 insertions(+), 105 deletions(-) diff --git a/Verification/WUI/wind_test2.ssf b/Verification/WUI/wind_test2.ssf index 76b62bcf8e..ebaec00d4f 100644 --- a/Verification/WUI/wind_test2.ssf +++ b/Verification/WUI/wind_test2.ssf @@ -8,8 +8,6 @@ ZSCENECLIP 0 -0.025000 0 25.025000 SCENECLIP 0 -LOADSLCF - QUANTITY='TEMPERATURE' PBX=0.0 LOADINIFILE wind_test2_arrow.ini SETTIMEVAL diff --git a/Verification/WUI/wind_test2_arrow.ini b/Verification/WUI/wind_test2_arrow.ini index 7714465217..26ec8679b6 100644 --- a/Verification/WUI/wind_test2_arrow.ini +++ b/Verification/WUI/wind_test2_arrow.ini @@ -1,4 +1,4 @@ -# NIST Smokeview configuration file, Release Dec 9 2020 +# NIST Smokeview configuration file, Release May 24 2022 ------------ global ini settings ------------ @@ -101,6 +101,9 @@ SPRINKONCOLOR 0.000000 1.000000 0.000000 STATICPARTCOLOR 0.000000 1.000000 0.000000 +SURFCOLORS + 1 0 + 121 116 48 : GRASS TIMEBARCOLOR 0.600000 0.600000 0.600000 VENTCOLOR @@ -129,7 +132,7 @@ SENSORABSSIZE SENSORRELSIZE 1.000000 SLICEOFFSET - 0.100000 0.000000 + 0.100000 0.000000 1 SMOOTHLINES 1 SPHERESEGS @@ -163,14 +166,10 @@ WINDOWHEIGHT *** DATA LOADING *** -BOUNDZIPSTEP - 1 FED 0 FEDCOLORBAR FED -ISOZIPSTEP - 1 LOADINC 0 NOPART @@ -180,19 +179,19 @@ PARTFAST PERCENTILEMODE 0 RESEARCHMODE - 0 1 1.000000 4 + 0 1 1.000000 4 0 4 0 0 SHOWFEDAREA 1 SLICEAVERAGE 0 10.000000 0 +SMOKELOAD + 0 1 SLICEDATAOUT 0 -SLICEZIPSTEP - 1 -SMOKE3DZIPSTEP - 1 USER_ROTATE - 0 0 0.250000 0.250000 0.500000 + -3 0 0.250000 0.250000 0.500000 +ZIPSTEP + 1 *** VIEW PARAMETERS *** @@ -221,7 +220,7 @@ EYEVIEW EYEX 0.500000 EYEY - -1.327817 + -1.267462 EYEZ 0.500000 FONTSIZE @@ -234,24 +233,20 @@ FREEZEVOLSMOKE 0 1 GEOMBOUNDARYPROPS 1 0 0 5.000000 5.000000 1 +SHOWSLICEVALS + 0 0 0 GEOMCELLPROPS 2 2 2 2 - 1 0 1 + 1 0 1 5.000000 1 0 1 0 0 0 0 0 0 -GEOMDIAGS - 1 0 0 0 0 0 0 GEOMDOMAIN 1 1 -GEOMOFFSET - 0.000000 0.000000 0.000000 0 GEOMSHOW - 0 1 1 0 1 0 0.500000 2.000000 + 0 1 1 0 1 0 0.500000 2.000000 1 0 6.000000 0.001000 0.010000 0 0 1 0 - 1.000000 30.000000 -GEOMSLICEPROPS - 5.000000 5.000000 + 1.000000 30.000000 0 0 2 0 GVERSION 0 GVECDOWN @@ -275,6 +270,8 @@ P3DSURFACETYPE 1 P3DSURFACESMOOTH 1 +PLOT2DHRRBOUNDS + 0 0.000000 0 1.000000 PROJECTION 0 SCALEDFONT @@ -314,6 +311,8 @@ SHOWFRAME 0 SHOWFRAMELABEL 0 +SHOWFRAMETIMELABEL + 1 SHOWFRAMERATE 0 SHOWGRID @@ -386,8 +385,6 @@ SLICEDUP 1 0 1 SMOKESENSORS 1 0 -SMOKETYPE - 0 1 0.100000 1.000000 1 0 1 STARTUPLANG en STEREO @@ -403,7 +400,7 @@ TITLESAFE TRAINERVIEW 1 TRANSPARENT - 1 0.000000 1 1 + 1 0.800000 1 1 TREEPARMS 3 0 1 1 TWOSIDEDVENTS @@ -435,7 +432,7 @@ ZOOM *** MISC *** -CELLCENTERTEXT +SHOWSLICEVALS 0 INPUT_FILE wind_test2.fds @@ -446,12 +443,14 @@ RENDERCLIP RENDERFILELABEL 0 RENDERFILETYPE - 0 0 + 0 0 2 MOVIEFILETYPE MOVIEFILETYPE 0 10 5000 1 17 +MOVIEPARMS + 0 10 0 RENDEROPTION - 993 1 512 + 993 2 512 UNITCLASSES 6 0 @@ -465,8 +464,6 @@ SHOWGRAVVECTOR *** 3D SMOKE INFO *** -ADJUSTALPHA - 2 COLORBARTYPE 0 % Rainbow CO2COLORMAP @@ -479,18 +476,21 @@ FIRECOLORMAP 0 8 FIREDEPTH 2.000000 10.000000 10.000000 0 +HRRPUVCUTOFF + 20.000000 SHOWEXTREMEDATA 0 0 0 +SLICESKIP + 1 1 1 1 SMOKECOLOR - 0 0 0 + 0 0 0 1 SMOKECULL 0 -SLICESKIP - 1 1 1 1 +SMOKEFIREPROP + 0 1SMOKEPROP +8700.000000 SMOKESKIP 0 1 1 1 1 -SMOKERTHICK - 1.000000 USEGPU 0 VOLSMOKE @@ -533,7 +533,7 @@ VIEWALLTOURS VIEWTIMES 0.000000 60.000000 1000 VIEWTOURFROMPATH - 0 + 0 0 0.000000 ------------ local ini settings ------------ @@ -572,7 +572,7 @@ SHOOTER 10 1 100 0 0 1.000000 1.000000 SHOWDEVICES - 8 + 8 0 0 sensor human_fixed human_altered_with_data @@ -582,24 +582,28 @@ SHOWDEVICES airpack helmit SHOWDEVICEPLOTS - 0 1 0.500000 1.000000 10.000000 + 0 1 0.500000 1.000000 10.000000 0.000000 0.000000 0.000000 1.200000 SHOWDEVICEVALS 0 1 0 1 1 0 1 1 0 -SHOWMISSINGOBJECTS +SHOWHRRPLOT + 1 0 17700.000000 0.500000 0SHOWMISSINGOBJECTS 1 +SHOWSLICEPLOT + 0.000000 0.000000 0.000000 0.500000 0 1 SMOKE3DCUTOFFS 1.000000 20.000000 SHOWGEOMTERRAIN 0 1 0 0 0 TOURCIRCLE -25.000000 0.000000 12.500000 25.000000 0.000000 12.500000 93.686935 0.000000TOURINDEX +25.000000 0.000000 12.500000 25.000000 0.000000 12.500000 93.686935 0.000000 +TOURINDEX -1 TOURS 1 Tour 2 2 1 0.000000 0 1 - 0.0 -1.0 -26.0 1000.0 0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 - 60.0 51.0 26.0 1000.0 0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 + 0.0 -1.0 -26.0 1000.000061 1 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 + 60.0 51.0 26.0 1000.000061 1 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 USERTICKS 0 1 5 1 1 1 1.000000 1 0.000000 -25.000000 0.000000 @@ -634,6 +638,10 @@ C_PLOT3D 4 0 1.000000 0 0.000000 5 0 1.000000 0 0.000000 6 0 168.501999 0 168.501999 +C_SLICE + 1 10000.000000 0 0.000000 temp +C_SLICE + 0 1.000000 0 0.000000 vel CACHE_DATA 1 1 1 1 PATCHDATAOUT @@ -657,11 +665,15 @@ V2_BOUNDARY V2_PLOT3D 6 1 3 1.000000 3 1.000000 temp - 2 3 1.000000 3 1.000000 temp - 3 3 1.000000 3 1.000000 temp - 4 3 1.000000 3 1.000000 temp - 5 3 1.000000 3 1.000000 temp - 6 3 1.000000 3 1.000000 temp + 2 3 1.000000 3 1.000000 U-VEL + 3 3 1.000000 3 1.000000 V-VEL + 4 3 1.000000 3 1.000000 W-VEL + 5 3 1.000000 3 1.000000 hrrpuv + 6 3 1.000000 3 1.000000 Speed +V2_SLICE + 3 19.998985 3 20.054371 temp : 0.000000 1.000000 1 +V2_SLICE + 0 0.000000 0 7.589950 vel : 0.000000 1.000000 1 V_TARGET 0 1.000000 0 0.000000 VIEWPOINT5 @@ -709,10 +721,10 @@ VIEWPOINT5 # ------------------------- # Smokeview Version: Test -# Smokeview Build: SMV6.7.15-407-g772b78239-dirty-master -# Smokeview Build Date: Dec 9 2020 -# FDS Version: FDS6.7.5-665-g1be04f8af-nightly -# FDS Build: FDS6.7.5-665-g1be04f8af-nightly +# Smokeview Build: unknown +# Smokeview Build Date: May 24 2022 +# FDS Version: FDS6.7.7-1225-g552c16b0c-master +# FDS Build: FDS6.7.7-1225-g552c16b0c-master # Platform: WIN64 diff --git a/Verification/WUI/wind_test2_profile.ini b/Verification/WUI/wind_test2_profile.ini index ec5ed7272d..15eaebdcef 100644 --- a/Verification/WUI/wind_test2_profile.ini +++ b/Verification/WUI/wind_test2_profile.ini @@ -1,4 +1,4 @@ -# NIST Smokeview configuration file, Release Dec 9 2020 +# NIST Smokeview configuration file, Release May 24 2022 ------------ global ini settings ------------ @@ -101,6 +101,9 @@ SPRINKONCOLOR 0.000000 1.000000 0.000000 STATICPARTCOLOR 0.000000 1.000000 0.000000 +SURFCOLORS + 1 0 + 121 116 48 : GRASS TIMEBARCOLOR 0.600000 0.600000 0.600000 VENTCOLOR @@ -129,7 +132,7 @@ SENSORABSSIZE SENSORRELSIZE 1.000000 SLICEOFFSET - 0.100000 0.000000 + 0.100000 0.000000 1 SMOOTHLINES 1 SPHERESEGS @@ -163,14 +166,10 @@ WINDOWHEIGHT *** DATA LOADING *** -BOUNDZIPSTEP - 1 FED 0 FEDCOLORBAR FED -ISOZIPSTEP - 1 LOADINC 0 NOPART @@ -180,19 +179,19 @@ PARTFAST PERCENTILEMODE 0 RESEARCHMODE - 0 1 1.000000 4 + 0 1 1.000000 4 0 4 0 0 SHOWFEDAREA 1 SLICEAVERAGE 0 10.000000 0 +SMOKELOAD + 0 1 SLICEDATAOUT 0 -SLICEZIPSTEP - 1 -SMOKE3DZIPSTEP - 1 USER_ROTATE - 0 0 0.250000 0.250000 0.500000 + -3 0 0.250000 0.250000 0.500000 +ZIPSTEP + 1 *** VIEW PARAMETERS *** @@ -221,7 +220,7 @@ EYEVIEW EYEX 0.500000 EYEY - -1.327817 + -1.267462 EYEZ 0.500000 FONTSIZE @@ -234,24 +233,20 @@ FREEZEVOLSMOKE 0 1 GEOMBOUNDARYPROPS 1 0 0 5.000000 5.000000 1 +SHOWSLICEVALS + 0 0 0 GEOMCELLPROPS 2 2 2 2 - 1 0 1 + 1 0 1 5.000000 1 0 1 0 0 0 0 0 0 -GEOMDIAGS - 1 0 0 0 0 0 0 GEOMDOMAIN 1 1 -GEOMOFFSET - 0.000000 0.000000 0.000000 0 GEOMSHOW - 0 1 1 0 1 0 0.500000 2.000000 + 0 1 1 0 1 0 0.500000 2.000000 1 0 6.000000 0.001000 0.010000 0 0 1 0 - 1.000000 30.000000 -GEOMSLICEPROPS - 5.000000 5.000000 + 1.000000 30.000000 0 0 2 0 GVERSION 0 GVECDOWN @@ -275,6 +270,8 @@ P3DSURFACETYPE 1 P3DSURFACESMOOTH 1 +PLOT2DHRRBOUNDS + 0 0.000000 0 1.000000 PROJECTION 0 SCALEDFONT @@ -314,6 +311,8 @@ SHOWFRAME 0 SHOWFRAMELABEL 0 +SHOWFRAMETIMELABEL + 1 SHOWFRAMERATE 0 SHOWGRID @@ -386,8 +385,6 @@ SLICEDUP 1 0 1 SMOKESENSORS 1 0 -SMOKETYPE - 0 1 0.100000 1.000000 1 0 1 STARTUPLANG en STEREO @@ -403,7 +400,7 @@ TITLESAFE TRAINERVIEW 1 TRANSPARENT - 1 0.000000 1 1 + 1 0.800000 1 1 TREEPARMS 3 0 1 1 TWOSIDEDVENTS @@ -435,7 +432,7 @@ ZOOM *** MISC *** -CELLCENTERTEXT +SHOWSLICEVALS 0 INPUT_FILE wind_test2.fds @@ -446,12 +443,14 @@ RENDERCLIP RENDERFILELABEL 0 RENDERFILETYPE - 0 0 + 0 0 2 MOVIEFILETYPE MOVIEFILETYPE 0 10 5000 1 17 +MOVIEPARMS + 0 10 0 RENDEROPTION - 993 1 512 + 993 2 512 UNITCLASSES 6 0 @@ -465,8 +464,6 @@ SHOWGRAVVECTOR *** 3D SMOKE INFO *** -ADJUSTALPHA - 2 COLORBARTYPE 0 % Rainbow CO2COLORMAP @@ -479,18 +476,21 @@ FIRECOLORMAP 0 8 FIREDEPTH 2.000000 10.000000 10.000000 0 +HRRPUVCUTOFF + 20.000000 SHOWEXTREMEDATA 0 0 0 +SLICESKIP + 1 1 1 1 SMOKECOLOR - 0 0 0 + 0 0 0 1 SMOKECULL 0 -SLICESKIP - 1 1 1 1 +SMOKEFIREPROP + 0 1SMOKEPROP +8700.000000 SMOKESKIP 0 1 1 1 1 -SMOKERTHICK - 1.000000 USEGPU 0 VOLSMOKE @@ -533,7 +533,7 @@ VIEWALLTOURS VIEWTIMES 0.000000 60.000000 1000 VIEWTOURFROMPATH - 0 + 0 0 0.000000 ------------ local ini settings ------------ @@ -572,7 +572,7 @@ SHOOTER 10 1 100 0 0 1.000000 1.000000 SHOWDEVICES - 8 + 8 0 0 sensor human_fixed human_altered_with_data @@ -582,24 +582,28 @@ SHOWDEVICES airpack helmit SHOWDEVICEPLOTS - 0 1 0.500000 1.000000 10.000000 + 0 1 0.500000 1.000000 10.000000 0.000000 0.000000 0.000000 1.200000 SHOWDEVICEVALS 0 1 0 1 3 0 1 1 0 -SHOWMISSINGOBJECTS +SHOWHRRPLOT + 1 0 17700.000000 0.500000 0SHOWMISSINGOBJECTS 1 +SHOWSLICEPLOT + 0.000000 0.000000 0.000000 0.500000 0 1 SMOKE3DCUTOFFS 1.000000 20.000000 SHOWGEOMTERRAIN 0 1 0 0 0 TOURCIRCLE -25.000000 0.000000 12.500000 25.000000 0.000000 12.500000 93.686935 0.000000TOURINDEX - 1 +25.000000 0.000000 12.500000 25.000000 0.000000 12.500000 93.686935 0.000000 +TOURINDEX + -1 TOURS 1 Tour 2 2 1 0.000000 0 1 - 0.0 -1.0 -26.0 1000.0 0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 - 60.0 51.0 26.0 1000.0 0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 + 0.0 -1.0 -26.0 1000.000061 1 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 + 60.0 51.0 26.0 1000.000061 1 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0 USERTICKS 0 1 5 1 1 1 1.000000 1 0.000000 -25.000000 0.000000 @@ -634,6 +638,10 @@ C_PLOT3D 4 0 1.000000 0 0.000000 5 0 1.000000 0 0.000000 6 0 168.501999 0 168.501999 +C_SLICE + 1 10000.000000 0 0.000000 temp +C_SLICE + 0 1.000000 0 0.000000 vel CACHE_DATA 1 1 1 1 PATCHDATAOUT @@ -657,11 +665,15 @@ V2_BOUNDARY V2_PLOT3D 6 1 3 1.000000 3 1.000000 temp - 2 3 1.000000 3 1.000000 temp - 3 3 1.000000 3 1.000000 temp - 4 3 1.000000 3 1.000000 temp - 5 3 1.000000 3 1.000000 temp - 6 3 1.000000 3 1.000000 temp + 2 3 1.000000 3 1.000000 U-VEL + 3 3 1.000000 3 1.000000 V-VEL + 4 3 1.000000 3 1.000000 W-VEL + 5 3 1.000000 3 1.000000 hrrpuv + 6 3 1.000000 3 1.000000 Speed +V2_SLICE + 3 19.998985 3 20.054371 temp : 0.000000 1.000000 1 +V2_SLICE + 0 0.000000 0 7.589950 vel : 0.000000 1.000000 1 V_TARGET 0 1.000000 0 0.000000 VIEWPOINT5 @@ -709,10 +721,10 @@ VIEWPOINT5 # ------------------------- # Smokeview Version: Test -# Smokeview Build: SMV6.7.15-407-g772b78239-dirty-master -# Smokeview Build Date: Dec 9 2020 -# FDS Version: FDS6.7.5-665-g1be04f8af-nightly -# FDS Build: FDS6.7.5-665-g1be04f8af-nightly +# Smokeview Build: unknown +# Smokeview Build Date: May 24 2022 +# FDS Version: FDS6.7.7-1225-g552c16b0c-master +# FDS Build: FDS6.7.7-1225-g552c16b0c-master # Platform: WIN64