-
Notifications
You must be signed in to change notification settings - Fork 0
apply calibration button wip #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
onChange={(e) => onProcedureFileChange?.(e.target.value)} | ||
/> | ||
</div> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an input field for the procedure_file
? data[mainKey][subKey].toFixed(3) | ||
? Number(data[mainKey][subKey].toFixed(3)) % 1 === 0 | ||
? data[mainKey][subKey].toFixed(0) | ||
: data[mainKey][subKey].toFixed(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Js doesnt differentiate int and float. Dynamically roll floats up to ints if they qualify..
<td> | ||
<Link | ||
className="link" | ||
className="link font-mono" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style tweaks
id: z.string(), | ||
hardware_name: z.string(), | ||
calibration_file: z.string(), | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add apply action.
case Intent.Enum.resume_calibration_procedure: | ||
try { | ||
const procedureState = | ||
await Evolver.resumeCalibrationProcedureHardwareHardwareNameCalibratorProcedureResumePost( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to use the new dedicated /resume endpoint, it used to be /start with param resume = false.
intent === Intent.Enum.resume_calibration_procedure | ||
? true | ||
: false, | ||
procedure_file: submission.value.procedure_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/start now requires a procedure_file param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we require it from the user? Or just that it is available to set but can submit with nothing - I wonder at this level if it might just be more confusing than helpful to ask the user for this...
The /start
endpoint doesn't actually require the parameter, it is optional there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep good point resolved in latest revision.
start procedure -> no user input, procedure_file name is auto-gen'd, applied to config, and saved to device fs.
apply procedure -> user is prompted for a calibration_file name, and this is what is saved to device fs.
hardware_name: submission.value.hardware_name, | ||
}, | ||
query: { | ||
calibration_file: submission.value.calibration_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note calibration_file
here. This is where the user specifies the file where the 'applied' calibration will be saved to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and working.
} | ||
return submission.reply({ | ||
formErrors: ["unknown error"], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should never happen (we're doing validation on actions and exausting them in the switch
- but remix lints expect the action to return something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remix is still throwing errors over this, maybe a bug on their end.
: `This will start a new calibration procedure and create a new procedure_file file to store procedure state on the device.`; | ||
|
||
const applyProcedureWarningMessage = `Apply the calibration procedure.This will copy procedure state currently stored in the procedure_file ${currentProcedureFile} to the calibration_file. Data in the calibration_file is used to calibrate the hardware. ${calibrationFile ?? "since no calibration_file attribute was found on this hardware's config, the data in procedure_file will be copied to a default calibration_file name."}`; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
descriptive copy to try and keep the difference between calibration_file
and procedure_file
clear.
useLoaderData<typeof loader>(); | ||
|
||
console.log("calibrationFile", calibrationFile); | ||
console.log("procedureFile", procedureFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will delete in revision 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted.
"@hey-api/client-fetch": "^0.1.10", | ||
"@hey-api/openapi-ts": "^0.49.0", | ||
"@prisma/client": "^5.16.2", | ||
"@prisma/client": "^6.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated prisma, it was complaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'm just a bit concerned about confusion with the procedure_file - but maybe my concerns aren't warranted
intent === Intent.Enum.resume_calibration_procedure | ||
? true | ||
: false, | ||
procedure_file: submission.value.procedure_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we require it from the user? Or just that it is available to set but can submit with nothing - I wonder at this level if it might just be more confusing than helpful to ask the user for this...
The /start
endpoint doesn't actually require the parameter, it is optional there
As a note, closing out this should also close: ssec-jhu/evolver-ng#288! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good, thanks!
see pr comments for features. bit of a mixed bag.