js-evaluator-for-android icon indicating copy to clipboard operation
js-evaluator-for-android copied to clipboard

Sometime the onResult callback not call

Open matanel-6over6 opened this issue 2 years ago • 0 comments

  1. i'm updated to new version 6.0.0 (my device with android 13)
  2. i'm use with callFunction
  3. I repeat, sometimes I return an answer and sometimes I don't. And no error returns

new JsEvaluator(activity.getApplicationContext()).callFunction("var testFunc = function(flagValue) { return flagValue <= 0.3;}", new JsCallback() { @Override public void onResult(final String result) { Logger.d("test_bug", "onResult: " + result); }

        @Override
        public void onError(String s) {
            Logger.d("testFunc", "onError: " + s);
        }
    }, "testFunc", 0.8);

10x

matanel-6over6 avatar Feb 09 '23 11:02 matanel-6over6

Meeting notes:

  • Ulf: Think it could be helpful, could make it easier to find signals
  • Erik: Please review/comment, if no one object I might make a draft.

erikbosch avatar Jan 24 '23 15:01 erikbosch

I don't know if it's a goal for VSS, but: this would be useful for generating a Vehicle struct, which our company is doing.

You can do this now by, e.g., running protoc on the protobuf target; but it's difficult to organize the types for all of the branches, instances, and enums.

elffjs avatar Jan 28 '23 15:01 elffjs

A possible restructure can be seen in https://github.com/boschglobal/vehicle_signal_specification/pull/20 (Note that only a subset of the files are restructured in that draft, but it shows how structure could look like after a restructure)

erikbosch avatar Feb 06 '23 13:02 erikbosch

Meeting notes:

  • Please review
  • Check how prefix for includes are handled, can it be removed to reduce risk of errors

erikbosch avatar Feb 07 '23 15:02 erikbosch

Following up on what was brought up yesterday by @kkoppolu1.

The general logic of the vspec files and #include syntax as of today is that there is no assumption made concerning which branch a signal belong to, so in the example below you explicitly need to state that Intensity belongs to Raindetection

Raindetection:
  type: branch
  description: Rainsensor signals.

Raindetection.Intensity:
  datatype: uint8
  type: sensor
  unit: percent
  max: 100
  description: Rain intensity. 0 = Dry, No Rain. 100 = Covered.

Similar for #include, if you want the content of SingleWindow.vspec to be added inside Window you need to specify Window as prefix, if not content will be added in parallel to Window. (Unless all content in SingleWindow.vspec start with Window. prefix, which typically is not the case as we want the included file to be independent.)

Window:
  type: branch
  description: Door window status

#include SingleWindow.vspec Window

So I think we cannot easily get rid of the prefix in includes. But we could definitively improve the checks, for example by actually checking that Window above exist as branch. We do not do that today, will create a Pull Request for that

erikbosch avatar Feb 08 '23 10:02 erikbosch