Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Automation: Plot all data in Octave Display as Line Segments programmatically

[ Edited ]

Dear All,

 

Is there any way to modify the Display properties from an Octave Picture in order to plot all data as Line Segments?

 

Thanks in advance

2 REPLIES
Solution
Solution
Accepted by topic author Kinetia
‎03-27-2017 10:56 AM

Re: Automation: Plot all data in Octave Display as Line Segments programmatically

Dear,

 

For this we need some advanced automation tric. I hope the code snippet below can help you.

Kind regards,

 

Snippet

private static void Change_Octave_LineStyle()
{
    LMSTestLabAutomation.IPictureManager pictureManager = null;
    LMSTestLabAutomation.IPicture picture = null;
    LMSTestLabAutomation.IDisplay display = null;
 
    LMSTestLabAutomation.Watch port = null;
    LMSTestLabAutomation.IData data = null;
    LMSTestLabAutomation.Enumerate style = null;
 
    try
    {
        Console.WriteLine("Change line style ...");
 
        //Get PictureManager of Active Test.Lab
        pictureManager = (LMSTestLabAutomation.IPictureManager)tl.ActiveBook.FindDataWatch("Navigator_DataViewing_PictureManager").Data;
 
        //Loop over all Pictures in the PictureManager
        for (int i = 0; i < pictureManager.PictureCount; i++)
        {
            //Get first picture
            picture = pictureManager.Picture[i];
 
            if (picture.LayoutName.Contains("Octave"))
            {
                //Get the display of the Octave Display
                display = picture.Display[0];
 
                //Create Line Segement style (3 = Line Segements)
                style = tl.Factory.CreateEnumerate("LmsHq::DataModelVI::PropertyFDisp::CBufferIOctaveCurvePropertyStrategy", 3);
 
                //Get the port for Options on display
                port = display.FindWatch("OptionPropertyOctave");
                data = (LMSTestLabAutomation.IData)port.Data;
 
                //Change style and push to display
                data = data.Edit("ValueCurvePropertyStrategy", style);
                port.Data = data;
 
            }
        }
        Console.WriteLine("Change line style done.");
 
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
    }
}

 

 

 

Re: Automation: Plot all data in Octave Display as Line Segments programmatically

Amazing, works perfect! I had to upgrade TL from 14 to 16A, seems that this DataType was included later...

 

Thanks a lot! I'm learnin a lot with you

 

Francisco