// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { TestFlight.TakeOff("8a2f26739dc3810018973494f39c9019_ODY2MjAxMS0xMC0wNCAxODozMDozOC4wMTk4Mzk"); window = new UIWindow(UIScreen.MainScreen.Bounds); viewController = new TestFlightSampleViewController("TestFlightSampleViewController", null); //window.RootViewController = viewController; var menu = new RootElement("Demos") { new Section("Enter some stuff") { new EntryElement("Name:", "", prefs.StringForKey("UserName")), new EntryElement("Email:", "", prefs.StringForKey("Email")) } }; var dv = new DialogViewController(menu) { Autorotate = true }; window.AddSubview(dv.View); window.MakeKeyAndVisible(); return(true); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { TestFlight.TakeOffThreadSafe("fb57eee9-f5f5-4ec3-96eb-404e6dd2573d"); Shared = this; FileCache.SaveLocation = System.IO.Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.Personal)).ToString() + "/tmp"; UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); window = new UIWindow(UIScreen.MainScreen.Bounds); UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes { TextColor = UIColor.White }); var productVc = new ProductListViewController(); productVc.ProductTapped += ShowProductDetail; navigation = new UINavigationController(productVc); navigation.NavigationBar.TintColor = UIColor.White; navigation.NavigationBar.BarTintColor = Color.Blue; window.RootViewController = navigation; window.MakeKeyAndVisible(); return(true); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { NSError error; #if TESTFLIGHT Analytics.SharedTracker.StartTracker("UA-31324545-3", 120, null); Analytics.SharedTracker.SetReferrer("TestFlight", out error); TestFlight.TakeOff("88e03730ca852e81d199baba95b9fc61_MTAxMDc3MjAxMi0wNi0xNyAyMzo0OToxNy44NzEzOTI"); #endif #if APPSTORE Analytics.SharedTracker.StartTracker("UA-31324545-3", 120, null); Flurry.StartSession("M3QY6NMPR8H9HSWT6YSM"); Flurry.SetSessionReportsOnPause(true); #endif Analytics.SharedTracker.TrackPageView("/launched", out error); StoreHelper.Load(); window = new UIWindow(UIScreen.MainScreen.Bounds); window.MakeKeyAndVisible(); if (selectedFilePathArray == null) { selectedFilePathArray = new List <string> (); } ShowSecretsView(); server.TransferEvent += Paste; return(true); }
/// <summary> /// Deletes a test flight from the database /// </summary> /// <param name="flight"></param> public void Delete(TestFlight flight) { _testFlightRepository.DeleteById(flight.Id); var flightNumber = flight.FlightNumber; _testFlightRepository.ReOrder(flight.FlightNumber, "FlightNumber"); }
public override void ViewDidLoad() { base.ViewDidLoad(); TestFlight.PassCheckpoint("Checkpoint 1"); //any additional setup after loading the view, typically from a nib. }
public PhantomGame(float width, float height, string name) { PhantomGame.Game = this; this.Name = name; #if DEBUG if (width < 10 || height < 10) { throw new Exception("Please create a PhantomGame with a sensable size (width >= 10 || height >= 10)."); } #endif this.Width = (float)Math.Floor(width); this.Height = (float)Math.Floor(height); this.Size = new Vector2(this.Width, this.Height); this.multiplier = 1; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; this.BackgroundColor = 0x123456.ToColor(); this.Paused = false; Trace.WriteLine("Phantom Game Engine"); Trace.WriteLine("Starting " + this.Name + " build " + Assembly.GetExecutingAssembly().GetName().Version + " on " + DeviceHardware.Form + " device running " + DeviceHardware.OS + " " + DeviceHardware.OSVersion); Trace.WriteLine("Device: " + DeviceHardware.Manufacturer + " " + DeviceHardware.Model + " " + DeviceHardware.ModelVersion + " (" + DeviceHardware.Identifier + ")"); Trace.WriteLine("Screen dimensions: " + DeviceHardware.ScreenWidth + "x" + DeviceHardware.ScreenHeight + " pixels at " + DeviceHardware.PPcm + " pixels per centimeter (" + DeviceHardware.PPI + " ppi)"); Trace.WriteLine("Display size: " + DeviceHardware.DisplayRealWidth + "x" + DeviceHardware.DisplayRealHeight + " cm, " + DeviceHardware.DisplayDiagonal + " cm diagonal (" + DeviceHardware.DisplayDiagonal / 2.54f + "\")"); #if TESTFLIGHT TestFlight.Log("[Start " + this.Name + "] " + DeviceHardware.Form + "; " + DeviceHardware.Manufacturer + "; " + DeviceHardware.Model + "; " + DeviceHardware.ModelVersion + "; " + DeviceHardware.Identifier + "; " + DeviceHardware.OS + "; " + DeviceHardware.OSVersion); TestFlight.Log("[Screen] " + DeviceHardware.ScreenWidth + "x" + DeviceHardware.ScreenHeight + "; " + DeviceHardware.PPI + " ppi; " + DeviceHardware.DisplayDiagonal + " inch"); #endif #if DEBUG // Setup Profiler: Profiler.Initialize(this, 16); #endif XnaGame = new Microsoft.Xna.Framework.Game(); XnaGame.Exiting += new EventHandler <EventArgs>(this.OnExit); XnaGame.Deactivated += new EventHandler <EventArgs>(this.OnDeactivate); #if !PLATFORM_ANDROID XnaGame.Window.Title = this.Name; #endif XnaGame.Content.RootDirectory = "Content"; XnaGame.Components.Add(new XnaPhantomComponent(this)); this.Content = new Content(XnaGame.Content); this.SetupGraphics(); //TODO: Instruction caused an invalid operation exception indicating that memory might be corrupted. //Happened when running full screen with two monitors... I think this might be the problem for Hendrik too this.graphics.ApplyChanges(); this.states = new List <GameState>(); }
/// <summary> /// Renames the directory where a flight stores its files /// </summary> /// <param name="oldPath"></param> /// <param name="flight"></param> public void RenameFlightDirectory(string oldPath, TestFlight flight) { oldPath = Path.Combine(_dataPath, oldPath); var newPath = Path.Combine(_dataPath, flight.TempFolderName); if (oldPath != newPath) { Directory.Move(oldPath, newPath); } }
void RegisterTestFlight() { string testflightKey = "9a624e6a-5140-4ede-a56c-10c8b9a29344"; if (!string.IsNullOrEmpty(testflightKey)) { TestFlight.TakeOffThreadSafe(testflightKey); TestFlight.PassCheckpoint("Starting app"); } }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { TestFlight.TakeOff("yourTeamTokenHere"); window = new UIWindow(UIScreen.MainScreen.Bounds); viewController = new TestFlightSampleViewController("TestFlightSampleViewController", null); window.RootViewController = viewController; window.MakeKeyAndVisible(); return(true); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { TestFlight.TakeOff("8a2f26739dc3810018973494f39c9019_ODY2MjAxMS0xMC0wNCAxODozMDozOC4wMTk4Mzk"); window = new UIWindow(UIScreen.MainScreen.Bounds); viewController = new TestFlightSampleViewController("TestFlightSampleViewController", null); window.RootViewController = viewController; window.MakeKeyAndVisible(); return(true); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { TestFlight.TakeOffThreadSafe(TestFlightAppToken); window = new UIWindow(UIScreen.MainScreen.Bounds); viewController = new TestFlightSampleViewController(); window.RootViewController = viewController; window.MakeKeyAndVisible(); return(true); }
// global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init(); public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init(); #if !DEBUG TestFlight.TakeOff("key"); #endif #region For ZXing ZXing.Net.Mobile.Forms.iOS.Platform.Init(); #endregion LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
/// <summary> /// Returns a path to one of the images from a test flight /// </summary> /// <param name="testFlight"></param> /// <returns></returns> public string GetRandomImagePathFromDir(TestFlight testFlight) { var path = Path.Combine(_dataPath, testFlight.TempFolderName); if (!Directory.Exists(path) || CountImages(path) == 0) { return(string.Empty); } var files = Directory.GetFiles(path, "*.*").Where(file => file.ToLower().EndsWith(".jpg") || file.ToLower().EndsWith(".jpeg")).ToList(); var random = new Random(); var imagePath = files[random.Next(0, files.Count())]; return(imagePath); }
public TestFlightLogger(string teamToken, int flags) : base() { CheckPointError = false; CheckPointWarn = false; CheckPointInfo = false; CheckPointDebug = false; CheckPointMetric = false; #if DEBUG TestFlight.TakeOff(teamToken); // TODO: Replace DEBUG compiler directive w/ OpenUDID-style replacement for udid string string udid = UIDevice.CurrentDevice.UniqueIdentifier; Console.WriteLine("Registering Device ID as: " + udid); TestFlight.SetDeviceIdentifier(udid); int flag = flags & EnabledError; if (flag == EnabledError) { CheckPointError = true; } flag = flags & EnabledWarn; if (flag == EnabledWarn) { CheckPointWarn = true; } flag = flags & EnabledInfo; if (flag == EnabledInfo) { CheckPointInfo = true; } flag = flags & EnabledDebug; if (flag == EnabledDebug) { CheckPointDebug = true; } flag = flags & EnabledMetric; if (flag == EnabledMetric) { CheckPointMetric = true; } #endif }
void Awake() { if (TestFlight.instance == null) { TestFlight.instance = this; DontDestroyOnLoad(this.gameObject); _appTokenIOS = this.appTokenIOS; _appTokenAndroid = this.appTokenAndroid; TestFlight.takeOff(); } else { this.gameObject.SetActive(false); this.logSceneLoad = false; GameObject.Destroy(this.gameObject); } }
public TestFlightSampleViewController() : base(UITableViewStyle.Grouped, null) { Root = new RootElement("TestFlight") { new Section("Checkpoints") { new StringElement("Pass checkpoint 1", () => { TestFlight.PassCheckpoint("Checkpoint 1"); }), new StringElement("Pass checkpoint 2", () => { TestFlight.PassCheckpoint("Checkpoint 2"); }), }, new Section("Options") { new StringElement("Set Flush Timeout to 30 sec.", () => { TestFlight.SetFlushSecondsInterval(31); }), new StringElement("Disable log on Checkpoint", () => { TestFlight.SetLogOnCheckpoint(false); }), new StringElement("Disable log to Console", () => { TestFlight.SetLogToConsole(false); }), new StringElement("Disable log to STDERR", () => { TestFlight.SetLogToSTDERR(false); }), new StringElement("Reinstall crashhandlers", () => { TestFlight.SetReinstallCrashHandlers(true); }), new StringElement("Disable crash reporting", () => { TestFlight.SetReportCrashes(false); }), new StringElement("Set send log on Crash only", () => { TestFlight.SetSendLogOnlyOnCrash(true); }), new StringElement("Set Session timeout to 60 sec.", () => { TestFlight.SetSessionKeepAliveTimeout(60); }) }, }; }
public void Update() { if (this.logSceneLoad) { string newSceneName = Application.loadedLevelName; if (newSceneName != oldSceneName) { if (this.oldSceneName != null && this.oldSceneName != string.Empty) { TestFlight.passCheckpoint("FinishedLevel__" + this.oldSceneName); //TestFlight.log("FinishedLevel__"+this.oldSceneName); } if (newSceneName != null && newSceneName != string.Empty) { TestFlight.passCheckpoint("LoadedLevel__" + newSceneName); //TestFlight.log("LoadedLevel__"+newSceneName); } this.oldSceneName = newSceneName; } } }
public override void AppendLog(String message, LogMessageType messageType) { string textEntry = string.Format("{0:MM-dd-yyyy HH:mm:ss:ffff} :{1}: [{2}] {3}", DateTime.Now, System.Threading.Thread.CurrentThread.ManagedThreadId, messageType.ToString(), message); //First write to console Console.WriteLine(textEntry); bool passCheckPoint = false; if (CheckPointError && LogMessageType.Error == messageType) { passCheckPoint = true; } else if (CheckPointWarn && LogMessageType.Warn == messageType) { passCheckPoint = true; } else if (CheckPointInfo && LogMessageType.Info == messageType) { passCheckPoint = true; } else if (CheckPointDebug && LogMessageType.Debug == messageType) { passCheckPoint = true; } else if (CheckPointMetric && LogMessageType.Metric == messageType) { passCheckPoint = true; } // Log a Checkpoint if necessary if (passCheckPoint) { TestFlight.PassCheckpoint(message); } AppendText(textEntry); }
protected override void OpenFeedbackView() { TestFlight.openFeedbackView(); }
protected override void PassCheckpoint(string checkPointName) { TestFlight.passCheckpoint(checkPointName); }
protected override void Append(LoggingEvent loggingEvent) { TestFlight.log(string.Format("{0} - {1}", loggingEvent.Level, RenderLoggingEvent(loggingEvent))); }
partial void leaveFeedback(MonoTouch.Foundation.NSObject sender) { TestFlight.OpenFeedbackView(); }
/// <summary> /// Persists a flight /// </summary> /// <param name="testFlight"></param> public void SaveTestFlight(TestFlight testFlight) { _testFlightRepository.Save(testFlight); }
partial void passCheckpoint(MonoTouch.Foundation.NSObject sender) { TestFlight.PassCheckpoint("Checkpoint 2"); }
/// <summary> /// Copies a file to a folder, creates folder if it doesn't exist. Folder name is based on test flight data. If logs are /// uploaded, the appropriate testflight data is updated /// </summary> /// <param name="flight"></param> /// <param name="fileNames"></param> /// <param name="workingPath"></param> /// <returns></returns> public void TransferFile(TestFlight flight, string filePath, string workingPath) { // create a path from the working directory and the flight name and data var fileStoragePath = System.IO.Path.Combine(_dataPath, workingPath); // verify if the directory exists if (!System.IO.Directory.Exists(fileStoragePath)) { // create it if it doens't exist System.IO.Directory.CreateDirectory(fileStoragePath); } // get the filename of the file var fileNameWithoutPath = System.IO.Path.GetFileName(filePath); // Parse logs to update test flight with proper wing ID // the file that ends with "_ACEeprom.text" contains Wing ID if (fileNameWithoutPath.EndsWith("_ACEeprom.text")) { // get flight data from log var type = File.ReadAllLines(filePath).Where(line => line.Contains("acType")).FirstOrDefault().Substring(7).PadLeft(4, '0'); flight.WingId = type + File.ReadAllLines(filePath).Where(line => line.Contains("acSerNr")).FirstOrDefault().Substring(8).PadLeft(6, '0'); } // Parse logs to update test flight with proper ebox ID // the file that ends with "_eBoxEeprom.text" contains ebox ID if (fileNameWithoutPath.EndsWith("_eBoxEeprom.text")) { // get flight data from log flight.EboxId = "EBX" + File.ReadAllLines(filePath).Where(line => line.Contains("eBoxSerNr")).FirstOrDefault().Substring(10).PadLeft(5, '0'); } // Parse logs to update test flight data with Elevator, Aileron and ShutterCommands values // the file that ends with "_prodlog.text" contains Elevator, Aileron, Samples and Shutter Commands if (fileNameWithoutPath.EndsWith("_prodlog.text")) { // get flight data from log var flightData = File.ReadAllLines(filePath)[0].Split(' '); flight.Elevator = Convert.ToInt32(flightData[0]); flight.Aileron = Convert.ToInt32(flightData[1]); flight.Samples = Convert.ToInt32(flightData[2]); flight.ShutterCommands = Convert.ToInt32(flightData[3]); } // Parse logs to update test flight data with undershoot if (fileNameWithoutPath.EndsWith(".txt")) { var flightData = File.ReadAllLines(filePath).Where(line => line != string.Empty).ToArray(); for (var i = 0; i < flightData.Count(); i++) { var speed = Convert.ToInt32(flightData[i].Split(' ')[26]); var height = Convert.ToInt32(flightData[i].Split(' ')[32]); var status = Convert.ToInt32(flightData[i].Split(' ')[22]); var deltaZ = Convert.ToInt32(flightData[i].Split(' ')[33]); // change these values to fine tune if (speed < 40 && height < 2 && status == 157 && deltaZ > -5 && deltaZ < 5) { // determine actual landing location var latitude = Double.Parse(flightData[i].Split(' ')[25], System.Globalization.NumberStyles.AllowDecimalPoint, new CultureInfo("en-US")); var longitude = Double.Parse(flightData[i].Split(' ')[24], System.Globalization.NumberStyles.AllowDecimalPoint, new CultureInfo("en-US")); var actualLandingLoc = new GeoCoordinate(latitude, longitude); // determine a reference position a little earlier in the AC's current path, this will be used to differentiate between under and overshoot latitude = Double.Parse(flightData[i - 5].Split(' ')[25], System.Globalization.NumberStyles.AllowDecimalPoint, new CultureInfo("en-US")); longitude = Double.Parse(flightData[i - 5].Split(' ')[24], System.Globalization.NumberStyles.AllowDecimalPoint, new CultureInfo("en-US")); var referenceLoc = new GeoCoordinate(latitude, longitude); // calculate distance from actual landing to programmed landing var distance = GetDistanceBetween(_programmedLandingLocation.Latitude, _programmedLandingLocation.Longitude, actualLandingLoc.Latitude, actualLandingLoc.Longitude); // calculate if its an overshoot or an undershoot: // if the distance between reference and programmed is smaller than the distance between actual and programmed then it's an overshoot var distanceBetweenReferenceAndProgrammed = GetDistanceBetween(referenceLoc, _programmedLandingLocation); if (distanceBetweenReferenceAndProgrammed < distance) { distance = distance * -1; } // assign the calculated undershoot to the flight property flight.Undershoot = Convert.ToInt32(Math.Round(distance, 0)); break; } } } if (fileNameWithoutPath.EndsWith("T04")) { // run the T04 file parser app var commandLineHelper = new CommandLineHelper(); commandLineHelper.Run("T01App.exe", filePath); // retrieve event number from result var record19Value = Convert.ToInt32(commandLineHelper.Output .Split(new string[] { Environment.NewLine }, StringSplitOptions.None) .Where(line => line.IndexOf("Record 19 :") > -1) .FirstOrDefault() .Substring(12)); // store the retrieved number of events in the testflight object flight.GBoxEvents = record19Value; } // Create a directory name var newFileName = System.IO.Path.Combine(fileStoragePath, fileNameWithoutPath); // Copy file using (FileStream SourceStream = File.Open(filePath, FileMode.Open)) using (FileStream DestinationStream = File.Create(newFileName)) SourceStream.CopyTo(DestinationStream); // delete T04 file if (fileNameWithoutPath.EndsWith("T04")) { File.Delete(filePath); } // if _doDeleteAfterCopy is true, clean up images after copying if (_doDeleteAfterCopy && (fileNameWithoutPath.ToLower().EndsWith("jpg") || fileNameWithoutPath.ToLower().EndsWith("jpeg"))) { File.Delete(filePath); } }