forked from ronlawrence3/ESP3D-WEBUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup. add new grid, show double-clicked lines on canvas
- Loading branch information
Ron Lawrence
committed
Apr 14, 2024
1 parent
5e1ae78
commit 844f97b
Showing
10 changed files
with
201 additions
and
158 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
dist | ||
src | ||
index.html.gz | ||
index.html.gz | ||
.DS_Store |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<title>ESP3D WebUI</title> | ||
<script> | ||
var target_firmware = ""; | ||
</script> | ||
<script> | ||
var web_ui_version = "replaceVERSION"; | ||
</script> | ||
<script> | ||
var direct_sd = false; | ||
</script> | ||
<script> | ||
var fw_version = ""; | ||
</script> | ||
<script> | ||
var primary_sd = "/ext/"; | ||
</script> | ||
<script> | ||
var secondary_sd = "/sd/"; | ||
</script> | ||
<!--removeIf(cleanheader)--> | ||
<link href="css/bootstrap.css" rel="stylesheet" /> | ||
<link href="css/menu.css" rel="stylesheet" /> | ||
<link href="css/tabs.css" rel="stylesheet" /> | ||
<link href="css/modaldlg.css" rel="stylesheet" /> | ||
<link href="css/wizard.css" rel="stylesheet" /> | ||
<link href="css/tablet.css" rel="stylesheet" /> | ||
<link href="css/tooltip.css" rel="stylesheet" /> | ||
<link href="css/loadingOverlay.css" rel="stylesheet" /> | ||
|
||
<!--endRemoveIf(cleanheader)--> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<title>ESP3D WebUI</title> | ||
<script> | ||
var target_firmware = ""; | ||
</script> | ||
<script> | ||
var web_ui_version = "replaceVERSION"; | ||
</script> | ||
<script> | ||
var direct_sd = false; | ||
</script> | ||
<script> | ||
var fw_version = ""; | ||
</script> | ||
<script> | ||
var primary_sd = "/ext/"; | ||
</script> | ||
<script> | ||
var secondary_sd = "/sd/"; | ||
</script> | ||
<!--removeIf(cleanheader)--> | ||
<link href="css/bootstrap.css" rel="stylesheet" /> | ||
<link href="css/menu.css" rel="stylesheet" /> | ||
<link href="css/tabs.css" rel="stylesheet" /> | ||
<link href="css/modaldlg.css" rel="stylesheet" /> | ||
<link href="css/wizard.css" rel="stylesheet" /> | ||
<link href="css/tablet.css" rel="stylesheet" /> | ||
<link href="css/tooltip.css" rel="stylesheet" /> | ||
|
||
<!-- smoosh --> | ||
<link href="css/style.css" rel="stylesheet" /> | ||
<!-- endsmoosh --> | ||
</head> | ||
<body> | ||
<file-include w3-include-html="'sub/calibrationtab.html'"></file-include> | ||
<!--removeIf(cleanheader)--> | ||
<script src="js/util.js"></script> | ||
<script src="js/wizard.js"></script> | ||
<script src="js/http.js"></script> | ||
<script src="js/icons.js"></script> | ||
<script src="js/camera.js"></script> | ||
<script src="js/settings.js"></script> | ||
<script src="js/config.js"></script> | ||
<script src="js/controls.js"></script> | ||
<script src="js/custom.js"></script> | ||
<script src="js/calculatesCalibrationStuff.js"></script> | ||
<script src="js/calibrationDraw.js"></script> | ||
<!--endRemoveIf(cleanheader)--> | ||
<!-- smoosh --> | ||
<script src="js/app.js"></script> | ||
<!-- endsmoosh --> | ||
</body> | ||
</html> | ||
<!--endRemoveIf(cleanheader)--> | ||
|
||
<!-- smoosh --> | ||
<link href="css/style.css" rel="stylesheet" /> | ||
<!-- endsmoosh --> | ||
<script src="https://cdn.jsdelivr.net/npm/ag-grid-community/dist/ag-grid-community.min.js"></script> | ||
|
||
</head> | ||
|
||
<body> | ||
<file-include w3-include-html="'sub/calibrationtab.html'"></file-include> | ||
<!--removeIf(cleanheader)--> | ||
<script src="js/calculatesCalibrationStuff.js"></script> | ||
<script src="js/calibrationDraw.js"></script> | ||
<!--endRemoveIf(cleanheader)--> | ||
<!-- smoosh --> | ||
<script src="js/app.js"></script> | ||
<!-- endsmoosh --> | ||
<script src="js/grid.js"></script> | ||
</body> | ||
|
||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Grid Options: Contains all of the grid configurations | ||
const agGridOptions = { | ||
rowData: [], | ||
columnDefs: [ | ||
{ | ||
field: "id", | ||
headerName: "ID", | ||
width: 80, | ||
}, | ||
{ | ||
field: "tl", | ||
headerName: "Top Left", | ||
width: 100, | ||
}, | ||
{ | ||
field: "tr", | ||
headerName: "Top Right", | ||
width: 100, | ||
}, | ||
{ | ||
field: "bl", | ||
headerName: "Bottom Left", | ||
width: 120, | ||
}, | ||
{ | ||
field: "br", | ||
headerName: "Bottom Right", | ||
width: 120, | ||
}, | ||
], | ||
onRowDoubleClicked: (p) => { | ||
console.log(p); | ||
if (p.data.line1) { | ||
var canvas = document.getElementById("CursorLayer"); | ||
var ctx = canvas.getContext("2d"); | ||
highlightLine(p.data.line1, ctx, 3000); | ||
highlightLine(p.data.line2, ctx, 3000); | ||
highlightLine(p.data.line3, ctx, 3000); | ||
highlightLine(p.data.line4, ctx, 3000); | ||
} | ||
}, | ||
onGridReady: (params) => { | ||
gridApi = params.api; | ||
console.log("my grid is ready", params); | ||
}, | ||
getRowId: (params) => params.data.id, | ||
}; | ||
|
||
const myGridElement = document.querySelector("#caltable"); | ||
agGrid.createGrid(myGridElement, agGridOptions); | ||
// Use this to update/ interact. | ||
let gridApi = null; | ||
|
||
function highlightLine(line, ctx, time) { | ||
ctx.fillStyle = "red"; | ||
ctx.strokeStyle = "red"; | ||
doDrawLine(line, ctx); | ||
ctx.fillStyle = "black"; | ||
ctx.strokeStyle = "#999"; | ||
setTimeout(() => { | ||
doDrawLine(line, ctx); | ||
}, time); | ||
} | ||
|
||
function doDrawLine(line, ctx) { | ||
ctx.setLineDash([5, 5]); | ||
ctx.beginPath(); | ||
ctx.moveTo(line.xBegin / 4, flipY(line.yBegin / 4)); | ||
ctx.lineTo(line.xEnd / 4, flipY(line.yEnd / 4)); | ||
ctx.stroke(); | ||
ctx.beginPath(); | ||
ctx.arc(line.xEnd / 4, flipY(line.yEnd / 4), 2, 0, 2 * Math.PI); | ||
ctx.fill(); | ||
} |
Oops, something went wrong.