Skip to content

Commit

Permalink
i miss type system.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnuda committed Jun 28, 2021
1 parent 07404c9 commit a12904c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 55 deletions.
4 changes: 2 additions & 2 deletions resources/manuform.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ <h3>Keys</h3>
</select>
<label for="keys.inner-column">Inner Index Finger's Column?</label>
<select id="keys.inner-column" name="keys.inner-column">
<option value="normal">Normal</option>
<option value="ergodox">Use inner column (like ergodox)</option>
<option value="normie">Normal</option>
<option value="outie">Use inner column (like ergodox)</option>
<option value="innie">Without</option>
</select>
<label for="keys.hide-last-pinky">
Expand Down
2 changes: 1 addition & 1 deletion resources/public/manuform.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"thumb-count": "six",
"last-row": "full",
"switch-type": "box",
"inner-column": "ergodox",
"inner-column": "outie",
"hide-last-pinky": false
},
"curve": {
Expand Down
105 changes: 53 additions & 52 deletions src/dactyl_keyboard/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -325,64 +325,65 @@
stagger-ring [0 ring-y ring-z]
stagger-pinky [0 pinky-y pinky-z]
misc (get body :misc)
c {:configuration-ncols (get keys :columns 5)
:configuration-nrows (get keys :rows 4)
:configuration-thumb-count (keyword (get keys :thumb-count "six"))
:configuration-last-row-count (keyword (get keys :last-row "two"))
:configuration-switch-type (keyword (get keys :switch-type "box"))
:configuration-use-inner-column? (get keys :inner-column false)
:configuration-hide-last-pinky? (get keys :hide-last-pinky false)

:configuration-alpha (/ pi (get curve :alpha 12))
:configuration-pinky-alpha (/ pi (get curve :pinky-alpha 12))
:configuration-beta (/ pi (get curve :beta 36))
:configuration-centercol (get curve :centercol 4)
:configuration-tenting-angle (/ pi (get curve :tenting 15))
:configuration-rotate-x-angle (/ pi (get curve :rotate-x 15))

:configuration-use-external-holder? (get connector :external false)
:configuration-connector-type (get connector :type :none)
:configuration-use-promicro-usb-hole? (get connector :micro-usb false)

:configuration-thumb-cluster-offset-x (get form :thumb-cluster-offset-x 6)
:configuration-thumb-cluster-offset-y (get form :thumb-cluster-offset-y -3)
:configuration-thumb-cluster-offset-z (get form :thumb-cluster-offset-z 7)
:configuration-custom-thumb-cluster? (get form :custom-thumb-cluster false)
:configuration-thumb-top-right-tenting-x (/ pi (get form :thumb-tenting-x 10))
:configuration-thumb-top-right-tenting-y (/ pi (get form :thumb-tenting-y -4))
:configuration-thumb-top-right-tenting-z (/ pi (get form :thumb-tenting-z 10))
:configuration-thumb-top-right-offset-x (get form :thumb-top-right-offset-x -15)
:configuration-thumb-top-right-offset-y (get form :thumb-top-right-offset-y -10)
:configuration-thumb-top-right-offset-z (get form :thumb-top-right-offset-z 5)
:configuration-thumb-top-left-tenting-x (/ pi (get form :thumb-top-left-tenting-x 10))
:configuration-thumb-top-left-tenting-y (/ pi (get form :thumb-top-left-tenting-y -4))
:configuration-thumb-top-left-tenting-z (/ pi (get form :thumb-top-left-tenting-z 10))
:configuration-thumb-top-left-offset-x (get form :thumb-top-left-offset-x -35)
:configuration-thumb-top-left-offset-y (get form :thumb-top-left-offset-y -16)
:configuration-thumb-top-left-offset-z (get form :thumb-top-left-offset-z 2)
c {:configuration-ncols (get keys :columns 5)
:configuration-nrows (get keys :rows 4)
:configuration-thumb-count (keyword (get keys :thumb-count "six"))
:configuration-last-row-count (keyword (get keys :last-row "two"))
:configuration-switch-type (keyword (get keys :switch-type "box"))
:configuration-inner-column (keyword (get keys :inner-column "normie"))
:configuration-hide-last-pinky? (get keys :hide-last-pinky false)

:configuration-alpha (/ pi (get curve :alpha 12))
:configuration-pinky-alpha (/ pi (get curve :pinky-alpha 12))
:configuration-beta (/ pi (get curve :beta 36))
:configuration-centercol (get curve :centercol 4)
:configuration-tenting-angle (/ pi (get curve :tenting 15))
:configuration-rotate-x-angle (/ pi (get curve :rotate-x 15))

:configuration-use-external-holder? (get connector :external false)
:configuration-connector-type (get connector :type :none)
:configuration-use-promicro-usb-hole? (get connector :micro-usb false)

:configuration-thumb-cluster-offset-x (get form :thumb-cluster-offset-x 6)
:configuration-thumb-cluster-offset-y (get form :thumb-cluster-offset-y -3)
:configuration-thumb-cluster-offset-z (get form :thumb-cluster-offset-z 7)
:configuration-custom-thumb-cluster? (get form :custom-thumb-cluster false)
:configuration-thumb-top-right-tenting-x (/ pi (get form :thumb-tenting-x 10))
:configuration-thumb-top-right-tenting-y (/ pi (get form :thumb-tenting-y -4))
:configuration-thumb-top-right-tenting-z (/ pi (get form :thumb-tenting-z 10))
:configuration-thumb-top-right-offset-x (get form :thumb-top-right-offset-x -15)
:configuration-thumb-top-right-offset-y (get form :thumb-top-right-offset-y -10)
:configuration-thumb-top-right-offset-z (get form :thumb-top-right-offset-z 5)
:configuration-thumb-top-left-tenting-x (/ pi (get form :thumb-top-left-tenting-x 10))
:configuration-thumb-top-left-tenting-y (/ pi (get form :thumb-top-left-tenting-y -4))
:configuration-thumb-top-left-tenting-z (/ pi (get form :thumb-top-left-tenting-z 10))
:configuration-thumb-top-left-offset-x (get form :thumb-top-left-offset-x -35)
:configuration-thumb-top-left-offset-y (get form :thumb-top-left-offset-y -16)
:configuration-thumb-top-left-offset-z (get form :thumb-top-left-offset-z 2)
:configuration-thumb-middle-left-tenting-x (/ pi (get form :thumb-middle-left-tenting-x 10))
:configuration-thumb-middle-left-tenting-y (/ pi (get form :thumb-middle-left-tenting-y -4))
:configuration-thumb-middle-left-tenting-z (/ pi (get form :thumb-middle-left-tenting-z 10))
:configuration-thumb-middle-left-offset-x (get form :thumb-middle-left-offset-x -35)
:configuration-thumb-middle-left-offset-y (get form :thumb-middle-left-offset-y -16)
:configuration-thumb-middle-left-offset-z (get form :thumb-middle-left-offset-z 2)
:configuration-use-hotswap? (get form :hotswap false)
:configuration-stagger? (get form :stagger true)
:configuration-stagger-index stagger-index
:configuration-stagger-middle stagger-middle
:configuration-stagger-ring stagger-ring
:configuration-stagger-pinky stagger-pinky
:configuration-use-wide-pinky? (get form :wide-pinky false)
:configuration-z-offset (get form :height-offset 4)
:configuration-use-wire-post? (get form :wire-post false)
:configuration-use-screw-inserts? (get form :screw-inserts false)

:configuration-show-caps? (get misc :keycaps false)
:configuration-plate-projection? (not (get misc :case true))}
:configuration-thumb-middle-left-offset-x (get form :thumb-middle-left-offset-x -35)
:configuration-thumb-middle-left-offset-y (get form :thumb-middle-left-offset-y -16)
:configuration-thumb-middle-left-offset-z (get form :thumb-middle-left-offset-z 2)
:configuration-use-hotswap? (get form :hotswap false)
:configuration-stagger? (get form :stagger true)
:configuration-stagger-index stagger-index
:configuration-stagger-middle stagger-middle
:configuration-stagger-ring stagger-ring
:configuration-stagger-pinky stagger-pinky
:configuration-use-wide-pinky? (get form :wide-pinky false)
:configuration-z-offset (get form :height-offset 4)
:configuration-use-wire-post? (get form :wire-post false)
:configuration-use-screw-inserts? (get form :screw-inserts false)

:configuration-show-caps? (get misc :keycaps false)
:configuration-plate-projection? (not (get misc :case true))}
generated-scad (g/generate-case-dm c (get misc :right-side true))]
{:status 200
:headers {"Content-Type" "application/octet-stream"
"Content-Disposition" "inline; filename=\"manuform-" (current-time) ".scad\""}
"Content-Disposition" "inline; filename=\"manuform-"
(current-time) ".scad\""}
:body generated-scad}))

(defn api-generate-lightcycle [{body :body}]
Expand Down

0 comments on commit a12904c

Please sign in to comment.