sFilter | (String) Specifies which of the viewer properties are saved into the configuration data.
The individual values can be concatenated. Example: "View;Trends;TimeMinMax;". "View;" - Save the viewer appearance apart the tvTrend objects and apart the time of the left and right edge of the viewer.
"Trends;" - Save only the configuration of tvTrend objects without data points
"TrendsNoConnect;" - Save only the configuration of tvTrend objects without data points and without parameters of the connection. The connection parameters are specified by the ConnectionType, ConnectionServer, ConnectionGroup and ConnectionItem properties of the tvTrend object. This option is suitable for generating the configuration file for printing. Note! If some of the following trend properties (for example tvTrend.Name, tvTrend.Unit, tvTrend.ValueMin, tvTrend.ValueMax or tvGraph.Color), contains the $default flag indicating reading the value from server), then the flag will be replaced by the real value that was read (cannot be read without the connection).
"TrendsData;" - Save only data points currently read by the viewer of the tvTrend object without the configuration of this object. This option is suitable for generating the configuration file for printing.
"TimeMinMax;" - Save the time of the left and right edge of the viewer.
"TimeZoom;" - Save only the time axis length of the viewer. |
---|---|
sCfgTitle | (String) User-defined configuration name. Saves into read data (<cfgtitle> tag). If the configuration is displayed in configuration list (by the LoadCfg method), then the user-defined configuration name is also displayed. Empty string ("") means that the configuration has no user-defined name. |
var oTView = pMe.Items("../AxTrendsView");
var sCfg = oTView.GetCfg("Trends;TimeZoom;", "");
if (Pm.IsValid(sCfg))
{
if (pMe.PmPanel.Methods.SaveTrendCfg("SaveCfg.tg", sCfg))
{
Pm.MessageBox("Message OK", "Configuration file saved");
}
else
{
Pm.MessageBox("Message Error", "Configuration file NOT saved");
}
}
If pContext.User.TestInGroup("$ADMIN") Then
pResult = Pm.FileTextWrite("#cfg:" & sFile, sCfg, "mode:new;charset:utf-8;")
Else
pResult = false
End If