Sun Monitor

Discussion in 'Share Your Creations' started by alfcen, Oct 18, 2007.

  1. alfcen

    alfcen Well-Known Member Licensed User

    Hi everybody,
    My latest Basic4PPC astronomy project is software that monitors the daily positions and motions of our home star, the Sun.

    If you are astronomy biased please have a look at:

    http://www.alfcen.com/pocket/taiyo.html

    (The installer is too large for the forum server)

    I am always amazed by the speed at which Basic4PPC applications can be put together!

    The application is shareware, but free for forum members.

    Cheers
    Robert
     
  2. Rioven

    Rioven Active Member Licensed User

    Hi alfcen,
    Looks very nice!:sign0098:
    I've got interested...
    I am using sun path for designing building facade, canopy, and other sun shading devices.

    Regards,
     
    Last edited: Oct 18, 2007
  3. Cableguy

    Cableguy Expert Licensed User

    Hi Robert...
    Althoug not an astronomy enthusiast, I like to watch the stars and know a bit or two about everything....
    Your app LOOKS great, but the screenshot in the website is a bit small...
    Can you post a larger image in the forum?
    btw, how did you get those great looking gouges? are they dll based or code based controls?
     
  4. alfcen

    alfcen Well-Known Member Licensed User

    Hi Cableguy
    Here you are...

    The gauges are bitmaps created with Paint Shop 5 :)

    Cheers
    Robert
     

    Attached Files:

  5. Cableguy

    Cableguy Expert Licensed User

    So they don't really work do they?..toobad, they look awsome!!!
     
  6. alfcen

    alfcen Well-Known Member Licensed User

    Without code the bitmaps are of course dummies, but with some code, mostly drawing on a form, they work quite vividly and do not require much memory. Besides, bitmaps load faster than other graphic formats while repainting the screen, in whole or part, is as easy as drawing the image again.

    I noticed that transparent forelayers cause flickering at data refresh, so I stayed with the static form. Transparency can be achieved by using a superimposed image button without any image and its transparent property set to true. Doing so, the bitmap adds a Click event.

    Sure it would be nicer to have gauges in the form of a control, but customization might be difficult then.

    Cheers
     
  7. Cableguy

    Cableguy Expert Licensed User

    I have been looking into gauge alike controls dll's...
    not much to customize....
    minimum value
    max value
    redline start value (if any)
    refresh
    and the default props
    width, height, etc..


    It's the drawing that still puzzles me as I'm not a c# developer in any sort...
     
  8. dzt

    dzt Active Member Licensed User

    Hi Robert,

    Amazing design as always!

    Best Regards
     
  9. agraham

    agraham Expert Licensed User

    That's a very nice looking app. Is that screenshot from a VGA device? If so how do you get B4PPC to work at that resolution?

    EDIT :- Ah sorry. I've looked closer and it seems to be a pixel doubled screenshot of a standard device. Still looks very good though - shows what can be done with a bit of design flair (which I totally lack) on a small device!
     
    Last edited: Oct 24, 2007
  10. dzt

    dzt Active Member Licensed User

    Unfortunately, I totally lack it too :(
     
  11. alfcen

    alfcen Well-Known Member Licensed User

    Gentlemen,

    Just a small 3D bitmap or some shades of color. I have been putting together web sites for years.

    I totally lack of in-depth knowledge of the frameworks, nor do I own ability of constructing DLLs with #Develop. On top of this, I have a talent to introduce new bugs as my senile, rusty brain attempts to add functionality.

    Most of my apps are enhanced by dzt's and Filippo's irreplaceable DLLs.

    In short, I am truly happy to have you at my side :)
     
  12. derez

    derez Expert Licensed User

    Gauges

    Hi
    Until there are controls in the shape of gauges, I used poligons (Erel's suggestion) as demonstrated here:

    .....
    triangle(track,40)
    Form5.FPolygon(alX,0,alY,0,4,Rgb(TRK.R,TRK.G,TRK.B),f)
    Form5.FPolygon(alX,0,alY,0,4,cBlack)
    ....
    Sub Triangle(angle,k)
    angle = angle * cPI / 180
    s = Sin(angle)
    c = Cos(angle)
    alX.Item(0) = center_x + k * s
    alY.Item(0) = center_y - k * c
    alX.Item(1) = center_x + 6 * c + 7 *s
    alY.Item(1) = center_y - 7 * c + 6 * s
    alX.Item(2) = center_x + 10 * s
    alY.Item(2) = center_y - 10 * c
    alX.Item(3) = center_x - 6 * c + 7 * s
    alY.Item(3) = center_y - 7 * c - 6 * s
    End Sub
    .....

    and it is drawn on the background of an image of a map, so an image of the instrument is the same.
     
  13. alfcen

    alfcen Well-Known Member Licensed User

    Very nice, David,

    Your method allows scaling, thick lines, etc. A true alternative.

    A control would require a vector graphic as background image rather than a bitmap to allow virtually limitless scaling of the control's dimensions.
     
  14. agraham

    agraham Expert Licensed User

    Being inspired by seeing alfcens' gauges I've been playing with pictures and polygons to make analogue gauges. To make it easier I've taken derez' code above, added a bit to it and parameterized it to make playing with different pointer shapes easier. Someone might be interested so I've posted it below. You can make a surprising number of different pointer styles by playing with different parameters!
     

    Attached Files:

  15. Erel

    Erel Administrator Staff Member Licensed User

    Looks great!
    You should zip the picture (with the code) as the forum changes its size and causes the large clock to be in a wrong size.
     
  16. alfcen

    alfcen Well-Known Member Licensed User

    That's a gorgeous gauge, agraham. :sign0142:
     
  17. agraham

    agraham Expert Licensed User

    Zipped!
     

    Attached Files:

Loading...