代码暂提
This commit is contained in:
parent
d353afa5dd
commit
cffefa06c6
@ -140,14 +140,24 @@
|
|||||||
<symbol id="icon-acs" width="28" height="28" viewBox="0 0 31 37" fill="none">
|
<symbol id="icon-acs" width="28" height="28" viewBox="0 0 31 37" fill="none">
|
||||||
<path d="M1.65057 24H0.357955L4.09659 13.8182H5.36932L9.10795 24H7.81534L4.77273 15.429H4.69318L1.65057 24ZM2.12784 20.0227H7.33807V21.1165H2.12784V20.0227ZM18.4086 17H17.1756C17.1027 16.6454 16.9751 16.3338 16.7928 16.0653C16.6138 15.7969 16.3951 15.5715 16.1365 15.3892C15.8813 15.2036 15.598 15.0644 15.2864 14.9716C14.9748 14.8788 14.65 14.8324 14.312 14.8324C13.6955 14.8324 13.137 14.9882 12.6365 15.2997C12.1394 15.6113 11.7433 16.0703 11.4483 16.6768C11.1567 17.2834 11.0108 18.0275 11.0108 18.9091C11.0108 19.7907 11.1567 20.5348 11.4483 21.1413C11.7433 21.7479 12.1394 22.2069 12.6365 22.5185C13.137 22.83 13.6955 22.9858 14.312 22.9858C14.65 22.9858 14.9748 22.9394 15.2864 22.8466C15.598 22.7538 15.8813 22.6162 16.1365 22.4339C16.3951 22.2483 16.6138 22.0213 16.7928 21.7528C16.9751 21.4811 17.1027 21.1695 17.1756 20.8182H18.4086C18.3158 21.3385 18.1467 21.8042 17.9015 22.2152C17.6562 22.6262 17.3513 22.9759 16.9867 23.2642C16.6221 23.5492 16.2128 23.7663 15.7587 23.9155C15.3079 24.0646 14.8257 24.1392 14.312 24.1392C13.4436 24.1392 12.6713 23.9271 11.9952 23.5028C11.3191 23.0786 10.7871 22.4754 10.3993 21.6932C10.0115 20.911 9.81765 19.983 9.81765 18.9091C9.81765 17.8352 10.0115 16.9072 10.3993 16.125C10.7871 15.3428 11.3191 14.7396 11.9952 14.3153C12.6713 13.8911 13.4436 13.679 14.312 13.679C14.8257 13.679 15.3079 13.7536 15.7587 13.9027C16.2128 14.0518 16.6221 14.2706 16.9867 14.5589C17.3513 14.844 17.6562 15.192 17.9015 15.603C18.1467 16.0107 18.3158 16.4763 18.4086 17ZM25.9691 16.3636C25.9094 15.8598 25.6675 15.4688 25.2433 15.1903C24.819 14.9119 24.2987 14.7727 23.6822 14.7727C23.2314 14.7727 22.837 14.8456 22.4989 14.9915C22.1642 15.1373 21.9023 15.3378 21.7134 15.593C21.5278 15.8482 21.435 16.1383 21.435 16.4631C21.435 16.7348 21.4996 16.9685 21.6289 17.1641C21.7615 17.3563 21.9305 17.517 22.136 17.6463C22.3415 17.7723 22.5569 17.8767 22.7823 17.9595C23.0077 18.0391 23.2148 18.1037 23.4038 18.1534L24.4379 18.4318C24.703 18.5014 24.998 18.5975 25.3228 18.7202C25.6509 18.8428 25.9641 19.0102 26.2624 19.2223C26.564 19.4311 26.8126 19.6996 27.0082 20.0277C27.2037 20.3558 27.3015 20.7585 27.3015 21.2358C27.3015 21.786 27.1573 22.2831 26.869 22.7273C26.5839 23.1714 26.1663 23.5244 25.6161 23.7862C25.0692 24.0481 24.4047 24.179 23.6225 24.179C22.8933 24.179 22.262 24.0613 21.7283 23.826C21.198 23.5907 20.7804 23.2625 20.4755 22.8416C20.1739 22.4207 20.0032 21.9318 19.9634 21.375H21.2362C21.2693 21.7595 21.3986 22.0777 21.6239 22.3295C21.8526 22.5781 22.141 22.7637 22.489 22.8864C22.8403 23.0057 23.2182 23.0653 23.6225 23.0653C24.0932 23.0653 24.5157 22.9891 24.8903 22.8366C25.2648 22.6809 25.5614 22.4654 25.7802 22.1903C25.9989 21.9119 26.1083 21.5871 26.1083 21.2159C26.1083 20.8778 26.0138 20.6027 25.8249 20.3906C25.636 20.1785 25.3874 20.0062 25.0792 19.8736C24.771 19.741 24.4379 19.625 24.0799 19.5256L22.8271 19.1676C22.0316 18.9389 21.4019 18.6125 20.9379 18.1882C20.4738 17.764 20.2418 17.2088 20.2418 16.5227C20.2418 15.9527 20.396 15.4555 20.7042 15.0312C21.0157 14.6037 21.4334 14.2723 21.957 14.0369C22.484 13.7983 23.0723 13.679 23.7219 13.679C24.3782 13.679 24.9615 13.7966 25.4719 14.032C25.9824 14.264 26.3867 14.5821 26.685 14.9865C26.9866 15.3909 27.1457 15.8499 27.1623 16.3636H25.9691Z" fill="white"/>
|
<path d="M1.65057 24H0.357955L4.09659 13.8182H5.36932L9.10795 24H7.81534L4.77273 15.429H4.69318L1.65057 24ZM2.12784 20.0227H7.33807V21.1165H2.12784V20.0227ZM18.4086 17H17.1756C17.1027 16.6454 16.9751 16.3338 16.7928 16.0653C16.6138 15.7969 16.3951 15.5715 16.1365 15.3892C15.8813 15.2036 15.598 15.0644 15.2864 14.9716C14.9748 14.8788 14.65 14.8324 14.312 14.8324C13.6955 14.8324 13.137 14.9882 12.6365 15.2997C12.1394 15.6113 11.7433 16.0703 11.4483 16.6768C11.1567 17.2834 11.0108 18.0275 11.0108 18.9091C11.0108 19.7907 11.1567 20.5348 11.4483 21.1413C11.7433 21.7479 12.1394 22.2069 12.6365 22.5185C13.137 22.83 13.6955 22.9858 14.312 22.9858C14.65 22.9858 14.9748 22.9394 15.2864 22.8466C15.598 22.7538 15.8813 22.6162 16.1365 22.4339C16.3951 22.2483 16.6138 22.0213 16.7928 21.7528C16.9751 21.4811 17.1027 21.1695 17.1756 20.8182H18.4086C18.3158 21.3385 18.1467 21.8042 17.9015 22.2152C17.6562 22.6262 17.3513 22.9759 16.9867 23.2642C16.6221 23.5492 16.2128 23.7663 15.7587 23.9155C15.3079 24.0646 14.8257 24.1392 14.312 24.1392C13.4436 24.1392 12.6713 23.9271 11.9952 23.5028C11.3191 23.0786 10.7871 22.4754 10.3993 21.6932C10.0115 20.911 9.81765 19.983 9.81765 18.9091C9.81765 17.8352 10.0115 16.9072 10.3993 16.125C10.7871 15.3428 11.3191 14.7396 11.9952 14.3153C12.6713 13.8911 13.4436 13.679 14.312 13.679C14.8257 13.679 15.3079 13.7536 15.7587 13.9027C16.2128 14.0518 16.6221 14.2706 16.9867 14.5589C17.3513 14.844 17.6562 15.192 17.9015 15.603C18.1467 16.0107 18.3158 16.4763 18.4086 17ZM25.9691 16.3636C25.9094 15.8598 25.6675 15.4688 25.2433 15.1903C24.819 14.9119 24.2987 14.7727 23.6822 14.7727C23.2314 14.7727 22.837 14.8456 22.4989 14.9915C22.1642 15.1373 21.9023 15.3378 21.7134 15.593C21.5278 15.8482 21.435 16.1383 21.435 16.4631C21.435 16.7348 21.4996 16.9685 21.6289 17.1641C21.7615 17.3563 21.9305 17.517 22.136 17.6463C22.3415 17.7723 22.5569 17.8767 22.7823 17.9595C23.0077 18.0391 23.2148 18.1037 23.4038 18.1534L24.4379 18.4318C24.703 18.5014 24.998 18.5975 25.3228 18.7202C25.6509 18.8428 25.9641 19.0102 26.2624 19.2223C26.564 19.4311 26.8126 19.6996 27.0082 20.0277C27.2037 20.3558 27.3015 20.7585 27.3015 21.2358C27.3015 21.786 27.1573 22.2831 26.869 22.7273C26.5839 23.1714 26.1663 23.5244 25.6161 23.7862C25.0692 24.0481 24.4047 24.179 23.6225 24.179C22.8933 24.179 22.262 24.0613 21.7283 23.826C21.198 23.5907 20.7804 23.2625 20.4755 22.8416C20.1739 22.4207 20.0032 21.9318 19.9634 21.375H21.2362C21.2693 21.7595 21.3986 22.0777 21.6239 22.3295C21.8526 22.5781 22.141 22.7637 22.489 22.8864C22.8403 23.0057 23.2182 23.0653 23.6225 23.0653C24.0932 23.0653 24.5157 22.9891 24.8903 22.8366C25.2648 22.6809 25.5614 22.4654 25.7802 22.1903C25.9989 21.9119 26.1083 21.5871 26.1083 21.2159C26.1083 20.8778 26.0138 20.6027 25.8249 20.3906C25.636 20.1785 25.3874 20.0062 25.0792 19.8736C24.771 19.741 24.4379 19.625 24.0799 19.5256L22.8271 19.1676C22.0316 18.9389 21.4019 18.6125 20.9379 18.1882C20.4738 17.764 20.2418 17.2088 20.2418 16.5227C20.2418 15.9527 20.396 15.4555 20.7042 15.0312C21.0157 14.6037 21.4334 14.2723 21.957 14.0369C22.484 13.7983 23.0723 13.679 23.7219 13.679C24.3782 13.679 24.9615 13.7966 25.4719 14.032C25.9824 14.264 26.3867 14.5821 26.685 14.9865C26.9866 15.3909 27.1457 15.8499 27.1623 16.3636H25.9691Z" fill="white"/>
|
||||||
</symbol>
|
</symbol>
|
||||||
<symbol id="icon-non-fire-power-supply" viewBox="0 0 1024 1024" fill="none" width="28" height="28">
|
<symbol id="icon-non-fire-power-supply" viewBox="0 0 1024 1024" fill="white" width="24" height="24">
|
||||||
<path d="M777.898667 85.333333c28.202667 0 51.754667 24.106667 54.101333 53.034667v679.765333c0 28.928-25.898667 53.034667-54.101333 53.034667h-117.674667v50.645333a16.298667 16.298667 0 0 1-16.469333 16.853334 16.298667 16.298667 0 0 1-16.469334-16.853334v-50.645333h-98.816v50.645333A16.298667 16.298667 0 0 1 512 938.666667a16.298667 16.298667 0 0 1-16.469333-16.853334v-50.645333H396.714667v50.645333a16.298667 16.298667 0 0 1-16.469334 16.853334 16.298667 16.298667 0 0 1-16.469333-16.853334v-48.213333H246.101333A53.333333 53.333333 0 0 1 192 820.565333V138.325333C192 109.482667 217.898667 85.333333 246.101333 85.333333z m-72.96 79.530667H319.061333c-28.245333 0-54.101333 24.106667-54.101333 53.034667v523.093333a53.333333 53.333333 0 0 0 54.101333 53.034667h383.530667c28.245333 0 54.101333-24.106667 54.101333-53.034667V215.509333c0-28.928-23.509333-50.645333-51.754666-50.645333z" p-id="4599"></path><path d="M643.754667 246.826667H380.245333c-21.205333 0-35.285333 16.896-35.285333 36.181333v89.173333c0 21.717333 16.469333 36.181333 35.285333 36.181334h261.162667c21.162667 0 35.285333-16.896 35.285333-36.181334V285.44c2.346667-21.674667-14.08-38.570667-32.938666-38.570667zM481.024 619.178667H435.2c-5.973333 0-10.112-6.570667-7.978667-12.714667l45.525334-131.114667a8.576 8.576 0 0 1 7.978666-6.016h76.8c6.016 0 10.154667 6.741333 7.893334 12.885334l-26.496 71.381333H588.8c7.338667 0 11.221333 9.514667 6.4 15.530667l-122.282667 152.96c-5.973333 7.424-16.981333 0.981333-14.677333-8.533334l22.784-94.378666z" p-id="4600"></path>
|
<path d="M777.898667 85.333333c28.202667 0 51.754667 24.106667 54.101333 53.034667v679.765333c0 28.928-25.898667 53.034667-54.101333 53.034667h-117.674667v50.645333a16.298667 16.298667 0 0 1-16.469333 16.853334 16.298667 16.298667 0 0 1-16.469334-16.853334v-50.645333h-98.816v50.645333A16.298667 16.298667 0 0 1 512 938.666667a16.298667 16.298667 0 0 1-16.469333-16.853334v-50.645333H396.714667v50.645333a16.298667 16.298667 0 0 1-16.469334 16.853334 16.298667 16.298667 0 0 1-16.469333-16.853334v-48.213333H246.101333A53.333333 53.333333 0 0 1 192 820.565333V138.325333C192 109.482667 217.898667 85.333333 246.101333 85.333333z m-72.96 79.530667H319.061333c-28.245333 0-54.101333 24.106667-54.101333 53.034667v523.093333a53.333333 53.333333 0 0 0 54.101333 53.034667h383.530667c28.245333 0 54.101333-24.106667 54.101333-53.034667V215.509333c0-28.928-23.509333-50.645333-51.754666-50.645333z" p-id="4599"></path><path d="M643.754667 246.826667H380.245333c-21.205333 0-35.285333 16.896-35.285333 36.181333v89.173333c0 21.717333 16.469333 36.181333 35.285333 36.181334h261.162667c21.162667 0 35.285333-16.896 35.285333-36.181334V285.44c2.346667-21.674667-14.08-38.570667-32.938666-38.570667zM481.024 619.178667H435.2c-5.973333 0-10.112-6.570667-7.978667-12.714667l45.525334-131.114667a8.576 8.576 0 0 1 7.978666-6.016h76.8c6.016 0 10.154667 6.741333 7.893334 12.885334l-26.496 71.381333H588.8c7.338667 0 11.221333 9.514667 6.4 15.530667l-122.282667 152.96c-5.973333 7.424-16.981333 0.981333-14.677333-8.533334l22.784-94.378666z" p-id="4600"></path>
|
||||||
</symbol>
|
</symbol>
|
||||||
<symbol id="icon-water-flow-indicator" width="24" height="24" viewBox="0 0 32 32" fill="none" >
|
<symbol id="icon-water-flow-indicator" width="24" height="24" viewBox="0 0 32 32" fill="none" >
|
||||||
<circle cx="16" cy="16" r="16" fill="#D9D9D9"/>
|
<circle cx="16" cy="16" r="16" fill="#D9D9D9"/>
|
||||||
<path d="M14.233 21V10.8182H15.4659V19.9062H20.1989V21H14.233Z" fill="white"/>
|
<path d="M14.233 21V10.8182H15.4659V19.9062H20.1989V21H14.233Z" fill="white"/>
|
||||||
</symbol>
|
</symbol>
|
||||||
<symbol id="icon-signal-butterfly-valve" width="28" height="28" viewBox="0 0 1024 1024" fill="none" >
|
<symbol id="icon-signal-butterfly-valve" width="24" height="24" viewBox="0 0 1024 1024" fill="white" >
|
||||||
<path d="M510.95 461.47c-96.06 0-173.93 77.87-173.93 173.93s77.87 173.93 173.93 173.93 173.93-77.87 173.93-173.93c-0.11-96.01-77.92-173.82-173.93-173.93z m0 0" p-id="6763"></path><path d="M510.95 308.81c-180.4 0-326.63 146.24-326.63 326.63 0 180.4 146.24 326.64 326.63 326.64s326.64-146.24 326.64-326.64c-0.2-180.31-146.32-326.43-326.64-326.63z m0 557.32c-127.43 0-230.74-103.3-230.74-230.73 0-127.43 103.3-230.74 230.74-230.74 127.43 0 230.74 103.3 230.74 230.74-0.14 127.38-103.36 230.6-230.74 230.73z m0 0M469.54 66.33h82.87c50.58 0 75.86 25.29 75.86 75.86v53.6c0 50.58-25.29 75.86-75.86 75.86h-82.87c-50.58 0-75.86-25.29-75.86-75.86v-53.6c0-50.57 25.29-75.86 75.86-75.86z m0 0M702.75 264.33c-16.57 0-30-13.43-30-30V97.92c0-16.57 13.43-30 30-30s30 13.43 30 30v136.4c0 16.57-13.43 30.01-30 30.01z" p-id="6764"></path>
|
<path d="M510.95 461.47c-96.06 0-173.93 77.87-173.93 173.93s77.87 173.93 173.93 173.93 173.93-77.87 173.93-173.93c-0.11-96.01-77.92-173.82-173.93-173.93z m0 0" p-id="6763"></path><path d="M510.95 308.81c-180.4 0-326.63 146.24-326.63 326.63 0 180.4 146.24 326.64 326.63 326.64s326.64-146.24 326.64-326.64c-0.2-180.31-146.32-326.43-326.64-326.63z m0 557.32c-127.43 0-230.74-103.3-230.74-230.73 0-127.43 103.3-230.74 230.74-230.74 127.43 0 230.74 103.3 230.74 230.74-0.14 127.38-103.36 230.6-230.74 230.73z m0 0M469.54 66.33h82.87c50.58 0 75.86 25.29 75.86 75.86v53.6c0 50.58-25.29 75.86-75.86 75.86h-82.87c-50.58 0-75.86-25.29-75.86-75.86v-53.6c0-50.57 25.29-75.86 75.86-75.86z m0 0M702.75 264.33c-16.57 0-30-13.43-30-30V97.92c0-16.57 13.43-30 30-30s30 13.43 30 30v136.4c0 16.57-13.43 30.01-30 30.01z" p-id="6764"></path>
|
||||||
</symbol>
|
</symbol>
|
||||||
|
<symbol id="icon-pressure-switch" width="24" height="24" viewBox="0 0 1024 1024">
|
||||||
|
<path d="M978.432 974.336H52.736V49.152h924.16v925.184h1.536z m-35.84-893.44H89.6V942.08h853.504V80.896h-0.512z" p-id="5253"></path><path d="M719.36 381.952c0 54.784-18.432 98.304-55.296 131.072-36.864 32.768-87.552 49.152-151.04 49.152H400.896v245.76h-44.032V207.872h154.112c65.024 0 116.224 15.36 153.088 45.568 36.864 30.72 55.296 73.216 55.296 128.512z m-44.544 1.536c0-43.52-14.336-77.824-42.496-102.4-28.672-24.576-71.168-36.864-127.488-36.864H400.896v281.6h108.032c52.736 0 93.696-12.288 122.88-36.864 28.16-24.576 43.008-59.904 43.008-105.472z" p-id="5254"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-fault-valve" width="24" height="24" viewBox="0 0 1343 1024">
|
||||||
|
<path d="M440.104439 99.262456h130.579032c13.051505 0 23.703837 10.428409 23.703837 23.192014v39.66634c0 12.731616 10.684321 23.192013 23.703837 23.192013h78.916823c13.051505 0 23.703837-10.460398 23.703837-23.192013v-39.66634c0-12.763605 10.652332-23.192013 23.671848-23.192014h130.387098c13.019516 0 23.671848-10.428409 23.671848-23.192013V23.192653a23.511903 23.511903 0 0 0-23.671848-23.192013H440.104439a23.511903 23.511903 0 0 0-23.671848 23.192013v52.87779c0 12.763605 10.652332 23.192013 23.671848 23.192013zM1319.865471 411.378971h-54.061382a23.511903 23.511903 0 0 0-23.671848 23.192014v22.712178a23.511903 23.511903 0 0 1-23.671848 23.192013h-52.142044a23.511903 23.511903 0 0 1-23.735826-23.192013v-52.87779a23.511903 23.511903 0 0 0-23.671848-23.192013h-92.192251c-13.051505 0-30.581469-7.86929-39.34645-17.370019L910.790347 278.304799c-8.764982-9.532717-26.326934-17.402007-39.602362-17.402007H428.972273c-13.051505 0-30.325557 8.125202-38.642693 18.073775l-108.058787 131.28279c-8.317136 9.948574-25.591187 18.073776-38.642692 18.073776h-23.92776a23.511903 23.511903 0 0 0-23.671848 23.192013v110.617906a23.511903 23.511903 0 0 1-23.735826 23.192013H125.140905a23.511903 23.511903 0 0 1-23.703837-23.192013v-127.540078a23.511903 23.511903 0 0 0-23.671848-23.192014H23.671848a23.511903 23.511903 0 0 0-23.703837 23.192014v425.101605c0 12.731616 10.652332 23.160024 23.671848 23.192013h54.061383c13.051505 0 23.703837-10.460398 23.703837-23.192013v-127.572067c0-12.763605 10.652332-23.192013 23.671848-23.192013h47.183751c13.051505 0 23.703837 10.428409 23.703837 23.192013v110.393983c0 12.987527 10.652332 23.415936 23.703837 23.415936h68.712337c13.051505 0 31.061303 7.421444 40.082197 16.954161l118.711118 123.797368c9.020893 9.276805 26.774779 16.954161 39.826285 16.954161h469.022481c13.019516 0 30.805391-7.86929 39.570373-17.402007l131.058866-142.60689c8.764982-9.500728 26.550857-17.402007 39.570373-17.402007h52.142044c13.051505 0 23.703837 8.349125 23.703837 18.329688 0 10.204486 10.652332 18.297699 23.703837 18.297699h54.061382c13.019516 0 23.671848-10.428409 23.671848-23.192014V434.602974a23.511903 23.511903 0 0 0-23.671848-23.192014z" fill="#C0C0C0" p-id="6436"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-start-pump-button" width="24" height="24" viewBox="0 0 32 32" fill="none" >
|
||||||
|
<circle cx="16" cy="16" r="16" fill="#D9D9D9"/>
|
||||||
|
<path d="M14.3068 10.8182V21H13.1136L7.56534 13.0057H7.46591V21H6.23295V10.8182H7.42614L12.9943 18.8324H13.0938V10.8182H14.3068ZM25.3649 15.9091C25.3649 16.983 25.171 17.911 24.7832 18.6932C24.3954 19.4754 23.8635 20.0786 23.1873 20.5028C22.5112 20.9271 21.7389 21.1392 20.8706 21.1392C20.0022 21.1392 19.2299 20.9271 18.5538 20.5028C17.8777 20.0786 17.3457 19.4754 16.9579 18.6932C16.5701 17.911 16.3762 16.983 16.3762 15.9091C16.3762 14.8352 16.5701 13.9072 16.9579 13.125C17.3457 12.3428 17.8777 11.7396 18.5538 11.3153C19.2299 10.8911 20.0022 10.679 20.8706 10.679C21.7389 10.679 22.5112 10.8911 23.1873 11.3153C23.8635 11.7396 24.3954 12.3428 24.7832 13.125C25.171 13.9072 25.3649 14.8352 25.3649 15.9091ZM24.1717 15.9091C24.1717 15.0275 24.0242 14.2834 23.7292 13.6768C23.4376 13.0703 23.0415 12.6113 22.541 12.2997C22.0439 11.9882 21.487 11.8324 20.8706 11.8324C20.2541 11.8324 19.6956 11.9882 19.1951 12.2997C18.698 12.6113 18.3019 13.0703 18.0069 13.6768C17.7153 14.2834 17.5694 15.0275 17.5694 15.9091C17.5694 16.7907 17.7153 17.5348 18.0069 18.1413C18.3019 18.7479 18.698 19.2069 19.1951 19.5185C19.6956 19.83 20.2541 19.9858 20.8706 19.9858C21.487 19.9858 22.0439 19.83 22.541 19.5185C23.0415 19.2069 23.4376 18.7479 23.7292 18.1413C24.0242 17.5348 24.1717 16.7907 24.1717 15.9091Z" fill="white"/>
|
||||||
|
</symbol>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 40 KiB |
41
src/drawApp/graphics/FAS/FaultValveInteraction.ts
Normal file
41
src/drawApp/graphics/FAS/FaultValveInteraction.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import * as pb_1 from 'google-protobuf';
|
||||||
|
import { GraphicDataBase } from '../GraphicDataBase';
|
||||||
|
import {
|
||||||
|
FaultValve,
|
||||||
|
IFaultValveData,
|
||||||
|
} from 'src/graphics/FAS/faultValve/FaultValve';
|
||||||
|
import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
|
||||||
|
|
||||||
|
export class FaultValveData extends GraphicDataBase implements IFaultValveData {
|
||||||
|
constructor(data?: iscsGraphicData.FaultValve) {
|
||||||
|
let faultValve;
|
||||||
|
if (data) {
|
||||||
|
faultValve = data;
|
||||||
|
} else {
|
||||||
|
faultValve = new iscsGraphicData.FaultValve({
|
||||||
|
common: GraphicDataBase.defaultCommonInfo(FaultValve.Type),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
super(faultValve);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get data(): iscsGraphicData.FaultValve {
|
||||||
|
return this.getData<iscsGraphicData.FaultValve>();
|
||||||
|
}
|
||||||
|
|
||||||
|
get code(): string {
|
||||||
|
return this.data.code;
|
||||||
|
}
|
||||||
|
set code(v: string) {
|
||||||
|
this.data.code = v;
|
||||||
|
}
|
||||||
|
clone(): FaultValveData {
|
||||||
|
return new FaultValveData(this.data.cloneMessage());
|
||||||
|
}
|
||||||
|
copyFrom(data: FaultValveData): void {
|
||||||
|
pb_1.Message.copyInto(data.data, this.data);
|
||||||
|
}
|
||||||
|
eq(other: FaultValveData): boolean {
|
||||||
|
return pb_1.Message.equals(this.data, other.data);
|
||||||
|
}
|
||||||
|
}
|
44
src/drawApp/graphics/FAS/PressureSwitchInteraction.ts
Normal file
44
src/drawApp/graphics/FAS/PressureSwitchInteraction.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import * as pb_1 from 'google-protobuf';
|
||||||
|
import { GraphicDataBase } from '../GraphicDataBase';
|
||||||
|
import {
|
||||||
|
PressureSwitch,
|
||||||
|
IPressureSwitchData,
|
||||||
|
} from 'src/graphics/FAS/pressureSwitch/PressureSwitch';
|
||||||
|
import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
|
||||||
|
|
||||||
|
export class PressureSwitchData
|
||||||
|
extends GraphicDataBase
|
||||||
|
implements IPressureSwitchData
|
||||||
|
{
|
||||||
|
constructor(data?: iscsGraphicData.PressureSwitch) {
|
||||||
|
let pressureSwitch;
|
||||||
|
if (data) {
|
||||||
|
pressureSwitch = data;
|
||||||
|
} else {
|
||||||
|
pressureSwitch = new iscsGraphicData.PressureSwitch({
|
||||||
|
common: GraphicDataBase.defaultCommonInfo(PressureSwitch.Type),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
super(pressureSwitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get data(): iscsGraphicData.PressureSwitch {
|
||||||
|
return this.getData<iscsGraphicData.PressureSwitch>();
|
||||||
|
}
|
||||||
|
|
||||||
|
get code(): string {
|
||||||
|
return this.data.code;
|
||||||
|
}
|
||||||
|
set code(v: string) {
|
||||||
|
this.data.code = v;
|
||||||
|
}
|
||||||
|
clone(): PressureSwitchData {
|
||||||
|
return new PressureSwitchData(this.data.cloneMessage());
|
||||||
|
}
|
||||||
|
copyFrom(data: PressureSwitchData): void {
|
||||||
|
pb_1.Message.copyInto(data.data, this.data);
|
||||||
|
}
|
||||||
|
eq(other: PressureSwitchData): boolean {
|
||||||
|
return pb_1.Message.equals(this.data, other.data);
|
||||||
|
}
|
||||||
|
}
|
44
src/drawApp/graphics/FAS/StartPumpButtonInteraction.ts
Normal file
44
src/drawApp/graphics/FAS/StartPumpButtonInteraction.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import * as pb_1 from 'google-protobuf';
|
||||||
|
import { GraphicDataBase } from '../GraphicDataBase';
|
||||||
|
import {
|
||||||
|
StartPumpButton,
|
||||||
|
IStartPumpButtonData,
|
||||||
|
} from 'src/graphics/FAS/startPumpButton/StartPumpButton';
|
||||||
|
import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
|
||||||
|
|
||||||
|
export class StartPumpButtonData
|
||||||
|
extends GraphicDataBase
|
||||||
|
implements IStartPumpButtonData
|
||||||
|
{
|
||||||
|
constructor(data?: iscsGraphicData.StartPumpButton) {
|
||||||
|
let startPumpButton;
|
||||||
|
if (data) {
|
||||||
|
startPumpButton = data;
|
||||||
|
} else {
|
||||||
|
startPumpButton = new iscsGraphicData.StartPumpButton({
|
||||||
|
common: GraphicDataBase.defaultCommonInfo(StartPumpButton.Type),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
super(startPumpButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get data(): iscsGraphicData.StartPumpButton {
|
||||||
|
return this.getData<iscsGraphicData.StartPumpButton>();
|
||||||
|
}
|
||||||
|
|
||||||
|
get code(): string {
|
||||||
|
return this.data.code;
|
||||||
|
}
|
||||||
|
set code(v: string) {
|
||||||
|
this.data.code = v;
|
||||||
|
}
|
||||||
|
clone(): StartPumpButtonData {
|
||||||
|
return new StartPumpButtonData(this.data.cloneMessage());
|
||||||
|
}
|
||||||
|
copyFrom(data: StartPumpButtonData): void {
|
||||||
|
pb_1.Message.copyInto(data.data, this.data);
|
||||||
|
}
|
||||||
|
eq(other: StartPumpButtonData): boolean {
|
||||||
|
return pb_1.Message.equals(this.data, other.data);
|
||||||
|
}
|
||||||
|
}
|
@ -110,6 +110,24 @@ import {
|
|||||||
SignalButterflyValveTemplate,
|
SignalButterflyValveTemplate,
|
||||||
} from 'src/graphics/FAS/signalButterflyValve/SignalButterflyValve';
|
} from 'src/graphics/FAS/signalButterflyValve/SignalButterflyValve';
|
||||||
import { SignalButterflyValveData } from './graphics/FAS/SignalButterflyValveInteraction';
|
import { SignalButterflyValveData } from './graphics/FAS/SignalButterflyValveInteraction';
|
||||||
|
import { PressureSwitchDraw } from 'src/graphics/FAS/pressureSwitch/PressureSwitchAssistant';
|
||||||
|
import {
|
||||||
|
PressureSwitch,
|
||||||
|
PressureSwitchTemplate,
|
||||||
|
} from 'src/graphics/FAS/pressureSwitch/PressureSwitch';
|
||||||
|
import { PressureSwitchData } from './graphics/FAS/PressureSwitchInteraction';
|
||||||
|
import { FaultValveDraw } from 'src/graphics/FAS/faultValve/FaultValveAssistant';
|
||||||
|
import {
|
||||||
|
FaultValve,
|
||||||
|
FaultValveTemplate,
|
||||||
|
} from 'src/graphics/FAS/faultValve/FaultValve';
|
||||||
|
import { FaultValveData } from './graphics/FAS/FaultValveInteraction';
|
||||||
|
import { StartPumpButtonDraw } from 'src/graphics/FAS/startPumpButton/StartPumpButtonAssistant';
|
||||||
|
import {
|
||||||
|
StartPumpButton,
|
||||||
|
StartPumpButtonTemplate,
|
||||||
|
} from 'src/graphics/FAS/startPumpButton/StartPumpButton';
|
||||||
|
import { StartPumpButtonData } from './graphics/FAS/StartPumpButtonInteraction';
|
||||||
// import { getOnlyToken } from 'src/configs/TokenManage';
|
// import { getOnlyToken } from 'src/configs/TokenManage';
|
||||||
|
|
||||||
let drawApp: IDrawApp | null = null;
|
let drawApp: IDrawApp | null = null;
|
||||||
@ -187,6 +205,15 @@ export function initIscsDrawApp(): IDrawApp {
|
|||||||
app,
|
app,
|
||||||
new SignalButterflyValveTemplate(new SignalButterflyValveData())
|
new SignalButterflyValveTemplate(new SignalButterflyValveData())
|
||||||
);
|
);
|
||||||
|
new PressureSwitchDraw(
|
||||||
|
app,
|
||||||
|
new PressureSwitchTemplate(new PressureSwitchData())
|
||||||
|
);
|
||||||
|
new FaultValveDraw(app, new FaultValveTemplate(new FaultValveData()));
|
||||||
|
new StartPumpButtonDraw(
|
||||||
|
app,
|
||||||
|
new StartPumpButtonTemplate(new StartPumpButtonData())
|
||||||
|
);
|
||||||
|
|
||||||
app.addKeyboardListener(
|
app.addKeyboardListener(
|
||||||
new KeyListener({
|
new KeyListener({
|
||||||
@ -406,6 +433,15 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
|
|||||||
datas.push(new SignalButterflyValveData(signalButterflyValve));
|
datas.push(new SignalButterflyValveData(signalButterflyValve));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
fasOfPlatformAlarm.pressureSwitches.forEach((pressureSwitch) => {
|
||||||
|
datas.push(new PressureSwitchData(pressureSwitch));
|
||||||
|
});
|
||||||
|
fasOfPlatformAlarm.faultValves.forEach((faultValve) => {
|
||||||
|
datas.push(new FaultValveData(faultValve));
|
||||||
|
});
|
||||||
|
fasOfPlatformAlarm.startPumpButtons.forEach((startPumpButton) => {
|
||||||
|
datas.push(new StartPumpButtonData(startPumpButton));
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -582,6 +618,21 @@ export function saveDrawDatas(app: IDrawApp) {
|
|||||||
fasStorage.signalButterflyValves.push(
|
fasStorage.signalButterflyValves.push(
|
||||||
(signalButterflyValveData as SignalButterflyValveData).data
|
(signalButterflyValveData as SignalButterflyValveData).data
|
||||||
);
|
);
|
||||||
|
} else if (g instanceof PressureSwitch) {
|
||||||
|
const pressureSwitchData = g.saveData();
|
||||||
|
fasStorage.pressureSwitches.push(
|
||||||
|
(pressureSwitchData as PressureSwitchData).data
|
||||||
|
);
|
||||||
|
} else if (g instanceof FaultValve) {
|
||||||
|
const faultValveData = g.saveData();
|
||||||
|
fasStorage.faultValves.push(
|
||||||
|
(faultValveData as FaultValveData).data
|
||||||
|
);
|
||||||
|
} else if (g instanceof StartPumpButton) {
|
||||||
|
const startPumpButtonData = g.saveData();
|
||||||
|
fasStorage.startPumpButtons.push(
|
||||||
|
(startPumpButtonData as StartPumpButtonData).data
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
storage.fasOfPlatformAlarmStorages[i] = fasStorage;
|
storage.fasOfPlatformAlarmStorages[i] = fasStorage;
|
||||||
|
68
src/graphics/FAS/faultValve/FaultValve.ts
Normal file
68
src/graphics/FAS/faultValve/FaultValve.ts
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'jl-graphic';
|
||||||
|
import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
|
||||||
|
import FasDeviceJson from '../pndDevice/PngDevice.json';
|
||||||
|
import FasDeviceAssets from '../pndDevice/FasDevice.png';
|
||||||
|
|
||||||
|
export interface IFaultValveData extends GraphicData {
|
||||||
|
get code(): string;
|
||||||
|
set code(v: string);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FaultValveTextures {
|
||||||
|
normal: Texture;
|
||||||
|
run: Texture;
|
||||||
|
fault: Texture;
|
||||||
|
interruption: Texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FaultValve extends JlGraphic {
|
||||||
|
static Type = 'FaultValve';
|
||||||
|
_faultValve: Sprite;
|
||||||
|
faultValveTextures: FaultValveTextures;
|
||||||
|
__state = 0;
|
||||||
|
|
||||||
|
constructor(faultValveTextures: FaultValveTextures) {
|
||||||
|
super(FaultValve.Type);
|
||||||
|
this._faultValve = new Sprite();
|
||||||
|
this.faultValveTextures = faultValveTextures;
|
||||||
|
this._faultValve.anchor.set(0.5);
|
||||||
|
this.addChild(this._faultValve);
|
||||||
|
this._faultValve.texture = this.faultValveTextures.normal;
|
||||||
|
}
|
||||||
|
get code(): string {
|
||||||
|
return this.datas.code;
|
||||||
|
}
|
||||||
|
get datas(): IFaultValveData {
|
||||||
|
return this.getDatas<IFaultValveData>();
|
||||||
|
}
|
||||||
|
|
||||||
|
doRepaint(): void {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FaultValveTemplate extends JlGraphicTemplate<FaultValve> {
|
||||||
|
faultValveTextures?: FaultValveTextures;
|
||||||
|
constructor(dataTemplate: IFaultValveData) {
|
||||||
|
super(FaultValve.Type, { dataTemplate });
|
||||||
|
this.loadAssets();
|
||||||
|
}
|
||||||
|
new(): FaultValve {
|
||||||
|
if (this.faultValveTextures) {
|
||||||
|
const g = new FaultValve(this.faultValveTextures);
|
||||||
|
g.loadData(this.datas);
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
throw new Error('资源未加载/加载失败');
|
||||||
|
}
|
||||||
|
async loadAssets(): Promise<FaultValveTextures> {
|
||||||
|
const texture = await Assets.load(FasDeviceAssets);
|
||||||
|
const faultValveSheet = new Spritesheet(texture, FasDeviceJson);
|
||||||
|
const result = await faultValveSheet.parse();
|
||||||
|
this.faultValveTextures = {
|
||||||
|
normal: result['faultValveNormal.png'],
|
||||||
|
run: result['faultValveRun.png'],
|
||||||
|
fault: result['faultValveFault.png'],
|
||||||
|
interruption: result['faultValveInterruption.png'],
|
||||||
|
};
|
||||||
|
return this.faultValveTextures as FaultValveTextures;
|
||||||
|
}
|
||||||
|
}
|
124
src/graphics/FAS/faultValve/FaultValveAssistant.ts
Normal file
124
src/graphics/FAS/faultValve/FaultValveAssistant.ts
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
|
||||||
|
import {
|
||||||
|
AbsorbableLine,
|
||||||
|
AbsorbablePosition,
|
||||||
|
GraphicDrawAssistant,
|
||||||
|
GraphicInteractionPlugin,
|
||||||
|
GraphicTransformEvent,
|
||||||
|
IDrawApp,
|
||||||
|
JlGraphic,
|
||||||
|
} from 'jl-graphic';
|
||||||
|
import { FaultValve, IFaultValveData, FaultValveTemplate } from './FaultValve';
|
||||||
|
|
||||||
|
export class FaultValveDraw extends GraphicDrawAssistant<
|
||||||
|
FaultValveTemplate,
|
||||||
|
IFaultValveData
|
||||||
|
> {
|
||||||
|
_faultValve: FaultValve | null = null;
|
||||||
|
constructor(app: IDrawApp, template: FaultValveTemplate) {
|
||||||
|
super(
|
||||||
|
app,
|
||||||
|
template,
|
||||||
|
'svguse:../drawIcon.svg#icon-pressure-switch',
|
||||||
|
'故障阀'
|
||||||
|
);
|
||||||
|
FaultValveInteraction.init(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
bind(): void {
|
||||||
|
super.bind();
|
||||||
|
if (!this._faultValve) {
|
||||||
|
this._faultValve = this.graphicTemplate.new();
|
||||||
|
this.container.addChild(this._faultValve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get faultValve(): FaultValve {
|
||||||
|
if (!this._faultValve) {
|
||||||
|
this._faultValve = this.graphicTemplate.new();
|
||||||
|
this.container.addChild(this._faultValve);
|
||||||
|
}
|
||||||
|
return this._faultValve;
|
||||||
|
}
|
||||||
|
|
||||||
|
redraw(cp: Point): void {
|
||||||
|
this.faultValve.position.copyFrom(cp);
|
||||||
|
}
|
||||||
|
onLeftUp(e: FederatedMouseEvent): void {
|
||||||
|
this.faultValve.position.copyFrom(this.toCanvasCoordinates(e.global));
|
||||||
|
this.createAndStore(true);
|
||||||
|
}
|
||||||
|
prepareData(data: IFaultValveData): boolean {
|
||||||
|
data.transform = this.faultValve.saveTransform();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
onEsc(): void {
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建吸附线
|
||||||
|
* @param faultValve
|
||||||
|
*/
|
||||||
|
function buildAbsorbablePositions(
|
||||||
|
faultValve: FaultValve
|
||||||
|
): AbsorbablePosition[] {
|
||||||
|
const aps: AbsorbablePosition[] = [];
|
||||||
|
const faultValves = faultValve.queryStore.queryByType<FaultValve>(
|
||||||
|
FaultValve.Type
|
||||||
|
);
|
||||||
|
const canvas = faultValve.getCanvas();
|
||||||
|
faultValves.forEach((item) => {
|
||||||
|
if (item.id === faultValve.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ala = new AbsorbableLine(
|
||||||
|
new Point(item.x, 0),
|
||||||
|
new Point(item.x, canvas.height)
|
||||||
|
);
|
||||||
|
const alb = new AbsorbableLine(
|
||||||
|
new Point(0, item.y),
|
||||||
|
new Point(canvas.width, item.y)
|
||||||
|
);
|
||||||
|
aps.push(ala);
|
||||||
|
aps.push(alb);
|
||||||
|
});
|
||||||
|
|
||||||
|
return aps;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FaultValveInteraction extends GraphicInteractionPlugin<FaultValve> {
|
||||||
|
static Name = 'fault_valve_transform';
|
||||||
|
constructor(app: IDrawApp) {
|
||||||
|
super(FaultValveInteraction.Name, app);
|
||||||
|
}
|
||||||
|
static init(app: IDrawApp) {
|
||||||
|
return new FaultValveInteraction(app);
|
||||||
|
}
|
||||||
|
filter(...grahpics: JlGraphic[]): FaultValve[] | undefined {
|
||||||
|
return grahpics
|
||||||
|
.filter((g) => g.type === FaultValve.Type)
|
||||||
|
.map((g) => g as FaultValve);
|
||||||
|
}
|
||||||
|
bind(g: FaultValve): void {
|
||||||
|
g.eventMode = 'static';
|
||||||
|
g.cursor = 'pointer';
|
||||||
|
g.scalable = true;
|
||||||
|
g.rotatable = true;
|
||||||
|
g.on('transformstart', this.transformstart, this);
|
||||||
|
}
|
||||||
|
unbind(g: FaultValve): void {
|
||||||
|
g.eventMode = 'none';
|
||||||
|
g.scalable = false;
|
||||||
|
g.rotatable = false;
|
||||||
|
g.off('transformstart', this.transformstart, this);
|
||||||
|
}
|
||||||
|
transformstart(e: GraphicTransformEvent) {
|
||||||
|
const target = e.target as DisplayObject;
|
||||||
|
const faultValve = target.getGraphic() as FaultValve;
|
||||||
|
faultValve.getGraphicApp().setOptions({
|
||||||
|
absorbablePositions: buildAbsorbablePositions(faultValve),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
68
src/graphics/FAS/pressureSwitch/PressureSwitch.ts
Normal file
68
src/graphics/FAS/pressureSwitch/PressureSwitch.ts
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'jl-graphic';
|
||||||
|
import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
|
||||||
|
import FasDeviceJson from '../pndDevice/PngDevice.json';
|
||||||
|
import FasDeviceAssets from '../pndDevice/FasDevice.png';
|
||||||
|
|
||||||
|
export interface IPressureSwitchData extends GraphicData {
|
||||||
|
get code(): string;
|
||||||
|
set code(v: string);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PressureSwitchTextures {
|
||||||
|
normal: Texture;
|
||||||
|
run: Texture;
|
||||||
|
fault: Texture;
|
||||||
|
interruption: Texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PressureSwitch extends JlGraphic {
|
||||||
|
static Type = 'PressureSwitch';
|
||||||
|
_pressureSwitch: Sprite;
|
||||||
|
pressureSwitchTextures: PressureSwitchTextures;
|
||||||
|
__state = 0;
|
||||||
|
|
||||||
|
constructor(pressureSwitchTextures: PressureSwitchTextures) {
|
||||||
|
super(PressureSwitch.Type);
|
||||||
|
this._pressureSwitch = new Sprite();
|
||||||
|
this.pressureSwitchTextures = pressureSwitchTextures;
|
||||||
|
this._pressureSwitch.anchor.set(0.5);
|
||||||
|
this.addChild(this._pressureSwitch);
|
||||||
|
this._pressureSwitch.texture = this.pressureSwitchTextures.normal;
|
||||||
|
}
|
||||||
|
get code(): string {
|
||||||
|
return this.datas.code;
|
||||||
|
}
|
||||||
|
get datas(): IPressureSwitchData {
|
||||||
|
return this.getDatas<IPressureSwitchData>();
|
||||||
|
}
|
||||||
|
|
||||||
|
doRepaint(): void {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PressureSwitchTemplate extends JlGraphicTemplate<PressureSwitch> {
|
||||||
|
pressureSwitchTextures?: PressureSwitchTextures;
|
||||||
|
constructor(dataTemplate: IPressureSwitchData) {
|
||||||
|
super(PressureSwitch.Type, { dataTemplate });
|
||||||
|
this.loadAssets();
|
||||||
|
}
|
||||||
|
new(): PressureSwitch {
|
||||||
|
if (this.pressureSwitchTextures) {
|
||||||
|
const g = new PressureSwitch(this.pressureSwitchTextures);
|
||||||
|
g.loadData(this.datas);
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
throw new Error('资源未加载/加载失败');
|
||||||
|
}
|
||||||
|
async loadAssets(): Promise<PressureSwitchTextures> {
|
||||||
|
const texture = await Assets.load(FasDeviceAssets);
|
||||||
|
const pressureSwitchSheet = new Spritesheet(texture, FasDeviceJson);
|
||||||
|
const result = await pressureSwitchSheet.parse();
|
||||||
|
this.pressureSwitchTextures = {
|
||||||
|
normal: result['pressureSwitchNormal.png'],
|
||||||
|
run: result['pressureSwitchRun.png'],
|
||||||
|
fault: result['pressureSwitchFault.png'],
|
||||||
|
interruption: result['pressureSwitchInterruption.png'],
|
||||||
|
};
|
||||||
|
return this.pressureSwitchTextures as PressureSwitchTextures;
|
||||||
|
}
|
||||||
|
}
|
123
src/graphics/FAS/pressureSwitch/PressureSwitchAssistant.ts
Normal file
123
src/graphics/FAS/pressureSwitch/PressureSwitchAssistant.ts
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
|
||||||
|
import {
|
||||||
|
AbsorbableLine,
|
||||||
|
AbsorbablePosition,
|
||||||
|
GraphicDrawAssistant,
|
||||||
|
GraphicInteractionPlugin,
|
||||||
|
GraphicTransformEvent,
|
||||||
|
IDrawApp,
|
||||||
|
JlGraphic,
|
||||||
|
} from 'jl-graphic';
|
||||||
|
import {
|
||||||
|
IPressureSwitchData,
|
||||||
|
PressureSwitch,
|
||||||
|
PressureSwitchTemplate,
|
||||||
|
} from './PressureSwitch';
|
||||||
|
|
||||||
|
export class PressureSwitchDraw extends GraphicDrawAssistant<
|
||||||
|
PressureSwitchTemplate,
|
||||||
|
IPressureSwitchData
|
||||||
|
> {
|
||||||
|
_pressureSwitch: PressureSwitch | null = null;
|
||||||
|
constructor(app: IDrawApp, template: PressureSwitchTemplate) {
|
||||||
|
super(app, template, 'svguse:../drawIcon.svg#icon-fault-valve', '压力开关');
|
||||||
|
PressureSwitchInteraction.init(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
bind(): void {
|
||||||
|
super.bind();
|
||||||
|
if (!this._pressureSwitch) {
|
||||||
|
this._pressureSwitch = this.graphicTemplate.new();
|
||||||
|
this.container.addChild(this._pressureSwitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get pressureSwitch(): PressureSwitch {
|
||||||
|
if (!this._pressureSwitch) {
|
||||||
|
this._pressureSwitch = this.graphicTemplate.new();
|
||||||
|
this.container.addChild(this._pressureSwitch);
|
||||||
|
}
|
||||||
|
return this._pressureSwitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
redraw(cp: Point): void {
|
||||||
|
this.pressureSwitch.position.copyFrom(cp);
|
||||||
|
}
|
||||||
|
onLeftUp(e: FederatedMouseEvent): void {
|
||||||
|
this.pressureSwitch.position.copyFrom(this.toCanvasCoordinates(e.global));
|
||||||
|
this.createAndStore(true);
|
||||||
|
}
|
||||||
|
prepareData(data: IPressureSwitchData): boolean {
|
||||||
|
data.transform = this.pressureSwitch.saveTransform();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
onEsc(): void {
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建吸附线
|
||||||
|
* @param pressureSwitch
|
||||||
|
*/
|
||||||
|
function buildAbsorbablePositions(
|
||||||
|
pressureSwitch: PressureSwitch
|
||||||
|
): AbsorbablePosition[] {
|
||||||
|
const aps: AbsorbablePosition[] = [];
|
||||||
|
const pressureSwitchs = pressureSwitch.queryStore.queryByType<PressureSwitch>(
|
||||||
|
PressureSwitch.Type
|
||||||
|
);
|
||||||
|
const canvas = pressureSwitch.getCanvas();
|
||||||
|
pressureSwitchs.forEach((item) => {
|
||||||
|
if (item.id === pressureSwitch.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ala = new AbsorbableLine(
|
||||||
|
new Point(item.x, 0),
|
||||||
|
new Point(item.x, canvas.height)
|
||||||
|
);
|
||||||
|
const alb = new AbsorbableLine(
|
||||||
|
new Point(0, item.y),
|
||||||
|
new Point(canvas.width, item.y)
|
||||||
|
);
|
||||||
|
aps.push(ala);
|
||||||
|
aps.push(alb);
|
||||||
|
});
|
||||||
|
|
||||||
|
return aps;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PressureSwitchInteraction extends GraphicInteractionPlugin<PressureSwitch> {
|
||||||
|
static Name = 'pressure_switch_transform';
|
||||||
|
constructor(app: IDrawApp) {
|
||||||
|
super(PressureSwitchInteraction.Name, app);
|
||||||
|
}
|
||||||
|
static init(app: IDrawApp) {
|
||||||
|
return new PressureSwitchInteraction(app);
|
||||||
|
}
|
||||||
|
filter(...grahpics: JlGraphic[]): PressureSwitch[] | undefined {
|
||||||
|
return grahpics
|
||||||
|
.filter((g) => g.type === PressureSwitch.Type)
|
||||||
|
.map((g) => g as PressureSwitch);
|
||||||
|
}
|
||||||
|
bind(g: PressureSwitch): void {
|
||||||
|
g.eventMode = 'static';
|
||||||
|
g.cursor = 'pointer';
|
||||||
|
g.scalable = true;
|
||||||
|
g.rotatable = true;
|
||||||
|
g.on('transformstart', this.transformstart, this);
|
||||||
|
}
|
||||||
|
unbind(g: PressureSwitch): void {
|
||||||
|
g.eventMode = 'none';
|
||||||
|
g.scalable = false;
|
||||||
|
g.rotatable = false;
|
||||||
|
g.off('transformstart', this.transformstart, this);
|
||||||
|
}
|
||||||
|
transformstart(e: GraphicTransformEvent) {
|
||||||
|
const target = e.target as DisplayObject;
|
||||||
|
const pressureSwitch = target.getGraphic() as PressureSwitch;
|
||||||
|
pressureSwitch.getGraphicApp().setOptions({
|
||||||
|
absorbablePositions: buildAbsorbablePositions(pressureSwitch),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
68
src/graphics/FAS/startPumpButton/StartPumpButton.ts
Normal file
68
src/graphics/FAS/startPumpButton/StartPumpButton.ts
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
import {
|
||||||
|
GraphicData,
|
||||||
|
JlGraphic,
|
||||||
|
JlGraphicTemplate,
|
||||||
|
VectorText,
|
||||||
|
} from 'jl-graphic';
|
||||||
|
import { Graphics } from 'pixi.js';
|
||||||
|
|
||||||
|
export interface IStartPumpButtonData extends GraphicData {
|
||||||
|
get code(): string;
|
||||||
|
set code(v: string);
|
||||||
|
}
|
||||||
|
|
||||||
|
const startPumpConsts = {
|
||||||
|
circleR: 32,
|
||||||
|
circleBackground: '0x99ccff',
|
||||||
|
textColor: '0x33cc00',
|
||||||
|
text: 'ON',
|
||||||
|
fontSize: 18,
|
||||||
|
};
|
||||||
|
|
||||||
|
export class StartPumpButton extends JlGraphic {
|
||||||
|
static Type = 'StartPumpButton';
|
||||||
|
circleGraphic: Graphics = new Graphics();
|
||||||
|
textGraphic: VectorText = new VectorText();
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(StartPumpButton.Type);
|
||||||
|
this.addChild(this.circleGraphic);
|
||||||
|
this.addChild(this.textGraphic);
|
||||||
|
}
|
||||||
|
get code(): string {
|
||||||
|
return this.datas.code;
|
||||||
|
}
|
||||||
|
get datas(): IStartPumpButtonData {
|
||||||
|
return this.getDatas<IStartPumpButtonData>();
|
||||||
|
}
|
||||||
|
|
||||||
|
doRepaint(): void {
|
||||||
|
const circleGraphic = this.circleGraphic;
|
||||||
|
circleGraphic.clear();
|
||||||
|
circleGraphic.beginFill(startPumpConsts.circleBackground);
|
||||||
|
circleGraphic.drawCircle(0, 0, startPumpConsts.circleR);
|
||||||
|
circleGraphic.endFill();
|
||||||
|
|
||||||
|
this.textGraphic.text = startPumpConsts.text;
|
||||||
|
this.textGraphic.setVectorFontSize(startPumpConsts.fontSize);
|
||||||
|
this.textGraphic.anchor.set(0.5);
|
||||||
|
this.textGraphic.style.fill = startPumpConsts.textColor;
|
||||||
|
this.textGraphic.position.set(
|
||||||
|
startPumpConsts.circleR / 2,
|
||||||
|
startPumpConsts.circleR / 2
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StartPumpButtonTemplate extends JlGraphicTemplate<StartPumpButton> {
|
||||||
|
constructor(dataTemplate: IStartPumpButtonData) {
|
||||||
|
super(StartPumpButton.Type, {
|
||||||
|
dataTemplate,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
new(): StartPumpButton {
|
||||||
|
const startPumpButton = new StartPumpButton();
|
||||||
|
startPumpButton.loadData(this.datas);
|
||||||
|
return startPumpButton;
|
||||||
|
}
|
||||||
|
}
|
130
src/graphics/FAS/startPumpButton/StartPumpButtonAssistant.ts
Normal file
130
src/graphics/FAS/startPumpButton/StartPumpButtonAssistant.ts
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
|
||||||
|
import {
|
||||||
|
AbsorbableLine,
|
||||||
|
AbsorbablePosition,
|
||||||
|
GraphicDrawAssistant,
|
||||||
|
GraphicInteractionPlugin,
|
||||||
|
GraphicTransformEvent,
|
||||||
|
IDrawApp,
|
||||||
|
JlGraphic,
|
||||||
|
} from 'jl-graphic';
|
||||||
|
import {
|
||||||
|
IStartPumpButtonData,
|
||||||
|
StartPumpButton,
|
||||||
|
StartPumpButtonTemplate,
|
||||||
|
} from './StartPumpButton';
|
||||||
|
|
||||||
|
export class StartPumpButtonDraw extends GraphicDrawAssistant<
|
||||||
|
StartPumpButtonTemplate,
|
||||||
|
IStartPumpButtonData
|
||||||
|
> {
|
||||||
|
_startPumpButton: StartPumpButton | null = null;
|
||||||
|
constructor(app: IDrawApp, template: StartPumpButtonTemplate) {
|
||||||
|
super(
|
||||||
|
app,
|
||||||
|
template,
|
||||||
|
'svguse:../drawIcon.svg#icon-start-pump-button',
|
||||||
|
'启泵按钮'
|
||||||
|
);
|
||||||
|
StartPumpButtonInteraction.init(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
bind(): void {
|
||||||
|
super.bind();
|
||||||
|
if (!this._startPumpButton) {
|
||||||
|
this._startPumpButton = this.graphicTemplate.new();
|
||||||
|
this.container.addChild(this._startPumpButton);
|
||||||
|
this._startPumpButton.doRepaint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get startPumpButton(): StartPumpButton {
|
||||||
|
if (!this._startPumpButton) {
|
||||||
|
this._startPumpButton = this.graphicTemplate.new();
|
||||||
|
this.container.addChild(this._startPumpButton);
|
||||||
|
}
|
||||||
|
return this._startPumpButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
redraw(cp: Point): void {
|
||||||
|
this.startPumpButton.position.copyFrom(cp);
|
||||||
|
}
|
||||||
|
onLeftUp(e: FederatedMouseEvent): void {
|
||||||
|
this.startPumpButton.position.copyFrom(this.toCanvasCoordinates(e.global));
|
||||||
|
this.createAndStore(true);
|
||||||
|
}
|
||||||
|
prepareData(data: IStartPumpButtonData): boolean {
|
||||||
|
data.transform = this.startPumpButton.saveTransform();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
onEsc(): void {
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建吸附线
|
||||||
|
* @param startPumpButton
|
||||||
|
*/
|
||||||
|
function buildAbsorbablePositions(
|
||||||
|
startPumpButton: StartPumpButton
|
||||||
|
): AbsorbablePosition[] {
|
||||||
|
const aps: AbsorbablePosition[] = [];
|
||||||
|
const startPumpButtons =
|
||||||
|
startPumpButton.queryStore.queryByType<StartPumpButton>(
|
||||||
|
StartPumpButton.Type
|
||||||
|
);
|
||||||
|
const canvas = startPumpButton.getCanvas();
|
||||||
|
startPumpButtons.forEach((item) => {
|
||||||
|
if (item.id === startPumpButton.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ala = new AbsorbableLine(
|
||||||
|
new Point(item.x, 0),
|
||||||
|
new Point(item.x, canvas.height)
|
||||||
|
);
|
||||||
|
const alb = new AbsorbableLine(
|
||||||
|
new Point(0, item.y),
|
||||||
|
new Point(canvas.width, item.y)
|
||||||
|
);
|
||||||
|
aps.push(ala);
|
||||||
|
aps.push(alb);
|
||||||
|
});
|
||||||
|
|
||||||
|
return aps;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StartPumpButtonInteraction extends GraphicInteractionPlugin<StartPumpButton> {
|
||||||
|
static Name = 'start_pump_button_transform';
|
||||||
|
constructor(app: IDrawApp) {
|
||||||
|
super(StartPumpButtonInteraction.Name, app);
|
||||||
|
}
|
||||||
|
static init(app: IDrawApp) {
|
||||||
|
return new StartPumpButtonInteraction(app);
|
||||||
|
}
|
||||||
|
filter(...grahpics: JlGraphic[]): StartPumpButton[] | undefined {
|
||||||
|
return grahpics
|
||||||
|
.filter((g) => g.type === StartPumpButton.Type)
|
||||||
|
.map((g) => g as StartPumpButton);
|
||||||
|
}
|
||||||
|
bind(g: StartPumpButton): void {
|
||||||
|
g.eventMode = 'static';
|
||||||
|
g.cursor = 'pointer';
|
||||||
|
g.scalable = true;
|
||||||
|
g.rotatable = true;
|
||||||
|
g.on('transformstart', this.transformstart, this);
|
||||||
|
}
|
||||||
|
unbind(g: StartPumpButton): void {
|
||||||
|
g.eventMode = 'none';
|
||||||
|
g.scalable = false;
|
||||||
|
g.rotatable = false;
|
||||||
|
g.off('transformstart', this.transformstart, this);
|
||||||
|
}
|
||||||
|
transformstart(e: GraphicTransformEvent) {
|
||||||
|
const target = e.target as DisplayObject;
|
||||||
|
const startPumpButton = target.getGraphic() as StartPumpButton;
|
||||||
|
startPumpButton.getGraphicApp().setOptions({
|
||||||
|
absorbablePositions: buildAbsorbablePositions(startPumpButton),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -333,6 +333,9 @@ import { Afc } from 'src/graphics/FAS/afc/Afc';
|
|||||||
import { NonFirePowerSupply } from 'src/graphics/FAS/nonFirePowerSupply/NonFirePowerSupply';
|
import { NonFirePowerSupply } from 'src/graphics/FAS/nonFirePowerSupply/NonFirePowerSupply';
|
||||||
import { WaterFlowIndicator } from 'src/graphics/FAS/waterFlowIndicator/WaterFlowIndicator';
|
import { WaterFlowIndicator } from 'src/graphics/FAS/waterFlowIndicator/WaterFlowIndicator';
|
||||||
import { SignalButterflyValve } from 'src/graphics/FAS/signalButterflyValve/SignalButterflyValve';
|
import { SignalButterflyValve } from 'src/graphics/FAS/signalButterflyValve/SignalButterflyValve';
|
||||||
|
import { PressureSwitch } from 'src/graphics/FAS/pressureSwitch/PressureSwitch';
|
||||||
|
import { FaultValve } from 'src/graphics/FAS/faultValve/FaultValve';
|
||||||
|
import { StartPumpButton } from 'src/graphics/FAS/startPumpButton/StartPumpButton';
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -431,6 +434,9 @@ function handleUtilsOption() {
|
|||||||
drawAssistantsTypes.push(NonFirePowerSupply.Type);
|
drawAssistantsTypes.push(NonFirePowerSupply.Type);
|
||||||
drawAssistantsTypes.push(WaterFlowIndicator.Type);
|
drawAssistantsTypes.push(WaterFlowIndicator.Type);
|
||||||
drawAssistantsTypes.push(SignalButterflyValve.Type);
|
drawAssistantsTypes.push(SignalButterflyValve.Type);
|
||||||
|
drawAssistantsTypes.push(PressureSwitch.Type);
|
||||||
|
drawAssistantsTypes.push(FaultValve.Type);
|
||||||
|
drawAssistantsTypes.push(StartPumpButton.Type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
drawAssistantsTypes.forEach((type) => {
|
drawAssistantsTypes.forEach((type) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user