public void OnAddImage() { //create new image data ImageData newImageData = new ImageData(20, 20 + (2 * 20), 2020, 20, 20, "newImage"); ALL_IMAGES.Add(newImageData); }
//--------------- Processing Information ----------------------- void client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e) { string message = Encoding.Default.GetString(e.Message); Debug.Log(message); Debug.Log(e.Topic); //Debug.Log("Altitude is: " + pos.Altitude); //Debug.Log("Azimuth is: " + pos.Azimuth); if (e.Topic == "IC.embedded/friends/unity/sensors") { ReceivedTelescopePos pos = JsonUtility.FromJson <ReceivedTelescopePos>(message); Debug.Log("Altitude is: " + pos.Altitude); Debug.Log("Azimuth is: " + pos.Azimuth); OnReceivePosUpdate(pos); TelsecopeUpdate = message; } else if (e.Topic == "IC.embedded/friends/unity/camera") { PictureTaken pic = JsonUtility.FromJson <PictureTaken>(message); Debug.Log(pic.Altitude); Debug.Log(pic.Azimuth); Debug.Log(pic.DayTaken); Debug.Log(pic.HourTaken); AASharp.AAS2DCoordinate coor = CoordinateTransformation.ToCelestialCoordinates(pic.Latitude, pic.Longitude, pic.Azimuth, pic.Altitude); OnReceivePic(pic, (float)coor.Y, (float)coor.X); ImageUpdate = message; //create new image data ImageData newImageData = new ImageData((float)coor.Y, (float)coor.X, pic.YearTaken, pic.HourTaken, pic.MinuteTaken, pic.ImageName); ALL_IMAGES.Add(newImageData); SaveData(); } }