Operator Console
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | List of all members
CSetup Class Reference

The class underlying the setup dialog. More...

#include <Setup.h>

Inheritance diagram for CSetup:
[legend]

Public Types

enum  { IDD = IDD_SETUP }
 
enum  { IDD = IDD_SETUP }
 

Public Member Functions

 CSetup (CWnd *pParent=NULL)
 
 CSetup (CWnd *pParent, const setup_settings &input_settings)
 
virtual ~CSetup ()
 
virtual BOOL OnInitDialog ()
 
afx_msg void OnChangeWidth ()
 
afx_msg void OnChangeHeight ()
 
afx_msg void OnLbnSelchangeDeviceList ()
 
afx_msg void OnSelchangeDeviceid ()
 
afx_msg void OnSelchangeBitsperpixel ()
 
afx_msg void OnSelchangeComboBayer ()
 
afx_msg void OnChangeEditBrowse ()
 
afx_msg void OnChangeEditbrowseProgpath ()
 
afx_msg void OnChangeEditbrowseInifile ()
 
afx_msg void OnChangeEditPartnumber ()
 
afx_msg void OnChangeEditSerialnumber ()
 
int GetDeviceID (void) const
 
int GetBitsPerPixel (void) const
 
 CSetup (CWnd *pParent=NULL)
 
 CSetup (CWnd *pParent, const setup_settings &input_settings)
 
virtual ~CSetup ()
 
virtual BOOL OnInitDialog ()
 
afx_msg void OnChangeWidth ()
 
afx_msg void OnChangeHeight ()
 
afx_msg void OnLbnSelchangeDeviceList ()
 
afx_msg void OnSelchangeDeviceid ()
 
afx_msg void OnSelchangeBitsperpixel ()
 
afx_msg void OnSelchangeComboBayer ()
 
afx_msg void OnChangeEditBrowse ()
 
afx_msg void OnChangeEditbrowseProgpath ()
 
afx_msg void OnChangeEditbrowseInifile ()
 
afx_msg void OnChangeEditPartnumber ()
 
afx_msg void OnChangeEditSerialnumber ()
 
int GetDeviceID (void) const
 
int GetBitsPerPixel (void) const
 

Public Attributes

CEdit c_setup_width
 The CEdit box for image width (in pixels) More...
 
CEdit c_setup_height
 The CEdit box for image height (in pixels) More...
 
CListBox c_device_list
 The CListBox containing the names of supported devices (Aptina DevWare, Omnivision, etc.) More...
 
CComboBox c_combo_deviceid
 The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) More...
 
CComboBox c_combo_bits_per_pixel
 The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision) More...
 
CComboBox c_combo_bayer
 The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision) More...
 
CMFCEditBrowseCtrl c_edit_browse
 [OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omnivision register file (only visible for Omnivision) More...
 
CEdit c_edit_part_number
 [OPTIONAL INPUT] The CEdit box for the camera part number to be reported in the JSON output More...
 
CEdit c_edit_serial_number
 [OPTIONAL INPUT] The CEdit box for the camera serial number to be reported in the JSON output More...
 
CMFCEditBrowseCtrl c_editbrowse_inifile
 The MFCEditBrowse that allows the user to navigate the file system to locate an Imatest INI file. More...
 
CMFCEditBrowseCtrl c_editbrowse_prog_path
 [Currently set to read-only] The MFCEditBrowse that allows the user to navigate the file system to locate the Imatest program path More...
 
setup_settings m_setup_settings
 this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and CListBoxes More...
 

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
 
virtual void DoDataExchange (CDataExchange *pDX)
 

Private Member Functions

void ShowOmnivisionElements (void)
 This function shows dialog elements that are meant only for Omnivision and hides those meant for Epiphan. More...
 
void ShowNormalElements (void)
 This function hides dialog elements that are meant only for Omnivision or Epiphan. More...
 
void ShowEpiphanElements (void)
 This function shows dialog elements that are meant only for Epiphan and hides those meant for Omnivision. More...
 
void ShowAllElements (void)
 This function shows dialog elements that are meant only for Omnivision or Epiphan. More...
 
void ShowOmnivisionElements (void)
 This function shows dialog elements that are meant only for Omnivision and hides those meant for Epiphan. More...
 
void ShowNormalElements (void)
 This function hides dialog elements that are meant only for Omnivision or Epiphan. More...
 
void ShowEpiphanElements (void)
 This function shows dialog elements that are meant only for Epiphan and hides those meant for Omnivision. More...
 
void ShowAllElements (void)
 This function shows dialog elements that are meant only for Omnivision or Epiphan. More...
 

Detailed Description

The class underlying the setup dialog.

This dialog allows the user to select between different camera sources (which must already be functioning) and input the necessary data, e.g. image width in pixels. Additionally, the user can supply the location of the ini file to be used with Imatest as well as the camera part number and serial number.

Member Enumeration Documentation

anonymous enum
Enumerator
IDD 
44 { IDD = IDD_SETUP };
#define IDD_SETUP
Definition: resource.h:38
Definition: Setup.h:44
anonymous enum
Enumerator
IDD 
44 { IDD = IDD_SETUP };
#define IDD_SETUP
Definition: resource.h:38
Definition: Setup.h:44

Constructor & Destructor Documentation

CSetup::CSetup ( CWnd *  pParent = NULL)
35  : CDialogEx(CSetup::IDD, pParent)
36 {
43 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int sourceID
sourceID for acquire_image()
Definition: setup_settings.h:33
int epiphan_deviceID
Used for Epiphan only: the device ID (0 or 1 only)
Definition: setup_settings.h:32
int bits_per_pixel
Used for Omnivision only: number of bits per pixel (8,10,12 only)
Definition: setup_settings.h:31
int width
image width in pixels
Definition: setup_settings.h:29
int bayer
Used for Omnivision only: Bayer pattern index.
Definition: setup_settings.h:35
Definition: Setup.h:44
int height
image height in pixels
Definition: setup_settings.h:30
CSetup::CSetup ( CWnd *  pParent,
const setup_settings input_settings 
)

References m_setup_settings.

47  : CDialogEx(CSetup::IDD, pParent)
48 {
49  m_setup_settings = input_settings;
50 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
Definition: Setup.h:44
CSetup::~CSetup ( )
virtual
53 {
54 }
CSetup::CSetup ( CWnd *  pParent = NULL)
CSetup::CSetup ( CWnd *  pParent,
const setup_settings input_settings 
)
virtual CSetup::~CSetup ( )
virtual

Member Function Documentation

void CSetup::DoDataExchange ( CDataExchange *  pDX)
protectedvirtual

References c_combo_bayer, c_combo_bits_per_pixel, c_combo_deviceid, c_device_list, c_edit_browse, c_edit_part_number, c_edit_serial_number, c_editbrowse_inifile, c_editbrowse_prog_path, c_setup_height, c_setup_width, IDC_BITSPERPIXEL, IDC_COMBO_BAYER, IDC_DEVICE_LIST, IDC_DEVICEID, IDC_EDIT_BROWSE, IDC_EDIT_PARTNUMBER, IDC_EDIT_SERIALNUMBER, IDC_EDITBROWSE_INIFILE, IDC_EDITBROWSE_PROGPATH, IDC_HEIGHT, and IDC_WIDTH.

57 {
58  CDialogEx::DoDataExchange(pDX);
59  DDX_Control(pDX, IDC_WIDTH, c_setup_width);
60  DDX_Control(pDX, IDC_HEIGHT, c_setup_height);
61  DDX_Control(pDX, IDC_DEVICE_LIST, c_device_list);
62  DDX_Control(pDX, IDC_DEVICEID, c_combo_deviceid);
63  DDX_Control(pDX, IDC_BITSPERPIXEL, c_combo_bits_per_pixel);
64  DDX_Control(pDX, IDC_COMBO_BAYER, c_combo_bayer);
65  DDX_Control(pDX, IDC_EDIT_BROWSE, c_edit_browse);
66  DDX_Control(pDX, IDC_EDIT_PARTNUMBER, c_edit_part_number);
70 }
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
CEdit c_edit_serial_number
[OPTIONAL INPUT] The CEdit box for the camera serial number to be reported in the JSON output ...
Definition: Setup.h:59
#define IDC_DEVICEID
Definition: resource.h:74
#define IDC_WIDTH
Definition: resource.h:70
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
CMFCEditBrowseCtrl c_editbrowse_prog_path
[Currently set to read-only] The MFCEditBrowse that allows the user to navigate the file system to lo...
Definition: Setup.h:61
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
#define IDC_EDITBROWSE_INIFILE
Definition: resource.h:86
#define IDC_HEIGHT
Definition: resource.h:65
#define IDC_EDIT_SERIALNUMBER
Definition: resource.h:84
#define IDC_COMBO_BAYER
Definition: resource.h:79
#define IDC_EDIT_PARTNUMBER
Definition: resource.h:83
CEdit c_edit_part_number
[OPTIONAL INPUT] The CEdit box for the camera part number to be reported in the JSON output ...
Definition: Setup.h:58
CMFCEditBrowseCtrl c_editbrowse_inifile
The MFCEditBrowse that allows the user to navigate the file system to locate an Imatest INI file...
Definition: Setup.h:60
CEdit c_setup_height
The CEdit box for image height (in pixels)
Definition: Setup.h:52
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
#define IDC_DEVICE_LIST
Definition: resource.h:72
CListBox c_device_list
The CListBox containing the names of supported devices (Aptina DevWare, Omnivision, etc.)
Definition: Setup.h:53
CEdit c_setup_width
The CEdit box for image width (in pixels)
Definition: Setup.h:51
#define IDC_EDIT_BROWSE
Definition: resource.h:80
#define IDC_BITSPERPIXEL
Definition: resource.h:73
#define IDC_EDITBROWSE_PROGPATH
Definition: resource.h:93
virtual void CSetup::DoDataExchange ( CDataExchange *  pDX)
protectedvirtual
int CSetup::GetBitsPerPixel ( void  ) const
int CSetup::GetBitsPerPixel ( void  ) const

References setup_settings::bits_per_pixel, and m_setup_settings.

354 {
356 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int bits_per_pixel
Used for Omnivision only: number of bits per pixel (8,10,12 only)
Definition: setup_settings.h:31
int CSetup::GetDeviceID ( void  ) const
int CSetup::GetDeviceID ( void  ) const

References setup_settings::epiphan_deviceID, and m_setup_settings.

349 {
351 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int epiphan_deviceID
Used for Epiphan only: the device ID (0 or 1 only)
Definition: setup_settings.h:32
void CSetup::OnChangeEditBrowse ( )

References c_edit_browse, m_setup_settings, and setup_settings::omnivision_reg_file.

410 {
411  CFile theFile;
412  CFileStatus status;
413  CString FileName;
414  c_edit_browse.GetWindowTextA(FileName);
415  FileName.Remove('\n'); // remove these characters, just in case, as they cause the file search to fail
416  FileName.Remove('\r');
417 
418  if ( FileName.Compare(_T("")) != 0) // Check for an empty string
419  {
420  if (CFile::GetStatus( FileName, status )) // if we find the file, propagate the filename
421  {
422  m_setup_settings.omnivision_reg_file.SetString(FileName);
423  }
424  else
425  {
426  fprintf(stderr, "Error: Omnivision register settings file not found. The program will revert to the previous file.\n");
427  }
428  }
429  else // allow the user to not supply a register file after previously supplying one
430  {
431  m_setup_settings.omnivision_reg_file.SetString(FileName);
432  }
433 
434 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CString omnivision_reg_file
[OPTIONAL INPUT] Used for Omnivision only: a fully-qualified filename (including full path) for a fil...
Definition: setup_settings.h:37
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
afx_msg void CSetup::OnChangeEditBrowse ( )
void CSetup::OnChangeEditbrowseInifile ( )

References c_editbrowse_inifile, setup_settings::ini_file, and m_setup_settings.

460 {
461  CFile theFile;
462  CFileStatus status;
463  CString FileName;
464  c_editbrowse_inifile.GetWindowTextA(FileName);
465  FileName.Remove('\n'); // remove these characters, just in, case as they cause the file search to fail
466  FileName.Remove('\r');
467 
468  if ( FileName.Compare(_T("")) != 0) // Check for an empty string
469  {
470  if (CFile::GetStatus( FileName, status )) // if we find the file, propagate the filename
471  {
472  m_setup_settings.ini_file.SetString(FileName);
473  }
474  else
475  {
476  fprintf(stderr, "Error: INI file not found. The program will revert to the previous file.\n");
477  }
478  }
479  else
480  {
482  }
483 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CString ini_file
The fully-qualified file name (including full path) for the imatest.ini file.
Definition: setup_settings.h:40
CMFCEditBrowseCtrl c_editbrowse_inifile
The MFCEditBrowse that allows the user to navigate the file system to locate an Imatest INI file...
Definition: Setup.h:60
afx_msg void CSetup::OnChangeEditbrowseInifile ( )
void CSetup::OnChangeEditbrowseProgpath ( )

References c_editbrowse_prog_path, m_setup_settings, and setup_settings::program_path.

438 {
439  CFile theFile;
440  CFileStatus status;
441  CString PathName;
442  c_editbrowse_prog_path.GetWindowTextA(PathName);
443  PathName.Remove('\n'); // remove these characters, just in case, as they cause the folder search to fail
444  PathName.Remove('\r');
445  if ( PathName.Compare(_T("")) != 0) // Check for an empty string
446  {
447  if (CFile::GetStatus( PathName, status )) // if we find the folder, propagate the path name
448  {
449  m_setup_settings.program_path.SetString(PathName);
450  }
451  else
452  {
453  fprintf(stderr, "Program path not found. The program will revert to the previous path.\n");
454  }
455  }
456 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CString program_path
The Imatest IT program path.
Definition: setup_settings.h:41
CMFCEditBrowseCtrl c_editbrowse_prog_path
[Currently set to read-only] The MFCEditBrowse that allows the user to navigate the file system to lo...
Definition: Setup.h:61
afx_msg void CSetup::OnChangeEditbrowseProgpath ( )
afx_msg void CSetup::OnChangeEditPartnumber ( )
void CSetup::OnChangeEditPartnumber ( )

References c_edit_part_number, m_setup_settings, and setup_settings::part_number.

487 {
489 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CString part_number
[OPTIONAL INPUT] The user supplied camera part number to be used in the JSON output ...
Definition: setup_settings.h:38
CEdit c_edit_part_number
[OPTIONAL INPUT] The CEdit box for the camera part number to be reported in the JSON output ...
Definition: Setup.h:58
afx_msg void CSetup::OnChangeEditSerialnumber ( )
void CSetup::OnChangeEditSerialnumber ( )

References c_edit_serial_number, m_setup_settings, and setup_settings::serial_number.

493 {
495 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CEdit c_edit_serial_number
[OPTIONAL INPUT] The CEdit box for the camera serial number to be reported in the JSON output ...
Definition: Setup.h:59
CString serial_number
[OPTIONAL INPUT] The user supplied camera part serial to be used in the JSON output ...
Definition: setup_settings.h:39
void CSetup::OnChangeHeight ( )

References c_setup_height, setup_settings::height, and m_setup_settings.

113 {
114  CString str;
115  int value = 0;
116  c_setup_height.GetWindowTextA(str);
117  value = (int) strtol(str.GetString(),NULL,10);
118  if ( value > 0 || value ==0)
119  {
120  m_setup_settings.height = value;
121  }
122  else if (value < 0)
123  {
124  m_setup_settings.height = -value;
125  str.Empty();
126  str.Format(_T("%d"),m_setup_settings.height);
127  c_setup_height.SetWindowTextA(str);
128  }
129 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CEdit c_setup_height
The CEdit box for image height (in pixels)
Definition: Setup.h:52
int height
image height in pixels
Definition: setup_settings.h:30
afx_msg void CSetup::OnChangeHeight ( )
afx_msg void CSetup::OnChangeWidth ( )
void CSetup::OnChangeWidth ( )
92 {
93  CString str;
94  int value = 0;
95  c_setup_width.GetWindowTextA(str);
96  value = (int) strtol(str.GetString(),NULL,10);
97 
98  if ( value > 0 || value ==0)
99  {
100  m_setup_settings.width = value;
101  }
102  else if (value < 0)
103  {
104  m_setup_settings.width = -value;
105  str.Empty();
106  str.Format(_T("%d"),m_setup_settings.width);
107  c_setup_width.SetWindowTextA(str);
108  }
109 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int width
image width in pixels
Definition: setup_settings.h:29
CEdit c_setup_width
The CEdit box for image width (in pixels)
Definition: Setup.h:51
BOOL CSetup::OnInitDialog ( )
virtual

References setup_settings::allowed_bits_per_pixel, setup_settings::bayer, setup_settings::bayer_list, setup_settings::bits_per_pixel, c_combo_bayer, c_combo_bits_per_pixel, c_combo_deviceid, c_device_list, c_edit_browse, c_edit_part_number, c_edit_serial_number, c_editbrowse_inifile, c_editbrowse_prog_path, c_setup_height, c_setup_width, setup_settings::device_list, setup_settings::epiphan_deviceID, setup_settings::epiphan_deviceID_list, setup_settings::height, setup_settings::ini_file, m_setup_settings, setup_settings::omnivision_reg_file, setup_settings::part_number, setup_settings::program_path, setup_settings::serial_number, ShowEpiphanElements(), ShowNormalElements(), ShowOmnivisionElements(), setup_settings::sourceID, and setup_settings::width.

133 {
134  CDialogEx::OnInitDialog();
135  CString strheight, strwidth;
136 
137  c_combo_bits_per_pixel.ShowWindow(SW_HIDE);
138  c_combo_deviceid.ShowWindow(SW_HIDE);
139 
140  strheight.Format(_T("%d"),m_setup_settings.height);
141  strwidth.Format(_T("%d"),m_setup_settings.width);
142  c_setup_height.SetWindowTextA(strheight);
143  c_setup_width.SetWindowTextA(strwidth);
144 
145 
146 
147  // fill the list of devices
148  for (std::size_t i1 = 0; i1 < m_setup_settings.device_list.size(); ++i1)
149  {
151  }
152 
153  // fill the list of Bayer patterns
154  for (std::size_t i1 = 0; i1 < m_setup_settings.bayer_list.size(); ++i1)
155  {
157  }
158 
159  // fill the list of allowed bits per pixel (Omnivision only)
160  for (std::size_t j1 = 0; j1 < m_setup_settings.allowed_bits_per_pixel.size(); ++j1)
161  {
162  CString str;
163  str.Format(_T("%d"), m_setup_settings.allowed_bits_per_pixel[j1] );
164  c_combo_bits_per_pixel.AddString(str);
165  }
166 
167  // fill the combo-box of Epiphan device IDs
168  for ( std::size_t j1 = 0; j1 < m_setup_settings.epiphan_deviceID_list.size(); ++j1)
169  {
171  }
172 
174  // Select the stored value for the device and hide/show objects accordingly
176 
177  // Recall:
178  //device_list[0] = _T("Aptina DevWare");
179  //device_list[1] = _T("Omnivision OVTA");
180  //device_list[2] = _T("Toshiba ImaTuning");
181  //device_list[3] = _T("STM Conduit");
182  //device_list[4] = _T("Graphin EasyLab");
183  //device_list[5] = _T("Epiphan");
184 
185  if (m_setup_settings.sourceID != 0)
186  {
187  CString str;
188 
189  switch (m_setup_settings.sourceID)
190  {
191  case 1:
192  str.SetString(m_setup_settings.device_list[0]); // Aptina DevWare
194  break;
195  case 2:
196  str.SetString(m_setup_settings.device_list[1]); // Omnivision OVTA
198  break;
199  case 3:
200  str.SetString(m_setup_settings.device_list[2]); // Toshiba ImaTuning
202  break;
203  case 4:
204  str.SetString(m_setup_settings.device_list[3]); // STM Conduit
206  break;
207  case 5:
208  str.SetString(m_setup_settings.device_list[4]); // Graphin EasyLab
210  break;
211  case 6:
212  str.SetString(m_setup_settings.device_list[5]); // Epiphan
214  break;
215  default:
216  str.SetString(m_setup_settings.device_list[0]); // Default: Aptina DevWare
218  }
219 
220  c_device_list.SelectString(-1,str); // select and highlight the previously stored entry
221 
222  }
223 
224  if (m_setup_settings.bayer > 0) // select the Bayer pattern item using the stored value
225  {
226  c_combo_bayer.SetCurSel(m_setup_settings.bayer - 1);
227  }
228  else
229  {
230  c_combo_bayer.SetCurSel(0);
232  }
233 
234  if ( m_setup_settings.bits_per_pixel > 0) // select the bits per pixel item using the stored value
235  {
236  CString str;
237  str.Format(_T("%d"), m_setup_settings.bits_per_pixel);
238 
239  int idx;
240  idx = c_combo_bits_per_pixel.FindString(-1, str);
241 
242  if (idx != CB_ERR)
243  {
244  c_combo_bits_per_pixel.SetCurSel(idx);
245  }
246  else
247  {
248  c_combo_bits_per_pixel.SetCurSel(0);
249  }
250  }
251  else
252  {
253  c_combo_bits_per_pixel.SetCurSel(0);
255  }
256 
257  // enable (or disable) the various edit-browse controls
258  CString devstr;
259  devstr.Format(_T("%d"), m_setup_settings.epiphan_deviceID);
260  int idx = c_combo_deviceid.FindString(-1,devstr);
261  c_combo_deviceid.SetCurSel(idx);
262 
263  c_edit_browse.EnableFileBrowseButton();
265 
266  c_editbrowse_inifile.EnableFileBrowseButton();
268 
269  //c_editbrowse_prog_path.EnableFolderBrowseButton(); // the program path is a read-only display for now
270  c_editbrowse_prog_path.EnableBrowseButton(false);
272  c_editbrowse_prog_path.SetReadOnly();
273 
274  // load the part number and serial number into their respective edit boxes
276 
278 
279  return TRUE; // return TRUE unless you set the focus to a control
280  // EXCEPTION: OCX Property Pages should return FALSE
281 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int sourceID
sourceID for acquire_image()
Definition: setup_settings.h:33
std::vector< int > allowed_bits_per_pixel
The list of allowed bits-per-pixels used to fill the c_combo_bits_per_pixel CComboBox in Setup...
Definition: setup_settings.h:45
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
void ShowOmnivisionElements(void)
This function shows dialog elements that are meant only for Omnivision and hides those meant for Epip...
Definition: Setup.cpp:543
CString part_number
[OPTIONAL INPUT] The user supplied camera part number to be used in the JSON output ...
Definition: setup_settings.h:38
CString omnivision_reg_file
[OPTIONAL INPUT] Used for Omnivision only: a fully-qualified filename (including full path) for a fil...
Definition: setup_settings.h:37
int epiphan_deviceID
Used for Epiphan only: the device ID (0 or 1 only)
Definition: setup_settings.h:32
CString program_path
The Imatest IT program path.
Definition: setup_settings.h:41
int bits_per_pixel
Used for Omnivision only: number of bits per pixel (8,10,12 only)
Definition: setup_settings.h:31
CEdit c_edit_serial_number
[OPTIONAL INPUT] The CEdit box for the camera serial number to be reported in the JSON output ...
Definition: Setup.h:59
CString serial_number
[OPTIONAL INPUT] The user supplied camera part serial to be used in the JSON output ...
Definition: setup_settings.h:39
void ShowNormalElements(void)
This function hides dialog elements that are meant only for Omnivision or Epiphan.
Definition: Setup.cpp:501
CString ini_file
The fully-qualified file name (including full path) for the imatest.ini file.
Definition: setup_settings.h:40
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
CMFCEditBrowseCtrl c_editbrowse_prog_path
[Currently set to read-only] The MFCEditBrowse that allows the user to navigate the file system to lo...
Definition: Setup.h:61
std::vector< CString > device_list
The list of allowed device names used to fill the c_device_list CListBox in Setup.h/cpp.
Definition: setup_settings.h:43
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
int width
image width in pixels
Definition: setup_settings.h:29
std::vector< CString > bayer_list
The list of allowed Bayer patterns used to fill the c_combo_bayer CComboBox in Setup.h/cpp.
Definition: setup_settings.h:44
CEdit c_edit_part_number
[OPTIONAL INPUT] The CEdit box for the camera part number to be reported in the JSON output ...
Definition: Setup.h:58
CMFCEditBrowseCtrl c_editbrowse_inifile
The MFCEditBrowse that allows the user to navigate the file system to locate an Imatest INI file...
Definition: Setup.h:60
CEdit c_setup_height
The CEdit box for image height (in pixels)
Definition: Setup.h:52
std::vector< CString > epiphan_deviceID_list
The list of allowed Epiphan device IDs used to fill the c_combo_deviceid CComboBox in Setup...
Definition: setup_settings.h:42
int bayer
Used for Omnivision only: Bayer pattern index.
Definition: setup_settings.h:35
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
CListBox c_device_list
The CListBox containing the names of supported devices (Aptina DevWare, Omnivision, etc.)
Definition: Setup.h:53
CEdit c_setup_width
The CEdit box for image width (in pixels)
Definition: Setup.h:51
int height
image height in pixels
Definition: setup_settings.h:30
void ShowEpiphanElements(void)
This function shows dialog elements that are meant only for Epiphan and hides those meant for Omnivis...
Definition: Setup.cpp:522

Here is the call graph for this function:

virtual BOOL CSetup::OnInitDialog ( )
virtual
void CSetup::OnLbnSelchangeDeviceList ( )

References c_device_list, setup_settings::device_list, m_setup_settings, ShowEpiphanElements(), ShowNormalElements(), ShowOmnivisionElements(), and setup_settings::sourceID.

285 {
286 
287  int nIndex;
288  CString str;
289  nIndex = c_device_list.GetCurSel();
290  c_device_list.GetText(nIndex,str);
291 
292  if (str.Compare(m_setup_settings.device_list[0]) ==0) // Aptina DevWare
293  {
296  }
297  else if (str.Compare(m_setup_settings.device_list[1]) ==0) // Omnivision OVTA
298  {
301  }
302  else if (str.Compare(m_setup_settings.device_list[2]) ==0) // Toshiba ImaTuning
303  {
306  }
307  else if (str.Compare(m_setup_settings.device_list[3]) ==0) // STM Conduit
308  {
311  }
312  else if (str.Compare(m_setup_settings.device_list[4]) ==0) // Graphin EasyLab
313  {
316  }
317  else if (str.Compare(m_setup_settings.device_list[5]) ==0) // Epiphan
318  {
321  }
322  else
323  {
325  fprintf(stderr,"Error: Unknown device selection. The program will revert to Aptina DevWare");
327  }
328 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int sourceID
sourceID for acquire_image()
Definition: setup_settings.h:33
void ShowOmnivisionElements(void)
This function shows dialog elements that are meant only for Omnivision and hides those meant for Epip...
Definition: Setup.cpp:543
void ShowNormalElements(void)
This function hides dialog elements that are meant only for Omnivision or Epiphan.
Definition: Setup.cpp:501
std::vector< CString > device_list
The list of allowed device names used to fill the c_device_list CListBox in Setup.h/cpp.
Definition: setup_settings.h:43
CListBox c_device_list
The CListBox containing the names of supported devices (Aptina DevWare, Omnivision, etc.)
Definition: Setup.h:53
void ShowEpiphanElements(void)
This function shows dialog elements that are meant only for Epiphan and hides those meant for Omnivis...
Definition: Setup.cpp:522

Here is the call graph for this function:

afx_msg void CSetup::OnLbnSelchangeDeviceList ( )
afx_msg void CSetup::OnSelchangeBitsperpixel ( )
void CSetup::OnSelchangeBitsperpixel ( )

References setup_settings::allowed_bits_per_pixel, setup_settings::bits_per_pixel, c_combo_bits_per_pixel, and m_setup_settings.

360 {
361  CString str;
362  int value = 0;
363 
364  c_combo_bits_per_pixel.GetWindowTextA(str);
365  value = (int) strtol(str.GetString(),NULL,10);
366  // double check that the found value is allowed.
367  std::vector<int>::iterator itr = std::find(m_setup_settings.allowed_bits_per_pixel.begin(), m_setup_settings.allowed_bits_per_pixel.end(), value);
368 
369  if ( itr != m_setup_settings.allowed_bits_per_pixel.end())
370  {
372  }
373  else
374  {
376  }
377 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
std::vector< int > allowed_bits_per_pixel
The list of allowed bits-per-pixels used to fill the c_combo_bits_per_pixel CComboBox in Setup...
Definition: setup_settings.h:45
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
int bits_per_pixel
Used for Omnivision only: number of bits per pixel (8,10,12 only)
Definition: setup_settings.h:31
afx_msg void CSetup::OnSelchangeComboBayer ( )
void CSetup::OnSelchangeComboBayer ( )

References setup_settings::bayer, setup_settings::bayer_list, c_combo_bayer, and m_setup_settings.

381 {
382  CString str;
383  int value = 0;
384  c_combo_bayer.GetWindowTextA(str);
385 
386  if (str.CompareNoCase(m_setup_settings.bayer_list[0])==0) // Red in R1C1 (RG/GB)
387  {
389  }
390  else if (str.CompareNoCase(m_setup_settings.bayer_list[1])==0) // Red in R1C2 (GR/BG)
391  {
393  }
394  else if (str.CompareNoCase(m_setup_settings.bayer_list[2])==0) // Red in R2C1 (GB/RG)
395  {
397  }
398  else if (str.CompareNoCase(m_setup_settings.bayer_list[3])==0) // Red in R2C2 (BG/GR)
399  {
401  }
402  else
403  {
405  }
406 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
std::vector< CString > bayer_list
The list of allowed Bayer patterns used to fill the c_combo_bayer CComboBox in Setup.h/cpp.
Definition: setup_settings.h:44
int bayer
Used for Omnivision only: Bayer pattern index.
Definition: setup_settings.h:35
afx_msg void CSetup::OnSelchangeDeviceid ( )
void CSetup::OnSelchangeDeviceid ( )

References c_combo_deviceid, setup_settings::epiphan_deviceID, setup_settings::epiphan_deviceID_list, and m_setup_settings.

331 {
332 
333  CString str;
334 
335  c_combo_deviceid.GetWindowTextA(str);
336 
337  if (str.CompareNoCase(m_setup_settings.epiphan_deviceID_list[0])==0)
338  {
340  }
341  else if (str.CompareNoCase(m_setup_settings.epiphan_deviceID_list[1])==0)
342  {
344  }
345 
346 }
setup_settings m_setup_settings
this contains settings for the setup dialog including the strings to fill the various CcomboBoxes and...
Definition: Setup.h:80
int epiphan_deviceID
Used for Epiphan only: the device ID (0 or 1 only)
Definition: setup_settings.h:32
std::vector< CString > epiphan_deviceID_list
The list of allowed Epiphan device IDs used to fill the c_combo_deviceid CComboBox in Setup...
Definition: setup_settings.h:42
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
void CSetup::ShowAllElements ( void  )
private

This function shows dialog elements that are meant only for Omnivision or Epiphan.

void CSetup::ShowAllElements ( void  )
private

This function shows dialog elements that are meant only for Omnivision or Epiphan.

References c_combo_bayer, c_combo_bits_per_pixel, c_combo_deviceid, c_edit_browse, IDC_STATIC_BAYER, IDC_STATIC_BITSPERPIXEL, IDC_STATIC_BROWSE, and IDC_STATIC_DEVICEID.

565 {
566  CWnd* pDeviceID = GetDlgItem(IDC_STATIC_DEVICEID);
567  CWnd* pBitsPerPixel = GetDlgItem(IDC_STATIC_BITSPERPIXEL);
568  CWnd* pBayer = GetDlgItem(IDC_STATIC_BAYER);
569  CWnd* pEditBrowse = GetDlgItem(IDC_STATIC_BROWSE);
570 
571  c_combo_bits_per_pixel.ShowWindow(SW_SHOW);
572  pBitsPerPixel->ShowWindow(SW_SHOW);
573  c_combo_deviceid.ShowWindow(SW_SHOW);
574  pDeviceID ->ShowWindow(SW_SHOW);
575  pBayer ->ShowWindow(SW_SHOW);
576  c_combo_bayer.ShowWindow(SW_SHOW);
577  pEditBrowse -> ShowWindow(SW_SHOW);
578  c_edit_browse.ShowWindow(SW_SHOW);
579 }
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
#define IDC_STATIC_BITSPERPIXEL
Definition: resource.h:75
#define IDC_STATIC_DEVICEID
Definition: resource.h:77
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
#define IDC_STATIC_BAYER
Definition: resource.h:76
#define IDC_STATIC_BROWSE
Definition: resource.h:82
void CSetup::ShowEpiphanElements ( void  )
private

This function shows dialog elements that are meant only for Epiphan and hides those meant for Omnivision.

void CSetup::ShowEpiphanElements ( void  )
private

This function shows dialog elements that are meant only for Epiphan and hides those meant for Omnivision.

References c_combo_bayer, c_combo_bits_per_pixel, c_combo_deviceid, c_edit_browse, IDC_STATIC_BAYER, IDC_STATIC_BITSPERPIXEL, IDC_STATIC_BROWSE, and IDC_STATIC_DEVICEID.

Referenced by OnInitDialog(), and OnLbnSelchangeDeviceList().

523 {
524  CWnd* pDeviceID = GetDlgItem(IDC_STATIC_DEVICEID);
525  CWnd* pBitsPerPixel = GetDlgItem(IDC_STATIC_BITSPERPIXEL);
526  CWnd* pBayer = GetDlgItem(IDC_STATIC_BAYER);
527  CWnd* pEditBrowse = GetDlgItem(IDC_STATIC_BROWSE);
528 
529  c_combo_bits_per_pixel.ShowWindow(SW_HIDE);
530  pBitsPerPixel->ShowWindow(SW_HIDE);
531  c_combo_deviceid.ShowWindow(SW_SHOW);
532  pDeviceID ->ShowWindow(SW_SHOW);
533  pBayer ->ShowWindow(SW_HIDE);
534  c_combo_bayer.ShowWindow(SW_HIDE);
535  pEditBrowse -> ShowWindow(SW_HIDE);
536  c_edit_browse.ShowWindow(SW_HIDE);
537 }
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
#define IDC_STATIC_BITSPERPIXEL
Definition: resource.h:75
#define IDC_STATIC_DEVICEID
Definition: resource.h:77
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
#define IDC_STATIC_BAYER
Definition: resource.h:76
#define IDC_STATIC_BROWSE
Definition: resource.h:82

Here is the caller graph for this function:

void CSetup::ShowNormalElements ( void  )
private

This function hides dialog elements that are meant only for Omnivision or Epiphan.

References c_combo_bayer, c_combo_bits_per_pixel, c_combo_deviceid, c_edit_browse, IDC_STATIC_BAYER, IDC_STATIC_BITSPERPIXEL, IDC_STATIC_BROWSE, and IDC_STATIC_DEVICEID.

Referenced by OnInitDialog(), and OnLbnSelchangeDeviceList().

502 {
503  CWnd* pDeviceID = GetDlgItem(IDC_STATIC_DEVICEID);
504  CWnd* pBitsPerPixel = GetDlgItem(IDC_STATIC_BITSPERPIXEL);
505  CWnd* pBayer = GetDlgItem(IDC_STATIC_BAYER);
506  CWnd* pEditBrowse = GetDlgItem(IDC_STATIC_BROWSE);
507 
508  c_combo_bits_per_pixel.ShowWindow(SW_HIDE);
509  pBitsPerPixel->ShowWindow(SW_HIDE);
510  c_combo_deviceid.ShowWindow(SW_HIDE);
511  pDeviceID ->ShowWindow(SW_HIDE);
512  pBayer ->ShowWindow(SW_HIDE);
513  c_combo_bayer.ShowWindow(SW_HIDE);
514  pEditBrowse -> ShowWindow(SW_HIDE);
515  c_edit_browse.ShowWindow(SW_HIDE);
516 }
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
#define IDC_STATIC_BITSPERPIXEL
Definition: resource.h:75
#define IDC_STATIC_DEVICEID
Definition: resource.h:77
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
#define IDC_STATIC_BAYER
Definition: resource.h:76
#define IDC_STATIC_BROWSE
Definition: resource.h:82

Here is the caller graph for this function:

void CSetup::ShowNormalElements ( void  )
private

This function hides dialog elements that are meant only for Omnivision or Epiphan.

void CSetup::ShowOmnivisionElements ( void  )
private

This function shows dialog elements that are meant only for Omnivision and hides those meant for Epiphan.

void CSetup::ShowOmnivisionElements ( void  )
private

This function shows dialog elements that are meant only for Omnivision and hides those meant for Epiphan.

References c_combo_bayer, c_combo_bits_per_pixel, c_combo_deviceid, c_edit_browse, IDC_STATIC_BAYER, IDC_STATIC_BITSPERPIXEL, IDC_STATIC_BROWSE, and IDC_STATIC_DEVICEID.

Referenced by OnInitDialog(), and OnLbnSelchangeDeviceList().

544 {
545  CWnd* pDeviceID = GetDlgItem(IDC_STATIC_DEVICEID);
546  CWnd* pBitsPerPixel = GetDlgItem(IDC_STATIC_BITSPERPIXEL);
547  CWnd* pBayer = GetDlgItem(IDC_STATIC_BAYER);
548  CWnd* pEditBrowse = GetDlgItem(IDC_STATIC_BROWSE);
549 
550  c_combo_bits_per_pixel.ShowWindow(SW_SHOW);
551  pBitsPerPixel->ShowWindow(SW_SHOW);
552  c_combo_deviceid.ShowWindow(SW_HIDE);
553  pDeviceID ->ShowWindow(SW_HIDE);
554  pBayer ->ShowWindow(SW_SHOW);
555  c_combo_bayer.ShowWindow(SW_SHOW);
556  pEditBrowse -> ShowWindow(SW_SHOW);
557  c_edit_browse.ShowWindow(SW_SHOW);
558 }
CComboBox c_combo_bits_per_pixel
The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)...
Definition: Setup.h:55
CComboBox c_combo_bayer
The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)...
Definition: Setup.h:56
CMFCEditBrowseCtrl c_edit_browse
[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omni...
Definition: Setup.h:57
#define IDC_STATIC_BITSPERPIXEL
Definition: resource.h:75
#define IDC_STATIC_DEVICEID
Definition: resource.h:77
CComboBox c_combo_deviceid
The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan) ...
Definition: Setup.h:54
#define IDC_STATIC_BAYER
Definition: resource.h:76
#define IDC_STATIC_BROWSE
Definition: resource.h:82

Here is the caller graph for this function:

Member Data Documentation

CComboBox CSetup::c_combo_bayer

The CCombobox drop-down list containing the valid Bayer pattern indexes (only visible for Omnivision)

Referenced by DoDataExchange(), OnInitDialog(), OnSelchangeComboBayer(), ShowAllElements(), ShowEpiphanElements(), ShowNormalElements(), and ShowOmnivisionElements().

CComboBox CSetup::c_combo_bits_per_pixel

The CCombobox drop-down list containing the valid bits-per-pixel values (only visible for Omnivision)

Referenced by DoDataExchange(), OnInitDialog(), OnSelchangeBitsperpixel(), ShowAllElements(), ShowEpiphanElements(), ShowNormalElements(), and ShowOmnivisionElements().

CComboBox CSetup::c_combo_deviceid

The CCombobox drop-down list containing the two valid device IDs (only visible for Epiphan)

Referenced by DoDataExchange(), OnInitDialog(), OnSelchangeDeviceid(), ShowAllElements(), ShowEpiphanElements(), ShowNormalElements(), and ShowOmnivisionElements().

CListBox CSetup::c_device_list

The CListBox containing the names of supported devices (Aptina DevWare, Omnivision, etc.)

Referenced by DoDataExchange(), OnInitDialog(), and OnLbnSelchangeDeviceList().

CMFCEditBrowseCtrl CSetup::c_edit_browse

[OPTIONAL INPUT] The MFCEditBrowse that allows the user to navigate the file system to locate an Omnivision register file (only visible for Omnivision)

Referenced by DoDataExchange(), OnChangeEditBrowse(), OnInitDialog(), ShowAllElements(), ShowEpiphanElements(), ShowNormalElements(), and ShowOmnivisionElements().

CEdit CSetup::c_edit_part_number

[OPTIONAL INPUT] The CEdit box for the camera part number to be reported in the JSON output

Referenced by DoDataExchange(), OnChangeEditPartnumber(), and OnInitDialog().

CEdit CSetup::c_edit_serial_number

[OPTIONAL INPUT] The CEdit box for the camera serial number to be reported in the JSON output

Referenced by DoDataExchange(), OnChangeEditSerialnumber(), and OnInitDialog().

CMFCEditBrowseCtrl CSetup::c_editbrowse_inifile

The MFCEditBrowse that allows the user to navigate the file system to locate an Imatest INI file.

Referenced by DoDataExchange(), OnChangeEditbrowseInifile(), and OnInitDialog().

CMFCEditBrowseCtrl CSetup::c_editbrowse_prog_path

[Currently set to read-only] The MFCEditBrowse that allows the user to navigate the file system to locate the Imatest program path

Referenced by DoDataExchange(), OnChangeEditbrowseProgpath(), and OnInitDialog().

CEdit CSetup::c_setup_height

The CEdit box for image height (in pixels)

Referenced by DoDataExchange(), OnChangeHeight(), and OnInitDialog().

CEdit CSetup::c_setup_width

The CEdit box for image width (in pixels)

Referenced by DoDataExchange(), and OnInitDialog().

setup_settings CSetup::m_setup_settings

The documentation for this class was generated from the following files: