mirror of https://github.com/rusefi/KiCad-Diff.git
Updated css
Tidied up Kidiff.sh Moved changes fro _wc (working copy) to kidiff.sh Working on Kidiff_wc.sh to support cascading style sheet sheet.css
This commit is contained in:
parent
87ba0f6a91
commit
39b8da545e
279
kidiff.sh
279
kidiff.sh
|
@ -2,87 +2,173 @@
|
||||||
|
|
||||||
# Takes one or two Fossil ref's as arguments and generates visual diffs between them
|
# Takes one or two Fossil ref's as arguments and generates visual diffs between them
|
||||||
# If only one ref specified, generates a diff from that file
|
# If only one ref specified, generates a diff from that file
|
||||||
# If no refs specified, assumes HEAD
|
# If no refs specified, assumes CURRENT
|
||||||
|
|
||||||
|
# TODO Consider moving all formatting to a single, external css file and putting all
|
||||||
|
# created web content into a 'web' directory.
|
||||||
|
|
||||||
|
# TODO Improve 3-pane layout - possible two side by side and comparison image underneath?
|
||||||
|
|
||||||
# TODO Consider moving all formatting to a single external css file.
|
|
||||||
# TODO Improve 3-pane layout - possible two side by side and comparison image underneath.
|
|
||||||
# TODO Add commandline quality option - Quality is dpi. 100 is fast but low quality 300 is a good compromise.
|
|
||||||
# TODO Improve sed removal of the the 'ADDED' 'CHANGED' tags. There is a difference in number of spaces in diffs with
|
|
||||||
# one vs two arguments. Need to match any number of spaces.
|
|
||||||
# Something like tr -d 'CHANGED[:space:]||ADDED[:space:]'
|
|
||||||
# TODO Remove filename from display format i.e 'filename-F_Cu' becomes 'F_Cu'
|
# TODO Remove filename from display format i.e 'filename-F_Cu' becomes 'F_Cu'
|
||||||
|
|
||||||
|
qual="100"
|
||||||
|
# TODO Add command line quality option - Quality is dpi. 100 is fast but low quality
|
||||||
|
# 600 is very detailed. 300 is a good compromise.
|
||||||
|
|
||||||
|
# TODO Add recolour option
|
||||||
|
# 952927
|
||||||
|
# convert F_Cu.png -fill "#952927" -fuzz 75% -opaque "#ffffff" test2.png
|
||||||
|
|
||||||
|
# Remove old plot files
|
||||||
|
rm -r /tmp/svg
|
||||||
|
|
||||||
|
# Set directory for plotting
|
||||||
OUTPUT_DIR="./plots"
|
OUTPUT_DIR="./plots"
|
||||||
# TODO Have added this temprarily to simply remove all the plots prior to generating files.
|
rm -r $OUTPUT_DIR
|
||||||
|
|
||||||
|
# TODO Have added this temporarily to simply remove all the plots prior to generating files.
|
||||||
# Theoretically the script could check if the files have already been generated and then only generate the
|
# Theoretically the script could check if the files have already been generated and then only generate the
|
||||||
# missing files. This would permit multiple diff compares and you could also use an external diff tool like p4merge
|
# missing files. This would permit multiple diff compares and you could also use an external diff tool like p4merge
|
||||||
# but the disadvantage is that the resoultions have to match. It is also more complicated to script
|
# but the disadvantage is that the resoultions have to match. It is also more complicated to script
|
||||||
# Ideally one could request random compares within the web interface and there would
|
# Ideally one could request random compares within the web interface and there would
|
||||||
# be 'on the fly' svg/png creation and diff showing.
|
# be 'on the fly' svg/png creation and diff showing.
|
||||||
|
|
||||||
|
# Try to keep the web components seperate from the images so that the images could be
|
||||||
|
# looked at using a graphical diff viewer like p4merge.
|
||||||
|
# Set directory for web backend
|
||||||
|
WEB_DIR=$OUTPUT_DIR"/web"
|
||||||
|
|
||||||
rm -r $OUTPUT_DIR
|
# TODO Might need to use a more complex strategy to cope with spaces in filename
|
||||||
# Find .kicad_files that differ between commits
|
# using some varient of 'find . -name "*.pro" -print0 | xargs -0'
|
||||||
###############################################
|
|
||||||
|
#################################
|
||||||
|
# Colours to substitute per layer
|
||||||
|
#
|
||||||
|
# Additionally need to add vias, and internal layers.
|
||||||
|
# TODO Parse the pcbnew file to determine which layers are active.
|
||||||
|
|
||||||
|
F_Cu="#952927"
|
||||||
|
B_Cu="#359632"
|
||||||
|
B_Paste="#3DC9C9"
|
||||||
|
F_Paste="#969696"
|
||||||
|
F_SilkS="#339697"
|
||||||
|
B_SilkS="#481649"
|
||||||
|
B_Mask="#943197"
|
||||||
|
F_Mask="#943197"
|
||||||
|
Edge_Cuts="#C9C83B"
|
||||||
|
In1_Cu="#C2C200"
|
||||||
|
In2_Cu="#C200C2"
|
||||||
|
User_Dwgs="#C2C2C2"
|
||||||
|
User_Cmts="#000085"
|
||||||
|
User_Eco1="#008500"
|
||||||
|
User_Eco2="#C2C200"
|
||||||
|
B_Fab="#858585"
|
||||||
|
F_Fab="#C2C200"
|
||||||
|
|
||||||
|
|
||||||
|
# These are the colour definitions for the 'solarised' theme from pcbnew.
|
||||||
|
#ColorPCBLayer_F.Cu=rgb(221, 47, 44)
|
||||||
|
#ColorPCBLayer_In3.Cu=rgba(194, 194, 194, 0.800)
|
||||||
|
#ColorPCBLayer_In4.Cu=rgba(0, 132, 132, 0.800)
|
||||||
|
#ColorPCBLayer_In5.Cu=rgba(0, 132, 0, 0.800)
|
||||||
|
#ColorPCBLayer_In6.Cu=rgba(0, 0, 132, 0.800)
|
||||||
|
#ColorPCBLayer_Margin=rgba(194, 0, 194, 0.800)
|
||||||
|
#ColorPCBLayer_B.CrtYd=rgba(194, 194, 0, 0.800)
|
||||||
|
#ColorPCBLayer_F.CrtYd=rgba(132, 132, 132, 0.800)
|
||||||
|
#ColorTxtFrontEx=rgba(194, 194, 194, 0.800)
|
||||||
|
#ColorTxtBackEx=rgba(0, 0, 132, 0.800)
|
||||||
|
#ColorTxtInvisEx=rgba(132, 132, 132, 0.800)
|
||||||
|
#ColorAnchorEx=rgba(0, 0, 132, 0.800)
|
||||||
|
#ColorPadBackEx=rgba(0, 132, 0, 0.800)
|
||||||
|
#ColorPadFrontEx=rgba(132, 132, 132, 0.800)
|
||||||
|
#ColorViaThruEx=rgba(194, 194, 194, 0.800)
|
||||||
|
#ColorViaBBlindEx=rgba(132, 132, 0, 0.800)
|
||||||
|
#ColorViaMicroEx=rgba(0, 132, 132, 0.800)
|
||||||
|
#ColorNonPlatedEx=rgba(194, 194, 0, 0.800)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#########################################################
|
||||||
|
# Find the .kicad_pcb files that differ between commits #
|
||||||
|
#########################################################
|
||||||
|
|
||||||
|
# Look at number of arguments provided set different variables based on number of Fossil refs
|
||||||
|
#############################################################################################
|
||||||
|
|
||||||
|
# 0. User provided no Fossil references, compare against last Fossil commit
|
||||||
|
|
||||||
## Look at number of arguments provided set different variables based on number of fossil refs
|
|
||||||
## User provided no Fossil references, compare against last Fossil commit
|
|
||||||
qual="300"
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
DIFF_1="current"
|
DIFF_1="current"
|
||||||
DIFF_2=$(fossil info current | grep ^uuid: | sed 's/uuid: //g' | cut -c 1-6)
|
DIFF_2=$(fossil info current | grep ^uuid: | tr -d 'uuid:[:space:]' | cut -c 1-6)
|
||||||
echo $DIFF_2
|
echo $DIFF_2
|
||||||
|
|
||||||
# TODO Might need to use strategy here to cope with spaces in name
|
|
||||||
# using some varient of sh -c {find . -name "*.pro" -print0 | xargs -0 gsed -E -i.bkp 's/update=.*/update=Date/'}
|
|
||||||
CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_2" | grep '.kicad_pcb$' | tr -d 'CHANGED[:space:]||ADDED[:space:]')
|
CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_2" | grep '.kicad_pcb$' | tr -d 'CHANGED[:space:]||ADDED[:space:]')
|
||||||
if [[ -z "$CHANGED_KICAD_FILES" ]]; then echo "No .kicad_pcb files differ" && exit 0; fi
|
if [[ -z "$CHANGED_KICAD_FILES" ]]; then echo "No .kicad_pcb files differ" && exit 0; fi
|
||||||
# Copy all modified kicad_file to $OUTPUT_DIR/current
|
|
||||||
|
# Copy all modified kicad_pcb files to $OUTPUT_DIR/current
|
||||||
|
|
||||||
for k in $CHANGED_KICAD_FILES; do
|
for k in $CHANGED_KICAD_FILES; do
|
||||||
mkdir -p "$OUTPUT_DIR/$DIFF_1"
|
mkdir -p "$OUTPUT_DIR/$DIFF_1"
|
||||||
cp "$k" $OUTPUT_DIR/current
|
cp "$k" $OUTPUT_DIR/current
|
||||||
done
|
done
|
||||||
# Copy the specified Fossil commit kicad_file to $OUTPUT_DIR/$(Fossil ref)
|
|
||||||
|
# Copy the Fossil commit kicad_pcb file to $OUTPUT_DIR/commit uuid
|
||||||
|
|
||||||
for k in $CHANGED_KICAD_FILES; do
|
for k in $CHANGED_KICAD_FILES; do
|
||||||
mkdir -p "$OUTPUT_DIR/$DIFF_2"
|
mkdir -p "$OUTPUT_DIR/$DIFF_2"
|
||||||
echo "Copying $DIFF_2:$k to $OUTPUT_DIR/$DIFF_2/"
|
echo "Copying $DIFF_2:$k to $OUTPUT_DIR/$DIFF_2/"
|
||||||
fossil cat $k -r $DIFF_2 > "$OUTPUT_DIR/$DIFF_2/$(basename $k)"
|
fossil cat $k -r $DIFF_2 > "$OUTPUT_DIR/$DIFF_2/$(basename $k)"
|
||||||
done
|
done
|
||||||
## User provided 1 Fossil reference to compare against current files
|
|
||||||
|
|
||||||
|
# 1. User supplied one Fossil reference to compare against current files
|
||||||
|
|
||||||
elif [ $# -eq 1 ]; then
|
elif [ $# -eq 1 ]; then
|
||||||
DIFF_1="current"
|
DIFF_1="current"
|
||||||
DIFF_2="$1"
|
DIFF_2="$1"
|
||||||
#CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_2" | grep '.kicad_pcb$' | sed 's/^CHANGED //g; s/^ADDED //g')
|
|
||||||
CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_2" | grep '.kicad_pcb$' | tr -d 'CHANGED[:space:]||ADDED[:space:]')
|
CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_2" | grep '.kicad_pcb$' | tr -d 'CHANGED[:space:]||ADDED[:space:]')
|
||||||
if [[ -z "$CHANGED_KICAD_FILES" ]]; then echo "No .kicad_pcb files differ" && exit 0; fi
|
if [[ -z "$CHANGED_KICAD_FILES" ]]; then echo "No .kicad_pcb files differ" && exit 0; fi
|
||||||
|
|
||||||
# Copy all modified kicad_file to $OUTPUT_DIR/current
|
# Copy all modified kicad_file to $OUTPUT_DIR/current
|
||||||
|
|
||||||
for k in $CHANGED_KICAD_FILES; do
|
for k in $CHANGED_KICAD_FILES; do
|
||||||
mkdir -p "$OUTPUT_DIR/$DIFF_1"
|
mkdir -p "$OUTPUT_DIR/$DIFF_1"
|
||||||
cp "$k" $OUTPUT_DIR/current
|
cp "$k" $OUTPUT_DIR/current
|
||||||
done
|
done
|
||||||
|
|
||||||
# Copy the specified Fossil commit kicad_file to $OUTPUT_DIR/$(Fossil ref)
|
# Copy the specified Fossil commit kicad_file to $OUTPUT_DIR/$(Fossil ref)
|
||||||
|
|
||||||
for k in $CHANGED_KICAD_FILES; do
|
for k in $CHANGED_KICAD_FILES; do
|
||||||
mkdir -p "$OUTPUT_DIR/$DIFF_2"
|
mkdir -p "$OUTPUT_DIR/$DIFF_2"
|
||||||
echo "Copying $DIFF_2:$k to $OUTPUT_DIR/$DIFF_2/$k"
|
echo "Copying $DIFF_2:$k to $OUTPUT_DIR/$DIFF_2/$k"
|
||||||
fossil cat $k -r $DIFF_2 > "$OUTPUT_DIR/$DIFF_2/$(basename $k)"
|
fossil cat $k -r $DIFF_2 > "$OUTPUT_DIR/$DIFF_2/$(basename $k)"
|
||||||
done
|
done
|
||||||
## User provided 2 Fossil references to compare
|
|
||||||
|
# 2. User supplied 2 Fossil references to compare
|
||||||
|
|
||||||
elif [ $# -eq 2 ]; then
|
elif [ $# -eq 2 ]; then
|
||||||
DIFF_1="$1"
|
DIFF_1="$1"
|
||||||
DIFF_2="$2"
|
DIFF_2="$2"
|
||||||
CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_1" --to "$DIFF_2" | grep '.kicad_pcb' | tr -d 'CHANGED[:space:]||ADDED[:space:]')
|
CHANGED_KICAD_FILES=$(fossil diff --brief -r "$DIFF_1" --to "$DIFF_2" | grep '.kicad_pcb' | tr -d 'CHANGED[:space:]||ADDED[:space:]')
|
||||||
if [[ -z "$CHANGED_KICAD_FILES" ]]; then echo "No .kicad_pcb files differ" && exit 0; fi
|
if [[ -z "$CHANGED_KICAD_FILES" ]]; then echo "No .kicad_pcb files differ" && exit 0; fi
|
||||||
|
|
||||||
# Copy all modified kicad_file to $OUTPUT_DIR/current
|
# Copy all modified kicad_file to $OUTPUT_DIR/current
|
||||||
|
|
||||||
for k in $CHANGED_KICAD_FILES; do
|
for k in $CHANGED_KICAD_FILES; do
|
||||||
mkdir -p "$OUTPUT_DIR/$DIFF_1"
|
mkdir -p "$OUTPUT_DIR/$DIFF_1"
|
||||||
fossil cat $k -r $DIFF_1 > "$OUTPUT_DIR/$DIFF_1/$(basename $k)"
|
fossil cat $k -r $DIFF_1 > "$OUTPUT_DIR/$DIFF_1/$(basename $k)"
|
||||||
done
|
done
|
||||||
# Copy the specified git commit kicad_file to $OUTPUT_DIR/$(git ref)
|
|
||||||
|
# Copy the specified Fossil commit kicad_file to $OUTPUT_DIR/Fossil uuid
|
||||||
|
|
||||||
for k in $CHANGED_KICAD_FILES; do
|
for k in $CHANGED_KICAD_FILES; do
|
||||||
mkdir -p "$OUTPUT_DIR/$DIFF_2"
|
mkdir -p "$OUTPUT_DIR/$DIFF_2"
|
||||||
echo "Copying $DIFF_2:$k to $OUTPUT_DIR/$DIFF_2/$k"
|
echo "Copying $DIFF_2:$k to $OUTPUT_DIR/$DIFF_2/$k"
|
||||||
fossil cat $k -r $DIFF_2 > "$OUTPUT_DIR/$DIFF_2/$(basename $k)"
|
fossil cat $k -r $DIFF_2 > "$OUTPUT_DIR/$DIFF_2/$(basename $k)"
|
||||||
done
|
done
|
||||||
## User provided too many referencess
|
|
||||||
|
|
||||||
|
# 3. User provided too many references
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Please only provide 1 or 2 arguments: not $#"
|
echo "Please only provide 1 or 2 arguments: not $#"
|
||||||
exit 2
|
exit 2
|
||||||
|
@ -90,12 +176,12 @@ fi
|
||||||
|
|
||||||
echo "Kicad files saved to: '$OUTPUT_DIR/$DIFF_1' and '$OUTPUT_DIR/$DIFF_2'"
|
echo "Kicad files saved to: '$OUTPUT_DIR/$DIFF_1' and '$OUTPUT_DIR/$DIFF_2'"
|
||||||
|
|
||||||
# Generate png files from kicad output
|
# Generate svg files from kicad output
|
||||||
#######################################
|
######################################
|
||||||
#curl -s https://gist.githubusercontent.com/spuder/4a76e42f058ef7b467d9/raw -o /tmp/plot_board.py
|
#
|
||||||
#chmod +x /tmp/plot_board.py
|
# Use the python script 'plot_pcbnew.py' to generate svg files from the two *.kicad_pcb files.
|
||||||
|
# Files are saved in /tmp/svg/COMMIT_ID
|
||||||
#I have found the simplest way to achieve this is to save the files as SVG and use rsvg-conver to produce the .png files
|
#
|
||||||
|
|
||||||
for f in $OUTPUT_DIR/$DIFF_1/*.kicad_pcb; do
|
for f in $OUTPUT_DIR/$DIFF_1/*.kicad_pcb; do
|
||||||
mkdir -p /tmp/svg/$DIFF_1
|
mkdir -p /tmp/svg/$DIFF_1
|
||||||
|
@ -109,46 +195,84 @@ for f in $OUTPUT_DIR/$DIFF_2/*.kicad_pcb; do
|
||||||
/usr/local/bin/plot_pcbnew.py "$f" "/tmp/svg/$DIFF_2"
|
/usr/local/bin/plot_pcbnew.py "$f" "/tmp/svg/$DIFF_2"
|
||||||
done
|
done
|
||||||
|
|
||||||
#TODO Use xargs or parallel to speed up
|
# Convert svg files into png
|
||||||
|
######################################
|
||||||
|
#
|
||||||
|
# Parse the svg files in /tmp/svg/COMMIT_ID using Image Magick.
|
||||||
|
# The conversion trims the image to the active area using the 'trim' function.
|
||||||
|
# Fuzz is probably not nescessary (trim measures the corner pixel value and trims
|
||||||
|
# to the first non-corner coloured pixel. Fuzz allows for minor variation but as this is
|
||||||
|
# a generated svg, pixels should be white.)
|
||||||
|
#
|
||||||
|
# The .png files are created in the output directory.
|
||||||
|
|
||||||
|
|
||||||
for p in /tmp/svg/$DIFF_1/*.svg; do
|
for p in /tmp/svg/$DIFF_1/*.svg; do
|
||||||
d="$(basename $p)"
|
d=$(basename $p)
|
||||||
echo "Converting $p to .png"
|
echo "Converting $p to .png"
|
||||||
#echo "Output_Dir "$OUTPUT_DIR
|
|
||||||
#echo "Diff_1_dir" $DIFF_1
|
|
||||||
#rsvg-convert -z 5 "$p" > "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png"
|
|
||||||
convert -density $qual -fuzz 1% -trim +repage "$p" "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png"
|
convert -density $qual -fuzz 1% -trim +repage "$p" "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png"
|
||||||
|
convert "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png" -negate "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
#TODO Use xargs or parallel to speed up
|
|
||||||
|
|
||||||
for p in /tmp/svg/$DIFF_2/*.svg; do
|
for p in /tmp/svg/$DIFF_2/*.svg; do
|
||||||
d="$(basename $p)"
|
d=$(basename $p)
|
||||||
echo "Converting $p to .png"
|
echo "Converting $p to .png"
|
||||||
# pdftoppm -png -r 600 "$p" "$OUTPUT_DIR/$DIFF_2/${d%%.*}"
|
|
||||||
# rsvg-convert "$p" -d 300 -z 5 > "$OUTPUT_DIR/$DIFF_2/${d%%.*}"
|
|
||||||
# rsvg-convert -z 5 "$p" > "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png"
|
|
||||||
convert -density $qual -fuzz 1% -trim +repage "$p" "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png"
|
convert -density $qual -fuzz 1% -trim +repage "$p" "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png"
|
||||||
|
convert "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png" -negate "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Generate png diffs
|
# Generate png diffs between DIFF_1 and DIFF_2
|
||||||
####################
|
##############################################
|
||||||
#TODO Use xargs or parallel to speed up
|
#
|
||||||
|
# Originally the intention was to use the ImageMagic 'composite stereo 0' function to identify
|
||||||
|
# where items have moved but I could not get this to work.
|
||||||
|
# This flattens the original files to greyscale and they need to be converted
|
||||||
|
# back to rgb in order to be colourised.
|
||||||
|
|
||||||
for g in $OUTPUT_DIR/$DIFF_1/*.png; do
|
for g in $OUTPUT_DIR/$DIFF_1/*.png; do
|
||||||
|
d=$(basename $g)
|
||||||
|
y=${d%.png}
|
||||||
|
layerName=${y##*-}
|
||||||
mkdir -p "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2"
|
mkdir -p "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2"
|
||||||
echo "Generating composite image $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
echo "Generating composite image $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
||||||
#composite -stereo 0 -density 600 $OUTPUT_DIR/$DIFF_1/$(basename $g) $OUTPUT_DIR/$DIFF_2/$(basename $g) $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)
|
convert '(' $OUTPUT_DIR/$DIFF_2/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
||||||
#convert $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g) -trim -density 600 -fill grey -opaque black $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)
|
'(' $OUTPUT_DIR/$DIFF_1/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
||||||
convert '(' $OUTPUT_DIR/$DIFF_1/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
|
||||||
'(' $OUTPUT_DIR/$DIFF_2/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
|
||||||
'(' -clone 0-1 -compose darken -composite ')' \
|
'(' -clone 0-1 -compose darken -composite ')' \
|
||||||
-channel RGB -combine $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)
|
-channel RGB -combine $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)
|
||||||
|
convert "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)" -fill ${!layerName} -fuzz 75% -opaque "#ffffff" "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
||||||
|
done
|
||||||
|
|
||||||
|
for p in $OUTPUT_DIR/$DIFF_1/*.png; do
|
||||||
|
d=$(basename $p)
|
||||||
|
y=${d%.png}
|
||||||
|
layerName=${y##*-}
|
||||||
|
echo "Converting $layerName to .png with colour "${!layerName}
|
||||||
|
convert "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png" -define png:color-type=2 "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png"
|
||||||
|
convert "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png" -fill ${!layerName} -fuzz 75% -opaque "#ffffff" "$OUTPUT_DIR/$DIFF_1/${d%%.*}.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
for p in $OUTPUT_DIR/$DIFF_2/*.png; do
|
||||||
|
d=$(basename $p)
|
||||||
|
y=${d%.png}
|
||||||
|
layerName=${y##*-}
|
||||||
|
echo "Converting $layerName to .png with colour "${!layerName}
|
||||||
|
convert "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png" -define png:color-type=2 "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png"
|
||||||
|
convert "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png" -fill ${!layerName} -fuzz 75% -opaque "#ffffff" "$OUTPUT_DIR/$DIFF_2/${d%%.*}.png"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Setup web directories for web output
|
||||||
|
######################################
|
||||||
|
#
|
||||||
|
# Remove index.html prior to streaming new data
|
||||||
|
# TODO Would be neater to put thumbs, tryptych, index and any .css sheet in a 'web' directory
|
||||||
|
#
|
||||||
|
|
||||||
if [ -e $OUTPUT_DIR/index.html ]
|
if [ -e $OUTPUT_DIR/index.html ]
|
||||||
then echo "An index.html file already exists. Remove it to regenerate"
|
then rm $OUTPUT_DIR/index.html
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d thumbs ]
|
if [ -d thumbs ]
|
||||||
|
@ -161,7 +285,13 @@ if [ -d tryptych ]
|
||||||
else mkdir $OUTPUT_DIR/tryptych && echo "'tryptych' directory created"
|
else mkdir $OUTPUT_DIR/tryptych && echo "'tryptych' directory created"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat >> $OUTPUT_DIR/index.html <<HEAD
|
# Stream HTML <head> and <style> to index.html
|
||||||
|
##############################################
|
||||||
|
#
|
||||||
|
# It would make more sense to stream this to $OUTPUT_DIR/web/style.css
|
||||||
|
# and reuse it in the 'tryptich' section.
|
||||||
|
|
||||||
|
cat >> $OUTPUT_DIR/index.html <<_HEAD_
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -185,7 +315,8 @@ div.gallery img {
|
||||||
div.desc {
|
div.desc {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 25px arial, sans-serif;
|
font: 20px arial, sans-serif;
|
||||||
|
color: #002B36;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
@ -220,33 +351,32 @@ div.desc {
|
||||||
div.desc {
|
div.desc {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
}
|
}
|
||||||
div.desc1 {
|
div.desc1 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
align: middle;
|
align: middle;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
color: #FFFFFF;
|
color: ##002B36;
|
||||||
}
|
}
|
||||||
div.desc2 {
|
div.desc2 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
color: #FFFFFF;
|
color: ##002B36;
|
||||||
}
|
}
|
||||||
div.title {
|
div.title {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font: 30px arial, sans-serif;
|
font: 30px arial, sans-serif;
|
||||||
color: #496075;
|
color: ##002B36;
|
||||||
}
|
}
|
||||||
.box {
|
.box {
|
||||||
float: left;
|
float: left;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
border-radius: 50%;
|
|
||||||
border: 1px solid rgba(0, 0, 0, .2);
|
border: 1px solid rgba(0, 0, 0, .2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,16 +399,12 @@ PCBnew Graphical Diff</div>
|
||||||
|
|
||||||
<div class="box green"></div><div class="desc1">in <b>$DIFF_1</b> and not in <b>$DIFF_2</b></div>
|
<div class="box green"></div><div class="desc1">in <b>$DIFF_1</b> and not in <b>$DIFF_2</b></div>
|
||||||
<div class="box red"></div><div class="desc2">in <b>$DIFF_2</b> and not in <b>$DIFF_1</b></div>
|
<div class="box red"></div><div class="desc2">in <b>$DIFF_2</b> and not in <b>$DIFF_1</b></div>
|
||||||
|
_HEAD_
|
||||||
|
|
||||||
HEAD
|
|
||||||
|
|
||||||
#for g in $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$HTTP/*.png; do
|
#for g in $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$HTTP/*.png; do
|
||||||
for g in $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/*.png; do
|
for g in $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/*.png; do
|
||||||
#convert $g -fuzz 1% -trim +repage $g
|
|
||||||
#convert -resize x250 $(basename $g) thumbs/th_$(basename $g)
|
|
||||||
convert $g
|
|
||||||
cp $g ./plots/thumbs/th_$(basename $g)
|
cp $g ./plots/thumbs/th_$(basename $g)
|
||||||
|
|
||||||
route=$g
|
route=$g
|
||||||
file=${route##*/}
|
file=${route##*/}
|
||||||
base=${file%.*}
|
base=${file%.*}
|
||||||
|
@ -287,7 +413,7 @@ dir=$(dirname $g)
|
||||||
echo $dir
|
echo $dir
|
||||||
|
|
||||||
|
|
||||||
cat >> $OUTPUT_DIR/index.html <<HTML
|
cat >> $OUTPUT_DIR/index.html <<_HTML_
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = tryptych/$(basename $g).html>
|
<a target="_blank" href = tryptych/$(basename $g).html>
|
||||||
|
@ -296,8 +422,9 @@ cat >> $OUTPUT_DIR/index.html <<HTML
|
||||||
<div class="desc">$base</div>
|
<div class="desc">$base</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
HTML
|
_HTML_
|
||||||
#Need to adjsut the width of the TRYPTYCH view so it is bigger (and maybe dif underneath?)
|
|
||||||
|
|
||||||
cat >> $OUTPUT_DIR/tryptych/$(basename $g).html <<HTML
|
cat >> $OUTPUT_DIR/tryptych/$(basename $g).html <<HTML
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
@ -322,26 +449,26 @@ div.gallery img {
|
||||||
div.desc {
|
div.desc {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
div.desc1 {
|
div.desc1 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
background: #43FF01;
|
background: #43FF01;
|
||||||
}
|
}
|
||||||
div.desc2 {
|
div.desc2 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
background: #F40008;
|
background: #F40008;
|
||||||
}
|
}
|
||||||
div.title {
|
div.title {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font: 30px arial, sans-serif;
|
font: 30px arial, sans-serif;
|
||||||
color: #496075;
|
color: #93A1A1;
|
||||||
}
|
}
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -372,13 +499,13 @@ div.title {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<div class="title">$base</div>
|
<div class="title">$base</div>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = $(basename $g).html>
|
<a target="_blank" href = $(basename $g).html>
|
||||||
|
@ -387,6 +514,7 @@ div.title {
|
||||||
<div class="desc1">$DIFF_1</div>
|
<div class="desc1">$DIFF_1</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = $(basename $g).html>
|
<a target="_blank" href = $(basename $g).html>
|
||||||
|
@ -395,6 +523,7 @@ div.title {
|
||||||
<div class="desc">Composite</div>
|
<div class="desc">Composite</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = $(basename $g).html>
|
<a target="_blank" href = $(basename $g).html>
|
||||||
|
@ -404,7 +533,9 @@ div.title {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
HTML
|
HTML
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
cat >>$OUTPUT_DIR/index.html<<FOOT
|
cat >>$OUTPUT_DIR/index.html<<FOOT
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div style="padding:6px;">
|
<div style="padding:6px;">
|
||||||
|
|
60
kidiff_wc.sh
60
kidiff_wc.sh
|
@ -19,17 +19,24 @@ qual="100"
|
||||||
# 952927
|
# 952927
|
||||||
# convert F_Cu.png -fill "#952927" -fuzz 75% -opaque "#ffffff" test2.png
|
# convert F_Cu.png -fill "#952927" -fuzz 75% -opaque "#ffffff" test2.png
|
||||||
|
|
||||||
|
# Remove old plot files
|
||||||
|
rm -r /tmp/svg
|
||||||
|
|
||||||
|
# Set directory for plotting
|
||||||
OUTPUT_DIR="./plots"
|
OUTPUT_DIR="./plots"
|
||||||
rm -r $OUTPUT_DIR
|
rm -r $OUTPUT_DIR
|
||||||
WEB_DIR=$OUTPUT_DIR"/web"
|
|
||||||
# TODO Have added this temprarily to simply remove all the plots prior to generating files.
|
# TODO Have added this temporarily to simply remove all the plots prior to generating files.
|
||||||
# Theoretically the script could check if the files have already been generated and then only generate the
|
# Theoretically the script could check if the files have already been generated and then only generate the
|
||||||
# missing files. This would permit multiple diff compares and you could also use an external diff tool like p4merge
|
# missing files. This would permit multiple diff compares and you could also use an external diff tool like p4merge
|
||||||
# but the disadvantage is that the resoultions have to match. It is also more complicated to script
|
# but the disadvantage is that the resoultions have to match. It is also more complicated to script
|
||||||
# Ideally one could request random compares within the web interface and there would
|
# Ideally one could request random compares within the web interface and there would
|
||||||
# be 'on the fly' svg/png creation and diff showing.
|
# be 'on the fly' svg/png creation and diff showing.
|
||||||
|
|
||||||
# Try to keep the web components seperate from the images so that the images could be
|
# Try to keep the web components seperate from the images so that the images could be
|
||||||
# looked at using a graphical diff viewer like p4merge.
|
# looked at using a graphical diff viewer like p4merge.
|
||||||
|
# Set directory for web backend
|
||||||
|
WEB_DIR=$OUTPUT_DIR"/web"
|
||||||
|
|
||||||
# TODO Might need to use a more complex strategy to cope with spaces in filename
|
# TODO Might need to use a more complex strategy to cope with spaces in filename
|
||||||
# using some varient of 'find . -name "*.pro" -print0 | xargs -0'
|
# using some varient of 'find . -name "*.pro" -print0 | xargs -0'
|
||||||
|
@ -49,35 +56,25 @@ B_SilkS="#481649"
|
||||||
B_Mask="#943197"
|
B_Mask="#943197"
|
||||||
F_Mask="#943197"
|
F_Mask="#943197"
|
||||||
Edge_Cuts="#C9C83B"
|
Edge_Cuts="#C9C83B"
|
||||||
In_1_Cu="#c2c200)"
|
In1_Cu="#C2C200"
|
||||||
In_2_Cu="#c200c2"
|
In2_Cu="#C200C2"
|
||||||
|
User_Dwgs="#C2C2C2"
|
||||||
|
User_Cmts="#000085"
|
||||||
|
User_Eco1="#008500"
|
||||||
|
User_Eco2="#C2C200"
|
||||||
|
B_Fab="#858585"
|
||||||
|
F_Fab="#C2C200"
|
||||||
|
|
||||||
|
|
||||||
#ColorPCBLayer_In1.Cu=rgba(#c2c200, 0.8)
|
# These are the colour definitions for the 'solarised' theme from pcbnew.
|
||||||
#ColorPCBLayer_In2.Cu=rgba(194, 0, 194, 0.800)
|
#ColorPCBLayer_F.Cu=rgb(221, 47, 44)
|
||||||
#ColorPCBLayer_In3.Cu=rgba(194, 194, 194, 0.800)
|
#ColorPCBLayer_In3.Cu=rgba(194, 194, 194, 0.800)
|
||||||
#ColorPCBLayer_In4.Cu=rgba(0, 132, 132, 0.800)
|
#ColorPCBLayer_In4.Cu=rgba(0, 132, 132, 0.800)
|
||||||
#ColorPCBLayer_In5.Cu=rgba(0, 132, 0, 0.800)
|
#ColorPCBLayer_In5.Cu=rgba(0, 132, 0, 0.800)
|
||||||
#ColorPCBLayer_In6.Cu=rgba(0, 0, 132, 0.800)
|
#ColorPCBLayer_In6.Cu=rgba(0, 0, 132, 0.800)
|
||||||
#ColorPCBLayer_B.Cu=rgba(0, 132, 0, 0.800)
|
|
||||||
#ColorPCBLayer_B.Adhes=rgba(0, 0, 132, 0.800)
|
|
||||||
#ColorPCBLayer_F.Adhes=rgba(132, 0, 132, 0.800)
|
|
||||||
#ColorPCBLayer_B.Paste=rgba(0, 194, 194, 0.800)
|
|
||||||
#ColorPCBLayer_F.Paste=rgba(132, 132, 132, 0.800)
|
|
||||||
#ColorPCBLayer_B.SilkS=rgba(132, 0, 132, 0.800)
|
|
||||||
#ColorPCBLayer_F.SilkS=rgba(0, 132, 132, 0.800)
|
|
||||||
#ColorPCBLayer_B.Mask=rgba(132, 132, 0, 0.800)
|
|
||||||
#ColorPCBLayer_F.Mask=rgba(132, 0, 132, 0.800)
|
|
||||||
#ColorPCBLayer_Dwgs.User=rgba(194, 194, 194, 0.800)
|
|
||||||
#ColorPCBLayer_Cmts.User=rgba(0, 0, 132, 0.800)
|
|
||||||
#ColorPCBLayer_Eco1.User=rgba(0, 132, 0, 0.800)
|
|
||||||
#ColorPCBLayer_Eco2.User=rgba(194, 194, 0, 0.800)
|
|
||||||
#ColorPCBLayer_Edge.Cuts=rgba(194, 194, 0, 0.800)
|
|
||||||
#ColorPCBLayer_Margin=rgba(194, 0, 194, 0.800)
|
#ColorPCBLayer_Margin=rgba(194, 0, 194, 0.800)
|
||||||
#ColorPCBLayer_B.CrtYd=rgba(194, 194, 0, 0.800)
|
#ColorPCBLayer_B.CrtYd=rgba(194, 194, 0, 0.800)
|
||||||
#ColorPCBLayer_F.CrtYd=rgba(132, 132, 132, 0.800)
|
#ColorPCBLayer_F.CrtYd=rgba(132, 132, 132, 0.800)
|
||||||
#ColorPCBLayer_B.Fab=rgba(132, 132, 132, 0.800)
|
|
||||||
#ColorPCBLayer_F.Fab=rgba(194, 194, 0, 0.800)
|
|
||||||
#ColorTxtFrontEx=rgba(194, 194, 194, 0.800)
|
#ColorTxtFrontEx=rgba(194, 194, 194, 0.800)
|
||||||
#ColorTxtBackEx=rgba(0, 0, 132, 0.800)
|
#ColorTxtBackEx=rgba(0, 0, 132, 0.800)
|
||||||
#ColorTxtInvisEx=rgba(132, 132, 132, 0.800)
|
#ColorTxtInvisEx=rgba(132, 132, 132, 0.800)
|
||||||
|
@ -88,6 +85,9 @@ In_2_Cu="#c200c2"
|
||||||
#ColorViaBBlindEx=rgba(132, 132, 0, 0.800)
|
#ColorViaBBlindEx=rgba(132, 132, 0, 0.800)
|
||||||
#ColorViaMicroEx=rgba(0, 132, 132, 0.800)
|
#ColorViaMicroEx=rgba(0, 132, 132, 0.800)
|
||||||
#ColorNonPlatedEx=rgba(194, 194, 0, 0.800)
|
#ColorNonPlatedEx=rgba(194, 194, 0, 0.800)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Find the .kicad_pcb files that differ between commits #
|
# Find the .kicad_pcb files that differ between commits #
|
||||||
#########################################################
|
#########################################################
|
||||||
|
@ -229,7 +229,8 @@ done
|
||||||
#
|
#
|
||||||
# Originally the intention was to use the ImageMagic 'composite stereo 0' function to identify
|
# Originally the intention was to use the ImageMagic 'composite stereo 0' function to identify
|
||||||
# where items have moved but I could not get this to work.
|
# where items have moved but I could not get this to work.
|
||||||
# -flatten -grayscale Rec709Luminance
|
# This flattens the original files to greyscale and they need to be converted
|
||||||
|
# back to rgb in order to be colourised.
|
||||||
|
|
||||||
for g in $OUTPUT_DIR/$DIFF_1/*.png; do
|
for g in $OUTPUT_DIR/$DIFF_1/*.png; do
|
||||||
d=$(basename $g)
|
d=$(basename $g)
|
||||||
|
@ -237,8 +238,8 @@ for g in $OUTPUT_DIR/$DIFF_1/*.png; do
|
||||||
layerName=${y##*-}
|
layerName=${y##*-}
|
||||||
mkdir -p "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2"
|
mkdir -p "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2"
|
||||||
echo "Generating composite image $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
echo "Generating composite image $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
||||||
convert '(' $OUTPUT_DIR/$DIFF_1/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
convert '(' $OUTPUT_DIR/$DIFF_2/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
||||||
'(' $OUTPUT_DIR/$DIFF_2/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
'(' $OUTPUT_DIR/$DIFF_1/$(basename $g) -flatten -grayscale Rec709Luminance ')' \
|
||||||
'(' -clone 0-1 -compose darken -composite ')' \
|
'(' -clone 0-1 -compose darken -composite ')' \
|
||||||
-channel RGB -combine $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)
|
-channel RGB -combine $OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)
|
||||||
convert "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)" -fill ${!layerName} -fuzz 75% -opaque "#ffffff" "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
convert "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)" -fill ${!layerName} -fuzz 75% -opaque "#ffffff" "$OUTPUT_DIR/diff-$DIFF_1-$DIFF_2/$(basename $g)"
|
||||||
|
@ -254,7 +255,6 @@ for p in $OUTPUT_DIR/$DIFF_1/*.png; do
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for p in $OUTPUT_DIR/$DIFF_2/*.png; do
|
for p in $OUTPUT_DIR/$DIFF_2/*.png; do
|
||||||
d=$(basename $p)
|
d=$(basename $p)
|
||||||
y=${d%.png}
|
y=${d%.png}
|
||||||
|
@ -297,7 +297,7 @@ cat >> $OUTPUT_DIR/index.html <<_HEAD_
|
||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #002B36;
|
background-color: #a2b1c6;
|
||||||
}
|
}
|
||||||
div.gallery {
|
div.gallery {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
@ -450,14 +450,12 @@ cat >> $OUTPUT_DIR/tryptych/$(basename $g).html <<HTML
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 15px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
color: #93A1A1
|
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
div.desc1 {
|
div.desc1 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 15px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
color: #93A1A1
|
|
||||||
background: #43FF01;
|
background: #43FF01;
|
||||||
}
|
}
|
||||||
div.desc2 {
|
div.desc2 {
|
||||||
|
@ -501,13 +499,13 @@ cat >> $OUTPUT_DIR/tryptych/$(basename $g).html <<HTML
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<div class="title">$base</div>
|
<div class="title">$base</div>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = $(basename $g).html>
|
<a target="_blank" href = $(basename $g).html>
|
||||||
|
@ -516,6 +514,7 @@ cat >> $OUTPUT_DIR/tryptych/$(basename $g).html <<HTML
|
||||||
<div class="desc1">$DIFF_1</div>
|
<div class="desc1">$DIFF_1</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = $(basename $g).html>
|
<a target="_blank" href = $(basename $g).html>
|
||||||
|
@ -524,6 +523,7 @@ cat >> $OUTPUT_DIR/tryptych/$(basename $g).html <<HTML
|
||||||
<div class="desc">Composite</div>
|
<div class="desc">Composite</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="responsive">
|
<div class="responsive">
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
<a target="_blank" href = $(basename $g).html>
|
<a target="_blank" href = $(basename $g).html>
|
||||||
|
|
|
@ -21,9 +21,9 @@ plotDir = filePath
|
||||||
|
|
||||||
popt.SetOutputDirectory(plotDir)
|
popt.SetOutputDirectory(plotDir)
|
||||||
popt.SetPlotFrameRef(False)
|
popt.SetPlotFrameRef(False)
|
||||||
popt.SetLineWidth(pcbnew.FromMM(0.15))
|
popt.SetLineWidth(pcbnew.FromMM(0.1))
|
||||||
popt.SetAutoScale(False)
|
popt.SetAutoScale(False)
|
||||||
popt.SetScale(1)
|
popt.SetScale(2)
|
||||||
popt.SetMirror(False)
|
popt.SetMirror(False)
|
||||||
popt.SetUseGerberAttributes(True)
|
popt.SetUseGerberAttributes(True)
|
||||||
popt.SetExcludeEdgeLayer(False)
|
popt.SetExcludeEdgeLayer(False)
|
||||||
|
@ -48,13 +48,21 @@ layers = [
|
||||||
("B_Mask", pcbnew.B_Mask, "Mask bottom"),
|
("B_Mask", pcbnew.B_Mask, "Mask bottom"),
|
||||||
("F_Mask", pcbnew.F_Mask, "Mask top"),
|
("F_Mask", pcbnew.F_Mask, "Mask top"),
|
||||||
("Edge_Cuts", pcbnew.Edge_Cuts, "Edges"),
|
("Edge_Cuts", pcbnew.Edge_Cuts, "Edges"),
|
||||||
("In_1_Cu", pcbnew.In1_Cu, "Inner1"),
|
("In1_Cu", pcbnew.In1_Cu, "Inner1"),
|
||||||
("In_2_Cu", pcbnew.In2_Cu, "Inner2")
|
("In2_Cu", pcbnew.In2_Cu, "Inner2"),
|
||||||
|
("User_Dwgs", pcbnew.Dwgs_User, "Dwgs_User"),
|
||||||
|
("User_Cmts", pcbnew.Cmts_User, "Comments_User"),
|
||||||
|
("User_Eco1", pcbnew.Eco1_User, "ECO1"),
|
||||||
|
("User_Eco2", pcbnew.Eco2_User, "ECO2"),
|
||||||
|
("B_Fab", pcbnew.B_Fab, "Fab bottom"),
|
||||||
|
("F_Fab", pcbnew.F_Fab, "Fab top"),
|
||||||
]
|
]
|
||||||
# Parse layers - might need more than these!
|
# Parse layers - might need more than these!
|
||||||
# popt.SetColor(COLOR4D(0.050, 0.050, 0.050, 0.1))
|
# popt.SetColor(COLOR4D(0.050, 0.050, 0.050, 0.1))
|
||||||
# Ideally would set colour of layer with the 'SetColor' method which was previosly descibed with colour names
|
# Ideally would set colour of layer with the 'SetColor' method which was
|
||||||
# e.g.popt.SetColor(YELLOW) - this does not work and, although the COLOR4D doesn't cause an error it doesn't work.
|
# previously described with colour names
|
||||||
|
# e.g.popt.SetColor(YELLOW)
|
||||||
|
# this does not work. COLOR4D doesn't cause an error but also doesn't work.
|
||||||
# Nor does setting an integer work.
|
# Nor does setting an integer work.
|
||||||
|
|
||||||
for layer_info in layers:
|
for layer_info in layers:
|
||||||
|
|
61
style.css
61
style.css
|
@ -22,19 +22,20 @@ TODO Need to differentiate the .responsive tag between the index and tryptych vi
|
||||||
div.desc {
|
div.desc {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
div.desc1 {
|
div.desc1 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
background: #43FF01;
|
background: #43FF01;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.desc2 {
|
div.desc2 {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 20px arial, sans-serif;
|
font: 15px arial, sans-serif;
|
||||||
background: #F40008;
|
background: #F40008;
|
||||||
}
|
}
|
||||||
div.title {
|
div.title {
|
||||||
|
@ -43,39 +44,21 @@ TODO Need to differentiate the .responsive tag between the index and tryptych vi
|
||||||
font: 30px arial, sans-serif;
|
font: 30px arial, sans-serif;
|
||||||
color: #496075;
|
color: #496075;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Block for Tryptych
|
||||||
|
|
||||||
.responsive {
|
.responsive {
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
float: left;
|
float: left;
|
||||||
width: 33.332%;
|
width: 33.332%;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@media only screen and (max-width: 700px){
|
|
||||||
.responsive {
|
|
||||||
width: 49.99999%;
|
|
||||||
margin: 6px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 500px){
|
|
||||||
.responsive {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.clearfix:after {
|
|
||||||
content: "";
|
|
||||||
display: table;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.responsive {
|
.responsive {
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
|
@ -102,30 +85,6 @@ TODO Need to differentiate the .responsive tag between the index and tryptych vi
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.desc {
|
|
||||||
padding: 15px;
|
|
||||||
text-align: center;
|
|
||||||
font: 20px arial, sans-serif;
|
|
||||||
}
|
|
||||||
div.desc1 {
|
|
||||||
padding: 15px;
|
|
||||||
text-align: left;
|
|
||||||
align: middle;
|
|
||||||
font: 20px arial, sans-serif;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
div.desc2 {
|
|
||||||
padding: 15px;
|
|
||||||
text-align: left;
|
|
||||||
font: 20px arial, sans-serif;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
div.title {
|
|
||||||
padding: 15px;
|
|
||||||
text-align: left;
|
|
||||||
font: 30px arial, sans-serif;
|
|
||||||
color: #496075;
|
|
||||||
}
|
|
||||||
.box {
|
.box {
|
||||||
float: left;
|
float: left;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
Loading…
Reference in New Issue