Exemple #1
0
        private void cb_presetSelection_SelectedIndexChanged(object sender, EventArgs e)
        {
            btn_presetRemove.Enabled = true;

            presetIndex = cb_presetSelection.SelectedIndex;
            clockForm.applyPreset(presetList[presetIndex]);     // Size type, customSize

            sizeType   = presetList[presetIndex].SizeType;
            customSize = presetList[presetIndex].Size;

            clockForm.setSecondState(presetList[presetIndex].DisplaySeconds);
            clockForm.setLocation(presetList[presetIndex].LocationX, presetList[presetIndex].LocationY);    // Location


            assignGlobalRadioState(presetList[presetIndex].ClockType);    // clock type

            clockForm.monitorSetupIsChanged();

            clockForm.applyNewAnalogLayout(presetList[presetIndex].AnalogClockLayout);
            storedAnalogLayout = presetList[presetIndex].AnalogClockLayout;

            setRadioButton(presetList[presetIndex].ClockType);

            clockForm.setColourScheme(presetList[presetIndex].DigitalColours);
            digitalColours = presetList[presetIndex].DigitalColours;

            Data_Config.SavedConfigs.setPresetIndex(presetIndex, presetList.Size() - 1);
            Data_Config.SavedConfigs.saveData();
        }
Exemple #2
0
        public UserProfileSubPage()
            : base(RoboSepSubPage.MdiChild.UserProfile)
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // Initialise fixed text
            this.Text = "Profile";

            btnUpdate.Text   = "Modify/Update";
            btnUpdate.Role   = RoboSepButton.ButtonRole.OK;
            btnLoad.Text     = "Load";
            btnLoad.Role     = RoboSepButton.ButtonRole.OK;
            btnProtocol.Text = "Protocol List";
            btnProtocol.Role = RoboSepButton.ButtonRole.Warning;
            btnEditor.Text   = "Protocol Editor";
            btnEditor.Role   = RoboSepButton.ButtonRole.Warning;

            pnlCustomUsers.Text = "Custom Users";
            pnlPresetUsers.Text = "Preset Protocol Databases";

            // Initialise colour scheme
            Color activeSubPageBackground = ColourScheme.GetColour(ColourSchemeItem.ActiveSubPageBackground);

            pnlCustomUsers.BackColor = activeSubPageBackground;
            pnlPresetUsers.BackColor = activeSubPageBackground;

            pnlCustomUsers.FillColor = ColourScheme.GetColour(ColourSchemeItem.NamedAreaStandardBackground);
            lstCustomUsers.BackColor = pnlCustomUsers.FillColor;
            pnlPresetUsers.FillColor = pnlCustomUsers.FillColor;
            lstPresetUsers.BackColor = pnlCustomUsers.FillColor;

            LoadCustomUsers();
            LoadPresetUsers();

            LoadCurrentUser();

            SeparatorGateway.GetInstance().UpdateChosenProtocolTable += new SampleTableDelegate(AtUpdateChosenProtocolTableUpdate);
            //SeparatorGateway.GetInstance()
            //myCurrentActionContext = listPresetUsersItems[0].Tag;

            myRoboSepWaitForm = new RoboSepWaitForm();
        }
Exemple #3
0
        // Triggers if the apply button is hit
        private void advancedOptions_applied(object sender, EventArgs e)
        {
            //  Sets the default preset clock type
            presetList[0].ClockType = advForm.DefaultDisplayType;
            presetList.saveToFile();

            // Store values
            customSize     = advForm.CustomSize;
            sizeType       = advForm.SizeType;
            displaySeconds = advForm.DisplaySeconds;

            // Main Form settings
            setDefaultRadioButton();
            setDeadlineMinutes();

            digitalColours = (advForm.DigitalColours != null) ? advForm.DigitalColours : new ColourScheme();

            if (advForm.isAnalogLayoutApplied())
            {
                if (advForm.AnalogClockLayout != null)
                {
                    storedAnalogLayout = advForm.AnalogClockLayout;
                }
                else
                {
                    storedAnalogLayout = new AnalogLayout(new AnalogClock.AnalogClock());
                }
            }

            // Clock form settings
            clockForm.setSizeType(sizeType);
            clockForm.setCustomSize(customSize);
            clockForm.setColourScheme(digitalColours);
            clockForm.setSecondState(displaySeconds);
            clockForm.resizeForm();

            if (storedAnalogLayout != null)
            {
                clockForm.applyNewAnalogLayout(storedAnalogLayout);
            }

            advForm.resetAnalogLayoutAppliance();
        }
Exemple #4
0
        private void setDefaultPreset()
        {
            Preset defaultPreset;

            if (Monitor.isOnlyOneMonitor())
            {
                defaultPreset = new Preset(1, (int)SIZETYPE.CUSTOMSIZE, 0, 0, 300, (int)CLOCKTYPE.E24hour, "Default - One Monitor", new AnalogLayout(new AnalogClock.AnalogClock()), new ColourScheme(), false);
            }
            else
            {
                defaultPreset = new Preset(Data_Config.Monitor.AllMonitors.Length, (int)SIZETYPE.FULLSCREEN, 0, 0, 0, (int)CLOCKTYPE.E24hour, "Default - Multiple Monitors", new AnalogLayout(new AnalogClock.AnalogClock()), new ColourScheme(), false);
            }

            presetList[0]  = defaultPreset;
            customSize     = defaultPreset.Size;
            sizeType       = defaultPreset.SizeType;
            digitalColours = defaultPreset.DigitalColours;
            displaySeconds = defaultPreset.DisplaySeconds;
        }
Exemple #5
0
        public PresetSettingsForm(PresetList presets, int xLocation, int yLocation, int typeOfSize, int size, int radioIndex, AnalogLayout layout, ColourScheme clockColours, bool seconds)
        {
            InitializeComponent();

            mPresetList = presets;
            populatePresetView();


            x          = xLocation;
            y          = yLocation;
            sizeType   = typeOfSize;
            customSize = size;

            clockType = radioIndex;

            analogLayout = layout;

            digitalColours = clockColours;

            displaySeconds = seconds;
        }
Exemple #6
0
    /// <summary>
    /// Convert colour scheme enumarable in to actual colour scheme.
    /// </summary>
    /// <returns>Array of Colour String Hex Codes</returns>
    ///
    private string[] getColourScheme(ColourScheme ColourSchemeNum)
    {
        switch (ColourSchemeNum)
        {
        case (ColourScheme.schemeBlues):
            return(new string[] { "#eff3ff", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#084594" });

        case (ColourScheme.schemeGreens):
            return(new string[] { "#edf8e9", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#005a32" });

        case (ColourScheme.schemeGreys):
            return(new string[] { "#f7f7f7", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525" });

        case (ColourScheme.schemeOranges):
            return(new string[] { "#feedde", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#8c2d04" });

        case (ColourScheme.schemePurples):
            return(new string[] { "#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#4a1486" });

        case (ColourScheme.schemeReds):
            return(new string[] { "#fee5d9", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#99000d" });

        case (ColourScheme.schemeBuPu):
            return(new string[] { "#edf8fb", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#6e016b" });

        case (ColourScheme.schemeGnBu):
            return(new string[] { "#f0f9e8", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#08589e" });

        case (ColourScheme.schemeOrRd):
            return(new string[] { "#fef0d9", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#990000" });

        case (ColourScheme.schemeBlYu):
            return(new string[] { "#BDE5BB", "#ABD9BB", "#99CCBB", "#87C0BC", "#75B3BC", "#63A7BC", "#51A4BC" });

        default:
            return(new string[] { "#f6eff7", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016450" });
        }
    }
        public ModelSetupWizardViewModel(Autodesk.Revit.UI.UIDocument uidoc)
        {
            doc = uidoc.Document;
            ProjectInformation          = new BindableCollection <ProjectInformationParameter>(ElementCollectors.GetProjectInformationParameters(doc));
            Worksets                    = new BindableCollection <WorksetParameter>(ElementCollectors.GetWorksetParameters(doc));
            SelectedWorksets            = new List <WorksetParameter>();
            SelectedProjectInformations = new List <ProjectInformationParameter>();
            optionsVm                   = new ModelSetupWizardOptionsViewModel();
            NominatedArchitects         = optionsVm.NominatedArchitects;
            ColourSchemes               = optionsVm.ColourSchemes;
            NominatedArchitects.Insert(0, new NominatedArchitect("Architects Name", "0000"));
            selectedNominatedArchitect = NominatedArchitects[0];
            selectedColourScheme       = ColourSchemes[0];
            FileName = doc.PathName;

            var iniFile = IniIO.GetIniFile(doc);

            if (iniFile.Length > 0)
            {
                var colors = IniIO.ReadColours(iniFile);
                Colours = new BindableCollection <System.Windows.Media.Color>(colors);
            }
            else
            {
                SCaddinsApp.WindowManager.ShowMessageBox(iniFile + " does not exist");
            }

            var fileNameParam = ProjectInformation.Where(p => p.Name == ModelSetupWizardSettings.Default.FileNameParameterName);

            if (fileNameParam.Count() == 1)
            {
                if (string.IsNullOrEmpty(doc.PathName))
                {
                    SCaddinsApp.WindowManager.ShowMessageBox("Document not saved... filename cannot be assigned.");
                }
                var path = System.IO.Path.GetFileName(doc.PathName);
                fileNameParam.First().Value = path;
            }

            foreach (var pinf in optionsVm.ProjectInformationReplacements)
            {
                var match = ProjectInformation.Where(p => p.Name == pinf.ParamaterName);
                if (match.Count() == 1)
                {
                    match.First().Format = pinf.ReplacementFormat;
                    match.First().Value  = pinf.ReplacementValue;
                }
            }
            foreach (var winf in optionsVm.Worksets)
            {
                if (Worksets.Select(w => w.Name.Trim()).Contains(winf.Name.Trim()))
                {
                    continue;
                }
                if (!Worksets.Select(w => w.Name).Contains(winf.ExistingName.Trim()))
                {
                    Worksets.Add(winf);
                }
                var match = Worksets.Where(w => w.Name.Trim() == winf.ExistingName.Trim());
                if (match.Any())
                {
                    match.First().Name = winf.Name;
                }
            }
        }