📄 garminconfiguration.java
字号:
package net.aetherial.gis.garmin;
import java.util.*;
import org.w3c.dom.svg.*;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.garmin.*;
public final class GarminConfiguration
{
private static boolean isInitialized = false;
private static int linkProtocolType = 000;
private static int deviceCommandProtocolType = 010;
private static int routeTransferProtocolType = 201;
private static int trackLogTransferProtocol = 300;
private static int waypointType = 101;
private static int routeHeaderType = 200;
private static int trackPointType = 300;
private static int trackHeadertype = 310;
private static int proximityWaypointType = 400;
private static int almanacType = 500;
private static String desc;
private static Hashtable currentTrackLog = null;
private static Hashtable currentWaypointLog = null;
private static SVGDocument svgDoc = null;
private static String tmpFile = null;
public static void setTmpFile (String n)
{
tmpFile = n;
}
public static String getTmpFile ()
{
return tmpFile;
}
public static void destroy(){
}
public static void initReceiver ()
{ System.out.println("GarminConfiguration.initReceiver ():will pd!");
ProductData pd =null;
pd = new ProductData ();
// System.out.println("GarminConfiguration.initReceiver ():pd OK!");
pd.printAll();
String [] pros = pd.getDataFormats ();
System.out.println("GarminConfiguration.initReceiver ():pros OK!");
for (int i = 0; i < pros.length; i++)
{
if (pros[i].equals ("D109"))
{
waypointType = 109;
}
else if (pros[i].equals ("D108"))
{
waypointType = 108;
}
else if (pros[i].equals ("D103"))
{
waypointType = 103;
}
else if (pros[i].equals ("D301"))
{
trackPointType = 301;
}
else
{
/* Add new types as features become implemented. */
}
}
desc = pd.getProductDescription ();
System.out.println("GarminConfiguration.initReceiver ():desc OK!");
currentTrackLog = new Hashtable ();
currentWaypointLog = new Hashtable ();
if((ItemValue.tracksNum==0)&&(ItemValue.waypointNum==0)){
GarminGMLDoc.resetGMLDoc();
}
isInitialized = true;
}
public static int getWaypointType ()
{
return waypointType;
}
public static int getTrackPointType ()
{
return trackPointType;
}
public static boolean addWaypointToLog (String name)
{
if (currentWaypointLog.containsKey (name))
return false;
currentWaypointLog.put (name, name);
return true;
}
public static boolean addTrackToLog (String name)
{
if (currentTrackLog.containsKey (name))
return false;
currentTrackLog.put (name, name);
return true;
}
public static String getDesc ()
{
return desc;
}
public static void setSVGDoc (SVGDocument s)
{
svgDoc = s;
}
public static SVGDocument getSVGDoc ()
{
return svgDoc;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -