void UpdateHomeXY() { if (mapa == null) { mapa = lista.GetBest(new PuntoF((float)center.Longitude, (float)center.Latitude)); } if (center != null && mapa != null) { PuntoF centroControl = new PuntoF(this.Width, this.Height) / 2; PuntoF centroGPS = mapa.InterpolaLonLat((float)center.Longitude, (float)center.Latitude); PuntoF resta = centroControl - centroGPS; if (resta.x > 0) { resta.x = 0; } if (resta.y > 0) { resta.y = 0; } if (resta.x < this.Width - mapa.img.Width) { resta.x = this.Width - mapa.img.Width; } if (resta.y < this.Height - mapa.img.Height) { resta.y = this.Height - mapa.img.Height; } homeXY = resta; } else { homeXY = new PuntoF(0, 0); } }
void UpdateHomeXY() { if (mapa == null) { mapa = lista.GetBest(new PuntoF((float)center.Longitude, (float)center.Latitude)); } if (center != null && mapa != null) { PuntoF centroControl = new PuntoF(this.Width, this.Height) / 2; PuntoF centroGPS = mapa.InterpolaLonLat((float)center.Longitude, (float)center.Latitude); PuntoF resta = centroControl - centroGPS; if (resta.x > 0) resta.x = 0; if (resta.y > 0) resta.y = 0; if (resta.x < this.Width - mapa.img.Width) resta.x = this.Width - mapa.img.Width; if (resta.y < this.Height - mapa.img.Height) resta.y = this.Height - mapa.img.Height; homeXY = resta; } else { homeXY = new PuntoF(0, 0); } }
public MapaCalibrado GetBest(PuntoF pos) { MapaCalibrado best = lista[0]; float dist = (best.CentroLonLat() - pos).mod(); foreach (MapaCalibrado mapa in lista) { float f = (mapa.CentroLonLat() - pos).mod(); if (f < dist) { dist = f; best = mapa; } } return(best); }
void UpdateHomeXY(int Width, int Height) { mapa = lista.GetBest(new PuntoF((float)tmpCenter.Longitude, (float)tmpCenter.Latitude)); if (tmpCenter != null && mapa != null) { PuntoF centroControl = new PuntoF(Width, Height) / 2; PuntoF centroGPS = mapa.InterpolaLonLat((float)tmpCenter.Longitude, (float)tmpCenter.Latitude); PuntoF resta = centroControl - centroGPS; /* */ if (resta.x > 0) { resta.x = 0; } if (resta.y > 0) { resta.y = 0; } if (resta.x < Width - mapa.img.Width) { resta.x = Width - mapa.img.Width; } if (resta.y < Height - mapa.img.Height) { resta.y = Height - mapa.img.Height; } /* */ centroGPS = centroControl - resta; PuntoF tmp = mapa.InterpolaXY(centroGPS.x, centroGPS.y); center = new WayPoint("", tmp.x, tmp.y); homeXY = resta; } else { homeXY = new PuntoF(0, 0); } }
public void SetMapaCalibrado(MapaCalibrado map) { mapa = map; }
public void LoadOziexplorer(string Filename) { mapa = new MapaCalibrado(Filename); }
public void SetMapaCalibrado(MapaCalibrado map) { mapa = map; }
public void LoadOziexplorer(string Filename) { mapa = new MapaCalibrado(Filename); }
public void SetCenter(WayPoint wpt) { this.tmpCenter = wpt; mapa = lista.GetBest(new PuntoF((float)tmpCenter.Longitude, (float)tmpCenter.Latitude)); }
void UpdateHomeXY(int Width, int Height) { mapa = lista.GetBest(new PuntoF((float)tmpCenter.Longitude, (float)tmpCenter.Latitude)); if (tmpCenter != null && mapa != null) { PuntoF centroControl = new PuntoF(Width, Height) / 2; PuntoF centroGPS = mapa.InterpolaLonLat((float)tmpCenter.Longitude, (float)tmpCenter.Latitude); PuntoF resta = centroControl - centroGPS; /* */ if (resta.x > 0) resta.x = 0; if (resta.y > 0) resta.y = 0; if (resta.x < Width - mapa.img.Width) resta.x = Width - mapa.img.Width; if (resta.y < Height - mapa.img.Height) resta.y = Height - mapa.img.Height; /* */ centroGPS = centroControl - resta; PuntoF tmp= mapa.InterpolaXY(centroGPS.x, centroGPS.y); center = new WayPoint("", tmp.x, tmp.y); homeXY = resta; } else { homeXY = new PuntoF(0, 0); } }
public void SetCenter(WayPoint wpt) { this.tmpCenter = wpt; mapa = lista.GetBest(new PuntoF((float)tmpCenter.Longitude, (float)tmpCenter.Latitude)); }