public override void Load()
		{
            //set plugin directory
            if (PluginDirectory.ToLower().EndsWith("gpstracker"))
                m_sPluginDirectory = PluginDirectory;
            else
                m_sPluginDirectory = PluginDirectory + "\\plugins\\gpstracker";

            try
            {
                Directory.CreateDirectory(m_sPluginDirectory + "\\NMEAExport");
            }
            catch (Exception)
            {
            }

			gpsOverlay=null;
			pluginAddOverlay();

			//create new instance of gpstracker
			gpsTracker = new GpsTracker(this);
			// Add the GPSTracker plugin to the World Wind tool bar 
            m_MenuButton = new WindowsControlMenuButton("Gps Tracker", m_sPluginDirectory + "\\gpstracker.png", this.gpsTracker);
			Application.WorldWindow.MenuBar.AddToolsMenuButton( m_MenuButton );
			
			base.Load();
		}
Example #2
0
        /// <summary>
        /// Plugin entry point - All plugins must implement this function
        /// </summary>
        public override void Load()
        {
            layer = new GlobeIconLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);

            // Add layer visibility controller (and save it to make sure you can kill it later!)
            control.Visible = true;
            evhand = new EventHandler(control_VisibleChanged);
            control.VisibleChanged += evhand;

            string imgPath = Path.Combine(PluginDirectory, "GlobeIcon.png");

            if (File.Exists(imgPath) == false)
            {
                Utility.Log.Write(new Exception("imgPath not found " + imgPath));
            }
            m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                "Globe Overview",
                imgPath,
                control);

            ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);


            //ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.ChildObjects.Insert(0,layer);
            ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);
            m_ToolbarItem.SetPushed(layer.IsOn);
        }
Example #3
0
        /// <summary>
        /// Plugin entry point - All plugins must implement this function
        /// </summary>
        public override void Load()
        {
            layer = new GlobeIconLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);

            // Add layer visibility controller (and save it to make sure you can kill it later!)
            control.Visible         = true;
            evhand                  = new EventHandler(control_VisibleChanged);
            control.VisibleChanged += evhand;

            string imgPath = Path.Combine(PluginDirectory, "GlobeIcon.png");

            if (File.Exists(imgPath) == false)
            {
                Utility.Log.Write(new Exception("imgPath not found " + imgPath));
            }
            m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                "Globe Overview",
                imgPath,
                control);

            ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);


            //ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.ChildObjects.Insert(0,layer);
            ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);
            m_ToolbarItem.SetPushed(layer.IsOn);
        }
		public override void Unload()
		{
			// Clean up
			gpsTracker.Close();
			
			//remove button...
			Application.WorldWindow.MenuBar.RemoveToolsMenuButton(m_MenuButton);

			pluginRemoveOverlay();

			m_MenuButton=null;
			gpsTracker=null;
			gpsOverlay=null;
			base.Unload ();
		}
Example #5
0
        /// <summary>
        /// Plugin entry point - All plugins must implement this function
        /// </summary>
        public override void Load()
        {
            // Add layer visibility controller (and save it to make sure you can kill it later!)
            control.Visible         = true;
            evhand                  = new EventHandler(control_VisibleChanged);
            control.VisibleChanged += evhand;
            // Add toolbar item
            m_ToolbarItem = new WorldWind.WindowsControlMenuButton("Compass", Path.Combine(this.PluginDirectory, @"Plugins\Compass\toolbar\tbcompass.png"), control);
            m_Application.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);

            layer      = new CompassLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);
            layer.IsOn = World.Settings.ShowCompass;
            ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);
            m_ToolbarItem.SetPushed(World.Settings.ShowCompass);
        }
Example #6
0
        /// <summary>
        /// Plugin entry point - All plugins must implement this function
        /// </summary>
        public override void Load()
        {
            if (ParentApplication.WorldWindow.CurrentWorld != null && ParentApplication.WorldWindow.CurrentWorld.Name.IndexOf("Earth") >= 0)
            {
                // Add layer visibility controller (and save it to make sure you can kill it later!)
                control.Visible         = true;
                evhand                  = new EventHandler(control_VisibleChanged);
                control.VisibleChanged += evhand;
                // Add toolbar item
                m_ToolbarItem = new WorldWind.WindowsControlMenuButton("Global Clouds", Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), @"Data\Icons\Interface\earth-eastern.png"), control);
                m_Application.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);

                layer      = new GlobalCloudsLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);
                layer.IsOn = World.Settings.ShowClouds;
                //ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.ChildObjects.Insert(0,layer);
                ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);

                m_ToolbarItem.SetPushed(World.Settings.ShowClouds);
            }
        }
Example #7
0
        /// <summary>
        /// Plugin entry point
        /// </summary>
        public override void Load()
        {
            if (ParentApplication.WorldWindow.CurrentWorld != null && ParentApplication.WorldWindow.CurrentWorld.Name.IndexOf("Earth") >= 0)
            {
                m_MenuItem        = new MenuItem("NRL Weather");
                m_MenuItem.Click += new EventHandler(menuItemClicked);
                ParentApplication.PluginsMenu.MenuItems.Add(m_MenuItem);

                m_Form = new NRLMontereyGlobal(ParentApplication.WorldWindow,
                                               Path.Combine(ParentApplication.WorldWindow.Cache.CacheDirectory, "NrlWeather"),
                                               Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Plugins\\NRLMonterey\\NRL_Monterey.xml");
                m_Form.Owner = ParentApplication;

                m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                    "Naval Research Labs, Monterey -- \"Real-Time\" Weather",
                    Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Data\\Icons\\Interface\\nrl.png",
                    m_Form);

                ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);
            }
        }
Example #8
0
		/// <summary>
		/// Plugin entry point - All plugins must implement this function
		/// </summary>
        public override void Load()
        {
            if (ParentApplication.WorldWindow.CurrentWorld != null && ParentApplication.WorldWindow.CurrentWorld.Name.IndexOf("Earth") >= 0)
            {
                // Add layer visibility controller (and save it to make sure you can kill it later!)
                control.Visible = true;
                evhand = new EventHandler(control_VisibleChanged);
                control.VisibleChanged += evhand;
                // Add toolbar item
                m_ToolbarItem = new WorldWind.WindowsControlMenuButton("Global Clouds", Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), @"Data\Icons\Interface\earth-eastern.png"), control);
                m_Application.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);

                layer = new GlobalCloudsLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);
				layer.IsOn = World.Settings.ShowClouds;
                //ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.ChildObjects.Insert(0,layer);
                ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);

				m_ToolbarItem.SetPushed(World.Settings.ShowClouds);
               
            }
        }
Example #9
0
        /// <summary>
        /// Unload our plugin
        /// </summary>
        public override void Unload()
        {
            if (m_MenuItem != null)
            {
                ParentApplication.ToolsMenu.MenuItems.Remove(m_MenuItem);
                m_MenuItem.Dispose();
                m_MenuItem = null;
            }

            if (m_ToolbarItem != null)
            {
                ParentApplication.WorldWindow.MenuBar.RemoveToolsMenuButton(m_ToolbarItem);
                m_ToolbarItem.Dispose();
                m_ToolbarItem = null;
            }

            if (m_Form != null)
            {
                m_Form.Dispose();
                m_Form = null;
            }
        }
        //NOTE had problems with pluginDir, possibly because Initialize wasn't getting called?
        //private static string _pluginDir;
        //public static string PluginDir
        //{
        //	get{return _pluginDir;}
        //}

        public override void Load()
        {
            try
            {
                if (ParentApplication.WorldWindow.CurrentWorld.IsEarth)
                {
                    m_Form = new VirtualEarthForm(ParentApplication);
                    m_Form.Owner = ParentApplication;

                    m_MenuItem = new MenuItem("MicroSoft VirtualEarth");
                    m_MenuItem.Click += new EventHandler(menuItemClicked);
                    ParentApplication.PluginsMenu.MenuItems.Add(m_MenuItem);

                    //#if DEBUG
                    string imgPath = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Plugins\\VirtualEarth\\VirtualEarthPlugin.png";
                    //#else
                    //					_pluginDir = this.PluginDirectory;
                    //					string imgPath = this.PluginDirectory + @"\VirtualEarthPlugin.png";
                    //#endif
                    if (File.Exists(imgPath) == false)
                    {
                        Utility.Log.Write(new Exception("imgPath not found " + imgPath));
                    }
                    m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                        "MicroSoft VirtualEarth",
                        imgPath,
                        m_Form);

                    ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);

                    base.Load();
                }
            }
            catch (Exception ex)
            {
                Utility.Log.Write(ex);
                throw;
            }
        }
Example #11
0
		/// <summary>
		/// Unload our plugin
		/// </summary>
		public override void Unload() 
		{
			if(m_MenuItem!=null)
			{
				ParentApplication.ToolsMenu.MenuItems.Remove( m_MenuItem );
				m_MenuItem.Dispose();
				m_MenuItem = null;
			}

			if(m_ToolbarItem != null)
			{
				ParentApplication.WorldWindow.MenuBar.RemoveToolsMenuButton(m_ToolbarItem);
				m_ToolbarItem.Dispose();
				m_ToolbarItem = null;
			}

			if(m_Form != null)
			{
				m_Form.Dispose();
				m_Form = null;
			}
		}
Example #12
0
		/// <summary>
		/// Plugin entry point 
		/// </summary>
		public override void Load() 
		{
			if(ParentApplication.WorldWindow.CurrentWorld != null && ParentApplication.WorldWindow.CurrentWorld.Name.IndexOf("Earth") >= 0)
			{
				m_MenuItem = new MenuItem("NRL Weather");
				m_MenuItem.Click += new EventHandler(menuItemClicked);
				ParentApplication.PluginsMenu.MenuItems.Add( m_MenuItem );
			
				m_Form = new NRLMontereyGlobal(ParentApplication.WorldWindow,
					Path.Combine(ParentApplication.WorldWindow.Cache.CacheDirectory, "NrlWeather"),
					Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Plugins\\NRLMonterey\\NRL_Monterey.xml");
				m_Form.Owner = ParentApplication;
			
				m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
					"Naval Research Labs, Monterey -- \"Real-Time\" Weather",
					Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Data\\Icons\\Interface\\nrl.png",
					m_Form);
			
				ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);
			}
		}
Example #13
0
        public override void Load()
        {
            try {
                SetEnvironmentVariable("PROJ_LIB",Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Plugins\\GeoportailPlugin\\NAD");

                if(ParentApplication.WorldWindow.CurrentWorld.Name.IndexOf("Earth") >= 0) {
                    m_Form = new GeoportailForm(ParentApplication);
                    m_Form.Owner = ParentApplication;

                    m_MenuItem = new MenuItem("Geoportail");
                    m_MenuItem.Click += new EventHandler(menuItemClicked);
                    ParentApplication.PluginsMenu.MenuItems.Add( m_MenuItem );

                    string imgPath = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Plugins\\GeoportailPlugin\\GeoportailPlugin.png";

                    if(!File.Exists(imgPath)) {
                        Utility.Log.Write("imgPath not found " + imgPath);
                    }
                    m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                        "Geoportail",
                        imgPath,
                        m_Form);

                    ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);

                    base.Load ();
                }
            }
            catch(Exception ex) {
                Utility.Log.Write(ex);
                throw;
            }
        }