MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / WriteDebugFile

Method WriteDebugFile

src/simulation.cpp:669–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669bool Simulation::WriteDebugFile( const wxString &file, ssc_module_t p_mod, ssc_data_t p_data )
670{
671 if( FILE *fp = fopen( file.c_str(), "w" ) )
672 {
673 fprintf(fp, "clear();\n");
674 int dbgidx = 0;
675 while( const ssc_info_t p_inf = ssc_module_var_info( p_mod, dbgidx++ ) )
676 {
677 const char *name = ::ssc_info_name( p_inf );
678 dump_variable( fp, p_data, name );
679 }
680 wxString name = wxFileName(file).GetName();
681 name = name.Right(name.length() - 4); // skip "ssc-"
682 fprintf(fp, "run('%s');\n", (const char *)name.c_str());
683 fclose(fp);
684 return true;
685 }
686 else
687 return false;
688}
689
690bool Simulation::WriteDebugFile( const wxString &file, ssc_data_t p_data )
691{

Callers 1

InvokeWithHandlerMethod · 0.45

Calls 3

dump_variableFunction · 0.85
lengthMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected