00001 /*! @file Qt/SSCMainForm.ui.h functions relating to SSC control main form */ 00002 00003 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Qt/SSCMainForm.ui.h $ 00004 // $Id: SSCMainForm.ui.h 5769 2005-10-20 16:50:33Z rjpeters $ 00005 00006 /**************************************************************************** 00007 ** ui.h extension file, included from the uic-generated form implementation. 00008 ** 00009 ** If you wish to add, delete or rename functions or slots use 00010 ** Qt Designer which will update this file, preserving your code. Create an 00011 ** init() function in place of a constructor, and a destroy() function in 00012 ** place of a destructor. 00013 *****************************************************************************/ 00014 00015 void SSCMainForm::init(ModelManager* mgr, nub::soft_ref<SSC> thessc) 00016 { 00017 manager = mgr; 00018 ssc = thessc; 00019 devname = "/dev/ttyS0"; 00020 baud = "9600"; 00021 } 00022 00023 void SSCMainForm::lineEditSerDev_textChanged(const QString &newdevname) 00024 { 00025 // keep the value and wait until <return> is pressed 00026 devname = newdevname; 00027 } 00028 00029 00030 void SSCMainForm::lineEditBaudrate_textChanged( const QString &newbaud ) 00031 { 00032 // keep the value and wait until <return> is pressed 00033 baud = newbaud; 00034 } 00035 00036 00037 void SSCMainForm::sliderSSC1_valueChanged( int val ) 00038 { 00039 ssc->moveRaw(0, val); 00040 } 00041 00042 00043 void SSCMainForm::sliderSSC2_valueChanged( int val ) 00044 { 00045 ssc->moveRaw(1, val); 00046 } 00047 00048 00049 void SSCMainForm::sliderSSC3_valueChanged( int val ) 00050 { 00051 ssc->moveRaw(2, val); 00052 } 00053 00054 00055 void SSCMainForm::sliderSSC4_valueChanged( int val ) 00056 { 00057 ssc->moveRaw(3, val); 00058 } 00059 00060 00061 void SSCMainForm::sliderSSC5_valueChanged( int val ) 00062 { 00063 ssc->moveRaw(4, val); 00064 } 00065 00066 00067 void SSCMainForm::sliderSSC6_valueChanged( int val ) 00068 { 00069 ssc->moveRaw(5, val); 00070 } 00071 00072 00073 void SSCMainForm::sliderSSC7_valueChanged( int val ) 00074 { 00075 ssc->moveRaw(6, val); 00076 } 00077 00078 00079 void SSCMainForm::sliderSSC8_valueChanged( int val ) 00080 { 00081 ssc->moveRaw(7, val); 00082 } 00083 00084 00085 void SSCMainForm::radioButtonDec_clicked() 00086 { 00087 radioButtonHex->setChecked(FALSE); 00088 radioButtonDec->setChecked(TRUE); 00089 lCDNumberSSC1->setDecMode(); 00090 lCDNumberSSC2->setDecMode(); 00091 lCDNumberSSC3->setDecMode(); 00092 lCDNumberSSC4->setDecMode(); 00093 lCDNumberSSC5->setDecMode(); 00094 lCDNumberSSC6->setDecMode(); 00095 lCDNumberSSC7->setDecMode(); 00096 lCDNumberSSC8->setDecMode(); 00097 } 00098 00099 void SSCMainForm::radioButtonHex_clicked() 00100 { 00101 radioButtonHex->setChecked(TRUE); 00102 radioButtonDec->setChecked(FALSE); 00103 lCDNumberSSC1->setHexMode(); 00104 lCDNumberSSC2->setHexMode(); 00105 lCDNumberSSC3->setHexMode(); 00106 lCDNumberSSC4->setHexMode(); 00107 lCDNumberSSC5->setHexMode(); 00108 lCDNumberSSC6->setHexMode(); 00109 lCDNumberSSC7->setHexMode(); 00110 lCDNumberSSC8->setHexMode(); 00111 } 00112 00113 00114 void SSCMainForm::lineEditSerDev_returnPressed() 00115 { 00116 manager->stop(); 00117 manager->setModelParamString("SerialPortDevName", 00118 devname.ascii(), MC_RECURSE); 00119 manager->start(); 00120 LINFO("Switched to device %s", devname.ascii()); 00121 } 00122 00123 00124 void SSCMainForm::lineEditBaudrate_returnPressed() 00125 { 00126 manager->stop(); 00127 manager->setModelParamString("SerialPortBaud", 00128 baud.ascii(), MC_RECURSE); 00129 manager->start(); 00130 LINFO("Switched to baudrate %s", baud.ascii()); 00131 }