diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000000..2a922f02bf4f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,82 @@ +default: + image: python:2.7.18-slim-buster + tags: + - linux + +stages: # List of stages for jobs, and their order of execution + - build + - deploy + +workflow: + rules: + - if: $CI_COMMIT_TAG + when: never + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) + +build-job: # This job runs in the build stage, which runs first. + stage: build + before_script: + - apt-get update + - apt-get install -y git curl + script: + - ./scripts/ci-install.sh + - ./ci_build/python-env/bin/pip freeze --all > requirements.txt + - pip download -r requirements.txt -d packages --python-version 27 --platform manylinux2014 --no-deps + - ./scripts/ci-build-stereotech.sh + - ./ci_build/python-env/bin/python ./klippy/chelper/__init__.py + - mkdir dist + - cp -R ./klippy/. ./dist/klippy + - cp -R ./stereotech_config/. ./dist/config + - cp -R ./ci_build/firmware/. ./dist/firmware + - cp -R ./packages/. ./dist/packages + - cp ./requirements.txt ./dist/requirements.txt + - tar -cvjf klipper.tar.bz2 -C dist . + artifacts: + name: klipper + paths: + - "klipper.tar.bz2" + expire_in: 7 days + +test-job: + stage: build + before_script: + - apt-get update + - apt-get install -y git curl + script: + - ./scripts/ci-install.sh + - ./scripts/ci-build.sh 2>&1 + artifacts: + name: data-dict + paths: + - "ci_build/dict" + expire_in: 7 days + +deploy_job: + stage: deploy + needs: + - build-job + - test-job + variables: + RELEASE_TYPE: testing + rules: + - if: $CI_COMMIT_BRANCH == "master" + variables: + RELEASE_TYPE: "stable" + - if: $CI_PIPELINE_SOURCE == "push" + before_script: + - pip install awscli + script: + - aws s3 --endpoint-url=https://storage.yandexcloud.net cp klipper.tar.bz2 s3://${BUCKET_NAME}/firmware_v5/${RELEASE_TYPE}/ --acl public-read + - touch klipper.sha + - echo "$CI_COMMIT_SHA" >> ./klipper.sha + - aws s3 --endpoint-url=https://storage.yandexcloud.net cp klipper.sha s3://${BUCKET_NAME}/firmware_v5/${RELEASE_TYPE}/ --acl public-read + +trigger_job: + stage: deploy + rules: + - if: $CI_COMMIT_BRANCH == "develop" && $CI_PIPELINE_SOURCE == "push" + needs: + - deploy_job + trigger: + project: stereotech/steapp/STE-App-Build diff --git a/.gitlab/.gitkeep b/.gitlab/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/scripts/ci-install.sh b/scripts/ci-install.sh index 606dd073551d..a69de7c60bdc 100755 --- a/scripts/ci-install.sh +++ b/scripts/ci-install.sh @@ -15,12 +15,11 @@ mkdir -p ${BUILD_DIR} ${CACHE_DIR} # Install system dependencies ###################################################################### echo -e "\n\n=============== Install system dependencies\n\n" -sudo apt-get update PKGS="virtualenv python2-dev libffi-dev build-essential" PKGS="${PKGS} gcc-avr avr-libc" PKGS="${PKGS} libnewlib-arm-none-eabi gcc-arm-none-eabi binutils-arm-none-eabi" PKGS="${PKGS} pv libmpfr-dev libgmp-dev libmpc-dev texinfo bison flex" -sudo apt-get install ${PKGS} +apt-get install -y ${PKGS} ###################################################################### diff --git a/stereotech_config/calibrate/probe_5d.cfg b/stereotech_config/calibrate/probe_5d.cfg index 14f368ade293..818b80112861 100644 --- a/stereotech_config/calibrate/probe_5d.cfg +++ b/stereotech_config/calibrate/probe_5d.cfg @@ -1,6 +1,7 @@ [gcode_macro PROBE_TEMPLATE_POINT] description: Macro for calibration template probing variable_a_probe_z: 0.0 +variable_a_probe_y: 0.0 variable_a_v_probe_z: 0.0 gcode: {% set point = params.POINT|default('A_Z') %} @@ -8,9 +9,10 @@ gcode: {% set probe_a_horizontal = printer["gcode_macro CONSTANTS"].probe_a_horizontal %} {% set probe_a_vertical = printer["gcode_macro CONSTANTS"].probe_a_vertical %} {% set whitelist = ['A_Z', 'B_Z', 'C_Y', 'D_Y'] %} + {% set a_y = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_y if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_y > 0 else probe_a_horizontal[1] %} {% set a_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z > 0 else probe_a_horizontal[2] + offsets[2] %} {% set a_v_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z > 0 else probe_a_vertical[2] + offsets[2] %} - {% set a = [probe_a_horizontal[0] - offsets[0], probe_a_horizontal[1] - offsets[1], a_z] %} + {% set a = [probe_a_horizontal[0] - offsets[0], a_y - offsets[1], a_z] %} {% set a_v = [probe_a_vertical[0] - offsets[0], probe_a_vertical[1] - offsets[1], a_v_z] %} {% set max_y = printer.toolhead.axis_maximum[1]|float %} #{% set whitelist = ['A_Z', 'A_Z_A0', 'A_Z_A90', 'A_X', 'A_Y', 'A_MX', 'A_MY', 'A_Z_A90', 'A_X_A90', 'A_MX_A90'] %} @@ -74,8 +76,8 @@ gcode: {% set axis = 'Y' %} {% endif %} #{% endif %} - {% if target_y|float > (max_y - 4.3) %} - {% set target_y = max_y - 5.5 %} + {% if target_y|float > (max_y - 6.3) %} + {% set target_y = max_y - 6.3 %} # 294 {% endif %} G0 Z{safe_distance_z} F3600 G0 A0 C0 F3600 diff --git a/stereotech_config/calibrate/probe_5d_template.cfg b/stereotech_config/calibrate/probe_5d_template.cfg index e6179bfd9e44..a8d42f7ff318 100644 --- a/stereotech_config/calibrate/probe_5d_template.cfg +++ b/stereotech_config/calibrate/probe_5d_template.cfg @@ -142,3 +142,16 @@ gcode: PROBE_TEMPLATE_POINT POINT=D_Y_A90 SET_POINT MACRO=SAVE_SKEW_POINT POINT=3 CHECK_ACCURACY_SET_MODULE_FIVE_D + +[gcode_macro GET_APPROXIMATE_Y] +description: calculate approximate wcs_1_y +gcode: + {% set distance = 55 %} # distance between points C and A + {% set x1 = printer.auto_wcs.points[2][0] %} + {% set x2 = printer.auto_wcs.points[3][0] %} + {% set wcs_1_x = (x1 + x2) / 2.0 %} + {% set probe_backlash_x = (x2 - (wcs_1_x + distance))|abs %} + {% set point_y = printer.auto_wcs.points[1][1] %} + {% set template_width = 10.0 %} + {% set wcs_1_y = point_y - probe_backlash_x + (template_width / 2.0) %} + SET_GCODE_VARIABLE MACRO=PROBE_TEMPLATE_POINT VARIABLE=a_probe_y VALUE={wcs_1_y} diff --git a/stereotech_config/calibrate/probe_v2.cfg b/stereotech_config/calibrate/probe_v2.cfg index 6a9d5ba4fc25..8cb4d2ef1cf1 100644 --- a/stereotech_config/calibrate/probe_v2.cfg +++ b/stereotech_config/calibrate/probe_v2.cfg @@ -2,26 +2,34 @@ description: macro do move for measuring and calculated WCS. Sensor DAC_v_2 gcode: {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} + # wcs_1_z PROBE_TEMPLATE_POINT POINT=A_Z SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 - PROBE_TEMPLATE_POINT POINT=B_MY_A0_C30 - SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=7 - PROBE_TEMPLATE_POINT POINT=B_Y_A0_C30 - SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + # wcs_1_x PROBE_TEMPLATE_POINT POINT=C_X SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=2 PROBE_TEMPLATE_POINT POINT=D_MX SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=3 + # wcs_1_y + PROBE_TEMPLATE_POINT POINT=B_Y_A0_C30 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + GET_APPROXIMATE_Y # calculate approximate wcs_1_y + PROBE_TEMPLATE_POINT POINT=B_MY_A0_C30 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=7 + # wcs_2_z PROBE_TEMPLATE_POINT POINT=A_Z_A90 SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=4 + # wcs_2_y PROBE_TEMPLATE_POINT POINT=B_Y_A90_C60 SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=5 PROBE_TEMPLATE_POINT POINT=B_MY_A90_C60 SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=6 + # wcs_2_x PROBE_TEMPLATE_POINT POINT=D_MX_A90 SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=8 PROBE_TEMPLATE_POINT POINT=C_X_A90 SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=9 + # calculating wcs {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} {% set auto_wcs_adj = printer.save_variables.variables.auto_wcs_adj|default(0.0)|float %} CALC_WCS_PARAMS THICKNESS={ template_thickness } ADJUSTMENT={ auto_wcs_adj } SENSOR_VERSION=1