Welcome to Radarspotting. Please login or sign up.

April 18, 2025, 07:46:41 AM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

ICAO Operator (Operator Flag)

Started by tjakob, March 03, 2020, 11:13:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tjakob

Hello everyone,
I am asking for help. Is there any solution that will automatically save to BaseStation.sqb in the Operator Flag column, bitmap code in the format e.g. AFLA320 ?
In my BaseStation it is stored in fe: A320 format. I would like to use colored bitmaps of aircraft silhouettes, but most are bitmaps for use in the Operator+ICAO type format (fe: AFLA320)
Manually editing this number of aircraft via SQLite is impossible and rather pointless.  :-[

Regards to All

Anmer

Welcome.

BaseStation doesn't place any data in the OperatorFlag field (column).  One either has to do it manually or using an external app, such as SQLite Expert Personal

What data you place in the OperatorFlag field is entirely up to you.  For example, if for all British Airways A320 you want to enter BAWA320 you can.  But you would also need a corresponding bmp file in your OperatorFlags folder.

Whay you could do is use an sql statement to do this, such as: 

update aircraft
set operatorflagcode ='BAWA320'
where icaotypecode ='A320'
and registeredowners ='British Airways';


Please make a copy of your BaseStation.sqb file to test the sql statement.
Here to Help.

Faramir

#2
That's something I stumbled on also.
As a quick and dirty solution I created a trigger. Every time a line changes I concatenate OperatorFlagCode and ICAOTypecode into another field, in my case into popularname. Some lines have no OperatorFlagCode ie private and corporate aircraft. That part I didn't solve yet. Modify the trigger to fill OperatorFlagCode won't work as it creates a loop.
For what it is worth:CREATE TRIGGER ConstructMiniature
  AFTER UPDATE
  ON Aircraft
BEGIN
  UPDATE Aircraft
  SET Popularname = (SELECT NEW.OperatorFlagCode from Aircraft)
                    || (SELECT NEW.ICAOTypecode from Aircraft)
  WHERE aircraft.aircraftid = NEW.aircraftid;
END;


Faramir

Forgot to mention that both fields are populated using separate software.
So the software fill both the OperatorFlagcode and ICAOTypeCode fields, the trigger than puts them concatenated into Popularname.