starting input templates
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.vscode
|
||||
*.pyc
|
||||
*.egg-info*
|
||||
*.egg-info
|
||||
.DS_Store
|
||||
|
||||
@@ -3,14 +3,18 @@ import time
|
||||
import sys
|
||||
|
||||
|
||||
if len(sys.argv) == 2:
|
||||
if len(sys.argv) == 2 or len(sys.argv) == 3:
|
||||
address = int(sys.argv[1],16)
|
||||
if len(sys.argv) == 3:
|
||||
busNum = int(sys.argv[2],16)
|
||||
else:
|
||||
busNum = 1
|
||||
else:
|
||||
print('-1 | -1')
|
||||
sys.exit(1)
|
||||
|
||||
# Get I2C bus
|
||||
bus = smbus.SMBus(1)
|
||||
bus = smbus.SMBus(busNum)
|
||||
|
||||
# SI7021 address, 0x40(64)
|
||||
# 0xF5(245) Select Relative Humidity NO HOLD master mode
|
||||
|
||||
@@ -23,6 +23,35 @@ import json
|
||||
import copy
|
||||
|
||||
|
||||
#Function that returns Boolean output state of the GPIO inputs / outputs
|
||||
def PinState_Boolean(pin, ActiveLow) :
|
||||
try:
|
||||
state = GPIO.input(pin)
|
||||
if ActiveLow and not state: return True
|
||||
if not ActiveLow and state: return True
|
||||
return False
|
||||
except:
|
||||
return "ERROR: Unable to read pin"
|
||||
|
||||
#Function that returns human-readable output state of the GPIO inputs / outputs
|
||||
def PinState_Human(pin, ActiveLow):
|
||||
PinState = PinState_Boolean(pin, ActiveLow)
|
||||
if PinState == True :
|
||||
return " ON "
|
||||
elif PinState == False:
|
||||
return " OFF "
|
||||
else:
|
||||
return PinState
|
||||
|
||||
#Translates the Pull-Up/Pull-Down GPIO resistor setting to ActiveLow/ActiveHigh boolean
|
||||
def CheckInputActiveLow(Input_Pull_Resistor):
|
||||
#input_pull_up
|
||||
#input_pull_down
|
||||
if Input_Pull_Resistor == "input_pull_up":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplatePlugin, octoprint.plugin.SettingsPlugin,
|
||||
octoprint.plugin.AssetPlugin, octoprint.plugin.BlueprintPlugin,
|
||||
octoprint.plugin.EventHandlerPlugin):
|
||||
@@ -52,10 +81,8 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
@staticmethod
|
||||
def to_float(value):
|
||||
"""Converts value to flow
|
||||
|
||||
Arguments:
|
||||
value {any} -- value to be
|
||||
|
||||
Returns:
|
||||
float -- value converted
|
||||
"""
|
||||
@@ -100,7 +127,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
for command in command_string.split(' '):
|
||||
index = command.upper().find(gcode.upper())
|
||||
if not index == -1:
|
||||
return command.replace(gcode, '').upper()
|
||||
return command.replace(gcode, '')
|
||||
return -1
|
||||
|
||||
# ~~ StartupPlugin mixin
|
||||
@@ -144,6 +171,40 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
self._settings.set(["rpi_inputs"], [])
|
||||
self.rpi_inputs = self._settings.get(["rpi_inputs"])
|
||||
|
||||
#Scan all configured inputs and outputs and return the pin value
|
||||
@octoprint.plugin.BlueprintPlugin.route("/ReadPin/<int:identifier>", methods=["GET"])
|
||||
def ReadSinglePin(self, identifier):
|
||||
Resp = []
|
||||
MatchFound = False
|
||||
for rpi_input in self.rpi_inputs:
|
||||
if identifier == self.to_int(rpi_input['gpio_pin']):
|
||||
MatchFound = True
|
||||
ConfiguredAs = "Input"
|
||||
ActiveLow = CheckInputActiveLow(rpi_input['input_pull_resistor'])
|
||||
pin = self.to_int(rpi_input['gpio_pin'])
|
||||
val = PinState_Human(pin,ActiveLow)
|
||||
label = rpi_input['label']
|
||||
Resp.append(dict(Configured_As=ConfiguredAs, label=label, GPIO_Pin=pin, Active_Low=ActiveLow, State=val))
|
||||
for rpi_output in self.rpi_outputs:
|
||||
if identifier == self.to_int(rpi_output['gpio_pin']):
|
||||
MatchFound = True
|
||||
ConfiguredAs = "Output"
|
||||
ActiveLow = CheckInputActiveLow(rpi_output['active_low'])
|
||||
pin = self.to_int(rpi_output['gpio_pin'])
|
||||
val = PinState_Human(pin,ActiveLow)
|
||||
label = rpi_output['label']
|
||||
Resp.append(dict(Configured_As=ConfiguredAs, label=label, GPIO_Pin=pin, Active_Low=ActiveLow, State=val))
|
||||
if MatchFound == False:
|
||||
pin = int(identifier)
|
||||
ConfiguredAs = "Unknown"
|
||||
ActiveLow = "Unknown"
|
||||
try:
|
||||
val = GPIO.input(pin)
|
||||
except:
|
||||
val = "GPIO pin not initialized."
|
||||
Resp.append(dict(Configured_As=ConfiguredAs, GPIO_Pin=pin, Active_Low=ActiveLow, State=val))
|
||||
return Response(json.dumps(Resp), mimetype='application/json')
|
||||
|
||||
# ~~ Blueprintplugin mixin
|
||||
@octoprint.plugin.BlueprintPlugin.route("/inputs", methods=["GET"])
|
||||
def get_inputs(self):
|
||||
@@ -151,10 +212,12 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
for rpi_input in self.rpi_inputs:
|
||||
index = self.to_int(rpi_input['index_id'])
|
||||
label = rpi_input['label']
|
||||
inputs.append(dict(index_id=index, label=label))
|
||||
ActiveLow = CheckInputActiveLow(rpi_input['input_pull_resistor'])
|
||||
pin = self.to_int(rpi_input['gpio_pin'])
|
||||
val = PinState_Human(pin,ActiveLow)
|
||||
inputs.append(dict(index_id=index, label=label, GPIO_Pin=pin, State=val))
|
||||
return Response(json.dumps(inputs), mimetype='application/json')
|
||||
|
||||
|
||||
@octoprint.plugin.BlueprintPlugin.route("/inputs/<int:identifier>", methods=["GET"])
|
||||
def get_input_status(self, identifier):
|
||||
for rpi_input in self.rpi_inputs:
|
||||
@@ -207,7 +270,6 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
self._settings.set(["rpi_inputs"], self.rpi_inputs)
|
||||
return make_response('', 204)
|
||||
|
||||
|
||||
@octoprint.plugin.BlueprintPlugin.route("/outputs", methods=["GET"])
|
||||
def get_outputs(self):
|
||||
outputs = []
|
||||
@@ -215,7 +277,10 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
if rpi_output['output_type'] == 'regular':
|
||||
index = self.to_int(rpi_output['index_id'])
|
||||
label = rpi_output['label']
|
||||
outputs.append(dict(index_id=index, label=label))
|
||||
pin = self.to_int(rpi_output['gpio_pin'])
|
||||
ActiveLow = rpi_output['active_low']
|
||||
val = PinState_Human(pin,ActiveLow)
|
||||
outputs.append(dict(index_id=index, label=label, GPIO_Pin=pin, State=val))
|
||||
return Response(json.dumps(outputs), mimetype='application/json')
|
||||
|
||||
|
||||
@@ -225,7 +290,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
if identifier == self.to_int(rpi_output['index_id']):
|
||||
out = copy.deepcopy(rpi_output)
|
||||
pin = self.to_int(rpi_output['gpio_pin'])
|
||||
out['current_value'] = GPIO.input(pin) if not rpi_output['active_low'] else (not GPIO.input(pin))
|
||||
out['current_value'] = PinState_Boolean(pin, rpi_output['active_low'] )
|
||||
return Response(json.dumps(out), mimetype='application/json')
|
||||
return make_response('', 404)
|
||||
|
||||
@@ -454,9 +519,11 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
for rpi_output in self.rpi_outputs:
|
||||
if rpi_output['output_type'] == 'regular':
|
||||
pin = self.to_int(rpi_output['gpio_pin'])
|
||||
val = GPIO.input(pin) if not rpi_output['active_low'] else (not GPIO.input(pin))
|
||||
ActiveLow = rpi_output['active_low']
|
||||
val = PinState_Boolean(pin, ActiveLow)
|
||||
val2 = PinState_Human(pin, ActiveLow)
|
||||
index = self.to_int(rpi_output['index_id'])
|
||||
gpio_status.append(dict(index_id=index, status=val))
|
||||
gpio_status.append(dict(index_id=index, status=val, State=val2))
|
||||
return Response(json.dumps(gpio_status), mimetype='application/json')
|
||||
|
||||
@octoprint.plugin.BlueprintPlugin.route("/setIO", methods=["GET"])
|
||||
@@ -581,7 +648,6 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
def send_neopixel_command(self, led_pin, led_count, led_brightness, red, green, blue, address, neopixel_dirrect,
|
||||
index_id, queue_id=None):
|
||||
"""Send neopixel command
|
||||
|
||||
Arguments:
|
||||
led_pin {int} -- GPIO number
|
||||
ledCount {int} -- number of LEDS
|
||||
@@ -800,7 +866,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
elif sensor['temp_sensor_type'] == "am2320":
|
||||
temp, hum = self.read_am2320_temp() # sensor has fixed address
|
||||
elif sensor['temp_sensor_type'] == "si7021":
|
||||
temp, hum = self.read_si7021_temp(sensor['temp_sensor_address'])
|
||||
temp, hum = self.read_si7021_temp(sensor['temp_sensor_address'], sensor['temp_sensor_i2cbus'])
|
||||
elif sensor['temp_sensor_type'] == "tmp102":
|
||||
temp = self.read_tmp102_temp(sensor['temp_sensor_address'])
|
||||
hum = 0
|
||||
@@ -835,7 +901,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
for rpi_controlled_output in self.rpi_outputs:
|
||||
if self.to_int(temperature_alarm['controlled_io']) == self.to_int(
|
||||
rpi_controlled_output['index_id']):
|
||||
val = GPIO.LOW if rpi_controlled_output['active_low'] else GPIO.HIGH
|
||||
val = GPIO.LOW if temperature_alarm['controlled_io_set_value'] == 'low' else GPIO.HIGH
|
||||
self.write_gpio(self.to_int(rpi_controlled_output['gpio_pin']), val)
|
||||
for notification in self.notifications:
|
||||
if notification['temperatureAction']:
|
||||
@@ -864,7 +930,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
stdout, _ = proc.communicate()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("MCP9808 result: %s", stdout)
|
||||
return self.to_float(stdout.strip())
|
||||
return self.to_float(stdout.decode("utf-8").strip())
|
||||
except Exception as ex:
|
||||
self._logger.info("Failed to execute python scripts, try disabling use SUDO on advanced section.")
|
||||
self.log_error(ex)
|
||||
@@ -883,7 +949,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
stdout = (Popen(cmd, shell=True, stdout=PIPE).stdout).read()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("Dht result: %s", stdout)
|
||||
temp, hum = stdout.split("|")
|
||||
temp, hum = stdout.decode("utf-8").split("|")
|
||||
return (self.to_float(temp.strip()), self.to_float(hum.strip()))
|
||||
except Exception as ex:
|
||||
self._logger.info(
|
||||
@@ -904,7 +970,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
stdout = (Popen(cmd, shell=True, stdout=PIPE).stdout).read()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("BME280 result: %s", stdout)
|
||||
temp, hum = stdout.split("|")
|
||||
temp, hum = stdout.decode("utf-8").split("|")
|
||||
return (self.to_float(temp.strip()), self.to_float(hum.strip()))
|
||||
except Exception as ex:
|
||||
self._logger.info(
|
||||
@@ -925,7 +991,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
stdout = (Popen(cmd, shell=True, stdout=PIPE).stdout).read()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("AM2320 result: %s", stdout)
|
||||
temp, hum = stdout.split("|")
|
||||
temp, hum = stdout.decode("utf-8").split("|")
|
||||
return (self.to_float(temp.strip()), self.to_float(hum.strip()))
|
||||
except Exception as ex:
|
||||
self._logger.info(
|
||||
@@ -933,20 +999,20 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
self.log_error(ex)
|
||||
return (0, 0)
|
||||
|
||||
def read_si7021_temp(self, address):
|
||||
def read_si7021_temp(self, address, i2cbus):
|
||||
try:
|
||||
script = os.path.dirname(os.path.realpath(__file__)) + "/SI7021.py "
|
||||
if self._settings.get(["use_sudo"]):
|
||||
sudo_str = "sudo "
|
||||
else:
|
||||
sudo_str = ""
|
||||
cmd = sudo_str + "python " + script + str(address)
|
||||
cmd = sudo_str + "python " + script + str(address) + " " + str(i2cbus)
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("Temperature SI7021 cmd: %s", cmd)
|
||||
stdout = (Popen(cmd, shell=True, stdout=PIPE).stdout).read()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("SI7021 result: %s", stdout)
|
||||
temp, hum = stdout.split("|")
|
||||
temp, hum = stdout.decode("utf-8").split("|")
|
||||
return (self.to_float(temp.strip()), self.to_float(hum.strip()))
|
||||
except Exception as ex:
|
||||
self._logger.info(
|
||||
@@ -990,7 +1056,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
stdout, _ = proc.communicate()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("TMP102 result: %s", stdout)
|
||||
return self.to_float(stdout.strip())
|
||||
return self.to_float(stdout.decode("utf-8").strip())
|
||||
except Exception as ex:
|
||||
self._logger.info("Failed to execute python scripts, try disabling use SUDO on advanced section.")
|
||||
self.log_error(ex)
|
||||
@@ -1006,7 +1072,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
stdout, _ = proc.communicate()
|
||||
if self._settings.get(["debug_temperature_log"]) is True:
|
||||
self._logger.debug("MAX31855 result: %s", stdout)
|
||||
return self.to_float(stdout.strip())
|
||||
return self.to_float(stdout.decode("utf-8").strip())
|
||||
except Exception as ex:
|
||||
self._logger.info("Failed to execute python scripts, try disabling use SUDO on advanced section.")
|
||||
self.log_error(ex)
|
||||
@@ -1261,8 +1327,8 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
item['time'] = time_now
|
||||
for line in self._settings.get(["filament_sensor_gcode"]).split('\n'):
|
||||
if line:
|
||||
self._printer.commands(line.strip().upper())
|
||||
self._logger.info("Sending GCODE command: %s", line.strip().upper())
|
||||
self._printer.commands(line.strip())
|
||||
self._logger.info("Sending GCODE command: %s", line.strip())
|
||||
time.sleep(0.2)
|
||||
for notification in self.notifications:
|
||||
if notification['filamentChange']:
|
||||
@@ -1378,8 +1444,8 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
def send_gcode_command(self, command):
|
||||
for line in command.split('\n'):
|
||||
if line:
|
||||
self._printer.commands(line.strip().upper())
|
||||
self._logger.info("Sending GCODE command: %s", line.strip().upper())
|
||||
self._printer.commands(line.strip())
|
||||
self._logger.info("Sending GCODE command: %s", line.strip())
|
||||
time.sleep(0.2)
|
||||
|
||||
def handle_printer_action(self, channel):
|
||||
@@ -1880,7 +1946,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
|
||||
|
||||
|
||||
__plugin_name__ = "Enclosure Plugin"
|
||||
__plugin_pythoncompat__ = ">=3,<4"
|
||||
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||
|
||||
|
||||
def __plugin_load__():
|
||||
@@ -1891,4 +1957,4 @@ def __plugin_load__():
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.comm.protocol.gcode.queuing" : __plugin_implementation__.hook_gcode_queuing,
|
||||
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ else:
|
||||
print("fail")
|
||||
sys.exit(1)
|
||||
|
||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT)
|
||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS)
|
||||
strip.begin()
|
||||
|
||||
color = Color(red, green, blue)
|
||||
|
||||
@@ -226,4 +226,5 @@
|
||||
}
|
||||
.colorpicker-inline.colorpicker-visible {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-colorpicker.css.map */
|
||||
@@ -455,7 +455,8 @@ $(function () {
|
||||
printer_action: ko.observable("filament"),
|
||||
temp_sensor_navbar: ko.observable(true),
|
||||
filament_sensor_timeout: ko.observable(120),
|
||||
filament_sensor_enabled: ko.observable(true)
|
||||
filament_sensor_enabled: ko.observable(true),
|
||||
temp_sensor_i2cbus: ko.observable(1)
|
||||
});
|
||||
};
|
||||
|
||||
@@ -706,4 +707,4 @@ $(function () {
|
||||
elements: ["#tab_plugin_enclosure", "#settings_plugin_enclosure", "#navbar_plugin_enclosure_1", "#navbar_plugin_enclosure_2"]
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<!-- <div class="controls">
|
||||
<h5>IO <span data-bind="text: $index"> </span></h5>
|
||||
</div> -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Output Type') }}</label>
|
||||
<div class="controls">
|
||||
<label class="radio">
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div class="controls">
|
||||
<label class="radio">
|
||||
<input type="radio" value="gcode_output" data-bind="checked: output_type, attr: {name: 'output_type_' + $index() }"> {{ _('GCode') }}
|
||||
<input type="radio" value="gcode_output" data-bind="checked: output_type, attr: {name: 'output_type_' + $index() }"> {{ _('Gcode') }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -65,31 +65,31 @@
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- ko if: ($data.output_type() != "temperature_alarm") -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Label') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: label">
|
||||
<span class="help-inline">Name displayed on Enclosure Tab</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Id') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: index_id" disabled="true">
|
||||
<span class="help-inline">Id used for API control</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- ko if: ($data.output_type() == "shell_output") -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Script') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: shell_script">
|
||||
<span class="help-inline">Shell script to be executed</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko ifnot: ($data.output_type() == "gcode_output" || $data.output_type() == "temperature_alarm" || $data.output_type() == "shell_output" || $data.output_type() == "ledstrip") -->
|
||||
<div class="control-group">
|
||||
@@ -98,8 +98,8 @@
|
||||
<input type="text" class="input-block-level" data-bind="value: gpio_pin">
|
||||
<!-- ko ifnot: ($data.output_type() == "neopixel_indirect") -->
|
||||
<span class="help-inline">GPIO number that will be controlled.</span>
|
||||
/ko
|
||||
ko if: ($data.output_type() == "neopixel_indirect")
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.output_type() == "neopixel_indirect") -->
|
||||
<span class="help-inline">
|
||||
<span class="label label-danger">Attention</span> Neopixel requires a microcontroller (ex: arduino)
|
||||
connected to I2C bus. This is the pin on the
|
||||
@@ -328,22 +328,22 @@
|
||||
</div>
|
||||
|
||||
<!-- ko if: ($data.auto_startup() || $data.startup_with_server())-->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Default Value') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: temp_ctr_default_value">
|
||||
<span class="help-inline">Default temperature / humidity that temperature control will be set when the print starts or the server starts.</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Value Deadband') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: temp_ctr_deadband">
|
||||
<span class="help-inline">Allowable drift on temperature / humidity control. Set it to zero to disable.</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- ko if: ($data.temp_ctr_type() == "heater") -->
|
||||
<div class="control-group">
|
||||
@@ -387,7 +387,7 @@
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.output_type() == "pwm") -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('PWM Frequency') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: pwm_frequency">
|
||||
@@ -400,7 +400,7 @@
|
||||
<input type="text" class="input-block-level" data-bind="value: default_duty_cycle">
|
||||
<span class="help-inline">Value is in percentage, between 0 and 100</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.output_type() == "neopixel_indirect") -->
|
||||
<div class="control-group">
|
||||
@@ -413,7 +413,7 @@
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.output_type() == "ledstrip") -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('CLK') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: ledstrip_gpio_clk">
|
||||
@@ -431,10 +431,10 @@
|
||||
<input type="text" class="input-block-level" data-bind="value: default_ledstrip_color, attr: {name: 'colorpicker' } , click: $root.showColorPicker()">
|
||||
<span class="help-inline">Value needs to follow the format rgb(value_red,value_green,value_blue) where values should be between 0 and 255</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.output_type() == "neopixel_indirect" || $data.output_type() == "neopixel_direct") -->
|
||||
<!-- <div class="control-group">
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Number of LEDS') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: neopixel_count">
|
||||
@@ -454,7 +454,7 @@
|
||||
<input type="text" class="input-block-level" data-bind="value: default_neopixel_color, attr: {name: 'colorpicker' } , click: $root.showColorPicker()">
|
||||
<span class="help-inline">Value needs to follow the format rgb(value_red,value_green,value_blue) where values should be between 0 and 255</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.output_type() == "gcode_output") -->
|
||||
<div class="control-group">
|
||||
@@ -582,6 +582,14 @@
|
||||
<code>i2cdetect -y 1</code> on your Raspberry Pi</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="settings-enclosure-dhtPin">{{ _('i2c Bus') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: temp_sensor_i2cbus">
|
||||
<span class="help-inline">This value should remain 1 unless you've used dtoverlay=i2c-gpio.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<!-- ko if: ($data.temp_sensor_type() == "max31855") -->
|
||||
<div class="control-group">
|
||||
@@ -901,4 +909,4 @@
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<form class="form-horizontal">
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,5 @@
|
||||
<form class="form-horizontal">
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,59 @@
|
||||
<div id="settings_inputs_edit_dialog" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<a href="#" class="close" data-dismiss="modal" aria-hidden="true">×</a>
|
||||
<h3 class="modal-title">Add / Edit Input</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div class="full-sized-box">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="active"><a href="#settings_inputs_edit_dialog_general"
|
||||
data-toggle="tab">{{ _('General') }}</a></li>
|
||||
|
||||
<li><a href="#settings_inputs_edit_dialog_io" data-toggle="tab">{{ _('IO Settings') }}</a></li>
|
||||
|
||||
<li><a href="#settings_inputs_edit_dialog_printer_action"
|
||||
data-toggle="tab">{{ _('Printer Action') }}</a></li>
|
||||
|
||||
<li><a href="#settings_inputs_edit_dialog_output_action" data-toggle="tab">{{ _('Output Action') }}</a>
|
||||
</li>
|
||||
|
||||
<li><a href="#settings_inputs_edit_dialog_temperature_sensor"
|
||||
data-toggle="tab">{{ _('Temperature Sensor') }}</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="settings_inputs_edit_dialog_general" class="tab-pane active">
|
||||
{% include "input_folder/general_info.jinja2" %}
|
||||
</div>
|
||||
|
||||
<div id="settings_inputs_edit_dialog_io" class="tab-pane">
|
||||
{% include "input_folder/io_output.jinja2" %}
|
||||
</div>
|
||||
|
||||
<div id="settings_inputs_edit_dialog_printer_action" class="tab-pane">
|
||||
{% include "input_folder/printer_action.jinja2" %}
|
||||
</div>
|
||||
|
||||
<div id="settings_inputs_edit_dialog_output_action" class="tab-pane">
|
||||
{% include "input_folder/output_action.jinja2" %}
|
||||
</div>
|
||||
|
||||
<div id="settings_inputs_edit_dialog_temperature_sensor" class="tab-pane">
|
||||
{% include "input_folder/temperature_sensor.jinja2" %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">{{ _('Abort') }}</button>
|
||||
<button class="btn btn-primary btn-confirm"
|
||||
data-bind="click: function() { $root.confirmEditInput();}, css: {disabled: !inputEditor.validInput()}">{{ _('Save') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<form class="form-horizontal">
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,5 @@
|
||||
<form class="form-horizontal">
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,5 @@
|
||||
<form class="form-horizontal">
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
0
octoprint_enclosure/templates/input_table.jinja2
Normal file
0
octoprint_enclosure/templates/input_table.jinja2
Normal file
Reference in New Issue
Block a user