public Agv GetAgvData() { var textData = LocalDataHandler.GetTextData("agv.json"); return(string.IsNullOrEmpty(textData) ? new Agv() : JsonConvert.DeserializeObject <Agv>(textData)); }
public Position GetBaseCupPosition() { var textData = LocalDataHandler.GetTextData("baseCupPosition.json"); return(string.IsNullOrEmpty(textData) ? Positions["Base2Position"] : JsonConvert.DeserializeObject <Position>(textData)); }
public RealRobot GetRobotData() { var textData = LocalDataHandler.GetTextData("robot.json"); return(string.IsNullOrEmpty(textData) ? new RealRobot() : JsonConvert.DeserializeObject <RealRobot>(textData)); }
public void SetAvailableDrink(DrinksPageItem drinkToAdd, DrinkPosition position) { if (drinkToAdd.Clone() is DrinksPageItem newDrink) { newDrink.DrinkPosition = position; AvailableDrinks.RemoveAt((int)position); AvailableDrinks.Insert((int)newDrink.DrinkPosition, newDrink); } LocalDataHandler.SaveTextData("availableDrinks.json", JsonConvert.SerializeObject(AvailableDrinks, Formatting.Indented)); }
public List <Sound> GetSoundInfo() { var textData = LocalDataHandler.GetTextData("sounds.json"); if (string.IsNullOrEmpty(textData)) { var sounds = GetSounds(); //SaveSoundInfo(sounds); return(sounds); } return(JsonConvert.DeserializeObject <List <Sound> >(textData)); }
public JsonDatabaseService() { Positions = JsonConvert.DeserializeObject <Dictionary <string, Position> >( LocalDataHandler.GetTextFromAssembly("Data.positions.json")); Poses = JsonConvert.DeserializeObject <Dictionary <string, Pose> >( LocalDataHandler.GetTextFromAssembly("Data.poses.json")); Tools = JsonConvert.DeserializeObject <Dictionary <string, Gripper> >( LocalDataHandler.GetTextFromAssembly("Data.tools.json")); Drinks = JsonConvert.DeserializeObject <List <DrinksPageItem> >( LocalDataHandler.GetTextFromAssembly("Data.drinks.json")); var availableDrinks = ""; if ((availableDrinks = LocalDataHandler.GetTextData("availableDrinks.json")) == "") { availableDrinks = LocalDataHandler.GetTextFromAssembly("Data.availableDrinks.json"); } AvailableDrinks = JsonConvert.DeserializeObject <List <DrinksPageItem> >(availableDrinks); }
public void SaveBaseCupPosition(Position position) { LocalDataHandler.SaveTextData("baseCupPosition.json", JsonConvert.SerializeObject(position, Formatting.Indented)); }
public void SaveSoundInfo(List <Sound> sounds) { LocalDataHandler.SaveTextData("sounds.json", JsonConvert.SerializeObject(sounds, Formatting.Indented)); }
public void SaveRobotData(RealRobot data) { LocalDataHandler.SaveTextData("robot.json", JsonConvert.SerializeObject(data, Formatting.Indented)); }
public void SaveAgvData(Agv agv) { LocalDataHandler.SaveTextData("agv.json", JsonConvert.SerializeObject(agv, Formatting.Indented)); }