Esempio n. 1
0
        public ScoringViewComponentPanel()
        {
            myHelper = new ViewPanelHelper(this);

            InitializeComponent();

            vsgController = (VSGController)AMEManager.Instance.Get("VSG");
            projectController = (RootController)AMEManager.Instance.Get("Project");
            vsgController.RegisterForUpdate(this);

            myLinkType = vsgController.ConfigurationLinkType;

            customTreeView1.Controller = vsgController;

            customTreeView1.AddCustomTreeRoot(myLinkType);
            customTreeView1.SetCustomTreeRootXsl(myLinkType, "Scoring.xsl");

            customTreeView1.Level = 3;
            customTreeView1.ShowRoot = false;


            scorePanel = new ScorePanel();
            scorePanel.Controller = vsgController;
            
            scoringRulePanel = new ScoringRulePanel();
            scoringRulePanel.Controller = vsgController;
            
            //scenarioImages1.Controller = vsgController;
            //scenarioInfo1.Controller = vsgController;
            //customCheckedListBox1.Controller = vsgController;
        }
        public ObjectTypesViewComponentPanel()
        {
            myHelper = new ViewPanelHelper(this);

            InitializeComponent();

            vsgController = (VSGController)AMEManager.Instance.Get("VSG");
            vsgController.RegisterForUpdate(this);

            myLinkType = vsgController.ConfigurationLinkType;

            customTreeView1.Controller = vsgController;

            customTreeView1.AddCustomTreeRoot(myLinkType);
            customTreeView1.SetCustomTreeRootXsl(myLinkType, "PlayerObjectTypes.xsl"); //"ResourcesObjectTypes.xsl";
            customTreeView1.FunctionProc += new CustomTreeView.FunctionProcessed(customTreeView1_FunctionProc);
            customTreeView2.FunctionProc += new CustomTreeView.FunctionProcessed(customTreeView1_FunctionProc);


            customTreeView1.Level = 3;
            customTreeView1.ShowRoot = false;

            customTreeView2.Controller = vsgController;

            customTreeView2.AddCustomTreeRoot(myLinkType);
            customTreeView2.SetCustomTreeRootXsl(myLinkType, "ResourcesObjectTypes.xsl");//"PlayerObjectTypes.xsl";

            customTreeView2.Level = 5;
            customTreeView2.ShowRoot = false;
            //polyTool.PolygonCreatedWithPoints += new PolygonDrawingTool.OnPolygonCreatedWithPoints(polyTool_PolygonCreatedWithPoints);
            customTreeView2.NodeFunctionList += new NodeFunctionListEventHandler(customTreeView2_NodeFunctionList);


            decisionMakerVC.Controller = vsgController;
            teamVC.Controller = vsgController;
            classificationVC.Controller = vsgController;
            networkVC.Controller = vsgController;
            engramVC.Controller = vsgController;
            sensorVC.Controller = vsgController;
            emitterVC.Controller = vsgController;
            proximityVC.Controller = vsgController;
            effectVC.Controller = vsgController;
            singletonVC.Controller = vsgController;
            transitionVC.Controller = vsgController;
            comboVC.Controller = vsgController;
            contributionVC.Controller = vsgController;
            stateVC.Controller = vsgController;
            speciesVC.Controller = vsgController;
            levelVC.Controller = vsgController;
            sensor_rangeVC.Controller = vsgController;
            //voiceChannelVC.Controller = vsgController;

            this.customTabControl1.SelectedIndexChanged += new EventHandler(customTabControl1_SelectedIndexChanged);
        }
        public ScenarioViewComponentPanel()
        {
            myHelper = new ViewPanelHelper(this, UpdateType.Parameter);

            InitializeComponent();

            vsgController = (VSGController)AMEManager.Instance.Get("VSG");
            projectController = (RootController)AMEManager.Instance.Get("Project");
            vsgController.RegisterForUpdate(this);

            mapPlayfield1.Controller = vsgController;
            iconLibrary1.Controller = vsgController;
            scenarioInfo1.Controller = vsgController;
        }
        public ScenarioPlayfieldViewComponentPanel()
        {
            myHelper = new ViewPanelHelper(this);

            InitializeComponent();

            vsgController = (VSGController)AMEManager.Instance.Get("VSG");
            vsgController.RegisterForUpdate(this);

            myLinkType = vsgController.ConfigurationLinkType;

            customTreeView1.Controller = vsgController;
            customTreeView1.AddCustomTreeRoot(myLinkType);
            customTreeView1.SetCustomTreeRootXsl(myLinkType, "RegionsTree.xsl");

            textBoxLRVertexList.Controller = vsgController;
            textBoxReferencePoint.Controller = vsgController;
            checkBoxDynamicRegion.Controller = vsgController;
            textBoxARSpeedMultiplier.Controller = vsgController;
            textBoxARVertexList.Controller = vsgController;
            textBoxActiveRegionRelativeVertexList.Controller = vsgController;
            textBoxARStart.Controller = vsgController;
            textBoxAREnd.Controller = vsgController;
            checkBoxARBlocksMovement.Controller = vsgController;
            checkBoxARIsVisible.Controller = vsgController;
            enumBoxARColor.Controller = vsgController;
            linkBoxARSensorsBlocked.Controller = vsgController;

            diagramPanel1.Controller = vsgController;
            foreach (Diagram d in diagramPanel1.Diagrams)
            {
                d.ObjectSingleClicked += new GoObjectEventHandler(d_ObjectSingleClicked);
                d.FillPolygon = false;
                d.OutlinePolygon = true;
            }

            // events for linking on points text box entry
            textBoxARVertexList.Leave += new EventHandler(textBoxARVertexList_Leave);
            textBoxARVertexList.KeyDown += new KeyEventHandler(textBoxARVertexList_KeyDown);

            textBoxLRVertexList.Leave += new EventHandler(textBoxLRVertexList_Leave);
            textBoxLRVertexList.KeyDown += new KeyEventHandler(textBoxLRVertexList_KeyDown);
        }
        public TimelineViewComponentPanel()
        {
            myHelper = new ViewPanelHelper(this);

            InitializeComponent();
            currentProperties = EventProperties.Blank;

            customBlockTimeline1.AfterSelect = new CustomBlockTimelineSelectHandler(OnBlockTimelineSelection);

            vsgController = (VSGController)AMEManager.Instance.Get("VSG");
            vsgController.RegisterForUpdate(this);

            myLinkType = vsgController.ConfigurationLinkType;

            diagramPanel1.Controller = vsgController;
            diagrams = diagramPanel1.Diagrams;
            
            createInstanceTree.Controller = vsgController;

            createInstanceTree.AddCustomTreeRoot(myLinkType);
            createInstanceTree.SetCustomTreeRootXsl(myLinkType, "CreateEventDecisionMaker.xslt");

            createInstanceTree.Level = 3;
            createInstanceTree.ShowRoot = false;

            customTreeView2.Controller = vsgController;

            customTreeView2.AddCustomTreeRoot(myLinkType);
            customTreeView2.SetCustomTreeRootXsl(myLinkType, "EventTree.xsl");
  
            //customTreeView2.Level = 10;
            customTreeView2.ShowRoot = true;

            customBlockTimeline1.Controller = vsgController;
            customBlockTimeline1.LinkType = vsgController.ConfigurationLinkType;


            this.evtPnl_ChatroomClose1.Controller = vsgController;
            this.evtPnl_ChatroomOpen1.Controller = vsgController;
            this.evtPnl_SendChatMessage1.Controller = vsgController;
            this.evtPnl_VoiceChannelClose1.Controller = vsgController;
            this.evtPnl_VoiceChannelOpen1.Controller = vsgController;
            this.evtPnl_SendVoiceMessage1.Controller = vsgController;
            this.evtPnl_SendVoiceMessageToUser1.Controller = vsgController;
            this.evtPnl_EngramChange1.Controller = vsgController;
            this.evtPnl_EngramRemove1.Controller = vsgController;
            this.evtPnl_Flush1.Controller = vsgController;
            this.evtPnl_Launch1.Controller = vsgController;
            this.evtPnl_WeaponLaunch1.Controller = vsgController;
            this.evtPnl_Move1.Controller = vsgController;
            this.evtPnl_Reveal1.Controller = vsgController;
            this.evtPnl_StateChange1.Controller = vsgController;
            this.evtPnl_Transfer1.Controller = vsgController;
            this.evtPnl_Reiterate1.Controller = vsgController;
            this.evtPnl_Completion1.Controller = vsgController;
            this.evtPnl_SpeciesCompletion1.Controller = vsgController;
            this.evtPnl_Create1.Controller = vsgController;
            //this.subplatform1.Controller = vsgController;
            //this.armament1.Controller = vsgController;
            InitializePropertyPanels();
            HideAllProperties();
        }
Esempio n. 6
0
        public PreviewViewComponentPanel()
        {
            myHelper = new ViewPanelHelper(this, UpdateType.Component);

            InitializeComponent();
            customTabPage1.Description = _description;

            _sim = new VSG.PreviewSimulator.PreviewSimulator(agT_CanvasControl1);
            _sim.TickUpdateCallback = new TickUpdateDelegate(this.UpdateUI);

            vsgController = (VSGController)AMEManager.Instance.Get("VSG");
            vsgController.RegisterForUpdate(this);

            comboBox1.SelectedIndex = 3;
            
        }
Esempio n. 7
0
        private Boolean dbSetup()
        {
            SqlServerExpressSetupForm setup = new SqlServerExpressSetupForm();
            setup.ServerHost = System.Net.Dns.GetHostName() +  @"\SQLEXPRESS";
            setup.Username = "******";
            setup.Database = "vsg";
            setup.StartPosition = FormStartPosition.CenterParent;
            setup.ShowDialog(this);

            // If click OK.
            if (setup.DialogResult == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;

                // Need these for the db dump
                server = setup.ServerHost;
                username = setup.Username;
                password = setup.Password;
                database = setup.Database;

                try
                {
                    AMEManager gme = AMEManager.Instance;
                    
                    AMEManager.DatabaseConfiguration dbConfiguration = new AMEManager.DatabaseConfiguration();
                    dbConfiguration.Server = setup.ServerHost;
                    dbConfiguration.Database = setup.Database;
                    dbConfiguration.Username = setup.Username;
                    dbConfiguration.Password = setup.Password;

                    gme.CreateModel(AME.AMEManager.DataModelTypes.SqlServerExpress, dbConfiguration, "vsg");
    
                    projectController = (RootController)gme.Get("Project");
                    vsgController = (VSGController)gme.Get("VSG");

                    //vsgController.ValidateAllSchemaLinks();

                    vsgController.RegisterForUpdate(this);

                    // Allow empty string as a legal value for all parameters
                    // do not return parameters that are empty string
                    projectController.IgnoreEmptyString = true;
                    vsgController.IgnoreEmptyString = true;

                    // Close any previously open projects (e.g. did someone already connect to a database?)
                    // to do...

                    // Create screens.
                    createViewComponentPanels();


                    //InitializeScenario(scenarioId);
                    return true;
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "DB setup failed");
                    return false;
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
            else if (setup.DialogResult == DialogResult.Cancel)
            {
                Application.Exit();
                return false;
            }
            else
            {
                return false;
            }
        }
Esempio n. 8
0
        public static List<String> GetClassificationList(VSGController control, int rootID)
        {
            List<String> classifications = new List<string>();

            IXPathNavigable iNavClassType = control.GetComponentAndChildren(control.ScenarioId, "Scenario", new ComponentOptions());//.GetComponent("Scenario");
            XPathNavigator navigator = iNavClassType.CreateNavigator();
            XPathNodeIterator itClassifications = navigator.Select("/Components/Component[@Type='Scenario']/Component[@Type='Classification']");
            if (itClassifications.Count > 0)
            {
                while (itClassifications.MoveNext())
                {
                    classifications.Add(itClassifications.Current.GetAttribute("Name", itClassifications.Current.NamespaceURI));
                }
            }

            return classifications;
        }
Esempio n. 9
0
 public static List<String> GetStatesListBySpecies(VSGController control, int rootID, string linkType, int speciesId)
 {
     List<String> states = new List<string>();
     if (speciesId < 0)
     {
         return states;
     }
     ComponentOptions compOptions = new ComponentOptions();
     IXPathNavigable iNavSpeciesType = control.GetComponentAndChildren(control.ScenarioId, "SpeciesType", compOptions);
     XPathNavigator navSpeciesType = iNavSpeciesType.CreateNavigator();
     XPathNavigator navSpecies = navSpeciesType.SelectSingleNode(String.Format("/Components/Component/Component[@ID='{0}']", speciesId));
     XPathNodeIterator itSpecies = navSpecies.Select("self::*");
     while (itSpecies.MoveNext())
     {
         String id = itSpecies.Current.GetAttribute("ID", itSpecies.Current.NamespaceURI);
         IXPathNavigable iNavScenario = control.GetComponentAndChildren(Int32.Parse(id), "Scenario", compOptions);
         XPathNavigator navScenario = iNavScenario.CreateNavigator();
         XPathNodeIterator itStates = navScenario.Select("/Components/Component[@Type='Species']/Component[@Type='State']");
         while (itStates.MoveNext())
         {
             String name = itStates.Current.GetAttribute("Name", itStates.Current.NamespaceURI);
             if (!states.Contains(name))
                 states.Add(name);
         }
     }
     return states;
 }