abc プロジェクト
14.4.3. GetFittingParam メンバ関数説明 |
メンバ関数名 | GetFittingParam |
定義ファイル名 | pass3.cpp |
定義行 | 320 |
所属名 | TScript |
アクセス属性 | public |
宣言形式 | void GetFittingParam ( TList * TokenList , int sPos ) |
概要 | fitting Scriptを解析してScriptデータに入れる。 SampledList->Count = 0 の場合は、デフォルトの値を設定する。 |
戻り値 | |
パラメタ説明 | TokenList トークンリスト sPos トークンリスト開始位置 |
機能説明 | |
備考 | |
呼出し元関数一覧表
呼出し先関数一覧表
|
名称 |
定義ファイル名 |
定義行 |
1 |
Add |
|
|
2 |
AnsiCompareText |
|
|
3 |
atoi |
|
|
4 |
c_str |
|
|
5 |
IndexOf |
|
|
6 |
Length |
|
|
7 |
Pos |
|
|
8 |
SubString |
|
|
9 |
Trim |
|
|
参照メンバ変数一覧表
|
名称 |
定義ファイル名 |
定義行 |
1 |
TScript::FittingDegree |
pass3.h |
173 |
2 |
TScript::FittingType |
pass3.h |
171 |
3 |
TScript::SampledList |
pass3.h |
174 |
4 |
TScript::TokStrList |
pass3.h |
166 |
関数論理チャート
| +----------------------------------------------------------+
320 +--+ void TScript::GetFittingParam(TList *TokenList,int sPos) |
321 | { |
+--+-------------------------------------------------------+
322 +--- int i = sPos;
323 +--- AnsiString s;
324 +--- int sIdx,eIdx,mIdx;
325 |
326 +--- FittingType = 0;
327 +--- SampledList = new TList;
328 |
329 +--- s = TokStrList->Strings[i++];
| +----------------------------------------------+
330 +--+ if(AnsiCompareText(s,"least-squares") == 0){ |
| +--+-------------------------------------------+
331 | +--- FittingType = 1;
| +-+---+
332 | | } |
| +-----+
333 +--- s = TokStrList->Strings[i++];
334 +--- FittingDegree = atoi(s.c_str()); // 多項式の次数
335 +--- s = TokStrList->Strings[i++];
| +----------------------------------------+
336 +--+ if(AnsiCompareText(s,"sampled") == 0){ |
| +--+-------------------------------------+
| | +------------------------------------+
337 | +--+ for(;i <= TokStrList->Count;i++){ |
| | +--+---------------------------------+
338 | | +--- s = TokStrList->Strings[i];
339 | | +--- s = Trim(s);
| | | +------------------------------+
340 | | +--+ if((s == "(")||(s == ",")){ |
| | | +--+---------------------------+
| | | | +------------+
341 | | | +--+ continue; |
| | | | +------------+
| | | +-+---+
342 | | | | } |
| | | +-+---+
| | | +-+-------------------+
342 | | | | else if(s == ")"){ |
| | | +-+-------------------+
| | | | +--------+
343 | | | +--+ break; |
| | | | +--------+
| | | +-+---+
344 | | | | } |
| | | +-+---+
| | | +-+-------+
344 | | | | else{ |
| | | +-+-------+
345 | | | +--- mIdx = s.Pos("-");
| | | | +----------------+
346 | | | +--+ if(mIdx != 0){ |
| | | | +--+-------------+
| | | | | +----------------+
347 | | | | +--+ if(mIdx == 1){ |
| | | | | +--+-------------+
348 | | | | | +--- sIdx = 1;
| | | | | +-+---+
349 | | | | | | } |
| | | | | +-+---+
| | | | | +-+-------+
349 | | | | | | else{ |
| | | | | +-+-------+
350 | | | | | +--- sIdx = atoi(s.c_str());
351 | | | | | +--- s = s.SubString(mIdx+1,s.Length());
| | | | | +-+---+
352 | | | | | | } |
| | | | | +-----+
353 | | | | +--- eIdx = atoi(s.c_str());
| | | | +-+---+
354 | | | | | } |
| | | | +-+---+
| | | | +-+-------+
354 | | | | | else{ |
| | | | +-+-------+
355 | | | | +--- sIdx = eIdx = atoi(s.c_str());
| | | | +-+---+
356 | | | | | } |
| | | | +-----+
| | | | +--------------------------------------+
357 | | | +--+ for(int i = sIdx ; i <= eIdx ; i++){ |
| | | | +--+-----------------------------------+
| | | | | +--------------------------------------------+
358 | | | | +--+ if(SampledList->IndexOf((void *)i) == -1){ |
| | | | | +--+-----------------------------------------+
359 | | | | | +--- SampledList->Add((void *)i);
| | | | | +-+---+
360 | | | | | | } |
| | | | | +-----+
| | | | +-+---+
361 | | | | | } |
| | | | +-----+
| | | +-+---+
362 | | | | } |
| | | +-----+
| | +-+---+
363 | | | } |
| | +-----+
| +-+---+
364 | | } |
| +-----+
+-+---+
365 | } |
+-----+