cancel
Showing results for 
Search instead for 
Did you mean: 

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

Creator
Creator

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

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

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

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

Creator
Creator

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