Jump to content

JackT

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

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

  1. JackT

    Firemonkey 3D vertex and fragment shading

    I have a grid of 64 sensors that are measuring magnetic fields in the range 0 to 150 Hz. The grid is non rectelinear. The idea was to build a mesh in the shape of the grid and then use a shader to set positive values red and negative values blue in real time. So all I really need to do is to pass a float in along with each vertex. I have started learning high level shader language to try to accomplish this. Best Regards, Jack T
  2. JackT

    Firemonkey 3D vertex and fragment shading

    Thanks for the reply. That code looks like the kind of think I need to do. So as you said there don't seem to be any built in materials or shaders in firemonkey that are set up to do this. I found an article that goes through the steps you need to create custom TMaterial and shaders so you are right it looks like I can have a go at coding it myself. https://blog.grijjy.com/2021/01/14/shader-programming/ I will give it a go and report back.
  3. I wish to use some thing like a TMesh component and be able to assign a color value dynamically to each vertex for the purpose of producing a color map for data cluster visualisation. Is there an easy way to do this in firemonkey ? Thanks for any help in advance. Jack T
  4. Hi I found a solution on stack overflow. https://stackoverflow.com/questions/3671042/mask-password-input-in-a-console-app I improved the function so it deletes it's input if you back space function GetPassword(const InputMask: Char = '*'): string; var OldMode: Cardinal; c: char; I,L:Integer; begin GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), OldMode); SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), OldMode and not (ENABLE_LINE_INPUT or ENABLE_ECHO_INPUT)); I:=0; try while not Eof do begin Read(c); if c = #8 then begin L:=Length(Result); if L>0 then begin Write(#8' '#8); Result := LeftStr(Result,L-1); continue; end; end else if C=#13 then begin break; end else begin Result := Result + C; Write(InputMask); end; end; finally SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), OldMode); end; end;
  5. I am trying to hide console input when a user has to enter a password in a command prompt window. I had the bright idea of redirecting the output of the command prompt to the NUL file but this code does not work even though you can execute the function without error. I am sure there used to be an easy way to do this! Do forget to include windows in the uses clause. Thanks for any help in advance Jack T function GetPassWordInput:String; var C:Char; S:String; H,HNULL:Cardinal; B:BOOL; begin HNULL := CreateFile('NUL',GENERIC_WRITE,FILE_SHARE_WRITE,nil, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM,0); Assert(HNULL <> 0,'CREATING NUL FILE FAILED'); H:= GetStdHandle(STD_OUTPUT_HANDLE); B:=SetStdHandle(STD_OUTPUT_HANDLE,HNULL); Assert(B,'Set standhard handle failed to assign HNULL'); try begin repeat Read(C); if C=#8 then begin if Length(S)>1 then begin S:=LeftStr(S,Length(S)-1); end; end else if C<>#13 then begin S:=S+C; end; until C=#13; end finally begin SetStdHandle(STD_OUTPUT_HANDLE,H); CloseHandle(HNULL); end; end; Result := S; end;
  6. JackT

    List Of Property Editors

    Thanks that was helpful.
  7. JackT

    List Of Property Editors

    I have been looking for a list of existing property editor classes supported in FireMonkey. I am specifically looking for the property editor that generates the combobox of styles using the StyleLook up property in the ObjectInspector. I don't know where the property editor for StylelLook up is registered ? I wish to use the property editor with my own components with one or more style settings. Thanks for any help in advance.
  8. JackT

    Bug TDialogService.MessageDialog on Windows

    I solved the problem by writing my own implementation of IFMXDialogServiceAsync and IFMXDialogService for windows.
  9. function FMXMessageDialog(const AMessage: string; const ADialogType: TMsgDlgType; const AButtons: TMsgDlgButtons; const ADefaultButton: TMsgDlgBtn): Integer; var mr: TModalResult; begin mr:=mrNone; // standart call with callback anonimous method TDialogService.MessageDialog(AMessage, ADialogType, AButtons, ADefaultButton, 0, procedure (const AResult: TModalResult) begin mr:=AResult end); while mr = mrNone do // wait for modal result Application.ProcessMessages; Result:=mr; end; The code works fine. However depending on which monitor the dialog spawns on, on my system the text is clipped. Dragging the dialog back to monitor 1 from monitor 2 makes the dialog draw correctly. Delphi Alex 11.3. The scale on monitor 1 is 150% and and on monitor 2 it's 100%.
  10. JackT

    Format text in TSpinBox

    Thanks for the reply. Unfortunately I forgot to mention I am developing a Firemonkey application so TNumberBox has a different implementation to the VCL component with the same name, although I did post the question in the FMX group.
  11. JackT

    Format text in TSpinBox

    Is there an easy way to change the formatting of the text in a TSpinBox ? I would like my TSpinBox to display a number with a leading 0 for a 24 hour clock format So instead of showing 9 it would show 09 as in "zero nine hundred hours". I am aware there is a TTimeEdit, but it puts it's spinner in an up down configuration not it in a side to side configuration like the TSpinBox. I am using TSpinBox to set YEAR - MONTH - DAY so I would like everything to look the same,
  12. I am writing a program that process data from 196+ channels in real time. I will have to employ digital filter(s) of one sort or another on all 196+ channels simultaneously. It occurred to me that a digital signal processing pipeline on a GPU would be an ideal solution. The data is sampled at 1200 Hz. My question is - Is there a parallel digital signal processing pipeline library for Delphi or C++ builder out there that takes advantage of GPU architecture ? If there is no such library should I code one using NVIDA's CUDA or AMD ROCm ?
  13. Thanks for the advice - much appreciated. I think I just assumed that the pointer for interfaces were going to be the same sorts in Delphi.
  14. Thanks Remy, Thanks for taking the time to reply to my questions. I haven't done a lot of C++ Builder programming so I didn't realise I had to use smart pointers for interfaces and I didn't know I wasn't supposed to throw New exception objects. I actually switched out my code to use the microsoft xmllite library in the mean time, but at least in the future I will know how to properly handle interfaces in C++ builder. I still have a few grey areas how memory clean up happens in C++ Builder such as should I be setting dynamic arrays to NULL to destroy them or does the C++ Compiler handle it. For example will WSA get destroyed correctly when it goes out of scope or do I need to do something else ? typedef DynamicArray<WideString> DynArrayWideString; DynArrayWideString WSA; WSA.Length = 4; WSA[0] = "A STRING"; WSA[1] = "ANOTHER STRING"; WSA[2] = "STRING 3"; WSA[3] = "END OF LIST";
  15. I'm generally having problems using VCL objects in a Win32 C++ Builder command line programs. I am also having trouble with TXMLDocument and IXMLNODE. I can use TXMLDocument in a VCL builder application and Delphi without a problem but as soon as I try to use it in a C++ Builder command line program I get silent failures THIS CODE IN IT'S OWN THREAD CRASHES TXMLDocument * pMEGConfig = NULL; TDOMVendor *vendor; if(CoInitializeEx(0,COINIT_SPEED_OVER_MEMORY) != S_OK) { return; } pMEGConfig = new TXMLDocument(NULL); vendor = DOMVendors->Find("MSXML"); if( vendor == NULL) { throw new Exception("vendor MSXML XML wasn't found'"); } if(pMEGConfig->Active) { pMEGConfig->Active = false; } pMEGConfig->DOMVendor = vendor; pMEGConfig->LoadFromFile("An XML FILE"); pMEGConfig->Active = true; IXMLNode * ROOT = pMEGConfig->DocumentElement; //THIS LINE CAUSE THE THREAD AND DEBUGGER TO EXIT IMMEDIAETLY AND SILENTLY I am assuming I am some how not linking to the correct lib files and or my compiler / linker settings are wrong
×