AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
Communicator.IOInit Class Reference

Input Output init Writting schema files to the disk for reference More...

Static Public Member Functions

static void createSchema< T > (string schemaName)
 Create the schema More...
 
static void CreateSchema ()
 Create new schem if the *schema.json if it exists or not. These schema can be used for to format python API More...
 

Detailed Description

Input Output init Writting schema files to the disk for reference

Definition at line 17 of file IOInit.cs.

Member Function Documentation

◆ CreateSchema()

static void Communicator.IOInit.CreateSchema ( )
inlinestatic

Create new schem if the *schema.json if it exists or not. These schema can be used for to format python API

Definition at line 47 of file IOInit.cs.

48  {
49  // Write schema to external file for reference
50  createSchema<ControlSchema>("ControlSchema.json");
51  createSchema<OutputSchema>("OutputSchema.json");
52  createSchema<TODSchema>("TOD.json");
53  createSchema<CameraSchema>("CameraSchema.json");
54  createSchema<LevelSchema>("LevelSchema.json");
55  createSchema<WeatherSchema>("WeatherSchema.json");
56  createSchema<UISchema>("UISchema.json");
57  createSchema<AudioSchema>("AudioSchema.json");
58  createSchema<LidarSchema>("LidarSchema.json");
59  createSchema<FuelSchema>("FuelSchema.json");
60  createSchema<PresetSchema>("PresetSchema.json");
61 
62  }

◆ createSchema< T >()

static void Communicator.IOInit.createSchema< T > ( string  schemaName)
inlinestatic

Create the schema

Parameters
connection
schemaNamename of the Json file to be created
Template Parameters
T
Type Constraints
T :new() 

Definition at line 35 of file IOInit.cs.

35  : new()
36  {
37  string json = JsonConvert.SerializeObject(new T(),Formatting.Indented, new PrimitiveToStringConverter());
38  string schemaFilePath = System.IO.Path.Combine(persistentDataPath,schemaName);
39  File.WriteAllText(schemaFilePath, json);
40  // Debug.Log("Writting Default schema file to : "+ schemaFilePath);
41  }

The documentation for this class was generated from the following file: