Example #1
0
        public TripPool(IGEPlugin _ge)
        {
            ge = _ge;
            _core = new ArrayList();
            _attr = new ArrayList();
            TripDetails = new DataTable();
            _st = new ArrayList();
            _fn = new ArrayList();
            p_highlight = "";
            _style = "";
            tripCount = 1;
            TripDetails.Columns.Add("KMLTrip");
            TripDetails.Columns.Add("Day");
            TripDetails.Columns.Add("Trip");
            TripDetails.Columns.Add("HouseHoldID");
            TripDetails.Columns.Add("Person");
            TripDetails.Columns.Add("Date");
            TripDetails.Columns.Add("WeekDay");
            TripDetails.Columns.Add("Start Time");
            TripDetails.Columns.Add("Finish Time");
            TripDetails.Columns.Add("Time");
            TripDetails.Columns.Add("Distance");
            TripDetails.Columns.Add("Speed");
            TripDetails.Columns.Add("StartLong");
            TripDetails.Columns.Add("StartLat");
            TripDetails.Columns.Add("FinishLong");
            TripDetails.Columns.Add("FinishLat");
            TripDetails.Columns.Add("Remain");

            HouseHoldID = "";
            Day = "";
            Date = "";
            WeekDay = "";
        }
Example #2
0
        public TripPool(IGEPlugin _ge)
        {
            ge          = _ge;
            _core       = new ArrayList();
            _attr       = new ArrayList();
            TripDetails = new DataTable();
            _st         = new ArrayList();
            _fn         = new ArrayList();
            p_highlight = "";
            _style      = "";
            tripCount   = 1;
            TripDetails.Columns.Add("KMLTrip");
            TripDetails.Columns.Add("Day");
            TripDetails.Columns.Add("Trip");
            TripDetails.Columns.Add("HouseHoldID");
            TripDetails.Columns.Add("Person");
            TripDetails.Columns.Add("Date");
            TripDetails.Columns.Add("WeekDay");
            TripDetails.Columns.Add("Start Time");
            TripDetails.Columns.Add("Finish Time");
            TripDetails.Columns.Add("Time");
            TripDetails.Columns.Add("Distance");
            TripDetails.Columns.Add("Speed");
            TripDetails.Columns.Add("StartLong");
            TripDetails.Columns.Add("StartLat");
            TripDetails.Columns.Add("FinishLong");
            TripDetails.Columns.Add("FinishLat");
            TripDetails.Columns.Add("Remain");

            HouseHoldID = "";
            Day         = "";
            Date        = "";
            WeekDay     = "";
        }
Example #3
0
 public Test(Controller _core, IGEPlugin _ge, TextFileEditor txt)
 {
     core    = _core;
     t_pool  = core.getTrips();
     record  = core.getRecord();
     ge      = _ge;
     txtedit = txt;
 }
Example #4
0
 public Test(Controller _core, IGEPlugin _ge, TextFileEditor txt)
 {
     core = _core;
     t_pool = core.getTrips();
     record = core.getRecord();
     ge = _ge;
     txtedit = txt;
 }
Example #5
0
        /// <summary>
        /// Called when the PluginReady event is fired.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void external_PluginReady(object sender, EventArgs args)
        {
            this.ge = (dynamic)sender;
            this.ge.getWindow().setVisibility(this.ge.VISIBILITY_SHOW);

            //--Some Examples of things you can enable in Google Earth--//
            this.ge.getNavigationControl().setVisibility(this.ge.VISIBILITY_AUTO);
            this.ge.getLayerRoot().enableLayerById(this.ge.LAYER_BORDERS, 1);
            this.ge.getLayerRoot().enableLayerById(this.ge.LAYER_ROADS, 1);
        }
Example #6
0
 /// <summary>
 /// Draws the line string.
 /// </summary>
 /// <param name="ge">The ge.</param>
 /// <param name="p1">The p1.</param>
 /// <param name="p2">The p2.</param>
 /// <returns></returns>
 public static IKmlPlacemark DrawLineString(IGEPlugin ge, IKmlPoint p1, IKmlPoint p2)
 {
     IKmlPlacemark lineStringPlacemark = ge.createPlacemark(String.Empty);
     IKmlLineString lineString = ge.createLineString(String.Empty);
     lineStringPlacemark.setGeometry(lineString);
     lineString.setTessellate(1);
     lineString.getCoordinates().pushLatLngAlt(p1.getLatitude(), p1.getLongitude(), 0);
     lineString.getCoordinates().pushLatLngAlt(p2.getLatitude(), p2.getLongitude(), 0);
     return lineStringPlacemark;
 }
Example #7
0
 /// <summary>
 /// Get the current pluin view as a point object
 /// </summary>
 /// <param name="ge">the plugin</param>
 /// <returns>Point set to the current view</returns>
 public static IKmlPoint GetCurrentViewAsPoint(IGEPlugin ge)
 {
     IKmlLookAt lookat = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
     IKmlPoint point = ge.createPoint(String.Empty);
     point.set(
         lookat.getLatitude(),
         lookat.getLongitude(),
         lookat.getAltitude(),
         ge.ALTITUDE_RELATIVE_TO_GROUND,
         0,
         0);
     return point;
 }
Example #8
0
 /// <summary>
 /// Look at the given coordinates
 /// </summary>
 /// <param name="ge">the plugin</param>
 /// <param name="latitude">latitude in decimal degrees</param>
 /// <param name="longitude">longitude in decimal degrees</param>
 public static void LookAt(IGEPlugin ge, double latitude, double longitude)
 {
     IKmlLookAt lookat = ge.createLookAt(String.Empty);
     lookat.set(
         latitude,
         longitude,
         100,
         ge.ALTITUDE_RELATIVE_TO_GROUND,
         0,
         0,
         1000);
     ge.getView().setAbstractView(lookat);
 }
Example #9
0
 public Controller(IGEPlugin _ge, TripPool _t_pool, Rec _record)
 {
     ge     = _ge;
     record = _record;
     t_pool = _t_pool;
 }
Example #10
0
        /// <summary>
        /// Called when the PluginReady event is fired.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void external_PluginReady(object sender, EventArgs args)
        {
            this.ge = (dynamic)sender;
            this.ge.getWindow().setVisibility(this.ge.VISIBILITY_SHOW);

            //--Some Examples of things you can enable in Google Earth--//
            this.ge.getNavigationControl().setVisibility(this.ge.VISIBILITY_AUTO);
            this.ge.getLayerRoot().enableLayerById(this.ge.LAYER_BORDERS, 1);
            this.ge.getLayerRoot().enableLayerById(this.ge.LAYER_ROADS, 1);
        }
Example #11
0
 /// <summary>
 /// Protected method for raising the PluginReady event
 /// </summary>
 /// <param name="ge">The plugin object</param>
 /// <param name="e">The Event arguments</param>
 protected virtual void OnPluginReady(IGEPlugin ge, GEEventArgs e)
 {
     if (this.PluginReady != null)
     {
         this.PluginReady(ge, e);
     }
 }
Example #12
0
        /// <summary>
        /// Called when the Plugin is Ready 
        /// </summary>
        /// <param name="plugin">The plugin instance</param>
        /// <param name="e">Event arguments</param>
        private void External_PluginReady(object plugin, GEEventArgs e)
        {
            this.geplugin = (IGEPlugin)plugin;

            // A label for the data
            e.Message = "ApiVersion";

            // The data is just the version info
            e.Data = this.geplugin.getApiVersion();

            // Raise the ready event
            this.OnPluginReady(this.geplugin, e);
        }
 public FullPathFeature(IGEPlugin ge, List<GeoCoordinate> fullPath)
 {
     this.ge = ge;
     this.fullPath = fullPath;
 }
Example #14
0
        /// <summary>
        /// Look at the given feature
        /// </summary>
        /// <param name="ge">the plugin</param>
        /// <param name="feature">the feature to look at</param>
        public static void LookAt(IGEPlugin ge, IKmlFeature feature)
        {
            switch (feature.getType())
            {
                case "KmlFolder":
                case "KmlDocument":
                case "KmlNetworkLink":
                    if (feature.getAbstractView() != null)
                    {
                        ge.getView().setAbstractView(feature.getAbstractView());
                    }

                    break;
                case "KmlPlacemark":
                    if (feature.getAbstractView() != null)
                    {
                        ge.getView().setAbstractView(feature.getAbstractView());
                    }
                    else
                    {
                        IKmlPlacemark placemark = (IKmlPlacemark)feature;
                        LookAt(ge, placemark.getGeometry());
                    }

                    break;
                default:
                    break;
            }
        }
Example #15
0
 // called from initCallback in JavaScript
 public void JSInitSuccessCallback_(object pluginInstance)
 {
     m_ge = (IGEPlugin)pluginInstance;
     toolPanel.Enabled = true;
 }
Example #16
0
        public void JSInitSuccessCallback_(object pluginInstance)
        {
            ge = (IGEPlugin)pluginInstance;
            ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
            btResetTilt.Visible = true;
            ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, 1);
            panel1.Enabled = true;
            Console.WriteLine("Google Earth GUI established");
            start = ge.createPlacemark("");
            finish = ge.createPlacemark("");
            t_pool = new TripPool(ge);

            loadSession();
        }
        public RidingModelFeature(GEWebBrowser geWebBrowser, List<GeoCoordinate> fullPath)
        {
            this.geWebBrowser = geWebBrowser;
            this.ge = geWebBrowser.Plugin as IGEPlugin;
            this.fullPath = fullPath;

            LoadTrainModel();
        }
Example #18
0
 /// <summary>
 /// Look at the given geometry 
 /// </summary>
 /// <param name="ge">the plugin</param>
 /// <param name="geometry">the geomerty to look at</param>
 public static void LookAt(IGEPlugin ge, IKmlGeometry geometry)
 {
     if (null != ge && null != geometry)
     {
         switch (geometry.getType())
         {
             case "KmlPoint":
                 LookAt(ge, (IKmlPoint)geometry);
                 break;
             case "KmlPolygon":
                 IKmlPolygon polygon = (IKmlPolygon)geometry;
                 LookAt(
                     ge,
                     polygon.getOuterBoundary().getCoordinates().get(0).getLatitude(),
                     polygon.getOuterBoundary().getCoordinates().get(0).getLongitude());
                 break;
             case "KmlLineString":
                 IKmlLineString lineString = (IKmlLineString)geometry;
                 LookAt(
                     ge,
                     lineString.getCoordinates().get(0).getLatitude(),
                     lineString.getCoordinates().get(0).getLongitude());
                 break;
             case "KmlMultiGeometry":
             ////IKmlMultiGeometry multiGeometry = (IKmlMultiGeometry)geometry;
             default:
                 break;
         }
     }
 }
 public RidingPathFeature(IGEPlugin ge)
 {
     this.ge = ge;
 }
Example #20
0
 /// <summary>
 /// Look at the given point
 /// </summary>
 /// <param name="ge">the plugin</param>
 /// <param name="point">the point to look at</param>
 public static void LookAt(IGEPlugin ge, IKmlPoint point)
 {
     LookAt(ge, point.getLatitude(), point.getLongitude());
 }
Example #21
0
 /// <summary>
 /// Called from javascript when the plugin is ready
 /// </summary>
 /// <param name="ge">the plugin instance</param>
 public void Ready(IGEPlugin ge)
 {
     this.OnPluginReady(ge, new GEEventArgs());
 }
Example #22
0
 /// <summary>
 /// Remove all features from the plugin 
 /// </summary>
 /// <param name="ge">The plugin instance</param>
 public static void RemoveAllFeatures(IGEPlugin ge)
 {
     IGEFeatureContainer features = ge.getFeatures();
     IKmlObject feature = features.getFirstChild();
     while (feature != null)
     {
         features.removeChild(feature);
     }
 }
Example #23
0
 // called from initCallback in JavaScript
 public void JSInitSuccessCallback_(object pluginInstance)
 {
     m_ge = (IGEPlugin)pluginInstance;
     toolPanel.Enabled = true;
 }
Example #24
0
 /// <summary>
 /// Remove the feature with the given id from the plugin
 /// </summary>
 /// <param name="ge">The plugin instance</param>
 /// <param name="id">The id of the element to remove</param>
 public static void RemoveFeatureById(IGEPlugin ge, string id)
 {
     while (Convert.ToBoolean(ge.getFeatures().hasChildNodes()))
     {
         if (ge.getFeatures().getFirstChild().getId() == id)
         {
             ge.getFeatures().removeChild(ge.getFeatures().getFirstChild());
         }
     }
 }
Example #25
0
 public void JSInitSuccessCallback_(object pluginInstance)
 {
     ge = (IGEPlugin)pluginInstance;
     ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
     ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, 1);
     //            ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, 1);
     panel1.Enabled = true;
 }
Example #26
0
 public Controller(IGEPlugin _ge, TripPool _t_pool, Rec _record)
 {
     ge = _ge;
     record = _record;
     t_pool = _t_pool;
 }