calc min
This commit is contained in:
parent
5344804e07
commit
8271b880e5
|
@ -51,7 +51,7 @@ const form_refs = {
|
|||
}
|
||||
|
||||
const changeParametres = () => {
|
||||
// console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000)
|
||||
console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000)
|
||||
|
||||
if ((form_state.total_length * 1000) <= (parametric.length.min + parametric.height.step)) {
|
||||
form_state.total_length = (parametric.length.min + parametric.height.step) / 1000
|
||||
|
@ -72,8 +72,8 @@ const changeParametres = () => {
|
|||
}
|
||||
}
|
||||
|
||||
if (form_state.total_length_mm < form_state.length) {
|
||||
// form_state.length = form_state.total_length_mm
|
||||
if (!form_state.auto_length && (form_state.length > form_state.total_length_mm)) {
|
||||
form_state.length = form_state.total_length_mm
|
||||
}
|
||||
form_state.total_length_mm = form_state.total_length * 1000
|
||||
|
||||
|
@ -83,7 +83,7 @@ const changeParametres = () => {
|
|||
if (auto_length) {
|
||||
let w = parametric.length.min
|
||||
const max_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.min + fence_length))
|
||||
const min_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.max + fence_length))
|
||||
const min_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.max + fence_length)) || 1
|
||||
|
||||
for (let index = min_sections; index <= max_sections; index++) {
|
||||
full_sections = index
|
||||
|
|
Loading…
Reference in New Issue