Repository navigation
feat(v2.5): integrate order-analysis JNI contract #59
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
Merged
+694
−870
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 36 additions & 36 deletions
72
...hm-runtime/src/main/java/com/opentest/algorithm/runtime/AlgorithmLibJNIBridgeService.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 80 additions & 34 deletions
114
...d/crydaq-algorithm-runtime/src/main/java/com/opentest/core/jni/AlgorithmLibJNIBridge.java
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 19 additions & 34 deletions
53
.../crydaq-algorithm-runtime/src/main/java/com/opentest/core/jni/OrderTrackingJNIBridge.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,26 @@ | ||
| package com.opentest.core.jni; | ||
|
|
||
| import com.opentest.algorithm.api.OrderTrackingModels.Config; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.Input; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.Result; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.AnglePreparationResult; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.AngleReference; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.FsSettings; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.OtSettings; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.Results; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.RpmReference; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.SpectrumSelection; | ||
| import com.opentest.algorithm.api.OrderTrackingModels.VibrationSignal; | ||
|
|
||
| /** | ||
| * Typed JNI boundary to {@code CRYOrderTrack::AnalyzeFromRpmFixedEx} in {@code CRYAlgorithmLib}. | ||
| * The host owns DLL loading and initialization; constructing this class never loads another runtime. | ||
| * All bridge instances serialize native order-analysis calls through one native mutex. This does not | ||
| * make unrelated algorithms or a second independently loaded runtime safe to call concurrently. | ||
| * Direct JNI boundary for the delivered fixed-sampling and order-tracking SDK. | ||
| * | ||
| * <p>The bridge performs no resampling, filtering, unit conversion, result selection, or | ||
| * business error translation. FS and OT analysis return the native result model, the angle | ||
| * preparation method returns the reference consumed by OT, and selectors read frame metadata | ||
| * from an existing result.</p> | ||
| */ | ||
| public class OrderTrackingJNIBridge { | ||
| /** | ||
| * Performs synchronous whole-record fixed-sampling analysis using already supplied RPM values. | ||
| * Vibration samples retain the caller's physical unit; RPM values are revolutions per minute, | ||
| * sampling rates are Hz and both start times are seconds relative to the same clock origin. | ||
| * Native code performs any required RPM interpolation; Java performs no numerical processing. | ||
| * Zero start times reproduce the ordinary {@code AnalyzeFromRpmFixed} timing contract. | ||
| * | ||
| * <p>Configuration defaults and enum codes are declared in {@code OrderTrackingModels}. | ||
| * Required nested objects and arrays must be non-null; optional selections use empty arrays. | ||
| * JNI copies input arrays into call-local storage. Do not mutate any reachable input/configuration | ||
| * during the call. Returned arrays are independent Java allocations; no native handles survive | ||
| * the call and no close/dispose operation is required. Fixed maps use {@code data[y/RPM][x/Hz]}, | ||
| * while the native derived map uses {@code data[x/RPM][y/order]}; neither is transposed by JNI. | ||
| * Actual and nominal axes are retained separately, and nonfinite result values are not normalized. | ||
| * | ||
| * <p>Binding errors throw; algorithm rejection returns {@code success=false} with the original | ||
| * errors, warnings and any partial facts. A false success flag is never replaced by synthetic data. | ||
| * | ||
| * @param config complete native configuration, including required common/fixed/standard objects | ||
| * @param input vibration and speed records with independent rates and common-origin start times | ||
| * @return complete native result, including chain, sections, curves, maps and diagnostics | ||
| * @throws IllegalArgumentException for null required objects/arrays or invalid integer enum codes | ||
| * @throws IllegalStateException for an escaping native exception, preserving its message | ||
| * @throws OutOfMemoryError for binding allocation failure | ||
| * @throws UnsatisfiedLinkError if a matching CRYAlgorithmLib has not been loaded by the host | ||
| */ | ||
| public native Result analyzeFromRpmFixed(Config config, Input input); | ||
| public native Results analyzeFs(VibrationSignal vibration, RpmReference rpm, FsSettings settings); | ||
|
mingtaojin marked this conversation as resolved.
Resolved
|
||
| public native AnglePreparationResult prepareAngleReference(RpmReference rpm); | ||
| public native Results analyzeOt(VibrationSignal vibration, AngleReference reference, OtSettings settings); | ||
| public native SpectrumSelection selectFsSpectrum(Results results, int axis, double target); | ||
| public native SpectrumSelection selectOtSpectrum(Results results, int axis, double target); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.