Skip to content

Commit

Permalink
Increased the margin for on target temp: #10
Browse files Browse the repository at this point in the history
  • Loading branch information
LazeMSS committed Jan 25, 2021
1 parent a182e4b commit 87cd1a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
4 changes: 4 additions & 0 deletions octoprint_toptemp/static/css/TopTemp.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
margin-top: 5px;
}

#navbar_plugin_toptemp .leftPad{
padding-left: 3px;
}

.UICHeaderIcons #navbar_plugin_toptemp{
margin-top: -6px;
}
Expand Down
44 changes: 26 additions & 18 deletions octoprint_toptemp/static/js/TopTemp.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,35 @@ $(function() {
// Append actual data
outputstr += self.formatTempLabel(name,data.actual,iSettings);

// Append target if different
if (!customType){
if (typeof data.target != undefined && data.target != data.actual && data.target > 0){
// Show arrow
if (iSettings.showTargetArrow()){
if (data.target > data.actual){
outputstr += '<i class="fas fa-caret-up TopTempArrow"></i>';
}else if (data.target < data.actual){
outputstr += '<i class="fas fa-caret-down TopTempArrow"></i>';
}
// Append target if not custom type, we have a target and told to show it
if (!customType && typeof data.target != undefined && data.target > 0){
var offsetL = data.target - 0.5;
var offsetU = data.target + 0.5;
var ontarget = false;

// show arrows between temps
if (iSettings.showTargetArrow()){
// Inside target margin
if (data.actual >= offsetL && data.actual <= offsetU){
ontarget = true;
}else if (data.actual < offsetL){
outputstr += '<i class="fas fa-caret-up TopTempArrow"></i>';
}else if (data.actual > offsetU){
outputstr += '<i class="fas fa-caret-down TopTempArrow"></i>';
}
// Show target temp
if (iSettings.showTargetTemp()){
if (!iSettings.showTargetArrow()){
outputstr += "/";
}
outputstr += self.formatTempLabel(name,data.target,iSettings);
}

// Show checkered if on target
if (ontarget){
outputstr += '<i class="fas fa-flag-checkered leftPad"></i>';
}else if (iSettings.showTargetTemp()){
// No arrow to seperate then we use text
if (!iSettings.showTargetArrow()){
outputstr += "/";
}
}else if(typeof data.target != undefined && data.target == data.actual && iSettings.showTargetArrow()){
outputstr += '<i class="fas fa-flag-checkered"></i>';
outputstr += self.formatTempLabel(name,data.target,iSettings);
}

}

// Should we add an icon
Expand Down

0 comments on commit 87cd1a7

Please sign in to comment.