Ejemplo n.º 1
0
        public App()
        {
            InitializeComponent();

            TodoManager = new ServiceManager(new CustomerService());


            //MainPage = new NavigationPage(new Views.TestDemoPage());

            if (Device.RuntimePlatform == Device.iOS)
            {
                MainPage = new Views.LoginPage();
            }
            else
            {
                MainPage = new Views.LoginPage();
            }


            GetCountryList();

            //MainPage = new Views.LongRunningPage();
            timer = new GeneralTimer(TimeSpan.FromSeconds(7867868), StartService);
            timer.Start();

            HandleReceivedMessages();
        }
Ejemplo n.º 2
0
        protected override void InitializeScene()
        {
            LayerManager.RegisterLayer("raycast", new Layer(1, 2));
            int hybridLayer = LayerManager.RegisterLayer("hybrid", new Layer(1, 1 | 2));

            LayerManager.RegisterLayer("physics", new Layer(1, 1));


            BasicCamera c = new BasicCamera(
                Matrix4.CreatePerspectiveFieldOfView(MathHelper.DegreesToRadians(75f),
                                                     GameEngine.Instance.Width / (float)GameEngine.Instance.Height, 0.01f, 1000f), Vector3.Zero);

            LoadTestScene(c);
            LoadGameScene(camera);
            Texture bg = null;

            if (!ComesFromMenu)
            {
                bg = TextureLoader.ColorToTexture(Color.Black);
            }

            LoadLoadingScreen(bg);
            LoadTimer = new GeneralTimer(0.0015f, FinalizeLoad, true);
            AddComponent(LoadTimer);
            TextureGenerator.OnProcessFinished += FinishedTexGen;
            LoadTime = Stopwatch.StartNew();
            TextureGenerator.Process();
        }
Ejemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();
            FormBorderStyle = FormBorderStyle.FixedDialog;

            // Set the MaximizeBox to false to remove the maximize box.
            MaximizeBox = false;


            // Set the MinimizeBox to false to remove the minimize box.
            //MinimizeBox = false;

            // Set the start position of the form to the center of the screen.
            StartPosition = FormStartPosition.CenterScreen;

            try
            {
                sqlControl = new SQLDataControl();
                MessageBox.Show("Connection successful");
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }

            GeneralTimer.Start();
        }
Ejemplo n.º 4
0
 private void Contbutton_Click(object sender, EventArgs e)
 {
     GeneralTimer.Enabled = false;
     GeneralTimer.Start();
     RoadTimer.Start();
     WaitTimer.Enabled  = false;
     Contbutton.Enabled = false;
     Waitbutton.Enabled = true;
 }
Ejemplo n.º 5
0
        public int sceneSwitchIndex = 2; // 2 because base scene load is 0. default living room load is 1, so next scene is 2

        void OnEnable()
        {
            genTimer       = GetComponent <GeneralTimer>();
            botInteraction = GetComponent <BotInteraction>();
            ProcessTrajectory.OnRestartEvent += ResetIndices;

            ProcessTrajectory.OnNewTrajEvent += GetPlayData;
            ProcessTrajectory.OnNewTrajEvent += ElmerHold;
        }
Ejemplo n.º 6
0
        public MainWindow()
        {
            DataContext = this;
            InitializeComponent();
            ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(Int32.MaxValue));
            ToolTipService.InitialShowDelayProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(0));

            GeneralTimer.Tick += GeneralTimer_Tick;
            GeneralTimer.Start();
            dataGridView1.ItemsSource = MyGrid;
            Open(Path.Combine(Paths.GetAppDirectoryPath(), "IP.txt"));
            listView1.ItemsSource = MyView;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Starts the service.
 /// </summary>
 public virtual bool Start()
 {
     App.Current.EventsBroker.Subscribe <NewPlaylistEvent> (HandleNewPlaylistEvent);
     App.Current.EventsBroker.Subscribe <JobRenderedEvent> (HandleCreateJob);
     App.Current.EventsBroker.Subscribe <NewDashboardEvent> (HandleDashboardEvent);
     App.Current.EventsBroker.Subscribe <DrawingSavedToProjectEvent> (HandleDrawingSavedToProject);
     App.Current.EventsBroker.Subscribe <ProjectCreatedEvent> (HandleNewProject);
     App.Current.EventsBroker.Subscribe <OpenedProjectEvent> (HandleOpenProject);
     App.Current.EventsBroker.Subscribe <NavigationEvent> (HandleNavigationEvent);
     App.Current.EventsBroker.Subscribe <LicenseChangeEvent> (HandleLicenseChangeEvent);
     App.Current.EventsBroker.Subscribe <LimitationDialogShownEvent>(HandleLimitationDialogShown);
     App.Current.EventsBroker.Subscribe <UpgradeLinkClickedEvent> (HandleUpgradeLinkClicked);
     GeneralTimer.Start();
     GeneralProperties ["Plan"] = App.Current.LicenseManager.LicenseStatus.PlanName;
     return(true);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Stops the service.
        /// </summary>
        public virtual bool Stop()
        {
            SaveTimer();
            App.Current.EventsBroker.Unsubscribe <NewPlaylistEvent> (HandleNewPlaylistEvent);
            App.Current.EventsBroker.Unsubscribe <JobRenderedEvent> (HandleCreateJob);
            App.Current.EventsBroker.Unsubscribe <NewDashboardEvent> (HandleDashboardEvent);
            App.Current.EventsBroker.Unsubscribe <DrawingSavedToProjectEvent> (HandleDrawingSavedToProject);
            App.Current.EventsBroker.Unsubscribe <ProjectCreatedEvent> (HandleNewProject);
            App.Current.EventsBroker.Unsubscribe <OpenedProjectEvent> (HandleOpenProject);
            App.Current.EventsBroker.Unsubscribe <NavigationEvent> (HandleNavigationEvent);
            App.Current.EventsBroker.Unsubscribe <LicenseChangeEvent> (HandleLicenseChangeEvent);
            App.Current.EventsBroker.Unsubscribe <LimitationDialogShownEvent> (HandleLimitationDialogShown);
            App.Current.EventsBroker.Unsubscribe <UpgradeLinkClickedEvent> (HandleUpgradeLinkClicked);
            GeneralTimer.Stop();
            RetrieveUserData();
            SendData();

            return(true);
        }
Ejemplo n.º 9
0
 private void Ride_Load(object sender, EventArgs e)
 {
     GeneralTimer.Start();
     RoadTimer.Start();
 }
Ejemplo n.º 10
0
 // Use this for initialization, interact and genTimer can be found anytime so this is okay
 void Start()
 {
     genTimer = GetComponent <GeneralTimer>();
     interact = GetComponentInChildren <Interact>();
 }
Ejemplo n.º 11
0
        private async void buttonSave_Click(object sender, RoutedEventArgs e)
        {
            if (IsBusy)
            {
                return;
            }

            if (!General.CheckPress())
            {
                MessageBox.Show("ゴールデンサンプルをセットして\nレバーを下げてください");
                return;
            }

            try
            {
                //LED全点灯の処理
                buttonSave.Background = Brushes.DodgerBlue;

                buttonLedOn.IsEnabled    = false;
                buttonLabeling.IsEnabled = false;
                buttonHue.IsEnabled      = false;

                IsBusy           = true;
                RingCal.IsActive = true;

                await Task.Run(() => General.PowSupply(true));

                await General.LedAllOn();

                var tm = new GeneralTimer(3000);
                tm.start();

                FlagLabeling = true;
                labeling();

                await Task.Run(() =>
                {
                    while (true)
                    {
                        if (tm.FlagTimeout)
                        {
                            break;
                        }
                        if (CanSaveLedPpint)
                        {
                            break;
                        }
                    }
                });

                if (!CanSaveLedPpint)
                {
                    goto FAIL;
                }
                else
                {
                    await Task.Delay(1000);

                    if (!SaveLedPoint() /*座標保存*/ || !SaveLedLum() /*輝度保存*/)
                    {
                        goto FAIL;
                    }

                    SaveCameraCommonPropForLed();//カメラプロパティ保存

                    //カラーチェック
                    FlagLabeling = false;
                    General.cam.ResetFlag();

                    await Task.Delay(1000);

                    TestLed.CheckColorForDebug();
                    if (!CheckCol())
                    {
                        goto FAIL;
                    }

                    General.PlaySound(General.soundSuccess);
                    labelMess.Content    = "自動補正完了しました!";
                    labelMess.Foreground = Brushes.DodgerBlue;
                    (FindResource("SbMessage") as Storyboard).Begin();
                    await Task.Delay(1000);

                    return;
                }

FAIL:
                General.PlaySound(General.soundFail);
                labelMess.Content    = "LED全点灯が認識できません\nカメラプロパティの調整をしてください";
                labelMess.Foreground = Brushes.HotPink;
                (FindResource("SbMessage") as Storyboard).Begin();
                await Task.Delay(1000);
            }
            finally
            {
                FlagLabeling     = false;
                RingCal.IsActive = false;
                await Task.Delay(150);

                buttonSave.Background = Brushes.Transparent;

                buttonLedOn.IsEnabled    = true;
                buttonLabeling.IsEnabled = true;
                buttonHue.IsEnabled      = true;

                IsBusy = false;
                General.ResetIo();
            }
        }
Ejemplo n.º 12
0
        public void LoadLoadingScreen(Texture background = null)
        {
            LoadingSymbol = TextureLoader.FileToTexture("assets/textures/LoadingSymbol.jpg");
            bg            = new GameObject("Background");
            if (background == null)
            {
                BlackBG = HoBMenuScene.menubg;
            }
            else
            {
                BlackBG = background;
            }

            UiImageRendererComponent bgImage =
                new UiImageRendererComponent(BlackBG, false, 1, DefaultFilepaths.DefaultUiImageShader);

            bgImage.RenderQueue = -1;
            bg.AddComponent(bgImage);
            bg.AddComponent(new BackgroundMover());
            Add(bg);

            GameObject text            = new GameObject("text");
            GameFont   f               = FontLibrary.LoadFontDirect("assets/fonts/default_font.ttf", 64);
            UiTextRendererComponent tr = new UiTextRendererComponent(f, false, 1, DefaultFilepaths.DefaultUiTextShader);

            text.AddComponent(tr);
            bg.Add(text);
            tr.Text        = "Loading...";
            tr.SystemColor = Color.Black;
            tr.Scale       = Vector2.One * 3;
            tr.RenderQueue = -1;
            tr.Position    = new Vector2(-0.7f, -0.7f);
            loading        = new GameObject("Loading");
            UiImageRendererComponent loadingImage =
                new UiImageRendererComponent(LoadingSymbol, false, 1, DefaultFilepaths.DefaultUiImageShader);

            loadingImage.RenderQueue = -1;
            loading.AddComponent(loadingImage);
            Add(loading);
            float size = 0.05f;

            loadingImage.Position = new Vector2(0.7f, -0.7f);
            loadingImage.Scale    = new Vector2(size, GameEngine.Instance.AspectRatio * size);
            LinearAnimation loadAnim = new LinearAnimation();
            Interpolator    intP     = new Arc2Interpolator();

            loadAnim.Interpolator     = intP;
            loadAnim.StartPos         = loadingImage.Position;
            loadAnim.EndPos           = loadingImage.Position + Vector2.UnitY * 0.1f;
            loadAnim.MaxAnimationTime = 0.5f;
            loadAnim.Trigger          = AnimationTrigger.None;
            loadAnim.AnimationDelay   = 0f;
            Animator anim = new Animator(new List <Animation> {
                loadAnim
            }, loadingImage);

            loading.AddComponent(anim);
            LoopTimer(anim, loadAnim);
            GameObject   obj   = new GameObject("Timer");
            GeneralTimer timer = new GeneralTimer(0.5f, () => LoopTimer(anim, loadAnim), true);

            obj.AddComponent(timer);
            Add(obj);
        }