Complete rewrite using template and SPIFFS

change to V0.4
This commit is contained in:
luc 2015-10-16 17:49:04 +08:00
parent 10e3cf1674
commit 7379ac580d
45 changed files with 5456 additions and 1788 deletions

324
esp8266/LinkedList.h Normal file
View File

@ -0,0 +1,324 @@
/*
LinkedList.h - V1.1 - Generic LinkedList implementation
Works better with FIFO, because LIFO will need to
search the entire List to find the last one;
For instructions, go to https://github.com/ivanseidel/LinkedList
Created by Ivan Seidel Gomes, March, 2013.
Released into the public domain.
Changelog: 2015/10/05: [Luc] Change false to NULL for pointers
*/
#ifndef LinkedList_h
#define LinkedList_h
template<class T>
struct ListNode
{
T data;
ListNode<T> *next;
};
template <typename T>
class LinkedList{
protected:
int _size;
ListNode<T> *root;
ListNode<T> *last;
// Helps "get" method, by saving last position
ListNode<T> *lastNodeGot;
int lastIndexGot;
// isCached should be set to FALSE
// everytime the list suffer changes
bool isCached;
ListNode<T>* getNode(int index);
public:
LinkedList();
~LinkedList();
/*
Returns current size of LinkedList
*/
virtual int size();
/*
Adds a T object in the specified index;
Unlink and link the LinkedList correcly;
Increment _size
*/
virtual bool add(int index, T);
/*
Adds a T object in the end of the LinkedList;
Increment _size;
*/
virtual bool add(T);
/*
Adds a T object in the start of the LinkedList;
Increment _size;
*/
virtual bool unshift(T);
/*
Set the object at index, with T;
Increment _size;
*/
virtual bool set(int index, T);
/*
Remove object at index;
If index is not reachable, returns false;
else, decrement _size
*/
virtual T remove(int index);
/*
Remove last object;
*/
virtual T pop();
/*
Remove first object;
*/
virtual T shift();
/*
Get the index'th element on the list;
Return Element if accessible,
else, return false;
*/
virtual T get(int index);
/*
Clear the entire array
*/
virtual void clear();
};
// Initialize LinkedList with false values
template<typename T>
LinkedList<T>::LinkedList()
{
root=NULL;
last=NULL;
_size=0;
lastNodeGot = root;
lastIndexGot = 0;
isCached = false;
}
// Clear Nodes and free Memory
template<typename T>
LinkedList<T>::~LinkedList()
{
ListNode<T>* tmp;
while(root!=NULL)
{
tmp=root;
root=root->next;
delete tmp;
}
last = NULL;
_size=0;
isCached = false;
}
/*
Actualy "logic" coding
*/
template<typename T>
ListNode<T>* LinkedList<T>::getNode(int index){
int _pos = 0;
ListNode<T>* current = root;
// Check if the node trying to get is
// immediatly AFTER the previous got one
if(isCached && lastIndexGot <= index){
_pos = lastIndexGot;
current = lastNodeGot;
}
while(_pos < index && current){
current = current->next;
_pos++;
}
// Check if the object index got is the same as the required
if(_pos == index){
isCached = true;
lastIndexGot = index;
lastNodeGot = current;
return current;
}
return NULL;
}
template<typename T>
int LinkedList<T>::size(){
return _size;
}
template<typename T>
bool LinkedList<T>::add(int index, T _t){
if(index >= _size)
return add(_t);
if(index == 0)
return unshift(_t);
ListNode<T> *tmp = new ListNode<T>(),
*_prev = getNode(index-1);
tmp->data = _t;
tmp->next = _prev->next;
_prev->next = tmp;
_size++;
isCached = false;
return true;
}
template<typename T>
bool LinkedList<T>::add(T _t){
ListNode<T> *tmp = new ListNode<T>();
tmp->data = _t;
tmp->next = NULL;
if(root){
// Already have elements inserted
last->next = tmp;
last = tmp;
}else{
// First element being inserted
root = tmp;
last = tmp;
}
_size++;
isCached = false;
return true;
}
template<typename T>
bool LinkedList<T>::unshift(T _t){
if(_size == 0)
return add(_t);
ListNode<T> *tmp = new ListNode<T>();
tmp->next = root;
tmp->data = _t;
root = tmp;
_size++;
isCached = false;
return true;
}
template<typename T>
bool LinkedList<T>::set(int index, T _t){
// Check if index position is in bounds
if(index < 0 || index >= _size)
return false;
getNode(index)->data = _t;
return true;
}
template<typename T>
T LinkedList<T>::pop(){
if(_size <= 0)
return T();
isCached = false;
if(_size >= 2){
ListNode<T> *tmp = getNode(_size - 2);
T ret = tmp->next->data;
delete(tmp->next);
tmp->next = NULL;
last = tmp;
_size--;
return ret;
}else{
// Only one element left on the list
T ret = root->data;
delete(root);
root = NULL;
last = NULL;
_size = 0;
return ret;
}
}
template<typename T>
T LinkedList<T>::shift(){
if(_size <= 0)
return T();
if(_size > 1){
ListNode<T> *_next = root->next;
T ret = root->data;
delete(root);
root = _next;
_size --;
isCached = false;
return ret;
}else{
// Only one left, then pop()
return pop();
}
}
template<typename T>
T LinkedList<T>::remove(int index){
if (index < 0 || index >= _size)
{
return T();
}
if(index == 0)
return shift();
if (index == _size-1)
{
return pop();
}
ListNode<T> *tmp = getNode(index - 1);
ListNode<T> *toDelete = tmp->next;
T ret = toDelete->data;
tmp->next = tmp->next->next;
delete(toDelete);
_size--;
isCached = false;
return ret;
}
template<typename T>
T LinkedList<T>::get(int index){
ListNode<T> *tmp = getNode(index);
return (tmp ? tmp->data : T());
}
template<typename T>
void LinkedList<T>::clear(){
while(size() > 0)
shift();
}
#endif

View File

@ -91,7 +91,7 @@ void COMMAND::check_command(String buffer)
cmd_part2=buffer.substring(ESPpos2+1);
}
//if command is a valid number then execute command
if(atoi(cmd_part1.c_str())!=0)execute_command(atoi(cmd_part1.c_str()),cmd_part2);
if(cmd_part1.toInt()!=0)execute_command(cmd_part1.toInt(),cmd_part2);
//if not is not a valid [ESPXXX] command
}
}

View File

@ -19,15 +19,16 @@
*/
#include "config.h"
#include <EEPROM.h>
#include "wifi.h"
//read a string
//a string is multibyte + \0, this is won't work if 1 char is multibyte like chinese char
bool CONFIG::read_string(word pos, char byte_buffer[], word size_max)
bool CONFIG::read_string(int pos, char byte_buffer[], int size_max)
{
//check if parameters are acceptable
if (size_max==0 || pos+size_max+1 > EEPROM_SIZE || byte_buffer== NULL)return false;
byte b=0;
word i=0;
int i=0;
//read first byte
b = EEPROM.read(pos + i);
byte_buffer[i]=b;
@ -44,12 +45,33 @@ bool CONFIG::read_string(word pos, char byte_buffer[], word size_max)
return true;
}
bool CONFIG::read_string(int pos, String & sbuffer, int size_max)
{
//check if parameters are acceptable
if (size_max==0 || pos+size_max+1 > EEPROM_SIZE )return false;
byte b=0;
int i=0;
sbuffer="";
//read first byte
b = EEPROM.read(pos + i);
sbuffer+=char(b);
i++;
//read until max size is reached or \0 is found
while (i<size_max+1 && b!=0)
{
b = EEPROM.read(pos+i);
sbuffer+=char(b);
i++;
}
return true;
}
//read a buffer of size_buffer
bool CONFIG::read_buffer(word pos, byte byte_buffer[], word size_buffer)
bool CONFIG::read_buffer(int pos, byte byte_buffer[], int size_buffer)
{
//check if parameters are acceptable
if (size_buffer==0 || pos+size_buffer > EEPROM_SIZE || byte_buffer== NULL)return false;
word i=0;
int i=0;
//read until max size is reached
while (i<size_buffer )
{
@ -60,7 +82,7 @@ bool CONFIG::read_buffer(word pos, byte byte_buffer[], word size_buffer)
}
//read a flag / byte
bool CONFIG::read_byte(word pos, byte * value)
bool CONFIG::read_byte(int pos, byte * value)
{
//check if parameters are acceptable
if (pos+1 > EEPROM_SIZE)return false;
@ -68,13 +90,21 @@ bool CONFIG::read_byte(word pos, byte * value)
return true;
}
//write a string (array of byte with a 0x00 at the end)
bool CONFIG::write_string(word pos, const char * byte_buffer, word size_buffer)
bool CONFIG::write_string(int pos, const __FlashStringHelper *str)
{
String stmp = str;
return write_string(pos,stmp.c_str());
}
//write a string (array of byte with a 0x00 at the end)
bool CONFIG::write_string(int pos, const char * byte_buffer)
{
int size_buffer;
size_buffer= strlen(byte_buffer);
//check if parameters are acceptable
if (size_buffer==0 || pos+size_buffer+1 > EEPROM_SIZE || byte_buffer== NULL)return false;
//copy the value(s)
for (word i = 0; i < size_buffer; i++) {
for (int i = 0; i < size_buffer; i++) {
EEPROM.write(pos + i, byte_buffer[i]);
}
@ -85,12 +115,12 @@ bool CONFIG::write_string(word pos, const char * byte_buffer, word size_buffer)
}
//write a buffer
bool CONFIG::write_buffer(word pos, const byte * byte_buffer, word size_buffer)
bool CONFIG::write_buffer(int pos, const byte * byte_buffer, int size_buffer)
{
//check if parameters are acceptable
if (size_buffer==0 || pos+size_buffer > EEPROM_SIZE || byte_buffer== NULL)return false;
//copy the value(s)
for (word i = 0; i < size_buffer; i++) {
for (int i = 0; i < size_buffer; i++) {
EEPROM.write(pos + i, byte_buffer[i]);
}
EEPROM.commit();
@ -98,7 +128,7 @@ bool CONFIG::write_buffer(word pos, const byte * byte_buffer, word size_buffer)
}
//read a flag / byte
bool CONFIG::write_byte(word pos, const byte value)
bool CONFIG::write_byte(int pos, const byte value)
{
//check if parameters are acceptable
if (pos+1 > EEPROM_SIZE)return false;
@ -110,44 +140,54 @@ bool CONFIG::write_byte(word pos, const byte value)
bool CONFIG::reset_config()
{
if(!CONFIG::write_byte(EP_WIFI_MODE,DEFAULT_WIFI_MODE))return false;
if(!CONFIG::write_string(EP_SSID,String(FPSTR(DEFAULT_SSID)).c_str(),strlen_P(DEFAULT_SSID)))return false;
if(!CONFIG::write_string(EP_PASSWORD,String(FPSTR(DEFAULT_PASSWORD)).c_str(),strlen_P(DEFAULT_PASSWORD)))return false;
if(!CONFIG::write_string(EP_SSID,FPSTR(DEFAULT_SSID)))return false;
if(!CONFIG::write_string(EP_PASSWORD,FPSTR(DEFAULT_PASSWORD)))return false;
if(!CONFIG::write_byte(EP_IP_MODE,DEFAULT_IP_MODE))return false;
if(!CONFIG::write_buffer(EP_IP_VALUE,DEFAULT_IP_VALUE,IP_LENGH))return false;
if(!CONFIG::write_buffer(EP_MASK_VALUE,DEFAULT_MASK_VALUE,IP_LENGH))return false;
if(!CONFIG::write_buffer(EP_GATEWAY_VALUE,DEFAULT_GATEWAY_VALUE,IP_LENGH))return false;
if(!CONFIG::write_buffer(EP_BAUD_RATE,(const byte *)&DEFAULT_BAUD_RATE,INTEGER_LENGH))return false;
if(!CONFIG::write_buffer(EP_IP_VALUE,DEFAULT_IP_VALUE,IP_LENGTH))return false;
if(!CONFIG::write_buffer(EP_MASK_VALUE,DEFAULT_MASK_VALUE,IP_LENGTH))return false;
if(!CONFIG::write_buffer(EP_GATEWAY_VALUE,DEFAULT_GATEWAY_VALUE,IP_LENGTH))return false;
if(!CONFIG::write_buffer(EP_BAUD_RATE,(const byte *)&DEFAULT_BAUD_RATE,INTEGER_LENGTH))return false;
if(!CONFIG::write_byte(EP_PHY_MODE,DEFAULT_PHY_MODE))return false;
if(!CONFIG::write_byte(EP_SLEEP_MODE,DEFAULT_SLEEP_MODE))return false;
if(!CONFIG::write_byte(EP_CHANNEL,DEFAULT_CHANNEL))return false;
if(!CONFIG::write_byte(EP_AUTH_TYPE,DEFAULT_AUTH_TYPE))return false;
if(!CONFIG::write_byte(EP_SSID_VISIBLE,DEFAULT_SSID_VISIBLE))return false;
if(!CONFIG::write_buffer(EP_WEB_PORT,(const byte *)&DEFAULT_WEB_PORT,INTEGER_LENGH))return false;
if(!CONFIG::write_buffer(EP_DATA_PORT,(const byte *)&DEFAULT_DATA_PORT,INTEGER_LENGH))return false;
if(!CONFIG::write_byte(EP_POLLING_TIME,DEFAULT_POLLING_TIME))return false;
if(!CONFIG::write_buffer(EP_WEB_PORT,(const byte *)&DEFAULT_WEB_PORT,INTEGER_LENGTH))return false;
if(!CONFIG::write_buffer(EP_DATA_PORT,(const byte *)&DEFAULT_DATA_PORT,INTEGER_LENGTH))return false;
if(!CONFIG::write_byte(EP_REFRESH_PAGE_TIME,DEFAULT_REFRESH_PAGE_TIME))return false;
if(!CONFIG::write_string(EP_HOSTNAME,wifi_config.get_default_hostname()))return false;
if(!CONFIG::write_buffer(EP_XY_FEEDRATE,(const byte *)&DEFAULT_XY_FEEDRATE,INTEGER_LENGTH))return false;
if(!CONFIG::write_buffer(EP_Z_FEEDRATE,(const byte *)&DEFAULT_Z_FEEDRATE,INTEGER_LENGTH))return false;
if(!CONFIG::write_buffer(EP_E_FEEDRATE,(const byte *)&DEFAULT_E_FEEDRATE,INTEGER_LENGTH))return false;
return true;
}
void CONFIG::print_config()
{
//use bigest size for buffer
char sbuf[MAX_PASSWORD_LENGH+1];
char sbuf[MAX_PASSWORD_LENGTH+1];
byte bbuf=0;
int ibuf=0;
if (CONFIG::read_byte(EP_WIFI_MODE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_string(EP_SSID, sbuf , MAX_SSID_LENGH))Serial.println(sbuf);
if (CONFIG::read_string(EP_PASSWORD, sbuf , MAX_PASSWORD_LENGH))Serial.println(sbuf);
if (CONFIG::read_string(EP_SSID, sbuf , MAX_SSID_LENGTH))Serial.println(sbuf);
if (CONFIG::read_string(EP_PASSWORD, sbuf , MAX_PASSWORD_LENGTH))Serial.println(sbuf);
if (CONFIG::read_byte(EP_IP_MODE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_buffer(EP_IP_VALUE,(byte *)sbuf , IP_LENGH))Serial.println(wifi_config.ip2str((byte *)sbuf));
if (CONFIG::read_buffer(EP_MASK_VALUE, (byte *)sbuf , IP_LENGH))Serial.println(wifi_config.ip2str((byte *)sbuf));
if (CONFIG::read_buffer(EP_GATEWAY_VALUE, (byte *)sbuf , IP_LENGH))Serial.println(wifi_config.ip2str((byte *)sbuf));
if (CONFIG::read_buffer(EP_BAUD_RATE, (byte *)&ibuf , INTEGER_LENGH))Serial.println(ibuf);
if (CONFIG::read_buffer(EP_IP_VALUE,(byte *)sbuf , IP_LENGTH))Serial.println(wifi_config.ip2str((byte *)sbuf));
if (CONFIG::read_buffer(EP_MASK_VALUE, (byte *)sbuf , IP_LENGTH))Serial.println(wifi_config.ip2str((byte *)sbuf));
if (CONFIG::read_buffer(EP_GATEWAY_VALUE, (byte *)sbuf , IP_LENGTH))Serial.println(wifi_config.ip2str((byte *)sbuf));
if (CONFIG::read_buffer(EP_BAUD_RATE, (byte *)&ibuf , INTEGER_LENGTH))Serial.println(ibuf);
if (CONFIG::read_byte(EP_PHY_MODE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_byte(EP_SLEEP_MODE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_byte(EP_CHANNEL, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_byte(EP_AUTH_TYPE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_byte(EP_SSID_VISIBLE, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_buffer(EP_WEB_PORT, (byte *)&ibuf , INTEGER_LENGH))Serial.println(ibuf);
if (CONFIG::read_buffer(EP_DATA_PORT, (byte *)&ibuf , INTEGER_LENGH))Serial.println(ibuf);
if (CONFIG::read_byte(EP_POLLING_TIME, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_buffer(EP_WEB_PORT, (byte *)&ibuf , INTEGER_LENGTH))Serial.println(ibuf);
if (CONFIG::read_buffer(EP_DATA_PORT, (byte *)&ibuf , INTEGER_LENGTH))Serial.println(ibuf);
if (CONFIG::read_byte(EP_REFRESH_PAGE_TIME, &bbuf ))Serial.println(byte(bbuf));
if (CONFIG::read_string(EP_HOSTNAME, sbuf , MAX_HOSTNAME_LENGTH))Serial.println(sbuf);
if (CONFIG::read_buffer(EP_XY_FEEDRATE, (byte *)&ibuf , INTEGER_LENGTH))Serial.println(ibuf);
if (CONFIG::read_buffer(EP_Z_FEEDRATE, (byte *)&ibuf , INTEGER_LENGTH))Serial.println(ibuf);
if (CONFIG::read_buffer(EP_E_FEEDRATE, (byte *)&ibuf , INTEGER_LENGTH))Serial.println(ibuf);
}

View File

@ -27,10 +27,7 @@
#define SSDP_FEATURE
//CAPTIVE_PORTAL_FEATURE: In SoftAP redirect all unknow call to main page
#define CAPTIVE_PORTAL_FEATURE
//USE_CSS_FEATURE: this feature allow to have fancy UI by adding css in page
#define USE_CSS_FEATURE
//#define CAPTIVE_PORTAL_FEATURE
#ifndef CONFIG_h
#define CONFIG_h
@ -41,7 +38,7 @@ extern "C" {
#include "user_interface.h"
}
//version and sources location
#define FW_VERSION "V0.3"
#define FW_VERSION "0.4"
#define REPOSITORY "https://github.com/luc-github/ESP8266"
@ -71,7 +68,11 @@ extern "C" {
#define EP_SSID_VISIBLE 120 //1 byte = flag
#define EP_WEB_PORT 121 //4 bytes = int
#define EP_DATA_PORT 125 //4 bytes = int
#define EP_POLLING_TIME 129 //1 bytes = flag
#define EP_REFRESH_PAGE_TIME 129 //1 bytes = flag
#define EP_HOSTNAME 130//33 bytes 32+1 = string ; warning does not support multibyte char like chinese
#define EP_XY_FEEDRATE 164//4 bytes = int
#define EP_Z_FEEDRATE 168//4 bytes = int
#define EP_E_FEEDRATE 172//4 bytes = int
@ -84,9 +85,6 @@ const byte DEFAULT_IP_VALUE[] = {192, 168, 0, 1};
const byte DEFAULT_MASK_VALUE[] = {255, 255, 255, 0};
#define DEFAULT_GATEWAY_VALUE DEFAULT_IP_VALUE
const long DEFAULT_BAUD_RATE = 9600;
#ifdef MDNS_FEATURE
const char LOCAL_NAME[] PROGMEM = "esp8266";
#endif
const char M117_[] PROGMEM = "M117 ";
#define DEFAULT_PHY_MODE PHY_MODE_11G
#define DEFAULT_SLEEP_MODE MODEM_SLEEP_T
@ -97,26 +95,32 @@ const char M117_[] PROGMEM = "M117 ";
#define DEFAULT_BEACON_INTERVAL 100
const int DEFAULT_WEB_PORT = 80;
const int DEFAULT_DATA_PORT = 8888;
#define DEFAULT_POLLING_TIME 3
#define DEFAULT_REFRESH_PAGE_TIME 3
const int DEFAULT_XY_FEEDRATE=1000;
const int DEFAULT_Z_FEEDRATE =100;
const int DEFAULT_E_FEEDRATE=400;
//sizes
#define EEPROM_SIZE 256 //max is 512
#define MAX_SSID_LENGH 32
#define MIN_SSID_LENGH 1
#define MAX_PASSWORD_LENGH 64
#define MIN_PASSWORD_LENGH 8
#define IP_LENGH 4
#define INTEGER_LENGH 4
#define MAX_SSID_LENGTH 32
#define MIN_SSID_LENGTH 1
#define MAX_PASSWORD_LENGTH 64
#define MIN_PASSWORD_LENGTH 8
#define IP_LENGTH 4
#define INTEGER_LENGTH 4
#define MAX_HOSTNAME_LENGTH 32
class CONFIG
{
public:
static bool read_string(word pos, char byte_buffer[], word size_max);
static bool read_buffer(word pos, byte byte_buffer[], word size_buffer);
static bool read_byte(word pos, byte * value);
static bool write_string(word pos, const char * byte_buffer, word size_buffer);
static bool write_buffer(word pos, const byte * byte_buffer, word size_buffer);
static bool write_byte(word pos, const byte value);
static bool read_string(int pos, char byte_buffer[], int size_max);
static bool read_string(int pos, String & sbuffer, int size_max);
static bool read_buffer(int pos, byte byte_buffer[], int size_buffer);
static bool read_byte(int pos, byte * value);
static bool write_string(int pos, const char * byte_buffer);
static bool write_string(int pos, const __FlashStringHelper *str);
static bool write_buffer(int pos, const byte * byte_buffer, int size_buffer);
static bool write_byte(int pos, const byte value);
static bool reset_config();
static void print_config();
};

View File

@ -0,0 +1,62 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Access Point</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $AP_SSID_STATUS$">
<label class="control-label" for="CONFIG1">SSID: </label><br>
<input type="text" class="form-control" id="CONFIG1" name="SSID" placeholder="SSID (8~32)" max="32" value="$AP_SSID$" style="width: auto;"></div>
<div class="form-group $AP_PASSWORD_STATUS$"><label class="control-label" for="CONFIG2">Password :</label><br>
<input type="password" class="form-control" id="CONFIG2" name="PASSWORD" placeholder="Password (0~64)" max="64" value="$AP_PASSWORD$" style="width: auto;"></div>
<div class="checkbox $IS_SSID_VISIBLE_STATUS$"><label class="control-label"><input type="checkbox" name="SSID_VISIBLE" $IS_SSID_VISIBLE$>Visible</label></div>
<div class="form-group $NETWORK_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG3">Network: </label><br>
<select name="NETWORK" id="CONFIG3" class="form-control" style="width:auto;">
$NETWORK_OPTION_LIST$
</select></div>
<div class="form-group $CHANNEL_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG4">Channel: </label><br>
<select name="CHANNEL" id="CONFIG4" class="form-control" style="width:auto;">
$CHANNEL_OPTION_LIST$
</select></div>
<div class="form-group $AUTH_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG5">Authentification: </label><br>
<select name="AUTHENTIFICATION" id="CONFIG5" class="form-control" style="width:auto;">
$AUTH_OPTION_LIST$
</select></div>
<script type="text/javascript">
function update_ip_set(){
if (document.getElementById("STATIC_IP").checked){
document.getElementById("IP_SET").style.visibility="visible";
document.getElementById("IP_SET").style.width="auto";
document.getElementById("IP_SET").style.height="auto";}
else{
document.getElementById("IP_SET").style.visibility="hidden";
document.getElementById("IP_SET").style.width="0px";
document.getElementById("IP_SET").style.height="0px";}
}
</script>
<div class="checkbox $AP_STATIC_IP_STATUS$"><label class="control-label"><input type="checkbox" id="STATIC_IP" name="STATIC_IP" onclick="update_ip_set();" $IS_STATIC_IP$>Static IP</label></div>
<div id="IP_SET" name="IP_SET">
<div class="form-group $AP_IP_STATUS$"><label class="control-label" for="CONFIG6">IP: </label><br>
<input type="text" class="form-control" id="CONFIG6" name="IP" placeholder="IP" value="$AP_IP$" max="15" style="width: auto;"></div>
<div class="form-group $AP_GW_STATUS$"><label class="control-label" for="CONFIG7">Gateway: </label><br>
<input type="text" class="form-control" id="CONFIG7" name="GATEWAY" placeholder="Gateway" value="$AP_GW$" max="15" style="width: auto;"></div>
<div class="form-group $AP_SUBNET_STATUS$"><label class="control-label" for="CONFIG8">Subnet: </label><br>
<input type="text" class="form-control" id="CONFIG8" name="SUBNET" placeholder="Subnet" value="$AP_SUBNET$" max="15" style="width: auto;"></div>
</div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
<script type="text/javascript">
update_ip_set();
</script>
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,56 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Station</div>
<div class="panel-body">
<form method="POST">
<DIV style="$AP_SCAN_VISIBILITY$">
<table class="table table-bordered table-striped" >
<caption>$AVAILABLE_AP_NB_ITEMS$ AP(s) available</caption>
<thead><tr><th>#</th><th>SSID</th><th>Signal</th><th>Protected</th></tr></thead>
<tbody>$AVAILABLE_AP[<tr><th>#$ROW_NUMBER$</th><td style="cursor:hand;" onclick="document.getElementById('CONFIG1').value='$AP_SSID$';">$AP_SSID$</td><td>$AP_SIGNAL$</td><td>$IS_PROTECTED$</td></tr>]$</tbody>
</table>
</DIV>
<div class="form-group $STA_SSID_STATUS$" ><label class="control-label" for="CONFIG1">SSID: </label><br>
<input type="text" class="form-control" id="CONFIG1" name="SSID" placeholder="SSID (8~32)" value="$STA_SSID$" max="32" style="width: auto;"></div>
<div class="form-group $STA_PASSWORD_STATUS$"><label class="control-label"for="CONFIG2">Password :</label><br>
<input type="password" class="form-control" id="CONFIG2" name="PASSWORD" placeholder="Password (0~64)" max="64" value="$STA_PASSWORD$" style="width: auto;"></div>
<div class="form-group $HOSTNAME_STATUS$" ><label class="control-label" for="CONFIG7">Hostname: </label><br>
<input type="text" class="form-control" id="CONFIG7" name="HOSTNAME" placeholder="Hostname (1~32)" value="$HOSTNAME$" max="32" style="width: auto;"></div>
<div class="form-group $NETWORK_OPTION_LIST_STATUS$"><label class="control-label"for="CONFIG3">Network: </label><br>
<select name="NETWORK" id="CONFIG3" class="form-control control-label" style="width:auto;">
$NETWORK_OPTION_LIST$
</select></div>
<script type="text/javascript">
function update_ip_set(){
if (document.getElementById("STATIC_IP").checked){
document.getElementById("IP_SET").style.visibility="visible";
document.getElementById("IP_SET").style.width="auto";
document.getElementById("IP_SET").style.height="auto";}
else{
document.getElementById("IP_SET").style.visibility="hidden";
document.getElementById("IP_SET").style.width="0px";
document.getElementById("IP_SET").style.height="0px";}
}
</script>
<div class="checkbox $STA_STATIC_IP_STATUS$"><label class="control-label">
<input type="checkbox" id="STATIC_IP" name="STATIC_IP" onclick="update_ip_set();" $IS_STATIC_IP$ >Static IP
</label></div>
<div id="IP_SET" name="IP_SET">
<div class="form-group $STA_IP_STATUS$"><label class="control-label" for="CONFIG4">IP: </label><br>
<input type="text" class="form-control" id="CONFIG4" name="IP" placeholder="IP" value="$STA_IP$" max="15" style="width: auto;"></div>
<div class="form-group $STA_GW_STATUS$"><label class="control-label"for="CONFIG5">Gateway: </label><br>
<input type="text" class="form-control" id="CONFIG5" name="GATEWAY" placeholder="Gateway" value="$STA_GW$" max="15" style="width: auto;"></div>
<div class="form-group $STA_SUBNET_STATUS$"><label class="control-label" for="CONFIG6">Subnet: </label><br>
<input type="text" class="form-control" id="CONFIG6" name="SUBNET" placeholder="Subnet" value="$STA_SUBNET$" max="15" style="width: auto;"></div>
</div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$</div></div></div>
<script type="text/javascript">update_ip_set();</script>
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,33 @@
<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">
<style>
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%; font-size:10px;}
body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333333;background-color:#ffffff;}
table{border:0px;border-spacing:0;max-width:100%;}
.table-bordered{ width:100%; border:1px solid #dddddd;margin-bottom:20px;}
th{text-align:left;}
td{white-space:nowrap; padding:2mm;}
.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9;}
.nav{ width:100%; color:#cccccc;padding-left:10;padding-right:10;list-style:none;background-color:#333333;border-radius:6px ;margin-bottom:20px;}
.panel{margin-bottom:20px;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05);}
.panel-body{padding:15px;}
.panel-heading{padding:10px 15px;color:#333333;background-color:#f5f5f5;border-color:#dddddd;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom:1px solid #dddddd;}
a{position:relative;display:block;padding:10px 15px;text-decoration:none;color:#cccccc;}
.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;}
@media (min-width:768px){.container{width:750px;}}
@media (min-width:992px){.container{width:970px;}}
@media (min-width:1200px){.container{width:1170px;}}
.text-info{color:#31708f;}
.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tbody>tr>td{border:1px solid #dddddd;}
.active{color:#ffffff;background-color:#000000;}
caption{text-align:left;}
</style><title>$PAGE_TITLE$</title> </head><body><div class="container"><table class="nav"><tr width=100%>
<td class="$MENU_HOME$"><a href="http://$WEB_ADDRESS$">Home</a></td><td class="$MENU_SYSTEM$"><a href="http://$WEB_ADDRESS$/CONFIGSYS">System Configuration</a></td>
<td class="$MENU_AP$"><a href="http://$WEB_ADDRESS$/CONFIGAP">AP Configuration</a></td><td class="$MENU_STA$"><a href="http://$WEB_ADDRESS$/CONFIGSTA">Station Configuration</a></td>
<td class="$MENU_PRINTER$"><a href="http://$WEB_ADDRESS$/PRINTER">Printer Status</a></td><td class="$MENU_SETTINGS$"><a href="http://$WEB_ADDRESS$/SETTINGS">Printer Settings</a></td>
<td width=100%>&nbsp;</td><td>FW: V$FW_VER$</td><td><a href="https://github.com/luc-github/ESP8266" >Github</a></td>
</tr>
</table>

View File

@ -0,0 +1,57 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">System</div>
<div class="panel-body"><label>Chip ID: </label><label class="text-info">$CHIP_ID$</label><BR>
<label>CPU Frequency: </label><label class="text-info">$CPU_FREQ$Hz</label><BR>
<label>Free Memory: </label><label class="text-info">$FREE_MEM$ octets</label><BR>
<label>SDK Version: </label><label class="text-info">$SDK_VER$</label><BR>
<DIV style ="$HOSTNAME_VISIBLE$"><label>Hostname: </label><label class="text-info">$HOSTNAME$</label><BR></DIV>
<DIV style ="$MDNS_VISIBLE$;"><label>mDNS name: </label><label class="text-info">$MDNS_NAME$</label><BR></DIV>
<DIV style ="$SSDP_VISIBLE$;"><label>SSDP Protocol: </label><label class="text-info">$SSDP_STATUS$</label><BR></DIV>
<DIV style ="$CAPTIVE_PORTAL_VISIBLE$;"><label>Captive Portal: </label><label class="text-info">$CAPTIVE_PORTAL_STATUS$</label><BR></DIV>
<label>Network: </label><label class="text-info">$NET_PHY$</label><BR>
<label>Sleep mode: </label><label class="text-info">$SLEEP_MODE$</label><BR>
<label>Boot version: </label><label class="text-info">$BOOT_VER$</label><BR>
<label>Baud rate: </label><label class="text-info">$BAUD_RATE$</label><BR>
<label>Web port:</label><label class="text-info">$WEB_PORT$</label><BR>
<label>Data port:</label><label class="text-info">$DATA_PORT$</label><BR>
</div></div>
<div class="panel"><div class="panel-heading">Access Point ($AP_STATUS_ENABLED$)</div>
<div class="panel-body"><label>Mac address: </label><label class="text-info">$AP_MAC$</label><BR>
<div style="$AP_VISIBILITY$;">
<label>SSID: </label><label class="text-info">$AP_SSID$</label><BR>
<label>Visible: </label><label class="text-info">$AP_IS_VISIBLE$</label><BR>
<label>Channel: </label><label class="text-info">$AP_CHANNEL$</label><BR>
<label>Authentification: </label><label class="text-info">$AP_AUTH$</label><BR>
<label>Maximum connections : </label><label class="text-info">$AP_MAX_CON$</label><BR>
<label>DHCP Server: </label><label class="text-info">$AP_DHCP_STATUS$</label><BR>
<label>IP: </label><label class="text-info">$AP_IP$</label><BR>
<label>Gateway: </label><label class="text-info">$AP_GW$</label><BR>
<label>Subnet: </label><label class="text-info">$AP_SUBNET$</label><BR>
<table class="table table-bordered table-striped">
<caption>$CONNECTED_STATIONS_NB_ITEMS$ connected station(s)</caption>
<thead><tr><th>#</th><th>Mac</th><th>IP</th></tr></thead>
<tbody>$CONNECTED_STATIONS[<TR><th>#$ROW_NUMBER$</th><td>$MAC_CONNECTED$</td><td>$IP_CONNECTED$</td></TR>]$</tbody>
</table>
</div>
</div>
</div>
<div class="panel">
<div class="panel-heading">Station ($STA_STATUS_ENABLED$)</div>
<div class="panel-body"><label>Mac address: </label><label class="text-info">$STA_MAC$</label><BR>
<div style="$STA_VISIBILITY$;">
<label>Connection to: </label><label class="text-info">$STA_SSID$</label><BR>
<label>Channel: </label><label class="text-info">$STA_CHANNEL$</label><BR>
<label>Status: </label><label class="text-info">$STA_STATUS$</label><BR>
<label>DHCP Client: </label><label class="text-info">$STA_DHCP_STATUS$</label><BR>
<label>IP: </label><label class="text-info">$STA_IP$</label><BR>
<label>Gateway: </label><label class="text-info">$STA_GW$</label><BR>
<label>Subnet: </label><label class="text-info">$STA_SUBNET$</label><BR>
</div>
</div>
</div>
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,306 @@
$INCLUDE[header.inc]$
<table>
<tr><td style="padding:0px;"><div id="Extruder1" style="visibility:hidden;height:0px;">
<table><tr><td><label>E1:&nbsp;</label></td>
<td id="data_extruder1"></td><td>0<input id="rangeinput1" type="range" min=0 max=270 onchange="Updatenumber('1');">270</td>
<td><input class="form-control" id="numberinput1" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('1');"></td><td> &#176;C
<td><input type="submit" value="Set" onclick="SendValue( 'M104 T0 S', '1');"></td></tr></table></div></td></tr>
<tr ><td style="padding:0px;"><div id="Extruder2" style="visibility:hidden;height:0px;">
<table><tr><td><label>E2:&nbsp;</label></td>
<td id="data_extruder2"></td><td>0<input id="rangeinput2" type="range" min=0 max=270 onchange="Updatenumber('2');">270</td>
<td><input class="form-control" id="numberinput2" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('2');"></td><td>&#176;C
<input type="submit" value="Set" onclick="SendValue( 'M104 T1 S', '2');">
</td></tr></table></div></td></tr>
<tr><td style="padding:0px;"><div id="Bed" style="visibility:hidden;height:0px;">
<table><tr><td><label>Bed:</label></td>
<td id="data_bed"></td><td>0<input id="rangeinputbed" type="range" min=0 max=130 onchange="Updatenumber('bed');">130</td>
<td><input class="form-control" id="numberinputbed"type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('bed');"></td><td>&#176;C
<input type="submit" value="Set" onclick="SendValue( 'M140 S', 'bed');">
</td></tr></table></div></td></tr>
<tr><td id="speed"><table><tr>
<td><label>Speed:</label></td><td class="text-info" id="currentspeed"></td>
<td>0<input id="rangeinputspeed" type="range" min=0 max=300 onchange="Updatenumber('speed');">300</td>
<td><input class="form-control" id="numberinputspeed" type="number" size="3" min=0 max=300 step=1 value=0 onchange="Updaterange('speed');"></td><td>%
<input type="submit" value="Set" onclick="SendValue( 'M220 S', 'speed');"></td>
<td>&nbsp;&nbsp;</td><td>Status:</td><td id="status" align="center" valign="middle">
<svg width="20" height="20"><circle cx="10" cy="10" r="8" stroke="black" stroke-width="2" fill="white"></circle></svg></td>
<td id="status-text"></td><td>&nbsp;&nbsp;</td><td class="btnimg" onclick="OnclickEmergency();">
<svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="red" />
<circle cx="20" cy="20" r="10" stroke="black" stroke-width="4" fill="red" /><rect x="15" y="8" width="10" height="10" style="fill:red;stroke-width:1;stroke:red" />
<rect x="18" y="6" rx="1" ry="1" width="4" height="14" style="fill:black;stroke-width:1;stroke:black" /></svg></td></tr></table></td></tr>
<tr><td id="flow"><table><tr><td><label>Flow:</label></td><td class="text-info" id="currentflow"></td>
<td>0<input id="rangeinputflow" type="range" min=0 max=300 onchange="Updatenumber('flow');">300</td>
<td><input class="form-control" id="numberinputflow" size="3" type="number" min=0 max=300 step=1 value=0 onchange="Updaterange('flow');"></td><td>%
<input type="submit" value="Set" onclick="SendValue( 'M221 S', 'flow');"></td><td>&nbsp;&nbsp;</td>
<td><label>X:</label></td><td class="text-info" id="posx"></td><td>&nbsp;&nbsp;</td><td><label>Y:</label></td><td class="text-info" id="posy"></td><td>&nbsp;&nbsp;</td>
<td><label>Z:</label></td><td class="text-info" id="posz" ></td></tr></table></td></tr>
<tr><td><table width="100%"><tr><td width="auto"><label>Command:</label></td>
<td width="100%"><input class="form-control" id="cmd" type="text" style="width: 100%;"></td>
<td width="auto"><input type="submit" value="Send" onclick="Sendcustomcommand();"></td></tr></table></td></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Info:</label></td><td width=100% id="infomsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Error:</label></td><td width=100% id="errormsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Status:</label></td><td width=100% id="statusmsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td class="btnimg" onclick="Sendcommand('M24');">
<svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" /><polygon points="15,10 30,20 15,30" fill:"white" stroke:"white" stroke-width:"1" /></svg></td>
<td class="btnimg" onclick="Sendcommand('M25');"><svg width="40" height="40" viewBox="0 0 40 40"> <circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /> <rect x="23" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /></svg></td>
<td class="btnimg" onclick="Sendcommand('M50');"><svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /></svg></td>
<td class="btnimg" onclick="alert('Not yet implemented');"><svg width="40" height="40" viewBox="0 0 40 40"><rect x="5" y="10" width="30" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /><text x="10" y="25" font-family="Verdana" font-size="14" fill="white">SD</text></svg></td>
<td>&nbsp;</td></tr></table></td></tr><tr><td><table><tr align="center" valign="middle"><td class="btnimg" onclick=" Sendcommand('G28 X');">
<svg width="40" height="40" viewBox="0 0 40 40" ><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="black" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">X</text></svg></td><td>
<table><tr><td class="btnimg" onclick="SendJogcommand( 'Y-10',XYfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7"/><text x="13" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y-1',XYfeedrate);"><svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5"/><text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y-0.1',XYfeedrate);"><svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:2"/><text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td class="btnimg" onclick=" Sendcommand('G28 Y');"><svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="blue" stroke-width:"1" stroke:"black" /><line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /><text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Y</text></svg></td>
<td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'Z-10',Zfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z-1',Zfeedrate);"><svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5"/><text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z-0.1',Zfeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder1-1" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E0-10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0-1',Efeedrate);"><svg width="40" height="20" viewBox="0 2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0-0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder2-1" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E1-10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1-1',Efeedrate);"><svg width="40" height="20" viewBox="0 2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1-0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td></tr>
<tr align="center" valign="middle"><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'X10',XYfeedrate);"><svg width="20" height="40" viewBox="12 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(-90 20 10)"/><text x="22" y="13" font-family="Verdana" font-size="7" fill="black">10</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X1',XYfeedrate);"><svg width="20" height="40" viewBox="10 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(-90 20 10)"/>
<text x="21" y="13" font-family="Verdana" font-size="7" fill="black">1</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X0.1',XYfeedrate);"><svg width="20" height="40" viewBox="14 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:2" transform="rotate(-90 20 10)"/><text x="19" y="13" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
</table></td><td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'X-0.1',XYfeedrate);"><svg width="20" height="40" viewBox="6 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:3" transform="rotate(90 20 10)"/><text x="7" y="12" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X-1',XYfeedrate);"><svg width="20" height="40" viewBox="8 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(90 20 10)"/>
<text x="11" y="13" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td><td class="btnimg" onclick="SendJogcommand( 'X-10',XYfeedrate);">
<svg width="20" height="40" viewBox="8 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(90 20 10)"/>
<text x="7" y="12" font-size="7" fill="black">-10</text></svg></td></tr></table></td>
<td></td><td><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="green">Z</text></svg></td>
<td></td><td id="JogExtruder1-2" style="visibility:hidden;"><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="orange">1</text></svg></td>
<td></td><td id="JogExtruder2-2" style="visibility:hidden;"><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="pink">2</text></svg></td></tr>
<tr align="center" valign="middle"><td class="btnimg" onclick=" Sendcommand('G28');"><svg width="40" height="40" viewBox="0 0 40 40"><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="purple" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /></svg></td><td>
<table><tr><td class="btnimg" onclick="SendJogcommand( 'Y0.1',XYfeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:3" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y1',XYfeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="17" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y10',XYfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td class="btnimg" onclick=" Sendcommand('G28 Z');"><svg width="40" height="40" viewBox="0 0 40 40"><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="green" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /><text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Z</text></svg></td>
<td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'Z0.1',Zfeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z1',Zfeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z10',Zfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder1-3" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E0+0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0+1',Efeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0+10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder2-3" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E1+0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1+1',Efeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1+10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20" ><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td></tr></table></td></tr></table>
<script type="text/javascript">
var XYfeedrate=$XY_FEEDRATE$;
var Zfeedrate=$Z_FEEDRATE$;
var Efeedrate=$E_FEEDRATE$;
function Sendcommand(commandtxt){
var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/CMD?COM="+encodeURI(commandtxt);;
xmlhttp.open("POST", url, true);
xmlhttp.send();
}
function delay(ms) {
ms += new Date().getTime();
while (new Date() < ms){}
}
function SendJogcommand( cmd, feedrate){
Sendcommand("G91");
delay(100);
Sendcommand("G1 "+cmd + " F"+feedrate);
delay(100);
Sendcommand("G90");
}
function SendValue( cmd, item){
Sendcommand(cmd + document.getElementById("numberinput"+item).value);
}
function Sendcustomcommand(){
var cmd = document.getElementById("cmd").value;
if (cmd.trim().length > 0) Sendcommand(cmd);
document.getElementById("cmd").value="";
}
function OnclickEmergency(){
Sendcommand("M112");
}
function Updatenumber(item){
document.getElementById("numberinput"+item).value=document.getElementById("rangeinput"+item).value;
}
function Updaterange(item){
document.getElementById("rangeinput"+item).value=document.getElementById("numberinput"+item).value;
}
Updaterange('1');
Updaterange('2');
Updaterange('bed');
Updaterange('speed');
Updaterange('flow');
var pulse=true;
var initialization_done = false;
function displaytemp(temperature, target,item){
var displaypicture = "<svg height=\"30px \" width=\"300px \" xmlns=\"http://wwww.w3.org/2000/svg\">\n<linearGradient id=\"gradient\">\n";
var description = String (temperature) + "/";
if (target>0)description += String (target);
else description += "Off ";
displaypicture+="<stop class=\"begin\" style=\"stop-color:green;\" offset=\"0%\"/>\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"100%\"/>\n</linearGradient>\n<linearGradient id=\"gradient2\">\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"0%\"/>\n<stop class=\"end\" style=\"stop-color:red;\" offset=\"100%\"/>\n";
displaypicture+="</linearGradient>\n<rect x=\"10\" y=\"4\" width=\"24\" height=\"21\" style=\"fill:url(#gradient)\" />\n";
displaypicture+="<rect x=\"34\" y=\"4\" width=\"280\" height=\"21\" style=\"fill:url(#gradient2)\" />\n<line x1=\"";
displaypicture+=String(target+10);
displaypicture+="\" y1=\"4\" x2=\"";
displaypicture+=String(target+10);
displaypicture+="\" y2=\"25\" style=\"stroke:rgb(255,255,255);stroke-width:1\" />\n<path d=\"M";
displaypicture+=String(temperature+5);
displaypicture+=" 0 L";
displaypicture+=String(temperature+15);
displaypicture+=" 0 L";
displaypicture+=String(temperature+10);
displaypicture+=" 8 Z\" stroke=\"white\" stroke-width=\"1\" />\n<path d=\"M";
displaypicture+=String(temperature+5);
displaypicture+=" 30 L";
displaypicture+=String(temperature+15);
displaypicture+=" 30 L";
displaypicture+=String(temperature+10);
displaypicture+=" 22 Z\" stroke=\"white\" stroke-width=\"1\"/>\n<text x=\"30\" y=\"19\" fill=\"black\" style=\"font-family: calibri; font-size:10pt;\">\n";
displaypicture+=description;
displaypicture+=" &#176;C</text>\n</svg>";
document.getElementById(item).innerHTML=displaypicture;
}
function displaystatus(status){
var content ="<svg width=\"20\" height=\"20\"><circle cx=\"10\" cy=\"10\" r=\"8\" stroke=\"black\" stroke-width=\"2\" fill=\"";
if (status=="Connected"){
if (pulse)content +="#00FF00";
else content +="#007F0E";}
else if (status=="Busy"){
if (pulse)content +="#FFD800";
else content +="#7F6A00";}
else{
if (pulse)content +="#FF0000";
else content +="#7F0000";}
content +="\"></circle></svg>";
pulse=!pulse;
document.getElementById("status").innerHTML=content;
document.getElementById("status-text").innerHTML=status;
}
function dispatchstatus(jsonresponse){
if(jsonresponse.heater[0].active==1){
document.getElementById("Extruder1").style.visibility="visible";
document.getElementById("Extruder1").style.height="auto";
document.getElementById("JogExtruder1-1").style.visibility="visible";
document.getElementById("JogExtruder1-2").style.visibility="visible";
document.getElementById("JogExtruder1-3").style.visibility="visible";
displaytemp(jsonresponse.heater[0].temperature, jsonresponse.heater[0].target,"data_extruder1");
Updaterange('1');}
else {
document.getElementById("Extruder1").style.visibility="hidden";
document.getElementById("Extruder1").style.height="0px";
document.getElementById("JogExtruder1-1").style.visibility="hidden";
document.getElementById("JogExtruder1-2").style.visibility="hidden";
document.getElementById("JogExtruder1-3").style.visibility="hidden";}
if(jsonresponse.heater[1].active==1){
document.getElementById("Extruder2").style.visibility="visible";
document.getElementById("Extruder2").style.height="auto";
document.getElementById("JogExtruder2-1").style.visibility="visible";
document.getElementById("JogExtruder2-2").style.visibility="visible";
document.getElementById("JogExtruder2-3").style.visibility="visible";
displaytemp(jsonresponse.heater[1].temperature, jsonresponse.heater[1].target,"data_extruder2");
Updaterange('2');}
else {
document.getElementById("Extruder2").style.visibility="hidden";
document.getElementById("Extruder2").style.height="0px";
document.getElementById("JogExtruder2-1").style.visibility="hidden";
document.getElementById("JogExtruder2-2").style.visibility="hidden";
document.getElementById("JogExtruder2-3").style.visibility="hidden";}
if(jsonresponse.heater[2].active==1){
document.getElementById("Bed").style.visibility="visible";
document.getElementById("Bed").style.height="auto";
displaytemp(jsonresponse.heater[2].temperature, jsonresponse.heater[2].target,"data_bed");
Updaterange('bed');}
else {
document.getElementById("Bed").style.visibility="hidden";
document.getElementById("Bed").style.height="0px";}
document.getElementById("posx").innerHTML=jsonresponse.Xpos;
document.getElementById("posy").innerHTML=jsonresponse.Ypos;
document.getElementById("posz").innerHTML=jsonresponse.Zpos;
displaystatus(jsonresponse.status);
var content="";
for (i = 0; i < jsonresponse.InformationMsg.length; i++) {
if (i==jsonresponse.InformationMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.InformationMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.InformationMsg[i].line;
content += "</li>";}
document.getElementById("infomsg").innerHTML=content;
content="";
for (i = 0; i < jsonresponse.ErrorMsg.length; i++){
if (i==jsonresponse.ErrorMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.ErrorMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.ErrorMsg[i].line;
content +="</li>";}
document.getElementById("errormsg").innerHTML=content;
content="";
for (i = 0; i < jsonresponse.StatusMsg.length; i++)
{
if (i==jsonresponse.StatusMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.StatusMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.StatusMsg[i].line;
content +="</li>";
}
document.getElementById("statusmsg").innerHTML=content;
if (!initialization_done){
document.getElementById("numberinputspeed").value=jsonresponse.speed;
Updaterange('speed');
document.getElementById("numberinputflow").value=jsonresponse.flow;
Updaterange('flow');
initialization_done=true;}
document.getElementById("currentspeed").innerHTML=jsonresponse.speed + "%";
document.getElementById("currentflow").innerHTML=jsonresponse.flow + "%";
}
function getstatus(){
var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/STATUS";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var jsonresponse = JSON.parse(xmlhttp.responseText);
dispatchstatus(jsonresponse);}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
setInterval(function(){getstatus();},$REFRESH_PAGE$);
</script>
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,29 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Printer Settings</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $REFRESH_PAGE_STATUS$"><label class="control-label" for="CONFIG1">Refresh page time: </label><br>
<input type="number" class="form-control" id="CONFIG1" name="REFRESH_PAGE" placeholder="Time in minutes 1~120 " value="$REFRESH_PAGE$" min="1"max="120" step="1"style="width: auto;"></div>
<div class="form-group $XY_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG2">XY axis feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG2" name="XY_FEEDRATE" placeholder="1~9999 " value="$XY_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="form-group $Z_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG3">Z axis feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG3" name="Z_FEEDRATE" placeholder="1~9999 " value="$Z_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="form-group $E_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG4">Extruder feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG4" name="E_FEEDRATE" placeholder="1~9999 " value="$E_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,33 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">System</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $BAUD_RATE_STATUS$">
<label class="control-label" for="CONFIG1" >Baud rate</label><br>
<select name="BAUD_RATE" id="CONFIG1" class="form-control">
$BAUD_RATE_OPTIONS_LIST$
</select></div>
<div class="form-group $SLEEP_MODE_STATUS$">
<label class="control-label" for="CONFIG2">Sleep Mode</label><br>
<select name="SLEEP_MODE" id="CONFIG2" class="form-control">
$SLEEP_MODE_OPTIONS_LIST$
</select></div>
<div class="form-group $WEB_PORT_STATUS$"><label class="control-label" for="CONFIG3">Web port:</label><br>
<input type="number" class="form-control" id="CONFIG3" name="WEBPORT" min="1" max="65000" step="1" placeholder="1~65000" value="$WEB_PORT$" style="width: auto;"></div>
<div class="form-group $DATA_PORT_STATUS$"><label class="control-label" for="CONFIG4">Data port:</label><br>
<input type="number" class="form-control" id="CONFIG4" name="DATAPORT" min="1" max="65000" step="1" placeholder="1~65000" value="$DATA_PORT$" style="width: auto;"></div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,30 @@
<HTML>
<HEAD>
<title>Redirecting...</title>
</HEAD>
<BODY>
<CENTER>Unknown page - you will be redirected...
<BR><BR>
if not redirected, <a href='http://$WEB_ADDRESS$'>click here</a>
<BR><BR>
<PROGRESS name='prg' id='prg'>
<script>
var i = 0;
var x = document.getElementById("prg");
x.max=5;
var interval=setInterval(function(){
i=i+1;
var x = document.getElementById("prg");
x.value=i;
if (i>5)
{
clearInterval(interval);
window.location.href='/';
}
},1000);
</script>
</CENTER>
</BODY>
</HTML>

View File

@ -0,0 +1,64 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Access Point</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $AP_SSID_STATUS$">
<label class="control-label" for="CONFIG1">SSID: </label><br>
<input type="text" class="form-control" id="CONFIG1" name="SSID" placeholder="SSID (8~32)" max="32" value="$AP_SSID$" style="width: auto;"></div>
<div class="form-group $AP_PASSWORD_STATUS$"><label class="control-label" for="CONFIG2">Password :</label><br>
<input type="password" class="form-control" id="CONFIG2" name="PASSWORD" placeholder="Password (0~64)" max="64" value="$AP_PASSWORD$" style="width: auto;"></div>
<div class="checkbox $IS_SSID_VISIBLE_STATUS$"><label class="control-label"><input type="checkbox" name="SSID_VISIBLE" $IS_SSID_VISIBLE$>Visible</label></div>
<div class="form-group $NETWORK_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG3">Network: </label><br>
<select name="NETWORK" id="CONFIG3" class="form-control" style="width:auto;">
$NETWORK_OPTION_LIST$
</select></div>
<div class="form-group $CHANNEL_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG4">Channel: </label><br>
<select name="CHANNEL" id="CONFIG4" class="form-control" style="width:auto;">
$CHANNEL_OPTION_LIST$
</select></div>
<div class="form-group $AUTH_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG5">Authentification: </label><br>
<select name="AUTHENTIFICATION" id="CONFIG5" class="form-control" style="width:auto;">
$AUTH_OPTION_LIST$
</select></div>
<script type="text/javascript">
function update_ip_set()
{
if (document.getElementById("STATIC_IP").checked)
{
document.getElementById("IP_SET").style.visibility="visible";
document.getElementById("IP_SET").style.width="auto";
document.getElementById("IP_SET").style.height="auto";
}
else
{
document.getElementById("IP_SET").style.visibility="hidden";
document.getElementById("IP_SET").style.width="0px";
document.getElementById("IP_SET").style.height="0px";
}
}
</script>
<div class="checkbox $AP_STATIC_IP_STATUS$"><label class="control-label"><input type="checkbox" id="STATIC_IP" name="STATIC_IP" onclick="update_ip_set();" $IS_STATIC_IP$>Static IP</label></div>
<div id="IP_SET" name="IP_SET">
<div class="form-group $AP_IP_STATUS$"><label class="control-label" for="CONFIG6">IP: </label><br>
<input type="text" class="form-control" id="CONFIG6" name="IP" placeholder="IP" value="$AP_IP$" max="15" style="width: auto;"></div>
<div class="form-group $AP_GW_STATUS$"><label class="control-label" for="CONFIG7">Gateway: </label><br>
<input type="text" class="form-control" id="CONFIG7" name="GATEWAY" placeholder="Gateway" value="$AP_GW$" max="15" style="width: auto;"></div>
<div class="form-group $AP_SUBNET_STATUS$"><label class="control-label" for="CONFIG8">Subnet: </label><br>
<input type="text" class="form-control" id="CONFIG8" name="SUBNET" placeholder="Subnet" value="$AP_SUBNET$" max="15" style="width: auto;"></div>
</div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
<script type="text/javascript">
update_ip_set();
</script>
$INCLUDE[footer.inc]$

View File

@ -0,0 +1,65 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Station</div>
<div class="panel-body">
<form method="POST">
<DIV style="$AP_SCAN_VISIBILITY$">
<table class="table table-bordered table-striped" >
<caption>$AVAILABLE_AP_NB_ITEMS$ AP(s) available</caption>
<thead><tr><th>#</th><th>SSID</th><th>Signal</th><th>Protected</th></tr></thead>
<tbody>$AVAILABLE_AP[<tr><th>#$ROW_NUMBER$</th><td style="cursor:hand;" onclick="document.getElementById('CONFIG1').value='$AP_SSID$';">$AP_SSID$</td><td>$AP_SIGNAL$</td><td>$IS_PROTECTED$</td></tr>]$</tbody>
</table>
</DIV>
<div class="form-group $STA_SSID_STATUS$" ><label class="control-label" for="CONFIG1">SSID: </label><br>
<input type="text" class="form-control" id="CONFIG1" name="SSID" placeholder="SSID (8~32)" value="$STA_SSID$" max="32" style="width: auto;"></div>
<div class="form-group $STA_PASSWORD_STATUS$"><label class="control-label"for="CONFIG2">Password :</label><br>
<input type="password" class="form-control" id="CONFIG2" name="PASSWORD" placeholder="Password (0~64)" max="64" value="$STA_PASSWORD$" style="width: auto;"></div>
<div class="form-group $HOSTNAME_STATUS$" ><label class="control-label" for="CONFIG7">Hostname: </label><br>
<input type="text" class="form-control" id="CONFIG7" name="HOSTNAME" placeholder="Hostname (1~32)" value="$HOSTNAME$" max="32" style="width: auto;"></div>
<div class="form-group $NETWORK_OPTION_LIST_STATUS$"><label class="control-label"for="CONFIG3">Network: </label><br>
<select name="NETWORK" id="CONFIG3" class="form-control control-label" style="width:auto;">
$NETWORK_OPTION_LIST$
</select></div>
<script type="text/javascript">
function update_ip_set()
{
if (document.getElementById("STATIC_IP").checked)
{
document.getElementById("IP_SET").style.visibility="visible";
document.getElementById("IP_SET").style.width="auto";
document.getElementById("IP_SET").style.height="auto";
}
else
{
document.getElementById("IP_SET").style.visibility="hidden";
document.getElementById("IP_SET").style.width="0px";
document.getElementById("IP_SET").style.height="0px";
}
}
</script>
<div class="checkbox $STA_STATIC_IP_STATUS$"><label class="control-label">
<input type="checkbox" id="STATIC_IP" name="STATIC_IP" onclick="update_ip_set();" $IS_STATIC_IP$ >Static IP
</label>
</div>
<div id="IP_SET" name="IP_SET">
<div class="form-group $STA_IP_STATUS$"><label class="control-label" for="CONFIG4">IP: </label><br>
<input type="text" class="form-control" id="CONFIG4" name="IP" placeholder="IP" value="$STA_IP$" max="15" style="width: auto;"></div>
<div class="form-group $STA_GW_STATUS$"><label class="control-label"for="CONFIG5">Gateway: </label><br>
<input type="text" class="form-control" id="CONFIG5" name="GATEWAY" placeholder="Gateway" value="$STA_GW$" max="15" style="width: auto;"></div>
<div class="form-group $STA_SUBNET_STATUS$"><label class="control-label" for="CONFIG6">Subnet: </label><br>
<input type="text" class="form-control" id="CONFIG6" name="SUBNET" placeholder="Subnet" value="$STA_SUBNET$" max="15" style="width: auto;"></div>
</div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
<script type="text/javascript">
update_ip_set();
</script>
$INCLUDE[footer.inc]$

View File

@ -0,0 +1,48 @@
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%; font-size:10px;}
body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333333;background-color:#ffffff;}
.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;}
table{border:0px;border-spacing:0;max-width:100%;}
.table-bordered{ width:100%; border:1px solid #dddddd;margin-bottom:20px;}
td{white-space:nowrap; padding:2mm;}
th{text-align:left;}
.table>thead>tr>th,.table>tbody>tr>th,.table>thead>tr>td,.table>tbody>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #dddddd;}
.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td{border:1px solid #dddddd;}
.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px;}
.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9;}
@media (min-width:768px){.container{width:750px;}}
@media (min-width:992px){.container{width:970px;}}
@media (min-width:1200px){.container{width:1170px;}}
.nav{ width:100%; color:#cccccc;padding-left:10;padding-right:10;list-style:none;background-color:#333333;border-radius:6px ;margin-bottom:20px;}
a{position:relative;display:block;padding:10px 15px;text-decoration:none;color:#cccccc;}
.active{color:#ffffff;background-color:#000000;}
.active a,a:hover,a:focus{color:#FFFFFF;}
.panel{margin-bottom:20px;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05);}
.panel-body{padding:15px;}
.panel-heading{padding:10px 15px;color:#333333;background-color:#f5f5f5;border-color:#dddddd;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom:1px solid #dddddd;}
label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold;}
.text-info{color:#31708f;}
.form-control{display:block;width:auto;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555555;background-color:#ffffff
;background-image:none;border:1px solid #cccccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);
* -webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;
* transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);
* box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);}
.form-group{margin-bottom:15px;}
.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer;
background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;
* -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
.btn-primary{color:#ffffff;background-color:#337ab7;border-color:#2e6da4;}
.btn-primary:focus,.btn-primary:active,.btn-primary:hover,.btn-primary.focus,.btn-primary.active,.btn-primary.hover{color:#ffffff;background-color:#286090;border-color:#122b40;}
caption{padding-top:8px;padding-bottom:8px;color:#777777;text-align:left;}
.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px;}
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d;}
.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442;}
.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);}
.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}
.has-error .control-label{color:#a94442;}
.has-success .form-control {border-color: #3c763d;-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);}
.has-success .form-control:focus {border-color: #2b542c;-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;}
.has-success .control-label{color: #3c763d;}
.btn-danger{color:#ffffff;background-color:#d9534f;border-color:#d43f3a;}
.btn-danger:focus,.btn-danger:active,.btn-danger:hover,.btn-danger.focus,.btn-danger.active,.btn-danger.hover{color: #ffffff;background-color:#c9302c;border-color:#761c19;}
.btnimg {cursor:hand; border-radius:6px ;;border:1px solid #FFFFFF;}
.btnimg:hover{background-color:#F0F0F0;border-color:#00FFFF;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,3 @@
$SERVICE_PAGE$
</body>
</html>

View File

@ -0,0 +1,23 @@
<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">
<style>
$INCLUDE[css.inc]$
</style>
<title>$PAGE_TITLE$</title> </head>
<body>
<div class="container"><table class="nav">
<tr width=100%>
<td class="$MENU_HOME$"><a href="http://$WEB_ADDRESS$">Home</a></td>
<td class="$MENU_SYSTEM$"><a href="http://$WEB_ADDRESS$/CONFIGSYS">System Configuration</a></td>
<td class="$MENU_AP$"><a href="http://$WEB_ADDRESS$/CONFIGAP">AP Configuration</a></td>
<td class="$MENU_STA$"><a href="http://$WEB_ADDRESS$/CONFIGSTA">Station Configuration</a></td>
<td class="$MENU_PRINTER$"><a href="http://$WEB_ADDRESS$/PRINTER">Printer Status</a></td>
<td class="$MENU_SETTINGS$"><a href="http://$WEB_ADDRESS$/SETTINGS">Printer Settings</a></td>
<td width=100%>&nbsp;</td>
<td>FW: V$FW_VER$</td>
<td><a href="https://github.com/luc-github/ESP8266" >Github</a></td>
</tr>
</table>

View File

@ -0,0 +1,54 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">System</div>
<div class="panel-body"><label>Chip ID: </label><label class="text-info">$CHIP_ID$</label><BR>
<label>CPU Frequency: </label><label class="text-info">$CPU_FREQ$Hz</label><BR>
<label>Free Memory: </label><label class="text-info">$FREE_MEM$ octets</label><BR>
<label>SDK Version: </label><label class="text-info">$SDK_VER$</label><BR>
<DIV style ="$HOSTNAME_VISIBLE$"><label>Hostname: </label><label class="text-info">$HOSTNAME$</label><BR></DIV>
<DIV style ="$MDNS_VISIBLE$;"><label>mDNS name: </label><label class="text-info">$MDNS_NAME$</label><BR></DIV>
<DIV style ="$SSDP_VISIBLE$;"><label>SSDP Protocol: </label><label class="text-info">$SSDP_STATUS$</label><BR></DIV>
<DIV style ="$CAPTIVE_PORTAL_VISIBLE$;"><label>Captive Portal: </label><label class="text-info">$CAPTIVE_PORTAL_STATUS$</label><BR></DIV>
<label>Network: </label><label class="text-info">$NET_PHY$</label><BR>
<label>Sleep mode: </label><label class="text-info">$SLEEP_MODE$</label><BR>
<label>Boot version: </label><label class="text-info">$BOOT_VER$</label><BR>
<label>Baud rate: </label><label class="text-info">$BAUD_RATE$</label><BR>
<label>Web port:</label><label class="text-info">$WEB_PORT$</label><BR>
<label>Data port:</label><label class="text-info">$DATA_PORT$</label><BR>
</div></div>
<div class="panel"><div class="panel-heading">Access Point ($AP_STATUS_ENABLED$)</div>
<div class="panel-body"><label>Mac address: </label><label class="text-info">$AP_MAC$</label><BR>
<div style="$AP_VISIBILITY$;">
<label>SSID: </label><label class="text-info">$AP_SSID$</label><BR>
<label>Visible: </label><label class="text-info">$AP_IS_VISIBLE$</label><BR>
<label>Channel: </label><label class="text-info">$AP_CHANNEL$</label><BR>
<label>Authentification: </label><label class="text-info">$AP_AUTH$</label><BR>
<label>Maximum connections : </label><label class="text-info">$AP_MAX_CON$</label><BR>
<label>DHCP Server: </label><label class="text-info">$AP_DHCP_STATUS$</label><BR>
<label>IP: </label><label class="text-info">$AP_IP$</label><BR>
<label>Gateway: </label><label class="text-info">$AP_GW$</label><BR>
<label>Subnet: </label><label class="text-info">$AP_SUBNET$</label><BR>
<table class="table table-bordered table-striped">
<caption>$CONNECTED_STATIONS_NB_ITEMS$ connected station(s)</caption>
<thead><tr><th>#</th><th>Mac</th><th>IP</th></tr></thead>
<tbody>$CONNECTED_STATIONS[<TR><th>#$ROW_NUMBER$</th><td>$MAC_CONNECTED$</td><td>$IP_CONNECTED$</td></TR>]$</tbody>
</table>
</div>
</div>
</div>
<div class="panel">
<div class="panel-heading">Station ($STA_STATUS_ENABLED$)</div>
<div class="panel-body"><label>Mac address: </label><label class="text-info">$STA_MAC$</label><BR>
<div style="$STA_VISIBILITY$;">
<label>Connection to: </label><label class="text-info">$STA_SSID$</label><BR>
<label>Channel: </label><label class="text-info">$STA_CHANNEL$</label><BR>
<label>Status: </label><label class="text-info">$STA_STATUS$</label><BR>
<label>DHCP Client: </label><label class="text-info">$STA_DHCP_STATUS$</label><BR>
<label>IP: </label><label class="text-info">$STA_IP$</label><BR>
<label>Gateway: </label><label class="text-info">$STA_GW$</label><BR>
<label>Subnet: </label><label class="text-info">$STA_SUBNET$</label><BR>
</div>
</div>
</div>
$INCLUDE[footer.inc]$

View File

@ -0,0 +1,303 @@
$INCLUDE[header.inc]$
<table>
<tr><td style="padding:0px;"><div id="Extruder1" style="visibility:hidden;height:0px;">
<table><tr><td><label>E1:&nbsp;</label></td>
<td id="data_extruder1"></td><td>0<input id="rangeinput1" type="range" min=0 max=270 onchange="Updatenumber('1');">270</td>
<td><input class="form-control" id="numberinput1" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('1');"></td><td> &#176;C
<td><input type="submit" value="Set" onclick="SendValue( 'M104 T0 S', '1');"></td></tr></table></div></td></tr>
<tr ><td style="padding:0px;"><div id="Extruder2" style="visibility:hidden;height:0px;">
<table><tr><td><label>E2:&nbsp;</label></td>
<td id="data_extruder2"></td><td>0<input id="rangeinput2" type="range" min=0 max=270 onchange="Updatenumber('2');">270</td>
<td><input class="form-control" id="numberinput2" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('2');"></td><td>&#176;C
<input type="submit" value="Set" onclick="SendValue( 'M104 T1 S', '2');">
</td></tr></table></div></td></tr>
<tr><td style="padding:0px;"><div id="Bed" style="visibility:hidden;height:0px;">
<table><tr><td><label>Bed:</label></td>
<td id="data_bed"></td><td>0<input id="rangeinputbed" type="range" min=0 max=130 onchange="Updatenumber('bed');">130</td>
<td><input class="form-control" id="numberinputbed"type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('bed');"></td><td>&#176;C
<input type="submit" value="Set" onclick="SendValue( 'M140 S', 'bed');">
</td></tr></table></div></td></tr>
<tr><td id="speed"><table><tr>
<td><label>Speed:</label></td><td class="text-info" id="currentspeed"></td>
<td>0<input id="rangeinputspeed" type="range" min=0 max=300 onchange="Updatenumber('speed');">300</td>
<td><input class="form-control" id="numberinputspeed" type="number" size="3" min=0 max=300 step=1 value=0 onchange="Updaterange('speed');"></td><td>%
<input type="submit" value="Set" onclick="SendValue( 'M220 S', 'speed');"></td>
<td>&nbsp;&nbsp;</td><td>Status:</td><td id="status" align="center" valign="middle">
<svg width="20" height="20"><circle cx="10" cy="10" r="8" stroke="black" stroke-width="2" fill="white"></circle></svg></td>
<td id="status-text"></td><td>&nbsp;&nbsp;</td><td class="btnimg" onclick="OnclickEmergency();">
<svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="red" />
<circle cx="20" cy="20" r="10" stroke="black" stroke-width="4" fill="red" /><rect x="15" y="8" width="10" height="10" style="fill:red;stroke-width:1;stroke:red" />
<rect x="18" y="6" rx="1" ry="1" width="4" height="14" style="fill:black;stroke-width:1;stroke:black" /></svg></td></tr></table></td></tr>
<tr><td id="flow"><table><tr><td><label>Flow:</label></td><td class="text-info" id="currentflow"></td>
<td>0<input id="rangeinputflow" type="range" min=0 max=300 onchange="Updatenumber('flow');">300</td>
<td><input class="form-control" id="numberinputflow" size="3" type="number" min=0 max=300 step=1 value=0 onchange="Updaterange('flow');"></td><td>%
<input type="submit" value="Set" onclick="SendValue( 'M221 S', 'flow');"></td><td>&nbsp;&nbsp;</td>
<td><label>X:</label></td><td class="text-info" id="posx"></td><td>&nbsp;&nbsp;</td><td><label>Y:</label></td><td class="text-info" id="posy"></td><td>&nbsp;&nbsp;</td>
<td><label>Z:</label></td><td class="text-info" id="posz" ></td></tr></table></td></tr>
<tr><td><table width="100%"><tr><td width="auto"><label>Command:</label></td>
<td width="100%"><input class="form-control" id="cmd" type="text" style="width: 100%;"></td>
<td width="auto"><input type="submit" value="Send" onclick="Sendcustomcommand();"></td></tr></table></td></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Info:</label></td><td width=100% id="infomsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Error:</label></td><td width=100% id="errormsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Status:</label></td><td width=100% id="statusmsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td class="btnimg" onclick="Sendcommand('M24');">
<svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" /><polygon points="15,10 30,20 15,30" fill:"white" stroke:"white" stroke-width:"1" /></svg></td>
<td class="btnimg" onclick="Sendcommand('M25');"><svg width="40" height="40" viewBox="0 0 40 40"> <circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /> <rect x="23" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /></svg></td>
<td class="btnimg" onclick="Sendcommand('M50');"><svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /></svg></td>
<td class="btnimg" onclick="alert('Not yet implemented');"><svg width="40" height="40" viewBox="0 0 40 40"><rect x="5" y="10" width="30" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /><text x="10" y="25" font-family="Verdana" font-size="14" fill="white">SD</text></svg></td>
<td>&nbsp;</td></tr></table></td></tr><tr><td><table><tr align="center" valign="middle"><td class="btnimg" onclick=" Sendcommand('G28 X');">
<svg width="40" height="40" viewBox="0 0 40 40" ><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="black" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">X</text></svg></td><td>
<table><tr><td class="btnimg" onclick="SendJogcommand( 'Y-10',XYfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7"/><text x="13" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y-1',XYfeedrate);"><svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5"/><text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y-0.1',XYfeedrate);"><svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:2"/><text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td class="btnimg" onclick=" Sendcommand('G28 Y');"><svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="blue" stroke-width:"1" stroke:"black" /><line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /><text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Y</text></svg></td>
<td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'Z-10',Zfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z-1',Zfeedrate);"><svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5"/><text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z-0.1',Zfeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder1-1" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E0-10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0-1',Efeedrate);"><svg width="40" height="20" viewBox="0 2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0-0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder2-1" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E1-10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1-1',Efeedrate);"><svg width="40" height="20" viewBox="0 2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1-0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td></tr>
<tr align="center" valign="middle"><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'X10',XYfeedrate);"><svg width="20" height="40" viewBox="12 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(-90 20 10)"/><text x="22" y="13" font-family="Verdana" font-size="7" fill="black">10</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X1',XYfeedrate);"><svg width="20" height="40" viewBox="10 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(-90 20 10)"/>
<text x="21" y="13" font-family="Verdana" font-size="7" fill="black">1</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X0.1',XYfeedrate);"><svg width="20" height="40" viewBox="14 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:2" transform="rotate(-90 20 10)"/><text x="19" y="13" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
</table></td><td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'X-0.1',XYfeedrate);"><svg width="20" height="40" viewBox="6 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:3" transform="rotate(90 20 10)"/><text x="7" y="12" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X-1',XYfeedrate);"><svg width="20" height="40" viewBox="8 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(90 20 10)"/>
<text x="11" y="13" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td><td class="btnimg" onclick="SendJogcommand( 'X-10',XYfeedrate);">
<svg width="20" height="40" viewBox="8 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(90 20 10)"/>
<text x="7" y="12" font-size="7" fill="black">-10</text></svg></td></tr></table></td>
<td></td><td><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="green">Z</text></svg></td>
<td></td><td id="JogExtruder1-2" style="visibility:hidden;"><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="orange">1</text></svg></td>
<td></td><td id="JogExtruder2-2" style="visibility:hidden;"><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="pink">2</text></svg></td></tr>
<tr align="center" valign="middle"><td class="btnimg" onclick=" Sendcommand('G28');"><svg width="40" height="40" viewBox="0 0 40 40"><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="purple" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /></svg></td><td>
<table><tr><td class="btnimg" onclick="SendJogcommand( 'Y0.1',XYfeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:3" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y1',XYfeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="17" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y10',XYfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td class="btnimg" onclick=" Sendcommand('G28 Z');"><svg width="40" height="40" viewBox="0 0 40 40"><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="green" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /><text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Z</text></svg></td>
<td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'Z0.1',Zfeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z1',Zfeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z10',Zfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder1-3" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E0+0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0+1',Efeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0+10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder2-3" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E1+0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1+1',Efeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1+10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20" ><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td></tr></table></td></tr></table>
<script type="text/javascript">
var XYfeedrate=$XY_FEEDRATE$;
var Zfeedrate=$Z_FEEDRATE$;
var Efeedrate=$E_FEEDRATE$;
function Sendcommand(commandtxt){
var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/CMD?COM="+encodeURI(commandtxt);;
xmlhttp.open("POST", url, true);
xmlhttp.send();
}
function delay(ms) {
ms += new Date().getTime();
while (new Date() < ms){}
}
function SendJogcommand( cmd, feedrate){
Sendcommand("G91");
delay(100);
Sendcommand("G1 "+cmd + " F"+feedrate);
delay(100);
Sendcommand("G90");
}
function SendValue( cmd, item){
Sendcommand(cmd + document.getElementById("numberinput"+item).value);
}
function Sendcustomcommand(){
var cmd = document.getElementById("cmd").value;
if (cmd.trim().length > 0) Sendcommand(cmd);
document.getElementById("cmd").value="";
}
function OnclickEmergency(){
Sendcommand("M112");
}
function Updatenumber(item){
document.getElementById("numberinput"+item).value=document.getElementById("rangeinput"+item).value;
}
function Updaterange(item){
document.getElementById("rangeinput"+item).value=document.getElementById("numberinput"+item).value;
}
Updaterange('1');
Updaterange('2');
Updaterange('bed');
Updaterange('speed');
Updaterange('flow');
var pulse=true;
var initialization_done = false;
function displaytemp(temperature, target,item){
var displaypicture = "<svg height=\"30px \" width=\"300px \" xmlns=\"http://wwww.w3.org/2000/svg\">\n<linearGradient id=\"gradient\">\n";
var description = String (temperature) + "/";
if (target>0)description += String (target);
else description += "Off ";
displaypicture+="<stop class=\"begin\" style=\"stop-color:green;\" offset=\"0%\"/>\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"100%\"/>\n</linearGradient>\n<linearGradient id=\"gradient2\">\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"0%\"/>\n<stop class=\"end\" style=\"stop-color:red;\" offset=\"100%\"/>\n";
displaypicture+="</linearGradient>\n<rect x=\"10\" y=\"4\" width=\"24\" height=\"21\" style=\"fill:url(#gradient)\" />\n";
displaypicture+="<rect x=\"34\" y=\"4\" width=\"280\" height=\"21\" style=\"fill:url(#gradient2)\" />\n<line x1=\"";
displaypicture+=String(target+10);
displaypicture+="\" y1=\"4\" x2=\"";
displaypicture+=String(target+10);
displaypicture+="\" y2=\"25\" style=\"stroke:rgb(255,255,255);stroke-width:1\" />\n<path d=\"M";
displaypicture+=String(temperature+5);
displaypicture+=" 0 L";
displaypicture+=String(temperature+15);
displaypicture+=" 0 L";
displaypicture+=String(temperature+10);
displaypicture+=" 8 Z\" stroke=\"white\" stroke-width=\"1\" />\n<path d=\"M";
displaypicture+=String(temperature+5);
displaypicture+=" 30 L";
displaypicture+=String(temperature+15);
displaypicture+=" 30 L";
displaypicture+=String(temperature+10);
displaypicture+=" 22 Z\" stroke=\"white\" stroke-width=\"1\"/>\n<text x=\"30\" y=\"19\" fill=\"black\" style=\"font-family: calibri; font-size:10pt;\">\n";
displaypicture+=description;
displaypicture+=" &#176;C</text>\n</svg>";
document.getElementById(item).innerHTML=displaypicture;
}
function displaystatus(status){
var content ="<svg width=\"20\" height=\"20\"><circle cx=\"10\" cy=\"10\" r=\"8\" stroke=\"black\" stroke-width=\"2\" fill=\"";
if (status=="Connected"){
if (pulse)content +="#00FF00";
else content +="#007F0E";}
else if (status=="Busy"){
if (pulse)content +="#FFD800";
else content +="#7F6A00";}
else{
if (pulse)content +="#FF0000";
else content +="#7F0000";}
content +="\"></circle></svg>";
pulse=!pulse;
document.getElementById("status").innerHTML=content;
document.getElementById("status-text").innerHTML=status;
}
function dispatchstatus(jsonresponse){
if(jsonresponse.heater[0].active==1){
document.getElementById("Extruder1").style.visibility="visible";
document.getElementById("Extruder1").style.height="auto";
document.getElementById("JogExtruder1-1").style.visibility="visible";
document.getElementById("JogExtruder1-2").style.visibility="visible";
document.getElementById("JogExtruder1-3").style.visibility="visible";
displaytemp(jsonresponse.heater[0].temperature, jsonresponse.heater[0].target,"data_extruder1");
Updaterange('1');}
else {
document.getElementById("Extruder1").style.visibility="hidden";
document.getElementById("Extruder1").style.height="0px";
document.getElementById("JogExtruder1-1").style.visibility="hidden";
document.getElementById("JogExtruder1-2").style.visibility="hidden";
document.getElementById("JogExtruder1-3").style.visibility="hidden";}
if(jsonresponse.heater[1].active==1){
document.getElementById("Extruder2").style.visibility="visible";
document.getElementById("Extruder2").style.height="auto";
document.getElementById("JogExtruder2-1").style.visibility="visible";
document.getElementById("JogExtruder2-2").style.visibility="visible";
document.getElementById("JogExtruder2-3").style.visibility="visible";
displaytemp(jsonresponse.heater[1].temperature, jsonresponse.heater[1].target,"data_extruder2");
Updaterange('2');}
else {
document.getElementById("Extruder2").style.visibility="hidden";
document.getElementById("Extruder2").style.height="0px";
document.getElementById("JogExtruder2-1").style.visibility="hidden";
document.getElementById("JogExtruder2-2").style.visibility="hidden";
document.getElementById("JogExtruder2-3").style.visibility="hidden";}
if(jsonresponse.heater[2].active==1){
document.getElementById("Bed").style.visibility="visible";
document.getElementById("Bed").style.height="auto";
displaytemp(jsonresponse.heater[2].temperature, jsonresponse.heater[2].target,"data_bed");
Updaterange('bed');}
else {
document.getElementById("Bed").style.visibility="hidden";
document.getElementById("Bed").style.height="0px";}
document.getElementById("posx").innerHTML=jsonresponse.Xpos;
document.getElementById("posy").innerHTML=jsonresponse.Ypos;
document.getElementById("posz").innerHTML=jsonresponse.Zpos;
displaystatus(jsonresponse.status);
var content="";
for (i = 0; i < jsonresponse.InformationMsg.length; i++) {
if (i==jsonresponse.InformationMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.InformationMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.InformationMsg[i].line;
content += "</li>";}
document.getElementById("infomsg").innerHTML=content;
content="";
for (i = 0; i < jsonresponse.ErrorMsg.length; i++){
if (i==jsonresponse.ErrorMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.ErrorMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.ErrorMsg[i].line;
content +="</li>";}
document.getElementById("errormsg").innerHTML=content;
content="";
for (i = 0; i < jsonresponse.StatusMsg.length; i++)
{
if (i==jsonresponse.StatusMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.StatusMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.StatusMsg[i].line;
content +="</li>";
}
document.getElementById("statusmsg").innerHTML=content;
if (!initialization_done){
document.getElementById("numberinputspeed").value=jsonresponse.speed;
Updaterange('speed');
document.getElementById("numberinputflow").value=jsonresponse.flow;
Updaterange('flow');
initialization_done=true;}
document.getElementById("currentspeed").innerHTML=jsonresponse.speed + "%";
document.getElementById("currentflow").innerHTML=jsonresponse.flow + "%";
}
function getstatus(){
var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/STATUS";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var jsonresponse = JSON.parse(xmlhttp.responseText);
dispatchstatus(jsonresponse);}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
setInterval(function(){getstatus();},$REFRESH_PAGE$);
</script>
$INCLUDE[footer.inc]$

View File

@ -0,0 +1,27 @@
<HTML>
<HEAD>
<title>Restarting...</title>
</HEAD>
<BODY>
<CENTER>Restarting, please wait....
<BR>
<PROGRESS name='prg' id='prg'>
</CENTER>
<script>
var i = 0;
var interval;
var x = document.getElementById("prg");
x.max=40;
interval = setInterval(function(){
i=i+1;
var x = document.getElementById("prg");
x.value=i;
if (i>40)
{
clearInterval(interval);
window.location.href='/';
}
},1000);
</script>
</BODY>
</HTML>

View File

@ -0,0 +1,27 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Printer Settings</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $REFRESH_PAGE_STATUS$"><label class="control-label" for="CONFIG1">Refresh page time: </label><br>
<input type="number" class="form-control" id="CONFIG1" name="REFRESH_PAGE" placeholder="Time in minutes 1~120 " value="$REFRESH_PAGE$" min="1"max="120" step="1"style="width: auto;"></div>
<div class="form-group $XY_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG2">XY axis feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG2" name="XY_FEEDRATE" placeholder="1~9999 " value="$XY_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="form-group $Z_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG3">Z axis feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG3" name="Z_FEEDRATE" placeholder="1~9999 " value="$Z_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="form-group $E_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG4">Extruder feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG4" name="E_FEEDRATE" placeholder="1~9999 " value="$E_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
$INCLUDE[footer.inc]$

View File

@ -0,0 +1,30 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">System</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $BAUD_RATE_STATUS$">
<label class="control-label" for="CONFIG1" >Baud rate</label><br>
<select name="BAUD_RATE" id="CONFIG1" class="form-control">
$BAUD_RATE_OPTIONS_LIST$
</select></div>
<div class="form-group $SLEEP_MODE_STATUS$">
<label class="control-label" for="CONFIG2">Sleep Mode</label><br>
<select name="SLEEP_MODE" id="CONFIG2" class="form-control">
$SLEEP_MODE_OPTIONS_LIST$
</select></div>
<div class="form-group $WEB_PORT_STATUS$"><label class="control-label" for="CONFIG3">Web port:</label><br>
<input type="number" class="form-control" id="CONFIG3" name="WEBPORT" min="1" max="65000" step="1" placeholder="1~65000" value="$WEB_PORT$" style="width: auto;"></div>
<div class="form-group $DATA_PORT_STATUS$"><label class="control-label" for="CONFIG4">Data port:</label><br>
<input type="number" class="form-control" id="CONFIG4" name="DATAPORT" min="1" max="65000" step="1" placeholder="1~65000" value="$DATA_PORT$" style="width: auto;"></div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
$INCLUDE[footer.inc]$

30
esp8266/data/404.tpl Normal file
View File

@ -0,0 +1,30 @@
<HTML>
<HEAD>
<title>Redirecting...</title>
</HEAD>
<BODY>
<CENTER>Unknown page - you will be redirected...
<BR><BR>
if not redirected, <a href='http://$WEB_ADDRESS$'>click here</a>
<BR><BR>
<PROGRESS name='prg' id='prg'>
<script>
var i = 0;
var x = document.getElementById("prg");
x.max=5;
var interval=setInterval(function(){
i=i+1;
var x = document.getElementById("prg");
x.value=i;
if (i>5)
{
clearInterval(interval);
window.location.href='/';
}
},1000);
</script>
</CENTER>
</BODY>
</HTML>

View File

@ -0,0 +1,64 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Access Point</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $AP_SSID_STATUS$">
<label class="control-label" for="CONFIG1">SSID: </label><br>
<input type="text" class="form-control" id="CONFIG1" name="SSID" placeholder="SSID (8~32)" max="32" value="$AP_SSID$" style="width: auto;"></div>
<div class="form-group $AP_PASSWORD_STATUS$"><label class="control-label" for="CONFIG2">Password :</label><br>
<input type="password" class="form-control" id="CONFIG2" name="PASSWORD" placeholder="Password (0~64)" max="64" value="$AP_PASSWORD$" style="width: auto;"></div>
<div class="checkbox $IS_SSID_VISIBLE_STATUS$"><label class="control-label"><input type="checkbox" name="SSID_VISIBLE" $IS_SSID_VISIBLE$>Visible</label></div>
<div class="form-group $NETWORK_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG3">Network: </label><br>
<select name="NETWORK" id="CONFIG3" class="form-control" style="width:auto;">
$NETWORK_OPTION_LIST$
</select></div>
<div class="form-group $CHANNEL_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG4">Channel: </label><br>
<select name="CHANNEL" id="CONFIG4" class="form-control" style="width:auto;">
$CHANNEL_OPTION_LIST$
</select></div>
<div class="form-group $AUTH_OPTION_LIST_STATUS$"><label class="control-label" for="CONFIG5">Authentification: </label><br>
<select name="AUTHENTIFICATION" id="CONFIG5" class="form-control" style="width:auto;">
$AUTH_OPTION_LIST$
</select></div>
<script type="text/javascript">
function update_ip_set()
{
if (document.getElementById("STATIC_IP").checked)
{
document.getElementById("IP_SET").style.visibility="visible";
document.getElementById("IP_SET").style.width="auto";
document.getElementById("IP_SET").style.height="auto";
}
else
{
document.getElementById("IP_SET").style.visibility="hidden";
document.getElementById("IP_SET").style.width="0px";
document.getElementById("IP_SET").style.height="0px";
}
}
</script>
<div class="checkbox $AP_STATIC_IP_STATUS$"><label class="control-label"><input type="checkbox" id="STATIC_IP" name="STATIC_IP" onclick="update_ip_set();" $IS_STATIC_IP$>Static IP</label></div>
<div id="IP_SET" name="IP_SET">
<div class="form-group $AP_IP_STATUS$"><label class="control-label" for="CONFIG6">IP: </label><br>
<input type="text" class="form-control" id="CONFIG6" name="IP" placeholder="IP" value="$AP_IP$" max="15" style="width: auto;"></div>
<div class="form-group $AP_GW_STATUS$"><label class="control-label" for="CONFIG7">Gateway: </label><br>
<input type="text" class="form-control" id="CONFIG7" name="GATEWAY" placeholder="Gateway" value="$AP_GW$" max="15" style="width: auto;"></div>
<div class="form-group $AP_SUBNET_STATUS$"><label class="control-label" for="CONFIG8">Subnet: </label><br>
<input type="text" class="form-control" id="CONFIG8" name="SUBNET" placeholder="Subnet" value="$AP_SUBNET$" max="15" style="width: auto;"></div>
</div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
<script type="text/javascript">
update_ip_set();
</script>
$INCLUDE[footer.inc]$

View File

@ -0,0 +1,65 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Station</div>
<div class="panel-body">
<form method="POST">
<DIV style="$AP_SCAN_VISIBILITY$">
<table class="table table-bordered table-striped" >
<caption>$AVAILABLE_AP_NB_ITEMS$ AP(s) available</caption>
<thead><tr><th>#</th><th>SSID</th><th>Signal</th><th>Protected</th></tr></thead>
<tbody>$AVAILABLE_AP[<tr><th>#$ROW_NUMBER$</th><td style="cursor:hand;" onclick="document.getElementById('CONFIG1').value='$AP_SSID$';">$AP_SSID$</td><td>$AP_SIGNAL$</td><td>$IS_PROTECTED$</td></tr>]$</tbody>
</table>
</DIV>
<div class="form-group $STA_SSID_STATUS$" ><label class="control-label" for="CONFIG1">SSID: </label><br>
<input type="text" class="form-control" id="CONFIG1" name="SSID" placeholder="SSID (8~32)" value="$STA_SSID$" max="32" style="width: auto;"></div>
<div class="form-group $STA_PASSWORD_STATUS$"><label class="control-label"for="CONFIG2">Password :</label><br>
<input type="password" class="form-control" id="CONFIG2" name="PASSWORD" placeholder="Password (0~64)" max="64" value="$STA_PASSWORD$" style="width: auto;"></div>
<div class="form-group $HOSTNAME_STATUS$" ><label class="control-label" for="CONFIG7">Hostname: </label><br>
<input type="text" class="form-control" id="CONFIG7" name="HOSTNAME" placeholder="Hostname (1~32)" value="$HOSTNAME$" max="32" style="width: auto;"></div>
<div class="form-group $NETWORK_OPTION_LIST_STATUS$"><label class="control-label"for="CONFIG3">Network: </label><br>
<select name="NETWORK" id="CONFIG3" class="form-control control-label" style="width:auto;">
$NETWORK_OPTION_LIST$
</select></div>
<script type="text/javascript">
function update_ip_set()
{
if (document.getElementById("STATIC_IP").checked)
{
document.getElementById("IP_SET").style.visibility="visible";
document.getElementById("IP_SET").style.width="auto";
document.getElementById("IP_SET").style.height="auto";
}
else
{
document.getElementById("IP_SET").style.visibility="hidden";
document.getElementById("IP_SET").style.width="0px";
document.getElementById("IP_SET").style.height="0px";
}
}
</script>
<div class="checkbox $STA_STATIC_IP_STATUS$"><label class="control-label">
<input type="checkbox" id="STATIC_IP" name="STATIC_IP" onclick="update_ip_set();" $IS_STATIC_IP$ >Static IP
</label>
</div>
<div id="IP_SET" name="IP_SET">
<div class="form-group $STA_IP_STATUS$"><label class="control-label" for="CONFIG4">IP: </label><br>
<input type="text" class="form-control" id="CONFIG4" name="IP" placeholder="IP" value="$STA_IP$" max="15" style="width: auto;"></div>
<div class="form-group $STA_GW_STATUS$"><label class="control-label"for="CONFIG5">Gateway: </label><br>
<input type="text" class="form-control" id="CONFIG5" name="GATEWAY" placeholder="Gateway" value="$STA_GW$" max="15" style="width: auto;"></div>
<div class="form-group $STA_SUBNET_STATUS$"><label class="control-label" for="CONFIG6">Subnet: </label><br>
<input type="text" class="form-control" id="CONFIG6" name="SUBNET" placeholder="Subnet" value="$STA_SUBNET$" max="15" style="width: auto;"></div>
</div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
<script type="text/javascript">
update_ip_set();
</script>
$INCLUDE[footer.inc]$

48
esp8266/data/css.inc Normal file
View File

@ -0,0 +1,48 @@
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%; font-size:10px;}
body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333333;background-color:#ffffff;}
.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;}
table{border:0px;border-spacing:0;max-width:100%;}
.table-bordered{ width:100%; border:1px solid #dddddd;margin-bottom:20px;}
td{white-space:nowrap; padding:2mm;}
th{text-align:left;}
.table>thead>tr>th,.table>tbody>tr>th,.table>thead>tr>td,.table>tbody>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #dddddd;}
.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td{border:1px solid #dddddd;}
.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px;}
.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9;}
@media (min-width:768px){.container{width:750px;}}
@media (min-width:992px){.container{width:970px;}}
@media (min-width:1200px){.container{width:1170px;}}
.nav{ width:100%; color:#cccccc;padding-left:10;padding-right:10;list-style:none;background-color:#333333;border-radius:6px ;margin-bottom:20px;}
a{position:relative;display:block;padding:10px 15px;text-decoration:none;color:#cccccc;}
.active{color:#ffffff;background-color:#000000;}
.active a,a:hover,a:focus{color:#FFFFFF;}
.panel{margin-bottom:20px;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05);}
.panel-body{padding:15px;}
.panel-heading{padding:10px 15px;color:#333333;background-color:#f5f5f5;border-color:#dddddd;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom:1px solid #dddddd;}
label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold;}
.text-info{color:#31708f;}
.form-control{display:block;width:auto;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555555;background-color:#ffffff
;background-image:none;border:1px solid #cccccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);
* -webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;
* transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);
* box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);}
.form-group{margin-bottom:15px;}
.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer;
background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;
* -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
.btn-primary{color:#ffffff;background-color:#337ab7;border-color:#2e6da4;}
.btn-primary:focus,.btn-primary:active,.btn-primary:hover,.btn-primary.focus,.btn-primary.active,.btn-primary.hover{color:#ffffff;background-color:#286090;border-color:#122b40;}
caption{padding-top:8px;padding-bottom:8px;color:#777777;text-align:left;}
.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px;}
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d;}
.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442;}
.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);}
.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}
.has-error .control-label{color:#a94442;}
.has-success .form-control {border-color: #3c763d;-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);}
.has-success .form-control:focus {border-color: #2b542c;-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;}
.has-success .control-label{color: #3c763d;}
.btn-danger{color:#ffffff;background-color:#d9534f;border-color:#d43f3a;}
.btn-danger:focus,.btn-danger:active,.btn-danger:hover,.btn-danger.focus,.btn-danger.active,.btn-danger.hover{color: #ffffff;background-color:#c9302c;border-color:#761c19;}
.btnimg {cursor:hand; border-radius:6px ;;border:1px solid #FFFFFF;}
.btnimg:hover{background-color:#F0F0F0;border-color:#00FFFF;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}

BIN
esp8266/data/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

3
esp8266/data/footer.inc Normal file
View File

@ -0,0 +1,3 @@
$SERVICE_PAGE$
</body>
</html>

23
esp8266/data/header.inc Normal file
View File

@ -0,0 +1,23 @@
<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">
<style>
$INCLUDE[css.inc]$
</style>
<title>$PAGE_TITLE$</title> </head>
<body>
<div class="container"><table class="nav">
<tr width=100%>
<td class="$MENU_HOME$"><a href="http://$WEB_ADDRESS$">Home</a></td>
<td class="$MENU_SYSTEM$"><a href="http://$WEB_ADDRESS$/CONFIGSYS">System Configuration</a></td>
<td class="$MENU_AP$"><a href="http://$WEB_ADDRESS$/CONFIGAP">AP Configuration</a></td>
<td class="$MENU_STA$"><a href="http://$WEB_ADDRESS$/CONFIGSTA">Station Configuration</a></td>
<td class="$MENU_PRINTER$"><a href="http://$WEB_ADDRESS$/PRINTER">Printer Status</a></td>
<td class="$MENU_SETTINGS$"><a href="http://$WEB_ADDRESS$/SETTINGS">Printer Settings</a></td>
<td width=100%>&nbsp;</td>
<td>FW: V$FW_VER$</td>
<td><a href="https://github.com/luc-github/ESP8266" >Github</a></td>
</tr>
</table>

54
esp8266/data/home.tpl Normal file
View File

@ -0,0 +1,54 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">System</div>
<div class="panel-body"><label>Chip ID: </label><label class="text-info">$CHIP_ID$</label><BR>
<label>CPU Frequency: </label><label class="text-info">$CPU_FREQ$Hz</label><BR>
<label>Free Memory: </label><label class="text-info">$FREE_MEM$ octets</label><BR>
<label>SDK Version: </label><label class="text-info">$SDK_VER$</label><BR>
<DIV style ="$HOSTNAME_VISIBLE$"><label>Hostname: </label><label class="text-info">$HOSTNAME$</label><BR></DIV>
<DIV style ="$MDNS_VISIBLE$;"><label>mDNS name: </label><label class="text-info">$MDNS_NAME$</label><BR></DIV>
<DIV style ="$SSDP_VISIBLE$;"><label>SSDP Protocol: </label><label class="text-info">$SSDP_STATUS$</label><BR></DIV>
<DIV style ="$CAPTIVE_PORTAL_VISIBLE$;"><label>Captive Portal: </label><label class="text-info">$CAPTIVE_PORTAL_STATUS$</label><BR></DIV>
<label>Network: </label><label class="text-info">$NET_PHY$</label><BR>
<label>Sleep mode: </label><label class="text-info">$SLEEP_MODE$</label><BR>
<label>Boot version: </label><label class="text-info">$BOOT_VER$</label><BR>
<label>Baud rate: </label><label class="text-info">$BAUD_RATE$</label><BR>
<label>Web port:</label><label class="text-info">$WEB_PORT$</label><BR>
<label>Data port:</label><label class="text-info">$DATA_PORT$</label><BR>
</div></div>
<div class="panel"><div class="panel-heading">Access Point ($AP_STATUS_ENABLED$)</div>
<div class="panel-body"><label>Mac address: </label><label class="text-info">$AP_MAC$</label><BR>
<div style="$AP_VISIBILITY$;">
<label>SSID: </label><label class="text-info">$AP_SSID$</label><BR>
<label>Visible: </label><label class="text-info">$AP_IS_VISIBLE$</label><BR>
<label>Channel: </label><label class="text-info">$AP_CHANNEL$</label><BR>
<label>Authentification: </label><label class="text-info">$AP_AUTH$</label><BR>
<label>Maximum connections : </label><label class="text-info">$AP_MAX_CON$</label><BR>
<label>DHCP Server: </label><label class="text-info">$AP_DHCP_STATUS$</label><BR>
<label>IP: </label><label class="text-info">$AP_IP$</label><BR>
<label>Gateway: </label><label class="text-info">$AP_GW$</label><BR>
<label>Subnet: </label><label class="text-info">$AP_SUBNET$</label><BR>
<table class="table table-bordered table-striped">
<caption>$CONNECTED_STATIONS_NB_ITEMS$ connected station(s)</caption>
<thead><tr><th>#</th><th>Mac</th><th>IP</th></tr></thead>
<tbody>$CONNECTED_STATIONS[<TR><th>#$ROW_NUMBER$</th><td>$MAC_CONNECTED$</td><td>$IP_CONNECTED$</td></TR>]$</tbody>
</table>
</div>
</div>
</div>
<div class="panel">
<div class="panel-heading">Station ($STA_STATUS_ENABLED$)</div>
<div class="panel-body"><label>Mac address: </label><label class="text-info">$STA_MAC$</label><BR>
<div style="$STA_VISIBILITY$;">
<label>Connection to: </label><label class="text-info">$STA_SSID$</label><BR>
<label>Channel: </label><label class="text-info">$STA_CHANNEL$</label><BR>
<label>Status: </label><label class="text-info">$STA_STATUS$</label><BR>
<label>DHCP Client: </label><label class="text-info">$STA_DHCP_STATUS$</label><BR>
<label>IP: </label><label class="text-info">$STA_IP$</label><BR>
<label>Gateway: </label><label class="text-info">$STA_GW$</label><BR>
<label>Subnet: </label><label class="text-info">$STA_SUBNET$</label><BR>
</div>
</div>
</div>
$INCLUDE[footer.inc]$

303
esp8266/data/printer.tpl Normal file
View File

@ -0,0 +1,303 @@
$INCLUDE[header.inc]$
<table>
<tr><td style="padding:0px;"><div id="Extruder1" style="visibility:hidden;height:0px;">
<table><tr><td><label>E1:&nbsp;</label></td>
<td id="data_extruder1"></td><td>0<input id="rangeinput1" type="range" min=0 max=270 onchange="Updatenumber('1');">270</td>
<td><input class="form-control" id="numberinput1" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('1');"></td><td> &#176;C
<td><input type="submit" value="Set" onclick="SendValue( 'M104 T0 S', '1');"></td></tr></table></div></td></tr>
<tr ><td style="padding:0px;"><div id="Extruder2" style="visibility:hidden;height:0px;">
<table><tr><td><label>E2:&nbsp;</label></td>
<td id="data_extruder2"></td><td>0<input id="rangeinput2" type="range" min=0 max=270 onchange="Updatenumber('2');">270</td>
<td><input class="form-control" id="numberinput2" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('2');"></td><td>&#176;C
<input type="submit" value="Set" onclick="SendValue( 'M104 T1 S', '2');">
</td></tr></table></div></td></tr>
<tr><td style="padding:0px;"><div id="Bed" style="visibility:hidden;height:0px;">
<table><tr><td><label>Bed:</label></td>
<td id="data_bed"></td><td>0<input id="rangeinputbed" type="range" min=0 max=130 onchange="Updatenumber('bed');">130</td>
<td><input class="form-control" id="numberinputbed"type="number" min=0 max=270 step=1 value=0 onchange="Updaterange('bed');"></td><td>&#176;C
<input type="submit" value="Set" onclick="SendValue( 'M140 S', 'bed');">
</td></tr></table></div></td></tr>
<tr><td id="speed"><table><tr>
<td><label>Speed:</label></td><td class="text-info" id="currentspeed"></td>
<td>0<input id="rangeinputspeed" type="range" min=0 max=300 onchange="Updatenumber('speed');">300</td>
<td><input class="form-control" id="numberinputspeed" type="number" size="3" min=0 max=300 step=1 value=0 onchange="Updaterange('speed');"></td><td>%
<input type="submit" value="Set" onclick="SendValue( 'M220 S', 'speed');"></td>
<td>&nbsp;&nbsp;</td><td>Status:</td><td id="status" align="center" valign="middle">
<svg width="20" height="20"><circle cx="10" cy="10" r="8" stroke="black" stroke-width="2" fill="white"></circle></svg></td>
<td id="status-text"></td><td>&nbsp;&nbsp;</td><td class="btnimg" onclick="OnclickEmergency();">
<svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="red" />
<circle cx="20" cy="20" r="10" stroke="black" stroke-width="4" fill="red" /><rect x="15" y="8" width="10" height="10" style="fill:red;stroke-width:1;stroke:red" />
<rect x="18" y="6" rx="1" ry="1" width="4" height="14" style="fill:black;stroke-width:1;stroke:black" /></svg></td></tr></table></td></tr>
<tr><td id="flow"><table><tr><td><label>Flow:</label></td><td class="text-info" id="currentflow"></td>
<td>0<input id="rangeinputflow" type="range" min=0 max=300 onchange="Updatenumber('flow');">300</td>
<td><input class="form-control" id="numberinputflow" size="3" type="number" min=0 max=300 step=1 value=0 onchange="Updaterange('flow');"></td><td>%
<input type="submit" value="Set" onclick="SendValue( 'M221 S', 'flow');"></td><td>&nbsp;&nbsp;</td>
<td><label>X:</label></td><td class="text-info" id="posx"></td><td>&nbsp;&nbsp;</td><td><label>Y:</label></td><td class="text-info" id="posy"></td><td>&nbsp;&nbsp;</td>
<td><label>Z:</label></td><td class="text-info" id="posz" ></td></tr></table></td></tr>
<tr><td><table width="100%"><tr><td width="auto"><label>Command:</label></td>
<td width="100%"><input class="form-control" id="cmd" type="text" style="width: 100%;"></td>
<td width="auto"><input type="submit" value="Send" onclick="Sendcustomcommand();"></td></tr></table></td></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Info:</label></td><td width=100% id="infomsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Error:</label></td><td width=100% id="errormsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td><label>Status:</label></td><td width=100% id="statusmsg" class="text-info"></td></tr></table></tr>
<tr><td><hr></td></tr><tr><td><table><tr><td class="btnimg" onclick="Sendcommand('M24');">
<svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" /><polygon points="15,10 30,20 15,30" fill:"white" stroke:"white" stroke-width:"1" /></svg></td>
<td class="btnimg" onclick="Sendcommand('M25');"><svg width="40" height="40" viewBox="0 0 40 40"> <circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /> <rect x="23" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /></svg></td>
<td class="btnimg" onclick="Sendcommand('M50');"><svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /></svg></td>
<td class="btnimg" onclick="alert('Not yet implemented');"><svg width="40" height="40" viewBox="0 0 40 40"><rect x="5" y="10" width="30" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" /><text x="10" y="25" font-family="Verdana" font-size="14" fill="white">SD</text></svg></td>
<td>&nbsp;</td></tr></table></td></tr><tr><td><table><tr align="center" valign="middle"><td class="btnimg" onclick=" Sendcommand('G28 X');">
<svg width="40" height="40" viewBox="0 0 40 40" ><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="black" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">X</text></svg></td><td>
<table><tr><td class="btnimg" onclick="SendJogcommand( 'Y-10',XYfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7"/><text x="13" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y-1',XYfeedrate);"><svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5"/><text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y-0.1',XYfeedrate);"><svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:2"/><text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td class="btnimg" onclick=" Sendcommand('G28 Y');"><svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="blue" stroke-width:"1" stroke:"black" /><line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /><text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Y</text></svg></td>
<td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'Z-10',Zfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z-1',Zfeedrate);"><svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5"/><text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z-0.1',Zfeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder1-1" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E0-10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0-1',Efeedrate);"><svg width="40" height="20" viewBox="0 2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0-0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder2-1" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E1-10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7"/><text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1-1',Efeedrate);"><svg width="40" height="20" viewBox="0 2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1-0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 4 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td></tr></table></td></tr>
<tr align="center" valign="middle"><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'X10',XYfeedrate);"><svg width="20" height="40" viewBox="12 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(-90 20 10)"/><text x="22" y="13" font-family="Verdana" font-size="7" fill="black">10</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X1',XYfeedrate);"><svg width="20" height="40" viewBox="10 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(-90 20 10)"/>
<text x="21" y="13" font-family="Verdana" font-size="7" fill="black">1</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X0.1',XYfeedrate);"><svg width="20" height="40" viewBox="14 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:2" transform="rotate(-90 20 10)"/><text x="19" y="13" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
</table></td><td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'X-0.1',XYfeedrate);"><svg width="20" height="40" viewBox="6 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:3" transform="rotate(90 20 10)"/><text x="7" y="12" font-family="Verdana" font-size="7" fill="black">-0.1</text></svg></td>
<td class="btnimg" onclick="SendJogcommand( 'X-1',XYfeedrate);"><svg width="20" height="40" viewBox="8 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(90 20 10)"/>
<text x="11" y="13" font-family="Verdana" font-size="7" fill="black">-1</text></svg></td><td class="btnimg" onclick="SendJogcommand( 'X-10',XYfeedrate);">
<svg width="20" height="40" viewBox="8 -10 20 40"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(90 20 10)"/>
<text x="7" y="12" font-size="7" fill="black">-10</text></svg></td></tr></table></td>
<td></td><td><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="green">Z</text></svg></td>
<td></td><td id="JogExtruder1-2" style="visibility:hidden;"><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="orange">1</text></svg></td>
<td></td><td id="JogExtruder2-2" style="visibility:hidden;"><svg width="20" height="20" viewBox="0 0 20 20"><text x="1" y="18" font-family="Verdana" font-size="22" fill="pink">2</text></svg></td></tr>
<tr align="center" valign="middle"><td class="btnimg" onclick=" Sendcommand('G28');"><svg width="40" height="40" viewBox="0 0 40 40"><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="purple" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /></svg></td><td>
<table><tr><td class="btnimg" onclick="SendJogcommand( 'Y0.1',XYfeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:3" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y1',XYfeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="17" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Y10',XYfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td class="btnimg" onclick=" Sendcommand('G28 Z');"><svg width="40" height="40" viewBox="0 0 40 40"><polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="green" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" /><polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" /><text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Z</text></svg></td>
<td></td><td><table><tr><td class="btnimg" onclick="SendJogcommand( 'Z0.1',Zfeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z1',Zfeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'Z10',Zfeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder1-3" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E0+0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0+1',Efeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E0+10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7" transform="rotate(180 20 10)"/><text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td>
<td></td><td id="JogExtruder2-3" style="visibility:hidden;"><table><tr><td class="btnimg" onclick="SendJogcommand( 'E1+0.1',Efeedrate);"><svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:3" transform="rotate(180 20 10)"/><text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1+1',Efeedrate);"><svg width="40" height="20" viewBox="0 -2 40 20"><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text></svg></td></tr>
<tr><td class="btnimg" onclick="SendJogcommand( 'E1+10',Efeedrate);"><svg width="40" height="20" viewBox="0 0 40 20" ><polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text></svg></td></tr></table></td></tr></table></td></tr></table>
<script type="text/javascript">
var XYfeedrate=$XY_FEEDRATE$;
var Zfeedrate=$Z_FEEDRATE$;
var Efeedrate=$E_FEEDRATE$;
function Sendcommand(commandtxt){
var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/CMD?COM="+encodeURI(commandtxt);;
xmlhttp.open("POST", url, true);
xmlhttp.send();
}
function delay(ms) {
ms += new Date().getTime();
while (new Date() < ms){}
}
function SendJogcommand( cmd, feedrate){
Sendcommand("G91");
delay(100);
Sendcommand("G1 "+cmd + " F"+feedrate);
delay(100);
Sendcommand("G90");
}
function SendValue( cmd, item){
Sendcommand(cmd + document.getElementById("numberinput"+item).value);
}
function Sendcustomcommand(){
var cmd = document.getElementById("cmd").value;
if (cmd.trim().length > 0) Sendcommand(cmd);
document.getElementById("cmd").value="";
}
function OnclickEmergency(){
Sendcommand("M112");
}
function Updatenumber(item){
document.getElementById("numberinput"+item).value=document.getElementById("rangeinput"+item).value;
}
function Updaterange(item){
document.getElementById("rangeinput"+item).value=document.getElementById("numberinput"+item).value;
}
Updaterange('1');
Updaterange('2');
Updaterange('bed');
Updaterange('speed');
Updaterange('flow');
var pulse=true;
var initialization_done = false;
function displaytemp(temperature, target,item){
var displaypicture = "<svg height=\"30px \" width=\"300px \" xmlns=\"http://wwww.w3.org/2000/svg\">\n<linearGradient id=\"gradient\">\n";
var description = String (temperature) + "/";
if (target>0)description += String (target);
else description += "Off ";
displaypicture+="<stop class=\"begin\" style=\"stop-color:green;\" offset=\"0%\"/>\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"100%\"/>\n</linearGradient>\n<linearGradient id=\"gradient2\">\n";
displaypicture+="<stop class=\"middle\" style=\"stop-color:yellow;\" offset=\"0%\"/>\n<stop class=\"end\" style=\"stop-color:red;\" offset=\"100%\"/>\n";
displaypicture+="</linearGradient>\n<rect x=\"10\" y=\"4\" width=\"24\" height=\"21\" style=\"fill:url(#gradient)\" />\n";
displaypicture+="<rect x=\"34\" y=\"4\" width=\"280\" height=\"21\" style=\"fill:url(#gradient2)\" />\n<line x1=\"";
displaypicture+=String(target+10);
displaypicture+="\" y1=\"4\" x2=\"";
displaypicture+=String(target+10);
displaypicture+="\" y2=\"25\" style=\"stroke:rgb(255,255,255);stroke-width:1\" />\n<path d=\"M";
displaypicture+=String(temperature+5);
displaypicture+=" 0 L";
displaypicture+=String(temperature+15);
displaypicture+=" 0 L";
displaypicture+=String(temperature+10);
displaypicture+=" 8 Z\" stroke=\"white\" stroke-width=\"1\" />\n<path d=\"M";
displaypicture+=String(temperature+5);
displaypicture+=" 30 L";
displaypicture+=String(temperature+15);
displaypicture+=" 30 L";
displaypicture+=String(temperature+10);
displaypicture+=" 22 Z\" stroke=\"white\" stroke-width=\"1\"/>\n<text x=\"30\" y=\"19\" fill=\"black\" style=\"font-family: calibri; font-size:10pt;\">\n";
displaypicture+=description;
displaypicture+=" &#176;C</text>\n</svg>";
document.getElementById(item).innerHTML=displaypicture;
}
function displaystatus(status){
var content ="<svg width=\"20\" height=\"20\"><circle cx=\"10\" cy=\"10\" r=\"8\" stroke=\"black\" stroke-width=\"2\" fill=\"";
if (status=="Connected"){
if (pulse)content +="#00FF00";
else content +="#007F0E";}
else if (status=="Busy"){
if (pulse)content +="#FFD800";
else content +="#7F6A00";}
else{
if (pulse)content +="#FF0000";
else content +="#7F0000";}
content +="\"></circle></svg>";
pulse=!pulse;
document.getElementById("status").innerHTML=content;
document.getElementById("status-text").innerHTML=status;
}
function dispatchstatus(jsonresponse){
if(jsonresponse.heater[0].active==1){
document.getElementById("Extruder1").style.visibility="visible";
document.getElementById("Extruder1").style.height="auto";
document.getElementById("JogExtruder1-1").style.visibility="visible";
document.getElementById("JogExtruder1-2").style.visibility="visible";
document.getElementById("JogExtruder1-3").style.visibility="visible";
displaytemp(jsonresponse.heater[0].temperature, jsonresponse.heater[0].target,"data_extruder1");
Updaterange('1');}
else {
document.getElementById("Extruder1").style.visibility="hidden";
document.getElementById("Extruder1").style.height="0px";
document.getElementById("JogExtruder1-1").style.visibility="hidden";
document.getElementById("JogExtruder1-2").style.visibility="hidden";
document.getElementById("JogExtruder1-3").style.visibility="hidden";}
if(jsonresponse.heater[1].active==1){
document.getElementById("Extruder2").style.visibility="visible";
document.getElementById("Extruder2").style.height="auto";
document.getElementById("JogExtruder2-1").style.visibility="visible";
document.getElementById("JogExtruder2-2").style.visibility="visible";
document.getElementById("JogExtruder2-3").style.visibility="visible";
displaytemp(jsonresponse.heater[1].temperature, jsonresponse.heater[1].target,"data_extruder2");
Updaterange('2');}
else {
document.getElementById("Extruder2").style.visibility="hidden";
document.getElementById("Extruder2").style.height="0px";
document.getElementById("JogExtruder2-1").style.visibility="hidden";
document.getElementById("JogExtruder2-2").style.visibility="hidden";
document.getElementById("JogExtruder2-3").style.visibility="hidden";}
if(jsonresponse.heater[2].active==1){
document.getElementById("Bed").style.visibility="visible";
document.getElementById("Bed").style.height="auto";
displaytemp(jsonresponse.heater[2].temperature, jsonresponse.heater[2].target,"data_bed");
Updaterange('bed');}
else {
document.getElementById("Bed").style.visibility="hidden";
document.getElementById("Bed").style.height="0px";}
document.getElementById("posx").innerHTML=jsonresponse.Xpos;
document.getElementById("posy").innerHTML=jsonresponse.Ypos;
document.getElementById("posz").innerHTML=jsonresponse.Zpos;
displaystatus(jsonresponse.status);
var content="";
for (i = 0; i < jsonresponse.InformationMsg.length; i++) {
if (i==jsonresponse.InformationMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.InformationMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.InformationMsg[i].line;
content += "</li>";}
document.getElementById("infomsg").innerHTML=content;
content="";
for (i = 0; i < jsonresponse.ErrorMsg.length; i++){
if (i==jsonresponse.ErrorMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.ErrorMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.ErrorMsg[i].line;
content +="</li>";}
document.getElementById("errormsg").innerHTML=content;
content="";
for (i = 0; i < jsonresponse.StatusMsg.length; i++)
{
if (i==jsonresponse.StatusMsg.length-1)content +="<li style='list-style-type: disc;'><b>" +jsonresponse.StatusMsg[i].line+ "</b>";
else content +="<li style='list-style-type: circle;'>"+jsonresponse.StatusMsg[i].line;
content +="</li>";
}
document.getElementById("statusmsg").innerHTML=content;
if (!initialization_done){
document.getElementById("numberinputspeed").value=jsonresponse.speed;
Updaterange('speed');
document.getElementById("numberinputflow").value=jsonresponse.flow;
Updaterange('flow');
initialization_done=true;}
document.getElementById("currentspeed").innerHTML=jsonresponse.speed + "%";
document.getElementById("currentflow").innerHTML=jsonresponse.flow + "%";
}
function getstatus(){
var xmlhttp = new XMLHttpRequest();
var url = "http://$WEB_ADDRESS$/STATUS";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var jsonresponse = JSON.parse(xmlhttp.responseText);
dispatchstatus(jsonresponse);}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
setInterval(function(){getstatus();},$REFRESH_PAGE$);
</script>
$INCLUDE[footer.inc]$

27
esp8266/data/restart.tpl Normal file
View File

@ -0,0 +1,27 @@
<HTML>
<HEAD>
<title>Restarting...</title>
</HEAD>
<BODY>
<CENTER>Restarting, please wait....
<BR>
<PROGRESS name='prg' id='prg'>
</CENTER>
<script>
var i = 0;
var interval;
var x = document.getElementById("prg");
x.max=40;
interval = setInterval(function(){
i=i+1;
var x = document.getElementById("prg");
x.value=i;
if (i>40)
{
clearInterval(interval);
window.location.href='/';
}
},1000);
</script>
</BODY>
</HTML>

27
esp8266/data/settings.tpl Normal file
View File

@ -0,0 +1,27 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">Printer Settings</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $REFRESH_PAGE_STATUS$"><label class="control-label" for="CONFIG1">Refresh page time: </label><br>
<input type="number" class="form-control" id="CONFIG1" name="REFRESH_PAGE" placeholder="Time in minutes 1~120 " value="$REFRESH_PAGE$" min="1"max="120" step="1"style="width: auto;"></div>
<div class="form-group $XY_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG2">XY axis feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG2" name="XY_FEEDRATE" placeholder="1~9999 " value="$XY_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="form-group $Z_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG3">Z axis feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG3" name="Z_FEEDRATE" placeholder="1~9999 " value="$Z_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="form-group $E_FEEDRATE_STATUS$"><label class="control-label" for="CONFIG4">Extruder feedrate: </label><br>
<input type="number" class="form-control" id="CONFIG4" name="E_FEEDRATE" placeholder="1~9999 " value="$E_FEEDRATE$" min="1"max="9999" step="1"style="width: auto;"></div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
$INCLUDE[footer.inc]$

30
esp8266/data/system.tpl Normal file
View File

@ -0,0 +1,30 @@
$INCLUDE[header.inc]$
<div class="panel">
<div class="panel-heading">System</div>
<div class="panel-body">
<form method="POST">
<div class="form-group $BAUD_RATE_STATUS$">
<label class="control-label" for="CONFIG1" >Baud rate</label><br>
<select name="BAUD_RATE" id="CONFIG1" class="form-control">
$BAUD_RATE_OPTIONS_LIST$
</select></div>
<div class="form-group $SLEEP_MODE_STATUS$">
<label class="control-label" for="CONFIG2">Sleep Mode</label><br>
<select name="SLEEP_MODE" id="CONFIG2" class="form-control">
$SLEEP_MODE_OPTIONS_LIST$
</select></div>
<div class="form-group $WEB_PORT_STATUS$"><label class="control-label" for="CONFIG3">Web port:</label><br>
<input type="number" class="form-control" id="CONFIG3" name="WEBPORT" min="1" max="65000" step="1" placeholder="1~65000" value="$WEB_PORT$" style="width: auto;"></div>
<div class="form-group $DATA_PORT_STATUS$"><label class="control-label" for="CONFIG4">Data port:</label><br>
<input type="number" class="form-control" id="CONFIG4" name="DATAPORT" min="1" max="65000" step="1" placeholder="1~65000" value="$DATA_PORT$" style="width: auto;"></div>
<div class="alert alert-danger" role="alert" style="$ERROR_MSG_VISIBILITY$" >
$ERROR_MSG$
</div>
<hr><input style="$SUBMIT_BUTTON_VISIBILITY$" type="submit" class="btn btn-primary" name="SUBMIT" value="Apply">
</form>
<div class="alert alert-success" role="alert" style="$SUCCESS_MSG_VISIBILITY$" >
$SUCCESS_MSG$
</div>
</div>
</div>
$INCLUDE[footer.inc]$

View File

@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this Firmware. If not, see <http://www.gnu.org/licenses/>.
along with this Firmware. If not, see <http://www.gnu.org/licenses/>.
This firmware is using the standard arduino IDE with module to support ESP8266:
https://github.com/esp8266/Arduino from Bootmanager
@ -50,6 +50,7 @@ DNSServer dnsServer;
extern "C" {
#include "user_interface.h"
}
#include <FS.h>
#define MAX_SRV_CLIENTS 1
WiFiServer * data_server;
WiFiClient serverClients[MAX_SRV_CLIENTS];
@ -68,7 +69,7 @@ void setup() {
long baud_rate=0;
//check if EEPROM has value
if ( CONFIG::read_buffer(EP_BAUD_RATE, (byte *)&baud_rate , INTEGER_LENGH)&&CONFIG::read_buffer(EP_WEB_PORT, (byte *)&(wifi_config.iweb_port) , INTEGER_LENGH)&&CONFIG::read_buffer(EP_DATA_PORT, (byte *)&(wifi_config.idata_port) , INTEGER_LENGH))
if ( CONFIG::read_buffer(EP_BAUD_RATE, (byte *)&baud_rate , INTEGER_LENGTH)&&CONFIG::read_buffer(EP_WEB_PORT, (byte *)&(wifi_config.iweb_port) , INTEGER_LENGTH)&&CONFIG::read_buffer(EP_DATA_PORT, (byte *)&(wifi_config.idata_port) , INTEGER_LENGTH))
{
//check if baud value is one of allowed ones
if ( ! (baud_rate==9600 || baud_rate==19200 ||baud_rate==38400 ||baud_rate==57600 ||baud_rate==115200 ||baud_rate==230400 ||baud_rate==250000) )breset_config=true;//baud rate is incorrect =>reset settings
@ -83,6 +84,7 @@ void setup() {
{
//update EEPROM with default settings
CONFIG::reset_config();
delay(1000);
//use default baud rate and ports
baud_rate=DEFAULT_BAUD_RATE;
wifi_config.iweb_port=DEFAULT_WEB_PORT;
@ -90,8 +92,10 @@ void setup() {
}
//setup serial
Serial.begin(baud_rate);
delay(1000);
wifi_config.baud_rate=baud_rate;
//setup wifi according settings
wifi_config.Setup();
if (!wifi_config.Setup()) wifi_config.Safe_Setup();
delay(1000);
//start interfaces
web_interface = new WEBINTERFACE_CLASS(wifi_config.iweb_port);
@ -110,15 +114,19 @@ void setup() {
{
// if DNSServer is started with "*" for domain name, it will reply with
// provided IP to all DNS request
dnsServer.setErrorReplyCode(DNSReplyCode::NoError);
dnsServer.start(DNS_PORT, "*", WiFi.softAPIP());
}
#endif
#ifdef SSDP_FEATURE
String stmp;
SSDP.setSchemaURL("description.xml");
SSDP.setHTTPPort( wifi_config.iweb_port);
SSDP.setName("ESP8266 Module");
SSDP.setSerialNumber(String(system_get_chip_id()).c_str());
if (!CONFIG::read_string(EP_HOSTNAME, stmp , MAX_HOSTNAME_LENGTH))stmp=wifi_config.get_default_hostname();
SSDP.setName(stmp.c_str());
stmp=String(system_get_chip_id());
SSDP.setSerialNumber(stmp.c_str());
SSDP.setURL("/");
SSDP.setModelName("ESP8266 01");
SSDP.setModelNumber("01");
@ -127,6 +135,7 @@ void setup() {
SSDP.setManufacturerURL("http://espressif.com");
SSDP.begin();
#endif
SPIFFS.begin();
}

View File

@ -18,52 +18,130 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "storestrings.h"
#define MAX_STORAGE 20
STORESTRINGS_CLASS::STORESTRINGS_CLASS (uint8_t size){
storage_size = (size<MAX_STORAGE)?size:MAX_STORAGE;
storage = new String[storage_size];
storage_cursor=0;
//Constructor
STORESTRINGS_CLASS::STORESTRINGS_CLASS (int maxsize , int maxstringlength){
//for rolling buffer
//if max size is reached then remove oldest one and add the new one
_maxsize=maxsize;
//to limit the storage space
_maxstringlength=maxstringlength;
//need space for the "..."
if (_maxstringlength<4 && _maxstringlength!=-1)_maxstringlength=4;
}
//Destructor
STORESTRINGS_CLASS::~STORESTRINGS_CLASS (){
delete storage;
storage_size = 0;
// clear list and content
clear();
}
bool STORESTRINGS_CLASS::add (const char * string){
//check if if there is something to add
if (strlen(string)> 0 )
{ //is current cursor available or need a shift
if (storage_cursor > storage_size-1)
{
for (uint i=0;i<storage_size-1;i++)
{
storage[i]=storage[i+1];
}
storage_cursor--;
}
storage[storage_cursor]=String(string);
storage_cursor++;
bool STORESTRINGS_CLASS::setsize(int size)
{
_maxsize=size;
return true;
}
bool STORESTRINGS_CLASS::setlenght(int lenght)
{
if (lenght<4)return false;
_maxstringlength=lenght;
return true;
}
int STORESTRINGS_CLASS::getsize()
{
return _maxsize;
}
int STORESTRINGS_CLASS::getlenght()
{
return _maxstringlength;
}
//Clear list and content
void STORESTRINGS_CLASS::clear(){
//while list is not empty
while(_charlist.size()){
//remove element
char * str = _charlist.pop();
//destroy it
delete str;
}
else return false;
}
String STORESTRINGS_CLASS::get_index_at(uint pos)
bool STORESTRINGS_CLASS::add (String & string)
{
if (pos > storage_size-1) return storage[storage_size-1];
else return storage[pos];
return add(string.c_str());
}
uint STORESTRINGS_CLASS::get_size()
bool STORESTRINGS_CLASS::add (const __FlashStringHelper *str)
{
return storage_size;
String stmp;
stmp=str;
return add(stmp.c_str());
}
//Add element in storage
bool STORESTRINGS_CLASS::add (const char * string){
//if we reach max size
if (_maxsize==_charlist.size())
{//remove oldest one
char * str = _charlist.shift();
delete str;
}
//add new one
//get size including \0 at the end
size_t size = strlen(string)+1;
bool need_resize=false;
if ( (_maxstringlength!=-1) && (size >_maxstringlength+1 ))
{
need_resize = true;
size=_maxstringlength+1;
}
//reserve memory
char * ptr = new char[size*sizeof(char)];
//copy string to storage
if (need_resize)
{ //copy maximum length minus 3
strncpy(ptr,string,_maxstringlength-3);
//add nul char
ptr[_maxstringlength-3]='\0';
//add dot to show string was cutted
strcat(ptr,"...");
}
else
{ //copy as it is
strcpy(ptr,string);
}
//add storage to list
_charlist.add(ptr);
return true;
}
//Remove element at pos position
bool STORESTRINGS_CLASS::remove(int pos)
{ //be sure index is in range
if (pos<0 && pos>(_charlist.size()-1)) return false;
//remove item from list
char * str = _charlist.remove(pos);
//destroy item
delete str;
return true;
}
//Get element at pos position
const char * STORESTRINGS_CLASS::get(int pos)
{ //be sure index is in range
if (pos<0 && pos>(_charlist.size()-1)) return NULL;
return (const char *) _charlist.get(pos);
}
//Get index for defined string
int STORESTRINGS_CLASS::get_index(const char * string)
{//parse the list until it is found
for (int p=0;p<_charlist.size();p++)
{
if (strcmp ( _charlist.get(p), string)==0)return p;
}
//if not found return -1
return -1;
}
//Number of elements in list
int STORESTRINGS_CLASS::size()
{
return _charlist.size();
}
int STORESTRINGS_CLASS::get_used_max_index()
{
if (storage_cursor > storage_size-1) return storage_size-1;
else return storage_cursor-1;
}

View File

@ -20,21 +20,29 @@
#ifndef STORESTRINGS_h
#define STORESTRINGS_h
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "LinkedList.h"
class STORESTRINGS_CLASS
{
public:
STORESTRINGS_CLASS (uint8_t size = 10);
STORESTRINGS_CLASS (int maxsize = -1, int maxstringlength=-1);
~STORESTRINGS_CLASS ();
bool add (const char * string);
String get_index_at(uint pos);
uint get_size();
int get_used_max_index();
bool add (String & string);
bool add (const __FlashStringHelper *str);
bool remove(int pos);
const char * get(int pos);
int get_index(const char * string);
void clear();
int size();
bool setsize(int size);
bool setlenght(int lenght);
int getsize();
int getlenght();
private:
String * storage;
uint storage_size;
uint storage_cursor;
int _maxsize;
int _maxstringlength;
LinkedList<char *> _charlist;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -32,10 +32,12 @@ class WEBINTERFACE_CLASS
{
public:
WEBINTERFACE_CLASS (int port = 80);
~WEBINTERFACE_CLASS();
ESP8266WebServer WebServer;
void urldecode(char *dst, const char *src);
void urldecode( String & dst, const char *src);
bool isSSIDValid(const char * ssid);
bool isPasswordValid(const char * password);
bool isHostnameValid(const char * hostname);
bool isIPValid(const char * IP);
String answer4M105;
String answer4M114;

View File

@ -28,27 +28,62 @@
extern "C" {
#include "user_interface.h"
}
//to get access to some function like
//wifi_get_opmode() in status
const char * WIFI_CONFIG::get_hostname(){
if (WiFi.hostname().length()==0)
{
if (!CONFIG::read_string(EP_HOSTNAME, _hostname , MAX_HOSTNAME_LENGTH))strcpy(_hostname,get_default_hostname());
}
else strcpy(_hostname,WiFi.hostname().c_str());
return _hostname;
}
const char * WIFI_CONFIG::get_default_hostname()
{
static char hostname[13];
uint8_t mac [WL_MAC_ADDR_LENGTH];
WiFi.macAddress(mac);
if (0>sprintf(hostname,"ESP_%02X%02X%02X",mac[3],mac[4],mac[5])) strcpy (hostname, "ESP8266");
return hostname;
}
//no strtok so this is simplified version
//return number of part
byte WIFI_CONFIG::split_ip (char * ptr,byte * part)
byte WIFI_CONFIG::split_ip (const char * ptr,byte * part)
{
char * pstart = ptr;
byte i = strlen(ptr);
if (strlen(ptr)>15 || strlen(ptr)< 7)
{
part[0]=0;
part[1]=0;
part[2]=0;
part[3]=0;
return 0;
}
char pstart [16];
char * ptr2;
strcpy(pstart,ptr);
ptr2 = pstart;
byte i = strlen(pstart);
byte pos = 0;
for (byte j=0;j<i;j++)
{
if (ptr[j]=='.')
if (pstart[j]=='.')
{
ptr[j]=0x0;
part[pos]=atoi(pstart);
if (pos==4)
{
part[0]=0;
part[1]=0;
part[2]=0;
part[3]=0;
return 0;
}
pstart[j]=0x0;
part[pos]=atoi(ptr2);
pos++;
pstart = &ptr[j+1];
ptr2 = &pstart[j+1];
}
}
part[pos]=atoi(pstart);
part[pos]=atoi(ptr2);
return pos+1;
}
@ -68,19 +103,46 @@ char * WIFI_CONFIG::ip2str(IPAddress Ip )
return ipstr;
}
void WIFI_CONFIG::Safe_Setup()
{
WiFi.disconnect();
//setup Soft AP
WiFi.mode(WIFI_AP);
IPAddress local_ip (DEFAULT_IP_VALUE[0],DEFAULT_IP_VALUE[1],DEFAULT_IP_VALUE[2],DEFAULT_IP_VALUE[3]);
IPAddress gateway (DEFAULT_GATEWAY_VALUE[0],DEFAULT_GATEWAY_VALUE[1],DEFAULT_GATEWAY_VALUE[2],DEFAULT_GATEWAY_VALUE[3]);
IPAddress subnet (DEFAULT_MASK_VALUE[0],DEFAULT_MASK_VALUE[1],DEFAULT_MASK_VALUE[2],DEFAULT_MASK_VALUE[3]);
String ssid = FPSTR(DEFAULT_SSID);
String pwd = FPSTR(DEFAULT_PASSWORD);
WiFi.softAP(ssid.c_str(),pwd.c_str());
delay(500);
wifi_set_phy_mode(PHY_MODE_11B);
WiFi.softAPConfig( local_ip, gateway, subnet);
Serial.println(F("M117 Safe mode started"));
delay(1000);
}
//Read configuration settings and apply them
bool WIFI_CONFIG::Setup()
{
char pwd[MAX_PASSWORD_LENGH+1];
char sbuf[MAX_SSID_LENGH+1];
char pwd[MAX_PASSWORD_LENGTH+1];
char sbuf[MAX_SSID_LENGTH+1];
char hostname [MAX_HOSTNAME_LENGTH+1];
int wstatus;
IPAddress currentIP;
byte bflag=0;
//set the sleep mode
if (!CONFIG::read_byte(EP_SLEEP_MODE, &bflag ))return false;
if (!CONFIG::read_byte(EP_SLEEP_MODE, &bflag ))
{
return false;
}
wifi_set_sleep_type ((sleep_type)bflag);
sleep_mode=bflag;
//AP or client ?
if (!CONFIG::read_byte(EP_WIFI_MODE, &bflag ) || !CONFIG::read_string(EP_SSID, sbuf , MAX_SSID_LENGH) ||!CONFIG::read_string(EP_PASSWORD, pwd , MAX_PASSWORD_LENGH)) return false;
if (!CONFIG::read_byte(EP_WIFI_MODE, &bflag ) || !CONFIG::read_string(EP_SSID, sbuf , MAX_SSID_LENGTH) ||!CONFIG::read_string(EP_PASSWORD, pwd , MAX_PASSWORD_LENGTH))
{
return false;
}
if (!CONFIG::read_string(EP_HOSTNAME, hostname , MAX_HOSTNAME_LENGTH))strcpy(hostname,get_default_hostname());
//disconnect if connected
WiFi.disconnect();
current_mode=bflag;
@ -91,7 +153,10 @@ bool WIFI_CONFIG::Setup()
WiFi.mode(WIFI_AP);
WiFi.softAP(sbuf, pwd);
//setup PHY_MODE
if (!CONFIG::read_byte(EP_PHY_MODE, &bflag ))return false;
if (!CONFIG::read_byte(EP_PHY_MODE, &bflag ))
{
return false;
}
wifi_set_phy_mode((phy_mode)bflag);
//get current config
struct softap_config apconfig;
@ -114,52 +179,54 @@ bool WIFI_CONFIG::Setup()
Serial.println(F("M117 Error Wifi AP!"));
delay(1000);
}
wifi_softap_dhcps_start();
}
else
{//setup station mode
WiFi.mode(WIFI_STA);
WiFi.begin(sbuf, pwd);
//setup PHY_MODE
if (!CONFIG::read_byte(EP_PHY_MODE, &bflag ))return false;
wifi_set_phy_mode((phy_mode)bflag);
byte i=0;
//try to connect
while (WiFi.status() != WL_CONNECTED && i<40) {
switch(WiFi.status())
{
WiFi.mode(WIFI_STA);
WiFi.begin(sbuf, pwd);
delay(500);
//setup PHY_MODE
if (!CONFIG::read_byte(EP_PHY_MODE, &bflag ))return false;
wifi_set_phy_mode((phy_mode)bflag);
byte i=0;
//try to connect
while (WiFi.status() != WL_CONNECTED && i<40) {
switch(WiFi.status())
{
case 1:Serial.println(F("M117 No SSID found!"));
break;
case 4:Serial.println(F("M117 No Connection!"));
break;
default: Serial.println(F("M117 Connecting..."));
break;
}
delay(500);
i++;
}
}
delay(500);
i++;
}
if (WiFi.status() != WL_CONNECTED) return false;
WiFi.hostname(hostname);
}
//DHCP or Static IP ?
if (!CONFIG::read_byte(EP_IP_MODE, &bflag )) return false;
if (bflag==STATIC_IP_MODE)
{
byte ip_buf[4];
//get the IP
if (!CONFIG::read_buffer(EP_IP_VALUE,(byte *)sbuf , IP_LENGH))return false;
IPAddress local_ip (sbuf[0],sbuf[1],sbuf[2],sbuf[3]);
if (!CONFIG::read_buffer(EP_IP_VALUE,ip_buf , IP_LENGTH))return false;
IPAddress local_ip (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
//get the gateway
if (!CONFIG::read_buffer(EP_GATEWAY_VALUE,(byte *)sbuf , IP_LENGH))return false;
IPAddress gateway (sbuf[0],sbuf[1],sbuf[2],sbuf[3]);
if (!CONFIG::read_buffer(EP_GATEWAY_VALUE,ip_buf , IP_LENGTH))return false;
IPAddress gateway (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
//get the mask
if (!CONFIG::read_buffer(EP_MASK_VALUE,(byte *)sbuf , IP_LENGH))return false;
IPAddress subnet (sbuf[0],sbuf[1],sbuf[2],sbuf[3]);
if (!CONFIG::read_buffer(EP_MASK_VALUE,ip_buf , IP_LENGTH))return false;
IPAddress subnet (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
//apply according active wifi mode
if (wifi_get_opmode()==WIFI_AP || wifi_get_opmode()==WIFI_AP_STA) WiFi.softAPConfig( local_ip, gateway, subnet);
else WiFi.config( local_ip, gateway, subnet);
if (wifi_get_opmode()==WIFI_AP || wifi_get_opmode()==WIFI_AP_STA) WiFi.softAPConfig( local_ip, gateway, subnet);
else WiFi.config( local_ip, gateway, subnet);
}
#ifdef MDNS_FEATURE
// Set up mDNS responder:
if (!mdns.begin(String(FPSTR(LOCAL_NAME)).c_str())) {
if (!mdns.begin(hostname)) {
Serial.println(F("M117 Error with mDNS!"));
delay(1000);
}

View File

@ -39,10 +39,17 @@ class WIFI_CONFIG
byte current_mode;
int iweb_port;
int idata_port;
long baud_rate;
int sleep_mode;
bool Setup();
void Safe_Setup();
char * mac2str(uint8_t mac [WL_MAC_ADDR_LENGTH]);
char * ip2str(IPAddress Ip );
byte split_ip (char * ptr,byte * part);
byte split_ip (const char * ptr,byte * part);
const char * get_default_hostname();
const char * get_hostname();
private:
char _hostname[33];
};

147
keywords.txt Normal file
View File

@ -0,0 +1,147 @@
[COMMON]
$INCLUDE[<filename>] : only one per line and alone, others will be ignored
$IP$ : current active ip
$WEB_ADDRESS$: current active ip , if port is not 80 it will add port like xxx.xxx.xxxx.xxx:XX
$MENU_HOME$/$MENU_SYSTEM$/$MENU_AP$/$MENU_STA$/$MENU_PRINTER$/$MENU_SETTINGS$: to highlight menu of active page (css use class active for active menu)
$SERVICE_PAGE$ : to add extra code like redirection or anything not managed by page
$PAGE_TILE$ : page title
$FILENAME$ : file name of tpl
$SHORT_FILENAME$ : file name of tpl without extension
$MODE$ : the mode when displaying page AP/STA/AP_STA
$FW_VER$ : Firmware version
[HOME]
$HOSTNAME$: Hostname
$HOSTNAME_VISIBLE$ : if AP mode then hostname is not applicable so set to hidden, if in STA mode set to visible
$CHIP_ID$ : Chip ID
$CPU_FREQ$ : CPU Frequency
$FREE_MEM$ : Free memory on heap
$SDK_VER$ : SDK version
$MDNS_VISIBLE$: set to hidden is no MDNS and visible if present
$MDNS_NAME$ : mDNS name if enabled or "Not enabled" if not enabled
$SSDP_VISIBLE$ : set to hidden is no MDNS and visible if present
$SSDP_STATUS$ : set to Enabled / Not enabled according compilation settings
$CAPTIVE_PORTAL_VISIBLE$: set to hidden is no Captive portal and visible if present
$CAPTIVE_PORTAL_STATUS$: set to Enabled / Not enabled according compilation settings
$NET_PHY$ : Network type (b/g/n)
$SLEEP_MODE$ : Sleep Mode
$BOOT_VER$ : Boot version
$BAUD_RATE$ : Baud rates for serial communication
$WEB_PORT$ : Port for web access
$DATA_PORT$ : Port for tcp ip connection
$AP_STATUS_ENABLED$ : is Access Point enabled or disabled
$AP_VISIBILITY$ : if Access Point is enabled set visible, else set to hidden
$AP_MAC$ : Mac address of AP
$AP_SSID$ : SSID of AP
$AP_IS_VISIBLE$ : Is AP visible
$AP_CHANNEL$ : Channel
$AP_AUTH$ : Autehntification mode
$AP_MAX_CON$ : Maximum connections allowed
$AP_DHCP_STATUS$ : AP DHCP server status (started/stopped)
$AP_IP$ : AP IP address
$AP_GW$ : AP gateway address
$AP_SUBNET$ : AP mask of subnet
$CONNECTED_STATIONS[ Repetive template using $ROW_NUMBER$ $MAC_CONNECTED$ $IP_CONNECTED$ ]$
$CONNECTED_STATIONS_NB_ITEMS$ : number of item for connected stations list
or can get variables in direct access:
$ROW_NUMBER[0]$
$MAC_CONNECTED[0]$
$IP_CONNECTED[0]$
until
$ROW_NUMBER[$CONNECTED_STATIONS_NB_ITEMS$ -1]$
$MAC_CONNECTED[$CONNECTED_STATIONS_NB_ITEMS$ -1]$
$IP_CONNECTED[$CONNECTED_STATIONS_NB_ITEMS$ -1]$
$STA_STATUS_ENABLED$ : is Station enabled or disabled
$STA_VISIBILITY$ : if Station is enabled set visible, else set to hidden
$STA_MAC$ : Mac address of Station
$STA_SSID$ : SSID used by STA
$STA_CHANNEL$ : Channel
$STA_STATUS$ : Connection Status
$STA_DHCP_STATUS$ : DHCP Client status
$STA_IP$ : STA IP
$STA_GW$ : STA Gateway
$STA_SUBNET$ : STA Mask
[SYSTEM CONFIGURATION]
$BAUD_RATE_OPTIONS_LIST$ : Baud rate list
$SLEEP_MODE_OPTIONS_LIST$ : Sleep mode list
$POLLING_OPTIONS_LIST$ : Refresh delay list
$WEB_PORT$ : Port for web access
$DATA_PORT$ : Port for tcp ip connection
$ERROR_MSG$ : Error message if any
$SUCCESS_MSG$ : Success message announcing restart
$ERROR_MSG_VISIBILITY$ : Show/Hide Error message
$SUCCESS_MSG_VISIBILITY$ : Show/Hide Success message
$SUBMIT_BUTTON_VISIBILITY$ : Show if no submission or any error, hide if submission is successful
$BAUD_RATE_STATUS$ : change to has-error if issue, or has-success if ok
$SLEEP_MODE_STATUS$ : change to has-error if issue, or has-success if ok
$WEB_PORT_STATUS$ : change to has-error if issue, or has-success if ok
$DATA_PORT_STATUS$ : change to has-error if issue, or has-success if ok
[AP CONFIGURATION]
$AP_SSID$ : Access point SSID
$AP_PASSWORD$ Access point password
$IS_SSID_VISIBLE$ : set to checked if SSID is visible
$NETWORK_OPTION_LIST$ : Option list for network for AP
$CHANNEL_OPTION_LIST$ : Channel list
$AUTH_OPTION_LIST$ Authentification methods list
$IS_STATIC_IP$ : set to checked if use static address
$AP_IP$ : Access point IP if static address
$AP_GW$ : Access point Gaieway if static address
$AP_SUBNET$ : : Access point network mask if static address
$ERROR_MSG$ : Error message if any
$SUCCESS_MSG$ : Success message announcing restart
$ERROR_MSG_VISIBILITY$ : Show/Hide Error message
$SUCCESS_MSG_VISIBILITY$ : Show/Hide Success message
$SUBMIT_BUTTON_VISIBILITY$ : Show if no submission or any error, hide if submission is successful
$AP_SSID_STATUS$ : change to has-error if issue, or has-success if ok
$AP_PASSWORD_STATUS$ : change to has-error if issue, or has-success if ok
$IS_SSID_VISIBLE_STATUS$ : change to has-error if issue, or has-success if ok
$NETWORK_OPTION_LIST_STATUS$ : change to has-error if issue, or has-success if ok
$CHANNEL_OPTION_LIST_STATUS$ : change to has-error if issue, or has-success if ok
$AUTH_OPTION_LIST_STATUS$ : change to has-error if issue, or has-success if ok
$AP_STATIC_IP_STATUS$ : change to has-error if issue, or has-success if ok
$AP_IP_STATUS$ : change to has-error if issue, or has-success if ok
$AP_GW_STATUS$ : change to has-error if issue, or has-success if ok
$AP_SUBNET_STATUS$ : change to has-error if issue, or has-success if ok
[STATION CONFIGURATION]
$STA_SSID$ : Access point SSID
$STA_PASSWORD$ Access point password
$NETWORK_OPTION_LIST$ : Option list for network for AP
$IS_STATIC_IP$ : set to checked if use static address
$STA_IP$ : Access point IP if static address
$STA_GW$ : Access point Gaieway if static address
$STA_SUBNET$ : : Access point network mask if static address
$ERROR_MSG$ : Error message if any
$SUCCESS_MSG$ : Success message announcing restart
$ERROR_MSG_VISIBILITY$ : Show/Hide Error message
$SUCCESS_MSG_VISIBILITY$ : Show/Hide Success message
$SUBMIT_BUTTON_VISIBILITY$ : Show if no submission or any error, hide if submission is successful
$STA_SSID_STATUS$ : change to has-error if issue, or has-success if ok
$STA_PASSWORD_STATUS$ : change to has-error if issue, or has-success if ok
$NETWORK_OPTION_LIST_STATUS$ : change to has-error if issue, or has-success if ok
$STA_STATIC_IP_STATUS$ : change to has-error if issue, or has-success if ok
$STA_IP_STATUS$ : change to has-error if issue, or has-success if ok
$STA_GW_STATUS$ : change to has-error if issue, or has-success if ok
$STA_SUBNET_STATUS$ : change to has-error if issue, or has-success if ok
$AP_SCAN_VISIBILITY$ : Hide scan table which is not executed when saving to EEPROM
[PRINTER STATUS]
$REFRESH_PAGE$ : Delay for refreshing pages
$XY_FEEDRATE$ : XY axis feedrate
$Z_FEEDRATE$ : Z axis feedrate
$E_FEEDRATE$ : Extruder feedrate
[PRINTER SETTINGS]
$REFRESH_PAGE$ : Delay for refreshing pages
$XY_FEEDRATE$ : XY axis feedrate
$Z_FEEDRATE$ : Z axis feedrate
$E_FEEDRATE$ : Extruder feedrate
$REFRESH_PAGE_STATUS$ : change to has-error if issue, or has-success if ok
$XY_FEEDRATE_STATUS$ : change to has-error if issue, or has-success if ok
$Z_FEEDRATE_STATUS$ : change to has-error if issue, or has-success if ok
$E_FEEDRATE_STATUS$ : change to has-error if issue, or has-success if ok

BIN
uitests/UI and commands.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -1,325 +1,669 @@
<HTML>
<HEAD>
<style>
.btnimg {cursor:hand; border-radius:6px ;;border:1px solid #FFFFFF;}
.btnimg:hover{background-color:#F0F0F0;border-color:#00FFFF;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}
</style>
</HEAD>
<BODY>
0<INPUT id="rangeinput" name="rangeinput" type="range" min=0 max=270 onchange="Updatenumber();">270
<INPUT id="numberinput" name="numberinput" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange();">
<INPUT type=submit value=Set>
<SCRIPT >
function Updatenumber()
{
numberinputvalue.value=rangeinputvalue.value;
}
function Updaterange()
{
rangeinputvalue.value=numberinputvalue.value;
}
var numberinputvalue=document.getElementById("numberinput");
var rangeinputvalue=document.getElementById("rangeinput");
Updaterange();
</SCRIPT>
<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">
<style>
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%; font-size:10px;}
body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333333;background-color:#ffffff;}
.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;}
table{border:0px;border-spacing:0;max-width:100%;}
.table-bordered{ width:100%; border:1px solid #dddddd;margin-bottom:20px;}
td{white-space:nowrap; padding:2mm;}
th{text-align:left;}
.table>thead>tr>th,.table>tbody>tr>th,.table>thead>tr>td,.table>tbody>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #dddddd;}
.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td{border:1px solid #dddddd;}
.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px;}
.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9;}
@media (min-width:768px){.container{width:750px;}}
@media (min-width:992px){.container{width:970px;}}
@media (min-width:1200px){.container{width:1170px;}}
.nav{ width:100%; color:#cccccc;padding-left:10;padding-right:10;list-style:none;background-color:#333333;border-radius:6px ;margin-bottom:20px;}
a{position:relative;display:block;padding:10px 15px;text-decoration:none;color:#cccccc;}
.active{color:#ffffff;background-color:#000000;}
.active a,a:hover,a:focus{color:#FFFFFF;}
.panel{margin-bottom:20px;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05);}
.panel-body{padding:15px;}
.panel-heading{padding:10px 15px;color:#333333;background-color:#f5f5f5;border-color:#dddddd;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom:1px solid #dddddd;}
label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold;}
.text-info{color:#31708f;}
.form-control{display:block;width:auto;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555555;background-color:#ffffff
;background-image:none;border:1px solid #cccccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);
* -webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;
* transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);
* box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);}
.form-group{margin-bottom:15px;}
.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation; touch-action:manipulation;cursor:pointer;
background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;
* -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
.btn-primary{color:#ffffff;background-color:#337ab7;border-color:#2e6da4;}
.btn-primary:focus,.btn-primary:active,.btn-primary:hover,.btn-primary.focus,.btn-primary.active,.btn-primary.hover{color:#ffffff;background-color:#286090;border-color:#122b40;}
caption{padding-top:8px;padding-bottom:8px;color:#777777;text-align:left;}
.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px;}
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d;}
.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442;}
.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);}
.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}
.has-error .control-label{color:#a94442;}
.has-success .form-control {border-color: #3c763d;-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);}
.has-success .form-control:focus {border-color: #2b542c;-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;}
.has-success .control-label{color: #3c763d;}
.btn-danger{color:#ffffff;background-color:#d9534f;border-color:#d43f3a;}
.btn-danger:focus,.btn-danger:active,.btn-danger:hover,.btn-danger.focus,.btn-danger.active,.btn-danger.hover{color: #ffffff;background-color:#c9302c;border-color:#761c19;}
.btnimg {cursor:hand; border-radius:6px ;;border:1px solid #FFFFFF;}
.btnimg:hover{background-color:#F0F0F0;border-color:#00FFFF;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;}
</style>
<title>Printer Interface</title> </head>
<body>
<div class="container"><table class="nav">
<tr width=100%>
<td class="$MENU_HOME$"><a href="http://192.168.0.123">Home</a></td>
<td class="$MENU_SYSTEM$"><a href="http://192.168.0.123/CONFIGSYS">System Configuration</a></td>
<td class="$MENU_AP$"><a href="http://192.168.0.123/CONFIGAP">AP Configuration</a></td>
<td class="$MENU_STA$"><a href="http://192.168.0.123/CONFIGSTA">Station Configuration</a></td>
<td class="active"><a href="http://192.168.0.123/PRINTER">Printer Status</a></td>
<td width=100%>&nbsp;</td>
<td>FW: V0.3</td>
<td><a href="https://github.com/luc-github/ESP8266" >Github</a></td>
</tr>
</table>
<BR><BR>
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="black" />
<rect x="10" y="10" width="7" height="20" rx="2" ry="2" style="fill:white;stroke-width:1;stroke:white" />
<rect x="23" y="10" width="7" height="20" rx="2" ry="2" style="fill:white;stroke-width:1;stroke:white" />
</svg>
<svg width="40" height="40" viewBox="0 0 40 40">
<rect x="5" y="5" width="10" height="30" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="25" y="5" width="10" height="30" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
</svg>
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="black" />
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" fill="white" stroke-width:"1" stroke:"white" />
</svg>
<svg width="40" height="40" viewBox="0 0 40 40">
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
</svg>
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<polygon points="15,10 30,20 15,30" fill:"white" stroke:"white" stroke-width:"1" />
</svg>
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="black" />
<polygon points="15,10 30,20 15,30" fill="white" stroke-width:"1" stroke:"white" />
</svg>
<svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="5,5 35,20 5,35" style="fill:fill:rgb(0,0,0);stroke:fill:rgb(0,0,0);stroke-width:1" />
</svg>
<BR><BR><BR><BR><BR>
<TABLE>
<TR>
<TD class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<polygon points="15,10 30,20 15,30" fill:"white" stroke:"white" stroke-width:"1" />
<table>
<tr height="auto"><td id='Extruder1'>
<table>
<tr>
<td><label>E1&nbsp;</label></td>
<td id="data_extruder1" name="data_extruder1">
<svg height="30px" width="300px" xmlns="http://wwww.w3.org/2000/svg">
<lineargradient id="gradient">
<stop class="begin" style="stop-color:green;" offset="0%"></stop>
<stop class="middle" style="stop-color:yellow;" offset="100%"></stop>
</lineargradient>
<lineargradient id="gradient2">
<stop class="middle" style="stop-color:yellow;" offset="0%"></stop>
<stop class="end" style="stop-color:red;" offset="100%"></stop>
</lineargradient>
<rect x="10" y="4" width="24" height="21" style="fill:url(#gradient)"></rect>
<rect x="34" y="4" width="280" height="21" style="fill:url(#gradient2)"></rect>
<line x1="10" y1="4" x2="10" y2="25" style="stroke:rgb(255,255,255);stroke-width:1"></line>
<path d="M5 0 L15 0 L10 8 Z" stroke="white" stroke-width="1"></path>
<path d="M5 30 L15 30 L10 22 Z" stroke="white" stroke-width="1"></path>
<text x="10" y="19" fill="black" style="font-family: calibri; font-size:10pt;">
Extruder : 0/off °C</text>
</svg>
</TD>
<TD class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="23" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
</td>
<td>
0<INPUT id="rangeinput1" name="rangeinput1" type="range" min=0 max=270 onchange="Updatenumber1();">270
<INPUT id="numberinput1" name="numberinput1" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange1();">
<INPUT type=submit value=Set onclick="SetTemperature(1);">
</td>
</tr>
</table>
</td>
</tr>
<tr><td id='Extruder2'>
<table>
<tr>
<td><label>E2&nbsp;</label></td>
<td id="data_extruder2" name="data_extruder2">
<svg height="30px" width="300px" xmlns="http://wwww.w3.org/2000/svg">
<lineargradient id="gradient">
<stop class="begin" style="stop-color:green;" offset="0%"></stop>
<stop class="middle" style="stop-color:yellow;" offset="100%"></stop>
</lineargradient>
<lineargradient id="gradient2">
<stop class="middle" style="stop-color:yellow;" offset="0%"></stop>
<stop class="end" style="stop-color:red;" offset="100%"></stop>
</lineargradient>
<rect x="10" y="4" width="24" height="21" style="fill:url(#gradient)"></rect>
<rect x="34" y="4" width="280" height="21" style="fill:url(#gradient2)"></rect>
<line x1="10" y1="4" x2="10" y2="25" style="stroke:rgb(255,255,255);stroke-width:1"></line>
<path d="M5 0 L15 0 L10 8 Z" stroke="white" stroke-width="1"></path>
<path d="M5 30 L15 30 L10 22 Z" stroke="white" stroke-width="1"></path>
<text x="10" y="19" fill="black" style="font-family: calibri; font-size:10pt;">
Extruder : 0/off °C</text>
</svg>
</TD>
<TD class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
</td>
<td>
0<INPUT id="rangeinput2" name="rangeinput2" type="range" min=0 max=270 onchange="Updatenumber2();">270
<INPUT id="numberinput2" name="numberinput2" type="number" min=0 max=270 step=1 value=0 onchange="Updaterange2();">
<INPUT type=submit value=Set onclick="SetTemperature(2);">
</td>
</tr>
</table>
</td>
</tr>
<tr><td id='Bed'>
<table>
<tr>
<td><label>Bed</label></td>
<td id="data_bed" name="data_bed">
<svg height="30px" width="300px" xmlns="http://wwww.w3.org/2000/svg">
<lineargradient id="gradient">
<stop class="begin" style="stop-color:green;" offset="0%"></stop>
<stop class="middle" style="stop-color:yellow;" offset="100%"></stop>
</lineargradient>
<lineargradient id="gradient2">
<stop class="middle" style="stop-color:yellow;" offset="0%"></stop>
<stop class="end" style="stop-color:red;" offset="100%"></stop>
</lineargradient>
<rect x="10" y="4" width="24" height="21" style="fill:url(#gradient)"></rect>
<rect x="34" y="4" width="280" height="21" style="fill:url(#gradient2)"></rect>
<line x1="10" y1="4" x2="10" y2="25" style="stroke:rgb(255,255,255);stroke-width:1"></line>
<path d="M5 0 L15 0 L10 8 Z" stroke="white" stroke-width="1"></path>
<path d="M5 30 L15 30 L10 22 Z" stroke="white" stroke-width="1"></path>
<text x="10" y="19" fill="black" style="font-family: calibri; font-size:10pt;">
Extruder : 0/off °C</text>
</svg>
</TD>
<TD class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<rect x="5" y="10" width="30" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<text x="10" y="25" font-family="Verdana" font-size="14" fill="white">SD</text>
</svg>
</TD>
<TD>
&nbsp;
</TD>
<TD class="btnimg">
</td>
<td>
0<INPUT id="rangeinputbed" name="rangeinputbed" type="range" min=0 max=130 onchange="Updatenumberbed();">130
<INPUT id="numberinputbed" name="numberinputbed" type="number" min=0 max=270 step=1 value=0 onchange="Updaterangebed();">
<INPUT type=submit value=Set onclick="SetTemperature(3);">
</td>
</tr>
</table>
</td>
</tr>
<tr><td id='speed'>
<table>
<tr>
<td><label>Speed</label></td>
<td>
0<INPUT id="rangeinputspeed" name="rangeinputspeed" type="range" min=0 max=300 onchange="Updatenumberspeed();">300
<INPUT id="numberinputspeed" name="numberinputspeed" type="number" size="3" min=0 max=300 step=1 value=0 onchange="Updaterangespeed();">%
<INPUT type=submit value=Set onclick="SetSpeed(1);">
</td>
<td>
&nbsp;
&nbsp;
</td>
<td>
Status:
</td>
<td id="status" name="status">
<svg width="20" height="20">
<circle cx="10" cy="10" r="8" stroke="black" stroke-width="2" fill="red"></circle>
</svg>
</td>
<td>
&nbsp;
&nbsp;
</td>
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="red" />
<circle cx="20" cy="20" r="10" stroke="black" stroke-width="4" fill="red" />
<rect x="15" y="8" width="10" height="10" style="fill:red;stroke-width:1;stroke:red" />
<rect x="18" y="6" rx="1" ry="1" width="4" height="14" style="fill:black;stroke-width:1;stroke:black" />
</svg>
</TD>
</TR>
</TABLE>
<TABLE>
<TR align="center" valign="middle">
<TD class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="black" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">X</text>
</svg>
</TD>
<TD>
<TABLE>
<TR>
<TD class="btnimg">
</td>
</tr>
</table>
</td>
</tr>
<tr><td id='flow'>
<table>
<tr>
<td><label>Flow</label></td>
<td>
0<INPUT id="rangeinputspeed" name="rangeinputspeed" type="range" min=0 max=300 onchange="Updatenumberspeed();">300
<INPUT id="numberinputspeed" name="numberinputspeed" size="3" type="number" min=0 max=300 step=1 value=0 onchange="Updaterangespeed();">%
<INPUT type=submit value=Set onclick="SetSpeed(1);">
</td>
<td>
&nbsp;
&nbsp;
</td>
<td name="position" id="position">
<label>X:</label><label class="text-info">0.0</label>&nbsp;&nbsp;<label>Y:</label><label class="text-info">0.0</label>&nbsp;&nbsp;<label>Z:</label><label class="text-info">0.000</label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width='100%'>
<tr>
<td width="auto"><label>Command:</label></td>
<td width="100%">
<INPUT id="cmd" name="cmd" type="text" style="width: 100%;">
</td>
<td width="auto">
<INPUT type=submit value="Send" onclick="Sendcommand();">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><hr></td>
</tr>
<tr>
<td><label>Info:</label><div width=100% ID="infomsg" NAME="infomsg" class="text-info"></div></td>
</tr>
<tr>
<td><hr></td>
</tr>
<tr>
<td><label>Error:</label><div width=100% ID="errormsg" NAME="errormsg" class="text-info"></div></td>
</tr>
<tr>
<td><hr></td>
</tr>
<tr>
<td><label>Status:</label><div width=100% ID="statusmsg" NAME="statusmsg" class="text-info"></div></td>
</tr>
<tr>
<td><hr></td>
</tr>
<tr>
<td>
<table>
<tr><td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<polygon points="15,10 30,20 15,30" fill:"white" stroke:"white" stroke-width:"1" />
</svg>
</td>
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="23" y="10" width="7" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
</svg>
</td>
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<circle cx="20" cy="20" r="18" stroke="black" stroke-width="2" fill="white" />
<rect x="10" y="10" width="20" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
</svg>
</td>
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<rect x="5" y="10" width="30" height="20" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<rect x="20" y="5" width="15" height="15" rx="2" ry="2" style="fill:rgb(0,0,0);stroke-width:1;stroke:rgb(0,0,0)" />
<text x="10" y="25" font-family="Verdana" font-size="14" fill="white">SD</text>
</svg>
</td>
<td>
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr align="center" valign="middle">
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="black" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">X</text>
</svg>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">10</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5"/>
<text x="17" y="20" font-family="Verdana" font-size="7" fill="black">1</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:2"/>
<text x="14" y="20" font-family="Verdana" font-size="7" fill="black">0.1</text>
</svg>
</TD>
</TR>
</TABLE>
</TD>
<TD class="btnimg">
</td>
</tr>
</table>
</td>
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="blue" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Y</text>
</svg>
</TD>
<TD>
</TD>
<TD>
<TABLE>
<TR>
<TD class="btnimg">
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7"/>
<text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text>
</svg>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR align="center" valign="middle">
<TD>
<TABLE>
<TR>
<TD class="btnimg">
</td>
</tr>
</table>
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7"/>
<text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text>
</svg>
</td>
</tr>
</table>
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7"/>
<text x="14" y="20" font-family="Verdana" font-size="7" fill="black">-10</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5"/>
<text x="15" y="20" font-family="Verdana" font-size="7" fill="black">-1</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:2"/>
<text x="12" y="20" font-family="Verdana" font-size="7" fill="black">-0.1</text>
</svg>
</td>
</tr>
</table>
</td>
</tr>
<tr align="center" valign="middle">
<td>
<table>
<tr>
<td class="btnimg">
<svg width="20" height="40" viewBox="12 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7" transform="rotate(-90 20 10)"/>
<text x="20" y="13" font-family="Verdana" font-size="7" fill="black">-10</text>
</svg>
</TD>
<TD class="btnimg">
</td>
<td class="btnimg">
<svg width="20" height="40" viewBox="10 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5" transform="rotate(-90 20 10)"/>
<text x="21" y="13" font-family="Verdana" font-size="7" fill="black">-1</text>
</svg>
</TD>
<TD class="btnimg">
</td>
<td class="btnimg">
<svg width="20" height="40" viewBox="14 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:2" transform="rotate(-90 20 10)"/>
<text x="19" y="13" font-family="Verdana" font-size="7" fill="black">-0.1</text>
</svg>
</TD>
</TR>
</TABLE>
</TD>
<TD>
</TD>
<TD>
<TABLE>
<TR>
<TD class="btnimg">
</td>
</tr>
</table>
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="20" height="40" viewBox="6 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:3" transform="rotate(90 20 10)"/>
<text x="7" y="13" font-family="Verdana" font-size="7" fill="black">0.1</text>
</svg>
</TD>
<TD class="btnimg">
</td>
<td class="btnimg">
<svg width="20" height="40" viewBox="8 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:5" transform="rotate(90 20 10)"/>
<text x="11" y="13" font-family="Verdana" font-size="7" fill="black">1</text>
</svg>
</TD>
<TD class="btnimg">
</td>
<td class="btnimg">
<svg width="20" height="40" viewBox="8 -10 20 40">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:blue;stroke-width:7" transform="rotate(90 20 10)"/>
<text x="7" y="13" font-size="7" fill="black">10</text>
</svg>
</TD>
</TR>
</TABLE>
</TD>
<TD>
</TD>
<TD >
</td>
</tr>
</table>
</td>
<td>
</td>
<td >
<svg width="20" height="20" viewBox="0 0 20 20">
<text x="1" y="18" font-family="Verdana" font-size="22" fill="green">Z</text>
</svg>
</TD>
</TR>
<TR align="center" valign="middle">
<TD class="btnimg">
</td>
<td>
</td>
<td >
<svg width="20" height="20" viewBox="0 0 20 20">
<text x="1" y="18" font-family="Verdana" font-size="22" fill="orange">1</text>
</svg>
</td>
<td>
</td>
<td >
<svg width="20" height="20" viewBox="0 0 20 20">
<text x="1" y="18" font-family="Verdana" font-size="22" fill="pink">2</text>
</svg>
</td>
</tr>
<tr align="center" valign="middle">
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="purple" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
</svg>
</TD>
<TD>
<TABLE>
<TR>
<TD class="btnimg">
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:3" transform="rotate(180 20 10)"/>
<text x="13" y="6" font-family="Verdana" font-size="7" fill="black">-0.1</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="16" y="7" font-family="Verdana" font-size="7" fill="black">-1</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:black;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="13" y="6" font-family="Verdana" font-size="7" fill="black">-10</text>
</svg>
</TD>
</TR>
</TABLE>
</TD>
<TD class="btnimg">
</td>
</tr>
</table>
</td>
<td class="btnimg">
<svg width="40" height="40" viewBox="0 0 40 40">
<polygon points="7,40 7,25 4,28 0,24 20,4 26,10 26,6 32,6 32,16 40,24 36,28 33,25 33,40" fill="green" stroke-width:"1" stroke:"black" />
<line x1="25" y1="8" x2="33" y2="16" style="stroke:white;stroke-width:1" />
<polyline points="4,28 20,12 36,28" style="fill:none;stroke:white;stroke-width:1" />
<text x="15" y="35" font-family="Verdana" font-size="14" fill="white">Z</text>
</svg>
</TD>
<TD>
</TD>
<TD>
<TABLE>
<TR>
<TD class="btnimg">
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:3" transform="rotate(180 20 10)"/>
<text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text>
</svg>
</TD>
</TR>
<TR>
<TD class="btnimg">
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:green;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text>
</svg>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:3" transform="rotate(180 20 10)"/>
<text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:orange;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text>
</svg>
</td>
</tr>
</table>
</td>
<td>
</td>
<td>
<table>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -4 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:3" transform="rotate(180 20 10)"/>
<text x="14" y="6" font-family="Verdana" font-size="7" fill="black">0.1</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 -2 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:5" transform="rotate(180 20 10)"/>
<text x="18" y="7" font-family="Verdana" font-size="7" fill="black">1</text>
</svg>
</td>
</tr>
<tr>
<td class="btnimg">
<svg width="40" height="20" viewBox="0 0 40 20">
<polyline points="5,18 20,5 35,18" style="fill:none;stroke:pink;stroke-width:7" transform="rotate(180 20 10)"/>
<text x="15" y="6" font-family="Verdana" font-size="7" fill="black">10</text>
</svg>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
<iframe id="dataframe" name="dataframe"src="http://$WEB_ADDRESS$/STATUS" frameborder=0 width="2" height="2" style="visibility:hidden;"></iframe>
<iframe width="2" height="2" style="visibility:hidden" id="frmcmd" name="frmcmd" ></iframe>
<script type="text/javascript">
document.getElementById("dataframe").onload=function(){
var ifrm=document.getElementById("dataframe");
var doc=ifrm.contentDocument?ifrm.contentDocument:ifrm.contentWindow.document;
document.getElementById("display_data").innerHTML=doc.getElementById("data").innerHTML;
document.getElementById("position").innerHTML=doc.getElementById("position").innerHTML;
document.getElementById("speed").innerHTML=doc.getElementById("speed").innerHTML;
document.getElementById("flow").innerHTML=doc.getElementById("flow").innerHTML;
document.getElementById("status").innerHTML=doc.getElementById("status").innerHTML;
document.getElementById("infomsg").innerHTML=doc.getElementById("infomsg").innerHTML;
document.getElementById("errormsg").innerHTML=doc.getElementById("errormsg").innerHTML;
document.getElementById("statusmsg").innerHTML=doc.getElementById("statusmsg").innerHTML;
}
setInterval(function(){var ifrm=document.getElementById("dataframe");var doc=ifrm.contentDocument?ifrm.contentDocument:ifrm.contentWindow.document;doc.location.reload(true);},$REFRESH_PAGE$);
</script>
$SERVICE_PAGE$
</body>
</html>