Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                OperationalInterface.ConfigureRemoting(args[0]);
            }
            else
            {
                OperationalInterface.ConfigureRemoting(null);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new formMain());
        }
Exemplo n.º 2
0
        private void listViewInstances_ItemActivate(object sender, EventArgs e)
        {
            if (listViewInstances.SelectedItems.Count == 1)
            {
                string name = listViewInstances.SelectedItems[0].Name;

                try {
                    this.UseWaitCursor = true;
                    OperationalInterface.Attach(name.Substring(OperationalUIService.OperationalUIFacade.ServiceName.Length), true);
                }
                catch (Exception ex) {
                    MessageBox.Show(this, "Error connecting to operational instance:\n" + ex.Message, "OperationalUI");
                }
                finally {
                    this.UseWaitCursor = false;
                }
            }
        }
        void OperationalInterface_Attached(object sender, OperationalInterface.AttachEventArgs e)
        {
            try {
                // clean up the old channels if they're set up
                if (obstacleChannel != null) {
                    obstacleChannel.Dispose();
                    obstacleChannel = null;
                }

                /*if (trackedObstacleChannel != null) {
                    trackedObstacleChannel.Dispose();
                    trackedObstacleChannel = null;
                }*/
            }
            catch (Exception) {
            }

            try {
                // get the channel factory
                IChannelFactory factory = (IChannelFactory)OperationalInterface.ObjectDirectory.Resolve("ChannelFactory");

                if (string.IsNullOrEmpty(e.Suffix)) {
                    // get the scene estimator all channel
                    obstacleChannel = factory.GetChannel(SceneEstimatorObstacleChannelNames.AnyClusterChannelName, ChannelMode.UdpMulticast);
                    //trackedObstacleChannel = null;
                }
                else {
                    obstacleChannel = factory.GetChannel(SceneEstimatorObstacleChannelNames.UntrackedClusterChannelName + "_" + e.Suffix, ChannelMode.UdpMulticast);
                    //trackedObstacleChannel = factory.GetChannel(SceneEstimatorObstacleChannelNames.TrackedClusterChannelName + "_" + suffix, ChannelMode.UdpMulticast);
                }
            }
            catch (Exception ex) {
                MessageBox.Show("Could not connect to scene estimator cluster channels: " + ex.Message);
                return;
            }

            if (obstacleChannel != null) {
                obstacleChannel.Subscribe(untrackedClusterAttacher);
            }

            /*if (trackedObstacleChannel != null) {
                trackedObstacleChannel.Subscribe(clusters);
            }*/
        }