Skip to content
Snippets Groups Projects
GenericGcodeDriver.java 31 KiB
Newer Older
  • Learn to ignore specific revisions
  •       return this.getUseBidirectionalRastering();
    
        } else if (SETTING_SPINDLE_MAX.equals(attribute)) {
          return this.getSpindleMax();
    
        } else if (SETTING_UPLOAD_METHOD.equals(attribute)) {
          return this.getUploadMethod();
    
        return null;
      }
    
      @Override
      public void setProperty(String attribute, Object value) {
        if (SETTING_HOST.equals(attribute)) {
          this.setHost((String) value);
    
        } else if (SETTING_BAUDRATE.equals(attribute)) {
          this.setBaudRate((Integer) value);
    
        } else if (SETTING_BEDWIDTH.equals(attribute)) {
          this.setBedWidth((Double) value);
        } else if (SETTING_BEDHEIGHT.equals(attribute)) {
          this.setBedHeight((Double) value);
        } else if (SETTING_COMPORT.equals(attribute)) {
          this.setComport((String) value);
    
        } else if (SETTING_FLIP_X.equals(attribute)) {
          this.setFlipXaxis((Boolean) value);
        } else if (SETTING_FLIP_Y.equals(attribute)) {
          this.setFlipYaxis((Boolean) value);
    
        } else if (SETTING_HOST.equals(attribute)) {
          this.setHost((String) value);
    
        } else if (SETTING_HTTP_UPLOAD_URL.equals(attribute)) {
          this.setHttpUploadUrl((String) value);
    
        } else if (SETTING_AUTOPLAY.equals(attribute)) {
          this.setAutoPlay((Boolean) value);
    
        } else if (SETTING_IDENTIFICATION_STRING.equals(attribute)) {
          this.setIdentificationLine((String) value);
    
        } else if (SETTING_INIT_DELAY.equals(attribute)) {
          this.setInitDelay((Integer) value);
    
        } else if (SETTING_LINEEND.equals(attribute)) {
          this.setLineend((String) value);
    
        } else if (SETTING_MAX_SPEED.equals(attribute)) {
    
          this.setMax_speed((Double) value);
    
        } else if (SETTING_TRAVEL_SPEED.equals(attribute)) {
          this.setTravel_speed((Double) value);
    
        } else if (SETTING_PRE_JOB_GCODE.equals(attribute)) {
          this.setPreJobGcode((String) value);
        } else if (SETTING_POST_JOB_GCODE.equals(attribute)) {
          this.setPostJobGcode((String) value);
    
        } else if (SETTING_RESOLUTIONS.equals(attribute)) {
          this.setSupportedResolutions((String) value);
    
        } else if (SETTING_WAIT_FOR_OK.equals(attribute)) {
          this.setWaitForOKafterEachLine((Boolean) value);
    
    quillford's avatar
    quillford committed
        } else if (SETTING_SERIAL_TIMEOUT.equals(attribute)) {
          this.setSerialTimeout((Integer) value);
    
        } else if (SETTING_BLANK_LASER_DURING_RAPIDS.equals(attribute)) {
          this.setBlankLaserDuringRapids((Boolean) value);
    
        } else if (SETTING_FILE_EXPORT_PATH.equals(attribute)) {
          this.setExportPath((String) value);
    
        } else if (SETTING_USE_BIDIRECTIONAL_RASTERING.equals(attribute)) {
          this.setUseBidirectionalRastering((Boolean) value);
    
        } else if (SETTING_SPINDLE_MAX.equals(attribute)) {
          this.setSpindleMax((Double) value);
    
        } else if (SETTING_UPLOAD_METHOD.equals(attribute)) {
          this.setUploadMethod(value);
    
      /**
       * Adjust defaults after deserializing driver from an old version of XML file
       */
      @Override
      protected void setKeysMissingFromDeserialization()
      {
        // added field spindleMax, needs to be set to 1.0 by default
        // but xstream initializes it to 0.0 when it is missing from XML
        if (this.spindleMax <= 0.0) this.spindleMax = 1.0;
      }
    
      @Override
      public GenericGcodeDriver clone() {
        GenericGcodeDriver clone = new GenericGcodeDriver();
        clone.copyProperties(this);
        return clone;
      }