diff --git a/CMakeLists.txt b/CMakeLists.txt index 45742f8..c5633fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ source_group(QtUI FILES ${SRC_UI}) cuda_add_executable(IMie ${SRC_CPP} ${SRC_H} ${UI_H} ${UI_MOC} ${ALL_RCC} ${SRC_CU}) #set the link libraries -target_link_libraries(IMie ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY}) +target_link_libraries(IMie ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLEW_LIBRARY}) diff --git a/EstimateMaterial.cpp b/EstimateMaterial.cpp index 5ddd887..a068c18 100644 --- a/EstimateMaterial.cpp +++ b/EstimateMaterial.cpp @@ -1,4 +1,5 @@ #include "globals.h" +#include #define PI 3.14159 double CalculateError(double* E) diff --git a/FileIO.cpp b/FileIO.cpp index 979f8b8..50c5a34 100644 --- a/FileIO.cpp +++ b/FileIO.cpp @@ -110,6 +110,7 @@ void SaveN(string fileName) void SaveSimulation(string fileName) { ofstream outFile(fileName.c_str()); + outFile.precision(10); for(unsigned int i=0; i using namespace std; @@ -34,17 +35,7 @@ static char PDTypeNames[][255] = { //end my stuff }; - -//------------------------------------------------------------------------------- - -//#ifdef DISPLAY -// #define PERFORMANCE_DATA_MEASUE_ENABLE -//#endif - -//#ifdef PERFORMANCE_DATA_MEASUE_ENABLE - -//------------------------------------------------------------------------------- - +#ifdef WIN32 #include #include #include @@ -72,7 +63,7 @@ public: } } - void StartTimer( int type ) { QueryPerformanceCounter( &startTime[type] ); /*startTime[type] = GetTickCount();*/ } + void StartTimer( int type ) { QueryPerformanceCounter( &startTime[type] );} void EndTimer( int type ) { LARGE_INTEGER endTime; QueryPerformanceCounter( &endTime ); @@ -122,7 +113,7 @@ private: }; //------------------------------------------------------------------------------- -/*#else +#else class PerformanceData{ public: @@ -141,7 +132,7 @@ public: #endif //------------------------------------------------------------------------------- -*/ + extern PerformanceData PD; //------------------------------------------------------------------------------- diff --git a/SimulateSpectrum.cpp b/SimulateSpectrum.cpp index 6948811..bcd5fb6 100644 --- a/SimulateSpectrum.cpp +++ b/SimulateSpectrum.cpp @@ -3,6 +3,7 @@ #include #include #include "globals.h" +#include //#include "cufft.h" using namespace std; @@ -10,9 +11,9 @@ using namespace std; typedef complex scComplex; -int cbessjyva(double v,complex z,double &vm,complex*cjv, +extern int cbessjyva(double v,complex z,double &vm,complex*cjv, complex*cyv,complex*cjvp,complex*cyvp); -int bessjyv(double v,double x,double &vm,double *jv,double *yv, +extern int bessjyv(double v,double x,double &vm,double *jv,double *yv, double *djv,double *dyv); complex Jl_neg(complex x) diff --git a/globals.h b/globals.h index 57eb52f..785d753 100644 --- a/globals.h +++ b/globals.h @@ -17,7 +17,7 @@ struct SpecPair{ struct Material{ vector nu; - vector> eta; + vector > eta; string name; }; @@ -27,7 +27,7 @@ enum OpticsType {TransmissionOpticsType, ReflectionOpticsType}; extern PerformanceData PD; -extern vector> RefSpectrum; +extern vector > RefSpectrum; extern int currentSpec; extern vector SimSpectrum; diff --git a/interactivemie.h b/interactivemie.h index 02eab7e..cb5f3ef 100644 --- a/interactivemie.h +++ b/interactivemie.h @@ -134,7 +134,7 @@ public slots: SimulateSpectrum(); UpdateDisplay(); } - void on_radDisplayIntensity_clicked(bool b){ + void on_radDisplayIntensity_toggled(bool b){ dispSimType = IntensitySpecType; SimulateSpectrum(); UpdateDisplay(); @@ -214,6 +214,8 @@ public slots: void on_radReflectionOptics_clicked(bool d){ ui.spinCondNAi->setEnabled(false); ui.spinCondNAo->setEnabled(false); + ui.radDisplayAbsorbance->setEnabled(false); + ui.radDisplayIntensity->setChecked(true); opticsMode = ReflectionOpticsType; SimulateSpectrum(); UpdateDisplay(); diff --git a/interactivemie.ui b/interactivemie.ui index 3e89aa7..5c249dd 100644 --- a/interactivemie.ui +++ b/interactivemie.ui @@ -357,7 +357,7 @@ -9999.000000000000000 - 3.000000000000000 + 9999.000000000000000 0.100000000000000 @@ -379,7 +379,7 @@ 1 - 4000 + 100000 10 diff --git a/main.cpp b/main.cpp index ea331fe..e6d3458 100644 --- a/main.cpp +++ b/main.cpp @@ -7,13 +7,13 @@ using namespace std; #include "rtsGUIConsole.h" #include "PerformanceData.h" #include -#include +//#include PerformanceData PD; qtSpectrumDisplay* gpSpectrumDisplay; -vector> RefSpectrum; +vector > RefSpectrum; vector SimSpectrum; vector EtaK; vector EtaN; @@ -254,15 +254,23 @@ void SetMaterial() int nSamples = MaterialList[currentMaterial].eta.size(); double nu; SpecPair temp; + + //initialize the current nuMin and nuMax values + nuMin = MaterialList[currentMaterial].nu[0]; + nuMax = nuMin; for(int i=0; i= nuMin && nu <= nuMax){ + //if(nu >= nuMin && nu <= nuMax){ + + //update the min and max values for display + if(nu < nuMin) nuMin = nu; + if(nu > nuMax) nuMax = nu; + temp.nu = nu; temp.A = MaterialList[currentMaterial].eta[i].imag(); EtaK.push_back(temp); temp.A = MaterialList[currentMaterial].eta[i].real(); EtaN.push_back(temp); - } } cA = 1.0; diff --git a/qtSpectrumDisplay.cpp b/qtSpectrumDisplay.cpp index 874f5d9..b2a4ee2 100644 --- a/qtSpectrumDisplay.cpp +++ b/qtSpectrumDisplay.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include diff --git a/rtsGUIConsole.cpp b/rtsGUIConsole.cpp index 785f6c7..3e2917c 100644 --- a/rtsGUIConsole.cpp +++ b/rtsGUIConsole.cpp @@ -1,101 +1,65 @@ +#ifdef WIN32 #include - #include - #include - #include - #include - #include #ifndef _USE_OLD_IOSTREAMS using namespace std; - #endif // maximum mumber of lines the output console should have static const WORD MAX_CONSOLE_LINES = 500; - //#ifdef _DEBUG void RedirectIOToConsole(int Xpos, int Ypos, int Width, int Height) - { - -int hConHandle; - -long lStdHandle; - -CONSOLE_SCREEN_BUFFER_INFO coninfo; - -FILE *fp; - -// allocate a console for this app - -AllocConsole(); - -// set the screen buffer to be big enough to let us scroll text - -GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); - -coninfo.dwSize.Y = MAX_CONSOLE_LINES; - -SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), - -coninfo.dwSize); - -// redirect unbuffered STDOUT to the console - -lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - -hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - -fp = _fdopen( hConHandle, "w" ); - -*stdout = *fp; - -setvbuf( stdout, NULL, _IONBF, 0 ); - -// redirect unbuffered STDIN to the console - -lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE); - -hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - -fp = _fdopen( hConHandle, "r" ); - -*stdin = *fp; - -setvbuf( stdin, NULL, _IONBF, 0 ); - -// redirect unbuffered STDERR to the console - -lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE); - -hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - -fp = _fdopen( hConHandle, "w" ); - -*stderr = *fp; - -setvbuf( stderr, NULL, _IONBF, 0 ); - -// make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog - -// point to console as well - -ios::sync_with_stdio(); - -//position - -MoveWindow(GetConsoleWindow(), Xpos, Ypos, Width, Height, true); - + int hConHandle; + long lStdHandle; + CONSOLE_SCREEN_BUFFER_INFO coninfo; + FILE *fp; + // allocate a console for this app + AllocConsole(); + // set the screen buffer to be big enough to let us scroll text + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); + coninfo.dwSize.Y = MAX_CONSOLE_LINES; + SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), + coninfo.dwSize); + // redirect unbuffered STDOUT to the console + lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); + hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + fp = _fdopen( hConHandle, "w" ); + *stdout = *fp; + setvbuf( stdout, NULL, _IONBF, 0 ); + // redirect unbuffered STDIN to the console + lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE); + hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + fp = _fdopen( hConHandle, "r" ); + *stdin = *fp; + setvbuf( stdin, NULL, _IONBF, 0 ); + + // redirect unbuffered STDERR to the console + lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE); + hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + fp = _fdopen( hConHandle, "w" ); + *stderr = *fp; + setvbuf( stderr, NULL, _IONBF, 0 ); + + // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog + // point to console as well + ios::sync_with_stdio(); + //position + MoveWindow(GetConsoleWindow(), Xpos, Ypos, Width, Height, true); } -//#endif +#else +void RedirectIOToConsole(int Xpos, int Ypos, int Width, int Height) +{ +} +#endif //End of File \ No newline at end of file -- libgit2 0.21.4