Add spiky layout to protoserve

This commit is contained in:
jaseg 2023-04-26 22:57:14 +02:00
parent 549a33d386
commit 38f766dc42
3 changed files with 18 additions and 1 deletions

View file

@ -473,7 +473,7 @@ class PoweredProto(ObjectGroup):
class SpikyProto(ObjectGroup):
def __init__(self, pitch=None, drill=None, clearance=None, power_pad_dia=None, via_size=None, trace_width=None, unit=MM):
super().__init__(0, 0)
super().__init__(0, 0, unit=unit)
res = importlib.resources.files(package_data)
self.fp_center = kfp.Footprint.load(res.joinpath('center-pad-spikes.kicad_mod').read_text(encoding='utf-8'))

View file

@ -106,6 +106,9 @@ def deserialize(obj, unit):
pattern_dia = mil(float(obj['pattern_dia']))
return pb.PatternProtoArea(2*pitch, 2*pitch, pb.THTFlowerProto(pitch, hole_dia, pattern_dia, unit=unit), unit=unit)
case 'spiky':
return pb.PatternProtoArea(2.54, 2.54, pb.SpikyProto(), unit=unit)
case 'rf':
pitch = float(obj.get('pitch', 2.54))
hole_dia = float(obj['hole_dia'])

View file

@ -363,6 +363,7 @@ input {
<a href="#" data-placeholder="flower"class="double-sided-only">THT Flower area</a>
<a href="#" data-placeholder="powered"class="double-sided-only">Powered THT area</a>
<a href="#" data-placeholder="rf"class="double-sided-only">RF THT area</a>
<a href="#" data-placeholder="spiky"class="double-sided-only">Spiky hybrid area</a>
</div>
</div>
</template>
@ -594,6 +595,19 @@ input {
</div>
</template>
<template id="tpl-g-spiky">
<div data-type="spiky" class="group spiky">
<h4>Spiky hybrid area</h4>
Layout by <a href="https://social.treehouse.systems/@electronic_eel">electroniceel</a> (<a href="https://github.com/electroniceel/protoboard">github</a>)
<span class="content area-controls">(<a href="#" class="area-remove">Remove</a><a href="#" class="area-move">Move</a>)</span>
<label class="proportion">Proportion
<input type="text" name="layout_prop" value="1">
</label>
<h5>Area Settings</h5>
This area has a fixed 100 mil / 2.54 mm pitch.
</div>
</template>
<script>
document.querySelectorAll('.expand').forEach((elem) => {
const checkbox = elem.querySelector(':first-child > input');