Gecko3 - CCC Event Weblog
Gecko3 - CCC Event Weblog
Gecko3 - CCC Event Weblog
Erfolgreiche ePaper selbst erstellen
Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.
E.3. Hostsoftware<br />
}<br />
void geckoadm : : c o n f i g u r e ( )<br />
210 {<br />
i f ( ! configPath −>isEmpty ( ) ) {<br />
bool t = gecko−>admOpen ( ) ;<br />
i f ( t == true ) {<br />
statusBar −>showMessage ( t r ( ” Device found and ready ” ) ) ;<br />
215 QFile f ( ∗ c o n f i gPath ) ;<br />
i f ( ! f . open ( QIODevice : : ReadOnly ) ) {<br />
statusBar −>showMessage ( t r ( ” Error : F i l e could not be opend” ) ) ;<br />
return ;<br />
}<br />
220<br />
bool s t a t e = gecko−>admConfigure ( f ) ;<br />
i f ( s t a t e ) {<br />
statusBar −>showMessage ( t r ( ”FPGA s u c c e s s f u l l y c o n f i g u r e d ” ) ) ;<br />
}<br />
225 else {<br />
statusBar −>showMessage ( t r ( ” Error : FPGA could not be c o n f i g u r e d . Check the<br />
FPGA type ” ) ) ;<br />
}<br />
f . c l o s e ( ) ;<br />
230 gecko−>admClose ( ) ;<br />
}<br />
else {<br />
statusBar −>showMessage ( t r ( ” Error : No Gecko found . P l e a s e check the USB<br />
c o n n e c t i o n ” ) ) ;<br />
}<br />
235 }<br />
else {<br />
QMessageBox : : warning ( this , t r ( ”No f i l e s e l e c t e d ” ) , t r ( ”You have to s e l e c t a F i l e<br />
b e f o r e you can c o n f i g u r e the FPGA” ) , QMessageBox : : Ok, QMessageBox : : NoButton ) ;<br />
}<br />
}<br />
240<br />
void geckoadm : : c h o o s e C o n f i g u r e ( )<br />
{<br />
∗ c o n f i g Path = QFileDialog : : getOpenFileName ( this , t r ( ” Choose FPGA c o n f i g F i l e ” ) ,<br />
∗ configPath , ” X i l i n x Bin F i l e s ( ∗ . bin ) ” ) ;<br />
l e C o n f i g F i l e −>setText (∗ c onfigPath ) ;<br />
245 }<br />
void geckoadm : : download ( )<br />
{<br />
i f ( ! downloadPath−>isEmpty ( ) ) {<br />
250 bool t = gecko−>admOpen ( ) ;<br />
i f ( t == true ) {<br />
statusBar −>showMessage ( t r ( ” Device found and ready ” ) ) ;<br />
QFile f ( ∗ downloadPath ) ;<br />
i f ( ! f . open ( QIODevice : : ReadOnly ) ) {<br />
255 statusBar −>showMessage ( t r ( ” Error : F i l e could not be opend” ) ) ;<br />
return ;<br />
}<br />
bool s t a t e = gecko−>admDownload ( f , s e l e c t C o n f i g −>value ( ) ) ;<br />
260 i f ( s t a t e ) {<br />
statusBar −>showMessage ( t r ( ” C o n f i g u r a t i o n s u c c e s s f u l l y downloaded ” ) ) ;<br />
}<br />
else {<br />
statusBar −>showMessage ( t r ( ” Error : C o n f i g u r a t i o n not downloaded ” ) ) ;<br />
265 }<br />
f . c l o s e ( ) ;<br />
gecko−>admClose ( ) ;<br />
Project Report 115