public static string GetSunStatusMessage(ToolbarType toolbarType, SunStudyData sunStudyData)
        {
            // Set status message if sun study dials are open
            string statusMessage = toolbarType == ToolbarType.AltitudeAzimuthDial ? AltitudeAzimuthRadialUIController.GetAltAzStatusMessage(sunStudyData) :
                                   toolbarType == ToolbarType.TimeOfDayYearDial ? TimeRadialUIController.GetTimeStatusMessage(sunStudyData) : String.Empty;

            return(statusMessage);
        }
Example #2
0
        void OnSunStudyButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.SunStudyDial))
            {
                return;
            }

            if (UIStateManager.current.stateData.activeDialog == DialogType.OrbitSelect)
            {
                UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.None));
            }
            if (m_SelectButton.selected)
            {
                UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenSubDialog, DialogType.None));
            }
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetSunStudyMode, false));
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetActiveToolbar, ToolbarType.TimeOfDayYearDial));
            var toolState = UIStateManager.current.stateData.toolState;

            toolState.activeTool = ToolType.SunstudyTool;
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
            var sunStudyData = UIStateManager.current.stateData.sunStudyData;

            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatus, TimeRadialUIController.GetTimeStatusMessage(sunStudyData)));
        }
        void OnDialogButtonClicked()
        {
            var dialogType  = m_DialogWindow.open ? DialogType.None : DialogType.SunStudy;
            var toolbarType = m_DialogWindow.open ? TimeRadialUIController.m_previousToolbar : ToolbarType.TimeOfDayYearDial;
            var toolState   = UIStateManager.current.stateData.toolState;

            toolState.activeTool = m_DialogWindow.open ? ToolType.None : ToolType.SunstudyTool;

            var data = UIStateManager.current.stateData;

            if (m_DialogWindow.open || data.dialogMode == DialogMode.Help)
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.ClearStatus, null));
            }
            else
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatusMessage, TimeRadialUIController.GetTimeStatusMessage(data.sunStudyData)));
            }
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, dialogType));
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenSubDialog, DialogType.None));

            // don't use dial in VR or Help Mode
            if (data.navigationState.navigationMode != NavigationMode.VR && data.dialogMode != DialogMode.Help)
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetActiveToolbar, toolbarType));
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
            }
            // Always change mode back to Geographic since dial will be Time or closed
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetSunStudyMode, false));
        }
        void OnSecondaryButtonClicked()
        {
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetSunStudyMode, false));
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetActiveToolbar, ToolbarType.TimeOfDayYearDial));
            var toolState = UIStateManager.current.stateData.toolState;

            toolState.activeTool = ToolType.SunstudyTool;
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
            var sunStudyData = UIStateManager.current.stateData.sunStudyData;

            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatus, TimeRadialUIController.GetTimeStatusMessage(sunStudyData)));
        }