We kick of the New Year with the first of “How it works with Holger” for 2022 and this first one this year is about using base64 encoded data.With REST APIs, JSON data, web client apps, string encoded binary data in URLs… ever more prominent in software developments, the use of base64 encoded data is everywhere. So, our colleague Dr. Holger Flick explains how you can use base64 encoded data with newer versions of Delphi out of the box and how the TMS FNC Utility library in TMS FNC Core goes a step beyond to make your life easier. Enjoy this first video of the year and watch for many more to come: Your idea could be on the next “How it works with Holger”! Submit your ideas here as comments or send us an email. Our list of subjects is growing. Your suggestion could be on it soon.
Just before the year closes, we’d like to share a new episode in the “How it works” series with Holger Flick. This series is created to show you how you can do more with Delphi and TMS components. First Holger introduces two new exciting components added to the TMS FNC WX Pack: the barcode and the QR code decoder components: and of course, the “How it works” video explains in detail how you can create a Delphi application that uses the QR code decoder component and use it to extract information from a QR code image file: TMS FNC WX Pack The TMS FNC WX Pack is all about leveraging existing, reliable, proven web technology in any type of Delphi app, be it a Windows VCL app, a cross-platform FireMonkey app or a TMS WEB Core web client application. It already comes with a HTML editor, a PDF viewer, an OCR component, a JSON formatter and a barcode or QR code generator. In our lab, the next series of breathtaking components are already in development that will join the TMS FNC WX Pack family in 2022! Watch the TMS FNC WX Pack introduction video again for more info. Learn more! Like to learn more about Delphi and TMS components? Consider also the books our colleague Holger Flick wrote for you. Get all the in-depth content on how to get more out of Delphi with TMS components while reading at your own pace. We made a convenient list of the books here from where you can add it to your basket in one-click. Be in touch! 2022 is nearby. Our team is extremely motivated to surprise you once more in the New Year with many exciting new developments. Let us know your wishes for 2022. We are eager to learn what you would like to see us doing in the New Year!
In this article, we’ll show how to implement curve fitting with FNC math components presented in version 3.2 of TMS Analytics & Physics library, most importantly, with little to no code! Curve fitting (approximation) is a mathematical method of finding a math expression (function) that fits best to some discrete data (series of points). Commonly, we need the following three ingredients to implement the curve fitting: Discrete data (a series of points) to fit. A set of functions (basis functions) to construct the curve. A method of solving the fitting problem (optimization algorithm). Let’s go through the FNC components for these three elements. The first component is TFNCDataSource1D. The component provides data for curve fitting and has the following published properties: Data (TDataCollection1D) – a collection of points. Each collection item has two properties of real type: ‘V’ – the value of the variable; ‘F’ – the value of the function. DataCount (integer) – the number of points in the collection (read-only). With standard Delphi IDE tools for collection editing, we can add and delete points, edit values of the points in design time. There is a binding component to show the data on an FNC chart – TFNCData1DPlotter. It has two primary published properties: Data (TFNCDataSource1D) – a data source to show on the chart. Chart – a chart to show the data. When assigning an FNC chart to the Chart property in design time, the plotter component creates a series for the chart. You can tune the series’ properties to get the appropriate data representation. In the picture below, we showed an example of data, drawn with the data plotter. The second ingredient for curve fitting is the set of basis functions. We’ll use the TFNCLinearConstructedBasis1D component. This component provides the easiest way to get a set of functions for constructing the fitted curve. The main published properties of the component are the following Variable (TVariableProperty) – provides the name of the variable for the basis functions. Coefficient (TVariableProperty) – provides the name of the coefficient for the fitting problem. Kind (TBasisKind) – the type of predefined basis functions. Order (integer) – number of basis functions for approximation. Expression (string) – read-only math expression of the constructed function. Parameter (TParameterCollection) – a set of parameter values for parametric basis functions. With the Kind property, you can select the appropriate basis functions for building the fitted curve: polynomials, Taylor series, exponents, Fourier series, exponential functions. The Order property sets up the number of basis functions to build the curve. Here is an example of the component’s properties, shown in the Object Inspector. The last component we need to complete curve fitting is TFNCApproxFunction1D. This component joins a data source with a basis and implements the least-squares approximation algorithm. It has the following published properties: DataSource (TFNCDataSource1D) – a data source for approximation. Basis (TFNCBasis1D) – a basis for approximation. Formula (TBaseFormulaProperty) – read-only formula of the curve. Expression (string) – read-only math expression of the fitted curve. When you assign the data source and the basis properties, the component runs the approximation algorithm and evaluates the formula and the expression properties, as shown in the picture below. The TFNCApproxFunction1D is a descendant of the TFNCBaseFunction1D component. So, you can draw the curve on an FNC chart as described in […]
Intro FNC was born in 2016 and with it, a lot of great opportunities and ideas. We started with TMS FNC Chart, followed by TMS FNC UI Pack only 4 months later! The typical components such as a grid, treeview, planner and many more are included as you would expect in a UI component set. In April 2020, with TMS FNC Maps, we introduced a brand new way to add and work with mapping/routing services in your application. Today we have a wide variety of visual and non-visual components and libraries to enhance your application. The latest addition to the FNC family, named TMS FNC WX Pack, provides access to a whole new world of JavaScript/HTML based libraries and components to Delphi. All of this would not be possible without a solid foundation, a component structure that is reliable as well as extensible. Solid Structure The architecture needed to be solid, robust as well as extensible. Our initial idea was to create a base component for each product separately, but not long after, we abandoned the idea and immediately thought out of the box and created TMS FNC Core. TMS FNC Core was the foundation we created starting with a custom control class and some utility functions. Over the years TMS FNC Core grew into a versatile base foundation for creating cross-platform and cross-framework custom controls. This includes VCL, FMX, LCL and WEB frameworks. Today we focus on a showcasing TMS FNC Core for VCL. Working on FNC components and the TMS FNC Core foundation on a daily basis and looking back at beginning made us realize that TMS FNC Core is much more than just a foundation. It’s actually capable of doing powerful things with little to no code. The following example demonstrates what TMS FNC Core alone is capable of. No need to install additional components, just download, install TMS FNC Core, plugin the code and experience the true power of FNC. Merry Christmas Out of all the features TMS FNC Core has to offer, we picked a couple of important ones: PDF export, SVG and asynchronous file download support. The code snippet below shows how to download an SVG, export it to PDF. Not more than 25 lines of code went into this sample, with a very nice and warm result, especially during this time of the year! uses VCL.TMSFNCCloudBase, VCL.TMSFNCTypes, VCL.TMSFNCPDFLib, VCL.TMSFNCGraphicsTypes; procedure TChristmasForm.GenerateChristmasWishes; begin TTMSFNCCloudBase.DownloadFileFromURL(‘https://tmssoftware.com/site/img/merry%20christmas.svg’, procedure(const ARequestResult: TTMSFNCCloudBaseRequestResult) var b: TTMSFNCBitmap; p: TTMSFNCPDFLib; begin p := TTMSFNCPDFLib.Create; b := TTMSFNCBitmap.CreateFromStream(ARequestResult.ResultStream); try p.HeaderSize := 100; p.HeaderFont.Size := 24; p.HeaderFont.Style := [TFontStyle.fsBold]; p.HeaderFont.Name := ‘Lucida Handwriting’; p.HeaderFont.Color := MakeGraphicsColor(156, 41, 41); p.Header := ‘tmssoftware.com wishes you a’; p.Footer := ”; p.BeginDocument(‘Christmas.pdf’); p.NewPage; p.Graphics.DrawImage(b, p.MediaBox); p.EndDocument(True); finally b.Free; p.Free; end; end); end; Download TMS FNC Core today, explore the capabilities!. Found something yourself that’s worth sharing? Please let us know, we are excited to find out what you have created, in which way you are using FNC. TMS and FNC wishes you all the best and a merry Christmas!
In version 3.2 of the TMS Analytics & Physics library, we’ve introduced new FNC Math components. The components allow easy development of math applications with all the advantages of the Delphi IDE. The base concepts of the math components have been described in the previous article. In this article, we’ll introduce several advanced components for designing more complicated math applications. With the base components TFNCFunction1D, TFNCDerivative1D, and TFNCIntegral1D we can evaluate functions, derivatives, and integrals of math expressions. Let’s consider the following component: TFNCFunctionDerivative1D – introduces a symbolic derivative of an FNC function; allows evaluating the derivative for the specified variable value. The component provides the following published properties: Variable (TVariableProperty) – a variable specifying the argument of the function. D (TVariableProperty) – a variable specifying the differential. Functional (TFNCBaseFunction1D) – a differentiable FNC function. Formula (TFormulaProperty) – read-only formula denoting the resulting math expression of the derivative. As one can see, this component is like the TFNCDerivative1D, but the Functional property now is of TFNCBaseFunction1D type. This means that we can assign any appropriate function to the property. The component will trace the functional’s change and re-evaluate the derivative automatically. Let’s start developing an advanced FNC math application. Put a TFNCProvider on the form and create three parameters ‘A’, ‘B’, and ‘L’. Add new TFNCFunction1D and TFNCFunctionDerivative1D components. Assign required properties to the function as described in this article. Add an FNC Chart and two plotters for both components (the function and the derivative). Then connect the derivative component with the function, assigning its Functional property. Finally, input a simple math expression, say ‘5*sin(x)’, into the Formula property of the function. Our math application at the design time is shown in the picture below: Then we can add a text box, allowing the user to input a math expression, and a button with the following simple event handler: procedure TForm1.Button1Click(Sender: TObject);var f: string;begin f:= Edit1.Text; FNCFunction1D1.Formula.Formula:= f;end; The developed application provides functionality for drawing a user-defined function and its derivative on one chart. An example of the running application is shown in the following picture: Note that we created only one button with the event handler which assigns the formula to the function. When the formula is changed, the derivative is re-evaluated and the chart is updated automatically. Let’s move on and modify the application to evaluate also the second derivative of the function. It is possible due to the special structure of the FNC math components. As the TFNCFunctionDerivative1D class is a descendent of the TFNCBaseFunction1D, the derivative is considered to be an FNC function. Thus, we can just evaluate a derivative of any other derivative and get the second-order derivative of a function. Putting a new TFNCFunctionDerivative1D component (together with a plotter for the FNC chart) and assigning the functional property to the first derivative component, we get the fully functional application: Finally, let’s consider the TFNCFunctionIntegral1D component. It has the same properties as the TFNCFunctionDerivative1D class, but it evaluates the indefinite integral of a function. Now we can create a single application that provides the evaluation of a user-defined function, its derivatives of the first and the second order, and its integral. The source code of the demo project for the article can be downloaded from here. To develop your own FNC math application […]
Time flies and we are yet again at the end of the year. With the holidays coming up we thought it would be exciting to put our Miletus technology to the test and see what we can achieve in combination with a Raspberry Pi 4. Christmas is just around the corner so why not have a Christmas tree on a screen with some snowflakes and Jingle Bells playing in the background? Preparation With the plan set we need something to show the Christmas tree on. The screen of our choice is an Adafruit PiTFT Plus 320×240 2.8″ TFT. In theory any ILI9431 display should work with this project if it is correctly hooked up to the Raspberry Pi. We also need a Christmas tree. If we carefully examine the available specification, datasheet and a Python library provided by Adafruit, we can learn that the pixel format is set to 16 bit. This means each pixel’s color is stored in an RGB565 format. With our Christmas tree image converted and stored in a binary file we are ready to get started! With respect to software needed to create the project, all we need here is the latest TMS WEB Core v1.9.6.0 release. Let’s get coding First let’s make the SPI connection. Drop the TMiletusRaspberrySPI component onto the form and leave the default settings. In the form’s OnCreate event set the TMiletusRaspberrySPI.Frequency property (= SPI clock frequency) to 16 MHz. This determines how fast the data can be written, which is important if we want to show a 150 kB image at a reasonable speed. Then open the connection: procedure TForm1.MiletusFormCreate(Sender: TObject); begin MiletusRaspberrySPI1.Frequency := 16000000; MiletusRaspberrySPI1.Open; end; Next is screen initialization. We can do this as soon as the SPI connection is ready. By using the TMiletusRaspberrySPI.OnOpen event we can initialize the screen, load the image and after that draw the snowflakes. By using async methods and functions we can wait for each of step to finish before moving onto the next one. procedure TForm1.MiletusRaspberrySPI1Open(Sender: TObject); begin Await(JSValue, InitScreen); Await(JSValue, LoadChristmasTree); StartSnowing; end; InitScreen is sending a number of command and data combinations through SPI to the screen so it can be set up with the correct settings. It is based on values from the datasheet and the example library. For further information on these values please study the linked sources. LoadChristmasTree is responsible for loading the Christmas tree onto the screen. While it is possible to embed the binary image as part of the executable, there are a few reasons against it: First of all, it doesn’t make sense to send the whole image to the web application and from there back to the native shell application. Sending 150 Kb of data between these 2 layers on a small device like a Raspberry Pi can be time consuming. Besides, by making it available as a file it gives the flexibility to change it to a different Christmas tree without modifying or recompiling the application! function TForm1.LoadChristmasTree: TJSPromise; begin Await(Boolean, TMiletusRaspberryMemoryBuffer.LoadFromFile(‘./xmastree.bin’)); Await(JSValue, Block(0, 0, 239, 319, [])); Await(Integer, GPIOWrite(GPIO_DC_PIN, 1)); Await(Boolean, MiletusRaspberrySPI1.WriteMemBuffer); Result := EmptyPromise; end; We added a new class called TMiletusRaspberryMemoryBuffer in TMS WEB Core v1.9.6.0. This makes it possible to load a file directly from the local file system (or […]
Perhaps this is our product that suits and targets students & teachers best and finally it is available now as a free edition for students & teachers. TMS Analytics helps students by providing a library to easily evaluate mathematical expressions, calculate symbolic derivatives & integration, solving non linear equations, approximation function calculation and more… This library is fully cross-platform, so it can be used in VCL Windows applications as well as FireMonkey applications for Windows, macOS, Linux, Android & iOS. We encourage and hope that students will discover & learn to appreciate Delphi even more when having TMS Analytics in their arsenal of tools. While you are visiting our academic offerings, check also following products available free for students & teachers: TMS VCL UI Pack: extensive UI controls library for VCL Windows applications TMS WEB Core: Object Pascal RAD component based web client development TMS FNC UI Pack: extensive UI controls library for both VCL Windows applications & FireMonkey cross-platform applications TMS Aurelius: ORM framework for Delphi with full support for data manipulation, complex and advanced queries, inheritance, polymorphism, and more TMS Flexcel for VCL/FMX: Powerful, extensive & flexible component suite for native Excel report & file generation & manipulation Also in the coming year 2022, we want to extend our academic offerings! Let us know what products you look forward to the most to join the TMS Academic family. Our team is listening!
With this blog we want to announce our new series of ‘How To” videos, presented by our colleague Holger Flick. In these video series you will learn how you can achieve basic interesting functionality with little to no code! Most of the time developers are blocked in a major project, just because of a little piece of information that is missing! This can be a common problem that keeps happening. That is why FlixEngineering and tmssoftware.com will work together to provide you hands-on solutions by explaining this step by step. Unlike other videos these series will not solve complex problems, here we will focus on simple “how to” questions! Subscribe to our YouTube channel and stay tuned for our first “How it works” video: Happy Holidays!
High DPI In this update of the TMS FNC UI Pack the main focus was the implementation of high DPI in our controls. Some components already had high DPI support since the previous update. Now all of our components are scaled to the monitor and have clear lines and fonts. This is implemented in design-time for Delphi 11 and in run-time from 10.3 onwards due to the integrated support. Design-Time Editors Introduced in the previous update are the improved editors which have an adjustable theme, high DPI support and available in Delphi and TMS WEB Core for Visual Studio Code. Planner Mode Editor A new addition to the editors is the TMS FNC Planner Mode Editor, which is now registered in design-time. It is possible to configure the mode and the different positions and resources of the planner. The editor is accessible via the mode property or by the configure option in the context menu via the right-click. This update also addresses different fixes and some smaller new features to the product which can be found in the release notes.
On 18 December in Osaka, Japan, there is an event for Japanese Delphi developers interested in using TMS WEB Core and creating REST APIs for use from a TMS WEB Core web client application. The event is offered as a hands-on event, where Delphi developers can bring their laptop and work on projects with TMS WEB Core shown during the event and create REST APIs to be used by the web client app. Some more background information about the organizer of the event and the experience with TMS WEB Core and REST API backends can be found here. It is of course a great opportunity to meet fellow Delphi & TMS WEB Core developers and exchange tips & tricks among each other. We kindly invite everyone to this upcoming event! Event information and registration is available here: https://ishuprog.connpass.com/event/233617/ TMS customers in Japan will receive an email with information for free entry for this event!
Invormațiile pe cale Dvs le introduceți în prezentul formular nu se păstrează online, dar se vor transmite direct la destinație. Mai multe informații găsiți în Politica Noastră de Confidentialitate
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.