Changeset 13681
- Timestamp:
- 05/12/12 18:44:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dimctrl.cc
r13671 r13681 65 65 fData = Tools::Split(opt); 66 66 67 if (opt.size()>0) 68 Debug("Start '"+opt+"' received."); 69 70 if (fDebug) 71 Debug("Received data: "+string(fDimStart.getString())); 72 67 73 if (opt.size()==0) 68 74 { … … 73 79 74 80 return; 75 }76 77 Debug("Start '"+opt+"' received.");78 if (fDebug)79 {80 string d(fDimStart.getString());81 if (d.length()>opt.length())82 Debug("Received data: "+string(fDimStart.getString()).substr(opt.length()+1));83 81 } 84 82 … … 142 140 } 143 141 142 string Line(const string &txt, char fill) 143 { 144 const int n = (55-txt.length())/2; 145 146 ostringstream out; 147 out << setfill(fill); 148 out << setw(n) << fill << ' '; 149 out << txt; 150 out << ' ' << setw(n) << fill; 151 152 if (2*n+txt.length()+2 != 57) 153 out << fill; 154 155 return out.str(); 156 } 157 144 158 int Write(const Time &time, const std::string &txt, int qos=kMessage) 145 159 { … … 150 164 if (fDebug) 151 165 { 152 ostringstream out;166 string msg; 153 167 if (fLabel<0) 154 168 { 155 169 if (fLabel==-1) 156 out << "========================== Begin ========================";170 msg = Line("Begin ["+fScript+"]", '='); 157 171 else 158 out << "=========================== End =========================";172 msg = Line("End ["+fScript+"]", '='); 159 173 } 160 174 else 161 out << "------------------------ Label " << setfill('0') << setw(3) << fLabel << " ----------------------"; 162 163 MessageDimTX::Write(time, out.str(), 90); 175 { 176 ostringstream out; 177 out << "Label " << fLabel << " [" << fScript << "]"; 178 msg = Line(out.str(), '-'); 179 } 180 181 MessageDimTX::Write(time, msg, 90); 164 182 } 165 183 … … 167 185 switch (fLabel) 168 186 { 169 case -2: return fSrvState.Update( "End of script execution");170 case -1: return fSrvState.Update( "Start of script execution");171 default: return fSrvState.Update("New label");187 case -2: return fSrvState.Update(fScript+" [end]"); 188 case -1: return fSrvState.Update(fScript+" [load]"); 189 case 0: return fSrvState.Update(fScript+" [start]"); 172 190 } 191 192 ostringstream msg; 193 msg << fScript << " [label=" << fLabel << "]"; 194 return fSrvState.Update(msg.str()); 173 195 } 174 196
Note:
See TracChangeset
for help on using the changeset viewer.