@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 2.8.1, 2013-11- |
|
3 | <!-- Written by QtCreator 2.8.1, 2013-11-14T14:43:39. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -1,9 +1,9 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: lfrsgse |
|
2 | # Makefile for building: lfrsgse | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: T |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Nov 12 11:16:36 2013 | |
4 | # Project: gselesia.pro |
|
4 | # Project: gselesia.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 |
# Command: /usr/bin/qmake-qt4 - |
|
6 | # Command: /usr/bin/qmake-qt4 -o Makefile gselesia.pro | |
7 | ############################################################################# |
|
7 | ############################################################################# | |
8 |
|
8 | |||
9 | ####### Compiler, tools and options |
|
9 | ####### Compiler, tools and options | |
@@ -174,7 +174,7 Makefile: gselesia.pro /usr/lib64/qt4/m | |||||
174 | /usr/lib64/libQtCore.prl \ |
|
174 | /usr/lib64/libQtCore.prl \ | |
175 | /usr/lib64/libQtGui.prl \ |
|
175 | /usr/lib64/libQtGui.prl \ | |
176 | /usr/lib64/libQtNetwork.prl |
|
176 | /usr/lib64/libQtNetwork.prl | |
177 |
$(QMAKE) |
|
177 | $(QMAKE) -o Makefile gselesia.pro | |
178 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
178 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
179 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
179 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
180 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
180 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
@@ -205,7 +205,7 Makefile: gselesia.pro /usr/lib64/qt4/m | |||||
205 | /usr/lib64/libQtGui.prl: |
|
205 | /usr/lib64/libQtGui.prl: | |
206 | /usr/lib64/libQtNetwork.prl: |
|
206 | /usr/lib64/libQtNetwork.prl: | |
207 | qmake: FORCE |
|
207 | qmake: FORCE | |
208 |
@$(QMAKE) |
|
208 | @$(QMAKE) -o Makefile gselesia.pro | |
209 |
|
209 | |||
210 | dist: |
|
210 | dist: | |
211 | @$(CHK_DIR_EXISTS) .tmp/lfrsgse1.0.0 || $(MKDIR) .tmp/lfrsgse1.0.0 |
|
211 | @$(CHK_DIR_EXISTS) .tmp/lfrsgse1.0.0 || $(MKDIR) .tmp/lfrsgse1.0.0 | |
@@ -236,13 +236,11 compiler_moc_header_clean: | |||||
236 | moc_mainwindow.cpp: lfrxmlhandler.h \ |
|
236 | moc_mainwindow.cpp: lfrxmlhandler.h \ | |
237 | lfrxmlwriter.h \ |
|
237 | lfrxmlwriter.h \ | |
238 | mainwindowui.h \ |
|
238 | mainwindowui.h \ | |
239 | lfrspectrogram.h \ |
|
|||
240 | lfrxmlparser.h \ |
|
239 | lfrxmlparser.h \ | |
241 | mainwindow.h |
|
240 | mainwindow.h | |
242 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp |
|
241 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp | |
243 |
|
242 | |||
244 |
moc_mainwindowui.cpp: |
|
243 | moc_mainwindowui.cpp: mainwindowui.h | |
245 | mainwindowui.h |
|
|||
246 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindowui.h -o moc_mainwindowui.cpp |
|
244 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindowui.h -o moc_mainwindowui.cpp | |
247 |
|
245 | |||
248 | moc_lfrxmlhandler.cpp: lfrxmlhandler.h |
|
246 | moc_lfrxmlhandler.cpp: lfrxmlhandler.h | |
@@ -295,7 +293,6 main.o: main.cpp mainwindow.h \ | |||||
295 | lfrxmlhandler.h \ |
|
293 | lfrxmlhandler.h \ | |
296 | lfrxmlwriter.h \ |
|
294 | lfrxmlwriter.h \ | |
297 | mainwindowui.h \ |
|
295 | mainwindowui.h \ | |
298 | lfrspectrogram.h \ |
|
|||
299 | lfrxmlparser.h |
|
296 | lfrxmlparser.h | |
300 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp |
|
297 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp | |
301 |
|
298 | |||
@@ -303,12 +300,10 mainwindow.o: mainwindow.cpp mainwindow. | |||||
303 | lfrxmlhandler.h \ |
|
300 | lfrxmlhandler.h \ | |
304 | lfrxmlwriter.h \ |
|
301 | lfrxmlwriter.h \ | |
305 | mainwindowui.h \ |
|
302 | mainwindowui.h \ | |
306 | lfrspectrogram.h \ |
|
|||
307 | lfrxmlparser.h |
|
303 | lfrxmlparser.h | |
308 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp |
|
304 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp | |
309 |
|
305 | |||
310 |
mainwindowui.o: mainwindowui.cpp mainwindowui.h |
|
306 | mainwindowui.o: mainwindowui.cpp mainwindowui.h | |
311 | lfrspectrogram.h |
|
|||
312 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindowui.o mainwindowui.cpp |
|
307 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindowui.o mainwindowui.cpp | |
313 |
|
308 | |||
314 | lfrxmlhandler.o: lfrxmlhandler.cpp lfrxmlhandler.h |
|
309 | lfrxmlhandler.o: lfrxmlhandler.cpp lfrxmlhandler.h |
@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 2.8.1, 2013-11- |
|
3 | <!-- Written by QtCreator 2.8.1, 2013-11-12T11:12:03. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -87,7 +87,7 void EnterMode::sendEnterMode( unsigned | |||||
87 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; |
|
87 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; | |
88 | packet.serviceType = TC_TYPE_DEFAULT; |
|
88 | packet.serviceType = TC_TYPE_DEFAULT; | |
89 | packet.serviceSubType = TC_SUBTYPE_ENTER_MODE; |
|
89 | packet.serviceSubType = TC_SUBTYPE_ENTER_MODE; | |
90 |
packet.sourceID = SID_TC_D |
|
90 | packet.sourceID = SID_TC_GROUND; | |
91 | packet.spare = 0x00; |
|
91 | packet.spare = 0x00; | |
92 | packet.mode = mode; |
|
92 | packet.mode = mode; | |
93 | packet.enterModeTime[0] = 0x00; |
|
93 | packet.enterModeTime[0] = 0x00; | |
@@ -146,7 +146,7 void EnterMode::sendReset() | |||||
146 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; |
|
146 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; | |
147 | packet.serviceType = TC_TYPE_DEFAULT; |
|
147 | packet.serviceType = TC_TYPE_DEFAULT; | |
148 | packet.serviceSubType = TC_SUBTYPE_RESET; |
|
148 | packet.serviceSubType = TC_SUBTYPE_RESET; | |
149 |
packet.sourceID = SID_TC_D |
|
149 | packet.sourceID = SID_TC_GROUND; | |
150 |
|
150 | |||
151 | parameterDump->GetCRCAsTwoBytes((unsigned char*) &packet, crcAsTwoBytes, |
|
151 | parameterDump->GetCRCAsTwoBytes((unsigned char*) &packet, crcAsTwoBytes, | |
152 | PACKET_LENGTH_TC_LFR_RESET + CCSDS_TC_TM_PACKET_OFFSET - 2); |
|
152 | PACKET_LENGTH_TC_LFR_RESET + CCSDS_TC_TM_PACKET_OFFSET - 2); | |
@@ -172,7 +172,7 void EnterMode::sendUpdateInfo() | |||||
172 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; |
|
172 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; | |
173 | packet.serviceType = TC_TYPE_DEFAULT; |
|
173 | packet.serviceType = TC_TYPE_DEFAULT; | |
174 | packet.serviceSubType = TC_SUBTYPE_UPDATE_INFO; |
|
174 | packet.serviceSubType = TC_SUBTYPE_UPDATE_INFO; | |
175 |
packet.sourceID = SID_TC_D |
|
175 | packet.sourceID = SID_TC_GROUND; | |
176 |
|
176 | |||
177 | packet.set1 = 0x00; |
|
177 | packet.set1 = 0x00; | |
178 | packet.set2 = 0x00; |
|
178 | packet.set2 = 0x00; | |
@@ -229,7 +229,7 void EnterMode::sendEnableCalibration() | |||||
229 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; |
|
229 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; | |
230 | packet.serviceType = TC_TYPE_DEFAULT; |
|
230 | packet.serviceType = TC_TYPE_DEFAULT; | |
231 | packet.serviceSubType = TC_SUBTYPE_ENABLE_CALIBRATION; |
|
231 | packet.serviceSubType = TC_SUBTYPE_ENABLE_CALIBRATION; | |
232 |
packet.sourceID = SID_TC_D |
|
232 | packet.sourceID = SID_TC_GROUND; | |
233 |
|
233 | |||
234 | parameterDump->GetCRCAsTwoBytes((unsigned char*) &packet, crcAsTwoBytes, |
|
234 | parameterDump->GetCRCAsTwoBytes((unsigned char*) &packet, crcAsTwoBytes, | |
235 | PACKET_LENGTH_TC_LFR_ENABLE_CALIBRATION + CCSDS_TC_TM_PACKET_OFFSET - 2); |
|
235 | PACKET_LENGTH_TC_LFR_ENABLE_CALIBRATION + CCSDS_TC_TM_PACKET_OFFSET - 2); | |
@@ -255,7 +255,7 void EnterMode::sendDisableCalibration() | |||||
255 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; |
|
255 | packet.ccsdsSecHeaderFlag_pusVersion_ack = 0x19; | |
256 | packet.serviceType = TC_TYPE_DEFAULT; |
|
256 | packet.serviceType = TC_TYPE_DEFAULT; | |
257 | packet.serviceSubType = TC_SUBTYPE_DISABLE_CALIBRATION; |
|
257 | packet.serviceSubType = TC_SUBTYPE_DISABLE_CALIBRATION; | |
258 |
packet.sourceID = SID_TC_D |
|
258 | packet.sourceID = SID_TC_GROUND; | |
259 |
|
259 | |||
260 | parameterDump->GetCRCAsTwoBytes((unsigned char*) &packet, crcAsTwoBytes, |
|
260 | parameterDump->GetCRCAsTwoBytes((unsigned char*) &packet, crcAsTwoBytes, | |
261 | PACKET_LENGTH_TC_LFR_DISABLE_CALIBRATION + CCSDS_TC_TM_PACKET_OFFSET - 2); |
|
261 | PACKET_LENGTH_TC_LFR_DISABLE_CALIBRATION + CCSDS_TC_TM_PACKET_OFFSET - 2); |
@@ -135,8 +135,9 TMStatistics::TMStatistics(QWidget *pare | |||||
135 | button_chooseDir = new QPushButton("choose dir"); |
|
135 | button_chooseDir = new QPushButton("choose dir"); | |
136 |
|
136 | |||
137 | //QCheckBox |
|
137 | //QCheckBox | |
138 | checkbox_record = new QCheckBox("Record packets"); |
|
|||
139 | checkbox_packetLog = new QCheckBox("Log packets"); |
|
138 | checkbox_packetLog = new QCheckBox("Log packets"); | |
|
139 | checkbox_packetRecording = new QCheckBox("Store packets (RAW)"); | |||
|
140 | checkbox_CSVPacketRecording = new QCheckBox("Store Packets (CSV)"); | |||
140 | label_currentDir = new QLabel("Current Dir: -"); |
|
141 | label_currentDir = new QLabel("Current Dir: -"); | |
141 |
|
142 | |||
142 | //********** |
|
143 | //********** | |
@@ -154,8 +155,10 TMStatistics::TMStatistics(QWidget *pare | |||||
154 | readSettings(); |
|
155 | readSettings(); | |
155 | logFile = new QFile(); |
|
156 | logFile = new QFile(); | |
156 | packetLogFile = new QFile(); |
|
157 | packetLogFile = new QFile(); | |
|
158 | csvPacketRecordFile = new QFile(); | |||
157 | logFileEn = false; |
|
159 | logFileEn = false; | |
158 | packetLogFileEn = false; |
|
160 | packetLogFileEn = false; | |
|
161 | csvPacketRecordFileEn = false; | |||
159 |
|
162 | |||
160 | initConstants(); |
|
163 | initConstants(); | |
161 |
|
164 | |||
@@ -176,8 +179,12 TMStatistics::TMStatistics(QWidget *pare | |||||
176 | connect(this->button_reset_stat, SIGNAL(clicked()), this, SLOT(resetStatistics())); |
|
179 | connect(this->button_reset_stat, SIGNAL(clicked()), this, SLOT(resetStatistics())); | |
177 | connect(this->button_chooseDir, SIGNAL(clicked()), this, SLOT(chooseDir())); |
|
180 | connect(this->button_chooseDir, SIGNAL(clicked()), this, SLOT(chooseDir())); | |
178 |
|
181 | |||
179 |
connect(this->checkbox_ |
|
182 | connect(this->checkbox_packetLog, SIGNAL(stateChanged(int)), | |
180 | connect(this->checkbox_packetLog, SIGNAL(stateChanged(int)), this, SLOT(logPackets(int))); |
|
183 | this, SLOT(logPackets(int))); | |
|
184 | connect(this->checkbox_packetRecording, SIGNAL(stateChanged(int)), | |||
|
185 | this, SLOT(storePackets(int))); | |||
|
186 | connect(this->checkbox_CSVPacketRecording, SIGNAL(stateChanged(int)), | |||
|
187 | this, SLOT(storeCSVPackets(int))); | |||
181 | } |
|
188 | } | |
182 |
|
189 | |||
183 | void TMStatistics::initConstants() |
|
190 | void TMStatistics::initConstants() | |
@@ -355,8 +362,9 void TMStatistics::buildMonitor() | |||||
355 | layout_last->addWidget(label_UNKNOWN, 3, 0, 1, 1); |
|
362 | layout_last->addWidget(label_UNKNOWN, 3, 0, 1, 1); | |
356 | layout_last->addWidget(label_UNKNOWN_nb, 3, 1, 1, 1); |
|
363 | layout_last->addWidget(label_UNKNOWN_nb, 3, 1, 1, 1); | |
357 |
|
364 | |||
358 | layout_record->addWidget(checkbox_record); |
|
|||
359 | layout_record->addWidget(checkbox_packetLog); |
|
365 | layout_record->addWidget(checkbox_packetLog); | |
|
366 | layout_record->addWidget(checkbox_packetRecording); | |||
|
367 | layout_record->addWidget(checkbox_CSVPacketRecording); | |||
360 | layout_record->addWidget(button_chooseDir); |
|
368 | layout_record->addWidget(button_chooseDir); | |
361 | layout_record->addWidget(label_currentDir); |
|
369 | layout_record->addWidget(label_currentDir); | |
362 | layout_record->insertStretch(4, 1); |
|
370 | layout_record->insertStretch(4, 1); | |
@@ -674,10 +682,10 unsigned int TMStatistics::getSID(TMPack | |||||
674 | unsigned char typ, unsigned char sub) |
|
682 | unsigned char typ, unsigned char sub) | |
675 | { |
|
683 | { | |
676 | unsigned int sid = 0; |
|
684 | unsigned int sid = 0; | |
677 | QByteArray packetAsAnArray; |
|
|||
678 | QString packetName; |
|
685 | QString packetName; | |
679 | QTime currentTime; |
|
686 | QTime currentTime; | |
680 | QDate currentDate; |
|
687 | QDate currentDate; | |
|
688 | unsigned int i; | |||
681 |
|
689 | |||
682 | if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_TC_EXE) |
|
690 | if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_TC_EXE) | |
683 | & (typ == TM_TYPE_TC_EXE) & (sub == TM_SUBTYPE_EXE_NOK)) |
|
691 | & (typ == TM_TYPE_TC_EXE) & (sub == TM_SUBTYPE_EXE_NOK)) | |
@@ -697,16 +705,14 unsigned int TMStatistics::getSID(TMPack | |||||
697 |
|
705 | |||
698 | if (logFileEn == true) |
|
706 | if (logFileEn == true) | |
699 | { |
|
707 | { | |
700 | // packetAsAnArray = QByteArray::fromRawData((char *) &packet->Value[4], (packet->size-4)); |
|
|||
701 | logFile->write((char *) &packet->Value[4], (packet->size-4)); |
|
708 | logFile->write((char *) &packet->Value[4], (packet->size-4)); | |
702 | // *(this->logFileStrm) |
|
|||
703 | // << packetAsAnArray; |
|
|||
704 | } |
|
709 | } | |
705 |
|
710 | |||
|
711 | currentTime = QTime::currentTime(); | |||
|
712 | currentDate = QDate::currentDate(); | |||
|
713 | ||||
706 | if (packetLogFileEn == true) |
|
714 | if (packetLogFileEn == true) | |
707 | { |
|
715 | { | |
708 | currentTime = QTime::currentTime(); |
|
|||
709 | currentDate = QDate::currentDate(); |
|
|||
710 | packetName = getPacketName( typ, sub, sid); |
|
716 | packetName = getPacketName( typ, sub, sid); | |
711 |
|
717 | |||
712 | *(this->packetLogFileStrm) |
|
718 | *(this->packetLogFileStrm) | |
@@ -723,6 +729,23 unsigned int TMStatistics::getSID(TMPack | |||||
723 | << endl; |
|
729 | << endl; | |
724 | } |
|
730 | } | |
725 |
|
731 | |||
|
732 | if (csvPacketRecordFileEn == true) | |||
|
733 | { | |||
|
734 | *(this->packetLogFileStrm) | |||
|
735 | << QString::number(currentDate.year()) + " " | |||
|
736 | << QString::number(currentDate.month()) + " " | |||
|
737 | << QString::number(currentDate.day()) + " " | |||
|
738 | << QTime::currentTime().toString() + ":" | |||
|
739 | << QString::number(currentTime.msec()); | |||
|
740 | for (i=0; i< packet->size; i++) | |||
|
741 | { | |||
|
742 | *(this->packetLogFileStrm) | |||
|
743 | << ", " + QString::number( packet->Value[i] ); | |||
|
744 | } | |||
|
745 | *(this->packetLogFileStrm) | |||
|
746 | << endl; | |||
|
747 | } | |||
|
748 | ||||
726 | return sid; |
|
749 | return sid; | |
727 | } |
|
750 | } | |
728 |
|
751 | |||
@@ -747,7 +770,8 void TMStatistics::buildFileName() | |||||
747 |
|
770 | |||
748 | if(this->logFile->isOpen()) this->logFile->close(); |
|
771 | if(this->logFile->isOpen()) this->logFile->close(); | |
749 | this->logFile->setFileName( prefix + "packet_record.data"); |
|
772 | this->logFile->setFileName( prefix + "packet_record.data"); | |
750 |
if(this->logFile->open(QIODevice::WriteOnly)) |
|
773 | if(this->logFile->open(QIODevice::WriteOnly)) | |
|
774 | this->logFileStrm = new QTextStream(this->logFile); | |||
751 | } |
|
775 | } | |
752 |
|
776 | |||
753 | void TMStatistics::buildPacketLogFileName() |
|
777 | void TMStatistics::buildPacketLogFileName() | |
@@ -771,7 +795,33 void TMStatistics::buildPacketLogFileNam | |||||
771 |
|
795 | |||
772 | if(this->packetLogFile->isOpen()) this->packetLogFile->close(); |
|
796 | if(this->packetLogFile->isOpen()) this->packetLogFile->close(); | |
773 | this->packetLogFile->setFileName( prefix + "packet_log.data"); |
|
797 | this->packetLogFile->setFileName( prefix + "packet_log.data"); | |
774 |
if(this->packetLogFile->open(QIODevice::WriteOnly)) |
|
798 | if(this->packetLogFile->open(QIODevice::WriteOnly)) | |
|
799 | this->packetLogFileStrm = new QTextStream(this->packetLogFile); | |||
|
800 | } | |||
|
801 | ||||
|
802 | void TMStatistics::buildCSVPacketRecordFileName() | |||
|
803 | { | |||
|
804 | QTime time; | |||
|
805 | QDate date; | |||
|
806 | QString dateTime; | |||
|
807 | QString prefix; | |||
|
808 | ||||
|
809 | date = QDate::currentDate(); | |||
|
810 | time = QTime::currentTime(); | |||
|
811 | ||||
|
812 | dateTime = QString::number( date.year() ) + "_" | |||
|
813 | + QString::number( date.month() ) + "_" | |||
|
814 | + QString::number( date.day() ) + "-" | |||
|
815 | + QString::number( time.hour() ) + "_" | |||
|
816 | + QString::number( time.minute() ) + "_" | |||
|
817 | + QString::number( time.second() ); | |||
|
818 | ||||
|
819 | prefix = defaultStorageDirectory + "/" + dateTime + "_" ; | |||
|
820 | ||||
|
821 | if(this->csvPacketRecordFile->isOpen()) this->csvPacketRecordFile->close(); | |||
|
822 | this->csvPacketRecordFile->setFileName( prefix + "packet_record.csv"); | |||
|
823 | if(this->csvPacketRecordFile->open(QIODevice::WriteOnly)) | |||
|
824 | this->csvPacketRecordFileStrm = new QTextStream(this->csvPacketRecordFile); | |||
775 | } |
|
825 | } | |
776 |
|
826 | |||
777 | void TMStatistics::storePackets( int state ) |
|
827 | void TMStatistics::storePackets( int state ) | |
@@ -788,6 +838,20 void TMStatistics::storePackets( int sta | |||||
788 | } |
|
838 | } | |
789 | } |
|
839 | } | |
790 |
|
840 | |||
|
841 | void TMStatistics::storeCSVPackets( int state ) | |||
|
842 | { | |||
|
843 | if (state == Qt::Checked) | |||
|
844 | { | |||
|
845 | buildCSVPacketRecordFileName(); | |||
|
846 | csvPacketRecordFileEn = true; | |||
|
847 | } | |||
|
848 | else | |||
|
849 | { | |||
|
850 | if(this->csvPacketRecordFile->isOpen()) this->csvPacketRecordFile->close(); | |||
|
851 | csvPacketRecordFileEn = false; | |||
|
852 | } | |||
|
853 | } | |||
|
854 | ||||
791 | void TMStatistics::logPackets( int state ) |
|
855 | void TMStatistics::logPackets( int state ) | |
792 | { |
|
856 | { | |
793 | if (state == Qt::Checked) |
|
857 | if (state == Qt::Checked) |
@@ -209,15 +209,19 public: | |||||
209 | QPushButton *button_chooseDir; |
|
209 | QPushButton *button_chooseDir; | |
210 |
|
210 | |||
211 | //QCheckBox |
|
211 | //QCheckBox | |
212 |
QCheckBox *checkbox_ |
|
212 | QCheckBox *checkbox_packetRecording; | |
213 | QCheckBox *checkbox_packetLog; |
|
213 | QCheckBox *checkbox_packetLog; | |
|
214 | QCheckBox *checkbox_CSVPacketRecording; | |||
214 |
|
215 | |||
215 | QFile *logFile; |
|
216 | QFile *logFile; | |
216 | QFile *packetLogFile; |
|
217 | QFile *packetLogFile; | |
|
218 | QFile *csvPacketRecordFile; | |||
217 | QTextStream *logFileStrm; |
|
219 | QTextStream *logFileStrm; | |
218 | QTextStream *packetLogFileStrm; |
|
220 | QTextStream *packetLogFileStrm; | |
|
221 | QTextStream *csvPacketRecordFileStrm; | |||
219 | bool logFileEn; |
|
222 | bool logFileEn; | |
220 | bool packetLogFileEn; |
|
223 | bool packetLogFileEn; | |
|
224 | bool csvPacketRecordFileEn; | |||
221 | QString defaultStorageDirectory; |
|
225 | QString defaultStorageDirectory; | |
222 |
|
226 | |||
223 | // QGroupBox |
|
227 | // QGroupBox | |
@@ -238,9 +242,11 public slots: | |||||
238 | unsigned int sid, unsigned int length, |
|
242 | unsigned int sid, unsigned int length, | |
239 | unsigned int coarse_t, unsigned int fine_t); |
|
243 | unsigned int coarse_t, unsigned int fine_t); | |
240 | void storePackets(int state); |
|
244 | void storePackets(int state); | |
|
245 | void storeCSVPackets( int state ); | |||
241 | void logPackets(int state); |
|
246 | void logPackets(int state); | |
242 | void buildFileName(); |
|
247 | void buildFileName(); | |
243 | void buildPacketLogFileName(); |
|
248 | void buildPacketLogFileName(); | |
|
249 | void buildCSVPacketRecordFileName(); | |||
244 | void readSettings(); |
|
250 | void readSettings(); | |
245 | void writeSettings(); |
|
251 | void writeSettings(); | |
246 | void chooseDir(); |
|
252 | void chooseDir(); |
@@ -1,9 +1,9 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: libwfdisplay.so.1.0.0 |
|
2 | # Makefile for building: libwfdisplay.so.1.0.0 | |
3 |
# Generated by qmake (2.01a) (Qt 4.8. |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Nov 12 11:17:03 2013 | |
4 | # Project: wfdisplay.pro |
|
4 | # Project: wfdisplay.pro | |
5 | # Template: lib |
|
5 | # Template: lib | |
6 |
# Command: /usr/bin/qmake-qt4 - |
|
6 | # Command: /usr/bin/qmake-qt4 -o Makefile wfdisplay.pro | |
7 | ############################################################################# |
|
7 | ############################################################################# | |
8 |
|
8 | |||
9 | ####### Compiler, tools and options |
|
9 | ####### Compiler, tools and options | |
@@ -80,6 +80,8 DIST = /usr/lib64/qt4/mkspecs/c | |||||
80 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
80 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
81 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
81 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
82 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
82 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
|
83 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |||
|
84 | /usr/lib64/qt4/mkspecs/features/dll.prf \ | |||
83 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
85 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
84 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
86 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
85 | /usr/lib64/qt4/mkspecs/features/qt.prf \ |
|
87 | /usr/lib64/qt4/mkspecs/features/qt.prf \ | |
@@ -153,6 +155,8 Makefile: wfdisplay.pro /usr/lib64/qt4/ | |||||
153 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
155 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
154 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
156 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
155 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
157 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
|
158 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |||
|
159 | /usr/lib64/qt4/mkspecs/features/dll.prf \ | |||
156 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
160 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
157 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
161 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
158 | /usr/lib64/qt4/mkspecs/features/qt.prf \ |
|
162 | /usr/lib64/qt4/mkspecs/features/qt.prf \ | |
@@ -165,7 +169,7 Makefile: wfdisplay.pro /usr/lib64/qt4/ | |||||
165 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
169 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
166 | /usr/lib64/libQtGui.prl \ |
|
170 | /usr/lib64/libQtGui.prl \ | |
167 | /usr/lib64/libQtCore.prl |
|
171 | /usr/lib64/libQtCore.prl | |
168 |
$(QMAKE) |
|
172 | $(QMAKE) -o Makefile wfdisplay.pro | |
169 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
173 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
170 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
174 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
171 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
175 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
@@ -180,6 +184,8 Makefile: wfdisplay.pro /usr/lib64/qt4/ | |||||
180 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
184 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: | |
181 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
185 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
182 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
186 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
|
187 | /usr/lib64/qt4/mkspecs/features/shared.prf: | |||
|
188 | /usr/lib64/qt4/mkspecs/features/dll.prf: | |||
183 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
189 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
184 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
190 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
185 | /usr/lib64/qt4/mkspecs/features/qt.prf: |
|
191 | /usr/lib64/qt4/mkspecs/features/qt.prf: | |
@@ -193,7 +199,7 Makefile: wfdisplay.pro /usr/lib64/qt4/ | |||||
193 | /usr/lib64/libQtGui.prl: |
|
199 | /usr/lib64/libQtGui.prl: | |
194 | /usr/lib64/libQtCore.prl: |
|
200 | /usr/lib64/libQtCore.prl: | |
195 | qmake: FORCE |
|
201 | qmake: FORCE | |
196 |
@$(QMAKE) |
|
202 | @$(QMAKE) -o Makefile wfdisplay.pro | |
197 |
|
203 | |||
198 | dist: |
|
204 | dist: | |
199 | @$(CHK_DIR_EXISTS) .tmp/wfdisplay1.0.0 || $(MKDIR) .tmp/wfdisplay1.0.0 |
|
205 | @$(CHK_DIR_EXISTS) .tmp/wfdisplay1.0.0 || $(MKDIR) .tmp/wfdisplay1.0.0 |
@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 2.8. |
|
3 | <!-- Written by QtCreator 2.8.1, 2013-11-12T11:16:00. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -536,14 +536,22 void WFPage::storeWfrm() | |||||
536 |
|
536 | |||
537 | void WFPage::buildFileName() |
|
537 | void WFPage::buildFileName() | |
538 | { |
|
538 | { | |
539 | QString date; |
|
539 | QTime time; | |
540 |
Q |
|
540 | QDate date; | |
|
541 | QString dateTime; | |||
541 | QString prefix; |
|
542 | QString prefix; | |
542 |
|
543 | |||
543 |
date = QDate::currentDate() |
|
544 | date = QDate::currentDate(); | |
544 |
time = QTime::currentTime() |
|
545 | time = QTime::currentTime(); | |
545 |
|
546 | |||
546 | prefix = defaultStorageDirectory + "/" + date + "_" + time + "_" + pageTitle ; |
|
547 | dateTime = QString::number( date.year() ) + "_" | |
|
548 | + QString::number( date.month() ) + "_" | |||
|
549 | + QString::number( date.day() ) + "-" | |||
|
550 | + QString::number( time.hour() ) + "_" | |||
|
551 | + QString::number( time.minute() ) + "_" | |||
|
552 | + QString::number( time.second() ); | |||
|
553 | ||||
|
554 | prefix = defaultStorageDirectory + "/" + dateTime + "_" + pageTitle ; | |||
547 |
|
555 | |||
548 | if(this->logFile->isOpen()) this->logFile->close(); |
|
556 | if(this->logFile->isOpen()) this->logFile->close(); | |
549 | this->logFile->setFileName( prefix + ".data"); |
|
557 | this->logFile->setFileName( prefix + ".data"); |
General Comments 0
You need to be logged in to leave comments.
Login now