added pycharm module, chagned package version to 1.4.0 alph1, added 8 macros button

This commit is contained in:
sanjayk03-dev
2024-01-09 22:38:35 +05:30
parent 825f930293
commit dacfd16184
17 changed files with 212 additions and 51 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

16
.idea/jsLinters/jshint.xml generated Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JSHintConfiguration" version="2.13.6" use-config-file="true" use-custom-config-file="true" custom-config-file-path="$PROJECT_DIR$/jshint.json">
<option bitwise="true" />
<option browser="true" />
<option curly="true" />
<option eqeqeq="true" />
<option forin="true" />
<option maxerr="50" />
<option noarg="true" />
<option noempty="true" />
<option nonew="true" />
<option strict="true" />
<option undef="true" />
</component>
</project>

4
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (onefinity-firmware)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/onefinity-firmware.iml" filepath="$PROJECT_DIR$/.idea/onefinity-firmware.iml" />
</modules>
</component>
</project>

22
.idea/onefinity-firmware.iml generated Normal file
View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/py" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/src/pug/templates" />
</list>
</option>
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,6 +1,6 @@
{ {
"name": "bbctrl", "name": "bbctrl",
"version": "1.3.2", "version": "1.4.0 Alpha 1",
"homepage": "https://onefinitycnc.com/", "homepage": "https://onefinitycnc.com/",
"repository": "https://github.com/OneFinityCNC/onefinity", "repository": "https://github.com/OneFinityCNC/onefinity",
"license": "GPL-3.0+", "license": "GPL-3.0+",

View File

@@ -109,7 +109,7 @@ module.exports = new Vue({
template: require("../resources/config-template.json"), template: require("../resources/config-template.json"),
config: { config: {
settings: { units: "METRIC" }, settings: { units: "METRIC" },
motors: [{}, {}, {}, {}], motors: [{}, {}, {}, {},{}, {}, {}, {}],
version: "<loading>", version: "<loading>",
full_version: "<loading>", full_version: "<loading>",
ip: "<>", ip: "<>",

View File

@@ -14,8 +14,6 @@ module.exports = {
}; };
}, },
components: { components: {
"axis-control": require("./axis-control"),
"path-viewer": require("./path-viewer"),
"gcode-viewer": require("./gcode-viewer"), "gcode-viewer": require("./gcode-viewer"),
}, },
computed: { computed: {
@@ -93,44 +91,56 @@ module.exports = {
cancelMacros: function (id) { cancelMacros: function (id) {
document.getElementById(`macros-name-${id}`).value = ""; document.getElementById(`macros-name-${id}`).value = "";
document.getElementById(`macros-color-${id}`).value = "#ffffff"; document.getElementById(`macros-color-${id}`).value = "#ffffff";
document.getElementById(`gcodeSelect-${id}`).value="default"; document.getElementById(`gcodeSelect-${id}`).value = "default";
this.$broadcast("gcode-clear"); this.$broadcast("gcode-clear");
}, },
resetConfig: async function () { resetConfig: async function () {
this.config.macros = [ this.config.macros = [
{ {
name: " ", name: "FireLaser",
color: "#efefef", color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,
}, },
{ {
name: " ", name: "Home",
color: "#efefef", color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,
}, },
{ {
name: " ", name: "Park",
color: "#efefef", color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,
}, },
{ {
name: " ", name: "Spindle WarmUp",
color: "#efefef", color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,
}, },
{ {
name: " ", name: "Spindle ON",
color: "#efefef", color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,
}, },
{ {
name: " ", name: "Spindle OFF",
color: "#efefef", color: "#e6e6e6",
gcode_file_name: " ",
gcode_file_time: 0,
},
{
name: "Vacuum ON",
color: "#e6e6e6",
gcode_file_name: " ",
gcode_file_time: 0,
},
{
name: "Vacuum OFF",
color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,
}, },

View File

@@ -35,6 +35,9 @@ html(lang="en")
li.pure-menu-heading li.pure-menu-heading
a.pure-menu-link(href="#control") Control a.pure-menu-link(href="#control") Control
li.pure-menu-heading
a.pure-menu-link(href="#macros") Macros
li.pure-menu-heading li.pure-menu-heading
a.pure-menu-link(href="#settings") Settings a.pure-menu-link(href="#settings") Settings
@@ -62,9 +65,6 @@ html(lang="en")
li.pure-menu-heading li.pure-menu-heading
a.pure-menu-link(href="#cheat-sheet") Cheat Sheet a.pure-menu-link(href="#cheat-sheet") Cheat Sheet
li.pure-menu-heading
a.pure-menu-link(href="#macros") Macros
li.pure-menu-heading li.pure-menu-heading
a.pure-menu-link(href="#help") Help a.pure-menu-link(href="#help") Help

View File

@@ -220,6 +220,10 @@ script#control-view-template(type="text/x-template")
:disabled="!true",v-bind:style="{ backgroundColor: config.macros[4].color }") {{config.macros[4].name}} :disabled="!true",v-bind:style="{ backgroundColor: config.macros[4].color }") {{config.macros[4].name}}
button.macros-buttons(title="Click to run Macros 6", @click="runMacros(5)", button.macros-buttons(title="Click to run Macros 6", @click="runMacros(5)",
:disabled="!true",v-bind:style="{ backgroundColor: config.macros[5].color }") {{config.macros[5].name}} :disabled="!true",v-bind:style="{ backgroundColor: config.macros[5].color }") {{config.macros[5].name}}
button.macros-buttons(title="Click to run Macros 7", @click="runMacros(6)",
:disabled="!true",v-bind:style="{ backgroundColor: config.macros[6].color }") {{config.macros[6].name}}
button.macros-buttons(title="Click to run Macros 8", @click="runMacros(7)",
:disabled="!true",v-bind:style="{ backgroundColor: config.macros[7].color }") {{config.macros[7].name}}
.tabs .tabs

View File

@@ -36,6 +36,12 @@ script#macros-template(type="text/x-template")
input#tab6(type="radio", name="tabs", @click="tab = '6'") input#tab6(type="radio", name="tabs", @click="tab = '6'")
label(for="tab6",style="height:50px;width:100px") Macros 6 label(for="tab6",style="height:50px;width:100px") Macros 6
input#tab7(type="radio", name="tabs", @click="tab = '7'")
label(for="tab7",style="height:50px;width:100px") Macros 7
input#tab8(type="radio", name="tabs", @click="tab = '8'")
label(for="tab8",style="height:50px;width:100px") Macros 8
section#content1.tab-content section#content1.tab-content
.macros-form .macros-form
p.title Name p.title Name
@@ -203,3 +209,59 @@ script#macros-template(type="text/x-template")
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros(5)", button.submit-macros(title="Cancel Macros",@click="cancelMacros(5)",
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
section#content7.tab-content
.macros-form
p.title Name
.input-container
input.input-color(type="color",id="macros-color-6",value="#ffffff")
input.input-name(type="text",minlength='1',maxlength='15',id="macros-name-6")
p.title G-Code
.select-upload-gcode
select#gcodeSelect-6(title="Select previously uploaded GCode programs.",selected
v-model="state.selected",@change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(disabled='' selected='' value='default') Select an option
option(v-for="file in state.files", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
.fa.fa-upload
form.gcode-file-input.file-upload
input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc")
br
gcode-viewer
button.submit-macros(title="Save Macros",@click="saveMacros(6)",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros(6)",
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
section#content8.tab-content
.macros-form
p.title Name
.input-container
input.input-color(type="color",id="macros-color-7",value="#ffffff")
input.input-name(type="text",minlength='1',maxlength='15',id="macros-name-7")
p.title G-Code
.select-upload-gcode
select#gcodeSelect-7(title="Select previously uploaded GCode programs.",selected
v-model="state.selected",@change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(disabled='' selected='' value='default') Select an option
option(v-for="file in state.files", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
.fa.fa-upload
form.gcode-file-input.file-upload
input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc")
br
gcode-viewer
button.submit-macros(title="Save Macros",@click="saveMacros(7)",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros(7)",
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel

View File

@@ -43,7 +43,7 @@ class Config(object):
self.values = {} self.values = {}
try: try:
self.version = "1.3.2" self.version = "1.4.0 Alpha 1"
# Load config template # Load config template
with open(get_resource('http/config-template.json'), 'r', with open(get_resource('http/config-template.json'), 'r',

View File

@@ -585,54 +585,66 @@
}, },
"macros": { "macros": {
"type":"list", "type": "list",
"index":"123456", "index": "12345678",
"default":[ "default": [
{ {
"name":"Macros 1", "name": "FireLaser",
"color": "", "color": "#e6e6e6",
"gcode_file_name": "", "gcode_file_name": "",
"gcode_file_time": 0 "gcode_file_time": 0
}, },
{ {
"name":"Macros 2", "name": "Home",
"color": "", "color": "#e6e6e6",
"gcode_file_name": "", "gcode_file_name": "",
"gcode_file_time": 0 "gcode_file_time": 0
}, },
{ {
"name":"Macros 3", "name": "Perk",
"color": "", "color": "#e6e6e6",
"gcode_file_name": "", "gcode_file_name": "",
"gcode_file_time": 0 "gcode_file_time": 0
}, },
{ {
"name":"Macros 4", "name": "Spindle Warmup",
"color": "", "color": "#e6e6e6",
"gcode_file_name": "", "gcode_file_name": "",
"gcode_file_time": 0 "gcode_file_time": 0
}, },
{ {
"name":"Macros 5", "name": "Spindle ON",
"color": "", "color": "#e6e6e6",
"gcode_file_name": "", "gcode_file_name": "",
"gcode_file_time": 0 "gcode_file_time": 0
}, },
{ {
"name":"Macros 6", "name": "Spindle OFF",
"color": "", "color": "#e6e6e6",
"gcode_file_name": "", "gcode_file_name": "",
"gcode_file_time": 0 "gcode_file_time": 0
},
{
"name": "Vacuum ON",
"color": "#e6e6e6",
"gcode_file_name": " ",
"gcode_file_time": 0
},
{
"name": "Vacuum OFF",
"color": "#e6e6e6",
"gcode_file_name": " ",
"gcode_file_time": 0
} }
], ],
"template": { "template": {
"name": { "name": {
"type": "text", "type": "text",
"default": "Default Name" "default": " "
}, },
"color": { "color": {
"type": "text", "type": "text",
"default": "#efefef" "default": "#e6e6e6"
}, },
"gcode_file_name": { "gcode_file_name": {
"type": "text", "type": "text",

View File

@@ -1,5 +1,5 @@
{ {
"version": "1.3.2", "version": "1.4.0 Alpha 1",
"settings": { "settings": {
"junction-accel": 200000, "junction-accel": 200000,
"max-deviation": 0.05, "max-deviation": 0.05,

View File

@@ -215,6 +215,9 @@ span.unit
.save .save
display block display block
margin 0.25em 0.6em margin 0.25em 0.6em
height 3.5em
width 8em
.pure-menu-heading .pure-menu-heading
background inherit background inherit