Skip to content

Conversation

imaitland
Copy link
Member

@imaitland imaitland commented Apr 3, 2025

see pr comments for features. bit of a mixed bag.

onChange={(e) => onProcedureFileChange?.(e.target.value)}
/>
</div>
)}
Copy link
Member Author

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)
Copy link
Member Author

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"
Copy link
Member Author

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(),
}),
Copy link
Member Author

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(
Copy link
Member Author

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,
Copy link
Member Author

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

Copy link
Member

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

Copy link
Member Author

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,
Copy link
Member Author

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.

Copy link
Member Author

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"],
});
Copy link
Member Author

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.

Copy link
Member Author

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."}`;

Copy link
Member Author

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);
Copy link
Member Author

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.

Copy link
Member Author

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",
Copy link
Member Author

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.

@imaitland imaitland marked this pull request as ready for review April 17, 2025 19:35
@imaitland imaitland requested a review from amitschang April 17, 2025 19:35
amitschang
amitschang previously approved these changes Apr 17, 2025
Copy link
Member

@amitschang amitschang left a 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,
Copy link
Member

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

@amitschang
Copy link
Member

As a note, closing out this should also close: ssec-jhu/evolver-ng#288!

Copy link
Member

@amitschang amitschang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, thanks!

@imaitland imaitland merged commit 2b889c7 into main Apr 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants