Jump to content

vugie

Members
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    32

Posts posted by vugie

  1. Also, the wire segments (I think) have a flags property where bit 4 says whether it's selected or not. It might also help.

    No such object as wire segment exist according to my knowledge. Only joints. Segment is only visual representation of connections between joints. Joint may be either bend, junction, end or loose end. From the joint wire may go to up, down, left and right (any combination for junctions, two directions for bends and one for ends). If selected segment of the wire is a connection of given joint, its 4th bit (0x8) is set to 1. Only in this case bits 5th and 6th (0x10 and 0x20) have sense. 0 for 0x10 means that left joint side is selected (if present) and 1 means that right joint side is selected. Similarly for 0x20 bit for up and down respectively. Note that bits 0x10 and 0x20 have not much sense for junctions - where segments may be selected in up to 4 directions. Two bits are simply too less to describe such situation. Two figure out what is the situation with selection for junction you have to follow the wire further to the next bend and read it out from the bend. What if you have few 4-directional junctions in row? I don't know.

    But gb119, what do you exactly need it for? Is Selected property and then first element of Terms[] property not enough to get a source of selected wire?

    • Like 1
  2. I was actually hoping to avoid using the Volume Serial Number, since I understand that it is not very static (reformatting will change it, and make the license obsolete). I was leaning more towards a physical Serial Number of the hard drive which can only be changed if the hard drive is swapped. MAC Address is no good since disabling the network card will make it impossible to read, and internet is not necessary to run the program.

    Michael's link fruited some ideas about using the BIOS card, which I'm looking into now. Any ideas about this?

    As for volume physical serial number you may use Win32_PhysicalMedia class from Windows Management Instrumentation, but you would have to build your own DLL wrapper in C++ or use MS script engine to get this information (examples for both methods for WMI are provided in above link). Additionally WMI gives you classes (I may be wrong - just found this out) to get virtually any number from hardware (i.e. motherboard serial). But it seems to be little bit tricky to use and works only for XP and above.

    Alternatively you may use diskid32 freeware tool in manner similar to "dir nothing".

    Using MAC address for licensing is a joke as changing it is very simple even for not advanced user. IMO optimal way is to use combination of few hardware related serials and obsoleting license only when ALL of them change.

  3. In did this a long time ago like this (only for windows).

    Make a system call to "Dir nothing.txt" this will give you this result:

    H:\>dir nothing.txt Volume in drive H is Data Volume Serial Number is [color="#ff0000"]64BA-5E87[/color] Directory of H:\File Not FoundH:\>

    Then just parse the string

    //Mikael

    This method may be simply hooked by creating read-only file nothing.txt where you can put whatever you want. Of course one has to figure out first what and where to create... Anyway, much safer method is GetVolumeInformation function from kernel32.dll (to be used with Call Library Function Node).

  4. I think that this is what you are asking for:

    post-121-124994005499_thumb.png

    PJM

    This is not required as:

    Terminals[] Property

    Property of Wire.

    References to the terminals connected by this wire. The first one is always the source, if one exists.

    (from documentation)

    But I guess that gb119 would be more interested in this:

    Joints[] Property

    Property of Wire.

    Returns an array of all joints (intersections, bends and end points) of the wire.

    The output of this property is an array of clusters, where each cluster represents one joint of the wire. The cluster can be interpreted as follows:

    The Position is the X,Y position on the block diagram of this joint.

    The Type indicates whether this joint is a bend in the wire, a fork of the wire, a connection to a terminal or a loose end of the wire.

    Up/Down/Left/Right are indexes into the array for the joints that are next along the wire in the respective direction from the current joint.

    The Flags are defined as follows:

    0x1 Joint is connected to one of the terminals of the signal.

    0x2 Used for optimizing redraw of signals. Do not modify.

    0x4 Used for optimizing redraw of signals. Do not modify.

    0x8 Joint is currently selected on the block diagram. If any edge connected to the joint (up, down, left or right) is selected, this bit will be set.

    0x10 Right edge is selected

    0x20 Down edge is selected

    0x40 Used for optimizing routing. Do not modify.

    0x80 Used for optimizing routing. Do not modify.

    0x100 Joint is loose (meaning it is not anywhere along a path between two joints that are both connected to terminals). Do not modify.

    0x200 Joint is on path (opposite of "loose"). Used during path and split algorithms. Do not modify.

    0x400 Unused

    0x800 Unused

    0x1000 During the most recent edit operation, this joint was shifted horizontally (cleared when wire table is rebuilt at the end of every edit operation)

    0x2000 During the most recent edit operation, this joint was shifted vertically (cleared when wire table is rebuilt at the end of every edit operation)

    • Like 1
  5. Terminal has a property Connected wire . You take a wire and get its Terminals[]. The first terminal in this array is always a source terminal (terminals has also Is source? property) - let's call it STerm. Now you have to go through all GObjects on the same diagram. You have four cases here: GObject is either Control, Constant, Node or FlatSequence. Two former have single Terminal property (according to AQ you can typecast Constant to Control making it one case), two latter have Terminals[] property. So for each GObject of these types you have to go through all its terminals (one or more) comparing their references to STerm. It may appear that node you found is a loop or other structure. In this case if you like to search further for the source you have to specify class of terminal reference to OuterTerminal, take Tunnel property, then its Inside Terminals[] property and recursively go further.

    In simple form I'm doing something similar here in Generate Objects and Links.vi

  6. Unlimited by-ref has come. And that's the problem. :-) His program was not a case of LV having a bug, but rather he just coded something where Diagram Alpha was using a reference and Diagram Beta tried to acquire that reference, and was waiting, and, meanwhile, Alpha was waiting on Beta before Alpha would release the reference. And his program sat and waited on itself.

    ...and then it suddenly stood up and said: "I'm not waiting for this bloody reference, I'm going back to 8.6"

  7. I like this inertia thing... SubVIs could hang by their wires, giving them a larger bend if the subVIs have more mass (VI Metrics).

    Also elasticity of the wires may be dependent on their thickness. Or amount of data they carry :)

    I just realized that word "wired" is not the same as "weird", which I really meant...

  8. If you would use the right click it would come out with a solution which unwraps the wires so that a crossing only looks like a crossing but is in fact just two touching wires as indicated.

    Done:

    post-7450-12490568947_thumb.png

    However cross calculation algorithm slowed it down quite much. And highlight execution drops "bounce" on crossings...

    • Like 2
  9. One serious limitation is that the wire cannot cross with itself - so cycloides chenged to chain of arcs.

    BTW, I found strange issue with property Joints[] of the Wire class. It describes actual wire bending and is marked as read-only in docs. There are some flags and few of them are marked "do not modify" (?!). I would like to be able to modify some read-only properties... But for property node option "Change to write" is not greyed-out, however modyfing writing to this property results with "Property doesn't exist". Quite strange, isn't it? LV82

  10. Since ages I am missing the context menu entry "Finish this VI". It should simply finish programming the code for the selected VI according to my ideas and the requirements. Does anyone has such a function?. Any idea how to make it?

    That definitely should be the part of RCFs competitor - Wrong-Klik Framework. With such plugins as "finish this project", "Get the idea", "Solve this problem", "Earn money for me" and less spectacular but still effective "Wire diagonally", "Zoom out", "Measure wires cross-talking" or "Ask on LAVA why this is not working". Some of us will also welcome "Generate post for alpha thread".

  11. When can we expect a working version we can all try out?

    Hard to say... Most of he problems on LV is solved or is on the straight way. I'm stucked in Flash/ActionScript mess now. The tool I used has its limits and is not developing in direction I expected. There are hundreds of other tools and libraries but it is hard to find something which satisfy my requirements. And for me - still hardly knowing the subject - it is even hard to judge whether my requirements are satisfied...

    September should be realistic.

  12. I really don't see how NI could possible have a legal leg to stand on against a NEW file format , i.e. a template for a script to generate VIs from a given input file.....

    If speaking as generally as "creating new file format" I would agree. But how specificaly how should this format look like to be usable? It should more or less strictly reflect internal LabVIEW class hierarchy and this may already be treated as reverse engineering - not the VI format, but LabVIEW itself.

    And creating such format trying not to mimic class hierarchy? Nonsense - it would look like esoteric programming language (BTW, which of them do you like most? :) )

    In my opinion, even thinking about such a format makes no sense as so many aspects of VI is not exposed (even as private classes): from less important like decoration content, to extremly important like recently discussed event structure management.

    All we can afford is human readable (limited) macro programming language... but would it be better than just scripting?

  13. Well... I'm just working on sth like this.

    Features planned for next release:

    • Exporting given VI and (possibly selectable) subVIs up to certain nesting level to navigable SWF file. Only browser with Flash plugin is required to view the file.
    • Switchable multiframe structures (Case, Event, etc.) for any nesting level
    • Only pictures are exported, not the code
    • Docs and connector pane for all exported VIs
    • Descriptions displayed as tips for all objects on BD and FP of selected classes (functions, subVIs, vi.lib VIs, terminals, etc.)
    • Simple GUI for navigatinon within SWF file: Selectable list of VIs, BD/FP switching, zooming, panning, scrolling

×
×
  • Create New...

Important Information

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