void TPartialGS::Dump(const TStr& FName) { PSOut out = TFOut::New(FName); for (int i = 0; i < R.Len(); i++) { for (int j = 0; j < i; j++) { out->PutStr(TFlt::GetStr(0.0, 20, 18)); out->PutCh(' '); } for (int j = 0; j < R[i].Len(); j++) { out->PutStr(TFlt::GetStr(R[i][j], 20, 18)); out->PutCh(' '); } out->PutCh('\n'); } }
///////////////////////////////////////////////// // Wireless-BMP void TWbmp::PutMultiByteInt(const PSOut& SOut, const uint& Val){ if (Val<128){ SOut->PutCh(uchar(Val)); } else if (Val<128*128){ uchar MsCh=uchar(Val/128); MsCh+=uchar(128); uchar LsCh=uchar(Val%128); SOut->PutCh(MsCh); SOut->PutCh(LsCh); } else { Fail; } }
void TWbmp::SaveWbmp(const PSOut& SOut) const { // write header SOut->PutCh(uchar(0)); // TypeField SOut->PutCh(uchar(0)); // FixHeaderField PutMultiByteInt(SOut, GetWidth()); // Width PutMultiByteInt(SOut, GetHeight()); // Height // write bitmap for (int Y=0; Y<GetHeight(); Y++){ TB8Set BSet; int X=0; while (X<GetWidth()){ if (GetPxVal(X,Y)){BSet.Incl(7-X%8);} X++; if (X%8==0){SOut->PutCh(BSet.GetUCh()); BSet=0;} } if (X%8!=0){SOut->PutCh(BSet.GetUCh());} } }
void TSAppSrvFun::LogReqRes(const TStrKdV& FldNmValPrV, const PHttpResp& HttpResp) { if (LogRqFolder == "") return; try { TDir::GenDir(LogRqFolder); TStr TimeNow = TTm::GetCurLocTm().GetWebLogDateTimeStr(true); TimeNow.ChangeChAll(':', '.'); PSOut Output = TFOut::New(LogRqFolder + "/" + TimeNow + ".txt", false); Output->PutStr(FunNm.CStr()); Output->PutCh('\n'); for (int N=0; N < FldNmValPrV.Len(); N++) Output->PutStrFmt(" %s: %s\n", FldNmValPrV[N].Key.CStr(), FldNmValPrV[N].Dat.CStr()); Output->PutCh('\n'); Output->PutStr(HttpResp->GetBodyAsStr(), false); } catch (...) { /*const PNotify& Notify = RqEnv->GetWebSrv()->GetNotify(); Notify->OnStatus("Unable to log request for function '" + GetFunNm() + "'!");*/ } }