Commit 86c3e7dab09dd5f13a11525a966a0b7c107a5477
1 parent
4476e18e
enhance print_model() output
Showing
1 changed file
with
22 additions
and
18 deletions
src/model/GModelSky.cpp
| ... | ... | @@ -984,29 +984,33 @@ std::string GModelSky::print_model(void) const |
| 984 | 984 | } |
| 985 | 985 | else |
| 986 | 986 | result.append("all"); |
| 987 | - result.append("\n"+parformat("Number of parameters")+str(size())); | |
| 988 | - result.append("\n"+parformat("Number of spatial par's")+str(n_spatial)); | |
| 989 | - int i; | |
| 987 | + | |
| 988 | + // Append model type | |
| 989 | + result.append("\n"+parformat("Model type")); | |
| 990 | 990 | if (n_spatial > 0) { |
| 991 | - result.append("\n"+parformat(" Model type")+m_spatial->type()); | |
| 992 | - for (i = 0; i < n_spatial; ++i) { | |
| 993 | - result.append("\n"+(*this)[i].print()); | |
| 994 | - } | |
| 991 | + result.append("\""+spatial()->type()+"\""); | |
| 992 | + if (n_spectral > 0 || n_temporal > 0) | |
| 993 | + result.append(" * "); | |
| 995 | 994 | } |
| 996 | - result.append("\n"+parformat("Number of spectral par's")+str(n_spectral)); | |
| 997 | 995 | if (n_spectral > 0) { |
| 998 | - result.append("\n"+parformat(" Model type")+m_spectral->type()); | |
| 999 | - for (; i < n_spatial+n_spectral; ++i) { | |
| 1000 | - result.append("\n"+(*this)[i].print()); | |
| 1001 | - } | |
| 996 | + result.append("\""+spectral()->type()+"\""); | |
| 997 | + if (n_temporal > 0) | |
| 998 | + result.append(" * "); | |
| 1002 | 999 | } |
| 1000 | + if (n_temporal > 0) | |
| 1001 | + result.append("\""+temporal()->type()+"\""); | |
| 1002 | + | |
| 1003 | + // Append parameters | |
| 1004 | + result.append("\n"+parformat("Number of parameters")+str(size())); | |
| 1005 | + result.append("\n"+parformat("Number of spatial par's")+str(n_spatial)); | |
| 1006 | + for (int i = 0; i < n_spatial; ++i) | |
| 1007 | + result.append("\n"+(*spatial())[i].print()); | |
| 1008 | + result.append("\n"+parformat("Number of spectral par's")+str(n_spectral)); | |
| 1009 | + for (int i = 0; i < n_spectral; ++i) | |
| 1010 | + result.append("\n"+(*spectral())[i].print()); | |
| 1003 | 1011 | result.append("\n"+parformat("Number of temporal par's")+str(n_temporal)); |
| 1004 | - if (n_temporal > 0) { | |
| 1005 | - result.append("\n"+parformat(" Model type")+m_temporal->type()); | |
| 1006 | - for (; i < n_spatial+n_spectral+n_temporal; ++i) { | |
| 1007 | - result.append("\n"+(*this)[i].print()); | |
| 1008 | - } | |
| 1009 | - } | |
| 1012 | + for (int i = 0; i < n_temporal; ++i) | |
| 1013 | + result.append("\n"+(*temporal())[i].print()); | |
| 1010 | 1014 | |
| 1011 | 1015 | // Return result |
| 1012 | 1016 | return result; | ... | ... |