public static Type GetDataType(GpsType type) { switch (type) { case GpsType.File: return(typeof(FileGpsInfo)); case GpsType.ComPort: return(typeof(ComPortInfo)); case GpsType.Gpsd: return(typeof(GpsdInfo)); case GpsType.WindowsLocationApi: return(typeof(WindowsLocationApiInfo)); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public static BaseGpsClient Create(GpsType type) { switch (type) { case GpsType.File: return(new FileGpsClient(new FileGpsInfo())); case GpsType.ComPort: return(new ComPortGpsClient(new ComPortInfo())); case GpsType.Gpsd: return(new GpsdGpsClient(new GpsdInfo())); case GpsType.WindowsLocationApi: return(new WindowsLocationApiGpsClient(new WindowsLocationApiInfo())); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public GpsConvert(Gps _v, GpsType type) { if (type == GpsType.Wgs84) { Wgs84 = _v; Wgs84ToDfm(); Wgs84ToGcj02(); Gcj02ToBd09(); } else if (type == GpsType.Gcj02) { Gcj02 = _v; Gcj02ToWgs84(); Wgs84ToDfm(); Gcj02ToBd09(); } else if (type == GpsType.Bd09) { Bd09 = _v; Bd09ToGcj02(); Gcj02ToWgs84(); Wgs84ToDfm(); } }
public static BaseGpsInfo Create(GpsType type) { var dataType = GetDataType(type); return((BaseGpsInfo)Activator.CreateInstance(dataType)); }
protected BaseGpsClient(GpsType gpsType, BaseGpsInfo gpsInfo) { GpsType = gpsType; GpsInfo = gpsInfo; }
public GpsService(GpsType gpsServiceType) { _client = GpsClientFactory.Create(gpsServiceType); }