Results 1 to 4 of 4

Thread: display text contained in a field. .CSV

  1. #1
    Tuner in Training
    Join Date
    Mar 2023
    Posts
    12

    display text contained in a field. .CSV

    Hello

    I did not find a gauge that allows you to display text contained in a field. .CSV
    For my drone, I would have liked to display the piloting mode C for "cinematic" N for "normal" S for "sport"
    I had thought about using the gearbox gauge and modifying the script...
    Unfortunately in the field . CSV it will be denoted C, N, or S and RaceRender translates it by one by a numeric number 1
    Do you have a solution to this small problem?
    Thank you

    Code:
    //Draw the current number in the center, with the two nearest numbers to its sides
    
    //Left number
    if (DataValue == "C")
    {	//cinematic
    	DrawChar('C', LeftX, ActiveY, ActiveColor, ActiveSize, 1);
    	DrawChar('N', CenterX, InactiveY, InactiveColor, InactiveSize, 1);
    	DrawChar('S', RightX, InactiveY, InactiveColor, InactiveSize, 1);
    }
    if (DataValue == "N")
    {	//normal
    	DrawChar('C', LeftX, InactiveY, InactiveColor, InactiveSize, 1);
    	DrawChar('N', CenterX, ActiveY, ActiveColor, ActiveSize, 1);
    	DrawChar('S', RightX, InactiveY, InactiveColor, InactiveSize, 1);
    }
    if (DataValue == "S")
    {	//Sport
    	DrawChar('C', LeftX, InactiveY, InactiveColor, InactiveSize, 1);
    	DrawChar('N', CenterX, InactiveY, InactiveColor, InactiveSize, 1);
    	DrawChar('S', RightX, ActiveY, ActiveColor, ActiveSize, 1);
    }
    mode.png

  2. #2
    Advanced Tuner
    Join Date
    Apr 2018
    Posts
    296
    Unfortunately...RaceRender does not seem to handle text/String values in input files... If there's any way that you could modify the input from text to a number, then an Enhanced Display Object would 100% be able to handle exactly what you're looking for.

    One side note, the syntax for if-statements in RaceRender requires that there is no space between the "if" and the parenthesis; otherwise, RaceRender thinks that you're trying to reference a variable named "if".

    Code:
    //Draw the current number in the center, with the two nearest numbers to its sides
    //Left number
    if(DataValue == 0) {
        //cinematic
        DrawChar('C', LeftX, ActiveY, ActiveColor, ActiveSize, 1);
    } else if(DataValue == 1){
        //normal
        DrawChar('N', CenterX, ActiveY, ActiveColor, ActiveSize, 1);
    } if(DataValue == 2) {
        //Sport
        DrawChar('S', RightX, ActiveY, ActiveColor, ActiveSize, 1); 
    }
    
    I hope that RaceRender is able to handle text values in the future; it would be really nice to be able to display text triggers from the data as you pass them without needing to convert them from some sort of number value. You can convert an ASCII numerical value to text; but it doesn't seem like you can convert a text value into something that can be read natively in the current version of 3.7.3.

  3. #3
    Advanced Tuner
    Join Date
    Apr 2018
    Posts
    296
    Another option (that would only work for individual videos) would be to follow the example from this post which details how to use the Timeline to update an individual Display Object to show different Text and various points within a video.

    I don't think this is necessarily a good long term solution since you'd need to find each point within a video where the value changes, and add a new timeline segment which would allow you to change the text of the Display Object to the appropriate value. This would need to be updated for every single video and every time that the value changes within that video...but it wouldn't require filtering the incoming data at all, which might be a positive.

  4. #4
    Tuner in Training
    Join Date
    Mar 2023
    Posts
    12
    Thank you
    I will wait for a new version ��