CompCreator - DynamicComponents compatibility

I just recreated the one-month fight named... When "what you see is not what you get"!

DragAndDropDynComp1.aia (102.0 KB)

Error...

On the error image appears the arrangement between ["xxxxxxxxxxxxxx@nnnnn"], in the last image, from Companion in Label2 appears a clean arrangement xxxxxxxxxxx@nnnnn

Why? What is that? With the inactive blocks (bottom-right) I try to "clean", to double "clean"... nothing!!!

With this, I fight a month (I learned a lot in that month). After a month of unsuccessful trying I made the above big blocks image that works like a charm. But... It was needed to make another global variable, compare the content of what came from tagData with that global variable, and select from that global variable the index, that is contained in tagData... Complicated... even for me.

if you want to change a component to a string, you will get a string like packages plus random text like. you can consider it's as the id of the component. it's unique.

but you can not convert this id string back to a component.

With that component/string, I fought a month to find a solution with 647 blocks... As you say... I think very complicated... but yesterday, I was just furious and I found another solution with only 159 blocks!!! But... with Dynamic Components. As dynamic components don't know to show a .Parent of a component (or I don't see it), my goal for today is to use the CompCreator with the same technique.

BTW can you/want/have time to make an extension like "DragAndDrop" with an added function?! a function that gives a component when is caught to be dragged, before the drag.complete (get the component name that is in the "air")?

ok cut the long story short, please describe what you want to achieve with presice words with drag and drop.

when catching a component/arrangement for Dragging, before Drop, when are "in the air" know the name of the arrangement/component to deregister from drop, to not drop on himself and crash the companion.

Something like this

WhatsApp Image 2024-05-24 at 13.00.47_8230d67b

This doesn't happen in @Ken's demo aia.

What are you doing differently that makes the companion crash ?

Create a "really simple" aia project example that replicates the behaviour you are getting.

I push the limits of DragAndDrop extension beyond Ken's demo .aia.

Please just run this .aia. Moove an arrangement about 10 px and let it drop on itself. This action will crash the companion. As I register the same arrangement for drop and for drag when I work on a real device and I lose an arrangement from drag, that arrangement drops on itself and crashes the companion.

please

Simplified version of above .aia. This is the final version for me as DragAndDrop that I will use on my app. Need more things in the future, but it just works perfectly with only 169 blocks. The only bug is that crash when an arrangement drops on itself.

DragAndDropDynCompLast.aia (101.5 KB)

Thank you Tim.

PS - Catch and drag arrangements on the big rectangle, you can move an arrangement on another arrangement, or you can delete an arrangement by moving it on the bottom-right small square.

Above you have an example.

Thank you.

@TIMAI2 Just imagine the potential of that approach only for the open-source communities, like Arduino World (I don't speak about industrial automation potential...). To have the possibility to drag and drop gauges, sliders, sensors, LED's, esp32, and so on... Just push a button and connect them all.

This kind of approach can open a new window on the "big screen community". Real estate, architecture, maps... You name it. But for that, a DragAndDrop extension is needed that doesn't crash.

In fact, the compatibility between DragAndDrop, CompCreator, and DynamicComponents, from my tests, is the key (as doesn't exist an extension that does alone, all that).

Not crashing for me

a quick demo

and is the same on two tablets and the 27" 4K chrome box, compiled as apk included crash.

Probably it helps to use logcat to find out more about that crash....

Taifun

I'm 100% sure that DragAndDrop creates a "paradox" when wants to drop on himself, it is a bug of it. Ken omitted to include a condition to prevent this behavior (almost sure then don't think at the possibility that somebody will use that extension for that purpose.). It is a great pity that it has this bug because it is the only extension that can "slide" when dropped.

Thank you Taifun for looking here.

Given that it does not crash for me, it could well be a local/hardware issue at your end. Take @Taifun's advice, and run logcat to see what is causing the crash.

I am also concerned that you may be running two component creation extensions in your larger app, they may have some conflict with each other? Best to pick just one, and only one. They both do the same thing.

From the hardware point of view, I'm 100% sure that is not. Can be from the companion?! But companion that runs on 3 devices... I don't think so. From CompCreator together with DynamicComponents I'm pretty sure that is no problem because I used them together in another test and it works great.

I'm 100% sure that is the DragAndDrop fought because if I don't use it to drag and drop on the same arrangement all works great!

@Taifun Can you please test this .aia to see if it on your part crashed?

Thank you in advance.

Sorry, I'm on mobile currently...

Taifun

I'm not sure that both do the same things, for example, DynamicComponents can't show .Parent, .Children and (for that reason a part of the logic from DragAndDrop) and CompCreator don't have an "id" associated with a component to create the logic behind tagData for every arrangement created (to create and identify multiple same arrangements, eg: VerticalArrangement, with different attributes).

So for me, they both, one complements the other. It is just an opinion(or I don't discover how to do only with one of them, the above .aia).

With CompCreator you can add created components to a list, then use the indexes in that list as "ids", or simply compare the component values.

1 Like