Apnea Board Forum - CPAP | Sleep Apnea
Charts disabled - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: Charts disabled (/Thread-Charts-disabled)

Pages: 1 2


RE: Charts disabled - GuyScharf - 07-24-2020

I've seen this happen twice before. In each case, the OSCAR_Data file was placed somewhere that Windows did not like and Windows security settings caused this response. In one case, the user had tried to place OSCAR in the Program Files\OSCAR directory. In another case, the user had marked the Documents directory as read-only.

Could you open the debug pane (Help/Troubleshooting/Debug Pane), copy the debug messages, and post them as an attached file?


RE: Charts disabled - rebirth - 07-25-2020

I'm going to get this for you tomorrow. Just busy today. I can also look at the code and help write some exception catching so that the user will at least get a message explaining to them that oscar doesn't have file permissions. I was a software developer in a past life. However I don't want to go though the build. I briefly looked at the gitlab build folder, got dizzy and closed it.


RE: Charts disabled - sawinglogz - 07-25-2020

I *might* already have addressed this in a recent change I made (after 1.1.1). The next version of OSCAR will now yell if it's unable to create the OSCAR_Data folder.


RE: Charts disabled - GuyScharf - 07-25-2020

I just tested that and it informed me that it could not create the OSCAR_Data folder in Program Files/OSCAR. I wonder if a little more explanatory text would be helpful.

While "could not create" is accurate, it doesn't give any clue as to what the problem might be. Not sure how to solve that in an OS-independent way.


RE: Charts disabled - rebirth - 07-26-2020

20245: Debug: Summary open for writing failed
20246: Warning: QIODevice::write (QFile, "E:\\Profiles\me\PRS1_J26211088696E\Events\00000041.001"): device not open
20246: Warning: QIODevice::write (QFile, "E:\\Profiles\me\PRS1_J26211088696E\Events\00000041.001"): device not open
20472: Debug: Finished Importing data 1
20474: Debug: Saving "Philips Respironics" session info "PRS1"
20474: Debug: Couldn't open "E://Profiles/me/PRS1_J26211088696E/Sessions.info" for writing
20474: Debug: Saving "Philips Respironics" "DreamStation Auto CPAP" Summaries
20477: Warning: QIODevice::write (QFile, "E:\\Profiles\me\PRS1_J26211088696E\Summaries.xml.gz"): device not open
20500: Debug: Overview range combo from QDate("2020-04-26") to QDate("2020-07-25") with 90 days
20501: Debug: No Event/Waveform data available for 65


Looks like the exception error is caught already, just need to put in a pop-up telling the user that it need to allow oscar write access.


RE: Charts disabled - rebirth - 07-26-2020

bool Machine:ConfusedaveSessionInfo()
{
   if (info.type == MT_JOURNAL) return false;
   if (sessionlist.size() == 0) return false;

   qDebug() << "Saving" << info.brand << "session info" << info.loadername;
   QString filename = getDataPath() + "Sessions.info";
   QFile file(filename);
   if (!file.open(QFile::WriteOnly)) {
       qDebug() << "Couldn't open" << filename << "for writing";
       return false;
   }

I'm scrolling thru the code. There is allot of it when it;s the first time.
There is a bunch of places where it tries to open a file and then checks to see if it's open. if it's not it output to debug. but says nothing to the user. and just continues.
But then i found places where it just trys to open the file and doesn't even check.

bool Session::StoreEvents()
{
   QString path = s_machine->getEventsPath();
   QDir dir;
   dir.mkpath(path);
   QString filename = path+QString().sprintf("%08lx.001", s_session);

   QFile file(filename);
   file.open(QIODevice::WriteOnly);

   QByteArray headerbytes;



 
I think the traditional way is to do a try / catch like this
try {
   file.open (QFile::WriteOnly);
 
   while (something);
   Do some stuff.
 }
 catch (const ifstream::failure& e) {
    qDebug() << "Couldn't open" << filename << "for writing";
 }
file.close();

Probably best and wouldn't take much work to go thru the code search for all these open files, reads and write and block them in a try catch. send a message to the user and then send the actual os expecption to the debug. I mean all we see here that oscar couldn't open the file, we don't see why. If we had it in a try catch we could see why.


RE: Charts disabled - jaswilliams - 07-26-2020

rebirth the issue here is your trying to write the OSCAR_DATA to the SD card rather than your PC this causes OSCAR to get completely confused


Pick a location on your PC for the data the default location is

C:\Users\Username\My Documents\OSCAR_Data

make sure the OSCAR_Data directory exists then launch OSCAR with the --datadir switch as below to change its data directory

c:\>cd \Program Files\OSCAR
c:\Program Files\OSCAR>OSCAR --datadir "C:\Users\Username\My Documents\OSCAR_Data"


RE: Charts disabled - rebirth - 07-26-2020

Jas, 
My SD card isn't even in the computer at this time. 
My E:\ is not my SD card. It's my reg harddrive. my C:\ is soildstat and only for the OS. nothing else will fit. 
Beside, my comments about the code hold true no matter where OSCAR is trying to write. It's traditional to do file IO in a try/catch so that for WHATEVER reason there may be an IO issue, the OS will throw and exception, OSCAR will catch it and output the error to the log file.


RE: Charts disabled - GuyScharf - 07-26-2020

rebirth: I appreciate your suggestions and have put this on our list of things to do [Mantis #258]. I'm in the middle of some other issues right now, but I think this should be fairly high priority after I get done with the current tasks.


RE: Charts disabled - rebirth - 07-29-2020

I get it, i'm over my head busy too. But if you want help, I can help out as much as I have time here and there.