@ -26,12 +26,12 @@ void task_osk()
system ( " start /b C: \\ Windows \\ system32 \\ osk.exe " ) ;
}
DialogSetup : : DialogSetup ( QWidget * parent ) : QDialog ( parent ) {
DialogSetup : : DialogSetup ( QWidget * parent ) : QDialog ( parent ) {
ui . setupUi ( this ) ;
InitPtrMat ( ) ;
this - > setWindowFlags ( Qt : : FramelessWindowHint ) ; //窗口可移动
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
{
lineEdit_expo_mat [ i ] - > setValidator ( new QIntValidator ( 0 , 1000000 , this ) ) ;
lineEdit_expo_mat [ i ] - > setText ( QString : : number ( g_sys_conf . expo [ i ] ) ) ;
@ -120,7 +120,7 @@ DialogSetup::DialogSetup(QWidget * parent) : QDialog(parent) {
}
else {
QString dirPath = " D:/image " ;
QDir * dirinfo = new QDir ( dirPath ) ;
QDir * dirinfo = new QDir ( dirPath ) ;
if ( ! dirinfo - > exists ( ) )
delete dirinfo , dirinfo = nullptr ;
//ui.comboBox_save_pics_path->clear();
@ -194,8 +194,8 @@ void DialogSetup::on_pushButton_exit_released()
void DialogSetup : : on_pushButton_desktop_released ( )
{
CoInitialize ( 0 ) ;
IShellDispatch4 * pdisp = NULL ;
CoCreateInstance ( CLSID_Shell , NULL , CLSCTX_ALL , __uuidof ( IShellDispatch4 ) , ( void * * ) & pdisp ) ;
IShellDispatch4 * pdisp = NULL ;
CoCreateInstance ( CLSID_Shell , NULL , CLSCTX_ALL , __uuidof ( IShellDispatch4 ) , ( void * * ) & pdisp ) ;
pdisp - > ToggleDesktop ( ) ; // 这句是用来切换桌面的
pdisp - > Release ( ) ;
CoUninitialize ( ) ;
@ -203,7 +203,7 @@ void DialogSetup::on_pushButton_desktop_released()
void DialogSetup : : on_pushButton_expo_released ( )
{
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
{
g_sys_conf . expo [ i ] = ( lineEdit_expo_mat [ i ] - > text ( ) ) . toInt ( ) ;
g_sys_conf . gain [ i ] = ( lineEdit_gain_mat [ i ] - > text ( ) ) . toInt ( ) ;
@ -237,7 +237,7 @@ void DialogSetup::on_checkBox_auto_work_clicked(bool checked)
void DialogSetup : : on_pushButton_filter_released ( )
{
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
{
g_sys_conf . filter [ i ] = ( lineEdit_filter_mat [ i ] - > text ( ) ) . toInt ( ) ;
}
@ -318,7 +318,7 @@ void DialogSetup::on_pushButton_save_released()
{
g_sys_conf . save = 2 ;
}
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
{
g_sys_conf . expo [ i ] = ( lineEdit_expo_mat [ i ] - > text ( ) ) . toInt ( ) ;
g_sys_conf . gain [ i ] = ( lineEdit_gain_mat [ i ] - > text ( ) ) . toInt ( ) ;
@ -590,7 +590,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID1=%d \n " , g_sys_conf . UserID [ 0 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO1=%d|%d|%d \n " , g_sys_conf . no [ 0 ] [ 0 ] , g_sys_conf . no [ 0 ] [ 1 ] , g_sys_conf . no [ 0 ] [ 2 ] ) ;
sprintf ( buf , " NO1=%d|%d|%d \n " , g_sys_conf . no [ 0 ] [ 0 ] , g_sys_conf . no [ 0 ] [ 1 ] , g_sys_conf . no [ 0 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT1=%d \n " , g_sys_conf . shoot [ 0 ] ) ;
@ -612,7 +612,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID2=%d \n " , g_sys_conf . UserID [ 1 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO2=%d|%d|%d \n " , g_sys_conf . no [ 1 ] [ 0 ] , g_sys_conf . no [ 1 ] [ 1 ] , g_sys_conf . no [ 1 ] [ 2 ] ) ;
sprintf ( buf , " NO2=%d|%d|%d \n " , g_sys_conf . no [ 1 ] [ 0 ] , g_sys_conf . no [ 1 ] [ 1 ] , g_sys_conf . no [ 1 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT2=%d \n " , g_sys_conf . shoot [ 1 ] ) ;
@ -634,7 +634,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID3=%d \n " , g_sys_conf . UserID [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO3=%d|%d|%d \n " , g_sys_conf . no [ 2 ] [ 0 ] , g_sys_conf . no [ 2 ] [ 1 ] , g_sys_conf . no [ 2 ] [ 2 ] ) ;
sprintf ( buf , " NO3=%d|%d|%d \n " , g_sys_conf . no [ 2 ] [ 0 ] , g_sys_conf . no [ 2 ] [ 1 ] , g_sys_conf . no [ 2 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT3=%d \n " , g_sys_conf . shoot [ 2 ] ) ;
@ -656,7 +656,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID4=%d \n " , g_sys_conf . UserID [ 3 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO4=%d|%d|%d \n " , g_sys_conf . no [ 3 ] [ 0 ] , g_sys_conf . no [ 3 ] [ 1 ] , g_sys_conf . no [ 3 ] [ 2 ] ) ;
sprintf ( buf , " NO4=%d|%d|%d \n " , g_sys_conf . no [ 3 ] [ 0 ] , g_sys_conf . no [ 3 ] [ 1 ] , g_sys_conf . no [ 3 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT4=%d \n " , g_sys_conf . shoot [ 3 ] ) ;
@ -678,7 +678,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID5=%d \n " , g_sys_conf . UserID [ 4 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO5=%d|%d|%d \n " , g_sys_conf . no [ 4 ] [ 0 ] , g_sys_conf . no [ 4 ] [ 1 ] , g_sys_conf . no [ 4 ] [ 2 ] ) ;
sprintf ( buf , " NO5=%d|%d|%d \n " , g_sys_conf . no [ 4 ] [ 0 ] , g_sys_conf . no [ 4 ] [ 1 ] , g_sys_conf . no [ 4 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT5=%d \n " , g_sys_conf . shoot [ 4 ] ) ;
@ -700,7 +700,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID6=%d \n " , g_sys_conf . UserID [ 5 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO6=%d|%d|%d \n " , g_sys_conf . no [ 5 ] [ 0 ] , g_sys_conf . no [ 5 ] [ 1 ] , g_sys_conf . no [ 5 ] [ 2 ] ) ;
sprintf ( buf , " NO6=%d|%d|%d \n " , g_sys_conf . no [ 5 ] [ 0 ] , g_sys_conf . no [ 5 ] [ 1 ] , g_sys_conf . no [ 5 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT6=%d \n " , g_sys_conf . shoot [ 5 ] ) ;
@ -722,7 +722,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID7=%d \n " , g_sys_conf . UserID [ 6 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO7=%d|%d|%d \n " , g_sys_conf . no [ 6 ] [ 0 ] , g_sys_conf . no [ 6 ] [ 1 ] , g_sys_conf . no [ 6 ] [ 2 ] ) ;
sprintf ( buf , " NO7=%d|%d|%d \n " , g_sys_conf . no [ 6 ] [ 0 ] , g_sys_conf . no [ 6 ] [ 1 ] , g_sys_conf . no [ 6 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT7=%d \n " , g_sys_conf . shoot [ 6 ] ) ;
@ -744,7 +744,7 @@ void DialogSetup::write_config()
sprintf ( buf , " USERID8=%d \n " , g_sys_conf . UserID [ 7 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " NO8=%d|%d|%d \n " , g_sys_conf . no [ 7 ] [ 0 ] , g_sys_conf . no [ 7 ] [ 1 ] , g_sys_conf . no [ 7 ] [ 2 ] ) ;
sprintf ( buf , " NO8=%d|%d|%d \n " , g_sys_conf . no [ 7 ] [ 0 ] , g_sys_conf . no [ 7 ] [ 1 ] , g_sys_conf . no [ 7 ] [ 2 ] ) ;
cfg_file . write ( buf , strlen ( buf ) ) ;
memset ( buf , 0 , 256 ) ;
sprintf ( buf , " SHOOT8=%d \n " , g_sys_conf . shoot [ 7 ] ) ;
@ -801,17 +801,17 @@ void DialogSetup::on_pushButton_config_released()
{
if ( m_camera_glue ) delete m_camera_glue ;
m_camera_glue = new camera_glue ( this ) ;
connect ( m_camera_glue , & camera_glue : : sendMsgToDialogSetup , this , & DialogSetup : : recMsgFromDialogConfig ) ;
connect ( this , & DialogSetup : : sendMsgToConfig , m_camera_glue , & camera_glue : : recMsgFromDialogSetup ) ;
connect ( m_camera_glue , & camera_glue : : sendMsgToDialogSetup , this , & DialogSetup : : recMsgFromDialogConfig ) ;
connect ( this , & DialogSetup : : sendMsgToConfig , m_camera_glue , & camera_glue : : recMsgFromDialogSetup ) ;
m_camera_glue - > show ( ) ;
m_camera_glue - > move ( this - > geometry ( ) . center ( ) - m_camera_glue - > rect ( ) . center ( ) ) ; //移动父窗口中心位置
emit sendMsgToConfig ( g_sys_conf . no ) ;
}
void DialogSetup : : recMsgFromDialogConfig ( int ptr [ ] [ 3 ] )
{
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
for ( int j = 0 ; j < 3 ; j + + )
g_sys_conf . no [ i ] [ j ] = ptr [ i ] [ j ] ;
for ( int i = 0 ; i < NumberOfSupportedCameras ; i + + )
for ( int j = 0 ; j < 3 ; j + + )
g_sys_conf . no [ i ] [ j ] = ptr [ i ] [ j ] ;
}
void DialogSetup : : on_pushButton_change_released ( )
{
@ -821,7 +821,7 @@ void DialogSetup::on_pushButton_change_released()
connect ( this , & DialogSetup : : sendMsgToShift , m_change_shift , & change_shift : : recMsgFromDialogSetup ) ;
m_change_shift - > show ( ) ;
m_change_shift - > move ( this - > geometry ( ) . center ( ) - m_change_shift - > rect ( ) . center ( ) ) ;
emit sendMsgToShift ( g_sys_conf . shiftA , g_sys_conf . shiftB , g_sys_conf . shiftC ) ;
emit sendMsgToShift ( g_sys_conf . shiftA , g_sys_conf . shiftB , g_sys_conf . shiftC ) ;
}
void DialogSetup : : on_pushButton_statistic_released ( )
{