// Path: app/src/main/java/in/co/gorest/grblcontroller/model/Constants.java
// public interface Constants {
// 
//     double MIN_SUPPORTED_VERSION        = 1.1;
// 
//     long GRBL_STATUS_UPDATE_INTERVAL    = 150;
//     String USB_BAUD_RATE = "115200";
// 
//     // Message types sent from the BluetoothService Handler
//     int MESSAGE_STATE_CHANGE            = 1;
//     int MESSAGE_READ                    = 2;
//     int MESSAGE_WRITE                   = 3;
//     int MESSAGE_DEVICE_NAME             = 4;
//     int MESSAGE_TOAST                   = 5;
//     int REQUEST_READ_PERMISSIONS        = 6;
//     int PROBE_TYPE_NORMAL               = 7;
//     int PROBE_TYPE_TOOL_OFFSET          = 8;
//     int CONNECT_DEVICE_SECURE           = 9;
//     int CONNECT_DEVICE_INSECURE         = 10;
//     int FILE_PICKER_REQUEST_CODE        = 11;
// 
//     int CONSOLE_LOGGER_MAX_SIZE         = 256;
//     double DEFAULT_JOGGING_FEED_RATE    = 2400.0;
//     int DEFAULT_PLANNER_BUFFER          = 15;
//     int DEFAULT_SERIAL_RX_BUFFER        = 128;
//     int PROBING_FEED_RATE               = 50;
//     int PROBING_PLATE_THICKNESS         = 20;
//     int PROBING_DISTANCE                = 15;
// 
//     String MACHINE_STATUS_IDLE          = "Idle";
//     String MACHINE_STATUS_JOG           = "Jog";
//     String MACHINE_STATUS_RUN           = "Run";
//     String MACHINE_STATUS_HOLD          = "Hold";
//     String MACHINE_STATUS_ALARM         = "Alarm";
//     String MACHINE_STATUS_CHECK         = "Check";
//     String MACHINE_STATUS_SLEEP         = "Sleep";
//     String MACHINE_STATUS_DOOR          = "Door";
//     String MACHINE_STATUS_HOME          = "Home";
//     String MACHINE_STATUS_NOT_CONNECTED = "Unknown";
// 
//     String[] SUPPORTED_FILE_TYPES       = {".tap",".gcode", ".nc", ".ngc", ".fnc", ".txt"};
//     String SUPPORTED_FILE_TYPES_STRING  = "^.*\\.(tap|gcode|nc|ngc|cnc|txt|ncc|fnc|dnc|fan|gc|txt|ncg|ncp|fgc)$";
// 
//     String JUST_STOP_STREAMING          = "0";
//     String STOP_STREAMING_AND_RESET     = "1";
//     String DEVICE_NAME                  = "device_name";
//     String TOAST                        = "toast";
// 
//     String SERIAL_CONNECTION_TYPE_BLUETOOTH         = "bluetooth";
//     String SERIAL_CONNECTION_TYPE_USB_OTG           = "usbotg";
// 
//     int BLUETOOTH_SERVICE_NOTIFICATION_ID           = 100;
//     int FILE_STREAMING_NOTIFICATION_ID              = 101;
//     int USB_OTG_SERVICE_NOTIFICATION_ID             = 102;
// 
//     String TEXT_CATEGORY_UPDATE                     = "update";
//     String TEXT_CATEGORY_LINK                       = "link";
//     String TEXT_CATEGORY_PROMOTION                  = "promotion";
// 
// }
// 
// Path: app/src/main/java/in/co/gorest/grblcontroller/model/Position.java
// public class Position {
//     private final Double cordX;
//     private final Double cordY;
//     private final Double cordZ;
// 
// 
//     private static final NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.ENGLISH);
//     private static final DecimalFormat decimalFormat = (DecimalFormat) numberFormat;
// 
//     public Position(double x, double y, double z){
//         this.cordX = x; this.cordY = y; this.cordZ = z;
//         decimalFormat.applyPattern("#0.###");
//     }
// 
//     public Double getCordX(){ return this.cordX; }
//     public Double getCordY(){ return this.cordY; }
//     public Double getCordZ(){ return this.cordZ; }
// 
//     private Double roundDouble(Double value){
//         String s = decimalFormat.format(value);
//         return Double.parseDouble(s);
//     }
// 
//     public boolean hasChanged(Position position){
//         return (position.getCordX().compareTo(this.cordX) != 0) || (position.getCordY().compareTo(this.cordY) != 0) || (position.getCordZ().compareTo(this.cordZ) != 0);
//     }
// 
//     public boolean atZero(){
//         return Math.abs(this.cordX) == 0 && Math.abs(this.cordY) == 0 && Math.abs(this.cordZ) == 0;
//     }
// 
// }


import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import in.co.gorest.grblcontroller.BR;
import in.co.gorest.grblcontroller.model.Constants;
import in.co.gorest.grblcontroller.model.Position;
    }

    @Bindable
    public Boolean getVerboseOutput(){ return this.verboseOutput; }
    public void setVerboseOutput(Boolean verboseOutput){
        if(this.verboseOutput != verboseOutput){
            this.verboseOutput = verboseOutput;
            notifyPropertyChanged(BR.verboseOutput);
        }
    }

    @Bindable
    public Boolean getLaserModeEnabled(){ return this.laserModeEnabled; }
    public void setLaserModeEnabled(Boolean laserModeEnabled){
        this.laserModeEnabled = laserModeEnabled;
        notifyPropertyChanged(BR.laserModeEnabled);
    }

    @Bindable
    public String getState(){ return this.state; }
    public void setState(String state){
        if(!this.state.equals(state)){
            this.state = state;
            notifyPropertyChanged(BR.state);
        }
    }

    @Bindable
    public Integer getPlannerBuffer(){ return this.plannerBuffer; }
    public void setPlannerBuffer(Integer plannerBuffer){
// Path: app/src/main/java/in/co/gorest/grblcontroller/model/Constants.java
// public interface Constants {
// 
//     double MIN_SUPPORTED_VERSION        = 1.1;
// 
//     long GRBL_STATUS_UPDATE_INTERVAL    = 150;
//     String USB_BAUD_RATE = "115200";
// 
//     // Message types sent from the BluetoothService Handler
//     int MESSAGE_STATE_CHANGE            = 1;
//     int MESSAGE_READ                    = 2;
//     int MESSAGE_WRITE                   = 3;
//     int MESSAGE_DEVICE_NAME             = 4;
//     int MESSAGE_TOAST                   = 5;
//     int REQUEST_READ_PERMISSIONS        = 6;
//     int PROBE_TYPE_NORMAL               = 7;
//     int PROBE_TYPE_TOOL_OFFSET          = 8;
//     int CONNECT_DEVICE_SECURE           = 9;
//     int CONNECT_DEVICE_INSECURE         = 10;
//     int FILE_PICKER_REQUEST_CODE        = 11;
// 
//     int CONSOLE_LOGGER_MAX_SIZE         = 256;
//     double DEFAULT_JOGGING_FEED_RATE    = 2400.0;
//     int DEFAULT_PLANNER_BUFFER          = 15;
//     int DEFAULT_SERIAL_RX_BUFFER        = 128;
//     int PROBING_FEED_RATE               = 50;
//     int PROBING_PLATE_THICKNESS         = 20;
//     int PROBING_DISTANCE                = 15;
// 
//     String MACHINE_STATUS_IDLE          = "Idle";
//     String MACHINE_STATUS_JOG           = "Jog";
//     String MACHINE_STATUS_RUN           = "Run";
//     String MACHINE_STATUS_HOLD          = "Hold";
//     String MACHINE_STATUS_ALARM         = "Alarm";
//     String MACHINE_STATUS_CHECK         = "Check";
//     String MACHINE_STATUS_SLEEP         = "Sleep";
//     String MACHINE_STATUS_DOOR          = "Door";
//     String MACHINE_STATUS_HOME          = "Home";
//     String MACHINE_STATUS_NOT_CONNECTED = "Unknown";
// 
//     String[] SUPPORTED_FILE_TYPES       = {".tap",".gcode", ".nc", ".ngc", ".fnc", ".txt"};
//     String SUPPORTED_FILE_TYPES_STRING  = "^.*\\.(tap|gcode|nc|ngc|cnc|txt|ncc|fnc|dnc|fan|gc|txt|ncg|ncp|fgc)$";
// 
//     String JUST_STOP_STREAMING          = "0";
//     String STOP_STREAMING_AND_RESET     = "1";
//     String DEVICE_NAME                  = "device_name";
//     String TOAST                        = "toast";
// 
//     String SERIAL_CONNECTION_TYPE_BLUETOOTH         = "bluetooth";
//     String SERIAL_CONNECTION_TYPE_USB_OTG           = "usbotg";
// 
//     int BLUETOOTH_SERVICE_NOTIFICATION_ID           = 100;
//     int FILE_STREAMING_NOTIFICATION_ID              = 101;
//     int USB_OTG_SERVICE_NOTIFICATION_ID             = 102;
// 
//     String TEXT_CATEGORY_UPDATE                     = "update";
//     String TEXT_CATEGORY_LINK                       = "link";
//     String TEXT_CATEGORY_PROMOTION                  = "promotion";
// 
// }
// 
// Path: app/src/main/java/in/co/gorest/grblcontroller/model/Position.java
// public class Position {
//     private final Double cordX;
//     private final Double cordY;
//     private final Double cordZ;
// 
// 
//     private static final NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.ENGLISH);
//     private static final DecimalFormat decimalFormat = (DecimalFormat) numberFormat;
// 
//     public Position(double x, double y, double z){
//         this.cordX = x; this.cordY = y; this.cordZ = z;
//         decimalFormat.applyPattern("#0.###");
//     }
// 
//     public Double getCordX(){ return this.cordX; }
//     public Double getCordY(){ return this.cordY; }
//     public Double getCordZ(){ return this.cordZ; }
// 
//     private Double roundDouble(Double value){
//         String s = decimalFormat.format(value);
//         return Double.parseDouble(s);
//     }
// 
//     public boolean hasChanged(Position position){
//         return (position.getCordX().compareTo(this.cordX) != 0) || (position.getCordY().compareTo(this.cordY) != 0) || (position.getCordZ().compareTo(this.cordZ) != 0);
//     }
// 
//     public boolean atZero(){
//         return Math.abs(this.cordX) == 0 && Math.abs(this.cordY) == 0 && Math.abs(this.cordZ) == 0;
//     }
// 
// }


// Path: app/src/main/java/in/co/gorest/grblcontroller/listeners/MachineStatusListener.java
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import in.co.gorest.grblcontroller.BR;
import in.co.gorest.grblcontroller.model.Constants;
import in.co.gorest.grblcontroller.model.Position;

    }

    @Bindable
    public Boolean getVerboseOutput(){ return this.verboseOutput; }
    public void setVerboseOutput(Boolean verboseOutput){
        if(this.verboseOutput != verboseOutput){
            this.verboseOutput = verboseOutput;
            notifyPropertyChanged(BR.verboseOutput);
        }
    }

    @Bindable
    public Boolean getLaserModeEnabled(){ return this.laserModeEnabled; }
    public void setLaserModeEnabled(Boolean laserModeEnabled){
        this.laserModeEnabled = laserModeEnabled;
        notifyPropertyChanged(BR.laserModeEnabled);
    }

    @Bindable
    public String getState(){ return this.state; }
    public void setState(String state){
        if(!this.state.equals(state)){
            this.state = state;
            notifyPropertyChanged(BR.state);
        }
    }

    @Bindable
    public Integer getPlannerBuffer(){ return this.plannerBuffer; }
    public void setPlannerBuffer(Integer plannerBuffer){
        if(this.plannerBuffer.compareTo(plannerBuffer) !=  0){