Changeset 12778 in osm for applications/editors/josm/plugins/globalsat/src/org/openstreetmap
- Timestamp:
- 2009-01-01T18:28:53+01:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat
- Files:
-
- 4 edited
-
GlobalsatConfigDialog.java (modified) (8 diffs)
-
GlobalsatDg100.java (modified) (10 diffs)
-
GlobalsatImportDialog.java (modified) (4 diffs)
-
GlobalsatPlugin.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java
r11555 r12778 50 50 /** 51 51 * Configuration download dialog. 52 * 52 * 53 53 * @author Raphael Mack <ramack@raphael-mack.de> 54 54 * … … 58 58 59 59 public class IntegerTextField extends JTextField { 60 60 61 61 final static String badchars = "-`~!@#$%^&*()_+=\\|\"':;?/>.<, "; 62 62 63 63 public void processKeyEvent(KeyEvent ev) { 64 64 65 65 char c = ev.getKeyChar(); 66 if((Character.isLetter(c) && !ev.isAltDown()) 66 if((Character.isLetter(c) && !ev.isAltDown()) 67 67 || badchars.indexOf(c) > -1) { 68 68 ev.consume(); … … 74 74 75 75 76 76 77 77 // the JOptionPane that contains this dialog. required for the closeDialog() method. 78 78 private JOptionPane optionPane; … … 103 103 104 104 private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>(); 105 105 106 106 private Dg100Config conf; 107 107 … … 132 132 logFormat.add(formatPosTDS); 133 133 logFormat.add(formatPosTDSA); 134 134 135 135 JPanel logPanel = new JPanel(); 136 136 logPanel.setLayout(new BoxLayout(logPanel, BoxLayout.PAGE_AXIS)); … … 209 209 minLogSpeed.setText("" + conf.getSpeedThres()); 210 210 minLogDist.setText("" + conf.getDistThres()); 211 211 212 212 ButtonGroup group = new ButtonGroup(); 213 213 group.add(aTime); … … 261 261 c.gridy = 6; 262 262 add(bMeters, c); 263 263 264 264 group = new ButtonGroup(); 265 265 group.add(cTime); 266 266 group.add(cDist); 267 267 268 268 c.insets = new Insets(4,4,0,4); 269 269 c.gridwidth = 1; … … 307 307 JOptionPane.showMessageDialog(Main.parent, tr("Unknown logFormat")); 308 308 } 309 309 310 310 if(conf.getSwATimeOrDist() == 0){ 311 311 aTime.setSelected(true); -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java
r11555 r12778 45 45 46 46 public static final int TIMEOUT = 2000; 47 public static final int TRACK_TYPE = 1; 48 47 public static final int TRACK_TYPE = 1; 48 49 49 /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */ 50 50 private static byte dg100CmdSwitch2Nmea[] = … … 111 111 , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 112 112 , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3}; 113 113 114 114 private byte[] response = new byte[65536]; 115 115 116 116 private CommPortIdentifier portIdentifier; 117 117 private SerialPort port = null; 118 118 119 119 private boolean cancelled = false; 120 120 121 121 public GlobalsatDg100(CommPortIdentifier portId){ 122 122 this.portIdentifier = portId; … … 178 178 return result; 179 179 } 180 180 181 181 public void deleteData() throws ConnectionException{ 182 182 if(port == null){ … … 189 189 } 190 190 } 191 191 192 192 public void disconnect(){ 193 193 if(port != null){ … … 210 210 } 211 211 } 212 212 213 213 private List<FileInfoRec> readFileInfoList() throws ConnectionException 214 214 { … … 226 226 } 227 227 } 228 228 229 229 public List<GpsRec> readGpsRecList(List<FileInfoRec> fileInfoList) throws ConnectionException 230 230 { 231 231 int cnt = 0; 232 232 List<GpsRec> result = new ArrayList<GpsRec>(200); 233 233 234 234 try{ 235 235 for(FileInfoRec fileInfoRec:fileInfoList){ … … 243 243 } 244 244 } 245 245 246 246 private Response sendCmdDelFiles() throws IOException, UnsupportedCommOperationException 247 247 { … … 317 317 return Response.parseResponse(response, len); 318 318 } 319 319 320 320 /** 321 321 * … … 348 348 } 349 349 350 350 351 351 private int readResponse(byte[] response, int bytesToRead) throws IOException, UnsupportedCommOperationException 352 352 { … … 396 396 } 397 397 return ((cntBytTot > bytesToRead) ? bytesToRead : cntBytTot); 398 }398 } 399 399 return -1; 400 400 } -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java
r11555 r12778 39 39 /** 40 40 * Main download dialog. 41 * 41 * 42 42 * @author Raphael Mack <ramack@raphael-mack.de> 43 43 * 44 44 */ 45 45 public class GlobalsatImportDialog extends JPanel { 46 46 47 47 // the JOptionPane that contains this dialog. required for the closeDialog() method. 48 48 private JOptionPane optionPane; … … 111 111 System.out.println("configureing the device"); 112 112 try{ 113 113 114 114 GlobalsatConfigDialog dialog = new GlobalsatConfigDialog(GlobalsatPlugin.dg100().getConfig()); 115 115 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); … … 136 136 add(configBtn, c); 137 137 138 138 139 139 delete = new JCheckBox(tr("delete data after import")); 140 140 delete.setSelected(Main.pref.getBoolean("globalsat.deleteAfterDownload", false)); … … 167 167 168 168 } 169 169 170 170 public boolean deleteFilesAfterDownload(){ 171 171 return delete.isSelected(); -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java
r12707 r12778 106 106 } 107 107 } 108 108 109 109 class GlobalsatImportAction extends JosmAction{ 110 110 public GlobalsatImportAction(){
Note:
See TracChangeset
for help on using the changeset viewer.
