|
Wasatch.VCPP 1.0.19
Visual C++ driver for Wasatch Photonics spectrometers
|
#include "framework.h"#include "InputBox.h"#include "WasatchVCPPDemo.h"#include "WasatchVCPP.h"#include <stdio.h>#include <fstream>#include <string>#include <vector>#include <map>Macros | |
| #define | MAX_LOADSTRING 100 |
| #define | LOGFILE_PATH "wasatch_vcpp.log" |
Functions | |
| void | log (const char *fmt,...) |
| A simple log function which updates the scrolling Textbox on the GUI. More... | |
| void | doConnect () |
| void | doSetIntegrationTime () |
| void | doSetMaxSpectra () |
| void | doSetLaserEnable () |
| void | doSetLaserPower () |
| void | doLaserPowerMW () |
| void | doGetDetectorTemperatureDegC () |
| void | doReadEEPROM () |
| void | doAcquire () |
| void | doSetOutfile () |
| int APIENTRY | wWinMain (_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow) |
| ATOM | MyRegisterClass (HINSTANCE hInstance) |
| BOOL | InitInstance (HINSTANCE hInstance, int nCmdShow) |
| LRESULT CALLBACK | WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| INT_PTR CALLBACK | About (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
Variables | |
| HINSTANCE | hInst |
| WCHAR | szTitle [MAX_LOADSTRING] |
| WCHAR | szWindowClass [MAX_LOADSTRING] |
| HWND | hTextbox |
| string | logBuffer |
| const int | MAX_LOG_LEN = 16 * 1024 |
| WasatchVCPP::Proxy::Driver | driver |
| WasatchVCPP::Proxy::Spectrometer * | spectrometer = nullptr |
| std::ofstream | outfile |
| int | maxSpectra = 1 |
This file demonstrates how the WasatchVCPPProxy class can be used to control Wasatch Photonics spectrometers from Visual C++.
This is a simple GUI created from a Visual C++ "Desktop Application" template. It has a few menu-bar options (configured using the "Resource View"), and a scrolling log event viewer. It doesn't provide an on-screen chart because I haven't figured out a lightweight way to do that from Visual C++ without adding a dependency on Qt or equivalent. A graphing demo is provided via the standalone WasatchVCPPNet C# GUI.
| void log | ( | const char * | fmt, |
| ... | |||
| ) |
A simple log function which updates the scrolling Textbox on the GUI.