Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 96cf9aeaa2 | |||
|
|
7ec7ebda8a | ||
|
|
9d2a8d31e7 | ||
|
|
dc3c3937b7 | ||
|
|
f5665ed0f2 | ||
| 813ee3723c |
22 changed files with 240486 additions and 30 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -28,3 +28,6 @@ target/
|
|||
# Ignore KiCad backups and lock files
|
||||
hardware/c_its-companion/c_its-companion-backups/
|
||||
*.kicad_pro.lck
|
||||
|
||||
# Ignore FreeCAD backups
|
||||
*.FCBak
|
||||
|
|
|
|||
28
Readme.md
28
Readme.md
|
|
@ -120,6 +120,24 @@ The unit tests in this project are meant to be run on the host:
|
|||
cargo test --target host-tuple --bin test --no-default-features -F std,spat
|
||||
```
|
||||
|
||||
## PCB and Housing
|
||||
A simple PCB to combine the u-blox SAM-M10Q, a XIAO ESP32-C5 and the screen can be found in [hardware/c_its-companion/](./hardware/c_its-companion/) including finished gerber files.
|
||||
Additional hardware:
|
||||
|
||||
- SMD Pin-Header 8 pos.: Amphenol 10129380-908001BLF
|
||||
- Snap-in stand-off 8mm: WE 702910000
|
||||
|
||||
(You may try to put the display lower with header Samtech TSM-108-04-T-SV and stand-off WE 702917000, but antenna needs to be plugged in before putting the display on then.)
|
||||
|
||||
The housing is a FreeCAD model at [hardware/housing/c_its-companion-housing.FCStd](./hardware/housing/c_its-companion-housing.FCStd), but the same folder also contains finished 3mf models that can be loaded into a 3D printer slicer.
|
||||
Exports are available for:
|
||||
|
||||
- 2mm: no battery (just display standoffs)
|
||||
- 7mm: EREMIT 654060 (6.5x40x60 mm) LiPo battery
|
||||
- 9mm: Some 9x40x60 mm LiPo battery, e.g. LP803860 (2000 mAh)
|
||||
|
||||
The display is expected to be soldered to the pin header directly to save height.
|
||||
|
||||
## Tips and Tricks
|
||||
|
||||
### Create TGA Assets
|
||||
|
|
@ -130,5 +148,13 @@ You can convert them using [ImageMagick](https://imagemagick.org) like this:
|
|||
# resize to 25px height, adding a black background to the white symbol and vice versa
|
||||
magick Sinnbild_Radfahrer_StVO_1992-200px-white.png -resize x25 -background black -alpha background -flatten -alpha off -verbose Sinnbild_Radfahrer_StVO_1992-25px-white.tga
|
||||
magick Sinnbild_Radfahrer_StVO_1992-200px-black.png -resize x25 -background white -alpha background -flatten -alpha off -verbose Sinnbild_Radfahrer_StVO_1992-25px-black.tga
|
||||
```
|
||||
|
||||
magick Stationary_Emergency_Vehicle_Dreieck_Rot.png -resize 200 -background black -alpha background -flatten -alpha off -verbose Stationary_Emergency_Vehicle_Dreieck_Rot-200px.tga
|
||||
magick Stationary_Vehicle_Dreieck_Rot.png -resize 200 -background black -alpha background -flatten -alpha off -verbose Stationary_Vehicle_Dreieck_Rot-200px.tga
|
||||
magick Work_Zone_Dreieck_Rot.png -resize 200 -background black -alpha background -flatten -alpha off -verbose Work_Zone_Dreieck_Rot-200px.tga
|
||||
|
||||
magick Dreieck_Rot-300x240.png -resize 200 -background black -alpha background -flatten -alpha off -verbose Dreieck_Rot-200px.tga
|
||||
magick Stationary_Emergency_Vehicle-140x105.svg -resize 70 -background black -alpha background -flatten -alpha off -verbose Stationary_Emergency_Vehicle-70px.tga
|
||||
magick Stationary_Vehicle-140x70.svg -resize 80 -background black -alpha background -flatten -alpha off -verbose Stationary_Vehicle-80px.tga
|
||||
magick Work_Zone-140x95.svg -resize 80 -background black -alpha background -flatten -alpha off -verbose Work_Zone-80px.tga
|
||||
```
|
||||
|
|
|
|||
38
graphics/Stationary_Emergency_Vehicle-140x105.svg
Normal file
38
graphics/Stationary_Emergency_Vehicle-140x105.svg
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 140 105" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(0.8551,0,0,0.8551,12.5273,9.81292)">
|
||||
<g transform="matrix(1,0,0,1,-80,-100)">
|
||||
<path d="M124.75,104.64L139.96,104.64L139.96,114.39L115,114.39C115,109.01 119.37,104.64 124.75,104.64Z" style="fill:rgb(6,42,56);fill-rule:nonzero;"/>
|
||||
<g transform="matrix(-1,7.65714e-16,-7.65714e-16,-1,334.84,219.02)">
|
||||
<path d="M154.94,104.64L179.9,104.64L179.9,114.39L164.69,114.39C159.31,114.39 154.94,110.02 154.94,104.64Z" style="fill:rgb(6,42,56);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<rect x="143.29" y="104.64" width="8.32" height="9.75" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-80,-100)">
|
||||
<g transform="matrix(0.707107,-0.707107,0.707107,0.707107,-35.6,105.1)">
|
||||
<path d="M111.13,89.64C111.13,88.503 110.207,87.58 109.07,87.58C107.933,87.58 107.01,88.503 107.01,89.64L107.01,101.42C107.01,102.557 107.933,103.48 109.07,103.48C110.207,103.48 111.13,102.557 111.13,101.42L111.13,89.64Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.202616,-0.979258,0.979258,0.202616,-25.44,186.41)">
|
||||
<path d="M103.82,102.94C103.82,101.803 102.897,100.88 101.76,100.88C100.623,100.88 99.7,101.803 99.7,102.94L99.7,114.72C99.7,115.857 100.623,116.78 101.76,116.78C102.897,116.78 103.82,115.857 103.82,114.72L103.82,102.94Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.474856,-0.880063,0.880063,0.474856,-34.67,142.49)">
|
||||
<path d="M104.12,91.58C104.12,90.443 103.197,89.52 102.06,89.52C100.923,89.52 100,90.443 100,91.58L100,109.01C100,110.147 100.923,111.07 102.06,111.07C103.197,111.07 104.12,110.147 104.12,109.01L104.12,91.58Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-80,-100)">
|
||||
<g transform="matrix(-0.707107,-0.707107,0.707107,-0.707107,248.85,293.42)">
|
||||
<path d="M187.25,89.28C187.25,88.143 186.327,87.22 185.19,87.22C184.053,87.22 183.13,88.143 183.13,89.28L183.13,101.06C183.13,102.197 184.053,103.12 185.19,103.12C186.327,103.12 187.25,102.197 187.25,101.06L187.25,89.28Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.202616,-0.979258,0.979258,-0.202616,125.31,318.97)">
|
||||
<path d="M194.57,102.58C194.57,101.443 193.647,100.52 192.51,100.52C191.373,100.52 190.45,101.443 190.45,102.58L190.45,114.36C190.45,115.497 191.373,116.42 192.51,116.42C193.647,116.42 194.57,115.497 194.57,114.36L194.57,102.58Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
<g transform="matrix(-0.474856,-0.880063,0.880063,-0.474856,195.52,316.54)">
|
||||
<path d="M194.27,91.22C194.27,90.083 193.347,89.16 192.21,89.16C191.073,89.16 190.15,90.083 190.15,91.22L190.15,108.65C190.15,109.787 191.073,110.71 192.21,110.71C193.347,110.71 194.27,109.787 194.27,108.65L194.27,91.22Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-80,-100)">
|
||||
<path d="M228.44,151.07L227.96,149.49C227.29,147.32 225,146.11 222.84,146.77L212.64,149.89C208.96,142.35 205.28,134.8 201.6,127.26C198.6,121.1 192.16,117.17 185.09,117.17L108.38,117.17C104.65,117.17 101.1,118.26 98.14,120.2C95.44,121.96 93.23,124.42 91.82,127.38C90.32,130.52 88.82,133.67 87.31,136.81C86.19,139.15 85.08,141.49 83.96,143.83C83.01,145.81 82.06,147.8 81.11,149.78L71.28,146.78C69.11,146.11 66.82,147.33 66.16,149.5L65.68,151.08C64.47,155.03 66.69,159.2 70.64,160.41L77.53,162.52L77.53,202.19C77.53,207 81.58,210.89 86.58,210.89L94.57,210.89C99.57,210.89 103.62,207 103.62,202.19L103.62,191.17L190.15,191.17L190.15,202.19C190.15,207 194.2,210.89 199.2,210.89L207.2,210.89C212.19,210.89 216.25,207 216.25,202.19L216.25,162.62L223.49,160.41C227.44,159.2 229.66,155.02 228.45,151.08L228.44,151.07ZM91.82,143.83C93.01,141.49 94.2,139.15 95.39,136.81C96.02,135.58 96.65,134.34 97.28,133.11C99.32,129.1 103.56,126.56 108.2,126.56L184.62,126.56C189.09,126.56 193.2,128.92 195.33,132.71C199.14,139.5 202.94,146.29 206.75,153.08L87.11,153.08C88.68,150 90.25,146.92 91.82,143.84L91.82,143.83ZM207.8,182.49L85.79,182.49L85.79,168.94L96.55,168.94C99.62,168.94 102.53,167.58 104.42,165.25C105.31,164.16 106.2,163.06 107.1,161.96L186.75,161.96C187.61,163.06 188.46,164.17 189.32,165.27C191.21,167.59 194.11,168.96 197.18,168.96L207.8,168.96L207.8,182.49Z" style="fill:rgb(3,42,56);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/Stationary_Emergency_Vehicle-70px.tga
Normal file
BIN
graphics/Stationary_Emergency_Vehicle-70px.tga
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
15
graphics/Stationary_Vehicle-140x70.svg
Normal file
15
graphics/Stationary_Vehicle-140x70.svg
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 140 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-miterlimit:10;">
|
||||
<g transform="matrix(0.663916,0,0,0.663916,21.159,-2.63741)">
|
||||
<g transform="matrix(1,0,0,1,-80,-95)">
|
||||
<path d="M240.68,135.74L240.2,134.16C239.53,132 237.25,130.78 235.08,131.45L224.9,134.56C221.22,127.03 217.55,119.49 213.88,111.96C210.88,105.81 204.46,101.88 197.4,101.88L120.8,101.88C117.07,101.88 113.53,102.97 110.57,104.91C107.87,106.67 105.67,109.12 104.26,112.08C102.76,115.21 101.26,118.36 99.76,121.49C98.64,123.83 97.53,126.17 96.41,128.5C95.47,130.49 94.52,132.47 93.57,134.45L83.75,131.45C81.59,130.78 79.3,132 78.64,134.16L78.15,135.74C76.95,139.68 79.17,143.85 83.11,145.06L89.99,147.16L89.99,157.58L90.04,157.5L91.03,159.15L91.74,160.34L92.41,161.47L93.27,162.89L93.75,163.7L95.13,166.02L96.51,168.33L96.98,169.11L98.39,171.48L102.81,178.88L103.42,179.91L105.86,184.01L108.18,187.88L109.21,189.59L109.29,189.73L109.89,190.74L110.02,190.97L110.63,192L111.08,192.72L105.9,192.72L106.43,193.6L107.46,195.31L107.54,195.45C107.95,195.43 108.36,195.38 108.76,195.3C110.12,195.04 111.38,194.49 112.45,193.7C113.76,192.76 114.79,191.47 115.4,189.98C115.82,188.99 116.04,187.91 116.04,186.78L116.04,175.77L202.45,175.77L202.45,186.78C202.45,191.58 206.5,195.47 211.48,195.47L219.46,195.47C224.45,195.47 228.49,191.58 228.49,186.78L228.49,147.27L235.72,145.06C239.67,143.85 241.88,139.68 240.68,135.74ZM104.26,128.5C105.45,126.17 106.64,123.83 107.83,121.49C108.45,120.26 109.08,119.03 109.71,117.8C111.75,113.79 115.98,111.25 120.62,111.25L196.93,111.25C201.4,111.25 205.5,113.61 207.62,117.4C211.42,124.17 215.22,130.96 219.03,137.74L99.55,137.74C101.12,134.66 102.69,131.58 104.26,128.5ZM220.06,167.11L98.24,167.11L98.24,153.58L108.98,153.58C112.04,153.58 114.94,152.21 116.83,149.89C117.72,148.8 118.61,147.7 119.51,146.61L199.04,146.61C199.9,147.71 200.75,148.81 201.6,149.92C203.49,152.24 206.39,153.6 209.46,153.6L220.06,153.6L220.06,167.11Z" style="fill:rgb(6,42,56);fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-80,-95)">
|
||||
<path d="M259,198.485C259,196.821 257.649,195.47 255.985,195.47L51.145,195.47C49.481,195.47 48.13,196.821 48.13,198.485C48.13,200.149 49.481,201.5 51.145,201.5L255.985,201.5C257.649,201.5 259,200.149 259,198.485Z" style="fill:rgb(6,42,56);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-80,-95)">
|
||||
<path d="M116.36,193.27L114.75,190.57L114.4,189.98L113.75,188.89L113.2,187.98L112.42,186.67L111.04,184.36L110.83,184.01L110.4,183.27L110.2,182.94L109.94,182.5L108.59,180.26L108.56,180.19L107.78,178.88L107.18,177.87L101.95,169.11L100.75,167.11L97.39,161.48L97.24,161.23L95.98,159.12L95.5,158.32L92.75,153.71L92.27,152.89L91.73,152.01L91.65,151.86C91.57,151.74 91.5,151.63 91.41,151.52C91.22,151.29 90.99,151.08 90.74,150.92C90.63,150.84 90.51,150.78 90.39,150.72C90.28,150.65 90.15,150.59 90.03,150.56C89.7,150.44 89.37,150.39 89.04,150.39L88.99,150.39C88.87,150.39 88.76,150.39 88.65,150.42C87.74,150.54 86.92,151.06 86.45,151.86L83.59,156.66L79.21,163.99L77.49,166.86L76.46,168.6L75.6,170.03L75.41,170.37L75.03,170.99L74.88,171.25L74.4,172.04L73.36,173.79L73.07,174.27L72.47,175.29L71.95,176.16L64.54,188.58L63.81,189.79L63.4,190.47L62.58,191.84L62.56,191.87L61.93,192.93L61.73,193.27C61.59,193.51 61.47,193.77 61.4,194.04C61.06,195.3 61.56,196.74 62.88,197.49C63.33,197.75 63.86,197.85 64.39,197.85L113.72,197.85C114.24,197.85 114.77,197.75 115.22,197.49C116.81,196.56 117.2,194.65 116.36,193.27ZM68.02,192.72L68.17,192.48L68.46,192L69.36,190.47L69.77,189.79L70.65,188.32L71.95,186.15L73.16,184.1L75.03,180.97L75.35,180.43L76.58,178.38L77.79,176.34L79.8,172.97L88.65,158.15L88.99,157.58L89.04,157.5L90.03,159.15L90.74,160.34L91.41,161.47L92.27,162.89L92.75,163.7L94.13,166.02L95.51,168.33L95.98,169.11L97.39,171.48L101.81,178.88L102.42,179.91L104.86,184.01L107.18,187.88L108.21,189.59L108.29,189.73L108.89,190.74L109.02,190.97L109.63,192L110.08,192.72L68.02,192.72Z" style="fill:rgb(229,37,33);fill-rule:nonzero;stroke:rgb(229,37,33);stroke-width:1px;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
BIN
graphics/Stationary_Vehicle-80px.tga
Normal file
BIN
graphics/Stationary_Vehicle-80px.tga
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
17
graphics/Work_Zone-140x95.svg
Normal file
17
graphics/Work_Zone-140x95.svg
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 140 95" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-miterlimit:10;">
|
||||
<g transform="matrix(0.92789,0,0,0.92789,2.46819,-3.53846)">
|
||||
<g transform="matrix(1,0,0,1,-80,-95)">
|
||||
<path d="M228.22,197.555C228.22,196.443 227.317,195.54 226.205,195.54L79.355,195.54C78.243,195.54 77.34,196.443 77.34,197.555C77.34,198.667 78.243,199.57 79.355,199.57L226.205,199.57C227.317,199.57 228.22,198.667 228.22,197.555Z" style="fill:rgb(3,42,56);stroke:rgb(6,42,56);stroke-width:0.56px;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-80,-95)">
|
||||
<path d="M156.61,180.13C147.09,185.13 143.69,185.08 139.62,198.04L205.13,198.17C197.76,185.28 189.65,171.17 182.28,158.27C170.92,161.28 163.58,176.47 156.61,180.12L156.61,180.13Z" style="fill:rgb(3,42,56);"/>
|
||||
<path d="M207.75,180.01C217.27,185.01 220.67,184.96 224.74,197.92L159.23,198.05C166.6,185.16 174.71,171.05 182.08,158.15C193.44,161.16 200.78,176.35 207.75,180L207.75,180.01Z" style="fill:rgb(3,42,56);"/>
|
||||
<path d="M93.79,138.45L101.05,142.7L108.33,125.98L101.41,125.98L93.79,138.45ZM114.43,149.99L125.12,155.96L120.28,139.5L114.43,149.99ZM136.37,162.25L182.76,188.17L180.08,192.98L130.39,165.22C129.56,165 128.79,164.57 128.16,163.97L88.05,141.57C87.46,141.46 86.88,141.24 86.34,140.91C83.94,139.45 83.18,136.32 84.64,133.92L94.21,118.25C95.17,116.68 96.84,115.82 98.55,115.81C100.26,115.8 115.41,115.81 115.41,115.81C120.29,115.81 124.37,115.64 125.74,121.99L136.56,158.88C136.9,160.04 136.8,161.23 136.37,162.26L136.37,162.25Z" style="fill:rgb(3,42,56);"/>
|
||||
<path d="M108.45,160.8L108.72,168.61L108.76,170.18L107.93,171.48L93.92,193.17C92.42,195.48 89.33,196.15 87.03,194.66L86.87,194.56C85.71,193.81 84.98,192.76 84.69,191.41C84.39,190.07 84.62,188.8 85.37,187.64L98.53,167.26L98.31,155.22L108.46,160.78L108.45,160.8Z" style="fill:rgb(3,42,56);"/>
|
||||
<path d="M138.32,116.08C142.02,112.38 142.16,106.5 138.64,102.99C135.12,99.47 129.24,99.61 125.55,103.31C121.86,107.01 121.71,112.89 125.23,116.4C128.75,119.91 134.63,119.77 138.32,116.08Z" style="fill:rgb(3,42,56);"/>
|
||||
<path d="M99.53,154.37C97.18,153.03 96.36,150.04 97.69,147.7C99.02,145.34 102.02,144.52 104.37,145.85L129.8,160.3C131.45,161.23 132.35,162.98 132.28,164.75L132.53,192.46C132.55,195.16 130.37,197.37 127.67,197.39C124.97,197.41 122.76,195.24 122.73,192.53L122.51,167.42L99.53,154.36L99.53,154.37Z" style="fill:rgb(3,42,56);"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
BIN
graphics/Work_Zone-80px.tga
Normal file
BIN
graphics/Work_Zone-80px.tga
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -99,6 +99,7 @@
|
|||
)
|
||||
(capping no)
|
||||
(filling no)
|
||||
(aux_axis_origin 80 169)
|
||||
(pcbplotparams
|
||||
(layerselection 0x00000000_00000000_55555555_5755f5ff)
|
||||
(plot_on_all_layers_selection 0x00000000_00000000_00000000_00000000)
|
||||
|
|
@ -562,8 +563,8 @@
|
|||
(xy -3.020759 1.67015) (xy -2.902296 1.799665) (xy -2.80614 1.946593) (xy -2.735551 2.107712) (xy -2.716425 2.170804)
|
||||
(xy -2.698044 2.270947) (xy -2.689557 2.388431) (xy -2.690963 2.510483) (xy -2.702263 2.624336)
|
||||
(xy -2.716425 2.693699) (xy -2.77566 2.856203) (xy -2.861703 3.007451) (xy -2.970947 3.143618) (xy -3.099784 3.260884)
|
||||
(xy -3.244606 3.355425) (xy -3.401806 3.423421) (xy -3.406737 3.425031) (xy -3.51052 3.449266) (xy -3.63247 3.463095)
|
||||
(xy -3.760725 3.466236) (xy -3.883419 3.458403) (xy -3.988688 3.43931) (xy -3.989598 3.439065) (xy -4.154266 3.380019)
|
||||
(xy -3.244606 3.355424) (xy -3.401806 3.423421) (xy -3.406737 3.425031) (xy -3.51052 3.449266) (xy -3.63247 3.463095)
|
||||
(xy -3.760725 3.466236) (xy -3.883419 3.458403) (xy -3.988688 3.43931) (xy -3.989598 3.439065) (xy -4.154267 3.380019)
|
||||
(xy -4.303264 3.295183) (xy -4.440833 3.182095) (xy -4.454033 3.169227) (xy -4.572775 3.033788)
|
||||
(xy -4.661492 2.89078) (xy -4.721491 2.737075) (xy -4.754073 2.569545) (xy -4.761303 2.432252) (xy -4.167311 2.432252)
|
||||
(xy -4.152257 2.536497) (xy -4.110172 2.636271) (xy -4.045673 2.72544) (xy -3.963374 2.797871) (xy -3.867894 2.84743)
|
||||
|
|
@ -573,7 +574,7 @@
|
|||
(xy -3.525746 2.046501) (xy -3.630353 2.009563) (xy -3.740415 1.997868) (xy -3.848554 2.012415)
|
||||
(xy -3.924207 2.041274) (xy -4.006823 2.09932) (xy -4.077345 2.179239) (xy -4.130646 2.272782) (xy -4.161596 2.371703)
|
||||
(xy -4.167311 2.432252) (xy -4.761303 2.432252) (xy -4.748663 2.252944) (xy -4.70981 2.089807) (xy -4.643347 1.939497)
|
||||
(xy -4.547876 1.798667) (xy -4.452659 1.693534) (xy -4.31628 1.579375) (xy -4.163124 1.489123) (xy -3.999316 1.426267)
|
||||
(xy -4.547876 1.798667) (xy -4.452658 1.693534) (xy -4.31628 1.579375) (xy -4.163124 1.489123) (xy -3.999316 1.426267)
|
||||
(xy -3.969878 1.418311) (xy -3.883859 1.40358) (xy -3.77933 1.396204) (xy -3.668608 1.396182)
|
||||
)
|
||||
(stroke
|
||||
|
|
@ -591,19 +592,19 @@
|
|||
(xy 6.803727 2.037089) (xy 6.830589 2.107423) (xy 6.855054 2.205848) (xy 6.870081 2.323058) (xy 6.875185 2.447441)
|
||||
(xy 6.869883 2.567382) (xy 6.854007 2.669931) (xy 6.813031 2.805683) (xy 6.755203 2.927307) (xy 6.676058 3.042494)
|
||||
(xy 6.571128 3.158938) (xy 6.56849 3.161579) (xy 6.462413 3.258894) (xy 6.360114 3.332673) (xy 6.252438 3.388308)
|
||||
(xy 6.13023 3.431194) (xy 6.093984 3.441175) (xy 5.992929 3.459437) (xy 5.874732 3.467883) (xy 5.752404 3.466428)
|
||||
(xy 5.638968 3.454984) (xy 5.585658 3.444542) (xy 5.42618 3.390141) (xy 5.277218 3.308399) (xy 5.142273 3.202873)
|
||||
(xy 6.13023 3.431194) (xy 6.093984 3.441175) (xy 5.992929 3.459437) (xy 5.874733 3.467883) (xy 5.752404 3.466428)
|
||||
(xy 5.638968 3.454984) (xy 5.585658 3.444542) (xy 5.42618 3.390141) (xy 5.277218 3.3084) (xy 5.142273 3.202873)
|
||||
(xy 5.024848 3.077127) (xy 4.928443 2.934723) (xy 4.856563 2.779222) (xy 4.823972 2.669931) (xy 4.807942 2.565727)
|
||||
(xy 4.802794 2.445638) (xy 4.803359 2.432252) (xy 5.40394 2.432251) (xy 5.418595 2.549248) (xy 5.461436 2.652939)
|
||||
(xy 5.530774 2.740594) (xy 5.624919 2.809483) (xy 5.643233 2.819114) (xy 5.711573 2.849154) (xy 5.771665 2.864046)
|
||||
(xy 5.838989 2.867997) (xy 5.907387 2.863892) (xy 5.96748 2.848772) (xy 6.034746 2.819114) (xy 6.128982 2.755368)
|
||||
(xy 6.201818 2.671708) (xy 6.250892 2.57337) (xy 6.273842 2.465588) (xy 6.268306 2.353598) (xy 6.260436 2.318842)
|
||||
(xy 6.216702 2.214791) (xy 6.148741 2.126763) (xy 6.06148 2.058537) (xy 5.959841 2.013888) (xy 5.84875 1.996595)
|
||||
(xy 6.216702 2.214791) (xy 6.148741 2.126763) (xy 6.06148 2.058537) (xy 5.959841 2.013888) (xy 5.848749 1.996595)
|
||||
(xy 5.840136 1.996506) (xy 5.726105 2.011219) (xy 5.623684 2.052887) (xy 5.536582 2.117807) (xy 5.468506 2.202275)
|
||||
(xy 5.423165 2.302586) (xy 5.404265 2.415036) (xy 5.40394 2.432251) (xy 4.803359 2.432252) (xy 4.808046 2.321278)
|
||||
(xy 4.823213 2.204255) (xy 4.84739 2.107422) (xy 4.915607 1.952101) (xy 5.009378 1.80597) (xy 5.108782 1.692104)
|
||||
(xy 4.823213 2.204255) (xy 4.84739 2.107421) (xy 4.915607 1.952101) (xy 5.009378 1.80597) (xy 5.108782 1.692104)
|
||||
(xy 5.227529 1.588985) (xy 5.353843 1.509207) (xy 5.499074 1.445614) (xy 5.500936 1.444936) (xy 5.551179 1.427688)
|
||||
(xy 5.595672 1.415871) (xy 5.642441 1.408486) (xy 5.699516 1.404534) (xy 5.774919 1.403016) (xy 5.838989 1.402863)
|
||||
(xy 5.595672 1.415871) (xy 5.64244 1.408486) (xy 5.699516 1.404534) (xy 5.774919 1.403016) (xy 5.838989 1.402863)
|
||||
)
|
||||
(stroke
|
||||
(width 0)
|
||||
|
|
@ -620,9 +621,9 @@
|
|||
(xy 0.38529 -2.153105) (xy 0.422645 -2.126534) (xy 0.447277 -2.101608) (xy 0.451031 -2.095582) (xy 0.454427 -2.08621)
|
||||
(xy 0.457484 -2.071964) (xy 0.460219 -2.051314) (xy 0.462651 -2.022731) (xy 0.464797 -1.984688)
|
||||
(xy 0.466677 -1.935655) (xy 0.468307 -1.874104) (xy 0.469706 -1.798505) (xy 0.470893 -1.707331)
|
||||
(xy 0.471885 -1.599052) (xy 0.472699 -1.472141) (xy 0.473356 -1.325065) (xy 0.473871 -1.1563) (xy 0.474265 -0.964317)
|
||||
(xy 0.471885 -1.599052) (xy 0.472699 -1.472141) (xy 0.473356 -1.325065) (xy 0.473871 -1.1563) (xy 0.474265 -0.964318)
|
||||
(xy 0.474554 -0.747584) (xy 0.474756 -0.504574) (xy 0.474891 -0.233759) (xy 0.474975 0.06639) (xy 0.475006 0.24164)
|
||||
(xy 0.475358 2.551091) (xy -0.522895 2.551091) (xy -1.521148 2.551091) (xy -1.521148 0.238895) (xy -1.521147 -0.929276)
|
||||
(xy 0.475358 2.551091) (xy -0.522895 2.551091) (xy -1.521148 2.551091) (xy -1.521148 0.238895) (xy -1.521146 -0.929276)
|
||||
(xy -1.204242 -0.929276) (xy -1.204144 -0.800708) (xy -1.203653 -0.699729) (xy -1.202479 -0.622239)
|
||||
(xy -1.20033 -0.564137) (xy -1.196913 -0.521322) (xy -1.191937 -0.489693) (xy -1.18511 -0.465149)
|
||||
(xy -1.17614 -0.44359) (xy -1.16859 -0.428392) (xy -1.138226 -0.378967) (xy -1.102126 -0.343806)
|
||||
|
|
@ -637,10 +638,10 @@
|
|||
(xy 0.072506 -1.466584) (xy 0.036101 -1.496396) (xy -0.015148 -1.517264) (xy -0.086182 -1.530941)
|
||||
(xy -0.181945 -1.53918) (xy -0.225795 -1.541247) (xy -0.411978 -1.548656) (xy -0.411978 -0.924858)
|
||||
(xy -0.665501 -0.924858) (xy -0.665502 -1.532219) (xy -0.830709 -1.541574) (xy -0.935156 -1.54482)
|
||||
(xy -1.013902 -1.540428) (xy -1.072228 -1.527432) (xy -1.115413 -1.504867) (xy -1.137021 -1.48552)
|
||||
(xy -1.013902 -1.540428) (xy -1.072228 -1.527432) (xy -1.115412 -1.504867) (xy -1.137021 -1.48552)
|
||||
(xy -1.156155 -1.462999) (xy -1.171293 -1.43833) (xy -1.182897 -1.407684) (xy -1.191429 -1.367229)
|
||||
(xy -1.197354 -1.313136) (xy -1.201133 -1.241574) (xy -1.203229 -1.148712) (xy -1.204106 -1.03072)
|
||||
(xy -1.204242 -0.929276) (xy -1.521147 -0.929276) (xy -1.521148 -2.073302) (xy -1.480126 -2.122054)
|
||||
(xy -1.204242 -0.929276) (xy -1.521146 -0.929276) (xy -1.521148 -2.073302) (xy -1.480126 -2.122054)
|
||||
(xy -1.439104 -2.170805) (xy -0.544212 -2.170805)
|
||||
)
|
||||
(stroke
|
||||
|
|
@ -657,7 +658,7 @@
|
|||
(xy 3.758519 -1.796373) (xy 3.813961 -1.782842) (xy 3.865837 -1.765225) (xy 3.918162 -1.743043)
|
||||
(xy 3.970277 -1.718132) (xy 3.998375 -1.702797) (xy 4.031507 -1.681607) (xy 4.071624 -1.652945)
|
||||
(xy 4.120678 -1.615192) (xy 4.180618 -1.566731) (xy 4.253398 -1.505941) (xy 4.340968 -1.431207)
|
||||
(xy 4.445277 -1.340909) (xy 4.56828 -1.23343) (xy 4.711926 -1.107151) (xy 4.790186 -1.038144) (xy 4.919767 -0.924138)
|
||||
(xy 4.445277 -1.340909) (xy 4.56828 -1.23343) (xy 4.711926 -1.107151) (xy 4.790186 -1.038144) (xy 4.919766 -0.924138)
|
||||
(xy 5.044022 -0.815478) (xy 5.160619 -0.714156) (xy 5.267232 -0.622165) (xy 5.361533 -0.541497)
|
||||
(xy 5.441194 -0.474144) (xy 5.503887 -0.422099) (xy 5.547285 -0.387355) (xy 5.567732 -0.372633)
|
||||
(xy 5.611519 -0.352992) (xy 5.683694 -0.328238) (xy 5.78152 -0.299205) (xy 5.902257 -0.266724) (xy 5.983755 -0.246127)
|
||||
|
|
@ -687,11 +688,11 @@
|
|||
(xy 2.602471 2.161395) (xy 2.602063 2.012563) (xy 2.601756 1.843069) (xy 2.601554 1.65475) (xy 2.601459 1.449444)
|
||||
(xy 2.601476 1.228989) (xy 2.601606 0.995223) (xy 2.601852 0.749985) (xy 2.602218 0.495111) (xy 2.602477 0.348596)
|
||||
(xy 2.605615 -1.317759) (xy 2.955146 -1.317759) (xy 2.955146 -0.763538) (xy 2.955216 -0.616152)
|
||||
(xy 2.955542 -0.497162) (xy 2.956302 -0.403273) (xy 2.957672 -0.33119) (xy 2.959831 -0.277617) (xy 2.962955 -0.239262)
|
||||
(xy 2.955542 -0.497162) (xy 2.956302 -0.403273) (xy 2.957672 -0.33119) (xy 2.959831 -0.277617) (xy 2.962955 -0.239263)
|
||||
(xy 2.967222 -0.212827) (xy 2.972808 -0.195018) (xy 2.97989 -0.182542) (xy 2.986837 -0.174092) (xy 3.021094 -0.143478)
|
||||
(xy 3.050218 -0.125897) (xy 3.0722 -0.12321) (xy 3.122548 -0.120668) (xy 3.197938 -0.118332) (xy 3.295047 -0.116264)
|
||||
(xy 3.410551 -0.114524) (xy 3.541125 -0.113174) (xy 3.683446 -0.112277) (xy 3.805947 -0.111922)
|
||||
(xy 4.529986 -0.110917) (xy 4.574444 -0.14912) (xy 4.5922 -0.165305) (xy 4.604601 -0.18197) (xy 4.612777 -0.204936)
|
||||
(xy 4.529986 -0.110917) (xy 4.574444 -0.14912) (xy 4.592199 -0.165305) (xy 4.604601 -0.18197) (xy 4.612777 -0.204936)
|
||||
(xy 4.61786 -0.240027) (xy 4.620984 -0.29306) (xy 4.623282 -0.369858) (xy 4.624125 -0.404463) (xy 4.625383 -0.487394)
|
||||
(xy 4.62515 -0.56159) (xy 4.623544 -0.619924) (xy 4.620683 -0.655272) (xy 4.619902 -0.659238) (xy 4.606064 -0.678508)
|
||||
(xy 4.571452 -0.715461) (xy 4.519312 -0.767112) (xy 4.45289 -0.830475) (xy 4.375435 -0.902563) (xy 4.290192 -0.980391)
|
||||
|
|
@ -738,7 +739,7 @@
|
|||
(xy -1.737183 -1.730301) (xy -1.738548 -1.593847) (xy -1.739713 -1.434015) (xy -1.740685 -1.249698)
|
||||
(xy -1.741473 -1.039789) (xy -1.742087 -0.803179) (xy -1.742534 -0.538761) (xy -1.742824 -0.245426)
|
||||
(xy -1.742965 0.077933) (xy -1.742982 0.252618) (xy -1.742982 2.551091) (xy -2.025776 2.551091)
|
||||
(xy -2.30857 2.551092) (xy -2.318325 2.380597) (xy -2.345454 2.170031) (xy -2.401206 1.970426) (xy -2.484079 1.784062)
|
||||
(xy -2.30857 2.551093) (xy -2.318325 2.380597) (xy -2.345454 2.170031) (xy -2.401206 1.970426) (xy -2.484079 1.784062)
|
||||
(xy -2.592573 1.613221) (xy -2.725189 1.460182) (xy -2.880426 1.327227) (xy -3.056784 1.216635)
|
||||
(xy -3.097754 1.195783) (xy -3.289659 1.119032) (xy -3.487713 1.072201) (xy -3.688712 1.054929)
|
||||
(xy -3.889457 1.066856) (xy -4.086743 1.107622) (xy -4.277367 1.176867) (xy -4.458126 1.274231)
|
||||
|
|
@ -762,7 +763,7 @@
|
|||
(xy -4.028433 -0.526412) (xy -3.95776 -0.4867) (xy -3.894178 -0.450473) (xy -3.816412 -0.406572)
|
||||
(xy -3.748466 -0.369481) (xy -3.694936 -0.341606) (xy -3.660412 -0.32535) (xy -3.649512 -0.322374)
|
||||
(xy -3.638054 -0.339418) (xy -3.61475 -0.377855) (xy -3.582859 -0.431997) (xy -3.545632 -0.496155)
|
||||
(xy -3.506328 -0.564639) (xy -3.468202 -0.631762) (xy -3.434509 -0.69183) (xy -3.408505 -0.739159)
|
||||
(xy -3.506328 -0.564639) (xy -3.468202 -0.631763) (xy -3.434509 -0.69183) (xy -3.408505 -0.739159)
|
||||
(xy -3.393447 -0.768057) (xy -3.391009 -0.774085) (xy -3.404141 -0.784864) (xy -3.440476 -0.808347)
|
||||
(xy -3.495537 -0.841806) (xy -3.564848 -0.882507) (xy -3.628572 -0.919027) (xy -3.706151 -0.963539)
|
||||
(xy -3.773122 -1.002933) (xy -3.825012 -1.034498) (xy -3.857348 -1.055523) (xy -3.866134 -1.062977)
|
||||
|
|
@ -785,7 +786,7 @@
|
|||
(xy -7.288713 -1.354772) (xy -7.288656 -1.576176) (xy -7.28853 -1.829676) (xy -7.288333 -2.057246)
|
||||
(xy -7.288048 -2.260328) (xy -7.287658 -2.440361) (xy -7.287147 -2.598785) (xy -7.286497 -2.737041)
|
||||
(xy -7.286487 -2.738455) (xy -6.718403 -2.738455) (xy -6.71632 -2.64197) (xy -6.709211 -2.572017)
|
||||
(xy -6.695784 -2.523654) (xy -6.674746 -2.491944) (xy -6.649253 -2.47406) (xy -6.619687 -2.467824)
|
||||
(xy -6.695784 -2.523654) (xy -6.674746 -2.491944) (xy -6.649253 -2.47406) (xy -6.619686 -2.467824)
|
||||
(xy -6.561212 -2.463351) (xy -6.476559 -2.460748) (xy -6.368465 -2.460125) (xy -6.308983 -2.460562)
|
||||
(xy -6.002557 -2.463943) (xy -5.964348 -2.508401) (xy -5.947373 -2.530542) (xy -5.936323 -2.554353)
|
||||
(xy -5.929941 -2.586969) (xy -5.92697 -2.635531) (xy -5.926154 -2.707173) (xy -5.926139 -2.72539)
|
||||
|
|
@ -811,8 +812,8 @@
|
|||
(xy -2.354218 -2.997367) (xy -2.411725 -2.998243) (xy -2.52783 -2.999894) (xy -2.616461 -3.000787)
|
||||
(xy -2.681834 -3.000486) (xy -2.728164 -2.998557) (xy -2.759668 -2.994567) (xy -2.78056 -2.98808)
|
||||
(xy -2.795057 -2.978662) (xy -2.807373 -2.965879) (xy -2.81526 -2.956655) (xy -2.831694 -2.934926)
|
||||
(xy -2.842382 -2.910842) (xy -2.848545 -2.877307) (xy -2.851394 -2.827231) (xy -2.852144 -2.753522)
|
||||
(xy -2.852152 -2.741384) (xy -5.926248 -2.741384) (xy -5.926667 -2.802648) (xy -5.929089 -2.855359)
|
||||
(xy -2.842382 -2.910842) (xy -2.848545 -2.877307) (xy -2.851394 -2.827231) (xy -2.852143 -2.753522)
|
||||
(xy -2.852152 -2.741384) (xy -5.926248 -2.741384) (xy -5.926667 -2.802648) (xy -5.929088 -2.855359)
|
||||
(xy -5.934666 -2.890659) (xy -5.944653 -2.915685) (xy -5.960307 -2.937575) (xy -5.964377 -2.942377)
|
||||
(xy -6.002616 -2.986832) (xy -6.30109 -2.996639) (xy -6.397268 -2.999082) (xy -6.484282 -2.999951)
|
||||
(xy -6.556481 -2.999292) (xy -6.608213 -2.997158) (xy -6.633616 -2.99368) (xy -6.66858 -2.974935)
|
||||
|
|
@ -825,7 +826,7 @@
|
|||
(xy -7.162357 -3.444481) (xy -7.153911 -3.447159) (xy -7.142305 -3.449641) (xy -7.126454 -3.451938)
|
||||
(xy -7.105275 -3.454055) (xy -7.077685 -3.456) (xy -7.042598 -3.457781) (xy -6.998933 -3.459402)
|
||||
(xy -6.945605 -3.460874) (xy -6.88153 -3.462203) (xy -6.805626 -3.463396) (xy -6.716807 -3.464461)
|
||||
(xy -6.613992 -3.465405) (xy -6.496094 -3.466235) (xy -6.362033 -3.466958) (xy -6.210722 -3.467583)
|
||||
(xy -6.613993 -3.465405) (xy -6.496094 -3.466235) (xy -6.362033 -3.466958) (xy -6.210722 -3.467583)
|
||||
(xy -6.04108 -3.468115) (xy -5.852022 -3.468563) (xy -5.642465 -3.468934) (xy -5.411324 -3.469235)
|
||||
(xy -5.157517 -3.469473) (xy -4.879959 -3.469656) (xy -4.577567 -3.469791) (xy -4.249257 -3.469885)
|
||||
(xy -3.893946 -3.469946) (xy -3.51055 -3.46998) (xy -3.097985 -3.469996) (xy -2.655167 -3.47) (xy -2.503555 -3.47)
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@
|
|||
"netlist": "",
|
||||
"plot": "",
|
||||
"specctra_dsn": "",
|
||||
"step": "",
|
||||
"step": "../housing/c_its-companion-v1.0.step",
|
||||
"vrml": ""
|
||||
},
|
||||
"page_layout_descr_file": ""
|
||||
|
|
|
|||
BIN
hardware/housing/ST7789-240x280px-screen.FCStd
Normal file
BIN
hardware/housing/ST7789-240x280px-screen.FCStd
Normal file
Binary file not shown.
BIN
hardware/housing/c_its-companion-assembly.FCStd
Normal file
BIN
hardware/housing/c_its-companion-assembly.FCStd
Normal file
Binary file not shown.
BIN
hardware/housing/c_its-companion-housing-bottom-2mm.3mf
Normal file
BIN
hardware/housing/c_its-companion-housing-bottom-2mm.3mf
Normal file
Binary file not shown.
BIN
hardware/housing/c_its-companion-housing-bottom-7mm.3mf
Normal file
BIN
hardware/housing/c_its-companion-housing-bottom-7mm.3mf
Normal file
Binary file not shown.
BIN
hardware/housing/c_its-companion-housing-bottom-9mm.3mf
Normal file
BIN
hardware/housing/c_its-companion-housing-bottom-9mm.3mf
Normal file
Binary file not shown.
BIN
hardware/housing/c_its-companion-housing-lid.3mf
Normal file
BIN
hardware/housing/c_its-companion-housing-lid.3mf
Normal file
Binary file not shown.
BIN
hardware/housing/c_its-companion-housing.FCStd
Normal file
BIN
hardware/housing/c_its-companion-housing.FCStd
Normal file
Binary file not shown.
240204
hardware/housing/c_its-companion-v1.0.step
Normal file
240204
hardware/housing/c_its-companion-v1.0.step
Normal file
File diff suppressed because it is too large
Load diff
BIN
hardware/housing/overpass-semibold.otf
Normal file
BIN
hardware/housing/overpass-semibold.otf
Normal file
Binary file not shown.
|
|
@ -1,13 +1,14 @@
|
|||
//! C-ITS DENM Evaluation
|
||||
|
||||
use c_its_parser::standards::cdd_2_2_1::etsi_its_cdd;
|
||||
use c_its_parser::standards::denm_2_2_1::denm_pdu_description;
|
||||
use log::info;
|
||||
|
||||
pub fn handle_denm(etsi: &denm_pdu_description::DENM) {
|
||||
pub fn handle_denm(etsi: &denm_pdu_description::DENM) -> Option<etsi_its_cdd::CauseCodeChoice> {
|
||||
let mgmt = &etsi.denm.management;
|
||||
|
||||
if mgmt.termination.is_some() {
|
||||
return;
|
||||
return None;
|
||||
}
|
||||
|
||||
if let (Some(sit), Some(loc)) = (&etsi.denm.situation, &etsi.denm.location) {
|
||||
|
|
@ -38,7 +39,11 @@ pub fn handle_denm(etsi: &denm_pdu_description::DENM) {
|
|||
"DENN: {station_id}/{seq_num} CC {cc}/{scc} at {lat_deg:.3}°N, {lon_deg:.3}°E until {end_time:?}"
|
||||
);
|
||||
}
|
||||
|
||||
Some(sit.event_type.cc_and_scc.clone())
|
||||
} else {
|
||||
info!("DENM: One of situation or location container not available");
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
11
src/main.rs
11
src/main.rs
|
|
@ -578,7 +578,16 @@ async fn main(spawner: Spawner) -> ! {
|
|||
transport: _,
|
||||
ref etsi,
|
||||
} => {
|
||||
applogic::denm::handle_denm(etsi);
|
||||
match applogic::denm::handle_denm(etsi) {
|
||||
#[cfg(feature = "screen")]
|
||||
Some(cc) => {
|
||||
let _ = screen
|
||||
.update(screen::ScreenState::DenmWarning(cc))
|
||||
.inspect_err(log_screen_error);
|
||||
}
|
||||
// TODO: cancel screen, if None?
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// Send data to BLE thread
|
||||
#[cfg(feature = "ble")]
|
||||
|
|
|
|||
146
src/screen.rs
146
src/screen.rs
|
|
@ -1,10 +1,15 @@
|
|||
//! Screen Output
|
||||
|
||||
#[cfg(feature = "denm")]
|
||||
use c_its_parser::standards::cdd_2_2_1;
|
||||
use embedded_graphics::prelude::*;
|
||||
use embedded_graphics::{geometry, mono_font, pixelcolor, primitives, text};
|
||||
|
||||
use crate::applogic;
|
||||
|
||||
#[cfg(feature = "denm")]
|
||||
const DENM_MIN_DISPLAY_TIME: esp_hal::time::Duration = esp_hal::time::Duration::from_secs(5);
|
||||
|
||||
pub struct DisplaySize {
|
||||
width: u16,
|
||||
height: u16,
|
||||
|
|
@ -23,10 +28,20 @@ where
|
|||
prev_state: ScreenState,
|
||||
hb_state: bool,
|
||||
gnss_hb_state: bool,
|
||||
#[cfg(feature = "denm")]
|
||||
denm_display_start_time: esp_hal::time::Instant,
|
||||
|
||||
// assets
|
||||
#[cfg(feature = "spat")]
|
||||
bike_image: tinytga::Tga<'static, pixelcolor::Rgb565>,
|
||||
bike_image: tinytga::Tga<'static, pixelcolor::Rgb565>, // 45x25px
|
||||
// #[cfg(feature = "denm")]
|
||||
// warn_icon: tinytga::Tga<'static, pixelcolor::Rgb565>, // 200x153 px
|
||||
#[cfg(feature = "denm")]
|
||||
sv_insert: tinytga::Tga<'static, pixelcolor::Rgb565>, // 80px wide (original 140x70)
|
||||
#[cfg(feature = "denm")]
|
||||
ev_insert: tinytga::Tga<'static, pixelcolor::Rgb565>, // 60px wide (original 140x105)
|
||||
#[cfg(feature = "denm")]
|
||||
rww_insert: tinytga::Tga<'static, pixelcolor::Rgb565>, // 80px wide (original 140x95)
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq)]
|
||||
|
|
@ -42,6 +57,8 @@ pub enum ScreenState {
|
|||
GlosaFound(applogic::GlosaFound),
|
||||
#[cfg(feature = "spat")]
|
||||
GlosaLocked(applogic::GlosaSignalInfo),
|
||||
#[cfg(feature = "denm")]
|
||||
DenmWarning(cdd_2_2_1::etsi_its_cdd::CauseCodeChoice),
|
||||
}
|
||||
|
||||
#[cfg(feature = "spat")]
|
||||
|
|
@ -99,9 +116,23 @@ where
|
|||
|
||||
pub fn new(target: D, display_size: DisplaySize) -> Self {
|
||||
#[cfg(feature = "spat")]
|
||||
let data = include_bytes!("../graphics/Sinnbild_Radfahrer_StVO_1992-25px-white.tga");
|
||||
#[cfg(feature = "spat")]
|
||||
let bike_image = tinytga::Tga::from_slice(data).expect("Failed to parse TGA image");
|
||||
let bike_image = tinytga::Tga::from_slice(include_bytes!(
|
||||
"../graphics/Sinnbild_Radfahrer_StVO_1992-25px-white.tga"
|
||||
))
|
||||
.expect("Failed to parse TGA image");
|
||||
|
||||
#[cfg(feature = "denm")]
|
||||
let sv_insert =
|
||||
tinytga::Tga::from_slice(include_bytes!("../graphics/Stationary_Vehicle-80px.tga"))
|
||||
.expect("Failed to parse TGA image");
|
||||
#[cfg(feature = "denm")]
|
||||
let ev_insert = tinytga::Tga::from_slice(include_bytes!(
|
||||
"../graphics/Stationary_Emergency_Vehicle-70px.tga"
|
||||
))
|
||||
.expect("Failed to parse TGA image");
|
||||
#[cfg(feature = "denm")]
|
||||
let rww_insert = tinytga::Tga::from_slice(include_bytes!("../graphics/Work_Zone-80px.tga"))
|
||||
.expect("Failed to parse TGA image");
|
||||
|
||||
Self {
|
||||
target,
|
||||
|
|
@ -109,12 +140,43 @@ where
|
|||
prev_state: ScreenState::Uninitialized,
|
||||
hb_state: false,
|
||||
gnss_hb_state: false,
|
||||
#[cfg(feature = "denm")]
|
||||
denm_display_start_time: esp_hal::time::Instant::EPOCH,
|
||||
#[cfg(feature = "spat")]
|
||||
bike_image,
|
||||
// #[cfg(feature = "denm")]
|
||||
// warn_icon,
|
||||
#[cfg(feature = "denm")]
|
||||
sv_insert,
|
||||
#[cfg(feature = "denm")]
|
||||
ev_insert,
|
||||
#[cfg(feature = "denm")]
|
||||
rww_insert,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(&mut self, state: ScreenState) -> Result<(), D::Error> {
|
||||
#[cfg(feature = "denm")]
|
||||
let now = esp_hal::time::Instant::now();
|
||||
|
||||
#[cfg(feature = "denm")]
|
||||
// when a DENM was shown before, make sure it's shown for a minimum time
|
||||
if let ScreenState::DenmWarning(_) = self.prev_state {
|
||||
use core::ops::Sub;
|
||||
|
||||
// update DENM display, if there are updates
|
||||
if self.prev_state != state
|
||||
&& let ScreenState::DenmWarning(cause_code_choice) = &state
|
||||
{
|
||||
return self.draw_denm_warning(cause_code_choice);
|
||||
}
|
||||
|
||||
// otherwise early return when timer isn't expired yet
|
||||
if now.sub(self.denm_display_start_time) < DENM_MIN_DISPLAY_TIME {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
if self.prev_state != state {
|
||||
match &state {
|
||||
ScreenState::Uninitialized | ScreenState::Initial => self.draw_slash_screen()?,
|
||||
|
|
@ -131,6 +193,11 @@ where
|
|||
self.draw_glosa(glosa_data, prev_glosa_data)?;
|
||||
}
|
||||
ScreenState::Error(msg) => self.draw_message(msg)?,
|
||||
#[cfg(feature = "denm")]
|
||||
ScreenState::DenmWarning(cause_code_choice) => {
|
||||
self.denm_display_start_time = now;
|
||||
self.draw_denm_warning(cause_code_choice)?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,6 +234,7 @@ where
|
|||
}
|
||||
|
||||
// on big screns: uses full screen width and height from 250 to 280 pixels
|
||||
#[cfg(feature = "gnss_ubx")]
|
||||
pub fn update_gnss(
|
||||
&mut self,
|
||||
pvt: &ublox::nav_pvt::proto27::NavPvtRef,
|
||||
|
|
@ -470,6 +538,76 @@ where
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "denm")]
|
||||
pub fn draw_denm_warning(
|
||||
&mut self,
|
||||
cc: &cdd_2_2_1::etsi_its_cdd::CauseCodeChoice,
|
||||
) -> Result<(), D::Error> {
|
||||
// clear whole display and draw image
|
||||
self.clear()?;
|
||||
|
||||
let centerline = i32::from(self.size.width) / 2;
|
||||
let sign_top = self.size.offset_top + 40;
|
||||
|
||||
// build triangle shape
|
||||
{
|
||||
let point1 = geometry::Point::new(centerline, sign_top);
|
||||
let point2 = geometry::Point::new(centerline - 100, sign_top + 150);
|
||||
let point3 = geometry::Point::new(centerline + 100, sign_top + 150);
|
||||
let mut line_style =
|
||||
primitives::PrimitiveStyle::with_stroke(pixelcolor::Rgb565::CSS_RED, 10);
|
||||
line_style.fill_color = Some(pixelcolor::Rgb565::WHITE);
|
||||
|
||||
primitives::Triangle::new(point1, point2, point3)
|
||||
.into_styled(line_style)
|
||||
.draw(&mut self.target)?;
|
||||
}
|
||||
|
||||
// add icon inside the triangle
|
||||
match cc {
|
||||
cdd_2_2_1::etsi_its_cdd::CauseCodeChoice::slowVehicle26(_)
|
||||
| cdd_2_2_1::etsi_its_cdd::CauseCodeChoice::stationaryVehicle94(_) => {
|
||||
embedded_graphics::image::Image::new(
|
||||
&self.sv_insert,
|
||||
geometry::Point::new(centerline - (80 / 2), sign_top + 90),
|
||||
)
|
||||
.draw(&mut self.target)?;
|
||||
}
|
||||
|
||||
cdd_2_2_1::etsi_its_cdd::CauseCodeChoice::rescueAndRecoveryWorkInProgress15(_)
|
||||
| cdd_2_2_1::etsi_its_cdd::CauseCodeChoice::emergencyVehicleApproaching95(_) => {
|
||||
embedded_graphics::image::Image::new(
|
||||
&self.ev_insert,
|
||||
geometry::Point::new(centerline - (70 / 2), sign_top + 85),
|
||||
)
|
||||
.draw(&mut self.target)?;
|
||||
}
|
||||
|
||||
cdd_2_2_1::etsi_its_cdd::CauseCodeChoice::roadworks3(_) => {
|
||||
embedded_graphics::image::Image::new(
|
||||
&self.rww_insert,
|
||||
geometry::Point::new(centerline - (80 / 2), sign_top + 85),
|
||||
)
|
||||
.draw(&mut self.target)?;
|
||||
}
|
||||
|
||||
_ => {
|
||||
text::Text::with_alignment(
|
||||
"Unhandled DENM CC",
|
||||
geometry::Point::new(
|
||||
i32::from(self.size.width) / 2,
|
||||
sign_top + 150 + (10 / 2) + 30,
|
||||
),
|
||||
Self::MID_TEXT_STYLE,
|
||||
text::Alignment::Center,
|
||||
)
|
||||
.draw(&mut self.target)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
fn draw_slash_screen(&mut self) -> Result<(), D::Error> {
|
||||
let text_style = mono_font::MonoTextStyle::new(&profont::PROFONT_18_POINT, Self::COLOR_FG);
|
||||
|
|
|
|||
Loading…
Reference in a new issue