Computed attribute for Operator

netluca17 years ago

Dear all,

I'm using Teltonika protocol. My tracker return the following additional data:

io241 - MCCMNC

Instead of presenting RAW values in the localisation I want to implement some logic and processing to those values.

i.e.
when seeing below values:

io241 - 22288 (Wind)

I want to replace the io241 in the screen and display only a "GSM Network Name". In above case 222 88 translated to Wind network.

Can you please help me?

Thanks

Anton Tananaev7 years ago
netluca17 years ago

before writing you I had seen that link I tried to create a similar thing but it does not work.

Operator == 22201? "Tim":
Operator == 22210? "Vodafone":
Operator == 22206? "Vodafone":
Operator == 22288? "Wind":
Operator == 22244? "Wind":
Operator == 22299? "H3G":
Operator == 22250? "Iliad":
false

but it gives me error.

org.traccar.processing.ComputedAttributesHandler.computeAttribute@86! [0,8]: 'Operator == 22201? 'Tim': Operator == 22210? 'Vodafone': Operator == 22206? 'Vodafone': Operator == 22288? 'Wind': Operator == 22244? 'Wind': Operator == 22299? 'H3G': Operator == 22250? 'Iliad': false; ' undefined variable Operator - Variable (... <ComputedAttributesHandler: 86 <AttributeResource: 51 <...)

and in type is not possible set text is present only string

Anton Tananaev7 years ago

Of course it will give you an error because you don't have attribute "Operator".

netluca17 years ago

in attributes and state pannel is present "Operator" ex "io241"

Anton Tananaev7 years ago

You need to use attribute "key", not the name that you see in state panel. Keys always start with lower-case letters.

netluca17 years ago

ok, thanks, everything works correctly but I think it is more 'right to find the way to insert and have in the db all the MCC, MNC, LAC, CID in order to have so the encoding of both operators worldwide and geolocation.
the site https://opencellid.org/downloads gives the possibility to download all the necessary data. Logically having the key.
I think that once downloaded it would be interesting to load it in the DB

Anton Tananaev7 years ago

That would definitely require code modifications.

netluca17 years ago

I agree, but this change would solve two problems both geolocation and world-wide identification of telephone operators.
I think it's very interesting as a change