Jump to content

drjdpowell

Members
  • Posts

    1,970
  • Joined

  • Last visited

  • Days Won

    172

Posts posted by drjdpowell

  1. Ah, so the issue is that an actor both replies with an error message, and publishes one.  One possible solution is to say that only one actor should “own" the error.  If actor_a asked actor_b to do something, and an error occurs, then actor_a is the one responsible for handling/reporting it.  You can do this by changing the error handling case to only publish the error message if their was no return address attached to the original request message.  Thus you Reply OR Notify, rather than Reply AND Notify, and there is only one error message.

    • Like 1
  2. Hi Max,

    I just use the message translation for errors, as well as other messages.   There is more than one way to do it; a simple way is to just register for all errors and relabel the messages. For example, here I launch a "Simple UI" and relabel its error notifications as "Simple UI --> Error".  Then, in the case that handles that error (as well as differently-named error messages from other actors, I just attach the message label the the error description, so that the User knows where the error came from.

    Register for errors.png

     

    Then, in the case that handles that error (as well as differently-named error messages from other actors) I just attach the message label the the error description, so that the User knows where the error came from.

    Receive Error.png

     

    • Like 1
  3. By "Producer/Consumer”, do you mean the simplest interpretation of  “you can have a loop that consumes elements from a queue that are enqueued elsewhere”**, or the application of that in many NI examples of a “Producer” loop that receives Events and send enqueues messages to a second “Consumer” loop (which also enqueues messages to itself), as in the “Queued Message Handler” or “Continuous Measurement and Logging”?  It’s the latter architectures I find poor^^.

     A better architecture is to have a “main” loop that is based on handling Events (the JKI “statemachine” template is a good example), with blocking operation like Dialogs handled in a small, simple, specialized parallel loop, that sends its results back to the main loop.

    ** A very important concept but not, by itself, enough to be an architecture.

    ^^ a pet peeve of mine; I’ve actually given talks on weaknesses in these examples (link)

  4. 20 hours ago, hooovahh said:

    I don't see myself ever using the pink-ish one but all the others I could see uses for depending on the UI design.  

    You can colour it whatever you want.   I just copy-pasted the green one a couple of times and changed the colour**.  I just wanted to make sure people knew that, as most custom control sets available on the Tools Network are based on PNGs, which cannot be recoloured (and don’t resize well either).  I’m trying for resizability and recolourability.  I include the “Google style” checkbox, because it is nice and fits well with other Google Icons, but it is not resizable or recolourable, unless you manually swap out the icons with new ones from materialdesignicons.com.

    **Note: it’s slightly tricky to change the colour, as the checkmark’s invisible containing box blocks the colour tool from affecting the box underneath, unless you click near the edges.  Unfortunately, the checkmark isn’t recolourable (it’s a vector graphic imported from LibreOffice).

    • Like 1
  5. There are multiple ways to do things; but pick one.   Be wary of mixing different methods in such a way that the result is overly complex.  So when you mention mixing CVT with an independent messaging system, that’s a worry.   Note that smithd’s Projects don’t mix the two.

    Personally, I follow the messaging paradigm, rather than CVT-like tags (my tag-like functionality is a Register-Subscribe notification system build on messages), and I have a standard library and template for QMH “actors” (note: NOT Actor Framework) that can communicate locally or over TCP/IP (some videos).

    • Like 1
  6. For comparison, I have a 2GB test SQLite database with 660k spectra, each of about 140 wavenumber (WN) readings, a total of 91M rows of Time, WN, Value.   These are stored in a "Without ROWID" table with primary key (Time,WN) I select regions of interest (ROI) in WN and Time, and I average spectra over time intervals (every 100 seconds, say), then take some statistic like a maximum of an average over each interval.  With WN ROI of about 30 points, and a time range of a few percent of the data, update time is about one second.  Doing the full time range takes 30 seconds.  

    I don't understand why MySQL and Postgres are not able to get comparable results.  But I would suggest trying (Time,id) as your primary key.

    Notes:

    -- the 2GB file is small enough to fit in the Windows File Cache, and so there is no disk access involved.

    -- SQLite is only using a single CPU for this, so it doesn't matter how many processors my computer has

  7. 1 hour ago, ASalcedo said:

    However how can I write and read the whole VI except the image? is there a shorcut way? Because it will be really tedious to put every indicator and controls except the image in the block diagram to reaad/write...

    There’s a middle ground between those two extremes, where one operates on arrays of control references.   You either create the array of references explicitly (lot less work that coding it), or you get it programmatically from either the pane reference or tab-control tab references.  You can even do things like use prefixes in the control’s name to exclude some controls.

  8. Dr. Powell:  While debugging, we are opening the Front Panels.  How?  Well... they opened automatically as set in the VI properties (to open when called).  We also used an invoke node to open the front panel.  It did not change anything.

    If you’re using “Open when Called” then the FP will be loaded before anything else happens, so that can’t be the source of your problem.  Be wary of using an invoke node on the VI block diagram, as the FP doesn’t exist until after that node executes.

  9. Note, BTW, that I haven’t worked on INSERT speed yet (as my application doesn’t require it) and the example only inserts one row at a time.  Better speed comes from multi-row INSERTs, and even faster is likely the COPY command, which I intend to support with the toolkit at some point.

    Also, from my reading, I wouldn’t expect MySQL to be slower than Postgres (except possibly for complex queries), so I think there must be something wrong with your MySQL benchmark.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.