none
clusters in c#?

    Question

  • Re: how do I set the position and size of the front panel using the FPRunTimeP​osRunCusto​m method in a c# app?

    02-23-201203:00 PM

    PIFORSystemTemplateVI.FPRunTimePosRunCustom((Int16)500, (Int16)500);

    this didn't work which is odd because the LabVIEW help files say that I only need to enter a 16 bit integer number.

    I've also tried to create 16 bit integer number variables and set them to any value and then use the variables for position and size, but that didn't work either.

    Has anyone used this method or has anyone got any ideas as to how to use this method?

    Method

    Requires: Base Package

    Class: VI Methods (ActiveX)

    Sets a custom position for the VI to move its front panel to every time the VI runs.

    For single-pane front panels, minimum size refers to the content area of that pane, not including the scroll bars. For multi-pane front panels, minimum size refers to the entire front panel, including any visible scroll bars.

    Syntax

    object.FPRunTimePosRunCustom([position], [size])

    Parameters

    Name Type Description
    position 16-bit integer A cluster of top and left pairs that indicate the front panel window position.
    size 16-bit integer A cluster of height and width pairs that indicate the size in pixels of the front panel.

    Return Value

    none


    • Edited by scurley Monday, March 12, 2012 11:29 AM
    Tuesday, March 06, 2012 10:25 PM

Answers

  • Apart from 3rd party interfaces, views, etc.  In WPF, everything that is displayed is considered to be a FrameworkElement. In this base class, there are two properties  Horizontal and VerticalAlignment.  Set both to strech to completely fill up the container they are in.

    For example you have a datagrid that has 4 regions.  One region hosts your LABVIEW view.  Make the control that contains the LABVIEW view a CONTENTCONTROL.  Set the content control's alignments as indicated above.  If the LABVIEW view still has problems you have to tell the LABVIEW control the width and heights similar to hosting a Silverlight control in a webbrowser.  Many unmanged controls are hosted in ACTIVEX controls which do have height and width properties.  You can experiment easily enought but JUST adding an activex control to your grid in WPF and altering these values to see the effect.  The last link shows how to how WINDOWS MEDIA PLAYER.  Try that sample and adjust width and height to see results.

    You mention the word clusters but you don't define it.  Clusters have no meaning in C# other than perhaps at the Operating System layer where there are many Systems Clustered to act as one big machine.  So for position, I'm guessing that it is the postion within the ACTIVEX control itself.  Leave that to position 0,0, and use the CONTENTCONTROL to render actual position.


    JP Cowboy Coders Unite!


    Monday, March 12, 2012 1:04 PM

All replies

  • I don't think anyone understands this question...

    JP Cowboy Coders Unite!

    Wednesday, March 07, 2012 5:11 AM
  • Could you provide more details about your issues please? It will be very benefit for us to help you find a solution.


    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 08, 2012 8:03 AM
    Moderator
  • I'm building a machine vision app and i need to use c#/wpf for the webcam interface and main GUI but I have to use labview for the image processing.

    i have sorted all the wpf/c# side but i can't get the labview front panel to be the size and position that i want because i don't know how to enter the position and size values into the method stated above.

    the VI method(ActiveX) in the labview 2010 help files states that the following method should be used:

    object.FPRunTimePosRunCustom([position], [size]);

    it also states that the variables used for position and size should be a cluster of Int16 pairs.

    how do i enter the values for the method if c# doesn't do clusters?

    I've tried arrays and they don't work, so i'm asking for help.

    if you need more info let me know what info you need please.

    Thank you.

    Monday, March 12, 2012 11:27 AM
  • Apart from 3rd party interfaces, views, etc.  In WPF, everything that is displayed is considered to be a FrameworkElement. In this base class, there are two properties  Horizontal and VerticalAlignment.  Set both to strech to completely fill up the container they are in.

    For example you have a datagrid that has 4 regions.  One region hosts your LABVIEW view.  Make the control that contains the LABVIEW view a CONTENTCONTROL.  Set the content control's alignments as indicated above.  If the LABVIEW view still has problems you have to tell the LABVIEW control the width and heights similar to hosting a Silverlight control in a webbrowser.  Many unmanged controls are hosted in ACTIVEX controls which do have height and width properties.  You can experiment easily enought but JUST adding an activex control to your grid in WPF and altering these values to see the effect.  The last link shows how to how WINDOWS MEDIA PLAYER.  Try that sample and adjust width and height to see results.

    You mention the word clusters but you don't define it.  Clusters have no meaning in C# other than perhaps at the Operating System layer where there are many Systems Clustered to act as one big machine.  So for position, I'm guessing that it is the postion within the ACTIVEX control itself.  Leave that to position 0,0, and use the CONTENTCONTROL to render actual position.


    JP Cowboy Coders Unite!


    Monday, March 12, 2012 1:04 PM
  • Thanks, i'll check out what you've said.

    Oh just so you know:

    LabVIEW defines clusters as arrays of different data types.

    Thanks again.

    Monday, March 12, 2012 9:08 PM