-
Posts
1,973 -
Joined
-
Last visited
-
Days Won
178
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by drjdpowell
-
Can we get rid of LVLIB “libraries†then? Or at least rename them as they don’t match the English meaning of library? Libraries are not "collections of books that cannot be read except all at onceâ€. And can we have an actual library construct that does collect related VIs with namespacing and scoping? Why don’t we have proper libraries in LabVIEW?!?
-
I’m all for advanced stuff to do advanced things, but I don’t want to have to build a carefully-structured dependency injection just to use a utility subVI. I’d rather just leave it a library orphan.
-
That’s alright. Polymorphic VIs certainly have the same issues. Though at least with them I can see why they might entail loading unused code, while with the library thing it seems entirely pointless. Similarly with Classes; I can see why one might need to load all Dynamic Dispatch methods, but not why LabVIEW insists on loading classes or static methods not used by any in-memory VI.
-
This is a standard thing to learn with SQLite, which is an “ACIDâ€-compliant database. The “D†is for durable; by default SQLite is durable against power-failure of the computer, meaning once a transaction has executed, in can be relied on to remain, and not be corrupted, even if power is lost in a subsequent transaction. Durability requires that SQLite verify proper writing to hard disk, and as hard disks spin at about 100Hz, this mean that the number of durable transactions is limited to an order of 20 per second. You can disable the durability requirement, but a better strategy is to group multiple INSERTs into a single transaction by wrapping them in BEGIN…COMMIT SQL statements. See on of the Examples provided with the package to see how this is done (you just need to execute “BEGIN†before your loops and “COMMIT†after**). For simple INSERTs, one should get greater than 100,000 per second. **also see SAVEPOINTs in the www.SQLite.com documentation.
-
Oh yeah, DUH, this is why the “Advanced Notifier Waiting†subpallet exists, isn’t it? I’ve never used notifiers in such complex ways and so I forgot about it. If one doesn’t need the many-readers ability of notifiers, one is better off sticking to queues. The “Future Token†class, which is what I use to solve “wait for something to reply†problems like the OP’s, is a Write-Once, Destroy-on-Reading, single-element queue. I shall add a "Wait on notification with history†method to my NotifierMessenger class in case people find uses for this. Thanks.
-
Is that wise? What if your API optionally interacts with some other API, and you have optional methods to support easy interoperation. It’s possible that a particular programmer my want to use one or the other APIs by themselves. Where do the optional VIs that depend on both go? An example might be: I have a message-passing API, and a TCP API, and I want to pass messages by TCP sometimes, without tying these two APIs forever together? And without having the extra burden of stewarding LabVIEW to do the obvious: don’t load it it it isn’t used.
-
How to creat an UI for drawing interactive flow control charts
drjdpowell replied to olisting's topic in User Interface
I use the menu of the picture control, dynamically built in the “Shortcut Menu Activation?†event and let the User insert after the clicked-on icon. Sadly, I do not. Should your “objects†know about the mouse? My “analysis pipeline actorsâ€, represented by the icons, do not know anything about the picture UI used by the top level VI. The top level determines what was clicked on and does the appropriate action or sends the appropriate message. -
True, but how do I identify real dependancies from all the fake ones? LLBs don’t seem to be equivalent (though I never really used them). No namespacing, no Private scope.
-
How to creat an UI for drawing interactive flow control charts
drjdpowell replied to olisting's topic in User Interface
I’ve used a single 2D picture control for similar work (no drag’n'drop, but I have full mouse-click logic including insert, delete, cut and paste, as well as “settings†and “disable†buttons built into the picture). It’s not that hard once you have made a “what is the mouse over†subVI that accepts mouse coordinates (you’ll need a cluster/class to hold the known coordinates of your icons). I would suspect that the VI server route would be harder. -
Something I did not appreciate till today: If I have an LVLIB library in which I use one of its VIs, then any LVCLASS class referred to by ANY of the LVLIB’s members will be loaded into memory (along with all their dependancies). In addition, the fact that all library members show up under “dependanciesâ€, even if only a few are actual used, makes it difficult to get useful information about real dependancies. So, should I ditch the use of LVLIBs altogether as a hopelessly-flawed tool? — James Added later: Must be getting old, as I forgot that I already knew this. But the question remains of what to do about it.
-
I’ve modified the code to only escape ‘/' if it follows ‘<‘ (so ‘</‘ becomes ‘<\/‘), as it’s use in HTML <script>..</script> seems to be the reason that escaping of ‘/‘ is allowed in JSON.
-
I had never noticed that JSON allows, but does not require, / to be escaped as \/. Googling suggests this is due to some use of JSON embedded in other formats such as HTML that do use / as a control character. I believe our library as it stands should accept both versions. But what should it do on output?
-
The latest JSON package, where I have fixes some issues with corner cases, mostly by changing the string escaping (failed on strings like “C:\\“). Also extended escaping to the name strings of JSON Objects (which we had neglected to do). I will make this the latest CR version in a week or so if there is no objection. lava_lib_json_api-1.3.1.25.vip
-
I would say putting common logic in the parent is desirable behavior. And I don’t mind if some children will want to override the default parent behavior. For example, I have a project at the moment that uses cameras and “lockinâ€, the extraction of a periodic signal in the image. Most concrete camera types just override the "Get Image" method, and the parent’s "Get Lockin Image†method uses "Get Imageâ€. But one camera model has a built-in lockin mode, so I override “Get Lockin Image†in that case.
-
It’s worth breaking through whatever conceptual block you have, because the code you have shown is considerably more complicated (and will require a higher level of competence to execute correctly) than the OOP solutions shoneil and I are talking about. And there are no advantages I can see to the way you are doing things.
-
You can still push the details into the subClass. Your generic code only needs a "Show Configuration UI in subpanel" method and a "Poll Configuration UI" method. You'll be able to write vastly simpler code in the subClass itself (no Variants, no Open VI ref, no Property nodes).
-
All Devices can implement “Show Device Configuration UIâ€, so you do not have any problem. Your mixing two incompatible statements: you’re code is generic enough to switch types, but specific enough that it must use one specific type. If you organize your code in levels, generic and specific**, then each level will be a lot cleaner. **Note that you can have intermediate levels, such as a generic “power supplyâ€. Code can know that it is using power supplies (rather than generic devices) but not depend on the type of supply used.
-
I think your conceptual problem is here. Your high-level, handles-array-of-generic-devices, code shouldn’t want to know anything about specific device properties. One of the biggest advantages of OOP is the ability to have generic code that doesn’t need to be complicated by a 1001 specific details. Anything specific needs to be pushed down a level to the specific child classes. The high-level code may have dynamically dispatched methods such as “Get Device configuration as Stringâ€, “Set Device configuration as Stringâ€, “Get Human-readable Device Statusâ€, “Show Device Configuration UIâ€, and so on. It should never have anything as specific as “Set Rate Formulaâ€. Now if you do need to write specific code that “knows†what the devices specifically are, then use a cluster, not an array (note that you can use a cluster of arrays of specific types if you have a variable number of each device type).
-
Actor Framework - Too much coupling?
drjdpowell replied to GeorgeG's topic in Object-Oriented Programming
Ignore it; it's not relevant to your OP. -
Actor Framework - Too much coupling?
drjdpowell replied to GeorgeG's topic in Object-Oriented Programming
My actors are already services. They’re private, rather than public, services, so access to them needs to be explicitly passed. Rather like an unnamed Queue is different from a named Queue. If I were to adopt the AF, such a “Notification†and “Routing†system using “Data Messages†would be the first thing I would do. Mouth would register for (and re-notify) Tongue’s Data Message. Brain would register Chew to receive Mouth’s re-notified Data Message (originally from Tongue), contained in a “Command Envelope†that tells Chew what to do with the info (Command Envelopes illustrated here). -
I wondered if anyone, who has used this package in real-world applications, would kindly review it on the Tools Network.
-
Actor Framework - Too much coupling?
drjdpowell replied to GeorgeG's topic in Object-Oriented Programming
A previous related conversation:"Decoupling message based systems that communicate across a network" Added later: I'm a strong proponent of message decoupling, even with the string-labelled messages I use instead of the Command pattern. I never want a component to explicitly contain text commands for anything that isn't a subcomponent of it. Instead, and command text is injected as part of the "reply address" attached as part of the initial message received from higher-level code. This has the great advantage of making it easier to follow code, since I don't need to place any actual commands in the low-level actors, and just need to study the high-level actors to understand the app. The low-level actors are also more simple and reusable. -
User Events aren’t front panel events, and should never lock any front panels.