1

Event type

Тема: Event type

Hi,
i'm working on an app wich is a kind of dashboard.
It 's actually gives the hours of ingine ignition. The code is:

function ignitionConfig(th) {
         var events_config = {
            itemId: th.getId(),
            eventType: 'ignition',
            ivalType: 4,
            ivalFrom: currentInterval[0],
            ivalTo: currentInterval[1]
        };
        
        wialon.core.Remote.getInstance().remoteCall(
            "unit/get_events",
            events_config,
            function (code, data) {
                var t1 = new Date();
                printIgnition(data.ignition[Object.keys(data.ignition)[0]], currentInterval[0], currentInterval[1]);
                var t2 = new Date();

                sortTable('date', 'up');

                setTimeout(function() {
                    $overlaytab.addClass('inactive');
                }, t2-t1);
            });
}

I would like to see the engine efficiency instead of ignition but i don't now what put in "event type" to do this.
Thank you for your time.

2

Event type

Re: Event type

janus, to get engine efficiency in events we can suggest you such solution:
1. Create counter unit sensor of instant type and set some parameter or your specific formula for example speed/const22
2. Then you can execute "unit/get_events" request with "eventType":"sensors","detalization":2,"filter1":<id_of_sensor>
For new unit messages (or after performing events recalculation) you'll get response like this:

[
    {
        "sensors": {
            "1": [
                {
                    "type": 2,
                    "counter": 26,
                    "summary": 9.25,
                    "total_counter": 26,
                    "total_summary": 9.25,
                    "value": 0.25
                },
                {
                    "type": 2,
                    "counter": 8,
                    "summary": 3.425,
                    "total_counter": 34,
                    "total_summary": 12.675,
                    "value": 0.45
                }
            ]
        }
    }
]

"1" - is unit sensor id
"counter" - number of messages in current interval
"summary" - sum of engine efficiency values for current interval
"total_..." - the same from beginning
"value" - value of engine efficiency for last message of interval

You can calculate average efficiency on interval by dividing "summary" by "counter".

Head of Wialon Local Department
Gurtam
3

Event type

Re: Event type

thank you Deal, this helps me