mirror of
https://github.com/nasa/trick.git
synced 2025-01-18 02:40:08 +00:00
#738 add Derek's warning
This commit is contained in:
parent
6eeb4cee80
commit
08d0ea5d40
@ -121,6 +121,9 @@ namespace Trick {
|
||||
/** Current file size for data record file in bytes.\n */
|
||||
uint64_t total_bytes_written; /**< trick_io(**) trick_units(--) */
|
||||
|
||||
/** Bool to signify that the warning for reaching max filesize has been printed */
|
||||
bool max_size_warning;
|
||||
|
||||
/** Buffer to hold formatted data ready for disk or other destination.\n */
|
||||
char * writer_buff ; /**< trick_io(**) trick_units(--) */
|
||||
|
||||
|
@ -73,6 +73,7 @@ Trick::DataRecordGroup::DataRecordGroup( std::string in_name ) :
|
||||
writer_num(0),
|
||||
max_file_size(1<<30), // 1 GB
|
||||
total_bytes_written(0),
|
||||
max_size_warning(false),
|
||||
writer_buff(NULL),
|
||||
single_prec_only(false),
|
||||
buffer_type(DR_Buffer),
|
||||
@ -692,6 +693,14 @@ int Trick::DataRecordGroup::write_data(bool must_write) {
|
||||
writer_num++ ;
|
||||
|
||||
}
|
||||
|
||||
if(!max_size_warning && (total_bytes_written > max_file_size)) {
|
||||
std::cerr << "WARNING: Data record max file size " << (max_file_size>>10) << "KB reached. Contact Derek Bankieris regarding any concerns.\n"
|
||||
"https://github.com/nasa/trick/wiki/Data-Record#changing-the-max-file-size-of-a-data-record-group-ascii-and-binary-only"
|
||||
<< std::endl;
|
||||
max_size_warning = true;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&buffer_mutex) ;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user