|
It is currently Wed May 22, 2013 8:08 pm
|
View unanswered posts | View active topics | View unsolved topics
|
Page 1 of 1
|
[ 12 posts ] |
|
[KSB] [April 18, 2012] Scripting Addons 1.3.6b73, 1.4.1b75
| Author |
Message |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 [KSB] [April 18, 2012] Scripting Addons 1.3.6b73, 1.4.1b75
Enclosed is our module that adds various scripting packages to the client, designer and gateway contexts. We made this module to add scripts we felt we needed, and we use them on almost every project we work on. I will enclose the module here, and the documentation will follow in the following post. This module exposes 5 new components: Analog Scale Attachment:
Analog Scale.png [ 1.06 KiB | Viewed 2079 times ]
QR Code Attachment:
QRCode.png [ 1.97 KiB | Viewed 2080 times ]
Vertical Sliding Indicator Attachment:
Sliding Indicator.png [ 1.82 KiB | Viewed 2078 times ]
Radar Chart Attachment:
Radar Chart.png [ 16.04 KiB | Viewed 2080 times ]
There is also a spark line, a small word sized graph (Cant post it because of attachment limitations Also, there is a SQLTag for the number of unacknowledged alarms at [System]Alert Count There is push alert messages, enabled in the project properties. It creates a small popup notification whenever a new alarm is pushed. Regular price of $400 per server, but until April 30, half price ($200) 20120320 - Added module. 20120329 - Made license checks faster 20120418 - Posted 1.3.6b73,1.4.1b75, Fixed bug with Null Pointer when using system.window scripts KSB Addon Scripts 1.3.6b73KSB Addon Scripts 1.4.1b75
Last edited by Kyle Chase on Wed Apr 18, 2012 8:28 pm, edited 10 times in total.
|
| Thu Mar 15, 2012 7:22 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.alert.acknowledgeAlerts(user) DescriptionAcknowledges all currently unacknowledged alarms SyntaxParametersString user The user that is acknowledging the alarm Returnsnothing ScopeClient Designer ExampleCode: user = system.security.getUsername() system.alert.acknowledgeAlerts(user) system.alert.acknowledgeAlerts() DescriptionAcknowledges all currently unacknowledged alarms. User is set to System SyntaxParametersString user Returnsnothing ScopeGateway Code: system.alert.acknowledgeAlerts() system.alert.createNotifier(title, bodyText, time, bgColor, textColor) DescriptionCreates a popup displaying the latest alarm information starting in the top right hand corner. It stays above all windows, and multiple alerts stack vertically for one column This function uses keyword invocationSyntaxParametersString title The header of the notifier String bodyText The body of the notifier int time How long the notifier will display for. If < 0, the notifier will persist until you close it String bgColor The background color of the notifier. Can be a color, such as "blue", or a RGB string, such as "0,0,255" String textColor The text color of the notifier. Can be a color, such as "blue", or a RGB string, such as "0,0,255" Returnsnothing ScopeClient Designer Code: system.alert.createNotifier("Hello","World",5000,"black","yellow") Attachment:
createNotifier example.png [ 19.63 KiB | Viewed 2432 times ]
|
| Thu Mar 15, 2012 7:27 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.client.moveProject() DescriptionCreates a popup based of your monitor configuration, and moves project to the monitor you select SyntaxParametersnothing Returnsnothing ScopeClient Designer ExampleCode: system.client.moveProject()
Last edited by Kyle Chase on Thu Mar 15, 2012 8:29 pm, edited 1 time in total.
|
| Thu Mar 15, 2012 8:02 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.tag.getAttribute(tagPath, attribute) DescriptionReturns any of the tag attributes definable in the tag editor. To list available attributes, run the following python code Code: print dir(system.tag.TagProp) Code: 'AccessRights', 'AlertAckMode', 'AlertAcknowledgeUser', 'AlertAcknowledged', 'AlertAcknowledgedTime', 'AlertActive', 'AlertActiveTime', 'AlertClearedTime', 'AlertCurrentSeverity', 'AlertCurrentState', 'AlertDeadband', 'AlertDisplayPath', 'AlertExecEnabled', 'AlertMessage', 'AlertMessageMode', 'AlertMessageSubject', 'AlertMode', 'AlertNotes', 'AlertSendClear', 'AlertTimestampSource', 'ClampMode', 'DataType', 'Deadband', 'Documentation', 'DriverName', 'Enabled', 'EngHigh', 'EngLow', 'EngUnit', 'Expression', 'ExpressionType', 'FormatString', 'HistoricalDeadband', 'HistoricalScanclass', 'HistoryEnabled', 'HistoryMaxAge', 'HistoryMaxAgeMode', 'HistoryTimestampSource', 'InterpolationMode', 'LastChange', 'Name', 'OPCItemPath', 'OPCServer', 'OPCWriteBackItemPath', 'OPCWriteBackServer', 'PollRate', 'PrimaryHistoryProvider', 'Quality', 'RawHigh', 'RawLow', 'SQLBindingDatasource', 'ScaleMode', 'ScaledHigh', 'ScaledLow', 'ScanClass', 'TagTypeSubCode', 'Tooltip', 'Value' SyntaxParametersString tagPath The tag to get the attribute from String attribute The Attribute to get, either in teh form system.tag.TagProp. attribute, or " attribute" ReturnsObject value - The value of the attribute, or null ScopeClient Designer Gateway ExampleCode: print system.tag.getAttribute("path/to/tag",system.tag.TagProp.HistoryEnabled) >> 1 system.tag.getChildren(tagPath) DescriptionReturns a list of all the children under tagPath SyntaxParametersString tagPath The tag to get the attribute from ReturnsObject[] value - A list of the children ScopeClient Designer Gateway ExampleCode: system.tag.getChildren("path/to/folder")
|
| Thu Mar 15, 2012 8:19 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.menu.addTag(tagPath, numberFormat) DescriptionAdds a label to the menu, displaying the value of a SQLTag. SyntaxParametersString tagPath The tag to get the attribute from String numberFormat The java format used to display the number Returnsnothing ScopeClient Designer ExampleCode: system.menu.addTag("path/to/folder", "#,##0.##") system.menu.addText(text) DescriptionAdds a static text label to the menu bar. SyntaxParametersString text The text to display Returnsnothing ScopeClient Designer ExampleCode: system.menu.addText("Hello, World!!") system.menu.remove(string) DescriptionIf the text matches a tagPath that is being displayed in the menu, it will be removed. If it matches the string displayed in static text, the label will be removed from the menu. SyntaxParametersString string The tag to get the attribute from Returnsnothing ScopeClient Designer ExampleCode: system.menu.addTag("path/to/folder", "#,##0.##") system.menu.addText("Hello, World!!")
system.menu.remove("path/to/folder") system.menu.remove("Hello, World!!") system.menu.clearMenu() DescriptionRemoves all dynamic labels from the menu SyntaxParametersnothing Returnsnothing ScopeClient Designer ExampleCode: system.menu.clearMenu()
Last edited by Kyle Chase on Mon Mar 19, 2012 11:01 pm, edited 1 time in total.
|
| Thu Mar 15, 2012 8:35 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.ctg.findPen(pen) DescriptionFinds the index of the requested pen SyntaxParametersString pen The point to search for ReturnsInteger index The index of the pen, or -1 if the point is not in the active pen list ScopeClient Designer ExampleCode: system.ctg.findPen("myPen") system.ctg.addPen(pen) DescriptionAdds the pen to the active pen list SyntaxParametersString pen The pen to add to the active list Returnsnothing ScopeClient Designer ExampleCode: system.ctg.addPen("myPen") system.ctg.deletePen(pen) DescriptionRemoves a pen from the active pen list SyntaxParametersString pen The pen to remove from the active pen list Returnsnothing ScopeClient Designer ExampleCode: system.ctg.deletePen("myPen") system.ctg.clearPens() DescriptionRemoves alls pens from the active pen list SyntaxParametersnothing Returnsnothing ScopeClient Designer ExampleCode: system.ctg.clearPens() system.ctg.updateGraph(graphId) DescriptionLoads the pens from the selected graph id anf refreshes the graph SyntaxParametersInteger pen The graph to open Returnsnothing ScopeClient Designer ExampleCode: system.ctg.updateGraph(7) system.ctg.updateGraph(graphId) DescriptionLoads the pens from the selected graph id anf refreshes the graph SyntaxParametersInteger pen The graph to open Returnsnothing ScopeClient Designer ExampleCode: id = system.db.runPrepQuery("give/Me/My/Id",[]) system.ctg.updateGraph(id) system.ctg.openGraph() DescriptionOpens the current graph on the screen called "CTG_Graph" SyntaxParametersnothing Returnsnothing ScopeClient Designer ExampleCode: system.ctg.openGraph() system.ctg.getPensString() DescriptionReturns a comma delimited string of the active pens SyntaxParametersReturnsString penString The string representation of the pens list. ScopeClient Designer ExampleCode: system.ctg.getPensString() system.ctg.getPensList() DescriptionReturns the list of the active pens SyntaxParametersReturnsString[] penList The active pens list. ScopeClient Designer ExampleCode: system.ctg.getPensList()
|
| Mon Mar 19, 2012 10:49 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.net.httpGetBytes(url) DescriptionLets you download the bytes of just about any file SyntaxParametersString[] url The full URL string of the desired file Returnsbyte[] bytes A byte array containing all the bytes of the requested file ScopeClient Designer Gateway ExampleCode: system.net.httpGetBytes("http://www.inductiveautomation.com/resources/com.inductiveautomation.website.BasePage/images/logos/logo.png")
|
| Tue Mar 20, 2012 9:32 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.window.getWindowInstance(window,instanceid) DescriptionChecks if a window with a certain instanceID is open, and if so, returns that window object. SyntaxParametersString[] window The name of the window you want to check for String[] instanceid The instance of the window you want to check for ReturnsPyObject[] window A reference to the window if it exists, else None ScopeClient Designer ExampleCode: system.window.getWindowInstance("Motor Window","Pump 1") system.window.openWindowInstance(window, instanceid, destination) DescriptionOpens a window with a certain ID, and places the value of ID into Root Container. destination. If the window is already open, it its moved to the front and given focus. SyntaxParametersString[] window The name of the window you want to open String[] instanceid The instance of the window you want to open String[] destination The property in the container that will store the instanceid. Defaults to "Tag" if omitted ReturnsPyObject[] window A reference to the window if it exists, else None ScopeClient Designer ExampleCode: system.window.openWindowInstance("Motor Window","Pump 1","tag") system.window.closeWindowInstance(window,instanceid) DescriptionCloses the window with the given instance ID SyntaxParametersString[] window The name of the window you want to close String[] instanceid The instance of the window you want to close ReturnsNothing ScopeClient Designer ExampleCode: system.window.closeWindowInstance("Motor Window","Pump 1")
|
| Thu Mar 22, 2012 1:35 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] Scripting Addons
system.stats.calculateMean(values,includeNull) DescriptionCalculates the mean of a list of numbers SyntaxParametersNumber[] values The values Boolean includeNull If true,If a null is found, return null ReturnsDouble mean The mean ScopeClient Designer Gateway ExampleCode: mean = system.stats.calculateMean([1,2,3],0) print mean 2 system.stats.calculateMedian(values) DescriptionSorts the list and returns the median SyntaxParametersNumber[] values The list of values Returnsdouble median The median of the list ScopeClient Designer Gateway ExampleCode: print system.stats.calculateMedian([2,4,3]) system.stats.getStdDev(values) DescriptionReturns teh standard deviation of the list SyntaxParametersNumber[] values The list of values Returnsdouble stdDev The standard deviation of the list ScopeClient Designer Gateway ExampleCode: print system.stats.getStdDev([1,2,3,4,5]) 1.581138830041898 system.stats.getLinearFit(xData,yData) DescriptionReturns the values of m and b for y = mx+b SyntaxParametersNumber[] xData The X axis values (cannot be null) Number[] yData The Y axis values (cannot be null) Returnsdouble[] result result[0] = b, result[1] = m ScopeClient Designer Gateway ExampleCode: result = system.stats.getLinearFit([1,2,3],[3,2,1]) print result[0] print result[1] 4.0 -1.0
system.stats.getSlope(xData,yData) DescriptionReturns the slope between 2 sets of data SyntaxParametersNumber[] xData The X axis values (cannot be null) Number[] yData The Y axis values (cannot be null) Returnsdouble slope The slope of the line ScopeClient Designer Gateway ExampleCode: result = system.stats.getSlope([1,2,3],[3,2,1]) print result -1.0
system.stats.getCorrelation(data1,data2) DescriptionReturns the correlation between 2 sets of data SyntaxParametersNumber[] data1 The first set of values (cannot be null) Number[] data2l The second set of values (cannot be null) Returnsdouble correlation The correlation between the sets of data ScopeClient Designer Gateway ExampleCode: result = system.stats.getCorrelation([1,2,3],[3,2,1]) print result -1.0
|
| Fri Mar 23, 2012 12:05 am |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] [March 29, 2012] Scripting Addons v 1.3.4 b61
Updated Module to 1.3.4 b61
License checks now faster
Module price is $200 until April 30th. After that, it goes to its normal price of $400
|
| Thu Mar 29, 2012 1:58 am |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] [April 18, 2012] Scripting Addons 1.3.6b73, 1.4.1b75
Updated to 1.3.6b73 and 1.4.1b75 (7.3 and 7.4 versions) Fixed a NPE bug on system.window scripts KSB Addon Scripts 1.3.6b73KSB Addon Scripts 1.4.1b75
|
| Wed Apr 18, 2012 8:29 pm |
|
 |
|
Kyle Chase
General
Joined: Sun Feb 25, 2007 2:54 pm Posts: 472
|
 Re: [KSB] [June 21, 2012] Scripting Addons 1.3.6b73, 1.4.1b88
Fix NPE due to improper passing of variables KSB Addon Scripts 1.4.1b88
|
| Thu Jun 21, 2012 10:11 pm |
|
 |
|
|
Page 1 of 1
|
[ 12 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|