コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            _rawPageViewController = new RawPageViewController();
            _setData = _rawPageViewController;
            var sampleFrame = new CGRect(SubView.Bounds.Location.X,
                                         SubView.Bounds.GetMinY(),
                                         SubView.Bounds.Width,
                                         SubView.Bounds.Height);

            _rawPageViewController.View.Frame = sampleFrame;
            SubView.Add(_rawPageViewController.View);

            var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;
            var station     = appDelegate.ActiveStation;
            var flight      = appDelegate.CurrentFlight;

            _firebaseHelper = new FireBaseHelper(station.Key, flight.Key);
            _firebaseHelper.StartRawDataObserver((obj) =>
            {
                Console.WriteLine(obj.EpochTime);
                GpsImage.Image       = new UIImage(GetImageName(obj.GpsStatus));
                SensorImage.Image    = new UIImage(GetImageName(obj.SensorStatus));
                TelemetryImage.Image = new UIImage(GetImageName(obj.TelemetryStatus));
                if (obj.StartDetected)
                {
                    StartTimeText.Text = $"Start Time: {obj.StartTime.FromUnixTime():HH:mm:ss}";
                }
                LastUpdateText.Text = $"Last Update: {obj.EpochTime.FromUnixTime():HH:mm:ss}";
                _setData?.SetData(obj);
            });
        }
コード例 #2
0
        public Params GetData()
        {
            Params ret   = new Params();
            var    lArgs = args.ToList();

            try
            {
                ret.FilePath     = lArgs.ElementAt(lArgs.IndexOf(Params.FILE_SWITCH) + 1);
                ret.MailTo       = lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_TO_SWITCH) + 1);
                ret.MailFrom     = lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_FROM_SWITCH) + 1);
                ret.MailServer   = lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_SERVER_SWITCH) + 1);
                ret.MailUser     = lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_USER_SWITCH) + 1);
                ret.MailPassword = lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_PASSWORD_SWITCH) + 1);
                if (Convert.ToInt16(lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_PORT_SWITCH) + 1)) == 0)
                {
                    ret.MailPort = 25;
                }
                else
                {
                    ret.MailPort = Convert.ToInt16(lArgs.ElementAt(lArgs.IndexOf(Params.MAIL_PORT_SWITCH) + 1));
                }
            }
            catch (Exception e)
            {
                logger.SetData("Wrong parameters  - " + e.Message);
            }
            return(ret);
        }
コード例 #3
0
 public void SetData(MailMessageComposer param)
 {
     if (!fileExists)
     {
         SmtpClient client = new SmtpClient();
         client.Port = par.MailPort;
         client.Host = par.MailServer;
         //client.EnableSsl = true;
         client.Timeout = 10000;
         //client.DeliveryMethod = SmtpDeliveryMethod.Network;
         client.UseDefaultCredentials = false;
         client.Credentials           = new System.Net.NetworkCredential(par.MailUser, par.MailPassword);
         try
         {
             client.Send(param.GetData());
             logger.SetData("Mail sent - File not found");
         }
         catch (Exception e) {
             logger.SetData("Error sending mail - " + e.Message);
         }
     }
 }
コード例 #4
0
 public static T SetTo <T>(this T dataBaseObject, ISetData <T> setableData)
     where T : BaseObjectData <T>
 {
     setableData.SetData(dataBaseObject);
     return(dataBaseObject);
 }