├── .github └── workflows │ ├── android.yml │ └── super-linter.yml ├── .gitignore ├── .idea ├── dictionaries │ └── zeevy.xml ├── gradle.xml └── vcs.xml ├── LICENSE ├── README.md ├── _config.yml ├── app ├── .gitignore ├── build.gradle ├── google-services.json ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── alarm_codes.csv │ ├── build_option_codes.csv │ ├── error_codes.csv │ ├── iconify │ │ └── android-iconify-fontawesome.ttf │ └── setting_codes.csv │ ├── java │ ├── com │ │ └── joanzapata │ │ │ └── iconify │ │ │ ├── Icon.java │ │ │ ├── IconDrawable.java │ │ │ ├── IconFontDescriptor.java │ │ │ ├── Iconify.java │ │ │ ├── fonts │ │ │ ├── FontAwesomeIcons.java │ │ │ └── FontAwesomeModule.java │ │ │ ├── internal │ │ │ ├── CustomTypefaceSpan.java │ │ │ ├── HasOnViewAttachListener.java │ │ │ ├── IconFontDescriptorWrapper.java │ │ │ └── ParsingUtil.java │ │ │ └── widget │ │ │ ├── IconButton.java │ │ │ ├── IconTextView.java │ │ │ └── IconToggleButton.java │ └── in │ │ └── co │ │ └── gorest │ │ └── grblcontroller │ │ ├── AboutActivity.java │ │ ├── BluetoothConnectionActivity.java │ │ ├── DeviceListActivity.java │ │ ├── GrblActivity.java │ │ ├── GrblController.java │ │ ├── NotificationArchiveActivity.java │ │ ├── SettingsActivity.java │ │ ├── SplashActivity.java │ │ ├── UsbConnectionActivity.java │ │ ├── adapters │ │ ├── CommandHistoryAdapter.java │ │ └── NotificationAdapter.java │ │ ├── events │ │ ├── BluetoothDisconnectEvent.java │ │ ├── ConsoleMessageEvent.java │ │ ├── FcmNotificationRecieved.java │ │ ├── GrblAlarmEvent.java │ │ ├── GrblErrorEvent.java │ │ ├── GrblOkEvent.java │ │ ├── GrblProbeEvent.java │ │ ├── GrblRealTimeCommandEvent.java │ │ ├── GrblSettingMessageEvent.java │ │ ├── JogCommandEvent.java │ │ ├── StreamingCompleteEvent.java │ │ ├── StreamingStartedEvent.java │ │ └── UiToastEvent.java │ │ ├── helpers │ │ ├── AngledText225.java │ │ ├── AngledText45.java │ │ ├── AngledTextBottomLeft.java │ │ ├── AngledTextTopLeft.java │ │ ├── DepthPageTransformer.java │ │ ├── EnhancedSharedPreferences.java │ │ ├── MyEditTextPreference.java │ │ ├── NotificationHelper.java │ │ ├── NumberPickerPreference.java │ │ ├── ReaderViewPagerTransformer.java │ │ ├── RepeatListener.java │ │ └── ZoomOutPageTransformer.java │ │ ├── listeners │ │ ├── ConsoleLoggerListener.java │ │ ├── EndlessRecyclerViewScrollListener.java │ │ ├── FileSenderListener.java │ │ ├── MachineStatusListener.java │ │ ├── SerialBluetoothCommunicationHandler.java │ │ ├── SerialCommunicationHandler.java │ │ └── SerialUsbCommunicationHandler.java │ │ ├── model │ │ ├── CommandHistory.java │ │ ├── Constants.java │ │ ├── GcodeCommand.java │ │ ├── GrblNotification.java │ │ ├── Overrides.java │ │ └── Position.java │ │ ├── service │ │ ├── FileStreamerIntentService.java │ │ ├── GrblBluetoothSerialService.java │ │ ├── GrblUsbSerialService.java │ │ └── MyFirebaseMessagingService.java │ │ ├── ui │ │ ├── BaseFragment.java │ │ ├── CamTabFragment.java │ │ ├── ConsoleTabFragment.java │ │ ├── FileSenderTabFragment.java │ │ ├── GrblFragmentPagerAdapter.java │ │ ├── JoggingTabFragment.java │ │ └── ProbingTabFragment.java │ │ └── util │ │ ├── GcodePreprocessorUtils.java │ │ ├── GrblLookups.java │ │ ├── GrblUtils.java │ │ └── SimpleGcodeMaker.java │ └── res │ ├── drawable-hdpi │ └── ic_stat_ic_notification.png │ ├── drawable-ldpi │ └── ic_stat_ic_notification.png │ ├── drawable-mdpi │ └── ic_stat_ic_notification.png │ ├── drawable-xhdpi │ └── ic_stat_ic_notification.png │ ├── drawable-xxhdpi │ └── ic_stat_ic_notification.png │ ├── drawable-xxxhdpi │ └── ic_stat_ic_notification.png │ ├── drawable │ ├── ic_android_black_20dp.xml │ ├── ic_android_black_36dp.xml │ ├── ic_android_black_shortcut_icon_12dp.xml │ ├── ic_attach_money_black_36dp.xml │ ├── ic_battery_unknown_black_24dp.xml │ ├── ic_bluetooth_connected_black_24dp.xml │ ├── ic_bug_report_black_36dp.xml │ ├── ic_cast_connected_black_24dp.xml │ ├── ic_check_circle_black_24dp.xml │ ├── ic_contact_mail_black_36dp.xml │ ├── ic_device_hub_black_24dp.xml │ ├── ic_error_black_24dp.xml │ ├── ic_filter_tilt_shift_black_24dp.xml │ ├── ic_folder_open_black_24dp.xml │ ├── ic_folder_special_black_24dp.xml │ ├── ic_font_download_black_24dp.xml │ ├── ic_format_list_numbered_black_24dp.xml │ ├── ic_help_outline_black_shortcut_icon_12dp.xml │ ├── ic_insert_drive_file.xml │ ├── ic_keyboard_black_24dp.xml │ ├── ic_live_help_black_36dp.xml │ ├── ic_notifications_active_black_24dp.xml │ ├── ic_open_with_black_24dp.xml │ ├── ic_pan_tool_black_24dp.xml │ ├── ic_power_black_24dp.xml │ ├── ic_power_settings_new_black_24dp.xml │ ├── ic_rotate_right_black_24dp.xml │ ├── ic_settings_applications_black_24dp.xml │ ├── ic_settings_black_20dp.xml │ ├── ic_settings_black_shortcut_icon_12dp.xml │ ├── ic_settings_input_hdmi_black_24dp.xml │ ├── ic_settings_overscan_black_24dp.xml │ ├── ic_share_black_20dp.xml │ ├── ic_signal_cellular_connected_no_internet_1_bar_black_24dp.xml │ ├── ic_signal_cellular_connected_no_internet_2_bar_black_24dp.xml │ ├── ic_signal_cellular_connected_no_internet_3_bar_black_24dp.xml │ ├── ic_star_half_black_36dp.xml │ ├── ic_stop_black_24dp.xml │ ├── ic_swap_horizontal_black_24dp.xml │ ├── ic_timer_black_24dp.xml │ ├── ic_touch_app_black_24dp.xml │ ├── ic_usb_black_20dp.xml │ ├── ic_usb_black_24dp.xml │ ├── ic_vibration_black_24dp.xml │ ├── ic_view_module_black_24dp.xml │ ├── ic_warning_black_24dp.xml │ ├── image_placeholder_email_large.png │ ├── rounded_border_edit_text.xml │ ├── splash_background.xml │ └── splash_logo.9.png │ ├── layout-large │ ├── activity_device_list.xml │ ├── activity_main.xml │ ├── device_name.xml │ ├── dialog_input_decimal.xml │ ├── dialog_input_decimal_signed.xml │ ├── dialog_input_int.xml │ ├── dialog_step_and_feed.xml │ ├── fragment_cam_tab.xml │ ├── fragment_console_tab.xml │ ├── fragment_file_sender_tab.xml │ ├── fragment_jogging_tab.xml │ └── fragment_probing_tab.xml │ ├── layout │ ├── activity_device_list.xml │ ├── activity_main.xml │ ├── activity_notification_archive.xml │ ├── command_history.xml │ ├── device_name.xml │ ├── dialog_input_decimal.xml │ ├── dialog_input_decimal_signed.xml │ ├── dialog_input_int.xml │ ├── dialog_step_and_feed.xml │ ├── fragment_cam_tab.xml │ ├── fragment_console_tab.xml │ ├── fragment_file_sender_tab.xml │ ├── fragment_jogging_tab.xml │ ├── fragment_probing_tab.xml │ └── notification.xml │ ├── menu │ ├── menu_main.xml │ └── menu_usb.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-pt-rBR │ └── strings.xml │ ├── values-ru │ └── strings.xml │ ├── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── application_about.xml │ ├── application_pref.xml │ ├── backup_descriptor.xml │ ├── data_extraction_rules.xml │ └── shortcuts.xml ├── build.gradle ├── doc ├── screenshots │ ├── ConsoleTab.png │ ├── DefaultConnectionType.png │ ├── FileSenderTab.png │ ├── G38.3StringProbe.png │ ├── JoggingTab.png │ ├── ProbingTab.png │ ├── Screenshot_01.png │ ├── Screenshot_02.png │ ├── Screenshot_03.png │ ├── Screenshot_04.png │ ├── Screenshot_05.png │ ├── Screenshot_06.png │ ├── Settings.png │ └── resized │ │ ├── Screenshot_20171001-090425.png │ │ ├── Screenshot_20171001-090440.png │ │ ├── Screenshot_20171001-090518.png │ │ ├── Screenshot_20171001-090533.png │ │ ├── Screenshot_20171001-090549.png │ │ └── Screenshot_20171001-090603.png └── wiki │ ├── ConsoleTab.png │ ├── FileSenderTab.png │ ├── HC-06_pinout.jpg │ ├── Hc-06-arduino.jpg │ ├── JogginTab.png │ ├── MachineStatusPanel.png │ ├── ProbingTab.png │ └── hc_06.ino ├── docs ├── about-us.html ├── application-settings.html ├── bluetooth-device-setup.html ├── change-log-plus.html ├── console-interface.html ├── css │ ├── bootstrap.min.css │ ├── bootstrap.united.min.css │ ├── font-awesome.min.css │ └── site.css ├── favicon.ico ├── file-streaming-panel.html ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── grbl-controller-plus-change-log.html ├── images │ ├── app-front.png │ ├── arduino-bluetooth-connection-hc-05-hc-06.png │ ├── arduino-usb-16u2.jpg │ ├── bluetooth-hc-05.png │ ├── bluetooth-hc-06 - Copy.jpg │ ├── bluetooth-hc-06.jpg │ ├── console_and_custom_commands.png │ ├── favicon-32x32.png │ ├── file_sender_and_overrides.png │ ├── grbl-controller-play-store.png │ ├── hc-05-hc-06-pinout.jpg │ ├── hc-06-arduino-connection-diagram.jpg │ ├── joggin_step_and_feed.png │ ├── jogging_control_panel.png │ ├── machine_status_panel.png │ ├── machine_status_panel_info.png │ ├── probing_and_tool_length_offsets.png │ └── wiring-diagram-Arduino-Bluetooth-HC-05-on-Uno-Board.jpg ├── index.html ├── jogging-control-panel.html ├── js │ ├── angular-route.min.js │ ├── angular.min.js │ ├── bootstrap.js │ ├── common.js │ ├── jquery.bootstrap-autohidingnavbar.js │ └── jquery.js ├── machine-setup.html ├── machine-status-panel.html ├── navigation.html ├── privacy-policy.html ├── probing-and-tool-length-offset.html ├── uploads │ ├── hc_05.ino │ └── hc_06.ino ├── usb-otg-setup.html └── version-2.30.html ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: set up JDK 11 17 | uses: actions/setup-java@v2 18 | with: 19 | java-version: '11' 20 | distribution: 'adopt' 21 | cache: gradle 22 | 23 | - name: Grant execute permission for gradlew 24 | run: chmod +x gradlew 25 | - name: Build with Gradle 26 | run: ./gradlew build 27 | -------------------------------------------------------------------------------- /.github/workflows/super-linter.yml: -------------------------------------------------------------------------------- 1 | # This workflow executes several linters on changed files based on languages used in your code base whenever 2 | # you push a code or open a pull request. 3 | # 4 | # You can adjust the behavior by modifying this file. 5 | # For more information, see: 6 | # https://github.com/github/super-linter 7 | name: Lint Code Base 8 | 9 | on: 10 | push: 11 | branches: [ "master" ] 12 | pull_request: 13 | branches: [ "master" ] 14 | jobs: 15 | run-lint: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v3 20 | with: 21 | # Full git history is needed to get a proper list of changed files within `super-linter` 22 | fetch-depth: 0 23 | 24 | - name: Lint Code Base 25 | uses: github/super-linter@v4 26 | env: 27 | VALIDATE_ALL_CODEBASE: false 28 | DEFAULT_BRANCH: "master" 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea 4 | gradle 5 | /local.properties 6 | /.idea/workspace.xml 7 | /.idea/libraries 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | -------------------------------------------------------------------------------- /.idea/dictionaries/zeevy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | arduinos 5 | cbeb 6 | cfeaaee 7 | connectivityservices 8 | coords 9 | debounce 10 | debouncing 11 | eeprom 12 | felhr 13 | gcode 14 | github 15 | gorest 16 | grbl 17 | grblcontroller 18 | horz 19 | linuxcnc 20 | mailto 21 | usbotg 22 | usbservice 23 | usec 24 | vert 25 | wpos 26 | zeevy 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | release 3 | -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "785640354976", 4 | "firebase_url": "https://grbl-controller.firebaseio.com", 5 | "project_id": "grbl-controller", 6 | "storage_bucket": "grbl-controller.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:785640354976:android:52392fa51329f49f", 12 | "android_client_info": { 13 | "package_name": "in.co.gorest.grblcontroller" 14 | } 15 | }, 16 | "oauth_client": [], 17 | "api_key": [ 18 | { 19 | "current_key": "AIzaSyBU3jDBtHS-FmsI0NHArpU0iCT-v6W0lOo" 20 | } 21 | ], 22 | "services": { 23 | "appinvite_service": { 24 | "other_platform_oauth_client": [ 25 | { 26 | "client_id": "785640354976-ol3fe7sdnmv2565n361cvvnicn6c6qi2.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ] 30 | } 31 | }, 32 | "admob_app_id": "ca-app-pub-4930099895671899~8705180010" 33 | } 34 | ], 35 | "configuration_version": "1" 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/assets/alarm_codes.csv: -------------------------------------------------------------------------------- 1 | 1,Hard limit,Hard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended. 2 | 2,Soft limit,Soft limit alarm. G-code motion target exceeds machine travel. Machine position retained. Alarm may be safely unlocked. 3 | 3,Abort during cycle,Reset while in motion. Machine position is likely lost due to sudden halt. Re-homing is highly recommended. 4 | 4,Probe fail,Probe fail. Probe is not in the expected initial state before starting probe cycle when G38.2 and G38.3 is not triggered and G38.4 and G38.5 is triggered. 5 | 5,Probe fail,Probe fail. Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4. 6 | 6,Homing fail,Homing fail. The active homing cycle was reset. 7 | 7,Homing fail,Homing fail. Safety door was opened during homing cycle. 8 | 8,Homing fail,Homing fail. Pull off travel failed to clear limit switch. Try increasing pull-off setting or check wiring. 9 | 9,Homing fail,Homing fail. Could not find limit switch within search distances. Try increasing max travel, decreasing pull-off distance, or check wiring. 10 | 10,Homing fail,Homing fail. Second dual axis limit switch failed to trigger within configured search distance after first. Try increasing trigger fail distance or check wiring. -------------------------------------------------------------------------------- /app/src/main/assets/build_option_codes.csv: -------------------------------------------------------------------------------- 1 | V,Variable spindle,Enabled 2 | N,Line numbers,Enabled 3 | M,Mist coolant M7,Enabled 4 | C,CoreXY,Enabled 5 | P,Parking motion,Enabled 6 | Z,Homing force origin,Enabled 7 | H,Homing single axis commands,Enabled 8 | T,Two limit switches on axis,Enabled 9 | A,Allow feed rate overrides in probe cycles,Enabled 10 | D,Use spindle direction as enable pin,Enabled 11 | 0,Spindle enable off when speed is zero,Enabled 12 | S,Software limit pin debouncing,Enabled 13 | R,Parking override control,Enabled 14 | *,Restore all EEPROM command,Disabled 15 | $,Restore EEPROM `$` settings command,Disabled 16 | #,Restore EEPROM parameter data command,Disabled 17 | I,Build info write user string command,Disabled 18 | E,Force sync upon EEPROM write,Disabled 19 | W,Force sync upon work coordinate offset change,Disabled 20 | L,Homing initialization auto-lock,Disabled -------------------------------------------------------------------------------- /app/src/main/assets/error_codes.csv: -------------------------------------------------------------------------------- 1 | 1,Expected command letter,G-code words consist of a letter and a value. Letter was not found. 2 | 2,Bad number format,Missing the expected G-code word value or numeric value format is not valid. 3 | 3,Invalid statement,Grbl '$' system command was not recognized or supported. 4 | 4,Value < 0,Negative value received for an expected positive value. 5 | 5,Setting disabled,Homing cycle failure. Homing is not enabled via settings. 6 | 6,Value < 3 usec,Minimum step pulse time must be greater than 3usec. 7 | 7,EEPROM read fail. Using defaults,An EEPROM read failed. Auto-restoring affected EEPROM to default values. 8 | 8,Not idle,Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job. 9 | 9,G-code lock,G-code commands are locked out during alarm or jog state. 10 | 10,Homing not enabled,Soft limits cannot be enabled without homing also enabled. 11 | 11,Line overflow,Max characters per line exceeded. Received command line was not executed. 12 | 12,Step rate > 30kHz,Grbl '$' setting value cause the step rate to exceed the maximum supported. 13 | 13,Check Door,Safety door detected as opened and door state initiated. 14 | 14,Line length exceeded,Build info or startup line exceeded EEPROM line length limit. Line not stored. 15 | 15,Travel exceeded,Jog target exceeds machine travel. Jog command has been ignored. 16 | 16,Invalid jog command,Jog command has no '=' or contains prohibited g-code. 17 | 17,Setting disabled,Laser mode requires PWM output. 18 | 20,Unsupported command,Unsupported or invalid g-code command found in block. 19 | 21,Modal group violation,More than one g-code command from same modal group found in block. 20 | 22,Undefined feed rate,Feed rate has not yet been set or is undefined. 21 | 23,Invalid gcode ID:23,G-code command in block requires an integer value. 22 | 24,Invalid gcode ID:24,More than one g-code command that requires axis words found in block. 23 | 25,Invalid gcode ID:25,Repeated g-code word found in block. 24 | 26,Invalid gcode ID:26,No axis words found in block for g-code command or current modal state which requires them. 25 | 27,Invalid gcode ID:27,Line number value is invalid. 26 | 28,Invalid gcode ID:28,G-code command is missing a required value word. 27 | 29,Invalid gcode ID:29,G59.x work coordinate systems are not supported. 28 | 30,Invalid gcode ID:30,G53 only allowed with G0 and G1 motion modes. 29 | 31,Invalid gcode ID:31,Axis words found in block when no command or current modal state uses them. 30 | 32,Invalid gcode ID:32,G2 and G3 arcs require at least one in-plane axis word. 31 | 33,Invalid gcode ID:33,Motion command target is invalid. 32 | 34,Invalid gcode ID:34,Arc radius value is invalid. 33 | 35,Invalid gcode ID:35,G2 and G3 arcs require at least one in-plane offset word. 34 | 36,Invalid gcode ID:36,Unused value words found in block. 35 | 37,Invalid gcode ID:37,G43.1 dynamic tool length offset is not assigned to configured tool length axis. 36 | 38,Invalid gcode ID:38,Tool number greater than max supported value. -------------------------------------------------------------------------------- /app/src/main/assets/iconify/android-iconify-fontawesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/assets/iconify/android-iconify-fontawesome.ttf -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/Icon.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify; 2 | 3 | /** 4 | * Icon represents one icon in an icon font. 5 | */ 6 | public interface Icon { 7 | 8 | /** The key of icon, for example 'fa-ok' */ 9 | String key(); 10 | 11 | /** The character matching the key in the font, for example '\u4354' */ 12 | char character(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/IconFontDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify; 2 | 3 | /** 4 | * An IconFontDescriptor defines a TTF font file 5 | * and is able to map keys with characters in this file. 6 | */ 7 | public interface IconFontDescriptor { 8 | 9 | /** 10 | * The TTF file name. 11 | * @return a name with no slash, present in the assets. 12 | */ 13 | String ttfFileName(); 14 | 15 | Icon[] characters(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/fonts/FontAwesomeModule.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify.fonts; 2 | 3 | import com.joanzapata.iconify.Icon; 4 | import com.joanzapata.iconify.IconFontDescriptor; 5 | 6 | public class FontAwesomeModule implements IconFontDescriptor { 7 | 8 | @Override 9 | public String ttfFileName() { 10 | return "iconify/android-iconify-fontawesome.ttf"; 11 | } 12 | 13 | @Override 14 | public Icon[] characters() { 15 | return FontAwesomeIcons.values(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/internal/HasOnViewAttachListener.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify.internal; 2 | 3 | import android.widget.TextView; 4 | 5 | import androidx.core.view.ViewCompat; 6 | 7 | /** 8 | * Any TextView subclass that wishes to call {@link com.joanzapata.iconify.Iconify#addIcons(TextView...)} on it 9 | * needs to implement this interface if it ever want to use spinning icons. 10 | *
11 | * IconTextView, IconButton and IconToggleButton already implement it, but if you need to implement it 12 | * yourself, please use {@link com.joanzapata.iconify.internal.HasOnViewAttachListener.HasOnViewAttachListenerDelegate} 13 | * to help you. 14 | */ 15 | public interface HasOnViewAttachListener { 16 | void setOnViewAttachListener(OnViewAttachListener listener); 17 | 18 | interface OnViewAttachListener { 19 | void onAttach(); 20 | 21 | void onDetach(); 22 | } 23 | 24 | /** 25 | * Helper class to implement {@link HasOnViewAttachListener}. 26 | * Usual implementation should look like this: 27 | *
28 |      * {@code
29 |      * class MyClass extends TextView implements HasOnViewAttachListener {
30 |      *
31 |      *       private HasOnViewAttachListenerDelegate delegate
32 |      *
33 |      *       @Override
34 |      *       public void setOnViewAttachListener(OnViewAttachListener listener) {
35 |      *          if (delegate == null) delegate = new HasOnViewAttachListenerDelegate(this);
36 |      *          delegate.setOnViewAttachListener(listener);
37 |      *       }
38 |      *
39 |      *       @Override
40 |      *       protected void onAttachedToWindow() {
41 |      *          super.onAttachedToWindow();
42 |      *          delegate.onAttachedToWindow();
43 |      *       }
44 |      *
45 |      *       @Override
46 |      *       protected void onDetachedFromWindow() {
47 |      *          super.onDetachedFromWindow();
48 |      *          delegate.onDetachedFromWindow();
49 |      *      }
50 |      *
51 |      *  }
52 |      * }
53 |      * 
54 | */ 55 | class HasOnViewAttachListenerDelegate { 56 | 57 | private final TextView view; 58 | private OnViewAttachListener listener; 59 | 60 | public HasOnViewAttachListenerDelegate(TextView view) { 61 | this.view = view; 62 | } 63 | 64 | public void setOnViewAttachListener(OnViewAttachListener listener) { 65 | if (this.listener != null) 66 | this.listener.onDetach(); 67 | this.listener = listener; 68 | if (ViewCompat.isAttachedToWindow(view) && listener != null) { 69 | listener.onAttach(); 70 | } 71 | } 72 | 73 | public void onAttachedToWindow() { 74 | if (listener != null) listener.onAttach(); 75 | } 76 | 77 | public void onDetachedFromWindow() { 78 | if (listener != null) listener.onDetach(); 79 | } 80 | 81 | } 82 | } -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/internal/IconFontDescriptorWrapper.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify.internal; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import com.joanzapata.iconify.Icon; 6 | import com.joanzapata.iconify.IconFontDescriptor; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | public class IconFontDescriptorWrapper { 12 | 13 | private final IconFontDescriptor iconFontDescriptor; 14 | 15 | private final Map iconsByKey; 16 | 17 | private Typeface cachedTypeface; 18 | 19 | public IconFontDescriptorWrapper(IconFontDescriptor iconFontDescriptor) { 20 | this.iconFontDescriptor = iconFontDescriptor; 21 | iconsByKey = new HashMap<>(); 22 | Icon[] characters = iconFontDescriptor.characters(); 23 | for (Icon icon : characters) { 24 | iconsByKey.put(icon.key(), icon); 25 | } 26 | } 27 | 28 | public Icon getIcon(String key) { 29 | return iconsByKey.get(key); 30 | } 31 | 32 | public IconFontDescriptor getIconFontDescriptor() { 33 | return iconFontDescriptor; 34 | } 35 | 36 | public Typeface getTypeface(Context context) { 37 | if (cachedTypeface != null) return cachedTypeface; 38 | synchronized (this) { 39 | if (cachedTypeface != null) return cachedTypeface; 40 | cachedTypeface = Typeface.createFromAsset(context.getAssets(), iconFontDescriptor.ttfFileName()); 41 | return cachedTypeface; 42 | } 43 | } 44 | 45 | public boolean hasIcon(Icon icon) { 46 | return iconsByKey.containsValue(icon); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/widget/IconButton.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.Button; 6 | import com.joanzapata.iconify.Iconify; 7 | import com.joanzapata.iconify.internal.HasOnViewAttachListener; 8 | 9 | public class IconButton extends Button implements HasOnViewAttachListener { 10 | 11 | private HasOnViewAttachListenerDelegate delegate; 12 | 13 | public IconButton(Context context) { 14 | super(context); 15 | init(); 16 | } 17 | 18 | public IconButton(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | init(); 21 | } 22 | 23 | public IconButton(Context context, AttributeSet attrs, int defStyle) { 24 | super(context, attrs, defStyle); 25 | init(); 26 | } 27 | 28 | private void init() { 29 | setTransformationMethod(null); 30 | } 31 | 32 | @Override 33 | public void setText(CharSequence text, BufferType type) { 34 | super.setText(Iconify.compute(getContext(), text, this), type); 35 | } 36 | 37 | 38 | @Override 39 | public void setOnViewAttachListener(HasOnViewAttachListener.OnViewAttachListener listener) { 40 | if (delegate == null) delegate = new HasOnViewAttachListenerDelegate(this); 41 | delegate.setOnViewAttachListener(listener); 42 | } 43 | 44 | @Override 45 | protected void onAttachedToWindow() { 46 | super.onAttachedToWindow(); 47 | delegate.onAttachedToWindow(); 48 | } 49 | 50 | @Override 51 | protected void onDetachedFromWindow() { 52 | super.onDetachedFromWindow(); 53 | delegate.onDetachedFromWindow(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/widget/IconTextView.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.TextView; 6 | import com.joanzapata.iconify.Iconify; 7 | import com.joanzapata.iconify.internal.HasOnViewAttachListener; 8 | 9 | public class IconTextView extends TextView implements HasOnViewAttachListener { 10 | 11 | private HasOnViewAttachListenerDelegate delegate; 12 | 13 | public IconTextView(Context context) { 14 | super(context); 15 | init(); 16 | } 17 | 18 | public IconTextView(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | init(); 21 | } 22 | 23 | public IconTextView(Context context, AttributeSet attrs, int defStyle) { 24 | super(context, attrs, defStyle); 25 | init(); 26 | } 27 | 28 | private void init() { 29 | setTransformationMethod(null); 30 | } 31 | 32 | @Override 33 | public void setText(CharSequence text, BufferType type) { 34 | super.setText(Iconify.compute(getContext(), text, this), type); 35 | } 36 | 37 | @Override 38 | public void setOnViewAttachListener(OnViewAttachListener listener) { 39 | if (delegate == null) delegate = new HasOnViewAttachListenerDelegate(this); 40 | delegate.setOnViewAttachListener(listener); 41 | } 42 | 43 | @Override 44 | protected void onAttachedToWindow() { 45 | super.onAttachedToWindow(); 46 | delegate.onAttachedToWindow(); 47 | } 48 | 49 | @Override 50 | protected void onDetachedFromWindow() { 51 | super.onDetachedFromWindow(); 52 | delegate.onDetachedFromWindow(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/joanzapata/iconify/widget/IconToggleButton.java: -------------------------------------------------------------------------------- 1 | package com.joanzapata.iconify.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.ToggleButton; 6 | import com.joanzapata.iconify.Iconify; 7 | import com.joanzapata.iconify.internal.HasOnViewAttachListener; 8 | 9 | public class IconToggleButton extends ToggleButton implements HasOnViewAttachListener { 10 | 11 | private HasOnViewAttachListenerDelegate delegate; 12 | 13 | public IconToggleButton(Context context, AttributeSet attrs, int defStyle) { 14 | super(context, attrs, defStyle); 15 | init(); 16 | } 17 | 18 | public IconToggleButton(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | init(); 21 | } 22 | 23 | public IconToggleButton(Context context) { 24 | super(context); 25 | init(); 26 | } 27 | 28 | private void init() { 29 | setTransformationMethod(null); 30 | } 31 | 32 | @Override 33 | public void setText(CharSequence text, BufferType type) { 34 | super.setText(Iconify.compute(getContext(), text, this), BufferType.NORMAL); 35 | } 36 | 37 | @Override 38 | public void setOnViewAttachListener(HasOnViewAttachListener.OnViewAttachListener listener) { 39 | if (delegate == null) delegate = new HasOnViewAttachListenerDelegate(this); 40 | delegate.setOnViewAttachListener(listener); 41 | } 42 | 43 | @Override 44 | protected void onAttachedToWindow() { 45 | super.onAttachedToWindow(); 46 | delegate.onAttachedToWindow(); 47 | } 48 | 49 | @Override 50 | protected void onDetachedFromWindow() { 51 | super.onDetachedFromWindow(); 52 | delegate.onDetachedFromWindow(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/GrblController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller; 23 | 24 | import androidx.appcompat.app.AppCompatDelegate; 25 | 26 | import com.joanzapata.iconify.Iconify; 27 | import com.joanzapata.iconify.fonts.FontAwesomeModule; 28 | import com.orm.SugarApp; 29 | 30 | import es.dmoral.toasty.Toasty; 31 | 32 | public class GrblController extends SugarApp { 33 | 34 | private static GrblController grblController; 35 | 36 | @Override 37 | public void onCreate() { 38 | super.onCreate(); 39 | 40 | grblController = this; 41 | 42 | AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); 43 | Iconify.with(new FontAwesomeModule()); 44 | 45 | Toasty.Config.getInstance() 46 | .tintIcon(true) 47 | .allowQueue(true) 48 | .apply(); 49 | } 50 | 51 | public static synchronized GrblController getInstance(){ 52 | return grblController; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/SplashActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller; 23 | 24 | import android.annotation.SuppressLint; 25 | import android.content.Intent; 26 | import android.os.Bundle; 27 | import androidx.appcompat.app.AppCompatActivity; 28 | import androidx.appcompat.app.AppCompatDelegate; 29 | 30 | import in.co.gorest.grblcontroller.helpers.EnhancedSharedPreferences; 31 | import in.co.gorest.grblcontroller.model.Constants; 32 | 33 | @SuppressLint("CustomSplashScreen") 34 | public class SplashActivity extends AppCompatActivity { 35 | 36 | static { 37 | AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); 38 | } 39 | 40 | @Override 41 | protected void onCreate(Bundle savedInstanceState) { 42 | super.onCreate(savedInstanceState); 43 | 44 | EnhancedSharedPreferences sharedPref = EnhancedSharedPreferences.getInstance(GrblController.getInstance(), getString(R.string.shared_preference_key)); 45 | 46 | String defaultConnection = sharedPref.getString(getString(R.string.preference_default_serial_connection_type), Constants.SERIAL_CONNECTION_TYPE_BLUETOOTH); 47 | 48 | if (Constants.SERIAL_CONNECTION_TYPE_USB_OTG.equals(defaultConnection)) { 49 | startActivity(new Intent(SplashActivity.this, UsbConnectionActivity.class)); 50 | } else { 51 | startActivity(new Intent(SplashActivity.this, BluetoothConnectionActivity.class)); 52 | } 53 | 54 | finish(); 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/adapters/CommandHistoryAdapter.java: -------------------------------------------------------------------------------- 1 | package in.co.gorest.grblcontroller.adapters; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.recyclerview.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import java.util.List; 11 | 12 | import in.co.gorest.grblcontroller.R; 13 | import in.co.gorest.grblcontroller.model.CommandHistory; 14 | 15 | public class CommandHistoryAdapter extends RecyclerView.Adapter{ 16 | 17 | private final List dataSet; 18 | private View.OnClickListener onItemClickListener; 19 | private View.OnLongClickListener onLongClickListener; 20 | 21 | public CommandHistoryAdapter(List dataSet){ 22 | this.dataSet = dataSet; 23 | } 24 | 25 | public void setItemLongClickListener(View.OnLongClickListener longClickListener){ 26 | onLongClickListener = longClickListener; 27 | } 28 | 29 | public void setItemClickListener(View.OnClickListener clickListener) { 30 | onItemClickListener = clickListener; 31 | } 32 | 33 | @NonNull 34 | @Override 35 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){ 36 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.command_history, parent, false); 37 | return new ViewHolder(view); 38 | } 39 | 40 | @Override 41 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) { 42 | holder.commandText.setText(dataSet.get(position).getCommand()); 43 | } 44 | 45 | @Override 46 | public int getItemCount() { 47 | return dataSet.size(); 48 | } 49 | 50 | class ViewHolder extends RecyclerView.ViewHolder{ 51 | private final TextView commandText; 52 | 53 | public ViewHolder(View itemView){ 54 | super(itemView); 55 | 56 | commandText = itemView.findViewById(R.id.history_command_text); 57 | itemView.setTag(this); 58 | itemView.setOnClickListener(onItemClickListener); 59 | itemView.setOnLongClickListener(onLongClickListener); 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/BluetoothDisconnectEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | public class BluetoothDisconnectEvent { 25 | 26 | private String message; 27 | 28 | public BluetoothDisconnectEvent(String message){ 29 | this.message = message; 30 | } 31 | 32 | public String getMessage(){ return this.message; } 33 | 34 | public void setMessage(String message){ 35 | this.message = message; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/ConsoleMessageEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | public class ConsoleMessageEvent { 25 | 26 | private final String message; 27 | 28 | public ConsoleMessageEvent(String message){ 29 | this.message = message; 30 | } 31 | 32 | public String getMessage(){ return this.message; } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/FcmNotificationRecieved.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * /** 4 | * * * Copyright (C) 2017 Grbl Controller Contributors 5 | * * * 6 | * * * This program is free software; you can redistribute it and/or modify 7 | * * * it under the terms of the GNU General Public License as published by 8 | * * * the Free Software Foundation; either version 2 of the License, or 9 | * * * (at your option) any later version. 10 | * * * 11 | * * * This program is distributed in the hope that it will be useful, 12 | * * * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * * * GNU General Public License for more details. 15 | * * * 16 | * * * You should have received a copy of the GNU General Public License along 17 | * * * with this program; if not, write to the Free Software Foundation, Inc., 18 | * * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * * * 20 | * * 21 | * 22 | */ 23 | 24 | package in.co.gorest.grblcontroller.events; 25 | 26 | import in.co.gorest.grblcontroller.model.GrblNotification; 27 | 28 | public class FcmNotificationRecieved { 29 | 30 | private final GrblNotification grblNotification; 31 | 32 | public FcmNotificationRecieved(GrblNotification grblNotification){ 33 | this.grblNotification = grblNotification; 34 | } 35 | 36 | public GrblNotification getGrblNotification(){ 37 | return this.grblNotification; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/GrblAlarmEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | import in.co.gorest.grblcontroller.GrblController; 28 | import in.co.gorest.grblcontroller.R; 29 | import in.co.gorest.grblcontroller.util.GrblLookups; 30 | 31 | public class GrblAlarmEvent { 32 | 33 | private final String message; 34 | 35 | private int alarmCode; 36 | private String alarmName; 37 | private String alarmDescription; 38 | 39 | public GrblAlarmEvent(GrblLookups lookups, String message){ 40 | this.message = message; 41 | 42 | String[] inputParts = message.split(":"); 43 | if(inputParts.length == 2){ 44 | String[] lookup = lookups.lookup(inputParts[1].trim()); 45 | if(lookup != null){ 46 | this.alarmCode = Integer.parseInt(lookup[0]); 47 | this.alarmName = lookup[1]; 48 | this.alarmDescription = lookup[2]; 49 | } 50 | } 51 | } 52 | 53 | @NonNull 54 | @Override 55 | public String toString(){ 56 | return GrblController.getInstance().getString(R.string.text_grbl_alarm_format, alarmCode, alarmDescription); 57 | } 58 | 59 | public String getMessage(){ return this.message; } 60 | 61 | public int getAlarmCode(){return this.alarmCode; } 62 | 63 | public String getAlarmName(){ 64 | return this.alarmName; 65 | } 66 | 67 | public String getAlarmDescription(){ 68 | return this.alarmDescription; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/GrblErrorEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | import in.co.gorest.grblcontroller.GrblController; 28 | import in.co.gorest.grblcontroller.R; 29 | import in.co.gorest.grblcontroller.util.GrblLookups; 30 | 31 | public class GrblErrorEvent { 32 | 33 | private final String message; 34 | 35 | private int errorCode; 36 | private String errorName; 37 | private String errorDescription; 38 | 39 | public GrblErrorEvent(GrblLookups lookups, String message){ 40 | this.message = message; 41 | 42 | String[] inputParts = message.split(":"); 43 | if(inputParts.length == 2){ 44 | String[] lookup = lookups.lookup(inputParts[1].trim()); 45 | if(lookup != null){ 46 | this.errorCode = Integer.parseInt(lookup[0]); 47 | this.errorName = lookup[1]; 48 | this.errorDescription = lookup[2]; 49 | } 50 | } 51 | } 52 | 53 | @NonNull 54 | @Override 55 | public String toString(){ 56 | return GrblController.getInstance().getString(R.string.text_grbl_error_format, errorCode, errorDescription); 57 | } 58 | 59 | public String getMessage(){ return this.message; } 60 | 61 | public int getErrorCode(){ 62 | return this.errorCode; 63 | } 64 | 65 | public String getErrorName(){ 66 | return this.errorName; 67 | } 68 | 69 | public String getErrorDescription(){ 70 | return this.errorDescription; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/GrblOkEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | public class GrblOkEvent { 25 | 26 | private String message; 27 | 28 | public GrblOkEvent(String message){ 29 | this.message = message; 30 | } 31 | 32 | public String getMessage(){ return this.message; } 33 | public void setMessage(String message){ this.message = message; } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/GrblProbeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | 25 | import in.co.gorest.grblcontroller.model.Position; 26 | 27 | public class GrblProbeEvent { 28 | 29 | private final String probeString; 30 | private Position probePosition; 31 | private Boolean isProbeSuccess = false; 32 | 33 | public GrblProbeEvent(String probeString){ 34 | this.probeString = probeString; 35 | this.parseProbeString(); 36 | } 37 | 38 | private void parseProbeString(){ 39 | String[] parts = probeString.split(":"); 40 | String[] coordinates = parts[0].split(","); 41 | 42 | this.probePosition = new Position(Double.parseDouble(coordinates[0]), Double.parseDouble(coordinates[1]), Double.parseDouble(coordinates[2])); 43 | this.isProbeSuccess = parts[1].equals("1"); 44 | } 45 | 46 | public Boolean getIsProbeSuccess(){ return this.isProbeSuccess; } 47 | 48 | public Double getProbeCordX(){ return this.probePosition.getCordX(); } 49 | 50 | public Double getProbeCordY(){ return this.probePosition.getCordY(); } 51 | 52 | public Double getProbeCordZ(){ return this.probePosition.getCordZ(); } 53 | 54 | public Position getProbePosition(){ return this.probePosition; } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/GrblRealTimeCommandEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * /** 4 | * * * Copyright (C) 2017 Grbl Controller Contributors 5 | * * * 6 | * * * This program is free software; you can redistribute it and/or modify 7 | * * * it under the terms of the GNU General Public License as published by 8 | * * * the Free Software Foundation; either version 2 of the License, or 9 | * * * (at your option) any later version. 10 | * * * 11 | * * * This program is distributed in the hope that it will be useful, 12 | * * * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * * * GNU General Public License for more details. 15 | * * * 16 | * * * You should have received a copy of the GNU General Public License along 17 | * * * with this program; if not, write to the Free Software Foundation, Inc., 18 | * * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * * * 20 | * * 21 | * 22 | */ 23 | 24 | package in.co.gorest.grblcontroller.events; 25 | 26 | public class GrblRealTimeCommandEvent { 27 | 28 | private final byte command; 29 | 30 | public GrblRealTimeCommandEvent(byte command){ 31 | this.command = command; 32 | } 33 | 34 | public byte getCommand(){ 35 | return this.command; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/JogCommandEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | public class JogCommandEvent { 25 | 26 | private String command; 27 | private String status; 28 | 29 | public JogCommandEvent(String command){ 30 | this.command = command; 31 | } 32 | 33 | public String getCommand(){ return this.command; } 34 | public void setCommand(String command){ this.command = command; } 35 | 36 | public String getStatus(){ return this.status; } 37 | public void setStatus(String status){ this.status = status; } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/StreamingCompleteEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | public class StreamingCompleteEvent { 25 | 26 | private String message; 27 | private String fileName; 28 | private int rowsSent; 29 | private long timeMillis; 30 | private String timeTaken; 31 | 32 | public StreamingCompleteEvent(String message){ 33 | this.message = message; 34 | } 35 | 36 | public StreamingCompleteEvent(String message, String fileName, int rowsSent, long timeMillis, String timeTaken){ 37 | this.message = message; 38 | this.fileName = fileName; 39 | this.rowsSent = rowsSent; 40 | this.timeMillis = timeMillis; 41 | this.timeTaken = timeTaken; 42 | } 43 | 44 | public String getMessage(){ return this.message; } 45 | public void setMessage(String message){ this.message = message; } 46 | 47 | public String getFileName(){ return this.fileName; } 48 | public void setFileName(String fileName){ this.fileName = fileName; } 49 | 50 | public int getRowsSent(){ return this.rowsSent; } 51 | public void setRowsSent(int rowsSent){ this.rowsSent = rowsSent; } 52 | 53 | public long getTimeMillis(){ return this.timeMillis; } 54 | public void setTimeMillis(long timeMillis){ this.timeMillis = timeMillis; } 55 | 56 | public String getTimeTaken(){ return this.timeTaken; } 57 | public void setTimeTaken(String timeTaken){ this.timeTaken = timeTaken; } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/StreamingStartedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * /** 4 | * * * Copyright (C) 2017 Grbl Controller Contributors 5 | * * * 6 | * * * This program is free software; you can redistribute it and/or modify 7 | * * * it under the terms of the GNU General Public License as published by 8 | * * * the Free Software Foundation; either version 2 of the License, or 9 | * * * (at your option) any later version. 10 | * * * 11 | * * * This program is distributed in the hope that it will be useful, 12 | * * * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * * * GNU General Public License for more details. 15 | * * * 16 | * * * You should have received a copy of the GNU General Public License along 17 | * * * with this program; if not, write to the Free Software Foundation, Inc., 18 | * * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * * * 20 | * * 21 | * 22 | */ 23 | 24 | package in.co.gorest.grblcontroller.events; 25 | 26 | public class StreamingStartedEvent { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/events/UiToastEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.events; 23 | 24 | public class UiToastEvent { 25 | 26 | private String message; 27 | private Boolean longToast; 28 | private Boolean isWarning; 29 | 30 | public UiToastEvent(String message){ 31 | this.message = message; 32 | this.longToast = false; 33 | this.isWarning = false; 34 | } 35 | 36 | public UiToastEvent(String message, Boolean longToast){ 37 | this.message = message; 38 | this.longToast = longToast; 39 | this.isWarning = false; 40 | } 41 | 42 | public UiToastEvent(String message, Boolean longToast, Boolean isWarning){ 43 | this.message = message; 44 | this.longToast = longToast; 45 | this.isWarning = isWarning; 46 | } 47 | 48 | public String getMessage(){ return this.message; } 49 | public void setMessage(String message){ this.message = message; } 50 | 51 | public Boolean getLongToast(){ return this.longToast; } 52 | public void setLongToast(Boolean longToast){ this.longToast = longToast; } 53 | 54 | public Boolean getIsWarning(){ return this.isWarning; } 55 | public void setIsWarning(boolean isWarning){ 56 | this.isWarning = isWarning; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/AngledText225.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.helpers; 23 | 24 | import android.content.Context; 25 | import android.graphics.Canvas; 26 | import android.util.AttributeSet; 27 | 28 | public class AngledText225 extends com.joanzapata.iconify.widget.IconButton { 29 | 30 | public AngledText225(Context context, AttributeSet attrs){ 31 | super(context, attrs); 32 | } 33 | 34 | @Override 35 | protected void onDraw(Canvas canvas){ 36 | canvas.save(); 37 | canvas.rotate(-45, this.getWidth()/2 + 10, this.getHeight()/2); 38 | super.onDraw(canvas); 39 | canvas.restore(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/AngledText45.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.helpers; 23 | 24 | import android.content.Context; 25 | import android.graphics.Canvas; 26 | import android.util.AttributeSet; 27 | 28 | public class AngledText45 extends com.joanzapata.iconify.widget.IconButton { 29 | 30 | public AngledText45(Context context, AttributeSet attrs){ 31 | super(context, attrs); 32 | } 33 | 34 | @Override 35 | protected void onDraw(Canvas canvas){ 36 | canvas.save(); 37 | canvas.rotate(45, this.getWidth()/2, this.getHeight()/2); 38 | super.onDraw(canvas); 39 | canvas.restore(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/AngledTextBottomLeft.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.helpers; 23 | 24 | import android.content.Context; 25 | import android.graphics.Canvas; 26 | import android.util.AttributeSet; 27 | 28 | public class AngledTextBottomLeft extends com.joanzapata.iconify.widget.IconButton { 29 | 30 | public AngledTextBottomLeft(Context context, AttributeSet attrs){ 31 | super(context, attrs); 32 | } 33 | 34 | @Override 35 | protected void onDraw(Canvas canvas){ 36 | canvas.save(); 37 | canvas.rotate(45, this.getWidth()/2 - 10, this.getHeight()/2); 38 | super.onDraw(canvas); 39 | canvas.restore(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/AngledTextTopLeft.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.helpers; 23 | 24 | import android.content.Context; 25 | import android.graphics.Canvas; 26 | import android.util.AttributeSet; 27 | 28 | public class AngledTextTopLeft extends com.joanzapata.iconify.widget.IconButton { 29 | 30 | public AngledTextTopLeft(Context context, AttributeSet attrs){ 31 | super(context, attrs); 32 | } 33 | 34 | @Override 35 | protected void onDraw(Canvas canvas){ 36 | canvas.save(); 37 | canvas.rotate(-45, this.getWidth()/2, this.getHeight()/2); 38 | super.onDraw(canvas); 39 | canvas.restore(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/DepthPageTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.helpers; 23 | 24 | 25 | import androidx.annotation.NonNull; 26 | import androidx.viewpager.widget.ViewPager; 27 | import android.view.View; 28 | 29 | class DepthPageTransformer implements ViewPager.PageTransformer{ 30 | 31 | private static final float MIN_SCALE = 0.75f; 32 | 33 | public void transformPage(@NonNull View view, float position) { 34 | int pageWidth = view.getWidth(); 35 | 36 | if (position < -1) { // [-Infinity,-1) 37 | // This page is way off-screen to the left. 38 | view.setAlpha(0); 39 | 40 | } else if (position <= 0) { // [-1,0] 41 | // Use the default slide transition when moving to the left page 42 | view.setAlpha(1); 43 | view.setTranslationX(0); 44 | view.setScaleX(1); 45 | view.setScaleY(1); 46 | 47 | } else if (position <= 1) { // (0,1] 48 | // Fade the page out. 49 | view.setAlpha(1 - position); 50 | 51 | // Counteract the default slide transition 52 | view.setTranslationX(pageWidth * -position); 53 | 54 | // Scale the page down (between MIN_SCALE and 1) 55 | float scaleFactor = MIN_SCALE 56 | + (1 - MIN_SCALE) * (1 - Math.abs(position)); 57 | view.setScaleX(scaleFactor); 58 | view.setScaleY(scaleFactor); 59 | 60 | } else { // (1,+Infinity] 61 | // This page is way off-screen to the right. 62 | view.setAlpha(0); 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/MyEditTextPreference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * /** 4 | * * * Copyright (C) 2017 Grbl Controller Contributors 5 | * * * 6 | * * * This program is free software; you can redistribute it and/or modify 7 | * * * it under the terms of the GNU General Public License as published by 8 | * * * the Free Software Foundation; either version 2 of the License, or 9 | * * * (at your option) any later version. 10 | * * * 11 | * * * This program is distributed in the hope that it will be useful, 12 | * * * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * * * GNU General Public License for more details. 15 | * * * 16 | * * * You should have received a copy of the GNU General Public License along 17 | * * * with this program; if not, write to the Free Software Foundation, Inc., 18 | * * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * * * 20 | * * 21 | * 22 | */ 23 | 24 | package in.co.gorest.grblcontroller.helpers; 25 | 26 | import android.content.Context; 27 | import android.preference.EditTextPreference; 28 | import android.util.AttributeSet; 29 | 30 | public class MyEditTextPreference extends EditTextPreference { 31 | public MyEditTextPreference(Context context, AttributeSet attrs, int defStyle) { 32 | super(context, attrs, defStyle); 33 | } 34 | 35 | public MyEditTextPreference(Context context, AttributeSet attrs) { 36 | super(context, attrs); 37 | } 38 | 39 | @Override 40 | public void setText(String text) { 41 | super.setText(text); 42 | setSummary(text); 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/helpers/ZoomOutPageTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.helpers; 23 | 24 | import androidx.annotation.NonNull; 25 | import androidx.viewpager.widget.ViewPager; 26 | import android.view.View; 27 | 28 | class ZoomOutPageTransformer implements ViewPager.PageTransformer { 29 | private static final float MIN_SCALE = 0.85f; 30 | private static final float MIN_ALPHA = 0.5f; 31 | 32 | public void transformPage(@NonNull View view, float position) { 33 | int pageWidth = view.getWidth(); 34 | int pageHeight = view.getHeight(); 35 | 36 | if (position < -1) { // [-Infinity,-1) 37 | // This page is way off-screen to the left. 38 | view.setAlpha(0); 39 | 40 | } else if (position <= 1) { // [-1,1] 41 | // Modify the default slide transition to shrink the page as well 42 | float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs(position)); 43 | float vertMargin = pageHeight * (1 - scaleFactor) / 2; 44 | float horzMargin = pageWidth * (1 - scaleFactor) / 2; 45 | if (position < 0) { 46 | view.setTranslationX(horzMargin - vertMargin / 2); 47 | } else { 48 | view.setTranslationX(-horzMargin + vertMargin / 2); 49 | } 50 | 51 | // Scale the page down (between MIN_SCALE and 1) 52 | view.setScaleX(scaleFactor); 53 | view.setScaleY(scaleFactor); 54 | 55 | // Fade the page relative to its size. 56 | view.setAlpha(MIN_ALPHA + 57 | (scaleFactor - MIN_SCALE) / 58 | (1 - MIN_SCALE) * (1 - MIN_ALPHA)); 59 | 60 | } else { // (1,+Infinity] 61 | // This page is way off-screen to the right. 62 | view.setAlpha(0); 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/listeners/ConsoleLoggerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.listeners; 23 | 24 | 25 | import androidx.databinding.BaseObservable; 26 | import androidx.databinding.Bindable; 27 | 28 | import org.apache.commons.collections4.queue.CircularFifoQueue; 29 | 30 | import in.co.gorest.grblcontroller.BR; 31 | import in.co.gorest.grblcontroller.model.Constants; 32 | 33 | public class ConsoleLoggerListener extends BaseObservable{ 34 | 35 | @Bindable 36 | private final CircularFifoQueue loggedMessagesQueue; 37 | private String messages; 38 | 39 | private static ConsoleLoggerListener consoleLoggerListener = null; 40 | public static ConsoleLoggerListener getInstance(){ 41 | if(consoleLoggerListener == null) consoleLoggerListener = new ConsoleLoggerListener(); 42 | return consoleLoggerListener; 43 | } 44 | 45 | public static void resetClass(){ 46 | consoleLoggerListener = new ConsoleLoggerListener(); 47 | } 48 | 49 | private ConsoleLoggerListener(){ 50 | this.loggedMessagesQueue = new CircularFifoQueue<>(Constants.CONSOLE_LOGGER_MAX_SIZE); 51 | this.messages = ""; 52 | } 53 | 54 | @Bindable 55 | public synchronized String getMessages(){ 56 | return this.messages.trim(); 57 | } 58 | 59 | public synchronized void offerMessage(String newMessage){ 60 | this.loggedMessagesQueue.offer(newMessage); 61 | if(this.loggedMessagesQueue.isAtFullCapacity()){ 62 | this.messages = this.messages.substring(this.messages.indexOf('\n')+1); 63 | } 64 | this.messages += newMessage + "\n"; 65 | notifyPropertyChanged(BR.messages); 66 | } 67 | 68 | public void clearMessages(){ 69 | this.loggedMessagesQueue.clear(); 70 | this.messages = ""; 71 | notifyPropertyChanged(BR.messages); 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/model/CommandHistory.java: -------------------------------------------------------------------------------- 1 | package in.co.gorest.grblcontroller.model; 2 | 3 | import com.orm.SugarRecord; 4 | import com.orm.query.Condition; 5 | import com.orm.query.Select; 6 | import com.orm.util.NamingHelper; 7 | 8 | import java.text.SimpleDateFormat; 9 | import java.util.Calendar; 10 | import java.util.List; 11 | import java.util.Locale; 12 | 13 | public class CommandHistory extends SugarRecord { 14 | 15 | public String command; 16 | public String gcode; 17 | public Integer usageCount; 18 | public String lastUsedOn; 19 | 20 | public CommandHistory(){} 21 | 22 | public CommandHistory(String command, String gcode){ 23 | this.command = command; 24 | this.gcode = gcode; 25 | this.usageCount = 0; 26 | this.lastUsedOn = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH).format(Calendar.getInstance().getTime()); 27 | } 28 | 29 | public String getCommand(){ return this.command; } 30 | public void setCommand(String command){ this.command = command; } 31 | 32 | public String getGcode(){ return this.gcode; } 33 | public void setGcode(String gcode){ this.gcode = gcode; } 34 | 35 | public Integer getUsageCount(){ return this.usageCount; } 36 | public void setUsageCount(Integer usageCount){ this.usageCount = usageCount; } 37 | 38 | public String getLastUsedOn(){ return this.lastUsedOn; } 39 | public void updateLastUsedOn(){ 40 | this.lastUsedOn = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH).format(Calendar.getInstance().getTime()); 41 | } 42 | 43 | public static void saveToHistory(String command, String gcode){ 44 | CommandHistory commandHistory = Select.from(CommandHistory.class) 45 | .where(Condition.prop("gcode").eq(gcode)) 46 | .first(); 47 | 48 | if(commandHistory == null) commandHistory = new CommandHistory(command, gcode); 49 | commandHistory.usageCount++; 50 | commandHistory.updateLastUsedOn(); 51 | 52 | commandHistory.save(); 53 | } 54 | 55 | public static List getHistory(String offset, String limit){ 56 | return Select.from(CommandHistory.class) 57 | .orderBy(NamingHelper.toSQLNameDefault("usageCount") + " DESC, " + NamingHelper.toSQLNameDefault("lastUsedOn") + " DESC") 58 | .limit(offset + ", " + limit).list(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/model/GcodeCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * /** 4 | * * * Copyright (C) 2017 Grbl Controller Contributors 5 | * * * 6 | * * * This program is free software; you can redistribute it and/or modify 7 | * * * it under the terms of the GNU General Public License as published by 8 | * * * the Free Software Foundation; either version 2 of the License, or 9 | * * * (at your option) any later version. 10 | * * * 11 | * * * This program is distributed in the hope that it will be useful, 12 | * * * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * * * GNU General Public License for more details. 15 | * * * 16 | * * * You should have received a copy of the GNU General Public License along 17 | * * * with this program; if not, write to the Free Software Foundation, Inc., 18 | * * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * * * 20 | * * 21 | * 22 | */ 23 | 24 | package in.co.gorest.grblcontroller.model; 25 | 26 | import in.co.gorest.grblcontroller.util.GcodePreprocessorUtils; 27 | import in.co.gorest.grblcontroller.util.GrblUtils; 28 | 29 | public class GcodeCommand { 30 | 31 | private String command; 32 | private String comment; 33 | private Integer size; 34 | private Boolean hasRomAccess; 35 | 36 | public GcodeCommand(){} 37 | 38 | public GcodeCommand(String command) { 39 | this.command = command; 40 | this.parseCommand(); 41 | } 42 | 43 | public void setCommand(String command){ 44 | this.command = command; 45 | this.parseCommand(); 46 | } 47 | 48 | private void parseCommand(){ 49 | this.comment = GcodePreprocessorUtils.parseComment(command); 50 | if(this.getHasComment()) this.command = GcodePreprocessorUtils.removeComment(command); 51 | this.command = GcodePreprocessorUtils.removeWhiteSpace(command); 52 | this.size = this.command.length() + 1; 53 | this.hasRomAccess = GrblUtils.hasRomAccess(this.command); 54 | } 55 | 56 | public String getCommandString() { 57 | return this.command; 58 | } 59 | 60 | private boolean getHasComment() { 61 | return this.comment != null && this.comment.length() != 0; 62 | } 63 | 64 | public Boolean getHasRomAccess(){ return this.hasRomAccess; } 65 | public void setHasRomAccess(Boolean hasRomAccess) { this.hasRomAccess = hasRomAccess; } 66 | public Integer getSize(){ return this.size; } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/model/Overrides.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.model; 23 | 24 | public enum Overrides { 25 | CMD_FEED_OVR_RESET, // 0x90 26 | CMD_FEED_OVR_COARSE_PLUS, // 0x91 27 | CMD_FEED_OVR_COARSE_MINUS, // 0x92 28 | CMD_FEED_OVR_FINE_PLUS , // 0x93 29 | CMD_FEED_OVR_FINE_MINUS , // 0x94 30 | CMD_RAPID_OVR_RESET, // 0x95 31 | CMD_RAPID_OVR_MEDIUM, // 0x96 32 | CMD_RAPID_OVR_LOW, // 0x97 33 | CMD_SPINDLE_OVR_RESET, // 0x99 34 | CMD_SPINDLE_OVR_COARSE_PLUS, // 0x9A 35 | CMD_SPINDLE_OVR_COARSE_MINUS, // 0x9B 36 | CMD_SPINDLE_OVR_FINE_PLUS, // 0x9C 37 | CMD_SPINDLE_OVR_FINE_MINUS, // 0x9D 38 | CMD_TOGGLE_SPINDLE, // 0x9E 39 | CMD_TOGGLE_FLOOD_COOLANT, // 0xA0 40 | CMD_TOGGLE_MIST_COOLANT, // 0xA1 41 | } 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/model/Position.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.model; 23 | 24 | 25 | import java.text.DecimalFormat; 26 | import java.text.NumberFormat; 27 | import java.util.Locale; 28 | 29 | public class Position { 30 | private final Double cordX; 31 | private final Double cordY; 32 | private final Double cordZ; 33 | 34 | 35 | private static final NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.ENGLISH); 36 | private static final DecimalFormat decimalFormat = (DecimalFormat) numberFormat; 37 | 38 | public Position(double x, double y, double z){ 39 | this.cordX = x; this.cordY = y; this.cordZ = z; 40 | decimalFormat.applyPattern("#0.###"); 41 | } 42 | 43 | public Double getCordX(){ return this.cordX; } 44 | public Double getCordY(){ return this.cordY; } 45 | public Double getCordZ(){ return this.cordZ; } 46 | 47 | private Double roundDouble(Double value){ 48 | String s = decimalFormat.format(value); 49 | return Double.parseDouble(s); 50 | } 51 | 52 | public boolean hasChanged(Position position){ 53 | return (position.getCordX().compareTo(this.cordX) != 0) || (position.getCordY().compareTo(this.cordY) != 0) || (position.getCordZ().compareTo(this.cordZ) != 0); 54 | } 55 | 56 | public boolean atZero(){ 57 | return Math.abs(this.cordX) == 0 && Math.abs(this.cordY) == 0 && Math.abs(this.cordZ) == 0; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/ui/BaseFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.ui; 23 | 24 | import android.content.Context; 25 | import android.os.Bundle; 26 | 27 | import androidx.annotation.NonNull; 28 | import androidx.fragment.app.Fragment; 29 | 30 | public class BaseFragment extends Fragment { 31 | 32 | OnFragmentInteractionListener fragmentInteractionListener; 33 | 34 | public void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | 37 | } 38 | 39 | @Override 40 | public void onAttach(@NonNull Context context) { 41 | super.onAttach(context); 42 | if (context instanceof OnFragmentInteractionListener) { 43 | fragmentInteractionListener = (OnFragmentInteractionListener) context; 44 | } else { 45 | throw new RuntimeException(context + " must implement OnFragmentInteractionListener"); 46 | } 47 | } 48 | 49 | public interface OnFragmentInteractionListener { 50 | void onGcodeCommandReceived(String command); 51 | void onGrblRealTimeCommandReceived(byte command); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/ui/GrblFragmentPagerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * /** 4 | * * * Copyright (C) 2017 Grbl Controller Contributors 5 | * * * 6 | * * * This program is free software; you can redistribute it and/or modify 7 | * * * it under the terms of the GNU General Public License as published by 8 | * * * the Free Software Foundation; either version 2 of the License, or 9 | * * * (at your option) any later version. 10 | * * * 11 | * * * This program is distributed in the hope that it will be useful, 12 | * * * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * * * GNU General Public License for more details. 15 | * * * 16 | * * * You should have received a copy of the GNU General Public License along 17 | * * * with this program; if not, write to the Free Software Foundation, Inc., 18 | * * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * * * 20 | * * 21 | * 22 | */ 23 | 24 | package in.co.gorest.grblcontroller.ui; 25 | 26 | import androidx.annotation.NonNull; 27 | import androidx.fragment.app.Fragment; 28 | import androidx.fragment.app.FragmentManager; 29 | import androidx.fragment.app.FragmentPagerAdapter; 30 | 31 | public class GrblFragmentPagerAdapter extends FragmentPagerAdapter { 32 | 33 | public final int tabCount; 34 | 35 | public GrblFragmentPagerAdapter(FragmentManager fragmentManager, int tabCount) { 36 | super(fragmentManager); 37 | this.tabCount = tabCount; 38 | } 39 | 40 | @NonNull 41 | @Override 42 | public Fragment getItem(int position) { 43 | switch (position) { 44 | case 1: return FileSenderTabFragment.newInstance(); 45 | case 2: return ProbingTabFragment.newInstance(); 46 | case 3: return ConsoleTabFragment.newInstance(); 47 | case 4: return CamTabFragment.newInstance(); 48 | default: return JoggingTabFragment.newInstance(); 49 | } 50 | } 51 | 52 | @Override 53 | public int getCount() {return tabCount; } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/util/GcodePreprocessorUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.util; 23 | 24 | import java.util.regex.Matcher; 25 | import java.util.regex.Pattern; 26 | 27 | public class GcodePreprocessorUtils { 28 | 29 | private static final String EMPTY = ""; 30 | private static final Pattern WHITE_SPACE = Pattern.compile("\\s"); 31 | private static final Pattern COMMENT = Pattern.compile("\\(.*\\)|\\s*;.*|%$"); 32 | private static final Pattern COMMENT_PARSE = Pattern.compile("(?<=\\()[^()]*|(?<=;).*|%"); 33 | 34 | public static String removeWhiteSpace(String command){ 35 | return WHITE_SPACE.matcher(command).replaceAll(EMPTY).toUpperCase(); 36 | } 37 | 38 | public static String parseComment(String command) { 39 | String comment = EMPTY; 40 | 41 | Matcher matcher = COMMENT_PARSE.matcher(command); 42 | if(matcher.find()) comment = matcher.group(0); 43 | return comment; 44 | } 45 | 46 | public static String removeComment(String command) { 47 | return COMMENT.matcher(command).replaceAll(EMPTY); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/in/co/gorest/grblcontroller/util/GrblLookups.java: -------------------------------------------------------------------------------- 1 | /* 2 | * /** 3 | * * Copyright (C) 2017 Grbl Controller Contributors 4 | * * 5 | * * This program is free software; you can redistribute it and/or modify 6 | * * it under the terms of the GNU General Public License as published by 7 | * * the Free Software Foundation; either version 2 of the License, or 8 | * * (at your option) any later version. 9 | * * 10 | * * This program is distributed in the hope that it will be useful, 11 | * * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * * GNU General Public License for more details. 14 | * * 15 | * * You should have received a copy of the GNU General Public License along 16 | * * with this program; if not, write to the Free Software Foundation, Inc., 17 | * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | * * 19 | * 20 | */ 21 | 22 | package in.co.gorest.grblcontroller.util; 23 | 24 | import android.content.Context; 25 | 26 | import java.io.BufferedReader; 27 | import java.io.IOException; 28 | import java.io.InputStreamReader; 29 | import java.util.HashMap; 30 | 31 | public class GrblLookups { 32 | 33 | private final HashMap lookups = new HashMap<>(); 34 | 35 | public GrblLookups(Context context, String prefix) { 36 | String filename = prefix + ".csv"; 37 | 38 | try { 39 | try (BufferedReader br = new BufferedReader( 40 | new InputStreamReader(context.getAssets().open(filename)))) { 41 | String line; 42 | while ((line = br.readLine()) != null) { 43 | String[] parts = line.split(","); 44 | lookups.put(parts[0], parts); 45 | } 46 | } 47 | } catch (IOException ex) { 48 | System.out.println("Unable to load GRBL resources."); 49 | ex.printStackTrace(); 50 | } 51 | } 52 | 53 | public String[] lookup(String idx){ 54 | return lookups.get(idx); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_stat_ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable-hdpi/ic_stat_ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_stat_ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable-ldpi/ic_stat_ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_stat_ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable-mdpi/ic_stat_ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_stat_ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable-xhdpi/ic_stat_ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_stat_ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable-xxhdpi/ic_stat_ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_stat_ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable-xxxhdpi/ic_stat_ic_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_android_black_20dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_android_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_android_black_shortcut_icon_12dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_attach_money_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_battery_unknown_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_bluetooth_connected_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_bug_report_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_cast_connected_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check_circle_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_contact_mail_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_device_hub_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_error_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_filter_tilt_shift_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_folder_open_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_folder_special_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_font_download_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_format_list_numbered_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_help_outline_black_shortcut_icon_12dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_insert_drive_file.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_keyboard_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_live_help_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_notifications_active_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_open_with_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pan_tool_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_power_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_power_settings_new_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_rotate_right_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_applications_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_black_20dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_black_shortcut_icon_12dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_input_hdmi_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_overscan_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share_black_20dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_signal_cellular_connected_no_internet_1_bar_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_signal_cellular_connected_no_internet_2_bar_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_signal_cellular_connected_no_internet_3_bar_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_star_half_black_36dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_stop_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_swap_horizontal_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_timer_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_touch_app_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_usb_black_20dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_usb_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_vibration_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_view_module_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_warning_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/image_placeholder_email_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable/image_placeholder_email_large.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_border_edit_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_logo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/drawable/splash_logo.9.png -------------------------------------------------------------------------------- /app/src/main/res/layout-large/activity_device_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout-large/device_name.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout-large/dialog_input_decimal.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout-large/dialog_input_decimal_signed.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout-large/dialog_input_int.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_device_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_notification_archive.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 30 | 31 | 35 | 36 | 41 | 42 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/res/layout/command_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 21 | 22 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/device_name.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_input_decimal.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_input_decimal_signed.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_input_int.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 19 | 20 | 26 | 27 | 33 | 34 | 41 | 42 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_usb.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 18 | 19 | 25 | 26 | 32 | 33 | 40 | 41 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #d50000 4 | #ff5131 5 | #9b0000 6 | #338a3e 7 | #ffffff 8 | #ffffff 9 | #bdbdbd 10 | #000000 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 17 | 18 | 19 | 23 | 24 | 35 | --> 36 | 37 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/xml/application_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 13 | 16 | 17 | 18 | 22 | 25 | 26 | 27 | 31 | 34 | 35 | 36 | 40 | 43 | 44 | 45 | 50 | 53 | 54 | 55 | 59 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_descriptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 3 | 10 | 14 | 15 | 16 | 17 | 24 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.2.2' 10 | classpath 'com.google.gms:google-services:4.3.14' 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | maven { url "https://jitpack.io" } 19 | maven { url 'https://maven.google.com/' } 20 | 21 | } 22 | } 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } -------------------------------------------------------------------------------- /doc/screenshots/ConsoleTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/ConsoleTab.png -------------------------------------------------------------------------------- /doc/screenshots/DefaultConnectionType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/DefaultConnectionType.png -------------------------------------------------------------------------------- /doc/screenshots/FileSenderTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/FileSenderTab.png -------------------------------------------------------------------------------- /doc/screenshots/G38.3StringProbe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/G38.3StringProbe.png -------------------------------------------------------------------------------- /doc/screenshots/JoggingTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/JoggingTab.png -------------------------------------------------------------------------------- /doc/screenshots/ProbingTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/ProbingTab.png -------------------------------------------------------------------------------- /doc/screenshots/Screenshot_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Screenshot_01.png -------------------------------------------------------------------------------- /doc/screenshots/Screenshot_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Screenshot_02.png -------------------------------------------------------------------------------- /doc/screenshots/Screenshot_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Screenshot_03.png -------------------------------------------------------------------------------- /doc/screenshots/Screenshot_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Screenshot_04.png -------------------------------------------------------------------------------- /doc/screenshots/Screenshot_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Screenshot_05.png -------------------------------------------------------------------------------- /doc/screenshots/Screenshot_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Screenshot_06.png -------------------------------------------------------------------------------- /doc/screenshots/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/Settings.png -------------------------------------------------------------------------------- /doc/screenshots/resized/Screenshot_20171001-090425.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/resized/Screenshot_20171001-090425.png -------------------------------------------------------------------------------- /doc/screenshots/resized/Screenshot_20171001-090440.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/resized/Screenshot_20171001-090440.png -------------------------------------------------------------------------------- /doc/screenshots/resized/Screenshot_20171001-090518.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/resized/Screenshot_20171001-090518.png -------------------------------------------------------------------------------- /doc/screenshots/resized/Screenshot_20171001-090533.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/resized/Screenshot_20171001-090533.png -------------------------------------------------------------------------------- /doc/screenshots/resized/Screenshot_20171001-090549.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/resized/Screenshot_20171001-090549.png -------------------------------------------------------------------------------- /doc/screenshots/resized/Screenshot_20171001-090603.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/screenshots/resized/Screenshot_20171001-090603.png -------------------------------------------------------------------------------- /doc/wiki/ConsoleTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/ConsoleTab.png -------------------------------------------------------------------------------- /doc/wiki/FileSenderTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/FileSenderTab.png -------------------------------------------------------------------------------- /doc/wiki/HC-06_pinout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/HC-06_pinout.jpg -------------------------------------------------------------------------------- /doc/wiki/Hc-06-arduino.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/Hc-06-arduino.jpg -------------------------------------------------------------------------------- /doc/wiki/JogginTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/JogginTab.png -------------------------------------------------------------------------------- /doc/wiki/MachineStatusPanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/MachineStatusPanel.png -------------------------------------------------------------------------------- /doc/wiki/ProbingTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/doc/wiki/ProbingTab.png -------------------------------------------------------------------------------- /doc/wiki/hc_06.ino: -------------------------------------------------------------------------------- 1 | #include 2 | SoftwareSerial hcSerial(10, 11); // RX, TX 3 | 4 | String fromPC = ""; 5 | 6 | void setup() { 7 | Serial.begin(9600); // hardware serial for the USB-PC 8 | hcSerial.begin(9600); // software serial Arduino to HC-06 (9600 is default) 9 | 10 | // print instructions 11 | Serial.println("HC-06 AT Command Programming"); 12 | Serial.println(" -- Command Reference ---"); 13 | Serial.println("AT (simply checks connection)"); 14 | Serial.println("AT+VERSION (sends the firmware verison)"); 15 | Serial.println("AT+NAMExxxxx (to change name to xxxxx"); 16 | Serial.println("AT+PINnnnn (to change password to 4 digit nnnn"); 17 | Serial.println("AT+BAUDn (to change to baud rate #1"); 18 | Serial.println(" BAUD1 = 1200"); 19 | Serial.println(" BAUD2 = 2400"); 20 | Serial.println(" BAUD3 = 4800"); 21 | Serial.println(" BAUD4 = 9600"); 22 | Serial.println(" BAUD5 = 19200"); 23 | Serial.println(" BAUD6 = 38400"); 24 | Serial.println(" BAUD7 = 57600"); 25 | Serial.println(" BAUD8 = 115200"); 26 | } 27 | 28 | void loop() { 29 | // Read from HC-06 30 | if (hcSerial.available()) { 31 | while(hcSerial.available()) { // While there is more to be read, keep reading. 32 | Serial.print((char)hcSerial.read()); 33 | } 34 | } 35 | 36 | // Read from PC 37 | if (Serial.available()){ 38 | delay(10); // 39 | fromPC = (char)Serial.read(); 40 | 41 | if (fromPC == "r" || fromPC == "n") { // don't send carriage returns to HC-06 42 | Serial.println(); // echo it back to the PC 43 | } 44 | else { 45 | hcSerial.print(fromPC); // show the HC-06 responce 46 | Serial.print(fromPC); // echo it back to the PC 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /docs/about-us.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | About Us | Grbl Controller 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 |

About Us

22 |

will be updated soon

23 |
24 |
25 |
26 |
27 | 28 | 35 |
36 | 37 | 38 | 39 | 40 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/css/site.css: -------------------------------------------------------------------------------- 1 | html, body {height: 100%;} 2 | a:focus, button:focus{outline: none !important;} 3 | .wrap {min-height: 100%;height: auto;margin: 0 auto -60px;padding: 0;} 4 | .wrap > .container {padding: 65px 15px 20px;} 5 | .footer {background-color: #000000; padding: 10px 0;} 6 | .text-white{color: #eeeeee;} 7 | .gutter-sm{margin: 5px !important;} .gutter-sm-top{margin-top: 5px !important;} .gutter-sm-right{margin-right: 5px !important;} .gutter-sm-bottom{margin-bottom: 5px !important;} .gutter-sm-left{margin-left: 5px !important;} 8 | .gutter-md{margin: 10px !important;} .gutter-md-top{margin-top: 10px !important;} .gutter-md-right{margin-right: 10px !important;} .gutter-md-bottom{margin-bottom: 10px !important;} .gutter-md-left{margin-left: 10px !important;} 9 | .gutter-lg{margin: 20px !important;} .gutter-lg-top{margin-top: 20px !important;} .gutter-lg-right{margin-right: 20px !important;} .gutter-lg-bottom{margin-bottom: 20px !important;} .gutter-lg-left{margin-left: 20px !important;} 10 | .padding-sm{padding: 5px !important;} .padding-sm-top{padding-top: 5px !important;} .padding-sm-right{padding-right: 5px !important;} .padding-sm-bottom{padding-bottom: 5px !important;} .padding-sm-left{padding-left: 5px !important;} 11 | .padding-md{padding: 10px !important;} .padding-md-top{padding-top: 10px !important;} .padding-md-right{padding-right: 10px !important;} .padding-md-bottom{padding-bottom: 10px !important;} .padding-md-left{padding-left: 10px !important;} 12 | .padding-lg{padding: 20px !important;} .padding-lg-top{padding-top: 20px !important;} .padding-lg-right{padding-right: 20px !important;} .padding-lg-bottom{padding-bottom: 20px !important;} .padding-lg-left{padding-left: 20px !important;} 13 | .tooltip-inner {white-space:nowrap;max-width:none;} 14 | .cursor{cursor: pointer;} 15 | ul, ol{padding: 0; list-style-position: inside;} 16 | ul ol{padding-left: 20px;} 17 | ol ul{padding-left: 20px;} 18 | .fa-rotate-45 {-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);-ms-transform: rotate(45deg);-o-transform: rotate(45deg);transform: rotate(45deg);} 19 | .text-black{color: #000000;} 20 | .fa-vam{vertical-align: middle;} 21 | .fa-18px{font-size: 18px !important;} 22 | .fa-15px{font-size: 15px !important;} 23 | .fa-20px{font-size: 20px !important;} 24 | .fa-25px{font-size: 25px !important;} 25 | .fa-30px{font-size: 30px !important;} 26 | code.btn{color: initial; font-weight: bold; background-color: #ddd;} 27 | code.btn:hover{color: initial; cursor: default;} -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/favicon.ico -------------------------------------------------------------------------------- /docs/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /docs/images/app-front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/app-front.png -------------------------------------------------------------------------------- /docs/images/arduino-bluetooth-connection-hc-05-hc-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/arduino-bluetooth-connection-hc-05-hc-06.png -------------------------------------------------------------------------------- /docs/images/arduino-usb-16u2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/arduino-usb-16u2.jpg -------------------------------------------------------------------------------- /docs/images/bluetooth-hc-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/bluetooth-hc-05.png -------------------------------------------------------------------------------- /docs/images/bluetooth-hc-06 - Copy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/bluetooth-hc-06 - Copy.jpg -------------------------------------------------------------------------------- /docs/images/bluetooth-hc-06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/bluetooth-hc-06.jpg -------------------------------------------------------------------------------- /docs/images/console_and_custom_commands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/console_and_custom_commands.png -------------------------------------------------------------------------------- /docs/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/favicon-32x32.png -------------------------------------------------------------------------------- /docs/images/file_sender_and_overrides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/file_sender_and_overrides.png -------------------------------------------------------------------------------- /docs/images/grbl-controller-play-store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/grbl-controller-play-store.png -------------------------------------------------------------------------------- /docs/images/hc-05-hc-06-pinout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/hc-05-hc-06-pinout.jpg -------------------------------------------------------------------------------- /docs/images/hc-06-arduino-connection-diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/hc-06-arduino-connection-diagram.jpg -------------------------------------------------------------------------------- /docs/images/joggin_step_and_feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/joggin_step_and_feed.png -------------------------------------------------------------------------------- /docs/images/jogging_control_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/jogging_control_panel.png -------------------------------------------------------------------------------- /docs/images/machine_status_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/machine_status_panel.png -------------------------------------------------------------------------------- /docs/images/machine_status_panel_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/machine_status_panel_info.png -------------------------------------------------------------------------------- /docs/images/probing_and_tool_length_offsets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/probing_and_tool_length_offsets.png -------------------------------------------------------------------------------- /docs/images/wiring-diagram-Arduino-Bluetooth-HC-05-on-Uno-Board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/docs/images/wiring-diagram-Arduino-Bluetooth-HC-05-on-Uno-Board.jpg -------------------------------------------------------------------------------- /docs/js/common.js: -------------------------------------------------------------------------------- 1 | jQuery('#siteNavigation').load('navigation.html', function(){ 2 | jQuery("nav.navbar-fixed-top").autoHidingNavbar({animationDuration: 250, showOnUpscroll: true, showOnBottom: false}); 3 | }); 4 | -------------------------------------------------------------------------------- /docs/uploads/hc_05.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | SoftwareSerial BTSerial(10, 11); // RX | TX 4 | 5 | void setup() { 6 | pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode 7 | digitalWrite(9, HIGH); 8 | Serial.begin(9600); 9 | 10 | Serial.print("For Arduino Rx use pin "); 11 | Serial.println(10); 12 | 13 | Serial.print("For Arduino Tx use pin "); 14 | Serial.println(11); 15 | 16 | Serial.println(" -- Command Reference ---"); 17 | Serial.println("To Read use '?', Like AT+PSWD?"); 18 | Serial.println("AT (simply checks connection)"); 19 | Serial.println("AT+VERSION (requests the firmware verison)"); 20 | Serial.println("AT+ROLE=x (0 =Slave role, 1 = Master role, 2 = Slave-Loop role default = 0)"); 21 | Serial.println("AT+NAME=xxxxx (to change name to xxxxx default=HC-05"); 22 | Serial.println("AT+PSWD=nnnn (to change password to 4 digit nnnn default = 1234"); 23 | Serial.println("AT+UART=nnnn,s,p (nnnn=Baud, s=stop bits (0=1, 1=2), p=parity (0=None, 1=Odd, 2=Even)"); 24 | Serial.println("AT+POLAR=a,b (a=PIO8 (LED), b=PIO9 for both 0=low turn on, 1 = high turn on."); 25 | Serial.println("AT+ORGL (reset all parameters to defaults)"); 26 | Serial.println("AT+RESET (restarts the HC-05. Will not be in AT mode afterward unless button held"); 27 | 28 | Serial.println("Enter AT commands:"); 29 | BTSerial.begin(38400); // HC-05 default speed in AT command more 30 | 31 | 32 | 33 | } 34 | 35 | void loop() { 36 | 37 | // Keep reading from HC-05 and send to Arduino Serial Monitor 38 | if (BTSerial.available()) 39 | Serial.write(BTSerial.read()); 40 | 41 | // Keep reading from Arduino Serial Monitor and send to HC-05 42 | if (Serial.available()) 43 | BTSerial.write(Serial.read()); 44 | } 45 | -------------------------------------------------------------------------------- /docs/uploads/hc_06.ino: -------------------------------------------------------------------------------- 1 | #include 2 | SoftwareSerial hcSerial(10, 11); // RX, TX 3 | 4 | String fromPC = ""; 5 | 6 | void setup() { 7 | Serial.begin(9600); // hardware serial for the USB-PC 8 | hcSerial.begin(9600); // software serial Arduino to HC-06 (9600 is default) 9 | 10 | // print instructions 11 | Serial.println("HC-06 AT Command Programming"); 12 | Serial.println(" -- Command Reference ---"); 13 | Serial.println("AT (simply checks connection)"); 14 | Serial.println("AT+VERSION (sends the firmware verison)"); 15 | Serial.println("AT+NAMExxxxx (to change name to xxxxx"); 16 | Serial.println("AT+PINnnnn (to change password to 4 digit nnnn"); 17 | Serial.println("AT+BAUDn (to change to baud rate #1"); 18 | Serial.println(" BAUD1 = 1200"); 19 | Serial.println(" BAUD2 = 2400"); 20 | Serial.println(" BAUD3 = 4800"); 21 | Serial.println(" BAUD4 = 9600"); 22 | Serial.println(" BAUD5 = 19200"); 23 | Serial.println(" BAUD6 = 38400"); 24 | Serial.println(" BAUD7 = 57600"); 25 | Serial.println(" BAUD8 = 115200"); 26 | } 27 | 28 | void loop() { 29 | // Read from HC-06 30 | if (hcSerial.available()) { 31 | while(hcSerial.available()) { // While there is more to be read, keep reading. 32 | Serial.print((char)hcSerial.read()); 33 | } 34 | } 35 | 36 | // Read from PC 37 | if (Serial.available()){ 38 | delay(10); // 39 | fromPC = (char)Serial.read(); 40 | 41 | if (fromPC == "r" || fromPC == "n") { // don't send carriage returns to HC-06 42 | Serial.println(); // echo it back to the PC 43 | } 44 | else { 45 | hcSerial.print(fromPC); // show the HC-06 responce 46 | Serial.print(fromPC); // echo it back to the PC 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /docs/usb-otg-setup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Usb Otg Setup | Grbl Controller 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 |
19 |
20 |

Usb Otg Setup Guide

21 |
22 |

23 | Usb Otg setup is really simple, just plugin the usb cable both sides Arduino and you phone. 24 |

25 |

26 | If the serial chip on the Arduino is supported, then app will immediately brings the connection prompt. 27 | If you are not seeing any prompt, then you may need to update the serial firmware (also known as bootloader) in the Arduiono board. 28 |

29 |
30 |
31 |
32 |
33 | 34 | 41 |
42 | 43 | 44 | 45 | 46 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/version-2.30.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Version 2.30 | Grbl Controller 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 |
19 |
20 |

Version 2.30

21 |

application release notes

22 | 23 |
24 |

Bug Fixes:

25 |
    26 |
  • Go to zero position command not rising Z-Axes if Z is already in zero position of WCO
  • 27 |
  • Jog cancel button sometimes not working (addressed this issue to some extent, it may still occur)
  • 28 |
29 |
30 | 31 |
32 |

New Features:

33 |
    34 |
  • Additional A and B Axis Support (currently there is no way in application to view the position of A and B axis)
  • 35 |
  • Wait for buffer runout before sending any EEPROM access command (uses dwell G4P0 to sync the machine and buffer)
  • 36 |
  • Inbuilt web view implementation for external help links
  • 37 |
38 |
39 | 40 |
41 |
42 |
43 | 44 |
45 |
46 |
47 |
48 |
49 | 50 | 51 | 52 | 53 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeevy/grblcontroller/088497d49e49afe5c5c529bb52552ae216827065/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Dec 22 18:31:24 IST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------