I am trying to create a way to import flight data that’s in a CSV and load it into a UDataTable I can then use to move assets around.
I am stuck on the creation of a UDataTable and returning it. My background is mostly Java and Python not a lot of C++ so I may just be making a really dumb mistake.
This is the block I created to Read in the data from a selected file. Right now it should all work other than this one error I am getting.
|Error (active)|E0330|UDataTable::UDataTable(UDataTable &&) (declared at line 69 of …) is inaccessible
UDataTable AFilePickerCharacter::ReadData(const FString& File)
{
//Create a USTRUCT RAW AIRCRAFT DATA AND RETURN
//Iterate ove the data and save it to the struct
//Return the struct so it can be manipulated.
TArray<FString> LoadedText;
UDataTable flightData;
//flightData.RowStruct(FAircraftRawData);
//flightData.RowStruct;
FFileHelper::LoadFileToStringArray(LoadedText, *File);
for (int32 i = 0; i < LoadedText.Num(); i++)
{
FTableRowBase *row2;
FAircraftRawData row;
//TArray<FString> readRow = LoadedText[i];
row.Longitude = double(LoadedText[i][1]);
row.Latitude = double(LoadedText[i][2]);
row.Height = double(LoadedText[i][3]);
row.Velocity = double(LoadedText[i][4]);
row.Roll = double(LoadedText[i][5]);
row.Pitch = double(LoadedText[i][6]);
row.Time = double(LoadedText[i][7]);
FName name = FName();
name.SetNumber(i);
//AircraftsRawDataTable->AddRow(name, row);
flightData.AddRow(name, row);
GLog->Log(LoadedText[i]);
}
return flightData;
}
This is the segment from the header file that defines the Raw AirCraftData Struct. I followed a Cesium tutorial on how to make a flight tracker to build this out.
USTRUCT(BlueprintType)
struct FAircraftRawData : public FTableRowBase
{
//GENERATED_USTRUCT_BODY()
public:
FAircraftRawData()
: Longitude(0.0)
, Latitude(0.0)
, Height(0.0)
, Velocity(0.0)
, Roll(0.0)
, Pitch(0.0)
, Time(0.0)
{}
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Longitude;
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Latitude;
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Height;
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Velocity;
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Roll;
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Pitch;
UPROPERTY(EditAnywhere, Category = "FlightTracker")
double Time;
};
As far as I can tell everything should be public so I am not sure why it is being listed as inacessable.