Add files via upload

This commit is contained in:
tpollina 2019-12-10 22:29:42 -08:00 committed by GitHub
parent a8ca22f392
commit 54e28093b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 16 deletions

View file

@ -4,5 +4,5 @@ $orientation = $_REQUEST["orientation"];
$toggler = $_REQUEST["toggler"];
$output = shell_exec('/usr/bin/python3 focus.py '.$nb_step.' '.$orientation.' '.$toggler);
$output = shell_exec('/usr/bin/python3 /var/www/html/pipeline/focus.py '.$nb_step.' '.$orientation.' '.$toggler);
?>

1
pipeline/newfile.txt Normal file
View file

@ -0,0 +1 @@
ceciestuntexte

View file

@ -9,23 +9,37 @@ $(document).ready(function(){
pump()
});
$( "#write" ).click(function() {
write()
});
function focus(toggler) {
var value = $("#nb_step").val();
var orientation = $("#orientation").val();
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "focus.php?nb_step="+value+"&orientation="+orientation+"&toggler="+toggler, true);
xmlhttp.send();
function focus(toggler) {
var value = $("#nb_step").val();
var orientation = $("#orientation").val();
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "pipeline/focus.php?nb_step="+value+"&orientation="+orientation+"&toggler="+toggler, true);
xmlhttp.send();
}
function pump() {
var volume = $("#volume").val();
var flowrate = $("#flowrate").val();
var direction = $("#direction").val();
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "pump.php?volume="+volume+"&flowrate="+flowrate+"&direction="+direction, true);
xmlhttp.send();
function pump() {
var volume = $("#volume").val();
var flowrate = $("#flowrate").val();
var direction = $("#direction").val();
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "pipeline/pump.php?volume="+volume+"&flowrate="+flowrate+"&direction="+direction, true);
xmlhttp.send();
}
function write(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "pipeline/write.php?txt=ceciestuntexte", true);
xmlhttp.send();
}
});

View file

@ -4,5 +4,5 @@ $flowrate = $_REQUEST["flowrate"];
$direction = $_REQUEST["direction"];
$output = shell_exec('/usr/bin/python3 pump.py '.$volume.' '.$flowrate.' '.$direction);
$output = shell_exec('/usr/bin/python3 /var/www/html/pipeline/pump.py '.$volume.' '.$flowrate.' '.$direction);
?>

View file

@ -5,7 +5,7 @@ from time import sleep
import sys
vol = int(sys.argv[1])
flowrate = int(sys.argv[2])
flowrate = float(sys.argv[2])
dir = str(sys.argv[3])
kit = MotorKit()

6
pipeline/write.php Normal file
View file

@ -0,0 +1,6 @@
<?php
$txt = $_REQUEST["txt"];
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
fwrite($myfile, $txt);
fclose($myfile);
?>