

Rollo62
Members-
Content Count
1984 -
Joined
-
Last visited
-
Days Won
26
Everything posted by Rollo62
-
Is this something that could match your needs? (untested) type QCL_WORD = SmallInt; t_bus_flags_w4 = record private data: QCL_WORD; function GetBit(Index: Integer): Boolean; procedure SetBit(Index: Integer; Value: Boolean); public property AlarmState: Boolean index 0 read GetBit write SetBit; property AlignmentState: Boolean index 1 read GetBit write SetBit; property InversionWait: Boolean index 2 read GetBit write SetBit; property OutOfMinBound: Boolean index 3 read GetBit write SetBit; property OutOfMaxBound: Boolean index 4 read GetBit write SetBit; property BelowSafetyHeight: Boolean index 5 read GetBit write SetBit; property InWorkingPos: Boolean index 6 read GetBit write SetBit; property LockingLatchState: Boolean index 7 read GetBit write SetBit; property BatteryWarning: Boolean index 8 read GetBit write SetBit; property BatteryAlarm: Boolean index 9 read GetBit write SetBit; property EVRState: Boolean index 10 read GetBit write SetBit; property LoadWeightZone: Byte index 11 read GetBit write SetBit; // 2 Bits property ColumnIsConsistent: Boolean index 13 read GetBit write SetBit; property LiftSetAcquireReq: Boolean index 14 read GetBit write SetBit; property MovementModeAbsolute: Boolean index 15 read GetBit write SetBit; end; implementation function t_bus_flags_w4.GetBit(Index: Integer): Boolean; begin Result := (data and (1 shl Index)) <> 0; end; procedure t_bus_flags_w4.SetBit(Index: Integer; Value: Boolean); begin if Value then data := data or (1 shl Index) else data := data and not (1 shl Index); end; // For 2-Bit-Property LoadWeightZone we need some special Getter and Setter function t_bus_flags_w4.GetLoadWeightZone: Byte; begin Result := (data shr 11) and 3; // Extract 2 Bits at Position 11 end; procedure t_bus_flags_w4.SetLoadWeightZone(Value: Byte); begin data := (data and not ($3 shl 11)) or ((Value and $3) shl 11); // Set 2 Bits at Position 11 end;
-
Watch me coding in Delphi on YouTube
Rollo62 replied to silvercoder79's topic in Tips / Blogs / Tutorials / Videos
No nooo, its just like in the Jurassic Park: The strange AI animals can be nice to watch and study, but be very sure to keep the cage door closed -
Maybe you could vote for an extension of @Jim McKeeth nice ColorPicker here.
-
Watch me coding in Delphi on YouTube
Rollo62 replied to silvercoder79's topic in Tips / Blogs / Tutorials / Videos
-
Watch me coding in Delphi on YouTube
Rollo62 replied to silvercoder79's topic in Tips / Blogs / Tutorials / Videos
Yeah, it should look like this, originally. But unfortunately the AI refuses to reproduce logos, socks, styles and so on, in the right way. Nevertheless, I'm sure this is quite the right picture of a messy programmer, at least as I am If anybody will tell you that AI ist not ruling the word yet, this proofs him work. AI already dictates how the the political correct content shall look like and refuses to produce anything else you ask for. -
Watch me coding in Delphi on YouTube
Rollo62 replied to silvercoder79's topic in Tips / Blogs / Tutorials / Videos
b51995d0-8bea-4723-8cf8-ced1a256af59.webp -
iOS: XCode 15: MADDA - Make Delphi Debugging again - after 01.May 2024
Rollo62 replied to Rollo62's topic in Cross-platform
I still have not a smooth workflow under iOS, as before. With the injection of the current lldb SymLink into the PAServer package, I could at least start an app on a device. It behaves as follows: Compile and RunNoDebug - Deploy and Launch after compile - iOS app gets loaded - After deployment, the app tries to start but immediately fails (due to missing debug support) - The app pops up shortly, then crashes immediately - At least I can start the app manually Compile and RunWithDebug - Deploy and Launch after compile - After deployment, the process stucks (due to missing lldb), PaServer messages look as below - The problem is, that the IDE crashes too and must be restarted, same as PaServer. The PaServer process seems to continue even after close. - I used to kill all PaServer processes ( can be more than one ), by shell command, but thats an ugly solution. - I've found a possible solution by PaServer command s ( stop server = kill the process ) and restart PaServer again - But that doesn't prevent the IDE crash. It is really a messy workflow now, if pressing the wrong button it crashes, debugging is no longer possible. XCode_1540, RadStudio 12.1 Upd 1 Does this behave now same on all machines, or is it only here? I really hope for a fix, that bring back normal debugging soon, I hope by patch of IDE & PaServer. Is there anything I still can improve by myself? -
Cross platform color picker and palette library
Rollo62 replied to Jim McKeeth's topic in I made this
Great, nothing is overengineered here at all. I was looking for something like that for a long time, already wanted to design my own, used MustangPeak under VCL in some projects. Color theory is a science on its own. Solving any task completly without leaving out necessary parts in the first place is NOT a definition of Overengineering, IMHO In case of someone is overwhelmend from reality, you could consider to introduce several "dummy-mode levels", to hide any frightening complexity from the more sensitive users. -
Threadvar "per object"
Rollo62 replied to chkaufmann's topic in Algorithms, Data Structures and Class Design
See also here https://www.thedelphigeek.com/2021/02/readers-writ-47358-48721-45511-46172.html -
Variable might not have been initialized
Rollo62 replied to shineworld's topic in Delphi IDE and APIs
Yees, thats a nasty bug. Thats why I had choosen long time ago, to always add a proper scope around even the simplest lines. if FWorkOrderManager.GetWorkOrderDataByIndex(WorkOrdersSelectedRow - 1, Data) then begin // evaluates file index FileIndex := ARow - 1; end; IMHO that increases readability and avoid a lot of such hard to see errors. You're lucky here, that the compiler throwed a warning 🙂 -
iOS: XCode 15: MADDA - Make Delphi Debugging again - after 01.May 2024
Rollo62 replied to Rollo62's topic in Cross-platform
I was trying to find some more insights, since my debugging at XCode 15.4 is currently broken. Here is what I have found so far, perhaps there are more tips to workaround somehow. Due to the fact that it worked for a while at least release & run from the IDE, but now suddenly seems to be broken for no reason, I had to look into this again. My setup: Macbook Intel Macos Sonoma 14.4.1 (23E224) XCode 15.4 (15F31d) - Multiple installations XCode 14.3.1, but the XCode 15.4 is the active selected, by xcode-select - All tools running Delphi RAD Studio 12.1 Patch 1 PAServer 14.1.14.0 Situation: Compile & Linking OK Run & Debug on device: Not OK ( Please do not propose using simulators, I'm looking for a workaround on device level ) XCode 15.4 - Seems to have only Python3.9 shipped within its PackageContent "/Applications/Xcode_1540.app/Contents/Developer/usr/bin" Python3.10 - Has to be installed manually, will land into User folders: /usr/local/bin/python@3.10 and /usr/local/opt/python@3.10/bin - Can be linked by SymLinks to PAServer PAServer - Seems to use Python3.10 internally - Seems to use llvm, lldb internally LLVM ( seems to be required by PAServer - iosinstall) - When installed by bew, it seems to depend on Python3.12, installs Python3.12 too. - Can be linked by SymLinks to be globally available Python3.12 ( seems to be required by llvm ) - Can be linked by SymLinks to be globally available ( but this is maybe the issue in PAServer, linking to Py3.10 and Py3.12 at the same time ) Problem: Signing: Seems OK via PAServer so far Launching: Seems not possible to launch the app via Delphi - Launch by: ""/Applications/PAServer-23.0.app/Contents/MacOS/iosinstall" -W -i bba94cfcbb26d9ff31774ac97d06e929f954993d0 -L -z "/usr/local/bin/lldb" -q -b "/Users/currentuser/PAServer/scratch-dir/currentuser-MB02_Rx1200_Athens/MyApp.app" Deployment - The app can be deleted, this commands seems to deploy and try to run it. - The app runs shortly, then crashes - When running the same, uploaded app manually, by double-click: The add starts and runs fine, only the iosinstall crashes Log and Eventlog - The command above returns like this - The Eventlog looks like this So the root cause seems to be the "iosinstall" command, IMHO. Maybe more specifically the usage of Python3.10 and Python3.12 within the same PAServer package, calling iosinstall and lldb and others. I have tried a few tests and still I'm not really clear why this not simply runs, no matter what Python library involved. Why does XCode 154. only include Python3.12? Why does llvm depends on Python3.12 (there seems no easy way to downfrade this, ate least not with brew and pip3) Is there any known workaround at the time now, what needs to be done? Apple development again causes my days or fumbling, instead of easy click-and-run. Why seems Python stuff so sensitive on versioning, are these known issues? Mybe some Python experts may lead to some easy tools or ideas to solve it. -
Is there a way to check is the "user Idle" (no interaction)
Rollo62 replied to Tommi Prami's topic in Windows API
Just to add some some thoughts on an alternative way, with certain pros and cons. I like to use a simple TDateTime helper in such uncritical situations, instead of GetTickCount, to determine timeouts: function TDateTime_Helper.Timeout_MSec_IsElapsed( const AValue : Integer ) : Boolean; begin if Self.IsNull then Result := False // is stopped => trigger never else Result := Now.MillisecondsBetween( Self ) >= AValue; // is elapsed => trigger conditional end; Cons: - Yes, it has much lower performance, since this has to run through many conversions and calculations. Roughly speaking this is in the microseconds range, while the GetTickCounter may lay in the nanoseconds range ( approx. factor 1000 ). In these cases, where I just need to test this in quite large periods, like > 10 sec., I think this is not a too big deal to loose some microseconds. Pros:< - It adresses timing questions directly, by easier readable millisecond notation and avoids any tick count mis-calculation or logical errors by default. - It avoids possible overflows, which may happen at 32-Bit in about 49.7 days (using GetTickCount64 practically may solve this, by overflow in about after million years). (A consideration to use QueryPerformanceCounter also might solve this overflow, but in 99.99% of the use-case any high precision is not needed.) - It avoids possible counter blocks or counter resets, by always using the real timestamp (of course a user might change the system time, but this is not very likely to be done without a clear user invention). - It avoids issues by non-incremental counting, which is noted in the GetLastInputInfo description already - It elegantly avoids the need to build any additional safety measure around the overflow or incremental issue from above, just to ensure a proper incremental timeline. - It should immediately work in the same way under all platform, because a timeline is a universal feature. (GetTickCount is originally a Windows function, other platforms may handle this completely different) . -
Is there a way to check is the "user Idle" (no interaction)
Rollo62 replied to Tommi Prami's topic in Windows API
Yes, you name it. Thats why I use portable, non-service tools wherever I can, looks like Awake plays in that category too, have not tested yet. I cannot understand this permanent services and processes bloat also, which only brings performance and reliability to the ground level. -
Is there a way to check is the "user Idle" (no interaction)
Rollo62 replied to Tommi Prami's topic in Windows API
Thanks, that "Awake" is a good tip. Usually I use my machines more or less clean and unchanged, like their were intended from their Maker. Mainly because finetuning, optimizing GroupPolicies or the like is a pain in the a** and some permanent gameplay for IT nerds or admins. I usually try to avoid that on all cost, because that is an evergrowing overhead with little benefit, IMHO. -
Is there a way to check is the "user Idle" (no interaction)
Rollo62 replied to Tommi Prami's topic in Windows API
Local, I mean within the app itself. There its quite easy to detect missing keystrokes or mouse moves by slow running timer. So the app could manage an Idle state, similar like banking apps in the browser (log out after 5 min.). Global, I mean, when your app is running, but in background. While another, long running task is in foreground, for example you wat 1h Youtube video in the browser. This means Global is "active" (even if the user is idle), while your local App is Idle. What do you expect to happen in such situation? -
Is there a way to check is the "user Idle" (no interaction)
Rollo62 replied to Tommi Prami's topic in Windows API
Its unclear to me, if you are looking after an application-wide or global detection of user-idle? For the local app, I think its easy, but for the global that can be tricky. How will external, long-running tasks in threads be handled? For example, if you do a longer running FTP-synchronisation, running updates or something like that: Does that mean the user is idle after some time, or not? What often disturbs me is, if the system is heavily running, like updating, giving a powerpoint presentation, but the OS switches unexpectedly to "idle", only because the user is waiting for finishing such a process. This forces me to hit the mouse from time to time, to keep the whole system awake. Maybe to improve to detect such situations above, it would be possible by checking the CPU load additionally and block "idle" mode 🙂 -
Do you mean something like this, for reverse GeoCoding? https://nominatim.openstreetmap.org/search?q="Köln, Heumarkt"&format=json
-
Beside other tools, I like Uwe Raabes Mmx CodeExplorer and here is another nice tool from Alexander Sviridenkov coping with that. Generally, like said before, you could consider to move critical references from the "interface uses" to the "implementation uses", wherever necessary, and to split up classes into interfaces and implementations in separate units.
-
Not sure if you are talking about this item with SnapDragon? https://www.microsoft.com/de-de/surface/devices/surface-pro-11th-edition?ef_id=_k_Cj0KCQjw0ruyBhDuARIsANSZ3wpQRZ2cSDuit-TypUqepPgIc4AE_aMrLZmReQw0Ai2OuQqK-QZQObwaAuOoEALw_wcB_k_&OCID=AIDcmmkg9d0avi_SEM__k_Cj0KCQjw0ruyBhDuARIsANSZ3wpQRZ2cSDuit-TypUqepPgIc4AE_aMrLZmReQw0Ai2OuQqK-QZQObwaAuOoEALw_wcB_k_&gad_source=1&gclid=Cj0KCQjw0ruyBhDuARIsANSZ3wpQRZ2cSDuit-TypUqepPgIc4AE_aMrLZmReQw0Ai2OuQqK-QZQObwaAuOoEALw_wcB#sup3 Which seems officially listed for pre-order on the Microsoft site, perhaps not shipping yet, but at least quite a bit "official". Not sure if these "preorder" prices have large rebates.
-
[Firemonkey ]Change iOS screen rotation at runtime
Rollo62 replied to gioma's topic in Cross-platform
I can conform Daves code too, works well here also 👍. What I've implemented in the former manual approach, was a system that shows a message and listens to the user turning the screen into the right position, handled by anonymous method. My goal was to distract the user as little as possible from his normal workflow, not enforcing him to press and buttons. class procedure TCore_Orientation.SetCurrent( const AOrientNew : TScreenOrientation; const AOrientPossible : TScreenOrientations; const ANotifyWhenReady : TProc ); begin // Use an anonymous method, to notify the change to the caller FNotifyWhenReady := ANotifyWhenReady; // Do whatever is necessary, either direct or after users message. // Register my ApplicationEvent handler, that listens to the change has occured, if that is necessary end; ... // How to use it in the caller TCore_Orientation.SetCurrent( TScreenOrientation.Portrait, // Desired orientation [ TScreenOrientation.Portrait, // Possible orientations allowed TScreenOrientation.InvertedPortrait ], procedure // Wait until User turned it as desired, or after it was set by hardware. Never reach this when cancelled. begin // Do whatever you wanted to do, after desired orientation is finally set up (triggered by ApplicationEvent or direct) end ); ... end;- 10 replies
-
- ios 13
- firemonkey
-
(and 1 more)
Tagged with:
-
I would suggest not to use those second layer functions at all, but to use TEncoding for this task: Result := TEncoding.Default.GetBytes(Val); It seems that all relevant of those overloaded functions use the same TEnconding function internally and the rest of the overloaded functions are only for some special cases.
-
Delphi 12 - PAClient Error - Locating Simulator Error when Delploying
Rollo62 replied to Shano's topic in Cross-platform
I just have seen an even weirder situation. I already used XCode 15.3 with iOS 17.4 before, have installed the iOS 17.4 SDK in D12.1. Last week I happily compiled and debugged on my iOS 16.7.7 device. This morning, I've got the same message above and the platforms settings looks like this: It seems that XCode had un-installed the iOS 17.4 device support suddenly, over the weekend. Is this something that can happen, without touching the system (not even reboot over the weekend), or do I have any delusions? After pressing the GET iOS device, it also downloads the simulator Whow, a lot of Apple-Magic involved, Apple is so much better than Windows -
Im afraid so too ... https://en.delphipraxis.net/topic/11463-ios-xcode-15-madda-make-delphi-debugging-again-after-01may-2024/?tab=comments#comment-90929
-
Oh yes, of course. I had skimmed the title too quickly, normally terms like TTS, TextToSpeech, SAPI, SpeechToText trigger me in the right direction. Maybe this will be helpful "https://learn.microsoft.com/de-de/windows/apps/develop/speech" and an older article with Rx1.4.2 sources by Brian Long "http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm"