Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cuttlefish
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
squidworks
cuttlefish
Commits
1c23a613
Commit
1c23a613
authored
5 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
lsq update cycles
parent
2d9131c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
hunks/calibrations/lsq.js
+19
-10
19 additions, 10 deletions
hunks/calibrations/lsq.js
with
19 additions
and
10 deletions
hunks/calibrations/lsq.js
+
19
−
10
View file @
1c23a613
...
@@ -23,6 +23,7 @@ export default function LoadcellCalibration() {
...
@@ -23,6 +23,7 @@ export default function LoadcellCalibration() {
let
loadReading
=
new
Output
(
'
number
'
,
'
prediction
'
,
this
)
let
loadReading
=
new
Output
(
'
number
'
,
'
prediction
'
,
this
)
this
.
outputs
.
push
(
loadReading
)
this
.
outputs
.
push
(
loadReading
)
let
isOkToCalc
=
false
// admit unwillingness to write nice array wrappers,
// admit unwillingness to write nice array wrappers,
// do that locally ..
// do that locally ..
let
xStateArray
=
new
State
(
'
string
'
,
'
csv: readings: x
'
,
'
0, 250, 500
'
)
let
xStateArray
=
new
State
(
'
string
'
,
'
csv: readings: x
'
,
'
0, 250, 500
'
)
...
@@ -44,19 +45,27 @@ export default function LoadcellCalibration() {
...
@@ -44,19 +45,27 @@ export default function LoadcellCalibration() {
let
lsqr
=
smallmath
.
lsq
(
exes
,
whys
)
let
lsqr
=
smallmath
.
lsq
(
exes
,
whys
)
m
=
lsqr
.
m
m
=
lsqr
.
m
b
=
lsqr
.
b
b
=
lsqr
.
b
isOkToCalc
=
true
if
(
b
>=
0
)
{
if
(
b
>=
0
)
{
return
`
${
m
}
x +
${
b
}
`
return
`
${
m
}
x +
${
b
}
`
}
else
{
}
else
{
return
`
${
m
}
x
${
b
}
`
return
`
${
m
}
x
${
b
}
`
}
}
}
else
{
}
else
{
isOkToCalc
=
false
return
'
bad inputs ...
'
return
'
bad inputs ...
'
}
}
}
}
let
result
=
new
State
(
'
string
'
,
'
calibration result
'
,
writeCalExpression
())
let
result
=
new
State
(
'
string
'
,
'
calibration result
'
,
writeCalExpression
())
this
.
states
.
push
(
xStateArray
,
yStateArray
,
result
)
this
.
states
.
push
(
xStateArray
,
yStateArray
,
result
)
xStateArray
.
onChange
=
(
value
)
=>
{
let
isOkToCalc
=
false
xStateArray
.
set
(
value
)
result
.
set
(
writeCalExpression
())
}
yStateArray
.
onChange
=
(
value
)
=>
{
yStateArray
.
set
(
value
)
result
.
set
(
writeCalExpression
())
}
this
.
init
=
()
=>
{
this
.
init
=
()
=>
{
result
.
set
(
writeCalExpression
())
result
.
set
(
writeCalExpression
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment