Skip to content

Commit

Permalink
Merge pull request #113 from tecimovic/silabs
Browse files Browse the repository at this point in the history
Silabs
  • Loading branch information
tecimovic committed Mar 2, 2021
2 parents 92ecdcd + acfcb27 commit 742ebb7
Show file tree
Hide file tree
Showing 12 changed files with 398 additions and 228 deletions.
28 changes: 14 additions & 14 deletions docs/make-schema-diagram
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ SVG=zap-schema.svg
echo "Creating schema diagram to ${SVG} from database at ${SQLITE} ..."

if [ ! -s ${SQLITE} ]; then
echo ""
echo "Can't locate ${SQLITE} file. Database file is required to read schema from."
exit
echo ""
echo "Can't locate ${SQLITE} file. Database file is required to read schema from."
exit
fi

# Generate the dot file using the schemacrawler
${SC_BIN} --server sqlite --database=${SQLITE} --command=schema --info-level=standard --output-format=scdot --output-file=zap-schema.dot

if [ ! $? -eq 0 ]; then
echo ""
echo "Error executing schemacrawler from ${SC_BIN}"
echo "Please make sure schemacrawler is properly installed."
echo ""
echo "You can download it from: https://www.schemacrawler.com/"
exit
echo ""
echo "Error executing schemacrawler from ${SC_BIN}"
echo "Please make sure schemacrawler is properly installed."
echo ""
echo "You can download it from: https://www.schemacrawler.com/"
exit
fi

# Fix the background of all HTML tables to white
Expand All @@ -47,15 +47,15 @@ sed -i 's/edge \[/edge\[\n color="black"\n style="bold"/g' zap-schema.dot

# Remove the date stamp, so we don't create unnecessary commits
sed -i '/.*td align=.left..202.*/d' zap-schema.dot
sed -i 's/>generated on/ colspan=\"2\">SQL schema is copyrighted by Silicon Labs./g' zap-schema.dot
sed -i 's/>generated on/ colspan=\"2\">ZAP schema, Copyright (c) 2020 Silicon Labs, released under Apache 2.0 license./g' zap-schema.dot

# Convert the dot to svg using the "dot" tool from graphviz
dot -Tsvg zap-schema.dot -o ${SVG}
if [ ! $? -eq 0 ]; then
echo ""
echo "Error executing 'dot' command from graphviz package."
echo "Please make sure graphviz is installed and on your PATH."
exit
echo ""
echo "Error executing 'dot' command from graphviz package."
echo "Please make sure graphviz is installed and on your PATH."
exit
fi

echo "Diagram created: ${SVG}"
10 changes: 5 additions & 5 deletions docs/zap-schema.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"gen": "node src-script/zap-generate.js --stateDirectory ~/.zap/gen -z ./zcl-builtin/silabs/zcl.json -g ./test/gen-template/zigbee/gen-templates.json -i ./test/resource/three-endpoint-device.zap -o ./tmp",
"gen2": "node src-script/zap-generate.js -z ./zcl-builtin/silabs/zcl.json -g ./test/gen-template/zigbee/gen-templates.json -i ./test/resource/generation-test-file-1.zap -o ./tmp",
"gen3": "node src-script/zap-generate.js --stateDirectory ~/.zap/gen3 -z ./zcl-builtin/dotdot/library.xml -g ./test/gen-template/zigbee/gen-templates.json -i ./test/resource/generation-test-file-1.zap -o ./tmp",
"convert": "node src-script/zap-convert.js ./test/resource/test-light.isc -o ./test/resource/test-light.zap -z ./zcl-builtin/silabs/zcl.json -g test/gen-template/zigbee/gen-templates.json",
"convert": "node src-script/zap-convert.js ./test/resource/test-light.isc -o {basename}.zap -z ./zcl-builtin/silabs/zcl.json -g test/gen-template/zigbee/gen-templates.json",
"gendotdot": "node src-script/zap-generate.js -z ./zcl-builtin/dotdot/library.xml -g ./test/gen-template/dotdot/dotdot-templates.json -o ./tmp",
"analyze": "node src-script/zap-start.js analyze -z ./zcl-builtin/silabs/zcl.json -g ./test/gen-template/zigbee/gen-templates.json ./test/resource/three-endpoint-device.zap -o ./tmp",
"genchip": "node src-script/zap-generate.js --stateDirectory ~/.zap/genchip -z ./zcl-builtin/silabs/zcl.json -g ./test/gen-template/chip/gen-test.json -i ./test/resource/chip/chip_test.zap -o ./tmp",
Expand Down

0 comments on commit 742ebb7

Please sign in to comment.