Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 20:24:29 +0000



[Programming Help] - Saving Subgraph.DrawStyle to a variable to be updated within ACSIL study

View Count: 313

[2023-10-15 10:13:25]
User92573 - Posts: 530
Dear Support/Support Board

Can someone help me solve this?


I need to save Subgraph.DrawStyle to a variable so that I can recall it, or change it, based on a selection, or outcome within my study - without changing the default setting.


//Here is an example to illustrate what I'm trying to achieve:

if (sc.SetDefaults)
{

  Subgraph_01.Name = "01";
  Subgraph_01.DrawStyle = DRAWSTYLE_DASH;

  return;

}

// Do Processing


SET A VAR as my_Drawstyle

if(Set_Drawstyle == 1)
{

  //Subgraph_01.DrawStyle = DRAWSTYLE_POINT; ... This would lose, or change the default.
  my_Drawstyle = DRAWSTYLE_POINT;

}
else if(Set_Drawstyle == 2)
{

  //Subgraph_01.DrawStyle = DRAWSTYLE_HIDDEN; ... This would lose, or change the default.
  my_Drawstyle = DRAWSTYLE_HIDDEN;


}
else
{

  my_Drawstyle = ... get .. Subgraph_01.DrawStyle // This would reset my Subgraph_01.DrawStyle parameters to the default setting.

}

// Now set Subgraph_01.DrawStyle to the selected DrawStyle.

Subgraph_01.DrawStyle = my_Drawstyle; //




What I'd like to do is retain the initial default settings but change the DrawStyle depending on an outcome in my ACSIL study.


Any help appreciated.

Many thanks
[2023-10-19 23:42:37]
ForgivingComputers.com - Posts: 960
//Here is an example to illustrate what I'm trying to achieve:

if (sc.SetDefaults)
{

Subgraph_01.Name = "01";
Subgraph_01.DrawStyle = DRAWSTYLE_DASH;

return;

}

// Do Processing


SET A VAR as my_Drawstyle

// Save Original DrawStyle
int Orig_DrawStyle;
if (sc.Index == 0)
  Orig_DrawStyle = Subgraph_01.DrawStyle;  

if(Set_Drawstyle == 1)
{
//Subgraph_01.DrawStyle = DRAWSTYLE_POINT; ... This would lose, or change the default.
my_Drawstyle = DRAWSTYLE_POINT;
}
else if(Set_Drawstyle == 2)
{
//Subgraph_01.DrawStyle = DRAWSTYLE_HIDDEN; ... This would lose, or change the default.
my_Drawstyle = DRAWSTYLE_HIDDEN;
}
else
{
  // Use the saved value of the default drawstyle
  my_Drawstyle = Orig_DrawStyle; // This would reset my Subgraph_01.DrawStyle parameters to the default setting.
}

// Now set Subgraph_01.DrawStyle to the selected DrawStyle.

Subgraph_01.DrawStyle = my_Drawstyle;


Date Time Of Last Edit: 2023-10-19 23:50:56
[2023-10-20 13:30:27]
User92573 - Posts: 530
Thank you I didn't think of that. I thought it would be an enum list of some form.

Great thanks.

I don't suppose you have any thought on the other Support Board Post?

How to hide/show "sc.AddAndManageSingleTextDrawingForStudy"

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account