Index: sources/storage/TreatmentLog.h =================================================================== diff -u -rf9e747f0f28df1cc6a33179f0bc78bfc03d486fc -r20d74e4816626ec810d9401752de4903650c9830 --- sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision f9e747f0f28df1cc6a33179f0bc78bfc03d486fc) +++ sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision 20d74e4816626ec810d9401752de4903650c9830) @@ -44,10 +44,14 @@ const int _pendingInterval= 60 ; // 1m int _pendingCounter = 0 ; // + const QString _sep = ","; + QString _treatmentLogPath; const char* _treatmentLogExtUploaded = "txr"; const char* _treatmentLogExtPending = "txr.p"; + const char* _txCodeKey = "Tx Code"; + QFutureWatcher _saveWatcher; QFutureWatcher _exportWatcher; @@ -90,9 +94,10 @@ MEMBER( QString , rTxCode, ""); // content of this value be received from CloudSync App. enum Role { - eValue, eTitle, - eUnit + eValue, + eUnit , + eCount }; enum TreatmentLogIndex { @@ -195,19 +200,19 @@ _unitTextFluid , // eSalineBolusVolume }; - QString title(quint8 vIndex) const { - if (vIndex < _titles.count()) return _titles[vIndex]; - return ""; + QString string(quint8 vIndex , const QStringList &vStringList) const { + QString str = ""; + if (vIndex < vStringList.count()) { + str = vStringList[vIndex]; + str.remove(_sep); + } + return str; } - QString value(quint8 vIndex) const { - if (vIndex < _valuesLog.count()) return _valuesLog[vIndex]; - return ""; - } - QString unit(quint8 vIndex) const { - if (vIndex < _units.count()) return _units[vIndex]; - return ""; - } + QString title(quint8 vIndex) const { return string(vIndex, _titles );} + QString value(quint8 vIndex) const { return string(vIndex, _valuesLog );} + QString unit (quint8 vIndex) const { return string(vIndex, _units );} + // Lists QStringList _valuesLog; @@ -233,6 +238,7 @@ bool exportLog (); void exportLogConcurrent(); bool checkTxCode(); + bool findTxCode (); void sendPending(); // Pending Tx Report