ACOP.NET API
Classes | Static Public Member Functions | List of all members
AcopUtils Class Reference

Some static utilities which could be of use when programming. More...

Classes

class  ExceptionLogEntry
 

Static Public Member Functions

static void AddScaleableControlsToPanel (Control panel)
 add all controls on a container to a scaleable collection More...
 
static void ApplyColorGradient (Form form, Graphics g, Color color1, Color color2)
 Apply a color gradient to the form specified. Use this method in a form's Paint event (hint: invalidate the form in the ResizeEnd event or call SetStyle(ControlStyles.ResizeRedraw, true) in FormLoad) More...
 
static void ApplyColorGradient (Form form, Graphics g, Color color1, Color color2, int angle)
 Apply a color gradient to the form specified. Use this method in a form's Paint event (hint: invalidate the form in the ResizeEnd event or call SetStyle(ControlStyles.ResizeRedraw, true) in FormLoad) More...
 
static void ApplyColorGradient (Form form, Graphics g, Color color1, Color color2, int angle, int extent)
 Apply a color gradient to the form specified. Use this method in a form's Paint event (hint: invalidate the form in the ResizeEnd event or call SetStyle(ControlStyles.ResizeRedraw, true) in FormLoad) More...
 
static Boolean CheckInstalledPrinter (string value)
 Returns true if the printer is installed on the system More...
 
static AcopComponent [] GetAcopLinkComponents (Control parent)
 Get an array of all AcopComponents on the parent container More...
 
static AcopUserComponent [] GetAcops (Control parent)
 Get an array of all AcopControls on the parent container More...
 
static String [] GetAcopsByName (Control parent)
 Get an array of all AcopControls by name on the parent container More...
 
static String [] GetBrowsingHierarchy (string protocol)
 Get label names More...
 
static String [] GetConnectionFlags (String protocol)
 Get a string array with all connection flags More...
 
static String [] GetContextList (String protocol)
 Gets a list of available contexts More...
 
static Object GetDataObjectFromStringArray (string protocol, Type type, String[] data)
 returns an appropriate data object created from the type information and string input provided More...
 
static DataTypeName [] GetDataTypeList (String protocol)
 gives an array of data types supported by the given protocol More...
 
static string GetDefaultPrinter ()
 Returns a string with the default printer name. More...
 
static String GetDefaultProtocol ()
 Return the default protocol from config file More...
 
static String [] GetDeviceList (String protocol, String context, String subsystem, String server, String property)
 Gets a list of devices exported by the server specified by the input parameters More...
 
static DateTime GetLocalTimefromUtc (double timeUtc)
 Returns the given UTC timestamp as Local DateTime More...
 
static string [] GetPrintersList ()
 Returns a string array with all installed printer names. More...
 
static String [] GetPropertyList (String protocol, String context, String subsystem, String server, String device)
 Gets a list of properties exported by the server specified by the input parameters More...
 
static String [] GetProtocolList ()
 Returns an array of all available plugins More...
 
static String [] GetServerList (String protocol, String context, String subsystem)
 Gets a list of available servers specified by the parameters More...
 
static String [] GetSubSystemList (String protocol, String context)
 Gets a list of available subsystems More...
 
static double GetUtcFromLocalTime (DateTime dataTime)
 Returns the UTC time (seconds since 1970) of the given local time object as a double (with fractional seconds). More...
 
static double GetUtcNow ()
 Returns the current UTC time (seconds since 1970) as a double (with fractional seconds). More...
 
static Boolean HasDeviceQueryPrecedence (String protocol, String context, String subsystem, String server)
 Indicates whether the targeted server has device query precedence More...
 
static Boolean HasPropertyQueryPrecedence (String protocol, String context, String subsystem, String server)
 Indicates whether the targeted server has property query precedence More...
 
static void ResetAcopLinks (Form frm)
 Resets all Acop Links contained on the given form More...
 
static void ScaleControlsOnPanel (Control panel, float scaleHeight, float scaleWidth)
 resizes all controls on the panel according to the scale factors given More...
 
static void SetAddressDrag (Control ctrl, String address, String property)
 Set the Drag event for a given control to drag an address with the default protocol Acop controls will be ignored! More...
 
static void SetAddressDrag (Control ctrl, String protocol, String address, String property)
 Set the Drag event for a given control to drag an address Acop controls will be ignored! More...
 
static void SetComponentValue (Control ctrl, String property, Object value)
 Sets the given property of the component to the value given (thread safe) More...
 
static void SetLabelText (Label lb, String text)
 Set a text to the given label (Thread safe) More...
 
static Boolean StartApplication (String application)
 starts the application with arguments given More...
 
static Boolean TextMatches (String pattern, String txt)
 returns true if the input text contains the pattern More...
 
static double [] ToDoubleArray (object data)
 Convert an object array to a double array More...
 

Detailed Description

Some static utilities which could be of use when programming.

Member Function Documentation

◆ AddScaleableControlsToPanel()

static void AddScaleableControlsToPanel ( Control  panel)
inlinestatic

add all controls on a container to a scaleable collection

Parameters
panelthe container control (not necessarily a panel)

ScaleControlsOnPanel

◆ ApplyColorGradient() [1/3]

static void ApplyColorGradient ( Form  form,
Graphics  g,
Color  color1,
Color  color2 
)
inlinestatic

Apply a color gradient to the form specified. Use this method in a form's Paint event (hint: invalidate the form in the ResizeEnd event or call SetStyle(ControlStyles.ResizeRedraw, true) in FormLoad)

Parameters
formthe instance of the form to apply the color gradient
gthe form's graphics (from the form's paint event)
color1upper left hand color
color2lower right hand color

◆ ApplyColorGradient() [2/3]

static void ApplyColorGradient ( Form  form,
Graphics  g,
Color  color1,
Color  color2,
int  angle 
)
inlinestatic

Apply a color gradient to the form specified. Use this method in a form's Paint event (hint: invalidate the form in the ResizeEnd event or call SetStyle(ControlStyles.ResizeRedraw, true) in FormLoad)

Parameters
formthe instance of the form to apply the color gradient
gthe form's graphics (from the form's paint event)
color1start color; e.g. upper left hand color
color2end color; e.g. lower right hand color
anglegradient angle in degrees

◆ ApplyColorGradient() [3/3]

static void ApplyColorGradient ( Form  form,
Graphics  g,
Color  color1,
Color  color2,
int  angle,
int  extent 
)
inlinestatic

Apply a color gradient to the form specified. Use this method in a form's Paint event (hint: invalidate the form in the ResizeEnd event or call SetStyle(ControlStyles.ResizeRedraw, true) in FormLoad)

Parameters
formthe instance of the form to apply the color gradient
gthe form's graphics (from the form's paint event)
color1upper left hand color
color2lower right hand color
anglegradient angle in degrees
extentthe extent (percent) of the form to which the gradient is to be applied (only applied if 'angle' is one of 0, 90, 180, or -90).

◆ CheckInstalledPrinter()

static Boolean CheckInstalledPrinter ( string  value)
inlinestatic

Returns true if the printer is installed on the system

Parameters
value
Returns
true if printer is installed

References AcopUtils.GetPrintersList().

◆ GetAcopLinkComponents()

static AcopComponent [] GetAcopLinkComponents ( Control  parent)
inlinestatic

Get an array of all AcopComponents on the parent container

Parameters
parentis the parent container
Returns
Array with all AcopComponents

Referenced by AcopUtils.ResetAcopLinks().

◆ GetAcops()

static AcopUserComponent [] GetAcops ( Control  parent)
inlinestatic

Get an array of all AcopControls on the parent container

Parameters
parentis the parent container
Returns
Array with all AcopControls

Referenced by AcopUtils.ResetAcopLinks().

◆ GetAcopsByName()

static String [] GetAcopsByName ( Control  parent)
inlinestatic

Get an array of all AcopControls by name on the parent container

Parameters
parentis the parent container
Returns
Array with all AcopControls by name

◆ GetBrowsingHierarchy()

static String [] GetBrowsingHierarchy ( string  protocol)
inlinestatic

Get label names

Parameters
protocolthe target protocol
Returns
String array

◆ GetConnectionFlags()

static String [] GetConnectionFlags ( String  protocol)
inlinestatic

Get a string array with all connection flags

Parameters
protocolthe target protocol
Returns
string array

◆ GetContextList()

static String [] GetContextList ( String  protocol)
inlinestatic

Gets a list of available contexts

Parameters
protocolthe target protocol
Returns
a list of available contexts

◆ GetDataObjectFromStringArray()

static Object GetDataObjectFromStringArray ( string  protocol,
Type  type,
String []  data 
)
inlinestatic

returns an appropriate data object created from the type information and string input provided

Parameters
protocolthe targeted protocol which should make the object
typethe object Type to create
dataa string array to use in filling in the fields of the data object
Returns
a data object or throws an exception if the object cannot be created.

◆ GetDataTypeList()

static DataTypeName [] GetDataTypeList ( String  protocol)
inlinestatic

gives an array of data types supported by the given protocol

Both a canonical name (for browsing) and a full assembly name (for instantiation via reflection) are contained in the returned object array.

Parameters
protocoltarget protocol
Returns
an array of data types supported by the given protocol

◆ GetDefaultPrinter()

static string GetDefaultPrinter ( )
inlinestatic

Returns a string with the default printer name.

Returns
string with the default printer name

◆ GetDefaultProtocol()

static String GetDefaultProtocol ( )
inlinestatic

Return the default protocol from config file

Returns
String with default protocol

◆ GetDeviceList()

static String [] GetDeviceList ( String  protocol,
String  context,
String  subsystem,
String  server,
String  property 
)
inlinestatic

Gets a list of devices exported by the server specified by the input parameters

Parameters
protocolthe target protocol
contextthe target context
subsystemthe target subsystem
serverthe target server
propertythe target property
Returns

◆ GetLocalTimefromUtc()

static DateTime GetLocalTimefromUtc ( double  timeUtc)
inlinestatic

Returns the given UTC timestamp as Local DateTime

Parameters
timeUtcthe UTC timestamp as double
Returns
the given UTC timestamp as Local DateTime

◆ GetPrintersList()

static string [] GetPrintersList ( )
inlinestatic

Returns a string array with all installed printer names.

Returns
String array with all installed printer names

Referenced by AcopUtils.CheckInstalledPrinter().

◆ GetPropertyList()

static String [] GetPropertyList ( String  protocol,
String  context,
String  subsystem,
String  server,
String  device 
)
inlinestatic

Gets a list of properties exported by the server specified by the input parameters

Parameters
protocolthe target protocol
contextthe target context
subsystemthe target subsystem
serverthe target server
devicethe target device
Returns
a list of exported properties

◆ GetProtocolList()

static String [] GetProtocolList ( )
inlinestatic

Returns an array of all available plugins

Returns
String array

◆ GetServerList()

static String [] GetServerList ( String  protocol,
String  context,
String  subsystem 
)
inlinestatic

Gets a list of available servers specified by the parameters

Parameters
protocolthe target protocol
contextthe target context
subsystemthe target subsystem
Returns
a list of available servers

◆ GetSubSystemList()

static String [] GetSubSystemList ( String  protocol,
String  context 
)
inlinestatic

Gets a list of available subsystems

Parameters
protocolthe target protocol
contextthe target context
Returns
a list of available subsystems

◆ GetUtcFromLocalTime()

static double GetUtcFromLocalTime ( DateTime  dataTime)
inlinestatic

Returns the UTC time (seconds since 1970) of the given local time object as a double (with fractional seconds).

Parameters
dataTimeA DateTime object containing the local time desired as a UTC double value.
Returns
the UTC time (seconds since 1970) of the given local time object as a double (with fractional seconds)

◆ GetUtcNow()

static double GetUtcNow ( )
inlinestatic

Returns the current UTC time (seconds since 1970) as a double (with fractional seconds).

Returns
the current UTC time (seconds since 1970) as a double (with fractional seconds)

Referenced by AcopAlarmsViewer.GetAlarmMessages().

◆ HasDeviceQueryPrecedence()

static Boolean HasDeviceQueryPrecedence ( String  protocol,
String  context,
String  subsystem,
String  server 
)
inlinestatic

Indicates whether the targeted server has device query precedence

if 'true' then a list of available properties should be acquired following any change of device.

Parameters
protocolthe target protocol
contextthe target context
subsystemthe target subsystem
serverthe target server
Returns
whether or not the targeted server has device query precedence

◆ HasPropertyQueryPrecedence()

static Boolean HasPropertyQueryPrecedence ( String  protocol,
String  context,
String  subsystem,
String  server 
)
inlinestatic

Indicates whether the targeted server has property query precedence

if 'true' then a list of available devices should be acquired following any change of property.

Parameters
protocolthe target protocol
contextthe target context
subsystemthe target subsystem
serverthe target server
Returns
whether or not the targeted server has property query precedence

◆ ResetAcopLinks()

static void ResetAcopLinks ( Form  frm)
inlinestatic

Resets all Acop Links contained on the given form

TINE//TEST/SineServer/SineGen0/Amplitude

Parameters
frmis the Form whose Acop Links should be reset

References AcopUtils.GetAcopLinkComponents(), AcopUtils.GetAcops(), AcopComponent.Reset(), and AcopUserComponent.Reset().

◆ ScaleControlsOnPanel()

static void ScaleControlsOnPanel ( Control  panel,
float  scaleHeight,
float  scaleWidth 
)
inlinestatic

resizes all controls on the panel according to the scale factors given

Parameters
panelthe container control (not necessarily a panel)
scaleHeightvertical scale factor
scaleWidthhorizontal scale factor

AddScaleableControlsToPanel

◆ SetAddressDrag() [1/2]

static void SetAddressDrag ( Control  ctrl,
String  address,
String  property 
)
inlinestatic

Set the Drag event for a given control to drag an address with the default protocol Acop controls will be ignored!

Parameters
ctrlthe control
addressthe target address
propertythe target property

◆ SetAddressDrag() [2/2]

static void SetAddressDrag ( Control  ctrl,
String  protocol,
String  address,
String  property 
)
inlinestatic

Set the Drag event for a given control to drag an address Acop controls will be ignored!

Parameters
ctrlthe control
protocolthe control system protocol (e.g. TINE or STARS)
addressthe target address
propertythe target property

◆ SetComponentValue()

static void SetComponentValue ( Control  ctrl,
String  property,
Object  value 
)
inlinestatic

Sets the given property of the component to the value given (thread safe)

Parameters
ctrlis the component whose property value is to be set
propertyis the component's property which should receive the given value
valueis the targeted value

◆ SetLabelText()

static void SetLabelText ( Label  lb,
String  text 
)
inlinestatic

Set a text to the given label (Thread safe)

Parameters
lb
text

◆ StartApplication()

static Boolean StartApplication ( String  application)
inlinestatic

starts the application with arguments given

Parameters
applicationis a string containing the application to start followed by any arguments separated by spaces
Returns
true if the application was successfully started

◆ TextMatches()

static Boolean TextMatches ( String  pattern,
String  txt 
)
inlinestatic

returns true if the input text contains the pattern

Parameters
patterna regular expression for comparison (preceed with a '-' to check for a negative match)
txtthe text which should contain the pattern or ('-' prefix) not contain the pattern
Returns
true if a match was found.

◆ ToDoubleArray()

static double [] ToDoubleArray ( object  data)
inlinestatic

Convert an object array to a double array

Parameters
data
Returns
Double array

The documentation for this class was generated from the following file:

Datenschutzerklaerung   -   Data Privacy Policy
Generated for ACOP.NET API by  doxygen 1.5.8