|
|
Home » U++ Library support » FileSel&FileList, Path » Problem with FileSel called from menu
Problem with FileSel called from menu [message #19775] |
Fri, 16 January 2009 22:06 |
sbtilden
Messages: 1 Registered: January 2009 Location: U of Arizona
|
Junior Member |
|
|
I am new to UPP and so far my experience has been very positive; I am currently working on a scientific application to display complex scientific data and perform complex data manipulations such as wavelet lifting on the data. However I am working on a 'bug' (probably a logic error on my part) that I can't seem to solve. I use FileSel initially to select a data file for processing and everything works okay. The application displays the data on a Drawing object and so far so good. I have several menu applications (wavelet lifting; invwavelet lift; printing data graph...etc) that properly manipulate the data and I must say the UPP Vector and BiVector objects work very fast indeed. I can do the complete wavelet lifting on a 65536 pt double float data set in under a second. However, I have a menu option to read in another data file and when I do that it crashes (panic ASSERT) the system when processing at line 77 of the Win32Proc.cpp. My suspicion in looking at the Ctrl code being manipulated is that the problem is related somehow to modal loop processing between my core application and the FileSel modal loop. The code snippet is as follows:
FileSel fs;
fs.ActiveDir("C:/Documents and Settings/Scott Tilden/Desktop/");
fs.Type("Data file", "*.dat;");
if(!fs.ExecuteOpen("Choose the data file to import..."))
{
PromptOK("File is already open or does not exist...");
return;
}
String fn = ~fs;
FileIn myfile(fn);
//have a valid file...
int i,val,cnt;
cnt = 0;
bool tst;
while (!myfile.IsEof()){
Vector<String> field = Split(myfile.GetLine(),',');
for (i =0;i<field.GetCount();i++)
{
val = ScanInt(field[i]);
tst = IsNumber(val);
if (!tst)
{
PromptOK("Field containing non-valid number found");
}
else
{
vals.AddTail(val);
wavelet.Add(val);
}
cnt++;
}
//above gets field as string vector...separated by comma
}
Please note that the code works fine for the initial data load but bombs the next time through...any suggestions on what I am doing wrong.
PS - I would be glad to post my complete code when finished since basic scientific data display manipulate, wavelet processing, etc. is probably of interest to some...
|
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 03:12:14 CET 2024
Total time taken to generate the page: 0.01139 seconds
|
|
|