Here is a New compiled windows version?

Discussion in 'PriiDash (TM)' started by SteveDH, Sep 21, 2011.

  1. SteveDH

    SteveDH Junior Member

    Joined:
    Aug 21, 2011
    47
    9
    0
    Location:
    London UK
    Vehicle:
    2008 Prius
    Model:
    N/A
    strange though as it used to shut down properly before.. but I s'pose at least it runs here.

    it was the one I put here, I'm pretty sure I included it in the last source I included


    #ifdef DEBUGreading
    fprintf(fplog, "readandlogdata(): # of reads= %d\n", j);
    #endif
    //fflush(fplog);
    //SDH
    wait(0.1f);// give the port some time to recover
    return ntot;


    ok all very wierd, none of those problems here.. although maybe the reason I wasn't having your crash was because mine had the file there and so no null pointer. I had problems with the main window showing before but that was down to it wanting a messaging loop setup

    hmm
     
  2. SteveDH

    SteveDH Junior Member

    Joined:
    Aug 21, 2011
    47
    9
    0
    Location:
    London UK
    Vehicle:
    2008 Prius
    Model:
    N/A
    ahh this was missed in Dash.cxx
    static void main_window_CB() {
    printf("main_window quit button pressed\n");fflush(stdout);
    QuitProgram=true;
    printf("waiting for runUI() thread to end\n");fflush(stdout);

    #ifdef VC_WIN
    //sorry need these now or other threads get stuck
    Fl::flush();
    Fl::unlock();
    #endif


    and putting it back in fixes my shutdown issue
     
  3. SteveDH

    SteveDH Junior Member

    Joined:
    Aug 21, 2011
    47
    9
    0
    Location:
    London UK
    Vehicle:
    2008 Prius
    Model:
    N/A
    here's another build windows version, although I haven't had a chance to properly test it yet. and I also re-fixed the null file pointer issue you found :)
     

    Attached Files:

  4. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    Thanks so much for taking the time to help!

    Yes I noticed you already fixed the null pointer bug in Dash.cxx. I hadn't pay much attention to that when merging - my bad. I had assumed it was just extra gauges which I used Dash.fl to add back in (Dash.cxx is auto generated from Dash.fl via fluid.exe) - didn't notice there were code changes as well at first.

    Time to merge again...
     
  5. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    OK here is the merged source code. Note: The binary (exe file) is Cygwin, not Windows version!

    The wait() and Fl::flush etc. are added back in and the null pointer bug is fixed.

    Update: I tried to compile with FLTK 1.3.0 and to my surprise it made a difference. Before with FLTK 1.1.10 the main control window does not show. Now with 1.3.0 all windows show but clicking on buttons inside window does not work - at most sometimes the corresponding menu would show up partially, as if the response is very very sluggish: essentially the same behavior as SteveDH's exe file running on my 2 different laptops. By the way this is with VC++ 2010 Express which seems to behave the same as 2008.

    Another update: compiled with MT as opposed to MTd, no difference.

    More update: move boost from 1.44 up to 1.47. No difference.

    I wonder if somehow the Sleep( ) function is slowing down everything (it shouldn't). Take a look here:
    http://www.daniweb.com/software-development/cpp/threads/385322
     

    Attached Files:

  6. SteveDH

    SteveDH Junior Member

    Joined:
    Aug 21, 2011
    47
    9
    0
    Location:
    London UK
    Vehicle:
    2008 Prius
    Model:
    N/A
    The sleep function, as far as I can tell ,should sort of have the opposite effect. with me, without it the program got locked into that thread and the failed to respond to windows messages and so the other windows didn't draw properly and respond to clicks.

    however what is really weird is why it works fine for me.. I've just tried it on all my computer again.. windows7 32 bit desktop, winxp netbook & windows7 64 bit laptop, and it works fine on all. I did die at 1st on the laptop, but thats because I hadn't created and obddirectory, and doesn't work for you.

    do you have any other program or background app installed on all the machines you've tested it on that may be interfering with it.
     
  7. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    I am using two laptops, one 32 bit XP professional SP2 with VC++ 2008 Express and the other 64 bit Win 7 professional SP1 with VC++ 2010 Express. Both run the example programs from FLTK without any problem. Now I wonder if the threads somehow got locked up for some reason. The only common programs that's running on both machines I can think of: Windows Explorer, Notepad++, Firefox, Beyond Compare, VC++ & NetBeans IDE. One has Symantec Endpoint Protection and the other Microsoft Security Essentials. I will try quit other programs.

    Update: tried quitting as many programs and background processes as possible. Still got non-responsive windows.
     
  8. Britprius

    Britprius Senior Member

    Joined:
    Jun 14, 2010
    5,194
    1,865
    0
    Location:
    Herefordshire England
    Vehicle:
    2008 Prius
    My Windows version would not run with VC++2010 it would only run with VC++2008. I also have SP3 on a very old IBM600E runnig XP home. My biggest problem is lack of hard drive space 6gb.
     
  9. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    SteveDH compiled with VC 2008 so if we just use his compiled exe file then we need VC 2008 redistributable. I am compiling with 2008 on one machine and 2010 on another. Both gave the same problems.

    A small step forward: I tried to use the VC debugger to see whether the threads got hung up. It seems that when I pause the debugger some of the threads always stop at the Fl::lock() added by SteveDH and marked with "#define VC_WIN". So I tried removing the VC_WIN from the preprocessor definition and now the main control window is responsive and I can exit the program normally! But the gauges and license windows are now blank. Tomorrow I will experiment with turning on and off various statements under the "define VC_WIN".
     
  10. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    Well not much progress yet. Either I keep the extra code:
    Code:
    #ifdef VC_W
                        Fl::lock();
    #endif
    #ifdef VC_W
                        wait(0.01);
                        MSG wMsg;
                        BOOL bRet;
                        while (bRet = PeekMessage( &wMsg, NULL, 0, 0, PM_REMOVE))
                        {
                            TranslateMessage(&wMsg); 
                            DispatchMessage(&wMsg); 
                        }
    #endif
    #ifdef VC_W
                        Fl::unlock();
    #endif
    
    and get all windows showing their content but being non-responsive, or if I remove the code then I get only the main control window showing its content and being responsive but the other windows being blank.

    For those of you who run the Windows version successfully, do you see the PriiDash icon (see example in my signature banner below or avatar picture to the left) showing at the upper left corner of each window?
     
  11. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    It finally worked! I kept all of SteveDH's extra code.

    The problem was that if I didn't click on the green button "Accept License", then other windows became non-responsive. This "feature" definitely wasn't intended but may be nice to have after all. :p

    Once I click on the "Accept License" button and the "About" window closes, everything works fine. I haven't tried with OBD-USB hardware yet but at least the simulation mode runs fine and I can easily adjust or enter user parameters in the main control window.

    Thanks a million to SteveDH again for making the Windows version work! :)

    Now the only thing is the PriiDash icon doesn't show in the windows, unlike the CygWin version.
     
  12. SteveDH

    SteveDH Junior Member

    Joined:
    Aug 21, 2011
    47
    9
    0
    Location:
    London UK
    Vehicle:
    2008 Prius
    Model:
    N/A
    Ahh I thought it was meant to be like that :), and once I click on the accept it doesn't pop up again so it never crossed my mind. anyway great you've solved it.


    your welcome, not sure why it doesn't show the icon though, and at present work is a bit heavy so fraid your on your own for the moment.
     
  13. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    One thing that surprised me was when I compared the loop speed in the simulation mode between the native Windows version and the CygWin version, the native version was slower! :confused: I did the comparison on a laptop and a netbook. Both gave the same trend. Weird.
     
  14. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    I just uploaded Windows (VC2010) version here:

    http://sourceforge.net/projects/priidash/

    Sometimes it gives errors but on my commute home today it worked fine for the entire trip of almost an hour.

    The CPU usage is lower than the CygWin version but the screen update seems slower too. The RPM dial jumps as opposed to smoothly swings. Not sure why.

    Update: Looked in the csv file and found that all the passive messages come in only about 1/2 as frequently (Windows vs. CygWin version). I knew there was one place where the Windows version had an extra delay but I didn't expect so much difference. I will be experimenting taking that delay out and see.
     
  15. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    Tried removing the delay and not much difference. Then I tried Ubuntu. Interestingly the data comes in about 3% more frequently than CygWin. So I guess the bottom line is that not all data is collected - when the PC is busy doing other things some data got lost. (We knew that since at least every 0.2 second we stop listening and send in a query for non-passive data. We just didn't expect large difference between operating systems.) CygWin and Ubuntu are getting similar data rate as Vass got in his setup. Windows gets about 1/2.

    By the way new version just came out:
    http://sourceforge.net/projects/priidash/
     
  16. SteveDH

    SteveDH Junior Member

    Joined:
    Aug 21, 2011
    47
    9
    0
    Location:
    London UK
    Vehicle:
    2008 Prius
    Model:
    N/A
    I didn't really notice the speed difference, but then I have a relatively slow interface.
    for the windows version I had to add a message pump or none of the displays updated, so it could be related to this, although I'm not sure there's a fix, although maybe doing something with windows priorities.
     
  17. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
    Update: Thanks to Ian MacArthur, Greg Ercolano, and Albrecht Schlosser from the FLTK general discussion group, the FLTK usage of the program has been improved a lot and now the Windows native version (developed with MinGW) performs as well as the Cygwin version. I will post the new version on SourceForge soon.
     
  18. 2009Prius

    2009Prius A Wimpy DIYer

    Joined:
    Mar 25, 2009
    2,703
    484
    63
    Location:
    USA
    Vehicle:
    2009 Prius
Loading...