Esempio n. 1
0
        public MainWindow(UIApplication uiapp, List <Room> rooms)
        {
            m_app         = uiapp;
            m_doc         = m_app.ActiveUIDocument.Document;
            selectedRooms = rooms;
            AbortFlag.SetAbortFlag(false);

            InitializeComponent();
            settings = DataStorageUtil.ReadAnalysisSettings(m_doc);

            DisplaySettings();
            this.Title = "LEED EQc 8.2 - View Analysis v." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
 private void DisplaySettings()
 {
     try
     {
         settings                       = DataStorageUtil.ReadAnalysisSettings(m_doc);
         textBoxDataFile.Text           = settings.DataFileName;
         sliderResolution.Value         = (int)settings.Resolution;
         radioButtonParameter.IsChecked = settings.ExteriorWallByParameter;
         checkBoxOverwrite.IsChecked    = settings.OverwriteData;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Failed to display settings for View Analysis.\n" + ex.Message, "Display Settings", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Esempio n. 3
0
        private bool SaveSettings()
        {
            bool saved = false;

            try
            {
                settings.DataFileName = textBoxDataFile.Text;

                double sliderVal = sliderResolution.Value;
                settings.Resolution = (DataResolution)sliderVal;
                switch (settings.Resolution)
                {
                case DataResolution.Low:
                    settings.Interval = 2;
                    break;

                case DataResolution.Medium:
                    settings.Interval = 1;
                    break;

                case DataResolution.High:
                    settings.Interval = 0.5;
                    break;
                }

                settings.ExteriorWallByParameter = (bool)radioButtonParameter.IsChecked;
                settings.IncludeLinkedModel      = (bool)checkBoxLinkedModel.IsChecked;
                settings.OverwriteData           = (bool)chekcBoxRecalculate.IsChecked;

                if (DataStorageUtil.UpdateAnalysisSettings(m_doc, settings))
                {
                    saved = true;
                }
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Failed to save analysis settings.\n" + ex.Message, "Save Settings", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            return(saved);
        }