Skip to content

Commit

Permalink
Fix errors and unnecessary data shown when printing from SD (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
harleyg321 committed Apr 3, 2020
1 parent 085cf09 commit defbb93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/app/job-status/job-status.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<div class="job-info__progress-percentage">{{ job.progress }}<span style="font-size: 40%">%</span></div>
</div>
<span class="job-info__filename">{{ job.filename }}</span> <br />
<span class="job-info__filament">{{ job.filamentAmount }}g Filament</span> <br />
<span class="job-info__time"><span
class="job-info__time-left">{{ job.timeLeft.value }}</span>{{ job.timeLeft.unit }} left,
<span class="job-info__filament" *ngIf="job.filamentAmount !== null">{{ job.filamentAmount }}g Filament</span> <br />
<span class="job-info__time"><span *ngIf="job.timeLeft.value !== null"><span
class="job-info__time-left">{{ job.timeLeft.value }}</span>{{ job.timeLeft.unit }} left,</span>
elapsed: {{ job.timePrinted.value }}{{ job.timePrinted.unit }}</span>
</div>
<div class="job-info__file-loaded" *ngIf="job && !isPrinting() && isFileLoaded()" (swipe)="cancelLoadedFile()">
Expand Down
8 changes: 4 additions & 4 deletions src/app/job.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ export class JobService {
async (data: OctoprintJobAPI): Promise<void> => {
let job: Job = null;
if (data.job && data.job.file.name) {
this.printing = ['Printing', 'Pausing', 'Paused', 'Cancelling'].includes(data.state);
this.printing = ['Printing', 'Pausing', 'Paused', 'Cancelling', 'Printing from SD'].includes(data.state);
try {
job = {
status: data.state,
filename: data.job.file.display.replace('.gcode', '').replace('.ufp', ''),
thumbnail: await this.fileService.getThumbnail(data.job.file.path),
thumbnail: (data.job.file.origin == 'sdcard') ? undefined : await this.fileService.getThumbnail(data.job.file.path),
progress: Math.round((data.progress.filepos / data.job.file.size) * 100),
filamentAmount: this.service.convertFilamentLengthToAmount(
filamentAmount: (data.job.filament === null) ? null : this.service.convertFilamentLengthToAmount(
this.getTotalAmountOfFilament(data.job.filament),
),
timeLeft: {
value: this.service.convertSecondsToHours(data.progress.printTimeLeft),
value: (data.progress.printTimeLeft === null) ? null : this.service.convertSecondsToHours(data.progress.printTimeLeft),
unit: 'h',
},
timePrinted: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/layer-progress/layer-progress.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span class="layer-indication" *ngIf="layerProgress">
<span class="layer-indication" *ngIf="layerProgress && !(layerProgress.current === 0 && layerProgress.total === 0)">
Layer <span class="layer-indication__current-layer">{{ layerProgress.current }}</span> of {{ layerProgress.total }}
</span>

0 comments on commit defbb93

Please sign in to comment.