Changeset 210
- Timestamp:
- 04/09/11 11:29:12 (14 months ago)
- Location:
- trunk
- Files:
-
- 10 modified
- 1 moved
-
CHANGELOG (modified) (1 diff)
-
src/org/jergometer/communication/BikeConnectionTester.java (modified) (1 diff)
-
src/org/jergometer/communication/BikeConnectorSerial.java (modified) (3 diffs)
-
src/org/jergometer/communication/BikeException.java (modified) (1 diff)
-
src/org/jergometer/communication/UnconfiguredSerialPortException.java (moved) (moved from trunk/src/org/jergometer/communication/UnconfiguredComPortException.java) (1 diff)
-
src/org/jergometer/gui/SettingsWindow.form (modified) (1 diff)
-
src/org/jergometer/gui/SettingsWindow.java (modified) (7 diffs)
-
src/org/jergometer/Jergometer.java (modified) (4 diffs)
-
src/org/jergometer/JergometerSettings.java (modified) (6 diffs)
-
src/org/jergometer/translation/jergometer_de.properties (modified) (4 diffs)
-
src/org/jergometer/translation/jergometer.properties (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r209 r210 5 5 * [stefan] * fixed bug #182: JErgometer wants to update even if it's a bleeding edge version 6 6 * implemented issue #247: display error message when JErgometer is started without RXTX library 7 * implemented issue #252: rename all occurrences of "COM port" to "serial port" 7 8 8 9 == 0.7.11 == -
trunk/src/org/jergometer/communication/BikeConnectionTester.java
r88 r210 50 50 try { 51 51 if(portId.isCurrentlyOwned()) { 52 System.out.println(" COMport is currently owned by another application!");52 System.out.println("Serial port is currently owned by another application!"); 53 53 } 54 54 serialPort = (SerialPort) portId.open("BikeConnector", 2000); -
trunk/src/org/jergometer/communication/BikeConnectorSerial.java
r209 r210 49 49 // dynamic 50 50 51 private String serialName;52 51 private SerialPort serialPort; 53 52 private BikeReader reader = null; … … 59 58 60 59 public void connect(String serialName) throws BikeException, UnsupportedCommOperationException, IOException { 61 this.serialName = serialName;62 63 60 Enumeration portList = CommPortIdentifier.getPortIdentifiers(); 64 61 … … 69 66 if(portId.getName().equals(serialName)) { 70 67 if(portId.isCurrentlyOwned()) { 71 throw new BikeException(I18n.getString("msg. com_port_used_by_the_following_application", portId.getCurrentOwner()));68 throw new BikeException(I18n.getString("msg.serial_port_used_by_the_following_application", portId.getCurrentOwner())); 72 69 } 73 70 try { 74 71 serialPort = (SerialPort) portId.open("JErgometer", 2000); 75 72 } catch (PortInUseException e) { 76 throw new BikeException(I18n.getString("msg. com_port_used_by_the_following_application", portId.getCurrentOwner()));73 throw new BikeException(I18n.getString("msg.serial_port_used_by_the_following_application", portId.getCurrentOwner())); 77 74 } 78 75 -
trunk/src/org/jergometer/communication/BikeException.java
r94 r210 4 4 5 5 /** 6 * Special IO exception related to the COMport connection to the ergometer.6 * Special IO exception related to the serial port connection to the ergometer. 7 7 */ 8 8 public class BikeException extends Exception { -
trunk/src/org/jergometer/communication/UnconfiguredSerialPortException.java
r94 r210 2 2 3 3 /** 4 * Unconfigured COMport exception.4 * Unconfigured serial port exception. 5 5 */ 6 public class Unconfigured ComPortException extends Exception {7 public Unconfigured ComPortException() {8 super("The COMport has not been configured yet.");6 public class UnconfiguredSerialPortException extends Exception { 7 public UnconfiguredSerialPortException() { 8 super("The serial port has not been configured yet."); 9 9 } 10 10 } -
trunk/src/org/jergometer/gui/SettingsWindow.form
r126 r210 22 22 </constraints> 23 23 <properties> 24 <text resource-bundle="org/jergometer/translation/jergometer" key="settings. com_port"/>24 <text resource-bundle="org/jergometer/translation/jergometer" key="settings.serial_port"/> 25 25 </properties> 26 26 </component> -
trunk/src/org/jergometer/gui/SettingsWindow.java
r209 r210 46 46 panel1.setBorder(BorderFactory.createTitledBorder(ResourceBundle.getBundle("org/jergometer/translation/jergometer").getString("label.global_settings"))); 47 47 final JLabel label1 = new JLabel(); 48 this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("org/jergometer/translation/jergometer").getString("settings. com_port"));48 this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("org/jergometer/translation/jergometer").getString("settings.serial_port")); 49 49 gbc = new GridBagConstraints(); 50 50 gbc.gridx = 0; … … 296 296 updatePortsButton.addActionListener(new ActionListener() { 297 297 public void actionPerformed(ActionEvent e) { 298 update ComPorts(null);298 updateSerialPorts(null); 299 299 } 300 300 }); … … 316 316 @Override 317 317 public void run() { 318 test ComPort(settingsWindow);318 testSerialPort(settingsWindow); 319 319 } 320 320 }.start(); … … 339 339 } 340 340 341 private void test ComPort(final SettingsWindow settingsWindow) {341 private void testSerialPort(final SettingsWindow settingsWindow) { 342 342 BikeConnectionTester bikeConnectionTester = new BikeConnectionTester(settingsWindow, comPortComboBox.getSelectedItem().toString()); 343 343 String id = bikeConnectionTester.test(); … … 356 356 */ 357 357 public ReturnCode showDialog(JergometerSettings settings) { 358 update ComPorts(settings);358 updateSerialPorts(settings); 359 359 360 360 if (settings != null) { … … 372 372 } 373 373 374 private void update ComPorts(JergometerSettings settings) {374 private void updateSerialPorts(JergometerSettings settings) { 375 375 String comPort = null; 376 376 if (settings != null) { 377 comPort = settings.get ComPort();377 comPort = settings.getSerialPort(); 378 378 } 379 379 int comPortIndex = -1; … … 413 413 public void saveSettings(JergometerSettings settings) { 414 414 settings.setCheckForUpdatesOnStart(checkForUpdatesOnStartCheckBox.isSelected()); 415 settings.set ComPort((String) comPortComboBox.getSelectedItem());415 settings.setSerialPort((String) comPortComboBox.getSelectedItem()); 416 416 settings.setXmlEditor(xmlEditorTextField.getText()); 417 417 } -
trunk/src/org/jergometer/Jergometer.java
r209 r210 188 188 /** 189 189 * Connects to the serial port. 190 */ 191 private void connectToSerialPort() throws BikeException, UnsupportedCommOperationException, IOException, UnconfiguredComPortException { 192 String comPort = jergometerSettings.getComPort(); 190 * 191 * @throws gnu.io.UnsupportedCommOperationException if communication operation is not supported 192 * @throws java.io.IOException if an I/O error occurs 193 * @throws org.jergometer.communication.BikeException if the bike communication fails 194 * @throws org.jergometer.communication.UnconfiguredSerialPortException if the serial port is not configured yet 195 */ 196 private void connectToSerialPort() throws BikeException, UnsupportedCommOperationException, IOException, UnconfiguredSerialPortException { 197 String comPort = jergometerSettings.getSerialPort(); 193 198 if (comPort == null) { 194 throw new Unconfigured ComPortException();199 throw new UnconfiguredSerialPortException(); 195 200 } 196 201 bikeConnector = new BikeConnectorSerial(comPort); … … 360 365 JOptionPane.showMessageDialog(mainWindow, e.getMessage(), I18n.getString("error_dialog.title"), JOptionPane.ERROR_MESSAGE); 361 366 return; 362 } catch (Unconfigured ComPortException e) {367 } catch (UnconfiguredSerialPortException e) { 363 368 e.printStackTrace(); 364 369 JOptionPane.showMessageDialog(mainWindow, I18n.getString("msg.configure_comport_first")); … … 480 485 for (BikeSession selectedSession : selectedSessions) { 481 486 this.userData.getSessions().remove(selectedSession); 487 //noinspection ResultOfMethodCallIgnored 482 488 selectedSession.getFile().delete(); 483 489 } … … 490 496 * 491 497 * @param bikeSession bike session 498 * @throws java.io.IOException if an I/O error occurs 492 499 */ 493 500 private void visualizeBikeSession(BikeSession bikeSession) throws IOException { -
trunk/src/org/jergometer/JergometerSettings.java
r187 r210 15 15 * Jergometer settings. 16 16 */ 17 @SuppressWarnings({"ResultOfMethodCallIgnored"}) 17 18 public class JergometerSettings { 18 19 … … 47 48 private ArrayList<String> userNames = new ArrayList<String>(); 48 49 private String lastUserName; 49 private String comPort;50 private String serialPort; 50 51 private String xmlEditor; 51 52 … … 138 139 139 140 lastUserName = properties.getString("last_user"); 140 comPort = properties.getString("comport");141 serialPort = properties.getString("comport"); 141 142 xmlEditor = properties.getString("xml_editor"); 142 143 … … 152 153 if (users != null) lastUserName = users.getAttribute("lastUser"); 153 154 XMLElement comport = root.getChildElement("comport"); 154 if (comport != null) comPort = comport.getAttribute("name");155 if (comport != null) serialPort = comport.getAttribute("name"); 155 156 XMLElement xmlEditor = root.getChildElement("xmlEditor"); 156 157 if (xmlEditor != null) this.xmlEditor = xmlEditor.getAttribute("name"); … … 174 175 175 176 properties.setString("last_user", lastUserName); 176 properties.setString("comport", comPort);177 properties.setString("comport", serialPort); 177 178 properties.setString("xml_editor", xmlEditor); 178 179 … … 241 242 } 242 243 243 public String get ComPort() {244 return comPort;245 } 246 247 public void set ComPort(String comPort) {248 this. comPort = comPort;244 public String getSerialPort() { 245 return serialPort; 246 } 247 248 public void setSerialPort(String serialPort) { 249 this.serialPort = serialPort; 249 250 } 250 251 -
trunk/src/org/jergometer/translation/jergometer_de.properties
r209 r210 89 89 </html> 90 90 label.global_settings=Globale Einstellungen 91 settings. com_port=COM-Port:92 settings.enter_port_name=Lass mich den Namen eingeben93 settings.update_ports=Akt ualisieren94 settings.test_port= Testen91 settings.serial_port=Serial-Port: 92 settings.enter_port_name=Lass mich den Namen &eingeben 93 settings.update_ports=Akt&ualisieren 94 settings.test_port=&Testen 95 95 settings.update=Update: 96 settings.check_for_updates_on_start=Suche nach neuen Versionen beim Start97 label.save= Speichern98 label.abort= Abbrechen96 settings.check_for_updates_on_start=Suche beim Start nach neuen &Versionen von JErgometer 97 label.save=&Speichern 98 label.abort=&Abbrechen 99 99 settings_dialog.title=JErgometer-Einstellungen 100 msg.configure_comport_first=Bitte geben Sie zunächst den COM-Port zur Datenübertragung an!100 msg.configure_comport_first=Bitte konfigurieren Sie zunächst den seriellen Port für die Kommunikation mit dem Ergometer! 101 101 msg.not_implemented_yet=Diese Funktion ist noch nicht implementiert. 102 102 menu.sessions.delete_selected=Lösche selektierte … … 109 109 choose_new_program_dialog.explanation=Dies könnte durch die Löschung oder Umbenennung von Trainingsprogrammen entstanden sein. Falls es sich nur um eine Umbenennung handelt, können Sie den betroffenen Sitzungen nun das zugehörige Programm zuweisen. 110 110 choose_new_program_dialog.title=Neues Programm auswählen 111 msg.connection_failed=Verbindung zum Ergometer fehlgeschlagen! Weitere Informationen finden Sie im Konsolenfenster.\nUm das Problem zu beheben, sollten Sie Ihre COM-Port-Konfiguration (siehe Einstellungen) überprüfen.111 msg.connection_failed=Verbindung zum Ergometer fehlgeschlagen! Weitere Informationen finden Sie im Konsolenfenster.\nUm das Problem zu beheben, sollten Sie Ihre Serial-Port-Konfiguration (siehe Einstellungen) überprüfen. 112 112 connection_tester.testing_connection_to_ergometer=Teste Verbindung zum Ergometer... 113 113 connection_tester.connection_successful=Verbindung zum Ergometer war erfolgreich! (ID=%s) … … 116 116 connection_tester.wait_for_reset_finished=Warte auf Reset-Ende 117 117 connection_tester.retrieving_ergometer_id=Hole Ergometer-ID 118 msg. com_port_used_by_the_following_application=Der COM-Port wird derzeit von der Anwendung "%s" genutzt!118 msg.serial_port_used_by_the_following_application=Der serielle Port wird derzeit von der Anwendung "%s" genutzt! 119 119 msg.unsatisfied_link_error=JErgometer konnte leider nicht die Serial-Port-Bibliothek für Ihr Betriebssystem laden.\nBitte melden Sie das Problem dem Entwickler, indem Sie ihm eine Mail schreiben oder auf jergometer.org ein einen Fehlerbericht (neues Ticket) verfassen.\nVergessen Sie dabei bitte nicht, Ihr Betriebsystem und die Fehlerausschriften im Konsolenfenster anzugeben. Danke. 120 120 error_dialog.title=Fehler! … … 144 144 main_window.title=JErgometer %s 145 145 label.xml_editor=XML-Editor: 146 label.file_choosing= >>>146 label.file_choosing=&>>> 147 147 msg.error_during_execution_of=Fehler während der Ausführung von "%s"! 148 148 msg.could_not_open_xml_editor=XML-Editor konnte nicht geöffnet werden -
trunk/src/org/jergometer/translation/jergometer.properties
r209 r210 68 68 about_dialog.text=<html><head><style>body { color: #000000; }th { text-align: left; }.vm { font-size:8px; margin-left: 10px; margin-top: 6px; } </style></head><body><br><br><table><tr><th>Version:</th><td>%1s</td></tr><tr><th>Website:</th><td>www.jergometer.org</td></tr><tr><th>Authors:</th><td>Stefan Endrullis,</td></tr><tr><th></th><td>Jörg Endrullis</td></tr><tr><th>License:</th><td>GPLv2</td></tr><tr><th>Java Version:</th><td>%2s</td></tr></table> <div class="vm">%3s</div></body></html> 69 69 label.global_settings=Global Settings 70 settings. com_port=COMport:71 settings.enter_port_name=Let me enter the port name72 settings.update_ports= Update73 settings.test_port= Test70 settings.serial_port=Serial port: 71 settings.enter_port_name=Let me &enter the port name 72 settings.update_ports=&Update 73 settings.test_port=&Test 74 74 settings.update=Update: 75 settings.check_for_updates_on_start= Check for updates on start76 label.save= Save77 label.abort= Abort75 settings.check_for_updates_on_start=&Check for updates on start 76 label.save=&Save 77 label.abort=&Abort 78 78 settings_dialog.title=JErgometer settings 79 msg.configure_comport_first=Please configure the COMport first!79 msg.configure_comport_first=Please configure the serial port first! 80 80 msg.not_implemented_yet=This function is not implemented yet. 81 81 menu.sessions.delete_selected=Delete selected … … 88 88 label.skip=Skip 89 89 choose_new_program_dialog.title=Choose a new program 90 msg.connection_failed=Connection to ergometer failed! See console output for additional information.\nTo solve this problem take a look at your COMport configuration (see settings).90 msg.connection_failed=Connection to ergometer failed! See console output for additional information.\nTo solve this problem take a look at your serial port configuration (see settings). 91 91 connection_tester.testing_connection_to_ergometer=Testing connection to ergometer... 92 92 connection_tester.connection_successful=Connection to ergoemter was successful! (ID=%s) … … 95 95 connection_tester.wait_for_reset_finished=Waiting for reset finished 96 96 connection_tester.retrieving_ergometer_id=Retrieving ergometer id 97 msg. com_port_used_by_the_following_application=COMport is currently owned by application "%s"!97 msg.serial_port_used_by_the_following_application=Serial port is currently owned by application "%s"! 98 98 msg.unsatisfied_link_error=JErgometer could not load the serial port library for your operating system.\nPlease file a bug report on jergometer.org and include the console output and the info which OS you are using. Thanks. 99 99 error_dialog.title=Error! … … 123 123 main_window.title=JErgometer %s 124 124 label.xml_editor=XML editor: 125 label.file_choosing= >>>125 label.file_choosing=&>>> 126 126 msg.error_during_execution_of=Error during execution of "%s"! 127 127 msg.could_not_open_xml_editor=Could not open XML editor
![(please configure the [header_logo] section in trac.ini)](https://jergometer.org/images/fork_me_on_github.png)