Skip to content

Commit

Permalink
feat: added status icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lipskij committed Jul 30, 2023
1 parent 1a3854a commit 7bf9268
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions src/components/quad-status/BottomStatusIcons.vue
Expand Up @@ -19,27 +19,44 @@
</template>

<script>
import { bit_check } from "../../js/bit";
export default {
props: {
lastReceivedTimestamp: { type: Number, default: 0 },
auxConfig: { type: Array, default: () => [] },
mode: { type: Number, default: 0 },
auxConfig: { type: Object, default: null },
},
computed: {
setActiveLink() {
const active = performance.now() - this.lastReceivedTimestamp < 300;
if (active) {
setActiveArmed() {
if (!this.auxConfig?.length) {
return false;
}
if (
this.auxConfig.includes("ARM") &&
bit_check(this.mode, this.auxConfig.indexOf("ARM"))
) {
return true;
}
return false;
},
setActiveArmed() {
if (this.auxConfig.length === 0) return false;
if (this.auxConfig.includes("ARM")) return true;
setFailsafeActive() {
if (!this.auxConfig?.length) {
return false;
}
if (
this.auxConfig.includes("FAILSAFE") &&
bit_check(this.mode, this.auxConfig.indexOf("FAILSAFE"))
) {
return true;
}
return false;
},
setFailsafeActive() {
if (this.auxConfig.length === 0) return false;
if (this.auxConfig.includes("FAILSAFE")) return true;
setActiveLink() {
const active = performance.now() - this.lastReceivedTimestamp < 300;
if (active) {
return true;
}
return false;
},
},
Expand Down

0 comments on commit 7bf9268

Please sign in to comment.