updated IR arts

This commit is contained in:
Peli de Halleux 2018-02-07 09:53:58 -08:00
parent 931ca40f49
commit 74ca722aac
4 changed files with 195 additions and 36 deletions

View File

@ -233,7 +233,7 @@ namespace sensors {
*/ */
//% blockNamespace=sensors //% blockNamespace=sensors
//% blockId=irSetRemoteChannel block="set %sensor|remote channel to %channel" //% blockId=irSetRemoteChannel block="set %sensor|remote channel to %channel"
//% weight=65 //% weight=99
//% group="Remote Infrared Beacon" //% group="Remote Infrared Beacon"
setRemoteChannel(channel: InfraredRemoteChannel) { setRemoteChannel(channel: InfraredRemoteChannel) {
this.setMode(InfraredSensorMode.RemoteControl) this.setMode(InfraredSensorMode.RemoteControl)

View File

@ -1,21 +1,100 @@
namespace pxsim.visuals { namespace pxsim.visuals {
export const REMOVE_SVG = ` export const REMOVE_SVG = `
<svg xmlns="http://www.w3.org/2000/svg" width="371.7" height="418.7" viewBox="0 0 98.3 110.8" id="svg8"> <svg xmlns="http://www.w3.org/2000/svg" width="80" height="123.773" viewBox="0 0 21.166666 32.748275" id="svg10208">
<g id="layer1" transform="translate(0 -186.2)"> <defs id="defs10202">
<rect id="rect90-3" width="72.7" height="9.6" x="12.1" y="186.5" rx="2.1" fill="#666" stroke="#000" stroke-width=".5"/> <linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 -2.30835 7.23512 0 1161.6036 852.6532)" id="linearGradient9407">
<rect id="rect90" width="73.1" height="9.6" x="12.2" y="287.1" rx="2.1" stroke="#000" stroke-width=".5"/> <stop offset="0" id="stop9403" stop-color="#a9aba9"/>
<path d="M14.3 193.2c-1.1 0-2.1 1-2.1 2.1v15.5H2.4c-1.2 0-2.1 1-2.1 2.1v73.7c0 1.1 1 2.1 2.1 2.1h9.8v.6c0 1.2 1 2.1 2.1 2.1h68.3c1.2 0 2.2-1 2.2-2.1v-.6h11.1c1.2 0 2.2-1 2.2-2.1v-73.7c0-1.1-1-2.1-2.2-2.1H84.8v-15.5c0-1.2-1-2.1-2.2-2.1z" id="rect10" fill="#fff" stroke="#000" stroke-width="1.1"/> <stop offset="1" id="stop9405" stop-color="#848484"/>
<path d="M31 197.9c7.3 0 7.7 8.2 7.7 9.3v17.4c0 1.2-1 2.2-2.2 2.2H25.7c-1.2 0-2.2-1-2.2-2.2v-17c0-1.1.2-9.7 7.5-9.7z" id="topleft" fill="#ccc" stroke="#000" stroke-width="1.1"/> </linearGradient>
<path d="M65.5 197.9c7.3 0 7.7 8.2 7.7 9.3v17.4c0 1.2-1 2.2-2.2 2.2H60.2c-1.2 0-2.1-1-2.1-2.2v-17c0-1.1.2-9.7 7.4-9.7z" id="topright" fill="#ccc" stroke="#000" stroke-width="1.1"/> <linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 2.61718 -8.4555 0 1161.6036 932.34937)" id="linearGradient9387">
<path d="M65.7 266.3c-7.3 0-7.6-8.2-7.6-9.4v-17.4c0-1.2 1-2.2 2.1-2.2H71c1.2 0 2.2 1 2.2 2.2v17c0 1.2-.2 9.8-7.5 9.8z" id="bottomright" fill="#ccc" stroke="#000" stroke-width="1.1"/> <stop offset="0" id="stop9383" stop-color="#303030"/>
<path d="M31.2 266.3c-7.3 0-7.7-8.2-7.7-9.4v-17.4c0-1.2 1-2.2 2.2-2.2h10.8c1.2 0 2.2 1 2.2 2.2v17c0 1.2-.3 9.8-7.5 9.8z" id="bottomleft" fill="#ccc" stroke="#000" stroke-width="1.1"/> <stop offset="1" id="stop9385" stop-color="#777"/>
<path d="M27.5 273.6l40.1.1c1.2 0 5.4 6.3 5.4 7.5v5.8c0 1.1-1 2.1-2.2 2.1H25.5c-1.2 0-2.1-1-2.1-2.1v-5.5c0-1.2 3-7.9 4.1-7.9z" id="center" fill="#b3b3b3" stroke="#000" stroke-width="1.1"/> </linearGradient>
<rect id="rect107" width="15.1" height="3.2" x="23.1" y="231.1" ry="1.3" fill="#247aff" stroke-width=".5"/> <clipPath id="clipPath9357">
<rect id="rect107-1" width="15.1" height="3.2" x="58.2" y="231.1" ry="1.3" fill="#ff242b" stroke-width=".5"/> <path d="M0 1145.871h1366V0H0z" id="path9355"/>
<circle id="path941" cx="49.2" cy="263.3" r="2.5" fill="#ff242b" stroke-width=".5"/> </clipPath>
<circle id="path943" cx="49.2" cy="263.3" r="4.5" fill="none" stroke="#949494" stroke-width=".5"/> <linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="rotate(124.418 344.320607 757.342015) scale(10.33459)" id="linearGradient9347">
<stop offset="0" id="stop9343" stop-color="#fff"/>
<stop offset="1" id="stop9345" stop-color="#9e9e9e"/>
</linearGradient>
<clipPath id="clipPath9305">
<path d="M0 1145.871h1366V0H0z" id="path9303"/>
</clipPath>
<linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 -5.71338 10.23004 0 1161.4999 872.46655)" id="linearGradient9295">
<stop offset="0" id="stop9291" stop-color="#f2f2f2"/>
<stop offset="1" id="stop9293" stop-color="#7a7a7a"/>
</linearGradient>
<clipPath id="clipPath9273">
<path d="M0 1145.871h1366V0H0z" id="path9271"/>
</clipPath>
</defs>
<g id="layer1" transform="translate(0 -264.2517)">
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9267">
<g id="g9269" clip-path="url(#clipPath9273)">
<g id="g9275" transform="translate(1188.0205 889.5135)">
<path d="M0 0h-53.041c-.541 0-.98.254-.98.566v29.585c0 .313.439.566.98.566H0c.541 0 .979-.253.979-.566V.566C.979.254.541 0 0 0" id="path9277" fill="#f2f2f2"/>
</g>
</g>
</g>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9279">
<g id="g9281">
<g id="g9287">
<g id="g9289">
<path d="M1134.979 898.024c-.541 0-.979-.254-.979-.567v-29.584c0-.313.438-.567.979-.567h53.042c.541 0 .979.254.979.567v29.584c0 .313-.438.567-.979.567z" id="path9297" fill="url(#linearGradient9295)"/>
</g>
</g>
</g>
</g>
<path d="M19.009995 291.64843H2.236527v-22.20479h16.773468z" id="path9307" fill="#f2f2f2" stroke-width=".384845"/>
<g id="g9309" transform="matrix(.38484 0 0 -.38484 11.821398 288.69324)">
<path d="M0 0h-6.642c-.687 0-1.245.558-1.245 1.246v12.867c0 .688.558 1.246 1.245 1.246H0c.687 0 1.245-.558 1.245-1.246V1.246C1.245.558.687 0 0 0" id="path9311" fill="#f22a21"/>
</g>
<path d="M6.251333 274.21366c-.838192 0-1.517581.67957-1.517581 1.51814v3.53633h3.083082v-3.53633c0-.83857-.67939-1.51814-1.517582-1.51814z" id="topleft" fill="#a9aba9" stroke-width=".384845"/>
<path d="M4.733752 281.18484v3.72518c0 .8378.679389 1.51702 1.517581 1.51702h.04792c.838192 0 1.51758-.67922 1.51758-1.51702v-3.72518z" id="bottomleft" fill="#a9aba9" stroke-width=".384845"/>
<g id="g9327" transform="matrix(.38484 0 0 -.38484 7.497511 280.74023)">
<path d="M0 0h-6.352c-.229 0-.415.186-.415.416v1.717c0 .229.186.415.415.415H0c.229 0 .415-.186.415-.415V.416C.415.186.229 0 0 0" id="path9329" fill="#f22a21"/>
</g>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9331">
<g id="g9333">
<g id="g9339">
<g id="g9341">
<path d="M1157.731 904.68c0-2.042 1.655-3.697 3.696-3.697 2.043 0 3.698 1.655 3.698 3.697 0 2.041-1.655 3.697-3.698 3.697-2.041 0-3.696-1.656-3.696-3.697" id="path9349" fill="url(#linearGradient9347)"/>
</g>
</g>
</g>
</g>
<g id="g9359" transform="matrix(.38484 0 0 -.38484 10.555605 276.77113)">
<path d="M0 0c-1.239 0-2.244 1.004-2.244 2.244 0 1.239 1.005 2.244 2.244 2.244 1.24 0 2.244-1.005 2.244-2.244C2.244 1.004 1.24 0 0 0" id="path9361" fill="#f22a21"/>
</g>
<g id="centerbeacon" transform="matrix(.38484 0 0 -.38484 15.001642 273.1773)">
<path d="M0 0h-23.265l-3.683 4.151v6.736H3.684V4.151z" id="path9365" fill="#a9aba9"/>
</g>
<path d="M12.061234 283.61556H9.025961v-.47952h3.035273z" id="path9367" fill="#b42e29" stroke-width=".384845"/>
<path d="M12.061234 284.49416H9.025961v-.47913h3.035273z" id="path9369" fill="#b42e29" stroke-width=".384845"/>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9371">
<g id="g9373">
<g id="g9379">
<g id="g9381">
<path d="M1140.849 934.967c-.573 0-1.038-.466-1.038-1.039v-12.452h43.585v12.452c0 .573-.465 1.039-1.037 1.039z" id="path9389" fill="url(#linearGradient9387)"/>
</g>
</g>
</g>
</g>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9391">
<g id="g9393">
<g id="g9399">
<g id="g9401">
<path d="M1139.811 863.778v-12.453c0-.803.651-1.453 1.453-1.453h40.679c.803 0 1.453.65 1.453 1.453v12.453z" id="path9409" fill="url(#linearGradient9407)"/>
</g>
</g>
</g>
</g>
<path d="M14.877744 274.21376c-.838192 0-1.517581.67957-1.517581 1.51815v3.53632h3.083082v-3.53632c0-.83858-.679389-1.51815-1.517582-1.51815z" id="topright" fill="#a9aba9" stroke-width=".384845"/>
<path d="M13.360163 281.18494v3.72518c0 .83781.679389 1.51702 1.517581 1.51702h.04792c.838192 0 1.517581-.67921 1.517581-1.51702v-3.72518z" id="bottomright" fill="#a9aba9" stroke-width=".384845"/>
<g id="g9323" transform="matrix(.38484 0 0 -.38484 16.12385 280.74023)">
<path d="M0 0h-6.352c-.228 0-.415.186-.415.416v1.717c0 .229.187.415.415.415H0c.229 0 .415-.186.415-.415V.416C.415.186.229 0 0 0" id="path9325" fill="#006db4"/>
</g>
</g> </g>
</svg> </svg>
`;
`;
} }

View File

@ -1,16 +1,96 @@
<svg xmlns="http://www.w3.org/2000/svg" width="371.7" height="418.7" viewBox="0 0 98.3 110.8" id="svg8"> <svg xmlns="http://www.w3.org/2000/svg" width="80" height="123.773" viewBox="0 0 21.166666 32.748275" id="svg10208">
<g id="layer1" transform="translate(0 -186.2)"> <defs id="defs10202">
<rect id="rect90-3" width="72.7" height="9.6" x="12.1" y="186.5" rx="2.1" fill="#666" stroke="#000" stroke-width=".5"/> <linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 -2.30835 7.23512 0 1161.6036 852.6532)" id="linearGradient9407">
<rect id="rect90" width="73.1" height="9.6" x="12.2" y="287.1" rx="2.1" stroke="#000" stroke-width=".5"/> <stop offset="0" id="stop9403" stop-color="#a9aba9"/>
<path d="M14.3 193.2c-1.1 0-2.1 1-2.1 2.1v15.5H2.4c-1.2 0-2.1 1-2.1 2.1v73.7c0 1.1 1 2.1 2.1 2.1h9.8v.6c0 1.2 1 2.1 2.1 2.1h68.3c1.2 0 2.2-1 2.2-2.1v-.6h11.1c1.2 0 2.2-1 2.2-2.1v-73.7c0-1.1-1-2.1-2.2-2.1H84.8v-15.5c0-1.2-1-2.1-2.2-2.1z" id="rect10" fill="#fff" stroke="#000" stroke-width="1.1"/> <stop offset="1" id="stop9405" stop-color="#848484"/>
<path d="M31 197.9c7.3 0 7.7 8.2 7.7 9.3v17.4c0 1.2-1 2.2-2.2 2.2H25.7c-1.2 0-2.2-1-2.2-2.2v-17c0-1.1.2-9.7 7.5-9.7z" id="topleft" fill="#ccc" stroke="#000" stroke-width="1.1"/> </linearGradient>
<path d="M65.5 197.9c7.3 0 7.7 8.2 7.7 9.3v17.4c0 1.2-1 2.2-2.2 2.2H60.2c-1.2 0-2.1-1-2.1-2.2v-17c0-1.1.2-9.7 7.4-9.7z" id="topright" fill="#ccc" stroke="#000" stroke-width="1.1"/> <linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 2.61718 -8.4555 0 1161.6036 932.34937)" id="linearGradient9387">
<path d="M65.7 266.3c-7.3 0-7.6-8.2-7.6-9.4v-17.4c0-1.2 1-2.2 2.1-2.2H71c1.2 0 2.2 1 2.2 2.2v17c0 1.2-.2 9.8-7.5 9.8z" id="bottomright" fill="#ccc" stroke="#000" stroke-width="1.1"/> <stop offset="0" id="stop9383" stop-color="#303030"/>
<path d="M31.2 266.3c-7.3 0-7.7-8.2-7.7-9.4v-17.4c0-1.2 1-2.2 2.2-2.2h10.8c1.2 0 2.2 1 2.2 2.2v17c0 1.2-.3 9.8-7.5 9.8z" id="bottomleft" fill="#ccc" stroke="#000" stroke-width="1.1"/> <stop offset="1" id="stop9385" stop-color="#777"/>
<path d="M27.5 273.6l40.1.1c1.2 0 5.4 6.3 5.4 7.5v5.8c0 1.1-1 2.1-2.2 2.1H25.5c-1.2 0-2.1-1-2.1-2.1v-5.5c0-1.2 3-7.9 4.1-7.9z" id="center" fill="#b3b3b3" stroke="#000" stroke-width="1.1"/> </linearGradient>
<rect id="rect107" width="15.1" height="3.2" x="23.1" y="231.1" ry="1.3" fill="#247aff" stroke-width=".5"/> <clipPath id="clipPath9357">
<rect id="rect107-1" width="15.1" height="3.2" x="58.2" y="231.1" ry="1.3" fill="#ff242b" stroke-width=".5"/> <path d="M0 1145.871h1366V0H0z" id="path9355"/>
<circle id="path941" cx="49.2" cy="263.3" r="2.5" fill="#ff242b" stroke-width=".5"/> </clipPath>
<circle id="path943" cx="49.2" cy="263.3" r="4.5" fill="none" stroke="#949494" stroke-width=".5"/> <linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="rotate(124.418 344.320607 757.342015) scale(10.33459)" id="linearGradient9347">
<stop offset="0" id="stop9343" stop-color="#fff"/>
<stop offset="1" id="stop9345" stop-color="#9e9e9e"/>
</linearGradient>
<clipPath id="clipPath9305">
<path d="M0 1145.871h1366V0H0z" id="path9303"/>
</clipPath>
<linearGradient x2="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 -5.71338 10.23004 0 1161.4999 872.46655)" id="linearGradient9295">
<stop offset="0" id="stop9291" stop-color="#f2f2f2"/>
<stop offset="1" id="stop9293" stop-color="#7a7a7a"/>
</linearGradient>
<clipPath id="clipPath9273">
<path d="M0 1145.871h1366V0H0z" id="path9271"/>
</clipPath>
</defs>
<g id="layer1" transform="translate(0 -264.2517)">
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9267">
<g id="g9269" clip-path="url(#clipPath9273)">
<g id="g9275" transform="translate(1188.0205 889.5135)">
<path d="M0 0h-53.041c-.541 0-.98.254-.98.566v29.585c0 .313.439.566.98.566H0c.541 0 .979-.253.979-.566V.566C.979.254.541 0 0 0" id="path9277" fill="#f2f2f2"/>
</g>
</g>
</g>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9279">
<g id="g9281">
<g id="g9287">
<g id="g9289">
<path d="M1134.979 898.024c-.541 0-.979-.254-.979-.567v-29.584c0-.313.438-.567.979-.567h53.042c.541 0 .979.254.979.567v29.584c0 .313-.438.567-.979.567z" id="path9297" fill="url(#linearGradient9295)"/>
</g>
</g>
</g>
</g>
<path d="M19.009995 291.64843H2.236527v-22.20479h16.773468z" id="path9307" fill="#f2f2f2" stroke-width=".384845"/>
<g id="g9309" transform="matrix(.38484 0 0 -.38484 11.821398 288.69324)">
<path d="M0 0h-6.642c-.687 0-1.245.558-1.245 1.246v12.867c0 .688.558 1.246 1.245 1.246H0c.687 0 1.245-.558 1.245-1.246V1.246C1.245.558.687 0 0 0" id="path9311" fill="#f22a21"/>
</g>
<path d="M6.251333 274.21366c-.838192 0-1.517581.67957-1.517581 1.51814v3.53633h3.083082v-3.53633c0-.83857-.67939-1.51814-1.517582-1.51814z" id="topleft" fill="#a9aba9" stroke-width=".384845"/>
<path d="M4.733752 281.18484v3.72518c0 .8378.679389 1.51702 1.517581 1.51702h.04792c.838192 0 1.51758-.67922 1.51758-1.51702v-3.72518z" id="bottomleft" fill="#a9aba9" stroke-width=".384845"/>
<g id="g9327" transform="matrix(.38484 0 0 -.38484 7.497511 280.74023)">
<path d="M0 0h-6.352c-.229 0-.415.186-.415.416v1.717c0 .229.186.415.415.415H0c.229 0 .415-.186.415-.415V.416C.415.186.229 0 0 0" id="path9329" fill="#f22a21"/>
</g>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9331">
<g id="g9333">
<g id="g9339">
<g id="g9341">
<path d="M1157.731 904.68c0-2.042 1.655-3.697 3.696-3.697 2.043 0 3.698 1.655 3.698 3.697 0 2.041-1.655 3.697-3.698 3.697-2.041 0-3.696-1.656-3.696-3.697" id="path9349" fill="url(#linearGradient9347)"/>
</g>
</g>
</g>
</g>
<g id="g9359" transform="matrix(.38484 0 0 -.38484 10.555605 276.77113)">
<path d="M0 0c-1.239 0-2.244 1.004-2.244 2.244 0 1.239 1.005 2.244 2.244 2.244 1.24 0 2.244-1.005 2.244-2.244C2.244 1.004 1.24 0 0 0" id="path9361" fill="#f22a21"/>
</g>
<g id="centerbeacon" transform="matrix(.38484 0 0 -.38484 15.001642 273.1773)">
<path d="M0 0h-23.265l-3.683 4.151v6.736H3.684V4.151z" id="path9365" fill="#a9aba9"/>
</g>
<path d="M12.061234 283.61556H9.025961v-.47952h3.035273z" id="path9367" fill="#b42e29" stroke-width=".384845"/>
<path d="M12.061234 284.49416H9.025961v-.47913h3.035273z" id="path9369" fill="#b42e29" stroke-width=".384845"/>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9371">
<g id="g9373">
<g id="g9379">
<g id="g9381">
<path d="M1140.849 934.967c-.573 0-1.038-.466-1.038-1.039v-12.452h43.585v12.452c0 .573-.465 1.039-1.037 1.039z" id="path9389" fill="url(#linearGradient9387)"/>
</g>
</g>
</g>
</g>
<g transform="matrix(.38484 0 0 -.38484 -436.41402 624.06906)" id="g9391">
<g id="g9393">
<g id="g9399">
<g id="g9401">
<path d="M1139.811 863.778v-12.453c0-.803.651-1.453 1.453-1.453h40.679c.803 0 1.453.65 1.453 1.453v12.453z" id="path9409" fill="url(#linearGradient9407)"/>
</g>
</g>
</g>
</g>
<path d="M14.877744 274.21376c-.838192 0-1.517581.67957-1.517581 1.51815v3.53632h3.083082v-3.53632c0-.83858-.679389-1.51815-1.517582-1.51815z" id="topright" fill="#a9aba9" stroke-width=".384845"/>
<path d="M13.360163 281.18494v3.72518c0 .83781.679389 1.51702 1.517581 1.51702h.04792c.838192 0 1.517581-.67921 1.517581-1.51702v-3.72518z" id="bottomright" fill="#a9aba9" stroke-width=".384845"/>
<g id="g9323" transform="matrix(.38484 0 0 -.38484 16.12385 280.74023)">
<path d="M0 0h-6.352c-.228 0-.415.186-.415.416v1.717c0 .229.187.415.415.415H0c.229 0 .415-.186.415-.415V.416C.415.186.229 0 0 0" id="path9325" fill="#006db4"/>
</g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -15,14 +15,14 @@ namespace pxsim.visuals {
getInnerView() { getInnerView() {
this.group = svg.elt("g") as SVGGElement; this.group = svg.elt("g") as SVGGElement;
this.group.setAttribute("transform", `scale(0.25, 0.25)`) this.group.setAttribute("transform", `scale(0.9, 0.9)`)
const xml = pxsim.visuals.normalizeXml(this.id, pxsim.visuals.REMOVE_SVG); const xml = pxsim.visuals.normalizeXml(this.id, pxsim.visuals.REMOVE_SVG);
const content = svg.parseString(xml); const content = svg.parseString(xml);
this.group.appendChild(content); this.group.appendChild(content);
const btns: Map<InfraredRemoteButton> = { const btns: Map<InfraredRemoteButton> = {
"center": InfraredRemoteButton.CenterBeacon, "centerbeacon": InfraredRemoteButton.CenterBeacon,
"topleft": InfraredRemoteButton.TopLeft, "topleft": InfraredRemoteButton.TopLeft,
"topright": InfraredRemoteButton.TopRight, "topright": InfraredRemoteButton.TopRight,
"bottomleft": InfraredRemoteButton.BottomLeft, "bottomleft": InfraredRemoteButton.BottomLeft,
@ -47,11 +47,11 @@ namespace pxsim.visuals {
} }
getInnerWidth() { getInnerWidth() {
return 98.3; return 80;
} }
getInnerHeight() { getInnerHeight() {
return 110.8; return 123.773;
} }
} }
} }