Radarspotting

Mode-S Software => Virtual Radar Server => Topic started by: tjakob on March 03, 2020, 11:13:24 PM

Title: ICAO Operator (Operator Flag)
Post by: tjakob on March 03, 2020, 11:13:24 PM
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
Title: Re: ICAO Operator (Operator Flag)
Post by: Anmer on March 04, 2020, 09:19:49 AM
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.
Title: Re: ICAO Operator (Operator Flag)
Post by: Faramir on March 29, 2020, 06:39:11 PM
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;

Title: Re: ICAO Operator (Operator Flag)
Post by: Faramir on March 29, 2020, 06:43:46 PM
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.