// Path: src/main/java/com/kasirgalabs/etumulator/processor/UART.java
// @Singleton
// public class UART implements Observable {
//     private RegisterFile registerFile;
//     private char input;
//     private final Dispatcher dispatcher;
//     private CountDownLatch latch;
// 
//     public UART(RegisterFile registerFile) {
//         this.registerFile = registerFile;
//         this.dispatcher = new BaseDispatcher();
//     }
// 
//     @Inject
//     public UART(RegisterFile registerFile, Dispatcher dispatcher) {
//         this.registerFile = registerFile;
//         this.dispatcher = dispatcher;
//     }
// 
//     public void setRegisterFile(RegisterFile registerFile) {
//         this.registerFile = registerFile;
//     }
// 
//     @Override
//     public void addObserver(Observer observer) {
//         dispatcher.addObserver(observer);
//     }
// 
//     public void read() throws InterruptedException {
//         latch = new CountDownLatch(1);
//         dispatcher.notifyObservers(UART.class, "read");
//         latch.await();
//         registerFile.setValue("r0", input);
//     }
// 
//     public void write() {
//         dispatcher.notifyObservers(UART.class, (char) registerFile.getValue("r0"));
//     }
// 
//     public void feed(char input) {
//         this.input = input;
//         latch.countDown();
//     }
// }
// 
// Path: src/main/java/com/kasirgalabs/etumulator/util/Observer.java
// public interface Observer {
//     void update(Class<?> clazz, Object arg);
// }
// 
// Path: src/main/java/com/kasirgalabs/etumulator/processor/Breakpoint.java
// public class Breakpoint {
//   private int point;
//   private static Breakpoint breakpoint;
// 
//   /**
//     * Construct a Breakpoint with an infinite point
//   */
//   private Breakpoint() {
//     reset();
//   }
// 
// 
//   /**
//     * Singleton structure implemented.
//   */
//   public static Breakpoint getInstance() {
//     if(breakpoint==null) {
//       breakpoint = new Breakpoint();
//     } return breakpoint;
//   }
// 
// 
//   /**
//     * @param point The point value to set the breakpoint
//   */
//   public void setPoint(int point) {
//     this.point = point;
//   }
// 
// 
//   /**
//     * @return The point where breakpoint is.
//   */
//   public int getPoint() {
//     return point;
//   }
// 
//   /**
//     * Sets the breakpoint to an infinite point
//     * to execute the entire program.
//   */
//   public void reset() {
//     point = Integer.MAX_VALUE;
//   }
// }


import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.kasirgalabs.etumulator.processor.UART;
import com.kasirgalabs.etumulator.util.Observer;
import com.kasirgalabs.etumulator.processor.Breakpoint;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
package com.kasirgalabs.etumulator.console;


@Singleton
public class BaseConsole extends TextArea implements Initializable, Console, Observer {
    private final String userName;
    private boolean readEnable;
    private boolean pointEnable;
    private char readChar;
    @FXML
    private VBox vbox;
    @FXML
    private TextField point;
// Path: src/main/java/com/kasirgalabs/etumulator/processor/UART.java
// @Singleton
// public class UART implements Observable {
//     private RegisterFile registerFile;
//     private char input;
//     private final Dispatcher dispatcher;
//     private CountDownLatch latch;
// 
//     public UART(RegisterFile registerFile) {
//         this.registerFile = registerFile;
//         this.dispatcher = new BaseDispatcher();
//     }
// 
//     @Inject
//     public UART(RegisterFile registerFile, Dispatcher dispatcher) {
//         this.registerFile = registerFile;
//         this.dispatcher = dispatcher;
//     }
// 
//     public void setRegisterFile(RegisterFile registerFile) {
//         this.registerFile = registerFile;
//     }
// 
//     @Override
//     public void addObserver(Observer observer) {
//         dispatcher.addObserver(observer);
//     }
// 
//     public void read() throws InterruptedException {
//         latch = new CountDownLatch(1);
//         dispatcher.notifyObservers(UART.class, "read");
//         latch.await();
//         registerFile.setValue("r0", input);
//     }
// 
//     public void write() {
//         dispatcher.notifyObservers(UART.class, (char) registerFile.getValue("r0"));
//     }
// 
//     public void feed(char input) {
//         this.input = input;
//         latch.countDown();
//     }
// }
// 
// Path: src/main/java/com/kasirgalabs/etumulator/util/Observer.java
// public interface Observer {
//     void update(Class<?> clazz, Object arg);
// }
// 
// Path: src/main/java/com/kasirgalabs/etumulator/processor/Breakpoint.java
// public class Breakpoint {
//   private int point;
//   private static Breakpoint breakpoint;
// 
//   /**
//     * Construct a Breakpoint with an infinite point
//   */
//   private Breakpoint() {
//     reset();
//   }
// 
// 
//   /**
//     * Singleton structure implemented.
//   */
//   public static Breakpoint getInstance() {
//     if(breakpoint==null) {
//       breakpoint = new Breakpoint();
//     } return breakpoint;
//   }
// 
// 
//   /**
//     * @param point The point value to set the breakpoint
//   */
//   public void setPoint(int point) {
//     this.point = point;
//   }
// 
// 
//   /**
//     * @return The point where breakpoint is.
//   */
//   public int getPoint() {
//     return point;
//   }
// 
//   /**
//     * Sets the breakpoint to an infinite point
//     * to execute the entire program.
//   */
//   public void reset() {
//     point = Integer.MAX_VALUE;
//   }
// }


// Path: src/main/java/com/kasirgalabs/etumulator/console/BaseConsole.java
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.kasirgalabs.etumulator.processor.UART;
import com.kasirgalabs.etumulator.util.Observer;
import com.kasirgalabs.etumulator.processor.Breakpoint;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;

package com.kasirgalabs.etumulator.console;


@Singleton
public class BaseConsole extends TextArea implements Initializable, Console, Observer {
    private final String userName;
    private boolean readEnable;
    private boolean pointEnable;
    private char readChar;
    @FXML
    private VBox vbox;
    @FXML
    private TextField point;
    private final UART uart;