001package jmri.jmrix.lenz.swing.lv102; 002 003import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 004import java.awt.FlowLayout; 005import java.awt.event.ActionEvent; 006import javax.swing.BoxLayout; 007import javax.swing.JButton; 008import javax.swing.JComboBox; 009import javax.swing.JLabel; 010import javax.swing.JPanel; 011import javax.swing.JToggleButton; 012import jmri.AddressedProgrammer; 013import jmri.ProgListener; 014import jmri.Programmer; 015import jmri.ProgrammerException; 016import org.slf4j.Logger; 017import org.slf4j.LoggerFactory; 018 019/** 020 * Internal Frame displaying the LV102 configuration utility. 021 * <p> 022 * This is a configuration utility for the LV102. It allows the user to set the 023 * Track Voltage and E-line status. 024 * <p> 025 * Note that ctor starts a listener thread; if you subclass this class, be sure 026 * that initialization is in the right order. 027 * 028 * @author Paul Bender Copyright (C) 2005 029 */ 030public class LV102InternalFrame extends javax.swing.JInternalFrame { 031 032 private static final String LV_102_STATUS_CHANGED = "LV102StatusChanged"; 033 private static final String DEBUG_STATUS = "Current Status: {}"; 034 private static final String LV_102_STATUS_WRITE_RAIL_COM_MODE = "LV102StatusWriteRailComMode"; 035 private static final String LV_102_STATUS_PROG_MODE = "LV102StatusProgMode"; 036 private static final String LV_102_STATUS_WRITE_VOLT = "LV102StatusWriteVolt"; 037 private ProgReplyListener progListener; 038 039 static final int WAIT_VALUE = 1000; // number of ms to wait after a 040 // programming operation. This 041 // should not be more than 15. 042 043 @SuppressFBWarnings(value = "SC_START_IN_CTOR", 044 justification = "with existing code structure, we do not expect this to ever be subclassed.") 045 046 public LV102InternalFrame() { 047 048 // Set up the programmer listener 049 progListener = new ProgReplyListener(); 050 051 getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); 052 053 setTitle(Bundle.getMessage("LV102Power")); 054 055 JPanel pane0 = new JPanel(); 056 pane0.setLayout(new FlowLayout()); 057 JLabel voltLabel = new JLabel(Bundle.getMessage("LV102Track")); 058 pane0.add(voltLabel); 059 voltLabel.setLabelFor(voltBox); 060 pane0.add(voltBox); 061 pane0.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT); 062 getContentPane().add(pane0); 063 064 JPanel pane1 = new JPanel(); 065 JLabel eLineLabel = new JLabel(Bundle.getMessage("LV102ELine")); 066 pane1.add(eLineLabel); 067 eLineLabel.setLabelFor(eLineBox); 068 pane1.add(eLineBox); 069 pane1.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT); 070 getContentPane().add(pane1); 071 072 JPanel pane2 = new JPanel(); 073 pane2.add(new JLabel(Bundle.getMessage("LV102RailCom"))); 074 pane2.add(railComBox); 075 pane2.add(new JLabel(Bundle.getMessage("LV102RailComMode"))); 076 pane2.add(railComModeBox); 077 pane2.add(new JLabel(Bundle.getMessage("LV102RailComTiming"))); 078 pane2.add(railComTimingBox); 079 pane2.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT); 080 getContentPane().add(pane2); 081 082 JPanel pane3 = new JPanel(); 083 084 // Set the write button tool tip 085 writeSettingsButton.setToolTipText(Bundle.getMessage("LV102WriteSettingsButtonToolTip")); 086 087 pane3.add(writeSettingsButton); 088 089 // Set the reset to Defaults button tool tip 090 defaultButton.setToolTipText(Bundle.getMessage("ResetDefaultsToolTip")); 091 092 // Set the reset button tool tip 093 resetButton.setToolTipText(Bundle.getMessage("LV102ResetButtonToolTip")); 094 095 pane3.add(defaultButton); 096 pane3.add(resetButton); 097 getContentPane().add(pane3); 098 099 // Initialize the Combo Boxes 100 101 /* configure the voltage selection box */ 102 voltBox.setVisible(true); 103 voltBox.setToolTipText(Bundle.getMessage("LV102TrackTip")); 104 for (String item : validVoltage) { 105 voltBox.addItem(item); 106 } 107 voltBox.setSelectedIndex(23); 108 109 /* Configure the E-Line Active/Inactive box */ 110 eLineBox.setVisible(true); 111 eLineBox.setToolTipText(Bundle.getMessage("LV102ELineTip")); 112 for (String eLineStatus : validELineStatus) { 113 eLineBox.addItem(eLineStatus); 114 } 115 eLineBox.setSelectedIndex(3); 116 117 /* Configure the RailCom Active/Inactive box */ 118 railComBox.setVisible(true); 119 railComBox.setToolTipText(Bundle.getMessage("LV102RailComTip")); 120 for (String railComStatus : validRailComStatus) { 121 railComBox.addItem(railComStatus); 122 } 123 railComBox.setSelectedIndex(2); 124 125 /* Configure the RailCom Mode selection box */ 126 railComModeBox.setVisible(true); 127 railComModeBox.setToolTipText(Bundle.getMessage("LV102RailComModeTip")); 128 for (String value : validRailComMode) { 129 railComModeBox.addItem(value); 130 } 131 railComModeBox.setSelectedIndex(2); 132 133 /* Configure the RailCom Timing selection box */ 134 railComTimingBox.setVisible(true); 135 railComTimingBox.setToolTipText(Bundle.getMessage("LV102RailComTimingTip")); 136 for (String s : validRailComTiming) { 137 railComTimingBox.addItem(s); 138 } 139 railComTimingBox.setSelectedIndex(4); 140 141 synchronized (currentStatus) { 142 currentStatus.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT); 143 currentStatus.setVisible(true); 144 currentStatus.setText(" "); 145 log.debug("Current Status: "); 146 getContentPane().add(currentStatus); 147 } 148 149 // and prep for display 150 pack(); 151 152 writeSettingsButton.addActionListener((ActionEvent a) -> { 153 writeLV102Settings(); 154 writeSettingsButton.setSelected(false); 155 }); 156 157 // install reset button handler 158 resetButton.addActionListener((ActionEvent a) -> { 159 resetLV102Settings(); 160 resetButton.setSelected(false); 161 }); 162 163 // install reset to defaults button handler 164 defaultButton.addActionListener((ActionEvent a) -> { 165 defaultLV102Settings(); 166 defaultButton.setSelected(false); 167 }); 168 169 // install a handler to set the status line when the selected item 170 // changes in the e-Line box 171 eLineBox.addActionListener((ActionEvent a) -> { 172 synchronized (currentStatus) { 173 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_CHANGED)); 174 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_CHANGED)); 175 } 176 }); 177 178 // install a handler to set the status line when the selected item 179 // changes in the RailCom box 180 railComBox.addActionListener((ActionEvent a) -> { 181 synchronized (currentStatus) { 182 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_CHANGED)); 183 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_CHANGED)); 184 } 185 }); 186 187 // install a handler to set the status line when the selected item 188 // changes in the RailComMode box 189 railComModeBox.addActionListener((ActionEvent a) -> { 190 synchronized (currentStatus) { 191 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_CHANGED)); 192 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_CHANGED)); 193 } 194 }); 195 196 // install a handler to set the status line when the selected item 197 // changes in the RailComTiming box 198 railComTimingBox.addActionListener((ActionEvent a) -> { 199 synchronized (currentStatus) { 200 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_CHANGED)); 201 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_CHANGED)); 202 } 203 }); 204 205 // install a handler to set the status line when the selected item 206 // changes in the volt box 207 voltBox.addActionListener((ActionEvent a) -> { 208 synchronized (currentStatus) { 209 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_CHANGED)); 210 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_CHANGED)); 211 } 212 }); 213 214 // configure internal frame options 215 setClosable(false); // don't let the user close this frame 216 setResizable(false); // don't let the user resize this frame 217 setIconifiable(false); // don't let the user minimize this frame 218 setMaximizable(false); // don't let the user maximize this frame 219 220 // make the internal frame visible 221 this.setVisible(true); 222 } 223 224 boolean read = false; 225 226 final JComboBox<String> voltBox = new javax.swing.JComboBox<>(); 227 final JComboBox<String> eLineBox = new javax.swing.JComboBox<>(); 228 final JComboBox<String> railComBox = new javax.swing.JComboBox<>(); 229 final JComboBox<String> railComModeBox = new javax.swing.JComboBox<>(); 230 final JComboBox<String> railComTimingBox = new javax.swing.JComboBox<>(); 231 232 final JLabel currentStatus = new JLabel(" "); 233 234 final JToggleButton writeSettingsButton = new JToggleButton(Bundle.getMessage("LV102WriteSettingsButtonLabel")); 235 final JButton defaultButton = new JButton(Bundle.getMessage("ButtonResetDefaults")); 236 final JButton resetButton = new JButton(Bundle.getMessage("LV102ResetButtonLabel")); 237 238 protected final String[] validVoltage = new String[]{"11V", "11.5V", "12V", "12.5V", "13V", "13.5V", "14V", "14.5V", "15V", "15.5V", Bundle.getMessage("Voltage16VDefault"), "16.5V", "17V", "17.5V", "18V", "18.5V", "19V", "19.5V", "20V", "20.5V", "21V", "21.5V", "22V", ""}; 239 protected final int[] validVoltageValues = new int[]{22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0}; 240 241 protected final String[] validELineStatus = new String[]{Bundle.getMessage("LV102ELineActive"), Bundle.getMessage("LV102ELineInactive"), Bundle.getMessage("UseDefaultValue"), ""}; 242 protected final int[] validELineStatusValues = new int[]{90, 91, 99, 0}; 243 244 protected final String[] validRailComStatus = new String[]{Bundle.getMessage("LV102RailComActive"), Bundle.getMessage("LV102RailComInactive"), ""}; 245 protected final int[] validRailComStatusValues = new int[]{93, 92, 0}; 246 247 protected final String[] validRailComMode = new String[]{Bundle.getMessage("LV102RailCom3BitMode"), Bundle.getMessage("LV102RailCom4BitMode"), ""}; 248 protected final int[] validRailComModeValues = new int[]{94, 95, 0}; 249 250 protected final String[] validRailComTiming = new String[]{Bundle.getMessage("LV102RailComDefaultTiming"), Bundle.getMessage("LV102RailComNCETiming"), Bundle.getMessage("LV102RailComIncreaseTiming"), Bundle.getMessage("LV102RailComDecreaseTiming"), ""}; 251 protected final int[] validRailComTimingValues = new int[]{88, 89, 70, 71, 0}; 252 253 //Send Power Station settings 254 void writeLV102Settings() { 255 256 // obtain the programmer Manager 257 jmri.AddressedProgrammerManager pm = jmri.InstanceManager.getNullableDefault(jmri.AddressedProgrammerManager.class); 258 if(pm == null) { 259 // no addressed programmer manager, cannot proceed. 260 currentStatus.setText(Bundle.getMessage("LV102StatusNoPM")); 261 log.error("No Programmer Manager Available, cannot configure LV102"); 262 return; 263 } 264 265 // Obtain an ops mode programmer instance 266 AddressedProgrammer opsProg = pm.getAddressedProgrammer(false, 0); 267 268 if(opsProg == null) { 269 // no ops mode programmer programmer, cannot proceed. 270 currentStatus.setText(Bundle.getMessage("LV102StatusNoPOM")); 271 log.error("Failed to obtain Operations Mode Programmer, cannot configure LV102"); 272 return; 273 } 274 275 // write the values to the power station. 276 writeVoltSetting(opsProg); 277 writeELineSetting(opsProg); 278 writeRailComSetting(opsProg); 279 writeRailComModeSetting(opsProg); 280 writeRailComTimingSetting(opsProg); 281 282 // we're done now, so we can release the programmer. 283 pm.releaseAddressedProgrammer(opsProg); 284 } 285 286 // Write the voltage setting 287 void writeVoltSetting(Programmer opsProg) { 288 if (!(voltBox.getSelectedItem().equals("")) 289 && voltBox.getSelectedItem() != null) { 290 291 log.debug("Selected Voltage: {}", voltBox.getSelectedItem()); 292 synchronized (currentStatus) { 293 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 294 currentStatus.doLayout(); 295 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 296 /* Pause briefly to give the user a chance to see what is 297 happening */ 298 new jmri.util.WaitHandler(this,WAIT_VALUE); 299 300 /* First, send the ops mode programming command to enter 301 programming mode */ 302 try { 303 opsProg.writeCV("7", 50, progListener); 304 } catch (ProgrammerException e) { 305 // Don't do anything with this yet 306 } 307 308 /* Pause briefly to give the booster a chance to change 309 into It's programming mode */ 310 new jmri.util.WaitHandler(this,WAIT_VALUE); 311 312 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_WRITE_VOLT)); 313 currentStatus.doLayout(); 314 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_WRITE_VOLT)); 315 316 /* Next, send the ops mode programming command for the voltage 317 we want */ 318 try { 319 opsProg.writeCV("7", validVoltageValues[voltBox.getSelectedIndex()], progListener); 320 } catch (ProgrammerException e) { 321 // Don't do anything with this yet 322 } 323 324 /* Pause briefly to wait for the programmer to send back a 325 reply */ 326 new jmri.util.WaitHandler(this,WAIT_VALUE); 327 328 } // End of synchronized(currentStatus) block for voltage setting 329 } else { 330 log.debug("No Voltage Selected"); 331 } 332 } 333 334 // Write the E-Line setting 335 void writeELineSetting(Programmer opsProg) { 336 if (!(eLineBox.getSelectedItem().equals("")) 337 && eLineBox.getSelectedItem() != null) { 338 339 log.debug("E-Line Setting: {}", eLineBox.getSelectedItem()); 340 synchronized (currentStatus) { 341 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 342 currentStatus.doLayout(); 343 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 344 345 /* Pause briefly to give the user a chance to see what is 346 happening */ 347 new jmri.util.WaitHandler(this,WAIT_VALUE); 348 349 /* First, send the ops mode programming command to enter 350 programming mode */ 351 try { 352 opsProg.writeCV("7", 50, progListener); 353 } catch (ProgrammerException e) { 354 // Don't do anything with this yet 355 } 356 357 /* Pause briefly to give the booster a chance to change 358 into It's programming mode */ 359 new jmri.util.WaitHandler(this,WAIT_VALUE); 360 361 currentStatus.setText(Bundle.getMessage("LV102StatusWriteELine")); 362 currentStatus.doLayout(); 363 log.debug(DEBUG_STATUS,Bundle.getMessage("LV102StatusWriteELine")); 364 365 /* Next, send the ops mode programming command for the E line 366 Status we want */ 367 try { 368 opsProg.writeCV("7", validELineStatusValues[eLineBox.getSelectedIndex()], progListener); 369 } catch (ProgrammerException e) { 370 // Don't do anything with this yet 371 } 372 373 /* Pause briefly to wait for the programmer to send back a 374 reply */ 375 new jmri.util.WaitHandler(this,WAIT_VALUE); 376 377 } // End of synchronized(currentStatus) block for E-line setting 378 } else { 379 log.debug("No E-Line value Selected"); 380 } 381 382 } 383 384 // Write the RailCom setting 385 void writeRailComSetting(Programmer opsProg) { 386 if (!(railComBox.getSelectedItem().equals("")) 387 && railComBox.getSelectedItem() != null) { 388 389 log.debug("RailCom Setting: {}", railComBox.getSelectedItem()); 390 synchronized (currentStatus) { 391 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 392 currentStatus.doLayout(); 393 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 394 395 /* Pause briefly to give the user a chance to see what is 396 happening */ 397 new jmri.util.WaitHandler(this,WAIT_VALUE); 398 399 /* First, send the ops mode programming command to enter 400 programming mode */ 401 try { 402 opsProg.writeCV("7", 50, progListener); 403 } catch (ProgrammerException e) { 404 // Don't do anything with this yet 405 } 406 407 /* Pause briefly to give the booster a chance to change 408 into It's programming mode */ 409 new jmri.util.WaitHandler(this,WAIT_VALUE); 410 411 currentStatus.setText(Bundle.getMessage("LV102StatusWriteRailCom")); 412 currentStatus.doLayout(); 413 log.debug(DEBUG_STATUS, Bundle.getMessage("LV102StatusWriteRailCom")); 414 415 /* Next, send the ops mode programming command for the RailComm 416 Status we want */ 417 try { 418 opsProg.writeCV("7", validRailComStatusValues[railComBox.getSelectedIndex()], progListener); 419 } catch (ProgrammerException e) { 420 // Don't do anything with this yet 421 } 422 423 /* Pause briefly to wait for the programmer to send back a 424 reply */ 425 new jmri.util.WaitHandler(this,WAIT_VALUE); 426 427 } // End of synchronized(currentStatus) block for RailCom Setting 428 } else { 429 log.debug("No RailCom value Selected"); 430 } 431 } 432 433 // Write the RailCom Mode setting 434 void writeRailComModeSetting(Programmer opsProg) { 435 if (!(railComModeBox.getSelectedItem().equals("")) 436 && railComModeBox.getSelectedItem() != null) { 437 438 log.debug("RailCom Setting: {}", railComModeBox.getSelectedItem()); 439 synchronized (currentStatus) { 440 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 441 currentStatus.doLayout(); 442 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 443 444 /* Pause briefly to give the user a chance to see what is 445 happening */ 446 new jmri.util.WaitHandler(this,WAIT_VALUE); 447 448 /* First, send the ops mode programming command to enter 449 programming mode */ 450 try { 451 opsProg.writeCV("7", 50, progListener); 452 } catch (ProgrammerException e) { 453 // Don't do anything with this yet 454 } 455 456 /* Pause briefly to give the booster a chance to change 457 into It's programming mode */ 458 new jmri.util.WaitHandler(this,WAIT_VALUE); 459 460 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_WRITE_RAIL_COM_MODE)); 461 currentStatus.doLayout(); 462 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_WRITE_RAIL_COM_MODE)); 463 464 /* Next, send the ops mode programming command for the RailCom Mode 465 Status we want */ 466 try { 467 opsProg.writeCV("7", validRailComModeValues[railComModeBox.getSelectedIndex()], progListener); 468 } catch (ProgrammerException e) { 469 // Don't do anything with this yet 470 } 471 472 /* Pause briefly to wait for the programmer to send back a 473 reply */ 474 new jmri.util.WaitHandler(this,WAIT_VALUE); 475 476 } // End of synchronized(currentStatus) block for RailCom Mode 477 } else { 478 log.debug("No RailCom Mode Selected"); 479 } 480 } 481 482 // Write the RailCom Mode setting 483 void writeRailComTimingSetting(Programmer opsProg) { 484 if (!(railComTimingBox.getSelectedItem().equals("")) 485 && railComTimingBox.getSelectedItem() != null) { 486 487 log.debug("RailCom Timing Setting: {}", railComTimingBox.getSelectedItem()); 488 synchronized (currentStatus) { 489 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 490 currentStatus.doLayout(); 491 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_PROG_MODE)); 492 493 /* Pause briefly to give the user a chance to see what is 494 happening */ 495 new jmri.util.WaitHandler(this,WAIT_VALUE); 496 497 /* First, send the ops mode programming command to enter 498 programming mode */ 499 try { 500 opsProg.writeCV("7", 50, progListener); 501 } catch (ProgrammerException e) { 502 // Don't do anything with this yet 503 } 504 505 /* Pause briefly to give the booster a chance to change 506 into It's programming mode */ 507 new jmri.util.WaitHandler(this,WAIT_VALUE); 508 509 currentStatus.setText(Bundle.getMessage(LV_102_STATUS_WRITE_RAIL_COM_MODE)); 510 currentStatus.doLayout(); 511 log.debug(DEBUG_STATUS, Bundle.getMessage(LV_102_STATUS_WRITE_RAIL_COM_MODE)); 512 513 /* Next, send the ops mode programming command for the RailCom 514 Timing we want */ 515 try { 516 opsProg.writeCV("7", validRailComTimingValues[railComTimingBox.getSelectedIndex()], progListener); 517 } catch (ProgrammerException e) { 518 // Don't do anything with this yet 519 } 520 521 /* Pause briefly to wait for the programmer to send back a 522 reply */ 523 new jmri.util.WaitHandler(this,WAIT_VALUE); 524 525 } // End of synchronized(currentStatus) block for RailCom Mode 526 } else { 527 log.debug("No RailCom Timing Mode Selected"); 528 } 529 } 530 531 // Set to LV102 default values. Voltage is 16, E Line is Active, 532 // Railcom is inactive, Railcom Mode is 3 bit cutout, Railcom Timing is 435 uS. 533 void defaultLV102Settings() { 534 voltBox.setSelectedIndex(10); 535 eLineBox.setSelectedIndex(0); 536 railComBox.setSelectedIndex(1); 537 railComModeBox.setSelectedIndex(0); 538 // also set RailCom Timing, 435uS is named Default 539 railComTimingBox.setSelectedIndex(0); 540 synchronized (currentStatus) { 541 currentStatus.setText(Bundle.getMessage("LV102StatusInitial")); 542 log.debug("Current Status: Factory Default Settings. May Not match actual configuration"); 543 } 544 } 545 546 // Set to initial values. 547 void resetLV102Settings() { 548 voltBox.setSelectedIndex(23); 549 eLineBox.setSelectedIndex(3); 550 railComBox.setSelectedIndex(2); 551 railComModeBox.setSelectedIndex(2); 552 synchronized (currentStatus) { 553 currentStatus.setText(Bundle.getMessage("StatusOK")); 554 log.debug("Current Status: OK"); 555 } 556 } 557 558 private class ProgReplyListener implements jmri.ProgListener { 559 560 ProgReplyListener() { 561 // no speciifc configuration required. 562 } 563 564 /** 565 * This class is a programmer listener, so we implement the 566 * programmingOpReply() function 567 */ 568 @SuppressFBWarnings(value = "NO_NOTIFY_NOT_NOTIFYALL", justification = "There should only ever be one thread waiting for this method.") 569 570 @Override 571 public void programmingOpReply(int value, int status) { 572 log.debug("Programming Operation reply received, value is {}, status is {}", value, status); 573 if (status == ProgListener.ProgrammerBusy) { 574 synchronized (currentStatus) { 575 currentStatus.setText(Bundle.getMessage("LV102StatusBUSY")); 576 log.debug(DEBUG_STATUS, Bundle.getMessage("LV102StatusBUSY")); 577 currentStatus.notify(); 578 } 579 } else if (status == ProgListener.OK) { 580 if (currentStatus.getText().equals(Bundle.getMessage(LV_102_STATUS_PROG_MODE))) { 581 synchronized (currentStatus) { 582 currentStatus.setText(Bundle.getMessage("LV102StatusReadyProg")); 583 log.debug(DEBUG_STATUS, Bundle.getMessage("LV102StatusReadyProg")); 584 currentStatus.notify(); 585 } 586 } else { 587 synchronized (currentStatus) { 588 currentStatus.setText(Bundle.getMessage("LV102StatusWritten")); 589 log.debug(DEBUG_STATUS, Bundle.getMessage("LV102StatusWritten")); 590 currentStatus.notify(); 591 } 592 } 593 } else { 594 synchronized (currentStatus) { 595 currentStatus.setText(Bundle.getMessage("LV102StatusUnknown")); 596 log.debug(DEBUG_STATUS, Bundle.getMessage("LV102StatusUnknown")); 597 currentStatus.notify(); 598 } 599 } 600 } 601 } 602 603 private static final Logger log = LoggerFactory.getLogger(LV102InternalFrame.class); 604 605}