Skip to content

Accessing array datarefs #18

Description

@realskudd

I'd like to be able to read and write sim/flightmodel/weight/m_fuel, but with it being an array of floats, I'm not entirely sure how to make it work with xplm.

I've tried this:

        let fuel_weights: DataRef<f64, ReadOnly> = DataRef::find("sim/flightmodel/weight/m_fuel")?;

        let tanks = fuel_weights.get();
        let tank1 = tanks[0];
        let tank2 = tanks[1];

But it's not valid, given the f64 that .get() returns.

What's the right way to accomplish this? Is it even implemented yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions