• AVR Freaks

Get ARIA generated string (char*, not laString)

Author
lcitos
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2019/07/01 10:58:01
  • Location: 0
  • Status: offline
2020/03/26 08:00:58 (permalink)
0

Get ARIA generated string (char*, not laString)

How can I obtain the char* from a string that I had generated with strings graphical composer?
 
laString struct contains a GFXU_CHAR* that should contain the char* data but this variable is never used or filled!
When a laLabelWidget is created, it only fills the table_index from laString and never the data, length, font etc.
And harmony graphical tasks draws on the fly the text onto the screen using only table_index, seaching da data directly from fontTable and stringTable.
#1

4 Replies Related Threads

    mjolhe01
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2019/08/28 08:00:56
    • Location: 0
    • Status: offline
    Re: Get ARIA generated string (char*, not laString) 2020/03/31 22:09:12 (permalink)
    0
    would the laString_ToCharBuffer function work?
    #2
    lcitos
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2019/07/01 10:58:01
    • Location: 0
    • Status: offline
    Re: Get ARIA generated string (char*, not laString) 2020/04/01 05:18:28 (permalink)
    0
    Thanks for your reply.
     
    laString_ToCharBuffer just copies the GFXU_CHAR* from the laString. But when we initialize a laString with an string_id, it just sets the string_id element of the laString, not the GFXU_CHAR*.
     
    But I've investigated a little further after your answer and come to a solution.
     
        laString str = laString_CreateFromID(string_id);
        laString_ExtractFromTable(&str, string_id);

     
    With laString_ExtractFromTable, GFXU_CHAR* getts filled with the real string data.
    I've never found this because the signature of the that function is
    void laString_ExtractFromTable(laString* dst, uint32_t table_index)

     
    table_index looks like it was the stringTable, but it really is the string_id.
     
    Thanks :) 
     
    #3
    epareja
    Super Member
    • Total Posts : 376
    • Reward points : 0
    • Joined: 2003/11/07 12:53:08
    • Location: Colombia
    • Status: offline
    Re: Get ARIA generated string (char*, not laString) 2020/04/01 11:54:52 (permalink)
    0
    Hello, I use this method
     

    laString str2;
    uint8_t Data[15]; // Variable para almacenar buffer de lectura y escritura a EEPROM
     
    sprintf(Data,"Hello World");
    str2 = laString_CreateFromCharBuffer(Data,&Calibri_14); // This is my font pointer
    laLabelWidget_SetText(ADC_lbl,str2); // this is a LabelWidget
    laString_Destroy(&str2);



    Ernesto Pareja J
    www.dcctrains.netne.net

    #4
    lcitos
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2019/07/01 10:58:01
    • Location: 0
    • Status: offline
    Re: Get ARIA generated string (char*, not laString) 2020/04/01 12:36:09 (permalink)
    0
    epareja
    Hello, I use this method
     

     
     
     
    laString str2;
    uint8_t Data[15]; // Variable para almacenar buffer de lectura y escritura a EEPROM
     
     
     
     
     
     
     
    sprintf(Data,"Hello World");
     
     
     
    str2 = laString_CreateFromCharBuffer(Data,&Calibri_14); // This is my font pointer
    laLabelWidget_SetText(ADC_lbl,str2); // this is a LabelWidget
    laString_Destroy(&str2);
     
     
     



    That just creates a laString and renders it at the screen from your char*. It does gets the text from a harmony string.
     
    But thanks anyways.
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5