Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ptlycldy

    TTextAlign problems in TEdit in FMX

    I'm new to FMX (VCL is easier) but I've encountered a problem and all the Embarcadero wiki's don't seem to help. I have a FMX TEdit box with text. I can position the text to "Center" in the box at design time by going to TextSettings->HorzAlign->Center in the object inspector and all goes well. It compiles. But I would like to change the alignment at runtime in the code when a button is clicked. The code I use is : Edit1->TextSettings->HorzAlign = Leading ; //Leading means left justified and the error message on compiling is: use of undeclared identifier 'Leading' I have included the file FMX.Types.hpp which should (does: I checked) tell the compiler about Leading. Where Leading is given as "enum class DECLSPEC_DENUM TTextAlign : unsigned int { Center, Leading, Trailing }; " in the embarcadero wiki at FMX.Types.TTextAlign - RAD Studio API Documentation (embarcadero.com) (Sorry folks-- I'm a C++ guy but this should be the same problem for you Delphi folks as well) So I added the code: unsigned int Center, Leading, Trailing; Center = 0; Leading = 1; Trailing = 2; And get error: cannot initialize a parameter of type 'FMX::Types::TTexAlign' with an lvalue of type 'unsigned int' What am I doing wrong? But more important, how can I get the Edit box to change alignment during runtime? Thanks for your ideas. Ptlycldy
  2. ptlycldy

    Hoiw to visualize GRIB2 Files

    The GRIB2 data is highly compressed data that effectively is a giant matrix. GRIB2 is a compression format just like *.ZIP or *.TAR files are compressed files. GRIB2 files are massive files and are compressed to make transmission faster. There are decompression programs that you can find free on the internet that will read them and create a gridded data file (matrix is a better description.) And I'd suggest using those programs to extract the data rather than writing your own. The next step is to select what data you wish to plot. For example, the GFS model covers the entire world, and I believe the spacing is a value every one degree of lat and Long. That is 129,699 values for every parameter, for every level -- surface to 10mb -- for every time period for 16 days. To plot a map, you have to go into this immense file and pick out those points that you want to display on the projected area of the map. To complicate it, some values are actually pairs of data, one on one grid, and one on another. Wind data is one such set. To evaluate the wind at one point, you have to get the correct value from the correct point in two 129,699 point grids. Finally, once you have your array of data that you want to plot, you have to plot it on to a map projection. Unless you commit to using a simple Mercator projection, and your background bitmap is also a measurable Mercator projection, Overlaying the weather data onto an existing map on the screen will not be trivial either. If you can find out exactly what projection your bitmap image was created with, you job will be much easier. Without that, I would recommend you create your own background map in a projection that you have the equations for and like. Then comes the job of converting every data point (lat/long) into the X/Y coordinates of the screen. This is all do-able--I've done it for creating trajectory forecasts for objects at about 100,000 ft ASL. Just want to let you know that this is not a "beginner's" project and it will take a lot of time. In another post, you were asking about plotting fronts and pressure centers on a bitmap image. I'd suggest knocking that project out first. That has all the challenges of putting data out onto a map projection, but using simplified data values: lat/long points for fronts, and a couple of numerical values for the Highs and Lows. The advantage of doing that smaller project is I think those weather messages come out 4 times a day (or at least twice a day) and you can go on-line to check your plot against the "official" plot presumably where NWS took the data from. Just be sure to check the product issue dates and times--that you don't have an outdated map to compare against. It is essential that you always verify that you are plotting is what you think you are plotting. That the data are in the right place and have the correct values. Good luck on this project. Creating the program to plot fronts from the text message is a good one, and it will give you a working sub-routine that you can fold into later software you develop that also plots data onto maps. Handy to keep in your bag of tricks. Once you get the method of plotting data onto map projections down, then you might try getting into working with the GRIB2 data. Be sure you are solid on pointers and seek() commands, etc. Have fun, and let me know when you get results. Love to see them. ptlycldy
  3. ptlycldy

    TRichEdit equivalent in FMX?

    Thanks for the tip. Looks like great software, but my application is just for my wife and myself. (I'm long retired and it is out of my price range now.)
  4. ptlycldy

    How to display weather data onto a sphere

    I don't know what data you are trying to plot, but wind data from the NWS or other sources are in two formats: direction/speed or north component of speed/east component of speed. Gridded data is usually in the latter format. In the direction/speed format, the direction is that FROM which the wind is blowing. That is a reported 315/21 means that if you face towards the Northwest, the wind will hit you in the face, so your plotted vector would be to the southeast (or if you are using the meteorologists' wind barb depiction, the "arrow" would be coming from the NW.) But I would, in your code, first align your wind indicator to your geographical location. That is make your arrow, say 10 miles long if that fits your scale; then taking the lat/long of the location, figure the lat/long you would be at if you went with the wind 10 miles and figure that lat/long. Save all these wind arrow start and end point pairs. And when it comes time to convert your background map to the projection on the flat screen of the display, fold in the wind data using the same equations. Step by step it sounds lengthy, but computers are fast. Good luck. ptlycldy
  5. ptlycldy

    How can i project fronts and pressure centers onto my sphere

    Hi LinuxUser1234-- I don't know if your end image is a sphere or just a map projection like you show in your question. As you know, the text is nothing but latitudes and Longitudes. But your map/sphere is going to be displayed on a flat screen. There are several good books on map projections and the math to convert positions onto these projections and then to a flat screen. My favorite is "An Album of Map Projections--U.S. Geological Survey Professional Paper 1453" printed by the Government Printing Office in 1989. Unless you know the exact projection you are using for your bitmap's image, it is going to be hard to back out what set of equations to use. Do you know who produced the bitmap? Perhaps ask them what projection they used. The National Weather Service uses fairly fixed projections. Hope this helps and good luck. Ptlycldy
  6. ptlycldy

    Hoiw to visualize GRIB2 Files

    Are you trying to decode GRIB2 files, or display the point data of decoded GRIB2 files? ptlycldy
  7. ptlycldy

    TRichEdit equivalent in FMX?

    I am trying to convert an old Windows program into Android. When I built the Win program it was all VCL and TRichEdit allowed you to edit a line at a time. I now am using a CE edition and can't find anything that might let me do that in FMX for Android. Does anyone have any suggestions? The application is for an aid in decrypting those "Cryptoquote" puzzles found in newspapers, so maintaining the sentence/line-of-text structure is important. Thanks for your ideas. Ptlycldy