Changeset 1919 in Sophya for trunk/SophyaPI/PIGcont/picntools.cc
- Timestamp:
- Mar 6, 2002, 5:46:47 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIGcont/picntools.cc
r1905 r1919 531 531 t_contour_levels_kind lvkind = dr->GetCntLevelKind() ; 532 532 for (ii=0 ; ii<4 ; ii++) 533 if( crbe_algo[ii]==kind)533 if(lev_kind[ii]==lvkind) 534 534 {mOpt[9]->SetValue(910+ii); break;} 535 535 … … 538 538 sprintf(txt,"%d",nlv); 539 539 mTxt[0]->SetText(txt); 540 // cout << " nlv "<<nlv<< endl; 540 541 541 if(dr->Levels()!=NULL){ 542 542 string strg=" "; 543 543 for(int kk=0 ; kk<nlv ; kk++) { 544 cout << " dr->Level("<<kk<<") "<<endl;544 //cout << " dr->Level("<<kk<<") "<<endl; 545 545 cout <<dr->Level(kk)<<endl; 546 sprintf(txt,"%g",dr->Level(kk)); 546 if (kk!=nlv-1) 547 sprintf(txt,"%g ,",dr->Level(kk)); 548 else 549 sprintf(txt,"%g",dr->Level(kk)); 550 547 551 strg += txt; 548 552 } … … 569 573 int k,ii,jj,kk; 570 574 571 k = mOpt[8]->GetValue()-900; // type de ligne575 k = mOpt[8]->GetValue()-900; // type de contour 572 576 dr->SetCntKind(crbe_algo[k]); 573 577 … … 576 580 577 581 string str=mTxt[0]->GetText(); 582 578 583 ii=atoi(str.c_str()); 579 dr->SetNLevel(ii); 584 if(ii>0) 585 dr->SetNLevel(ii); 586 else 587 cerr<< " PICnTools::SetCalcParm ERREUR noombre de contours <=0 "<<ii<<endl; 580 588 char *buff; 581 589 char *tmp; 582 590 str=mTxt[1]->GetText(); 591 583 592 buff=strdup(str.c_str()); 584 593 double * zlev=NULL; … … 587 596 zlev = new double[2]; 588 597 tmp = strtok(buff,","); 598 if(tmp ==NULL) { 599 cerr<< " PICnTools::SetCalcParm ERREUR decodage des niveaux impossible avec " << buff <<endl; 600 return; 601 } 589 602 zlev[0] = atof(tmp); 603 590 604 tmp = strtok(NULL,","); 605 if(tmp ==NULL) { 606 cerr<< " PICnTools::SetCalcParm ERREUR decodage des niveaux impossible avec " << buff <<endl; 607 return; 608 } 591 609 zlev[1]= atof(tmp); 592 610 dr->SetMyLevels(zlev,2); … … 596 614 zlev = new double[ii]; 597 615 tmp = strtok(buff,","); 616 if(tmp ==NULL) { 617 cerr<< " PICnTools::SetCalcParm ERREUR decodage des niveaux impossible dans " << buff <<endl; 618 return; 619 } 620 int cntr = 0; 598 621 for(jj=0 ; jj<ii ; jj++){ 599 622 zlev[jj]= atof(tmp); 600 cout << " jj "<<zlev[jj]<<endl; 601 tmp = strtok(NULL,","); 623 cntr++; 624 //cout << " jj "<<zlev[jj]<<endl; 625 tmp = strtok(NULL,"," ); 626 if(tmp == NULL) { 627 628 break; 629 } 630 cout << " tmp = <"<<tmp<<"<"<<endl; 631 632 } 633 if(cntr<ii) { 634 cerr<< " PICnTools::SetCalcParm ERREUR decodage des niveaux "<<cntr 635 <<" trouves sur "<<ii<<" dans " << buff <<endl; 636 return; 637 602 638 } 603 639 dr->SetMyLevels(zlev,ii); … … 605 641 606 642 607 } 643 } 608 644 609 645 //
Note:
See TracChangeset
for help on using the changeset viewer.