浏览代码

adding initial calibration dev

Snarf 6 年之前
父节点
当前提交
3d8d189a25

+ 16 - 0
tools/calibration/LICENCE.md

@@ -0,0 +1,16 @@
+```  
+       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                 Version 2, December 2004
+ 
+Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+Everyone is permitted to copy and distribute verbatim or modified
+copies of this license document, and changing it is allowed as long
+as the name is changed.
+ 
+           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
+```

+ 6 - 0
tools/calibration/README.md

@@ -0,0 +1,6 @@
+# Calibration logging tools
+
+Quick 'n Dirty Calibration log used with [XYZ 200mm Calibration Cube](https://www.thingiverse.com/thing:1278865)
+
+
+

+ 37 - 0
tools/calibration/htdocs/assets/css/sticky-footer-navbar.css

@@ -0,0 +1,37 @@
+/* Sticky footer styles
+-------------------------------------------------- */
+html {
+  position: relative;
+  min-height: 100%;
+}
+body {
+  /* Margin bottom by footer height */
+  margin-bottom: 60px;
+}
+.footer {
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  /* Set the fixed height of the footer here */
+  height: 60px;
+  line-height: 60px; /* Vertically center the text there */
+  background-color: #f5f5f5;
+}
+
+
+/* Custom page CSS
+-------------------------------------------------- */
+/* Not required for template or sticky footer method. */
+
+body > .container {
+  padding: 60px 15px 0;
+}
+
+.footer > .container {
+  padding-right: 15px;
+  padding-left: 15px;
+}
+
+code {
+  font-size: 80%;
+}

+ 13 - 0
tools/calibration/htdocs/etc/failures.dat

@@ -0,0 +1,13 @@
+<?php
+
+$i=0;
+
+// Name 
+$failure[$i]['name']='test';
+//Score between 0(less important) and 10 (more important)
+$failure[$i]['score']=0;
+$failure[$i]['desc']='The desc';
+$failure[$i]['image']='';
+
+
+?>

+ 74 - 0
tools/calibration/htdocs/index.php

@@ -0,0 +1,74 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <meta name="description" content="">
+    <meta name="author" content="">
+    <link rel="icon" href="../../../../favicon.ico">
+
+    <title>Calibration Logging Facility</title>
+
+    <!-- Bootstrap CSS -->
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+
+    <!-- Custom styles for this template -->
+    <link href="./assets/css/sticky-footer-navbar.css" rel="stylesheet">
+  </head>
+
+  <body>
+
+    <header>
+      <!-- Fixed navbar -->
+      <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
+        <a class="navbar-brand" href="#">Calibration</a>
+        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
+          <span class="navbar-toggler-icon"></span>
+        </button>
+        <div class="collapse navbar-collapse" id="navbarCollapse">
+          <ul class="navbar-nav mr-auto">
+         <li class="nav-item active">
+              <a class="nav-link" href="?p=l">Logs <span class="sr-only"></span></a>
+            </li>
+         <li class="nav-item active">
+              <a class="nav-link" href="?p=f">Défauts <span class="sr-only"></span></a>
+            </li>
+          </ul>
+        </div>
+      </nav>
+    </header>
+
+    <!-- Begin page content -->
+    <main role="main" class="container">
+<?php
+
+if(!isset($_REQUEST['p'])) $page='d';
+else $page = $_REQUEST['p'];
+
+if(file_exists("./pages/$page.page.php"))
+  include("./pages/$page.page.php");
+else
+  include("./pages/404.page.php");
+?>
+    </main>
+
+    <footer class="footer">
+      <div class="container">
+        <span class="text-muted">&copy; 2019 - Snarf - Licenced under the <a href='https://en.wikipedia.org/wiki/WTFPL' target='_blank'>WTF Public Licence</a></span>
+      </div>
+    </footer>
+
+    <!-- Bootstrap core JavaScript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
+    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
+
+  </body>
+</html>
+
+
+<?php
+
+?>

+ 2 - 0
tools/calibration/htdocs/pages/404.page.php

@@ -0,0 +1,2 @@
+<br><br><br><br>
+<h1><center> 404 ;)</center></h2>

+ 4 - 0
tools/calibration/htdocs/pages/l.page.php

@@ -0,0 +1,4 @@
+d
+<?php
+
+?>

+ 38 - 0
tools/calibration/htdocs/plop.php

@@ -0,0 +1,38 @@
+<?php
+
+$data='./data/logs.dat';
+
+function loadLogs($file) {
+  $string = file_get_contents($file);
+  return json_decode($string, true);
+}
+
+$logs=Array();
+
+if(file_exists($data)) 
+  $logs=loadLogs($data);
+
+$uuid=uniqid('log',true);
+
+echo "UUID = $uuid<br>";
+echo '
+<form method=post>
+
+
+Filament <input type=input name=filament><br>
+Vitesse <input type=input name=v0><br>
+T° Extrudeur <input type=input name=te><br>
+T° Bed <input type=input name=tb><br>
+Fan <input type=input name=fan><br>
+ID <input type=input name=id><br>
+</form>
+';
+
+echo "<pre>";
+print_r($logs);
+echo "</pre>";
+  
+
+
+
+?>

+ 11 - 0
tools/calibration/run_server.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+
+### Internal ### 
+php_bin=$(which php)
+_f=$(readlink -f $0)
+_p=$(dirname $_f)
+
+
+$php_bin -S localhost:4242 -t $_p/htdocs
+exit $?