Example #1
0
        /// <summary>
        /// Runs a command-line application
        /// </summary>
        private int Run()
        {
            int     returnCode = 0;
            AppMode appMode    = _appConfig.Mode;

            switch (appMode)
            {
            case AppMode.Help:
                WriteHelp();
                break;

            case AppMode.Version:
                WriteVersion();
                break;

            case AppMode.Conversion:
                returnCode = Convert(_appConfig.InputDirectory, _appConfig.Namespace,
                                     _appConfig.InternalAccessModifier) ? 0 : -1;
                break;

            default:
                throw new AppUsageException("Unknown application mode.");
            }

            return(returnCode);
        }
Example #2
0
        private void TouchToResolveCloudReferencePoint()
        {
            OutputText.text = m_CloudReferenceId;

            if (Input.touchCount >= 1 &&
                Input.GetTouch(0).phase == TouchPhase.Began &&
                !EventSystem.current.IsPointerOverGameObject(
                    Input.GetTouch(0).fingerId))
            {
                m_CloudReferencePoint =
                    ReferencePointManager.ResolveCloudReferenceId(
                        m_CloudReferenceId);
                if (m_CloudReferencePoint == null)
                {
                    OutputText.text    = "Resolve Failed!";
                    m_CloudReferenceId = string.Empty;
                    m_AppMode          = AppMode.TouchToHostCloudReferencePoint;
                    return;
                }

                m_CloudReferenceId = string.Empty;

                // Wait for the reference point to be ready.
                m_AppMode = AppMode.WaitingForResolvedReferencePoint;
            }
        }
Example #3
0
        private void updateMode(AppMode newMode)
        {
            this._mode = newMode;
            switch (_mode)
            {
            case AppMode.Participants:
                _grabber.AnalysisFunction = ParticipantsAnalysisFunction;
                break;

            case AppMode.Faces:
                _grabber.AnalysisFunction = AnalysisFunction;
                break;

            case AppMode.Emotions:
                _grabber.AnalysisFunction = AnalysisFunction;
                break;

            case AppMode.EmotionsWithClientFaceDetect:
                // Same as Emotions, except we will display the most recent faces combined with
                // the most recent API results.
                _grabber.AnalysisFunction = AnalysisFunction;
                _fuseClientRemoteResults  = true;
                break;

            default:
                _grabber.AnalysisFunction = null;
                break;
            }
        }
Example #4
0
    void Start()
    {
        Message      = GameObject.Find("Message").GetComponent <TMP_Text>();
        Message.text = "Start";

        planeManager          = GameObject.Find("AR Session Origin").GetComponent <ARPlaneManager>();
        pointCloudManager     = GameObject.Find("AR Session Origin").GetComponent <ARPointCloudManager>();
        ReferencePointManager = GameObject.Find("AR Session Origin").GetComponent <ARReferencePointManager>();

        if (PhotonNetwork.LocalPlayer.IsMasterClient)
        {
            if (!photonView.IsMine)
            {
                Message.text = "Start IsMasterClient but not PhotonVIewIsMine";
                return;
            }

            Message.text   = "MasterClient - please place common reference point by tapping a plane...  ";
            RaycastManager = GameObject.Find("AR Session Origin").GetComponent <ARRaycastManager>();

            m_AppMode = AppMode.TouchToHostCloudReferencePoint;
        }
        else
        {
            //Only MasterClient needs to see the environment interpretation (Points Planes)
            //Only Masterclient sets Cloud Reference Point
            VisualizePlanes(false);
            VisualizePoints(false);
            Message.text = "Not MasterClient";
            m_AppMode    = AppMode.ResolveCloudReferencePoint;
        }
    }
Example #5
0
        private void SetMode(AppMode mode)
        {
            m_appState.Mode = mode;

            switch (mode)
            {
            case AppMode.Calibration:
                LoadScene(forceCalibrationSceneName);
                break;

            case AppMode.Static:
                LoadScene(sequentialTestingSceneName);
                break;

            case AppMode.Dynamic:
                LoadScene(dynamicForceTrackingSceneName);
                break;

            case AppMode.RhythmGame:
                LoadScene(rhythmGameSceneName);
                break;

            case AppMode.FlappyBird:
                LoadScene(flappyBirdGameSceneName);
                break;

            case AppMode.MusicPlay:
                LoadScene(musicplayGameSceneName);
                break;
            }
        }
        private void OnAppModeChanged(AppMode mode)
        {
            if (mode == AppMode.Debug)
            {
                _savedStates.Clear();
                foreach (var variable in Variables.Where(t => t.IsAssigned))
                {
                    _savedStates.Add(variable.Clone());
                }
            }
            else if (mode == AppMode.Editor)
            {
                if (_savedStates.Count == 0)
                {
                    return;
                }

                foreach (var variable in _savedStates)
                {
                    var selector = Variables.FirstOrDefault(t => Common.IsSameName(t.Name, variable.Name));
                    if (selector != null && selector.StringValue != variable.StringValue)
                    {
                        selector.Update(variable);
                    }
                }
                _savedStates.Clear();
            }
        }
Example #7
0
    private void Update_WaitingForResolvedReferencePoint()
    {
        OutputText.text = "Waiting for server to resolve";
        CloudReferenceState cloudReferenceState =
            m_CloudReferencePoint.cloudReferenceState;

        OutputText.text += " - " + cloudReferenceState.ToString();

        if (cloudReferenceState == CloudReferenceState.Success)
        {
            print("GOT EM, ID: " + m_CloudReferencePoint.cloudReferenceId);
            CloudAnchors.Add(m_CloudReferencePoint.transform);
            CloudAnchorCreated?.Invoke(m_CloudReferencePoint.transform);

            m_CloudReferencePoint = null;
            m_AppMode             = AppMode.TouchToHostCloudReferencePoint;
        }
        else if (cloudReferenceState != CloudReferenceState.TaskInProgress)
        {
            print("Failed, TRYING AGAIN");
            OutputText.text = "Failed, Retrying in 5s";
            StartCoroutine(LoadPointFromIdInTime(idToLoad, 5f));
            m_AppMode = AppMode.TouchToHostCloudReferencePoint;
        }
    }
Example #8
0
        public void StartApp(AppMode pMode)
        {
            try
            {
                Init();
                InitAppMode(pMode);
                // Old Stub used to Init MediaNova Module
                InitModules();
                // Check if user cancel App Run on BootStrap and Launch Quit
                if (!_quitAfterBootStrap)
                {
                    Application.Run();
                }
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
                Utils.ShowMessageTouch(GlobalApp.WindowStartup, DialogFlags.Modal, new Size(500, 240), MessageType.Error, ButtonsType.Ok, Resx.global_error, Resx.app_error_contact_support);
            }
            finally
            {
                // Dispose Devices

                // Always Close Display Device
                if (GlobalApp.UsbDisplay != null)
                {
                    GlobalApp.UsbDisplay.Close();
                }
                // Always Close Com Ports
                if (GlobalApp.WeighingBalance != null && GlobalApp.WeighingBalance.IsPortOpen())
                {
                    GlobalApp.WeighingBalance.ClosePort();
                }
            }
        }
Example #9
0
 public DatabaseAuditParameters(
     string auditConnectionStringName,
     AppMode applicationMode)
 {
     AuditConnectionStringName = auditConnectionStringName;
     ApplicationMode           = applicationMode;
 }
Example #10
0
        private async void ModeList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            await _grabber.StopProcessingAsync();

            var comboBox = sender as ComboBox;
            var modes    = (AppMode[])Enum.GetValues(typeof(AppMode));

            _mode = modes[comboBox.SelectedIndex];
            switch (_mode)
            {
            case AppMode.Faces:
                _grabber.AnalysisFunction = FacesAnalysisFunction;
                break;

            case AppMode.Emotions:
                _grabber.AnalysisFunction = EmotionAnalysisFunction;
                break;

            case AppMode.Text:
                _grabber.AnalysisFunction = TextDetectAnalyzeFunction;
                break;

            default:
                _grabber.AnalysisFunction = null;
                break;
            }
            await _grabber.StartProcessingCameraAsync();
        }
Example #11
0
        private void WaitForHostedReferencePoint()
        {
            OutputText.text = m_AppMode.ToString();

            CloudReferenceState cloudReferenceState = m_CloudReferencePoint.cloudReferenceState;

            OutputText.text += " - " + cloudReferenceState.ToString();

            if (cloudReferenceState == CloudReferenceState.Success)
            {
                GameObject cloudAnchor = Instantiate(
                    Board,
                    Vector3.zero,
                    Quaternion.identity);
                cloudAnchor.transform.SetParent(
                    m_CloudReferencePoint.transform, false);

                m_CloudReferenceId    = m_CloudReferencePoint.cloudReferenceId;
                m_CloudReferencePoint = null;

                OutputText.text = m_CloudReferenceId;

                InstantiateBoardPieces();
                m_AppMode = AppMode.PlayState;
            }
            else
            {
                OutputText.text = cloudReferenceState.ToString();
            }
        }
 /// <summary>
 /// The constructor with stylesheet and window mode.
 /// </summary>
 public NUIApplication(string stylesheet, WindowMode windowMode) : base()
 {
     //handle the stylesheet and windowMode
     _appMode    = AppMode.StyleSheetWithWindowMode;
     _stylesheet = stylesheet;
     _windowMode = (Application.WindowMode)windowMode;
 }
Example #13
0
 internal void Broadcast(AppMode mode)
 {
     foreach (var modeNotificationSubscriber in modeNotificationSubscribers)
     {
         modeNotificationSubscriber.SetMode(mode);
     }
 }
Example #14
0
        static void Main(string[] args)
        {
            //args = "-parse -path /Users/mask/Downloads/playlists/parse/".Split(' ');
            //args = "-check".Split(' ');
            args = "-export -path /Users/mask/Downloads/playlists/out_playlist.m3u".Split(' ');

            if (args == null || args.Length == 0)
            {
                return;
            }

            // get app mode
            AppMode mode = null;

            if (args.Contains("-parse"))
            {
                mode = new ParserMode(args);
            }
            else if (args.Contains("-groups"))
            {
                mode = new GroupsMode(args);
            }
            else if (args.Contains("-check"))
            {
                mode = new CheckMode(args);
            }
            else if (args.Contains("-export"))
            {
                mode = new ExportMode(args);
            }

            mode?.Run();
        }
Example #15
0
        private void SoundCycleTheme_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                if (AppMode.AM_NORMAL == m_mode)
                {
                    m_mode = AppMode.AM_EDIT;
                }
                else
                {
                    m_mode = AppMode.AM_NORMAL;
                }

                UpdateAppMode();
            }


            if (e.KeyCode == Keys.MediaPlayPause)
            {
                if (m_play)
                {
                    Stop();
                }
                else
                {
                    Play();
                }
            }

            if (e.KeyCode == Keys.MediaStop)
            {
                Stop();
            }
        }
Example #16
0
        private void Init()
        {
            appLog    = new Log();
            FPS       = new Timer();
            FPS_Count = 0;

            FPS.Interval = 500;
            FPS.Tick    += new EventHandler(FPS_Time_Tick);
            FPS.Start();

            fdh = new FaceDetectHaar();
            odh = new ObjectDetectHaar();

            listDataSource             = new BindingList <Record>();
            gcDisplayDetect.DataSource = listDataSource;

            isSave    = false;
            numRecord = 0;

            mode     = AppMode.Predict;
            faceRepo = new FaceDataRepositories();
            cusRepo  = new CustomerRepositories();

            videoW = new VideoWriter(HelperFeature.pathLogVideo + "\\" + DateTime.Now.ToFileName() + ".avi",
                                     16,
                                     new Size(HelperFeature.Camera_Width,
                                              HelperFeature.Camera_Height),
                                     true);
            isLoadDataView = 10;
        }
Example #17
0
        private void PlaceChessBoard()
        {
            OutputText.text = "Please touch the screen to place the chess board";

            if (Input.touchCount >= 1 &&
                Input.GetTouch(0).phase == TouchPhase.Began &&
                !EventSystem.current.IsPointerOverGameObject(
                    Input.GetTouch(0).fingerId))
            {
                List <ARRaycastHit> hitResults = new List <ARRaycastHit>();
                RaycastManager.Raycast(Input.GetTouch(0).position, hitResults);
                if (hitResults.Count > 0)
                {
                    Pose pose = hitResults[0].pose;
                    if (placed == false)
                    {
                        PhotonNetwork.Instantiate(this.Board.name, pose.position, Quaternion.identity);
                        InstantiateBoardPieces();
                        placed    = true;
                        m_AppMode = AppMode.PlayState;
                    }
                    else
                    {
                        OutputText.text = "Chess Board already placed, cannot place another one";
                    }
                }
            }
        }
        private void ModeList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Disable "most-recent" results display.
            _fuseClientRemoteResults = false;

            var comboBox = sender as ComboBox;
            var modes    = (AppMode[])Enum.GetValues(typeof(AppMode));

            _mode = modes[comboBox.SelectedIndex];
            switch (_mode)
            {
            case AppMode.Faces:
                _grabber.AnalysisFunction = FacesAnalysisFunction;
                break;

            case AppMode.Emotions:
                _grabber.AnalysisFunction = EmotionAnalysisFunction;
                break;

            case AppMode.EmotionsWithClientFaceDetect:
                // Same as Emotions, except we will display the most recent faces combined with
                // the most recent API results.
                _grabber.AnalysisFunction = EmotionAnalysisFunction;
                _fuseClientRemoteResults  = true;
                break;

            case AppMode.Tags:
                _grabber.AnalysisFunction = TaggingAnalysisFunction;
                break;

            default:
                _grabber.AnalysisFunction = null;
                break;
            }
        }
Example #19
0
        private void TouchtoHostCloudReferencePoint()
        {
            OutputText.text = m_AppMode.ToString();

            if (Input.touchCount >= 1 &&
                Input.GetTouch(0).phase == TouchPhase.Began &&
                !EventSystem.current.IsPointerOverGameObject(
                    Input.GetTouch(0).fingerId))
            {
                List <ARRaycastHit> hitResults = new List <ARRaycastHit>();
                RaycastManager.Raycast(Input.GetTouch(0).position, hitResults);
                if (hitResults.Count > 0)
                {
                    pose = hitResults[0].pose;

                    // Create a reference point at the touch.
                    ARReferencePoint referencePoint =
                        ReferencePointManager.AddReferencePoint(
                            pose);

                    // Create Cloud Reference Point.
                    m_CloudReferencePoint =
                        ReferencePointManager.AddCloudReferencePoint(
                            referencePoint);
                    if (m_CloudReferencePoint == null)
                    {
                        OutputText.text = "Create Failed!";
                        return;
                    }

                    // Wait for the reference point to be ready.
                    m_AppMode = AppMode.WaitingForHostedReferencePoint;
                }
            }
        }
Example #20
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            AppDomain.CurrentDomain.AssemblyResolve += LoadEmbedAssembly;
            DeleteFiles();

            Instence = this;
            EventsManager.DatasDownloaded += OnDatasDownloaded;
            SaveInServer.Intitialize();
            LoadDatas();

            string[] args = Environment.GetCommandLineArgs();
            if (args.Length <= 1)
            {//Normal mode
                StartNormalMode();
            }
            else
            {
                switch (args[1])
                {
                case NOTIFAPPARG:
                    Mode = AppMode.NotificationMode;
                    NotificationsManager.Start_HomeworkNotification();
                    if (Agenda_Virtuel.Properties.Settings.Default.RunPluginNotification)
                    {
                        Plugin.PluginManager.Open();
                    }
                    break;

                default:
                    StartNormalMode();
                    break;
                }
            }
        }
Example #21
0
 /// <summary>
 /// Sets a application mode to configuration settings
 /// </summary>
 /// <param name="appConfig">Application configuration settings</param>
 /// <param name="mode">Application mode</param>
 private static void SetAppMode(AppConfiguration appConfig, AppMode mode)
 {
     if (appConfig.Mode == AppMode.Unknown)
     {
         appConfig.Mode = mode;
     }
 }
Example #22
0
    // Update is called once per frame
    void Update()
    {
        if (m_AppMode == AppMode.WaitingForResolvedReferencePoint)
        {
            OutputText.text = m_AppMode.ToString();

            CloudAnchorState cloudReferenceState =
                m_CloudReferencePoint.cloudAnchorState;
            OutputText.text += " - " + cloudReferenceState.ToString();

            if (cloudReferenceState == CloudAnchorState.Success)
            {
                GameObject cloudAnchor = Instantiate(
                    ResolvedPointPrefab,
                    Vector3.zero,
                    Quaternion.identity);
                cloudAnchor.transform.SetParent(
                    m_CloudReferencePoint.transform, false);
                m_CloudReferencePoint = null;
                j++;
                if (j == paths.Count - 1)
                {
                    m_AppMode = AppMode.FinishApp;
                }
                printScreen(paths[j]);
            }
        }
        if (m_AppMode == AppMode.FinishApp)
        {
            OutputText.text = "Hedefe Ulaştınız!";
        }
    }
Example #23
0
        public DataProvider(AppMode appMode)
        {
            XmlRepository  = new XmlRepository(this);
            CommonSettings = XmlRepository.LoadCommonSettings();
            if (CommonSettings == null)
            {
                CommonSettings = new CommonSettings {
                    IsSet = false
                }
            }
            ;
            else
            {
                CommonSettings.IsSet = true;
            }
            VariablesRepository = new VariablesRepository(this);
            ObjectsRepository   = new ObjectsRepository(this);

            CommonSettings.AppMode         = appMode;
            CommonSettings.AppModeChanged += delegate { ObjectsRepository.SwitchAppMode(); };

            ProjectRepository = new ProjectRepository(this);
            DialogsManager    = new DialogsManager(this);
            TabsRepository    = new TabsRepository(this);
            WindowsManager    = new WindowsManager(this);
        }
Example #24
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

        private void InitAppMode(AppMode pAppMode)
        {
            //Run in BackOffice Mode
            if (pAppMode == AppMode.Backoffice)
            {
                GlobalApp.WindowBackOffice = new BackOfficeMainWindow();
            }
            //Run in POS Mode
            else
            {
                //Init Theme Object
                _log.Debug("Init Theme Object ");
                var predicate   = (Predicate <dynamic>)((dynamic x) => x.ID == "StartupWindow");
                var themeWindow = GlobalApp.Theme.Theme.Frontoffice.Window.Find(predicate);

                //// Inject themeWindow into
                //GlobalApp.ExpressionEvaluator.Variables.Add("themeWindow", themeWindow);

                try
                {
                    _log.Debug("Init windowImageFileName ");
                    string windowImageFileName = string.Format(themeWindow.Globals.ImageFileName, GlobalApp.ScreenSize.Width, GlobalApp.ScreenSize.Height);
                    _log.Debug("StartupWindow " + windowImageFileName);
                    GlobalApp.WindowStartup = new StartupWindow(windowImageFileName);
                }
                catch (Exception ex)
                {
                    _log.Error(ex.Message, ex);
                }
            };
        }
Example #25
0
    // Update is called once per frame
    void Update()
    {
        if (m_AppMode == AppMode.TouchToHostCloudReferencePoint)
        {
            OutputText.text = m_AppMode.ToString();

            if (Input.touchCount >= 1 &&
                Input.GetTouch(0).phase == TouchPhase.Began &&
                !EventSystem.current.IsPointerOverGameObject(
                    Input.GetTouch(0).fingerId))
            {
                List <ARRaycastHit> hitResults = new List <ARRaycastHit>();
                RaycastManager.Raycast(Input.GetTouch(0).position, hitResults);
                if (hitResults.Count > 0)
                {
                    Pose pose = hitResults[0].pose;

                    // dokundurulan yerde referans noktası oluşturuyor.
                    ARAnchor referencePoint =
                        AnchorManager.AddAnchor(hitResults[0].pose);

                    // bulut referans noktasını oluşturuyor.
                    m_CloudReferencePoint =
                        AnchorManager.HostCloudAnchor(referencePoint);
                    if (m_CloudReferencePoint == null)
                    {
                        OutputText.text = "Create Failed!";
                        return;
                    }

                    // Wait for the reference point to be ready.
                    m_AppMode = AppMode.WaitingForHostedReferencePoint;
                }
            }
        }
        else if (m_AppMode == AppMode.WaitingForHostedReferencePoint)
        {
            OutputText.text = m_AppMode.ToString();

            CloudAnchorState cloudReferenceState =
                m_CloudReferencePoint.cloudAnchorState;
            OutputText.text += " - " + cloudReferenceState.ToString();

            if (cloudReferenceState == CloudAnchorState.Success)
            {
                GameObject cloudAnchor = Instantiate(
                    HostedPointPrefab,
                    Vector3.zero,
                    Quaternion.identity);
                cloudAnchor.transform.SetParent(
                    m_CloudReferencePoint.transform, false);
                panel.gameObject.SetActive(true);
                m_CloudReferenceId    = m_CloudReferencePoint.cloudAnchorId;
                cloudAnchorId.text    = m_CloudReferenceId;
                m_CloudReferencePoint = null;
                m_AppMode             = AppMode.TouchToHostCloudReferencePoint;
            }
        }
    }
Example #26
0
        private void barButtonItem12_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            InsertDataFromPicture temp = new InsertDataFromPicture();

            mode = AppMode.Logout;
            temp.ShowDialog();
            mode = AppMode.Predict;
        }
Example #27
0
        public void SetMode(AppMode newMode)
        {
            adminHeader.Visibility = adminDeleteButton.Visibility = adminMenu.Visibility =
                newMode == AppMode.Admin ? Visibility.Visible : Visibility.Collapsed;

            slideHeader.Visibility = newMode == AppMode.Slide ? Visibility.Visible : Visibility.Collapsed;
            techHeader.Visibility  = newMode == AppMode.Tech ? Visibility.Visible : Visibility.Collapsed;
        }
Example #28
0
 public void DrawMode()
 {
     appMode = AppMode.draw;
     drawButton.SetActive(false);
     editButton.SetActive(true);
     addButton.SetActive(true);
     marker.SetActive(true);
 }
Example #29
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public SettingDictionary ExportGeneral()
 {
     return(new Dictionary <string, string>()
     {
         { "app_mode", AppMode.ToString().ToLower() },
         { "instance_name", InstanceName },
     });
 }
Example #30
0
 void Set_CloudReferenceId(string id)
 {
     if (PhotonPlayersSingleton.Instance.CloudReferencePointId == "" || PhotonPlayersSingleton.Instance.CloudReferencePointId == null)
     {
         PhotonPlayersSingleton.Instance.CloudReferencePointId = id;
         m_AppMode    = AppMode.ResolveCloudReferencePoint;
         Message.text = "PunRPC Mode: AppMode.ResolveCloudReferencePoint";
     }
 }
Example #31
0
        public void ApplicationStartUpMode(AppMode mode)
        {
            switch (mode) {
                case AppMode.Login:
                    Console.WriteLine("Launching login mode...");
                    InvokeOnMainThread(()=>{
                    _loginViewController.View.Frame = ScreenResolutionMatcher.FullViewFrame();
                        _RemoveAllSubviews();
                        window.AddSubview(_loginViewController.View);
                    });
                    break;

                case AppMode.Tabs:
                    Console.WriteLine("Launching tabs mode...");

                    AppManager.Current.CommunityService.GetCommunityStats(); //sync call
                    AppManager.Current.CardsService.GetCards(); //sync call

                    InvokeOnMainThread(()=>{
                        var tabBarController = new UITabBarController();
                        if (ScreenResolutionMatcher.IsiOS7()) {
                            tabBarController.TabBar.BarTintColor = UIColor.Black;
                            tabBarController.TabBar.TintColor = UIColor.White;
                        }
                        //tabBarController.Delegate = new ProdeTabBarDelegate(this);
                        tabBarController.ViewControllers = new UIViewController [] {
                            _communityViewController,
                            _cardsViewController,
                            _userViewController
                        };
                        _RemoveAllSubviews();
                        window.RootViewController = tabBarController;
                    });
                    break;

                case AppMode.Newbie:
                    Console.WriteLine("Launching newbie mode...");
                    InvokeOnMainThread(()=>{
                        _tutorialViewController.View.Frame = ScreenResolutionMatcher.FullViewFrame();
                        _RemoveAllSubviews();
                        window.AddSubview(_tutorialViewController.View);
                    });
                    break;
            }
        }
 private void ButtonRecognizeOcto_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         busyIndicator.BusyContent = "Imaged captured & send to server";
         busyIndicator.IsBusy = true;
         _appMode = AppMode.RecognitionOcto;
         _captureSource.CaptureImageAsync();
     }
     catch (InvalidOperationException ex)
     {
         TextBoxInfo.Text = "Start the web cam first";
         busyIndicator.IsBusy = false;
     }
     catch (Exception ex)
     {
         TextBoxInfo.Text = "Undetermined exception";
         busyIndicator.IsBusy = false;
     }
 }
        public void Initialize(AppMode appMode, string startupStreamUrl, string startupTmsId, bool isDiagModeEnabled)
        {
            this.container = new SimpleContainer();
            this.container.RegisterSingleton(typeof(IEventAggregator), null, typeof(EventAggregator));
            this.container.RegisterSingleton(typeof(ISettingsService), null, typeof(SettingsService));
            this.container.RegisterSingleton(typeof(ScriptBridge), null, typeof(ScriptBridge));
            this.container.RegisterSingleton(typeof(LocationService), null, typeof(LocationService));
            this.container.GetInstance<ScriptBridge>();
            this.container.GetInstance<ISettingsService>().AppMode = appMode;
            this.container.RegisterSingleton(typeof(PlayerViewModel), null, typeof(PlayerViewModel));
            this.container.RegisterSingleton(typeof(InteractionViewModel), null, typeof(InteractionViewModel));
            this.container.RegisterSingleton(typeof(AssetViewerViewModel), null, typeof(AssetViewerViewModel));
            this.container.RegisterSingleton(typeof(AssetInfoViewModel), null, typeof(AssetInfoViewModel));
            this.container.RegisterSingleton(typeof(CaptionSettingsViewModel), null, typeof(CaptionSettingsViewModel));
            this.container.GetInstance<AssetViewerViewModel>().ShowErrorDetail = isDiagModeEnabled;
            switch (appMode)
            {
                case AppMode.Default:
                    this.container.RegisterSingleton(typeof(BaseShellViewModel), null, typeof(OnDemandShellViewModel));
                    break;

                case AppMode.Live:
                    this.container.RegisterSingleton(typeof(ChannelBrowserViewModel), null, typeof(ChannelBrowserViewModel));
                    this.container.RegisterSingleton(typeof(BaseShellViewModel), null, typeof(LiveTVShellViewModel));
                    if (startupTmsId.IsNotNullOrEmpty())
                    {
                        this.container.GetInstance<ChannelBrowserViewModel>().StartupTmsId = startupTmsId;
                    }
                    break;

                case AppMode.SportsNetwork:
                    this.container.RegisterSingleton(typeof(BaseShellViewModel), null, typeof(SportsNetworkShellViewModel));
                    if (startupStreamUrl.IsNotNullOrEmpty())
                    {
                        SportsNetworkShellViewModel instance = (SportsNetworkShellViewModel) this.container.GetInstance<BaseShellViewModel>();
                        instance.StartupStreamUrl = startupStreamUrl;
                    }
                    break;
            }
            HtmlPage.RegisterScriptableObject("Bridge", this.container.GetInstance<ScriptBridge>());
        }
        public MeetingViewModel(
            Meeting meeting, 
            IList<IToolViewModel> tools,
            VideoConfViewModel videoConf,
            ISharedDataService sharedData,
            AppMode appMode)
        {
            AppMode = appMode;
            Id = meeting.Id;
            _identifierProperty = this.WhenAnyValue(v => v.Id, p => p.ToString().Substring(0, 6).ToUpper()).ToProperty(this, p => p.Identifier);
            StartTime = meeting.StartTime;
            Duration = meeting.Duration;
            Client = new ClientInfoViewModel(meeting.Client);

            PopulateMeetingStatus(meeting.Status);
            Tools = tools;
            VideoConf = videoConf;

            ActiveTool = tools.FirstOrDefault();

            this.WhenAnyValue(p => p.StartTime, p => p.DateTime.ToString("dddd")).ToProperty(this, p => p.DayOfTheWeek, out _dayOfTheWeekProperty);
            this.WhenAnyValue(p => p.StartTime, p => p.DateTime.ToString("dd")).ToProperty(this, p => p.DayOfTheMonth, out _dayOfTheMonthProperty);
            this.WhenAnyValue(p => p.StartTime, p => p.DateTime.ToString("MMMM yyyy")).ToProperty(this, p => p.MonthAndYear, out _monthAndYearProperty);
            this.WhenAnyValue(p => p.StartTime, p => p.Duration, (s, d) =>
            {
                var start = s.DateTime;
                var end = s.DateTime.Add(d);

                var startStr = start.ToString(start.Minute == 0 ? " h " : "h:mm").Trim();
                var endStr = start.ToString(end.Minute == 0 ? "h tt" : "h:mm tt");

                if (start.ToString("tt") != end.ToString("tt"))
                {
                    startStr = startStr + " " + start.ToString("tt");
                }

                return string.Format("{0} - {1}", startStr, endStr);

            }).ToProperty(this, p => p.TimeAndDuration, out _timeAndDurationProperty);
        }
 private void ButtonAddOcto_Click(object sender, RoutedEventArgs e)
 {
     if (String.IsNullOrEmpty(TextBoxLabel.Text))
     {
         TextBoxInfo.Text = "You have to specify the label!";
         return;
     }
     try
     {
         busyIndicator.IsBusy = true;
         busyIndicator.BusyContent = "Imaged captured & send to server to be added to training set";
         _appMode = AppMode.TrainingOcto;
         _captureSource.CaptureImageAsync();
     }
     catch (InvalidOperationException ex)
     {
         TextBoxInfo.Text = "Start the web cam first";
         busyIndicator.IsBusy = false;
     }
     catch (Exception ex)
     {
         busyIndicator.IsBusy = false;
     }
 }
            public Page2(LifetimeEconomicValueViewModel parent, AppMode mode)
            {
                Mode = mode;
                _parent = parent;

                

                // Check for valid inputs
                Person.WhenAnyValue(
                    p => p.AnnualIncome,
                    p => p.RetirementAge,
                    p => p.Age,
                    (income, retAge, curAge) => // Check that we have values for the inputs and tha they make sense
                        income.HasValue &&
                        income.Value >= 1000 &&
                        curAge.HasValue &&
                        curAge.Value >= 18 &&
                        retAge.HasValue &&
                        retAge.Value >= curAge
                    )
                    .ToProperty(this, p => p.HasValidInputs, out _hasValidInputs);

                this.WhenAnyValue(p => p.HasValidInputs, p => !p).ToProperty(this, p => p.HasInvalidInputs, out _hasInvalidInputs);
            }
Example #37
0
        public CoreViewModel()
        {
            _currentAppMode = AppMode.None;
            _initResult = InitResultType.None;
            _userVars = new Dictionary<string, EnVar>();
            _systemVars = new Dictionary<string, EnVar>();
            _modificationMode = ModificationModeType.None;
            _modificationTitle = string.Empty;
            _modifiedKey = string.Empty;
            _modifiedValue = string.Empty;
            _validationMessage = string.Empty;
            _hasUserImportVariables = false;
            _hasSystemImportVariables = false;
            _hasUserExportVariables = false;
            _hasSystemExportVariables = false;
            _hasInitImportStatus = false;
            _hasImportConflicts = false;

            // Get the services
            _messageService = ServiceManager.Instance.GetService<IMessageService>();
            _modificationService = ServiceManager.Instance.GetService<IModificationService>();
            _fileService = ServiceManager.Instance.GetService<IFileService>();
            _progressService = ServiceManager.Instance.GetService<IProgressService>();

            // InitializeEnvironmentVariables the commands
            InitializeCommands();
        }
Example #38
0
 public void ChangeApplicationStartUpMode(AppMode mode)
 {
     _uiClient.ApplicationStartUpMode(mode);
 }
 public Page3(BasicInformationToolViewModel parent, AppMode mode)
 {
     Mode = mode;
     _parent = parent;
 }
 public Page1(PersonModel person, AppMode mode)
 {
     Person = person;
     Mode = mode;
 }
Example #41
0
        void SwitchMode(AppMode newMode)
        {
            if (mode == newMode)
                return;

            mode = newMode;

            switch (mode)
            {
                case AppMode.Regular:

                    buttonPureArbitrage.IsEnabled = true;
                    LogModeController.Stop();
                    break;

                case AppMode.Sleep:

                    buttonPureArbitrage.IsEnabled = false;
                    PureArbitrageWindow pureArbitrageWindow =
                        (PureArbitrageWindow)
                        fixApplication.SpreadMatrixCollection.SearchForUpdatableObject(wnd => wnd is PureArbitrageWindow);
                    if (pureArbitrageWindow != null)
                        pureArbitrageWindow.MessageProvider = null;

                    foreach (SpreadMatrixData spreadMatrixData in fixApplication.SpreadMatrixCollection.Values)
                    {
                        SMatrixForm spreadMatrixForm =
                            (SMatrixForm) spreadMatrixData.SearchForUpdatableObject(wnd => wnd is SMatrixForm);

                        if (spreadMatrixForm != null)
                            spreadMatrixForm.MessageProvider = null;
                    }

                    LogModeController.Start();
                    break;
            }
        }
        //--------------------------------------------------
        // fill the pgo struct and initialize PasswordGenerator class with it
        void ProcessCmdline()
        {
            // quickgen
            if (CommandLineArgs.ContainsKey("--quickgen"))
            {
                App.appMode = App.AppMode.quickgen;

                string quickGen = CommandLineArgs["--quickgen"].ToString();
                if (quickGen.Length == 0)
                {
                    ReportErrorAndExit("Required argument value is empty: --quickgen", ExitCodes.cmdlineArgError);
                }

                switch (GetLongArgOrValueName(quickGen.Split(':')[0]))
                {
                    case "password":
                        quickGenMode = QuickGenMode.password;
                        break;
                    case "wpa":
                        quickGenMode = QuickGenMode.wpa;
                        break;
                    default:
                        ReportErrorAndExit("Unknown QuickGen mode: --quickgen:" + quickGen.Split(':')[0], ExitCodes.cmdlineArgError);
                        break;
                }
            }
        }
Example #43
0
 public Settings(AppMode mode)
 {
     Mode = mode;
 }