mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 21:27:54 +00:00
#836 remove all S_default.dat stuff
This commit is contained in:
parent
101ae55bb0
commit
82bae3b0d0
@ -135,10 +135,6 @@ The simulation-specific executive source code file.
|
|||||||
|
|
||||||
The simulation-specific object code link list file.
|
The simulation-specific object code link list file.
|
||||||
|
|
||||||
=item B<S_default.dat>
|
|
||||||
|
|
||||||
The simulation-specific default initialization data file.
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
@ -280,7 +276,6 @@ tidy:
|
|||||||
-rm -f S_source.hh S_sie.resource
|
-rm -f S_source.hh S_sie.resource
|
||||||
-rm -f S_main* T_main*
|
-rm -f S_main* T_main*
|
||||||
-rm -f build/Makefile_*
|
-rm -f build/Makefile_*
|
||||||
-rm -f S_default.dat
|
|
||||||
|
|
||||||
clean: tidy
|
clean: tidy
|
||||||
-rm -f DP_Product/DP_rt_frame DP_Product/DP_rt_itimer
|
-rm -f DP_Product/DP_rt_frame DP_Product/DP_rt_itimer
|
||||||
|
@ -326,12 +326,6 @@ namespace Trick {
|
|||||||
*/
|
*/
|
||||||
virtual int load_checkpoint_job() ;
|
virtual int load_checkpoint_job() ;
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls the MemoryManager restore_managed_memory method with S_default.dat
|
|
||||||
* @return always 0
|
|
||||||
*/
|
|
||||||
virtual int load_default_data() ;
|
|
||||||
|
|
||||||
// Removed all doxygen documents for functions that have documents in the parent class since
|
// Removed all doxygen documents for functions that have documents in the parent class since
|
||||||
// Doxygen inherits the documents from the parent class automatically.
|
// Doxygen inherits the documents from the parent class automatically.
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ use lib "$RealBin/pm" ;
|
|||||||
use parse_s_define ;
|
use parse_s_define ;
|
||||||
use gte ;
|
use gte ;
|
||||||
use s_source ;
|
use s_source ;
|
||||||
use default_data ;
|
|
||||||
use trick_print ;
|
use trick_print ;
|
||||||
use trick_version ;
|
use trick_version ;
|
||||||
|
|
||||||
@ -81,13 +80,9 @@ trick_print($sim{fh}, "S_source.c\n", "title_white", $sim{args}{v});
|
|||||||
s_source( \%sim ) ;
|
s_source( \%sim ) ;
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
# Make Default Data
|
# close
|
||||||
|
|
||||||
chdir ($cwd) ;
|
chdir ($cwd) ;
|
||||||
trick_print($sim{fh}, "Writing ", "title_blue" , $sim{args}{v}) ;
|
|
||||||
trick_print($sim{fh}, "Default_data\n", "title_white" , $sim{args}{v}) ;
|
|
||||||
make_default_data( \%sim ) ;
|
|
||||||
|
|
||||||
close OUTFILE ;
|
close OUTFILE ;
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
@ -124,10 +119,6 @@ See the Trick User's guide for B<CP>
|
|||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
=item B<-d>
|
|
||||||
|
|
||||||
S_default.dat and Default_data (Default data files)
|
|
||||||
|
|
||||||
=item B<-e>
|
=item B<-e>
|
||||||
|
|
||||||
S_main_\${TRICK_HOST_CPU}.exe (Master executable)
|
S_main_\${TRICK_HOST_CPU}.exe (Master executable)
|
||||||
|
@ -1,93 +0,0 @@
|
|||||||
package default_data ;
|
|
||||||
|
|
||||||
use Exporter ();
|
|
||||||
@ISA = qw(Exporter);
|
|
||||||
@EXPORT = qw(make_default_data);
|
|
||||||
|
|
||||||
use strict ;
|
|
||||||
|
|
||||||
use lib $ENV{"TRICK_HOME"} . "/bin/pm" ;
|
|
||||||
use gte ;
|
|
||||||
use trick_print ;
|
|
||||||
use get_paths ;
|
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
|
||||||
# Make Default Data
|
|
||||||
|
|
||||||
sub make_default_data($) {
|
|
||||||
|
|
||||||
my ($sim_ref) = @_ ;
|
|
||||||
my $title ;
|
|
||||||
my @all_lines ;
|
|
||||||
my $date = localtime() ;
|
|
||||||
my $user ;
|
|
||||||
my @include_paths ;
|
|
||||||
|
|
||||||
if (open FILE, "Title") {
|
|
||||||
@all_lines = <FILE> ;
|
|
||||||
$title = join "" , @all_lines ;
|
|
||||||
chomp $title ;
|
|
||||||
close FILE ;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$title = "No Title Specified" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = gte("USER");
|
|
||||||
chomp $user ;
|
|
||||||
|
|
||||||
open S_DEF, ">S_default.dat" or die "Could not open S_default.dat for writing" ;
|
|
||||||
|
|
||||||
my ($sec,$min,$hour,$mday,$mon,$year) = localtime ;
|
|
||||||
$year += 1900 ;
|
|
||||||
$mon += 1 ;
|
|
||||||
my ($login) = getpwuid($<) ;
|
|
||||||
|
|
||||||
#---------------------------
|
|
||||||
# Print version - date
|
|
||||||
printf S_DEF "\n// Created $year/%02d/%02d %02d\:%02d\:%02d $login\n",
|
|
||||||
$mon , $mday , $hour , $min , $sec ;
|
|
||||||
|
|
||||||
print S_DEF "
|
|
||||||
// TITLE: $title
|
|
||||||
// DATE: $date
|
|
||||||
// USER: $user\n\n" ;
|
|
||||||
|
|
||||||
my @default_data_list ;
|
|
||||||
@include_paths = get_include_paths() ;
|
|
||||||
|
|
||||||
foreach my $dd_comment ( @{$$sim_ref{default_data}} ) {
|
|
||||||
$dd_comment =~ s/\(\s*\(/\(/sg ;
|
|
||||||
$dd_comment =~ s/\)\s*\)/\)/sg ;
|
|
||||||
@default_data_list = $dd_comment =~ m/\((.+?)\)/sg ;
|
|
||||||
foreach my $dd ( @default_data_list ) {
|
|
||||||
my $file_found = 0 ;
|
|
||||||
my ($type , $var , $file_name) = split /\s+/ , $dd ;
|
|
||||||
if ( $file_name eq "" ) {
|
|
||||||
# not enough fields
|
|
||||||
trick_print($$sim_ref{fh},"Default data does not have \"TYPE VAR FILE\" syntax\n$dd\n", "title_red", $$sim_ref{args}{v}) ;
|
|
||||||
exit -1 ;
|
|
||||||
}
|
|
||||||
print S_DEF "\n// from $type $var $file_name\n\n" ;
|
|
||||||
(my $cc = gte("TRICK_CC")) =~ s/\n// ;
|
|
||||||
foreach my $inc ( @include_paths ) {
|
|
||||||
if ( -e "$inc/$file_name") {
|
|
||||||
open DEFDATA, "$cc -E -x c -D$type=$var $inc/$file_name |" ;
|
|
||||||
while ( <DEFDATA> ) {
|
|
||||||
print S_DEF if ( !/^#\s\d+/ )
|
|
||||||
}
|
|
||||||
$file_found = 1 ;
|
|
||||||
last ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( $file_found == 0 ) {
|
|
||||||
print "\033[31mCould not find default data file $file_name\033[00m\n" ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
@ -39,8 +39,6 @@ The simulation-specific executive source code file.
|
|||||||
\fIbuild/S_library_list\fP
|
\fIbuild/S_library_list\fP
|
||||||
The simulation-specific object code link list file.
|
The simulation-specific object code link list file.
|
||||||
.TP
|
.TP
|
||||||
\fIS_default.dat\fP
|
|
||||||
The simulation-specific default initialization data file.
|
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
.TP
|
.TP
|
||||||
\fB${TRICK_CPFLAGS}\fP
|
\fB${TRICK_CPFLAGS}\fP
|
||||||
|
@ -214,8 +214,6 @@ class CheckPointRestartSimObject : public Trick::SimObject {
|
|||||||
exec_register_scheduler(&cpr) ;
|
exec_register_scheduler(&cpr) ;
|
||||||
|
|
||||||
{TRK} P0 ("default_data") cpr.find_write_checkpoint_jobs(name + ".cpr") ;
|
{TRK} P0 ("default_data") cpr.find_write_checkpoint_jobs(name + ".cpr") ;
|
||||||
|
|
||||||
{TRK} P0 ("default_data") cpr.load_default_data() ;
|
|
||||||
{TRK} P1 ("initialization") cpr.write_pre_init_checkpoint() ;
|
{TRK} P1 ("initialization") cpr.write_pre_init_checkpoint() ;
|
||||||
{TRK} P65535 ("initialization") cpr.write_post_init_checkpoint() ;
|
{TRK} P65535 ("initialization") cpr.write_post_init_checkpoint() ;
|
||||||
{TRK} P0 ("system_checkpoint") cpr.write_checkpoint() ;
|
{TRK} P0 ("system_checkpoint") cpr.write_checkpoint() ;
|
||||||
|
1
test/.gitignore
vendored
1
test/.gitignore
vendored
@ -13,7 +13,6 @@ CP_out
|
|||||||
MAKE_out
|
MAKE_out
|
||||||
Makefile_sim
|
Makefile_sim
|
||||||
Makefile_swig
|
Makefile_swig
|
||||||
S_default.dat
|
|
||||||
S_document.xml
|
S_document.xml
|
||||||
S_library_list
|
S_library_list
|
||||||
S_main_*
|
S_main_*
|
||||||
|
1
trick_sims/.gitignore
vendored
1
trick_sims/.gitignore
vendored
@ -14,7 +14,6 @@ CP_out
|
|||||||
MAKE_out
|
MAKE_out
|
||||||
Makefile_sim
|
Makefile_sim
|
||||||
Makefile_swig
|
Makefile_swig
|
||||||
S_default.dat
|
|
||||||
S_document.xml
|
S_document.xml
|
||||||
S_library_list
|
S_library_list
|
||||||
S_main_*
|
S_main_*
|
||||||
|
@ -443,12 +443,6 @@ int Trick::CheckPointRestart::load_checkpoint_job() {
|
|||||||
return(0) ;
|
return(0) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Trick::CheckPointRestart::load_default_data() {
|
|
||||||
|
|
||||||
trick_MM->read_checkpoint("S_default.dat") ;
|
|
||||||
return(0) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Trick::CheckPointRestart::write_s_job_execution(FILE *fp) {
|
int Trick::CheckPointRestart::write_s_job_execution(FILE *fp) {
|
||||||
|
|
||||||
if ( fp == NULL ) {
|
if ( fp == NULL ) {
|
||||||
|
@ -63,13 +63,7 @@ int Trick::MemoryManager::read_checkpoint(const char* filename ) {
|
|||||||
// Create a stream from the named file.
|
// Create a stream from the named file.
|
||||||
std::ifstream infile(filename , std::ios::in);
|
std::ifstream infile(filename , std::ios::in);
|
||||||
if (infile.is_open()) {
|
if (infile.is_open()) {
|
||||||
|
return ( read_checkpoint( &infile, true )) ;
|
||||||
// If the filename is not S_default.dat, we will tell read_checkpoint to
|
|
||||||
// restore stls.
|
|
||||||
bool do_restore_stls =
|
|
||||||
(std::string(filename).find("S_default.dat") == std::string::npos);
|
|
||||||
|
|
||||||
return ( read_checkpoint( &infile, do_restore_stls )) ;
|
|
||||||
} else {
|
} else {
|
||||||
std::stringstream message;
|
std::stringstream message;
|
||||||
message << "Couldn't open \"" << filename << "\"." ;
|
message << "Couldn't open \"" << filename << "\"." ;
|
||||||
|
Loading…
Reference in New Issue
Block a user