예제 #1
0
        private void ListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBoxItem item = ListBox.SelectedItem as ListBoxItem;

            Home.Background = new SolidColorBrush(Colors.Transparent);
            MyFrame.BackStack.Clear();
            MyFrame.Navigate(typeof(HomePage), this, new SuppressNavigationTransitionInfo());
            if (Home.IsSelected)
            {
                HomeEvent?.Invoke();
            }

            else if (Today.IsSelected)
            {
                TodayEvent?.Invoke();
            }

            else if (Upcoming.IsSelected)
            {
                UpcomingEvent?.Invoke();
            }
            else if (Delayed.IsSelected)
            {
                DelayedEvent?.Invoke();
            }
            else if (AssignedToOthers.IsSelected)
            {
                AssignedToOthersEvent?.Invoke();
            }
        }
        public ActionResult GetAttendesList()
        {
            var       FoundUserId = User.Identity.GetUserId();
            HomeEvent homeEvent   = db.HomeEvent.Where(c => c.ApplicationUserId == FoundUserId).FirstOrDefault();
            //var GoingToEvent = db.GuestList.Where(s => s.Going).ToString();
            // GuestList guestList = new GuestList();
            HomeEvent homeEvents   = new HomeEvent();
            var       GoingToEvent = homeEvents.Going;

            if (GoingToEvent == false)
            {
                return(View());
            }
            else
            {
                List <HomeEvent> AllHomeEventAttendeeList;

                AllHomeEventAttendeeList = /* Convert.ToUInt16(homeEvent.FullName);//*/ db.HomeEvent.Where(c => c.ApplicationUserId == FoundUserId).ToList();

                if (AllHomeEventAttendeeList.Any())
                {
                    return(View());
                }
                else
                {
                    return(View(AllHomeEventAttendeeList));
                }
            }
        }
        public ActionResult EventDetails()
        {
            var       FoundUserId = User.Identity.GetUserId();
            HomeEvent homeEvent   = db.HomeEvent.Where(c => c.ApplicationUserId == FoundUserId).FirstOrDefault();

            return(View(homeEvent));
        }
        private int GetImageStep(HomeEvent homeEvent, HomeEvent first)
        {
            var stepSize   = config.ImageStepSeconds;
            var seconds    = (first.DateTime - homeEvent.DateTime).TotalSeconds;
            var stepNumber = (int)Math.Floor(seconds / stepSize);

            return(stepNumber);
        }
 public ActionResult AddEvent(HomeEvent events)
 {
     if (ModelState.IsValid)
     {
         repository.HomeEvents.Add(events);
         repository.SaveChanges();
         return(Redirect("/Home/Activities"));
     }
     return(View());
 }
        public ActionResult Create([Bind(Include = "EventID,FullName,Address,City,State,ZipCode,City,State,TeamName,Rules,EventTime,Time,Price,Going,Arrived")] HomeEvent homeEvent)
        {
            if (ModelState.IsValid)
            {
                var userId = User.Identity.GetUserId();
                homeEvent.ApplicationUserId = userId;

                db.HomeEvent.Add(homeEvent);
                db.SaveChanges();
                return(RedirectToAction("EventDetails", new { id = homeEvent.EventID }));
            }
            return(View(homeEvent));
        }
예제 #7
0
    private void checkSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        var e = new HomeEvent( );

        switch (scene.name)
        {
        case "ProtoAlex":
            e.onMenuHome = false;
            e.Raise( );

            GlobalManager.GameCont.StartGame( );
            break;

        case "HomeMenu":
            e.onMenuHome = true;
            e.Raise( );

            GlobalManager.Ui.OpenThisMenu(MenuType.MenuHome);
            break;
        }
    }
예제 #8
0
        /// <summary>
        /// 机器开始回零点
        /// </summary>
        /// <returns></returns>
        public Task <short> MachineHome()
        {
            return(Task <short> .Factory.StartNew(() => {
                #region 回零
                this.MachineIO.ResetBtnLight.SetIO(true);
                Thread.Sleep(1000);
                HomeEvent?.Invoke(this, new HomeEventArgs(30, "机器开始回零...."));
                MachineIO.TrunServoOn.SetIO(true);
                HomeEvent?.Invoke(this, new HomeEventArgs(40, "Z轴开始回零"));;

                short rtn = 0;
                Task <short> task1 = Task <short> .Factory.StartNew(() =>
                {
                    return this.MachineAxis.Z[0].GoHome(ConstDefine.iHomeTime, SpeedDefine.Instance[Module][Shceme.GoLimit, GeneralAxis.Z],
                                                        SpeedDefine.Instance[Module][Shceme.Home, GeneralAxis.Z], this.MachineIO.Limit[0]);
                });

                Task <short> task2 = Task <short> .Factory.StartNew(() =>
                {
                    return this.MachineAxis.Z[2].GoHome(ConstDefine.iHomeTime, SpeedDefine.Instance[Module][Shceme.GoLimit, GeneralAxis.Z],
                                                        SpeedDefine.Instance[Module][Shceme.Home, GeneralAxis.Z], this.MachineIO.Limit[1]);
                });

                // U轴回原点
                Task <short>[] tasks = new Task <short> [4];
                for (int i = 0; i < 4; ++i)
                {
                    int nz = i;
                    tasks[i] = Task <short> .Factory.StartNew(() =>
                    {
                        return this.MachineAxis.R[nz].GoHome(ConstDefine.iHomeTime, SpeedDefine.Instance[Module][Shceme.GoLimit, GeneralAxis.U],
                                                             SpeedDefine.Instance[Module][Shceme.Home, GeneralAxis.U], false);
                    });
                }

                task1.Wait();
                task2.Wait();

                HomeEvent?.Invoke(this, new HomeEventArgs(45, "Z轴回零完成,到安全高度中..."));;
                Thread.Sleep(200);
                this.MachineAxis.Z[0].ZeroAxis();
                this.MachineAxis.Z[2].ZeroAxis();
                Thread.Sleep(100);
                if (task1.Result != 0)
                {
                    MsgHelper.Instance.WriteLog(MsgLevel.Error, "Z1轴 回原点失败,请检查,Z1轴感应器");
                    return task1.Result;
                }
                else if (task2.Result != 0)
                {
                    MsgHelper.Instance.WriteLog(MsgLevel.Error, "Z3轴 回原点失败,请检查,Z2轴感应器");
                    return task2.Result;
                }
                else
                {
                    MsgHelper.Instance.WriteLog(MsgLevel.Info, "Z轴 回原点成功");
                }

                Thread.Sleep(500);
                // Z轴到安全高度
                rtn += this.ZGoSafeTillStop(Shceme.ManualNormal);
                if (rtn != 0)
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(100, "Z轴到安全高度失败"));
                    return rtn;
                }
                else
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(40, "Z轴到安全高度成功"));
                }

                // X轴回原点
                rtn += MachineAxis.X.GoHome(ConstDefine.iHomeTime, SpeedDefine.Instance[Module][Shceme.GoLimit, GeneralAxis.X],
                                            SpeedDefine.Instance[Module][Shceme.Home, GeneralAxis.X]);
                if (rtn != 0)
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(100, "X轴回原点失败"));
                    return rtn;
                }
                else
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(50, "X轴回原点成功"));
                }

                // 翻转轴回原点
                rtn += MachineAxis.Trun.GoHome(ConstDefine.iHomeTime, SpeedDefine.Instance[Module][Shceme.GoLimit, GeneralAxis.TRUN],
                                               SpeedDefine.Instance[Module][Shceme.Home, GeneralAxis.TRUN]);
                if (rtn != 0)
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(100, "翻转轴回原点失败"));
                    return rtn;
                }
                else
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(60, "翻转轴回原点成功"));
                }

                // 翻转轴到水平位置
                rtn += MachineAxis.Trun.GoPosTillStop(ConstDefine.iHomeTime, MachineConfig.TrunSuckAngle, SpeedDefine.Instance[Module][Shceme.ManualNormal, GeneralAxis.TRUN]);
                if (rtn != 0)
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(100, "翻转轴到水平位置失败"));
                    return rtn;
                }
                else
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(70, "翻转轴到水平位置成功"));
                }

                // Y轴回原点
                rtn += MachineAxis.Y.GoHome(ConstDefine.iHomeTime, SpeedDefine.Instance[Module][Shceme.GoLimit, GeneralAxis.Y],
                                            SpeedDefine.Instance[Module][Shceme.Home, GeneralAxis.Y]);
                if (rtn != 0)
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(100, "Y轴回原点失败"));
                    return rtn;
                }
                else
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(80, "Y轴到回原点成功"));
                }

                if (!Task.WaitAll(tasks, 2000))
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(100, "U轴回原点失败"));
                    return -1;
                }
                else
                {
                    HomeEvent?.Invoke(this, new HomeEventArgs(90, "U轴回原点成功"));
                }

                HomeEvent?.Invoke(this, new HomeEventArgs(100, "机器回零成功"));
                return rtn;

                #endregion
            }));
        }
예제 #9
0
 public void Handle(HomeEvent message)
 {
     ActivateModel <SelectItemsViewModel>();
 }