April 29, 2024, 09:05:12 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Changing brightness of a background image???

Started by Egil, March 11, 2015, 05:42:05 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Brian

Egil

I'll have a look at that - didn't know who produced Flightradar24, anyway

Glad you called me "English" - whenever I am asked my nationality I always say English. To me,
British means you could be either English, Scottish, Welsh or Irish

Glad to say I am English, even though my surname is Welsh!

Brian

Egil

Larry:
I have often noticed that some airliners never manage to set their flight computer clocks to UTC. Which means that the timestamps they transmit when reporting their positions are wrong. (The transmissions shown in the log preceded by [HFNPDU PERFORMANCE]). So maybe I shall replace all timestamps with the pc's system clock.

These are mostly east european and pakistani airliners, but also some charter plane companies from south america. Aeroflot planes, and other companies that was formerly asociated with them, extensively use Moscow time. And the others seem to pick a time by random.

I wonder if their passenger would trust these companies enough to fly with them if they knew that the companies' maintenance crews don't know how to set the flight cumputers right!

Support Amateur Radio  -  Have a ham  for dinner!

Egil

Quote from: Brian Pugh on April 18, 2015, 06:46:47 AM
Glad you called me "English" - whenever I am asked my nationality I always say English. To me,
British means you could be either English, Scottish, Welsh or Irish

Glad to say I am English, even though my surname is Welsh!

Brian

Well, I've been enough on the British Isles to know that nationality is a very important matter, but forunately most of "the others" are proud if I call them english. ;D ;D ;D
Except in Ireland...

Egil
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

What do you think? The center of the triangle is the target.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

for Oslo I was using 10 45 8 E 59 54 50 N

Looks pretty close to me
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

That's close enough Larry, great!

Right now I'm having a look at the UDP routines. I have all the UDP routines in an inc file. and guess we can use that file directly when converting to a project. I am going to use them to set up a UDP "listener", listening for input on a single, specified port. These are routines that can be activated at program startup, and then forget them as the receiver works in the background in its own thread. Have to decide if UDP send routines also should be included. This may come in handy for people using decoders on multiple computers running PC-HFDL.

What do you think of a set of program routines that can be called automaticly if no config or ini file is present, then use a dialog to set up UDP, the wanted number of logfiles to read, and the paths to these logfiles and  paths to any other utility files, such as GroundStations, HomePosition and possibly a simple database of plane information collected from "the air". And by not restricting the mumber of logfiles to four, decoders using SDR receivers of the USB-stick kind, can use as many as they want, as long as they don't run out of CPU.
When all the parameters are set, the program can start. And then stop operations and get the setup dialog visible, to make any changes, and then save and start operations again.

Then, the next time the program starts the mentioned config file is used for operations.

I have tried to do part of this in the LogFix program posted in another  thread, a little clumsy, but it works. Tonight I'll try finish a simple user manual for the LogFix program, as several of the decoding enthusiasts already are using the program, and ask for a user guide.  Most of the LogFix routines need to be included in the MapView program.


Egil

Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

Sounds like a plan except for code in an 'inc' file. We'll simply change that to an iwb file.
I've already added the code for reading/writing ini files so that is in place.

What I'm working on right now:
1) two different window sizes selectable by the user and optimized for the image size done
2) two different zoom levels selectable by the user (requires program restart) done
3) reading those selections from ini file done
4) reading display of a/c, base, home from ini file done
5) reading bg shading from ini file done
6) writing all the about values to ini file at appropriate time done
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

OK Larry.

Seems like you are working much faster than me. :D :D
Because of the painkillers I have to use to calm down the hip pain, my brain is presently running slow ahead only...
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

Quote from: Egil on April 18, 2015, 11:46:25 AM
OK Larry.

Seems like you are working much faster than me. :D :D
Because of the painkillers I have to use to calm down the hip pain, my brain is presently running slow ahead only...

I'm just doing what I know how to do.  I'll hit a point where you'll be pretty much on your on before long because I don't have any radio recievers.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

TAAA-DAAA!!
Attached is the 'project'
I suggest you put the contents of the zip in a new folder.
It has a working ini file that remembers selected options between sessions.
User can select from 2 different window sizes and two different zoom levels
The dialog to allow the user to set their home base location is working.

I'm through with the basic home base code.
Later it will need error checking code added to make sure valid lat and long values are entered.

The next code I'll work on is to read the ground stations and their freq and displaying the info on the screen.
Might be a little slow this coming week.  My wife has cataract surgery thurs and if all goes well she'll have her other eye done a couple of weeks later.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

Thanks Larry!

You have done a really  great job. And I am going to learn a lot from seeing the way you code.
And you really deserve to take it easy for a while.
Myself have a lot of catching up to do  as well. I'm having an x-ray of my arm on tuesday, so hope to get rid of the anoying plaster on my arm at the same time.
Typing with this harness has been a nightmare. And I won' even mention how it has been at night, trying to sleep.

Now I'll download your code and have a look at it.


Egil

Support Amateur Radio  -  Have a ham  for dinner!

Bill-Bo


LarryMc

Egil

I'm using the file you created called System Table.txt as the input source data file for creating the ground station displays.
I have changed the name to SystemTable.txt (removed the space and placed the file in a subfolder called data under the folder mapview.exe is in.)
However you are generating that text file don't change it or you will destroy my code.
I'm decoding that file and creating an ini file that is loaded each time mapview is started and can also be updated at any other time you so desire.  Any time the display needs to be updated the ini file is looked at.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Do we have any idea what the max number of freq a ground station can have is?
In one picture you had the frq were displayed directly on the screen.
I think a popup window will be a lot better and less overall clutter, if you really need to see the freq.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

Larry:

The max number of frequencies for each Ground Station is set by the system to 20.
As far as I remember,  the only station ever set up with that maximum is Riverhead - New York.

I attach systable49, which is the systable presently in use. This file is generated by PC-HFDL, and whenever there are changes in the GroundStation setup, a new such table is broadcast by the groundstations. Guess we are soon up for another change, as the present one has been in use for almost three years now. There are always several of the decoders manageto pick up the new files when they are transmitted, and they post their findings on the HFDL Yahoo Group. The actual file is in a binary format, and the plain text file is generated/translated from the binary one.

The map really looks great!


Bill:
I agree! I have been taking part in collecting data for it since they started some years ago. And they have done a great job to achieve the present state of the site.




Egil
Support Amateur Radio  -  Have a ham  for dinner!

Egil

Larry,
Almost forgot... A popup window would be the best.


At present I am studying your code, trying to understand how to use that graphics library, as that may come in handy for later projects. And think I am starting to see how things work.
But since the people that made that library, like us, had to use the windows API to make it, I can't help thinking that the  same routines could be done using plain IWB code. But at the same time I see that the library saves us a lot of time.
When this project is up and going, I think I'll experiment a little, to see how I can do such shape drawing routines myself. Frankly, I have been thinking of that for some time, but never got around to start.


Egil

Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

I know you have probably already told me.
On the txt file containing plane positions, how often is that file created so that I'll have access to it to decode it so that I can update the display data?
Or is that data going to be fed to me real time from your listener code?
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

Was planning to update planepositions once a minute, reading them from the logfile I sent you.

Each "channel" monitored (each instance of PC-HFDL) makes its own logfile. These files are checked every five seconds, and any new contents is appended to the logfile you read from.
Any input arriving at the UDP port we set up to "listen" to, will also be appended to this file.
By collecting all data in that particular logfile, allows for using the data with several other shareware programs, all using a file with that name as a data source.

Just for fun, I converted the only "shape" file i ever made for this purpose in MiniBASIC to IWBasic.
When compiled with IWB, and using the same world map, the shapes does not always fill with color when drawn. I do not understand why.
As the method plots fast, it is something I will look into when this program is finished. Do not know if I ever go to use it though. Posting the code below.


Egil





AutoDefine "Off"

def win:window  
def i,handle,run,wstyle,mapleft,maptop,pw,ph:int  
wstyle = @minbox '|@maxbox

' Create a window ..  
OpenWindow win,0,0,1000,500,@minbox,0,"IWB Skeleton Window",&messages  
run = 1  

GETCLIENTSIZE win,mapleft,maptop,pw,ph ' finding available area for drawing
handle = LOADIMAGE ("world.jpg", @IMGSCALABLE)
SHOWIMAGE win,handle,@IMGSCALABLE,0,0,pw,ph  
for i = 1 to 150 ' 150 planes to plot
PlotPlanes(win,rand(10,990),rand(10,490),0,255,0,rand(0,35),15,240, 220,182)
next i

WAITUNTIL run = 0  
CLOSEWINDOW win  
END  

SUB messages(),int
SELECT @class

CASE @idcreate  
centerwindow win  

CASE @idclosewindow  
run = 0  
ENDSELECT  
RETURN  0
EndSub

'
'------------------------------------------------------------------------------------------------------
' To call, use:
' x,y      = center of shape
' sr,sg,sb = color of shape (RGB)
' course   = planes direction of travel (restricted to 10 degrees intervalls)
' headline = length of line indicating planes course
' lr,lg,lb = color of headline (RGB)
'------------------------------------------------------------------------------------------------------
sub PlotPlanes(window wnd,int x,int y,int sr,int sg,int sb,int course,int headline ,int lr, int lg,int lb)
int hdc
move wnd,x,y
hdc = gethdc(wnd)
line(wnd,x, y-3, x-3, y, rgb(sr,sg,sb))
line(wnd,x-3, y, x, y+3)
line(wnd,x, y+3, x+3, y)
line(wnd,x+3, y, x, y-3)
' ReleaseHDC(wnd,hdc)

' hdc = gethdc(wnd)
FloodFill wnd,x,y,RGB(sr,sg,sb)
ReleaseHDC(wnd,hdc)
move wnd,x,y
frontpen wnd,rgb(lr,lg,lb)
LINETO wnd,x+headline * cosd(course*10),y+headline* sind(course*10)
RETURN
ENDSUB

Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

I also noticed in the file that the freq that the ground stations are currently using are being reported.
Are you wanting to capture that info so not only are all the freq listed in the popup window the in-use freq will be flagged also?
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

Yes. The "squitter broadcasts", sent every 33 seconds, contains a station ID with active frequencies for the transmitting stations plus two other groundstastions. The two other graoundstations are changed for every broadcast, just by stepping through the stationlist.
All frequency changes are transmitted in these broadcasts, couple of minutes before they are changed. This way the planes software can can changne tom the new frequency or log on to another ground stations. But planes working on a channel that "dissapears", whether frequency change or radio propagation is the cause, have to change to a new frequency anyway, but if they catch the frequency change, this change s done more faster.


Egil

Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

Since we'll only be updating the plane file every minute and the grnd stations are changing every 33 secs we'll be lagging just a bit behind.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

The planefile can be upated after every update of the logfile, during the 5 seconds interval between two logfile updates.
Then the map is updated once a minute. We can update the map "live", but since there are at least four other programs collecting data for the logfile Mapview reads, things will be more relaxed this way.
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

okay, I'm getting confused about what information I'm pulling from what file and when.

I need a constant file name to pull data from.  Doesn't matter to me how many files or how you generate the files.
They also need to be in a constant format.

So far you have sent me these 3 files
QuoteSystem Table.txt
April18.txt
March28.txt

I used System Table.txt as my source file for creating my ini file I use in generating the ground station display.
I don't care where it came from or how you create it  but I need it to have a fixed name from now on or we're going to have to make its name a configuration option.

The other 2 files are the same format.  Right now that is the source of ALL my other information and I'm expecting you to provide me with a new file(with a constant name) every minute for me to read and process.
From that file I will get the plane ID and location, calculate the heading, and capture the current active freq of the ground stations.

Other than that I don't know anything about any other files or data.
How far mis-matched are we?


LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

Most of the routines from the LogFix program (posted here: http://www.ionicwind.com/forums/index.php?topic=5629.0) will be included in the MapView program.

Below is the sub I use for generating logfile names that change with the UTC dates. This is the same naming convention PC-HFDL uses.
I call it like this:

def Log$:string

Log$ = LogName()




'
'-------------------------------------------------------------------------------
' SUB LogName(),string    
' Generates PC-HFDL logname
' 'windows.inc' must be included before calling
'-------------------------------------------------------------------------------
SUB LogName(),string
string month,day
int t_mnd
DEF n_mnd[12]:string
n_mnd = "January","February","March","April","May","June",_
"July","August","September","October","November","December"

SYSTEMTIME st
_GetSystemTime(st)
month = STR$(st.wMonth)
day = STR$(st.wDay)
t_mnd = val(month)
day = RIGHT$(day,2)
IF VAL(day) < 10 THEN day = "0" + RIGHT$(day,1)
RETURN n_mnd[t_mnd-1] + day + ".txt"
ENDSUB
'-------------------------------------------------------------------------------




But you are way ahead of me with the programming, and I have not yet come around to prepare that module.


Egil

Support Amateur Radio  -  Have a ham  for dinner!