Example #1
0
        public FormOptionsSettings()
        {
            InitializeComponent();

            Panels.Add(new OptionPanelUnits());
            Panels.Add(new OptionPanelDimensions());
            Panels.Add(new OptionPanelPalletEdition());
            Panels.Add(new OptionPanelReporting());
            Panels.Add(new OptionPanelLayerListCtrl());
            Panels.Add(new OptionPanelDebugging());
        }
Example #2
0
 public TECTypical(TECTypical source, Dictionary <Guid, Guid> guidDictionary     = null,
                   ObservableListDictionary <ITECObject> characteristicReference = null) : this()
 {
     if (guidDictionary != null)
     {
         guidDictionary[_guid] = source.Guid;
     }
     foreach (TECEquipment equipment in source.Equipment)
     {
         var toAdd = new TECEquipment(equipment, guidDictionary, characteristicReference);
         if (characteristicReference != null)
         {
             characteristicReference.AddItem(equipment, toAdd);
         }
         Equipment.Add(toAdd);
     }
     foreach (TECController controller in source.Controllers)
     {
         var toAdd = controller.CopyController(guidDictionary);
         if (characteristicReference != null)
         {
             characteristicReference.AddItem(controller, toAdd);
         }
         AddController(toAdd);
     }
     foreach (TECPanel panel in source.Panels)
     {
         var toAdd = new TECPanel(panel, guidDictionary);
         if (characteristicReference != null)
         {
             characteristicReference.AddItem(panel, toAdd);
         }
         Panels.Add(toAdd);
     }
     foreach (TECMisc misc in source.MiscCosts)
     {
         var toAdd = new TECMisc(misc);
         MiscCosts.Add(toAdd);
     }
     foreach (TECScopeBranch branch in source.ScopeBranches)
     {
         var toAdd = new TECScopeBranch(branch);
         ScopeBranches.Add(toAdd);
     }
     copyPropertiesFromLocated(source);
 }
Example #3
0
        public void OpenMetaFieldTemplateEdition(IEntity metaField)
        {
            MetaFieldEditionPanelViewModel panelViewModel = null;

            switch (metaField)
            {
            case IBooleanMetaField booleanMetaField:
                panelViewModel = BooleanMetaFieldTemplateEditionPanelViewModel.Create();
                ((BooleanMetaFieldTemplateEditionPanelViewModel)panelViewModel).Initialize(booleanMetaField);
                break;

            case IIntegerMetaField integerMetaField:
                panelViewModel = IntegerMetaFieldTemplateEditionPanelViewModel.Create();
                ((IntegerMetaFieldTemplateEditionPanelViewModel)panelViewModel).Initialize(integerMetaField);
                break;

            case IDecimalMetaField decimalMetaField:
                panelViewModel = DecimalMetaFieldTemplateEditionPanelViewModel.Create();
                ((DecimalMetaFieldTemplateEditionPanelViewModel)panelViewModel).Initialize(decimalMetaField);
                break;

            case IDateTimeMetaField dateTimeMetaField:
                panelViewModel = DateTimeMetaFieldTemplateEditionPanelViewModel.Create();
                ((DateTimeMetaFieldTemplateEditionPanelViewModel)panelViewModel).Initialize(dateTimeMetaField);
                break;

            case IStringMetaField stringMetaField:
                panelViewModel = StringMetaFieldTemplateEditionPanelViewModel.Create();
                ((StringMetaFieldTemplateEditionPanelViewModel)panelViewModel).Initialize(stringMetaField);
                break;

            case IEntityMetaField entityMetaField:
                panelViewModel = EntityMetaFieldTemplateEditionPanelViewModel.Create();
                ((EntityMetaFieldTemplateEditionPanelViewModel)panelViewModel).Initialize(entityMetaField);
                break;
            }

            if (panelViewModel != null)
            {
                Panels.Add(panelViewModel);
                SetFocusOnSelectedPanel();
            }
        }
Example #4
0
        public OptionForm()
            : base(PropertyDictionary <string, object> .Convert(Config.LocalSetting))
        {
            InitializeComponent();
            languagePanel = new LanguagePanel();

            Panels.Add(new GeneralPanel());
            Panels.Add(new TestPanel());
            Panels.Add(languagePanel);
            Panels.Add(new UserAgentPanel());
            Panels.Add(new SystemTestPanel());

            OkButtonText         = Config.LocalLanguage.OptionPage.OK;
            ApplyButtonText      = Config.LocalLanguage.OptionPage.Apply;
            CancelButtonText     = Config.LocalLanguage.OptionPage.Cancel;
            OptionsNoDescription = Config.LocalLanguage.OptionPage.OptionsNoDescription;

            AppRestartText = Config.LocalLanguage.OptionPage.ProgramRestartRequired;
            Config.LocalSetting.PropertyChanged += LocalSetting_PropertyChanged;
        }
        public QuadcopterApp()
        {
            InitializeComponent();

            // merge menu strips
            foreach (ToolStripMenuItem menuItem in menuStrip1.Items)
            {
                menuItem.MergeAction = MergeAction.Append;
            }
            toolsToolStripMenuItem.MergeAction = MergeAction.MatchOnly;
            ToolStripManager.Merge(menuStrip1, base.MenuStrip);
            menuStrip1.Visible = false;

            // create panels
            dataPanel       = new DataPanel();
            mapPanel        = new GMapPanel();
            videoPanel      = new DummyVideoPanel();
            quickTools      = new QuickTools();
            dataPanel.Text  = "Telemetry Data";
            mapPanel.Text   = "Map";
            videoPanel.Text = "Dummy Video (not working)";
            quickTools.Text = "Quick Tools";
            Panels.Add(dataPanel, DockState.DockRight);
            Panels.Add(mapPanel, DockState.Document);
            Panels.Add(videoPanel, DockState.Document);
            Panels.Add(quickTools, DockState.DockLeft);

            // create message processors
            messageProcessorData        = new MessageProcessor_Data();
            messageProcessorPath        = new MessageProcessor_Path();
            messageProcessorMap         = new MessageProcessor_Map();
            messageProcessorData.Target = dataPanel;
            messageProcessorPath.Target = mapPanel;
            messageProcessorMap.Target  = mapPanel;
            AddMessageProcessor(messageProcessorData);
            AddMessageProcessor(messageProcessorPath);
            AddMessageProcessor(messageProcessorMap);

            // init quick tools
            quickTools.AddMap(mapPanel);
        }
Example #6
0
 public void Extract(string filepath)
 {
     using (FileStream fs = File.Open(filepath, FileMode.Open, FileAccess.ReadWrite))
     {
         using (XmlReader rdr = XmlReader.Create(fs))
         {
             XDocument doc                    = XDocument.Load(rdr);
             XElement  rootElement            = doc.Root;
             IEnumerable <XElement> panelstag = rootElement.Descendants("panels");
             XElement rootpanel               = panelstag.Elements().ToList()[0];
             var      result                  = Getelement(rootpanel);
             Panels.Add(result);
             IEnumerable <XElement> gggg = rootpanel.Descendants("item");
             foreach (var item in gggg)
             {
                 result = Getelement(item);
                 Panels.Add(result);
             }
             AdditionalExtract(rootElement);
         }
     }
 }
Example #7
0
        public TECTypical(TECSystem system, TECScopeManager manager) : this()
        {
            Dictionary <Guid, Guid> guidDictionary = new Dictionary <Guid, Guid>();

            guidDictionary[_guid] = system.Guid;
            foreach (TECEquipment equipment in system.Equipment)
            {
                var toAdd = new TECEquipment(equipment, guidDictionary);
                Equipment.Add(toAdd);
            }
            foreach (TECController controller in system.Controllers)
            {
                var toAdd = controller.CopyController(guidDictionary);
                AddController(toAdd);
            }
            foreach (TECPanel panel in system.Panels)
            {
                var toAdd = new TECPanel(panel, guidDictionary);
                Panels.Add(toAdd);
            }
            foreach (TECMisc misc in system.MiscCosts)
            {
                var toAdd = new TECMisc(misc);
                MiscCosts.Add(toAdd);
            }
            foreach (TECScopeBranch branch in system.ScopeBranches)
            {
                var toAdd = new TECScopeBranch(branch);
                ScopeBranches.Add(toAdd);
            }
            foreach (TECProposalItem item in system.ProposalItems)
            {
                var toAdd = new TECProposalItem(item, guidDictionary);
                ProposalItems.Add(toAdd);
            }
            copyPropertiesFromLocated(system);
            ModelLinkingHelper.LinkSystem(this, guidDictionary);
        }