Skip to content

Commit

Permalink
Merge pull request #146 from CloudyPadmal/pslab-v6
Browse files Browse the repository at this point in the history
fix: design rules (positioning) in schematic
  • Loading branch information
mariobehling authored Oct 29, 2023
2 parents 1f7324e + 6ef304f commit 853d610
Show file tree
Hide file tree
Showing 53 changed files with 260,153 additions and 491,659 deletions.
87 changes: 39 additions & 48 deletions .github/workflows/hardware-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ jobs:

steps:
- name: Download project files
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install KiCAD
run: |
sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases
sudo add-apt-repository --yes ppa:kicad/kicad-7.0-releases
sudo apt update
sudo apt install --install-recommends kicad -y -qq
Expand All @@ -24,93 +26,82 @@ jobs:
mkdir kicad
cd kicad
wget https://gist.githubusercontent.com/CloudyPadmal/dad9975e02bf39d6a3d2851ca53981cc/raw/0f342a3bba82b1af9789be689e5c00b4ad914015/kicad_common
- name: Install kibot
run: |
wget https://set-soft.github.io/debian/kibot.list
sudo cp kibot.list /etc/apt/sources.list.d/
wget https://set-soft.github.io/debian/kibot.gpg
sudo cp kibot.gpg /etc/apt/
sudo apt-get update
sudo apt install kibot kidiff
- name: Install dependencies
run: |
pip install --no-compile kibot
wget https://github.com/INTI-CMNB/InteractiveHtmlBom/releases/download/v2.3.4-2/interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
sudo dpkg -i interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
pip install pcb-tools image
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
- name: Change Imagemagic Policy
run: sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF"/<policy domain="coder" rights="read|write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml

- name: Update kibot configuration
run: |
commit_id=$(git ls-remote https://github.com/fossasia/pslab-hardware.git refs/heads/pslab-v6 | cut -f 1)
commit_id_escaped=$(sed 's/[&/\]/\\&/g' <<< "$commit_id")
sed -i "s/old: 'HEAD'/old: '$commit_id_escaped'/g" schematics/CI.kibot.yaml
- name: Run build
run: |
cd schematics
kibot -v
sudo kibot -v
- name: Publish PDF schematic
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: schematic-pdf
path: docs/schematics/PSLab.pdf

- name: Publish interactive bill of materials
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: interactive-bom
path: docs/components/InteractiveBoM.html

- name: Publish bill of materials
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: bill-of-materials
path: docs/components/BillOfMaterials.csv

- name: Publish gerbers
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: gerbers
path: output/Gerber/

- name: Publish centroids
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pick-and-place
path: docs/position_files/PositionFile.csv

- name: Electric Rule Check
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: electric-rule-check
path: schematics/PSLab-erc.txt

- name: Design Rule Check
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: design-rule-check
path: schematics/PSLab-drc.txt

- name: Difference
uses: actions/upload-artifact@v3
with:
name: difference
path: |
docs/components/diff_pcb.pdf
docs/components/diff_schematic.pdf
- name: Setup board diff images
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
python3 scripts/pslab_gerber_generator.py
git clone --quiet --branch=diff-img https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY diff-img > /dev/null
cd diff-img
convert -colorspace gray front-layer.png old-front.png
convert -colorspace gray bottom-layer.png old-bottom.png
convert -colorspace gray ground-layer.png old-ground.png
convert -colorspace gray power-layer.png old-power.png
mv ../output/Images/* .
convert -colorspace gray front-layer.png new-front.png
convert -colorspace gray bottom-layer.png new-bottom.png
convert -colorspace gray ground-layer.png new-ground.png
convert -colorspace gray power-layer.png new-power.png
composite -stereo 0 old-front.png new-front.png diff-front.png
composite -stereo 0 old-bottom.png new-bottom.png diff-bottom.png
composite -stereo 0 old-ground.png new-ground.png diff-ground.png
composite -stereo 0 old-power.png new-power.png diff-power.png
mv PSLab.pdf old-PSLab.pdf
cp ../docs/schematics/PSLab.pdf .
pdftoppm old-PSLab.pdf old-PSLab -png -rx 300 -ry 300
pdftoppm PSLab.pdf new-PSLab -png -rx 300 -ry 300
convert -colorspace gray old-PSLab-1.png old-PSLab.png
convert -colorspace gray new-PSLab-1.png new-PSLab.png
composite -stereo 0 old-PSLab.png new-PSLab.png diff-schematic.png
rm -rf old-* new-*
git checkout --orphan temporary
git add .
git commit -m "chore: updating board diff images"
git branch -D diff-img
git branch -m diff-img
git push origin diff-img -f --quiet > /dev/null
82 changes: 37 additions & 45 deletions .github/workflows/pullrequest-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: PSLAB

steps:
- name: Download project files
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install KiCAD
run: |
sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases
sudo add-apt-repository --yes ppa:kicad/kicad-7.0-releases
sudo apt update
sudo apt install --install-recommends kicad -y -qq
Expand All @@ -30,91 +32,81 @@ jobs:
mkdir kicad
cd kicad
wget https://gist.githubusercontent.com/CloudyPadmal/dad9975e02bf39d6a3d2851ca53981cc/raw/0f342a3bba82b1af9789be689e5c00b4ad914015/kicad_common
- name: Install kibot
run: |
wget https://set-soft.github.io/debian/kibot.list
sudo cp kibot.list /etc/apt/sources.list.d/
wget https://set-soft.github.io/debian/kibot.gpg
sudo cp kibot.gpg /etc/apt/
sudo apt-get update
sudo apt install kibot kidiff
- name: Install dependencies
run: |
pip install --no-compile kibot
wget https://github.com/INTI-CMNB/InteractiveHtmlBom/releases/download/v2.3.4-2/interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
sudo dpkg -i interactivehtmlbom.inti-cmnb_2.3.4-2_all.deb
pip install pcb-tools image cloudinary
sudo apt install xvfb recordmydesktop xdotool libmagickwand-dev librsvg2-bin imagemagick poppler-utils
- name: Change Imagemagic Policy
run: sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF"/<policy domain="coder" rights="read|write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml

- name: Update kibot configuration
run: |
commit_id=$(git ls-remote https://github.com/fossasia/pslab-hardware.git refs/heads/pslab-v6 | cut -f 1)
commit_id_escaped=$(sed 's/[&/\]/\\&/g' <<< "$commit_id")
sed -i "s/old: 'HEAD'/old: '$commit_id_escaped'/g" schematics/CI.kibot.yaml
- name: Run build
run: |
cd schematics
kibot -v
sudo kibot -v
- name: Publish PDF schematic
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: schematic-pdf
path: docs/schematics/PSLab.pdf

- name: Publish interactive bill of materials
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: interactive-bom
path: docs/components/InteractiveBoM.html

- name: Publish bill of materials
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: bill-of-materials
path: docs/components/BillOfMaterials.csv

- name: Publish gerbers
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: gerbers
path: output/Gerber/

- name: Publish centroids
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pick-and-place
path: docs/position_files/PositionFile.csv

- name: Electric Rule Check
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: electric-rule-check
path: schematics/PSLab-erc.txt

- name: Design Rule Check
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: design-rule-check
path: schematics/PSLab-drc.txt

- name: Setup board diff images
run: |
python3 scripts/pslab_gerber_generator.py
git clone --quiet --branch=diff-img https://$GITHUB_ACTOR:${{ secrets.PSLAB_KEY }}@github.com/$GITHUB_REPOSITORY diff-img > /dev/null
cd diff-img
convert -colorspace gray front-layer.png old-front.png
convert -colorspace gray bottom-layer.png old-bottom.png
convert -colorspace gray ground-layer.png old-ground.png
convert -colorspace gray power-layer.png old-power.png
mv ../output/Images/* .
convert -colorspace gray front-layer.png new-front.png
convert -colorspace gray bottom-layer.png new-bottom.png
convert -colorspace gray ground-layer.png new-ground.png
convert -colorspace gray power-layer.png new-power.png
composite -stereo 0 old-front.png new-front.png diff-front.png
composite -stereo 0 old-bottom.png new-bottom.png diff-bottom.png
composite -stereo 0 old-ground.png new-ground.png diff-ground.png
composite -stereo 0 old-power.png new-power.png diff-power.png
mv PSLab.pdf old-PSLab.pdf
cp ../docs/schematics/PSLab.pdf .
pdftoppm old-PSLab.pdf old-PSLab -png -rx 300 -ry 300
pdftoppm PSLab.pdf new-PSLab -png -rx 300 -ry 300
convert -colorspace gray old-PSLab-1.png old-PSLab.png
convert -colorspace gray new-PSLab-1.png new-PSLab.png
composite -stereo 0 old-PSLab.png new-PSLab.png diff-schematic.png
rm -rf old-* new-*
- name: Upload board diff images
uses: actions/upload-artifact@v2
- name: Difference
uses: actions/upload-artifact@v3
with:
name: board-diff-images
path: diff-img/diff-*.png
name: difference
path: |
docs/components/diff_pcb.pdf
docs/components/diff_schematic.pdf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _autosave-*
fp-info-cache
*erc.txt
*drc.txt
*.lck

# Netlist files (exported from Eeschema)
*.net
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)

This repository contains the [PSLab](https://pslab.io) hardware design files. PSLab is a tiny pocket science lab that provides an array of test and measurement instruments for doing science and engineering experiments. It can function like an oscilloscope, waveform generator, frequency counter, programmable voltage and current source and also as a data logger. The first version of hardware (v1) was developed by [Jithin B P](https://github.com/jithinbp). Later versions were developed by [Padmal](https://github.com/CloudyPadmal).
This repository contains the [PSLab](https://pslab.io) hardware design files. PSLab is a tiny pocket science lab that provides an array of test and measurement instruments for doing science and engineering experiments. It can function like an oscilloscope, waveform generator, frequency counter, programmable voltage and current source and also as a data logger. The first version of hardware (v1) was developed by [Jithin](https://github.com/jithinbp). Later versions were developed by [Padmal](https://github.com/CloudyPadmal) and [Rafael](https://github.com/RafaelLeeImg).

## PCB Layout
Front Side | Back Side
Expand Down
Loading

0 comments on commit 853d610

Please sign in to comment.