Skip to content

Commit

Permalink
2012 flight commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsteve committed Nov 10, 2014
1 parent c51afa5 commit c91554f
Show file tree
Hide file tree
Showing 19 changed files with 799 additions and 467 deletions.
92 changes: 68 additions & 24 deletions Application.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

extern Gui *gui;

unsigned int CountcurveFunction[MAX_CHANNEL];

extern int stop_message;
extern FILE *dataFile;
extern int fout;
Expand All @@ -36,10 +34,12 @@ extern char dataFileDir[MAXPATH];
int file_type;
char *data_file_save_dir;
int read_delay;
int data_source; // 0 means simulation, 1 means ASIC, 2 means Formatter
int data_source; // 0 means simulation, 1 means ASIC, 2 means Formatter, 3 means Formatter playback file
int mainImage_minimum;
int newFPGA_register;
char *formatter_configuration_file;
char *formatter_playback_file;
char read_filename[100];

//extern int mainHistogram_binsize;

Expand All @@ -53,14 +53,60 @@ Application::Application()
bad_check_sum_count = 0;
no_trigger_count = 0;
formatter_start_time = 0;
number_of_temperature_sensors = 12;

char *formatter_playback_file;

// temperature limits for the temperature sensors
// if these limits are exceeded the display background turns red
// power board
temperature_limits_low[0] = -5.0;
temperature_limits_hi[0] = 40;
// actel on formatter board
temperature_limits_low[1] = -5.0;
temperature_limits_hi[1] = 35;
// clock on formatter board
temperature_limits_low[2] = -5.0;
temperature_limits_hi[2] = 50;
// actel on actel board
temperature_limits_low[3] = 0.0;
temperature_limits_hi[3] = 50;
// actel board
temperature_limits_low[4] = -5.0;
temperature_limits_hi[4] = 35;
// detector 6
temperature_limits_low[5] = -5.0;
temperature_limits_hi[5] = 35;
// detector 3
temperature_limits_low[6] = -40.0;
temperature_limits_hi[6] = 35;
// detector 4
temperature_limits_low[7] = -40.0;
temperature_limits_hi[7] = 35;
// detector 1
temperature_limits_low[8] = -40.0;
temperature_limits_hi[8] = 35;
// focal plane (near det 3)
temperature_limits_low[9] = -40.0;
temperature_limits_hi[9] = 35;
// detector 0
temperature_limits_low[10] = -40.0;
temperature_limits_hi[10] = 35;

temperature_limits_low[11] = -40.0;
temperature_limits_hi[11] = 35;

// the voltages should read to within 5% of their nominal values
// if not display background turns red
voltage_tolerance = 0.05;
}

int Application::get_data_source(void){
return data_source;
}

void Application::set_data_source(int value){
if ((data_source == 0) || (data_source == 1) || (data_source == 2)){
if ((data_source == 0) || (data_source == 1) || (data_source == 2) || (data_source == 3)){
data_source = value;
}
}
Expand All @@ -73,12 +119,7 @@ void Application::flush_histogram(void)

void Application::flush_timeseries(void)
{
// Zero the time series
for(int i = 0;i < MAX_CHANNEL; i++)
{
CountcurveFunction[i] = 0;
}
gui->mainLightcurveWindow->redraw();
gui->mainLightcurveWindow->flush(7);
}

void Application::flush_image(void)
Expand Down Expand Up @@ -138,7 +179,7 @@ void Application::set_gsesync_file(void)
char *temp = fl_file_chooser("Pick gsesync", "", 0);
strcpy(formatter_configuration_file, temp);
gui->gsesyncfile_fileInput->value(formatter_configuration_file);
printf_to_console("Output directory set to %s.\n", formatter_configuration_file, NULL);
printf_to_console("Formatter config file set to %s.\n", formatter_configuration_file, NULL);
}

void Application::start_file()
Expand All @@ -152,17 +193,15 @@ void Application::write_header(FILE *file)
}

// the method that gets executed when the readFile callback is called
void Application::readFile()
void Application::read_file()
{
// launch file browser
char *file = fl_file_chooser("Pick a file from this list:", "*.*", "");
if(file == NULL)
return;
if(file == NULL){ return; }

cout << "Loading File:" << file << endl;

//store image name
//strcpy(filename,file);
strcpy(read_filename,file);
printf_to_console("Opening file %s for reading.\n", read_filename, NULL);
flush_image();
flush_histogram();

Expand All @@ -177,13 +216,22 @@ void Application::initialize(void)
gui->closeBut->activate();
}

void Application::flush_all(void)
{
flush_image();
flush_histogram();
flush_timeseries();
reset_read_counter();
}

void Application::close_data(void)
{
// Close a connection to a data stream
gui->usb->close();
gui->initializeBut->activate();
gui->closeBut->deactivate();
gui->startReadingDataButton->deactivate();
data_close();
}

void Application::start_reading_data(void)
Expand Down Expand Up @@ -289,7 +337,7 @@ void Application::stop_reading_data(void)

void Application::reset_read_counter(void)
{
gui->nEventsDone->value(0);
//gui->nEventsDone->value(0);

frame_display_count = 0;
frame_miss_count = 0;
Expand All @@ -306,12 +354,6 @@ void Application::update_histogrambinsize(void)
gui->mainHistogramWindow->redraw();
}

void Application::update_timebinsize(void)
{
// mainHistogram_binsize = gui->binsize_counter->value();
gui->mainLightcurveWindow->binsize[0] = gui->timebinsize_counter->value();
}

void Application::update_lightcurvexmax(void)
{
gui->mainLightcurveWindow->set_xmax(gui->lightcurvexmax_counter->value());
Expand Down Expand Up @@ -408,6 +450,8 @@ void Application::toggle_detector_display(void)
gui->mainHistogramWindow->update_detector_display(gui->detector4_checkbox->value(), 4);
gui->mainHistogramWindow->update_detector_display(gui->detector5_checkbox->value(), 5);
gui->mainHistogramWindow->update_detector_display(gui->detector6_checkbox->value(), 6);
gui->mainHistogramWindow->update_detector_display(gui->detectorAll_checkbox->value(), 7);


gui->mainHistogramWindow->redraw();
gui->mainImageWindow->redraw();
Expand Down
12 changes: 9 additions & 3 deletions Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Application {
// open the data file for saving data
// executed when someone clicks on "Write to File" Button
void start_file(void);
void read_file(void);
void write_header(FILE *file);
//void set_datafile_dir(void);

Expand Down Expand Up @@ -98,8 +99,10 @@ class Application {
void save_image_to_file(void);
void set_lightcurve_ymax(void);
void set_gsesync_file(void);
void set_formatter_playback_file(void);
void toggle_show_mask(void);
void toggle_detector_display(void);
void flush_all(void);
int elapsed_time_sec;
void set_imagemax(void);
void set_histogram_max(void);
Expand All @@ -116,13 +119,16 @@ class Application {
void set_data_source(int value);
uint32_t frame_number;

float temperature_limits_low[13];
float temperature_limits_hi[13];
float voltage_tolerance;
int number_of_temperature_sensors;

private:
int data_source;
char filename[40];
float pixel_half_life;
static void *read_data(void *variable); // Begin reading data from a data stream
static void *auto_run_sequence(void *variable); // auto-run sequence of acquisitions with varying hold times

};
};

#endif
24 changes: 9 additions & 15 deletions FOXSI_GSE.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 45;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -19,7 +19,6 @@
86E4A44D138C2B900004DBB3 /* mainHistogram.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 86E4A441138C2B900004DBB3 /* mainHistogram.cxx */; };
86E4A44E138C2B900004DBB3 /* mainImage.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 86E4A443138C2B900004DBB3 /* mainImage.cxx */; };
86E4A44F138C2B900004DBB3 /* mainLightcurve.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 86E4A445138C2B900004DBB3 /* mainLightcurve.cxx */; };
86E4A450138C2B900004DBB3 /* subImage.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 86E4A447138C2B900004DBB3 /* subImage.cxx */; };
86E4A451138C2B900004DBB3 /* UsefulFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86E4A449138C2B900004DBB3 /* UsefulFunctions.cpp */; };
86E4A453138C2BA40004DBB3 /* gui.fl in Sources */ = {isa = PBXBuildFile; fileRef = 86E4A452138C2BA40004DBB3 /* gui.fl */; };
86E4A499138C2DCC0004DBB3 /* icons.icns in Resources */ = {isa = PBXBuildFile; fileRef = 86E4A498138C2DCC0004DBB3 /* icons.icns */; };
Expand Down Expand Up @@ -77,8 +76,6 @@
86E4A444138C2B900004DBB3 /* mainImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mainImage.h; sourceTree = "<group>"; };
86E4A445138C2B900004DBB3 /* mainLightcurve.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mainLightcurve.cxx; sourceTree = "<group>"; };
86E4A446138C2B900004DBB3 /* mainLightcurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mainLightcurve.h; sourceTree = "<group>"; };
86E4A447138C2B900004DBB3 /* subImage.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = subImage.cxx; sourceTree = "<group>"; };
86E4A448138C2B900004DBB3 /* subImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = subImage.h; sourceTree = "<group>"; };
86E4A449138C2B900004DBB3 /* UsefulFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UsefulFunctions.cpp; sourceTree = "<group>"; };
86E4A44A138C2B900004DBB3 /* UsefulFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UsefulFunctions.h; sourceTree = "<group>"; };
86E4A452138C2BA40004DBB3 /* gui.fl */ = {isa = PBXFileReference; explicitFileType = sourcecode.fluid; fileEncoding = 4; path = gui.fl; sourceTree = "<group>"; };
Expand Down Expand Up @@ -195,8 +192,6 @@
86E4A445138C2B900004DBB3 /* mainLightcurve.cxx */,
86E4A446138C2B900004DBB3 /* mainLightcurve.h */,
86739EAA138C7B0600D6C498 /* WinTypes.h */,
86E4A447138C2B900004DBB3 /* subImage.cxx */,
86E4A448138C2B900004DBB3 /* subImage.h */,
AD84A8FC148B264400A65724 /* data.h */,
AD84A8FB148B264400A65724 /* data.cpp */,
86E4A44A138C2B900004DBB3 /* UsefulFunctions.h */,
Expand Down Expand Up @@ -267,11 +262,8 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FOXSI_GSE" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
knownRegions = (
English,
Expand Down Expand Up @@ -312,7 +304,6 @@
86E4A44D138C2B900004DBB3 /* mainHistogram.cxx in Sources */,
86E4A44E138C2B900004DBB3 /* mainImage.cxx in Sources */,
86E4A44F138C2B900004DBB3 /* mainLightcurve.cxx in Sources */,
86E4A450138C2B900004DBB3 /* subImage.cxx in Sources */,
86E4A451138C2B900004DBB3 /* UsefulFunctions.cpp in Sources */,
86E4A453138C2BA40004DBB3 /* gui.fl in Sources */,
86739DDA138C708900D6C498 /* usbd2xx.cpp in Sources */,
Expand Down Expand Up @@ -346,6 +337,7 @@
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -364,7 +356,7 @@
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
PRODUCT_NAME = FOXSI_GSE;
SDKROOT = macosx;
SDKROOT = macosx10.5;
STRINGS_FILE_OUTPUT_ENCODING = "UTF-8";
VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64";
};
Expand Down Expand Up @@ -393,7 +385,7 @@
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
PRODUCT_NAME = FOXSI_GSE;
SDKROOT = macosx;
SDKROOT = macosx10.5;
STRINGS_FILE_OUTPUT_ENCODING = "UTF-8";
VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64";
};
Expand All @@ -411,7 +403,8 @@
LIBRARY_SEARCH_PATHS = "";
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "";
SDKROOT = macosx;
PREBINDING = NO;
SDKROOT = macosx10.6;
USER_HEADER_SEARCH_PATHS = "";
};
name = Debug;
Expand All @@ -423,7 +416,8 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = macosx;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Release;
};
Expand Down
12 changes: 6 additions & 6 deletions GSE Bug List.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

\f0\fs24 \cf0 Bug Tracker\
\
check common mode subtraction\
figure out count rate\
\
moving data_source into app settings\
\
trying to get rid of all global variables\
\
changing the detector to display for the histogram does not seem to display correct one\
all detector displays disapears with small amount of data, hitting flush restores it, displays gets pushed all the way to the right, \
\
detector display numbers disapear sometimes on multi histogram plot\
\
increasing the min threshold to max value does not allow one to decrease it after that \
add ability to read gsetest data file\
\
integration time subtraction does not work}
add temperature display as a function of time\
only update housekeeping every x seconds}
Binary file modified YSI44031.xls
Binary file not shown.
Loading

0 comments on commit c91554f

Please sign in to comment.