Stenberggg / minimosd-extra

Automatically exported from code.google.com/p/minimosd-extra
0 stars 0 forks source link

HELP ME! MinimOSD-Extra little MOD. WRONG CHARACTERS LENGHT #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

    Hi at all!
    I'm Mirko from Italy.
    I made a little mod on minimextra 2.2 plane code to print on osd a flight modes scrolling list , in consequence of this mod that I made on Ardupilot-MPNG code
    https://github.com/MegaPirateNG/ardupilot-mpng/issues/78
    I used the panel "CALLSIGN" to print those datas:

        /* **************************************************************** */
        // Panel  : panCALLSIGN
        // Needs  : X, Y locations
        // Output : Flight Modes ciclic switch list
        // Size   : 1 x 28  (rows x chars)
        // Staus  : done
        void panCALLSIGN(int first_col, int first_line){
            osd.setPanel(first_col, first_line);
            osd.openPanel();
               if(flight_mode_selected == 0){ 
            osd.printf("loit-guid-", 0x5B, "manu", 0x5D, "-circ-stab"); }
              if(flight_mode_selected == 1){ 
            osd.printf("guid-manu-", 0x5B, "circ", 0x5D, "-stab-trai"); }
              if(flight_mode_selected == 2){ 
            osd.printf("manu-circ-", 0x5B, "stab", 0x5D, "-trai-fbwa"); }
              if(flight_mode_selected == 3){ 
            osd.printf("circ-stab-", 0x5B, "trai", 0x5D, "-fbwa-fbwb"); }
              if(flight_mode_selected == 4){ 
            osd.printf("stab-trai-", 0x5B, "fbwa", 0x5D, "-fbwb-auto"); }
              if(flight_mode_selected == 5){ 
            osd.printf("trai-fbwa-", 0x5B, "fbwb", 0x5D, "-auto-retl"); }
              if(flight_mode_selected == 6){ 
            osd.printf("fbwa-fbwb-", 0x5B, "auto", 0x5D, "-retl-loit"); }
              if(flight_mode_selected == 7){ 
            osd.printf("fbwb-auto-", 0x5B, "retl", 0x5D, "-loit-guid"); }
              if(flight_mode_selected == 8){ 
            osd.printf("auto-retl-", 0x5B, "loit", 0x5D, "-guid-manu"); }
              if(flight_mode_selected == 9){ 
            osd.printf("retl-loit-", 0x5B, "guid", 0x5D, "-manu-circ"); }
            osd.closePanel();
        }

    The mavlink connection work great, but I have a little problem: it shows only the firsts 8 characters  instead of 28 characters.
    Is there a parameter anywhere to set the panel dimensions that I didn't see or did I make an error in the code?
    Please, help me to have 28 characters for this panel
    Thank you
    Mirko

Original issue reported on code.google.com by dispett...@gmail.com on 10 Feb 2014 at 5:21

GoogleCodeExporter commented 9 years ago
Victor answered me:
Hi Mirko,
Could you try this way?
 osd.printf("loit-guid-%cmanu%c-circ-stab", 0x5B, 0x5D); }

@Victor, could you explain me your sintax, please?
I'm talking about the symbol "%C"

I want that the result will be this:

LOIT-GUID-{MANU}-CIRC-STAB

I also don't understand why you put the codes "0x5B" and "0x5D" (that I think 
are respectively { and } ) at the end.

Original comment by dispett...@gmail.com on 10 Feb 2014 at 5:29

GoogleCodeExporter commented 9 years ago
Closed as we have a new version.

Ifthe problem is still present please reopen it.

Original comment by gabek...@gmail.com on 28 Nov 2014 at 11:44