-
-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: moves MCU info to separate panel (#706)
Signed-off-by: Pedro Lamas <[email protected]> Co-authored-by: Mathis Mensing <[email protected]>
- Loading branch information
1 parent
5ccc2d6
commit d937f06
Showing
9 changed files
with
152 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<collapsable-card | ||
:title="$t('app.system_info.label.mcu_information', {mcu: mcu.name})" | ||
icon="$chip" | ||
> | ||
<template #menu> | ||
<app-btn | ||
color="" | ||
fab | ||
x-small | ||
text | ||
@click="showMcuConstantsDialog" | ||
> | ||
<v-icon>$viewHeadline</v-icon> | ||
</app-btn> | ||
</template> | ||
|
||
<v-simple-table dense> | ||
<tbody> | ||
<tr> | ||
<th>{{ $t('app.system_info.label.micro_controller') }}</th> | ||
<td>{{ mcu.mcu_constants.MCU }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ $t('app.system_info.label.frequency') }}</th> | ||
<td>{{ $filters.getReadableFrequencyString(+mcu.mcu_constants.CLOCK_FREQ) }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ $t('app.system_info.label.version') }}</th> | ||
<td>{{ mcu.mcu_version }}</td> | ||
</tr> | ||
</tbody> | ||
</v-simple-table> | ||
|
||
<mcu-constants-dialog | ||
v-if="mcuConstantsDialogOpen" | ||
v-model="mcuConstantsDialogOpen" | ||
:mcu="mcu" | ||
/> | ||
</collapsable-card> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import McuConstantsDialog from './McuConstantsDialog.vue' | ||
import { MCU } from '@/store/printer/types' | ||
import { Component, Prop, Vue } from 'vue-property-decorator' | ||
@Component({ | ||
components: { | ||
McuConstantsDialog | ||
} | ||
}) | ||
export default class PrinterStatsCard extends Vue { | ||
@Prop({ type: Object, required: true }) | ||
mcu!: MCU | ||
mcuConstantsDialogOpen = false | ||
showMcuConstantsDialog () { | ||
this.mcuConstantsDialogOpen = true | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<v-dialog | ||
:value="value" | ||
:max-width="500" | ||
scrollable | ||
@input="$emit('input', $event)" | ||
> | ||
<v-card> | ||
<v-card-title class="card-heading py-2"> | ||
<span class="focus--text">{{ $t('app.system_info.label.mcu_information', {mcu: mcu.name}) }}</span> | ||
</v-card-title> | ||
|
||
<v-divider /> | ||
|
||
<v-card-text> | ||
<v-simple-table dense> | ||
<tbody> | ||
<template v-for="constant in constants"> | ||
<tr :key="constant[0]"> | ||
<th>{{ constant[0] }}</th> | ||
<td>{{ constant[1] }}</td> | ||
</tr> | ||
</template> | ||
</tbody> | ||
</v-simple-table> | ||
</v-card-text> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { MCU } from '@/store/printer/types' | ||
import { Component, Prop, Vue } from 'vue-property-decorator' | ||
@Component({}) | ||
export default class McuConstantsDialog extends Vue { | ||
@Prop({ type: Boolean, default: false }) | ||
value!: boolean | ||
@Prop({ type: Object, required: true }) | ||
mcu!: MCU | ||
get constants () { | ||
return Object.entries(this.mcu.mcu_constants) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters