Closed Francklin2 closed 8 years ago
I put a filename option in affichestr2str to switch between the 2 position filenames, but it dont work I"m not sure the PositionMode variable from optionsstr2str.cpp is shared
Changed the déclaration of the positionMode définition in optionsstr2str.h to be accessible in affichestr2str.cpp, It was déclared like this: in optionstr2str.cpp: `#include "optionsstr2str.h"
int PositionMode;
in optionsstr2str.h:
#ifndef OPTIONSSTR2STR_H
extern int PositionMode;` Now there is no more error "PositionMode was not declared" in affichePositionMode.cpp in the compilator, so I guess the variable PositionMode is accessible by affichestr2str.cpp. in affichestr2str.cpp I tried a if/else condition on PositionMode to select filename but in that case , only the first condition is token (auto mode for PositionMode=1),.
`{ args=arga; ui->setupUi(this); /Displays in FullScreen/ this->setWindowFlags(Qt::Window); this->showFullScreen();
/*pick up Base Position from last recorded in rover mode*/
QString filenamebase;
{
if (PositionMode = 1) {filenamebase = "sauvegardepourbase.txt"; } else {filenamebase = "sauvegardepourbaseManual.txt";}
}
int i=0;
QStringList list;
QFile fichierlastpositionforbase(filenamebase);
fichierlastpositionforbase.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream flux(&fichierlastpositionforbase);
QString ligne;
while(! flux.atEnd())
{
ligne = flux.readLine();
list<<ligne;
i=i+1;
}
fichierlastpositionforbase.close();
`
If I put a 2 if like this, it will only take the second condition (manual mode for PositionMode=2). ` {
`if (PositionMode = 1) {filenamebase = "sauvegardepourbase.txt";}
if (PositionMode = 2) {filenamebase = "sauvegardepourbaseManual.txt";}`
} `
I found the mistake I have to put
`if (PositionMode == 1)
Instead of
`if (PositionMode = 1)
Eheh, so basic but you found it !
Yes it was quite basic but sometime the harder to see :)))
It"s functionnal now so I can close this issue (just doing a few graphics modifications)
Only added the radiobuttion to optionsstr2str.ui . I have to put a if condition to select position file in affichestr2str.cpp