app
app
app object provides the application related functions used by PowerScene. Main functions are program termination, executing external programs, playing sound, and printing messages.
The functions are available in PowerScene Studio, and some functions are available in Data Explorer.
app object provides the followiing functions.
Methods
Return Type |
Method |
Explorer Support |
Description |
ackAll() |
Acknowledge all alarms which are not acknowledged in the alarm window. |
||
setAlarmStationFilter( name ) |
Reflect only the alarm which its station is 'name' from the PowerScene alarm window. |
||
list[str] |
analogPointNamesByStation( stationName ) |
O |
Return the name of analog points belonging to that station. |
boolean |
checkPassword( password ) |
Verify the password, and return whether the authentication is succeeded or failed. |
|
setInterval로 실행한 모든 스크립트를 중지합니다. |
|||
list[str] |
Return the communication channel group list. |
||
list[str] |
O |
Return the communication channel list. |
|
list[str] |
commChennelNamesInCommGroup( chennelName ) |
Return the communication channel list belonging to that communication channel group. |
|
boolean |
confirmUserDialog( title, id ) |
Process the authentication with displaying the user authentication dialog. |
|
connect( eventName, func ) |
Register a receivable event handler for log-in and log-off. |
||
str |
Return the IP address of the SCADA server. |
||
connectValueChange( func, pointNames ) |
포인트값 변경시 수신되는 이벤트 핸들러를 등록합니다. |
||
copyToClipboard( data ) |
Copy the data to a clipboard. |
||
list[int] |
O |
Return the current time. (Year, Month, Day, Hour, Minute, Second) |
|
int |
O |
Return the current date. |
|
int |
O |
Return the current hour. |
|
int |
O |
Return the current minute. |
|
int |
O |
Return the current month. |
|
int |
O |
Return the current second. |
|
str |
Return the name of logged-in users |
||
int |
O |
Return the current year. |
|
list[str] |
Return the history data report group list. |
||
int |
daysInMonth( year, month ) |
O |
Entered the year and month, and return the number of days for that month. |
list[str] |
O |
Return the device list. |
|
executeFile( path ) |
Execute the program for that path. |
||
exitApp() |
Terminate the running PowerScene application program. |
||
Maximize the running PowerScene canvas. ( * Same function as F5 of MS-PPT) |
|||
list[str] |
generateReport( reportName, year, month, day, parameter ) |
등록된 파워씬 리포트를 생성하고 관련 정보를 반환합니다. |
|
boolean |
generateReport( path, reportName, year, month, day, parameter ) |
O |
등록된 파워씬 리포트를 path 경로에 생성하고 결과를 반환합니다. |
str or float or int |
getProperty( property ) |
O |
Obtain the value of global variables. |
boolean |
hasProperty( property ) |
O |
Validate the specified property exists. |
list[str] |
Return the history data group list. |
||
boolean |
isCalculationRunning( name ) |
O |
Return whether the calculation registered in Data Explorer is running. |
boolean |
isDataGroupEnabled( name ) |
이력 데이터 그룹의 수집 여부를 반환합니다. |
|
boolean |
isHoliday( year, month, day ) |
O |
Validate whether the specified day is a holiday. |
boolean |
isLogOn() |
Return the current log-in state. |
|
boolean |
O |
Return whether today is a holiday. |
|
boolean |
isTrendSetEnabled( name ) |
Return whether the trend set is saved. |
|
boolean |
logOn( user, password ) |
Log-in with entering the user ID and password. |
|
boolean |
logOut( user, password ) |
Log-out with entering the user ID and password. |
|
maximize() |
Maximize the running PowerScene screen. |
||
messageBox( text ) |
Print a message box. |
||
messageBox( title, text ) |
Print a message box with title. |
||
minimize() |
Minimize the running PowerScene screen. |
||
moveScreen( number ) |
Move the PowerScene HMI program to the desired monitor. |
||
int |
Obtain the operating time of the SCADA server in seconds. |
||
str |
Obtain the operating time of the SCADA server in the form of hour:minute:second. |
||
Open the detailed alarm window. |
|||
boolean |
openAuthDialog( title ) |
Open the user authentication window and return whether the authentication is succeeded or failed. |
|
openExplorer( path ) |
Open the file explorer for that path. |
||
str |
openFileDialog( path ) |
Open the file explorer for that path, if a file is selected, return the file path and file name. |
|
str |
Open the folder dialog, if a folder is selected, return the folder path. |
||
Open the history report browser. |
|||
boolean |
Open the log-in and log-out window. |
||
list[float] |
openNumberInputDialog( title, defaultValue ) |
Open the number input dialog. |
|
Open the number keypad. |
|||
list[str] |
openPasswordInputDialog( title, devaultValue ) |
Print the password input dialog on the screen. |
|
Open the point browser. |
|||
openReport( reportName, year, month, day ) |
등록된 파워씬 리포트를 생성하고 엽니다. |
||
str |
Open the save file dialog for that path, and return the entire path of the file on the dialog. |
||
str |
Set the default path, file's extension, and dialog title. Then open the save file dialog. Return the entire path of the entered file on the dialog. |
||
Open the SCADA summary information window. |
|||
list[str] |
openStringInputDialog( title, defaultValue ) |
Print the string input dialog on the screen |
|
openTrendView( name ) |
Open the trend window. |
||
app.PlatformType |
Return the platform for the currently running HMI program. ( Desktop(PC), Andriod, Embedied ) |
||
playSound( filepath ) |
Play the sound file for that path. |
||
playTTS( tts ) |
Play the entered text in Korean. ( Voiceware TTS engine must be installed. ) |
||
playTTS( tts, lang ) |
Play the entered text in the desired language. ( Voiceware TTS engine must be installed. ) |
||
boolean |
questionMessageBox( title, message ) |
Open the message window to select yes or no. |
|
간편 스케줄을 재로드합니다. |
|||
restore() |
Restore the fullScreen applied screen. ( * Restored screen is maximized screen. ) |
||
Restore the mouse pointer as a default. |
|||
runApp( filepath ) |
Execute the application program for that path. |
||
runApp2( name, parameter ) |
Execute the application program for that path, then use the entered parameters. |
||
setAllTriggerEnabled( enable ) |
Set all trigger control enable or disable. |
||
setCalculationEnable( name, enable ) |
O |
Set the registered calculation to enable or disable. |
|
setDataGroupEnabled( name, enabled ) |
이력 데이터 그룹의 수집을 활성화하거나 비활성화합니다. |
||
setDataGroupEnabled( enabled ) |
모든 이력 데이터 그룹의 수집을 활성화하거나 비활성화합니다. |
||
setInterval( script, msec ) |
스크립트를 특정 시간(msec) 간격으로 반복 실행합니다. |
||
setProperty( property, value ) |
O |
Create a global variable and set the value. |
|
setScreenAutoMove( move ) |
Set the screen auto move function to enable or disable. |
||
setTrandSetEnabled( name, enabled ) |
Set the trend set saving to enable or disable. |
||
setTrandSetEnabled( enabled ) |
모든 트랜드 그룹의 수집을 활성화하거나 비활성화합니다. |
||
setTriggerEnabled( name, enabled ) |
Set the trigger to enable or disable. |
||
Change the mouse pointer to the shape of an hourglass. |
|||
list[str] |
O |
Return the name of all stations in the project. |
|
list[str] |
statusPointNamesByStation( stationName ) |
O |
Return the name of status points belonging to the entered station. |
stopInterval( script ) |
setInterval로 실행한 스크립트를 중지합니다. |
||
list[int] |
sunsetTime( year, month, day, latitude, longitude ) |
O |
Return the sunset time corresponding to the entered date of the entered location. |
list[int] |
sunriseTime( year, month, day, latitude, longitude ) |
O |
Return the sunrise time corresponding to the entered date of the entered location. |
list[int] |
systemSunsetTime( year, month, day ) |
O |
Return the sunset time corresponding to the entered date of the system location. |
list[int] |
systemSunriseTime( year, month, day ) |
O |
Return the sunrise time corresponding to the entered date of the system location. |
list[int] |
O |
Return today's sunset time of the system location. |
|
list[int] |
todaySunsetTime( latitude, longitude ) |
O |
Return today's sunset time of the entered location. |
list[int] |
O |
Return today's sunrise time of the system location. |
|
list[int] |
todaySunriseTime( latitude, longitude ) |
O |
Return today's sunrise time of the entered location. |
datetime |
toUtcDateTime( localtime ) |
Convert the local time to UTC Date time. |
|
list[str] |
O |
Return the name of all trend groups specified by Data Explorer. |
|
float |
trimDecimal( value, decimal ) |
Set the decimal place for the entered value. |
|
wait( msec ) |
O |
PowerScene program waits for a set of period. |
Acknowledge all alarms which are not acknowledged in the alarm window. Example)
app.ackAll(); # Acknowledge all alarms which are not acknowledged in the alarm window.
|
Print a message window that contains the name of trend groups via a loop. |
|
setAlarmStationFilter reflects only the alarm in which its station is corresponding to the user-set station. It is used to see only the alarms in that station. Example)
app.setAlarmSationFilter('A'); # Reflects only the alarms about station 'A' in the alarm window.
|
|
Validate a password in the script.
If the correct password is entered as a parameter 'password', return TRUE, or FALSE. Examples)
# Suppose that the password is 1234 ret = app.checkPassword('1234'); # If the correct password is entered, return TRUE. app.messageBox(ret); # The value of ret is TRUE. ret = app.checkPassword('0000'); # If the wrong password is entered, return FALSE. app.messageBox(ret); # The value of ret is FALSE. |
The following is the result of checkPassword |
|
|
|||||
Return the IP address of the SCADA server. Example)
app.messageBox(app.connectedServer()); # Return the IP address of the SCADA server. |
The following is the result of connectedServer. |
|
Copy data on a clipboard. By using the paste function in programs such as Notepad, Excel, and Powerpoint, Users can paste the copied contents Example)
app.copyToClipboard('Copy the data.'); |
Return the current date and time. Example)
year, month, day, hour, minute, second= app.currentDate() # Return the current date and time.
|
Return the current hour. Example)
hour = app.currentHour() # Return the current hour.
|
Return the current minute. Example)
minute = app.currentMinute() # Return the current minute.
|
Return the current month. Example)
month = app.currentMonth() # Return the current month.
|
Return the current second. Example)
second = app.currentSecond() # Return the current second.
|
Obtain the name of the currently logged-in user. Example)
User_Name = app.currentUser(); # Obtain the name of the currently logged-in user.
|
Print the currentUser information using a messageBox. |
|
Return the current year. Example)
year = app.currentYear() # Return the current year.
|
Return the history data report group list. Example)
list = app.dataReportNames() # Read the history data report group list. i = 0 for item in list: print 'list[', i, '] = ', item i = i + 1 |
Result) |
list[ 0 ] = Smart channel - 1 list[ 1 ] = Smart channel - 3 list[ 2 ] = Smart channel - 4 list[ 3 ] = Smart channel - 5 |
Entered the year and month, and return the number of days for that month. Example)
days = app.daysInMonth(2017, 2) # Return the number of days for Feburary, 2017. print days
|
Output)
28
|
Return the device list. Example)
list = app.deviceNames() # Return the device list. i = 0 for item in list: print 'list[', i, '] = ', item i = i + 1 |
Result) |
list[ 0 ] = Smart device - 1 list[ 1 ] = Smart device - 3 list[ 2 ] = Smart device - 4 list[ 3 ] = Smart device - 5 |
path: Enter the file path to execute. Example)
app.executeFile('C:/Workspace/test.txt') # Execute the text.txt file for 'C:/Workspace'.
|
Execute the text.txt file for 'C:/Workspace'. |
|
exitApp terminates the PowerScene HMI program. Terminate the currently running PowerScene HMI program. It is used with PushButtons or other functions. Example)
app.exitApp(); # Terminate the PowerScene HMI.
|
|
Set the currently running PowerScene canvas as a fullscreen. It is the same as the F5 of MS-PPT functions.
Example)
app.fullScreen() # Set the canvas as a fullscreen.
|
|
Return the value of selected property. If the value does not exist, return None. Example)
Value = app.getProperty('LastResult'); |
Validate whether the set property exists. If it exists, return TRUE, or return FALSE. Example)
app.setProperty('property',1234); ret = app.hasProperty('property') if ret == 1 : Value = app. getProperty('property'); app.messageBox(Value); |
Result) |
|
Return history data group names. Example)
list = app.historyDataGroupNames() # Return history data group names. i = 0 for item in list: print 'list[', i, '] = ', item i = i + 1 |
Result) |
list[ 0 ] = Smart channel - 1 list[ 1 ] = Smart channel - 3 list[ 2 ] = Smart channel - 4 list[ 3 ] = Smart channel - 5 |
Represent whether the calculation is running in SCADA server. If the script is running in the server, return TRUE, or return FALSE. Example)
Running = app.isCalculationRunning('A'); # Validate whether the calculation 'A' is running in SCADA server. app.messageBox(Running); |
The screen to check whether the calculation is running. |
|
Validate whether the entered date is a holiday. If it is, return TRUE, or return FALSE. Example)
ret = app. isHoliday(2016, 1, 1) # Validate whether January 1st ,2016 is a holiday. # If it is a holiday if (ret == 1) : print '2016-1-1 is a holiday.' # If it is not a holiday else: print '2016-1-1 is not a holiday.'
|
Return the currently log-in state. Example)
ret = app.isLogOn(); # Return the current log-in state. |
Validate whether today is a holiday. If it is, return TRUE, or return FALSE. Example)
ret = app.isTodayHoliday() # Validate whether today is a holiday. # If today is a holiday if (ret == 1) : print 'today is a holiday.' # If today is not a holiday else: print 'today is not a holiday.'
|
Process the log-on with the entered user ID and password. If the log-on succeeds, return TRUE, or return FALSE. Example)
Ret = app.logOn('admin', '1234') # If the log-on succeeds, return TRUE. print Ret |
Process the log-out with the entered user ID and password. If the log-out succeeds, return TRUE, or return FALSE. Example)
Ret = app.logOut('admin', '1234') # If the log-out succeeds, return TRUE. print Ret |
Maximize the currently running PowerScene window.
ㆍ Maximizing window by conditional statements. ㆍ Maximize the screen without clicking on a window when the program is running. Example)
app.maximize(); # Maximize the window.
|
|
Print the string on the window. ㆍ The messageBox is used as a: 1) Print a message 2) Print an alarm ㆍ Enter the String to text. Example)
app.messageBox('print a screen'); # Print a message 'print a screen' on the window.
|
Print the message on the window. ㆍ The messageBox is used as a: 1) Print a message 2) Print a alarm. ㆍ title represents the name of window, and enter string. ㆍ Enter the String to text. Example)
app.messageBox('Title', 'Message'); # Print 'Message' on 'Title' window. |
|
Minimize the currently running PowerScene window.
ㆍ The minimize is used as a: 1) Minimizing window by conditional statements. 2) Minimize the screen without clicking on a window when the program is running. Example)
app.minimize(); # Minimize the window.
|
|
Move the PowerScene program to the desired monitor. ㆍ number represents a monitor number. - You should validate the number before entering the number. - Enter the value of -1 for the monitor number. Example) If the monitor number is 1, enter 0. Example) If the monitor number is 2, enter 1. Example)
app.moveScreen(0) # Move to monitor 1. app.moveScreen(1) # Move to monitor 2. |
||||||||||
This is the result screen after executing connectedServer. |
||||||||||
|
||||||||||
Users can check the monitor numer with [OK] button in the window screen display setting. |
||||||||||
Return the operating time of the PowerScene SCADA server. ㆍ Unit is a second. Example)
Duration = app.onlineDuration(); # Return the operating time of the SCADA server in seconds. app.messageBox(str(Duration) + 'seconds'); |
This is the result screen after executing onlineDuration. |
|
Return the operating time of the SCADA server in a form of hour:minute:second. Example)
Duration = app.onlineDurationString(); # Return the operating time of the SCADA server in a form of hour:minute:second. app.messageBox(Duration); |
This is the result screen after executing onlineDurationString. |
|
Open the detailed alarm window. Example)
app.openAlarmWindow(); # Open the detailed alarm window. |
This is the result screen of executing openAlarmWindow. |
|
Open the user authentication window. ㆍ Open the user authentication window part. ㆍ Process the authentication by entering user ID and password on the user confirm field. - User authentication success : Return TRUE. - User authentication failed : Return FALSE. Example)
ret = app.openAuthDialog('Need a user authentication'); # Open user authentication. String 'Need a user authentication' is displayed on the command part. app.messageBox(ret); # If an user authentication is succeeded, return TRUE, or return FALSE.
|
This is the result window of executing openAuthDialog. |
|
Open the file explorer for that path.
ㆍ Open the file explorer for that path. Example)
app.openExplorer('C:\Program Files'); # Open the 'C:\Program Files' folder.
|
|
Open the file explorer for that path, and show files that corresponding to the entered file extension. If a file selected, return its path. ㆍ openFileDialog is used as a: 1) Directly use the selected file in the PowerScene by openFileDialog. 2) Run the application program using runApp. 3) Play the sound using playSound. ㆍ path is entered as String. Example)
FilePath = app.openFileDialog('*.wav'); # Show .wav files in the current project folder.
|
|
Open the folder select dialog, and if a folder selected, return the path of that folder.
FolderPath = app.openFolderDialog(); # Return the path of the selected folder.
|
|
Open the history report browser for PowerScene. Example)
app.openHistoryBrowser(); # Open the history report browser for PowerScene. |
This is the result screen of executing openHistoryBrowser. |
|
Open the log-in window. ㆍ Log-in / Log-out success : Return TRUE. ㆍ Log-in / Log-out failed : Return FALSE. Example)
ret = app.openLoginOutForm(); # Open the log-in window. app.messageBox(ret); |
Execute openLoginOutForm and return the value. |
|
Open the save file dialog for the user entered path.
ㆍ If the file saved, return its path. Example)
path = app.openSaveFileDialog('C:\Program Files'); # Open the save file dialog for 'C:\Program Files' print path |
|
Open the SCADA summary information window. Example)
app.openStationBrowser(); # Open the SCADA summary information window. |
This is the result of executing openStationBrowser. |
|
openTrendView is used to open the entered trend group with the trend viewer. Example)
app.openTrendView('A'); # Open 'A' with the trend viewer.
|
|
|
Return the platform type of the currently running HMI program. ( Desktop(PC), Android, Embedded ) Example)
plat = app.platformType() # Return the platform type of the currently running HMI program. # Desktop if ( plat == app.DeskTop ): print 'PC HMI' # Andriod elif ( plat == app.Mobilie ): print 'Android' # Embedded elif (plat == app.Embedded): print 'Embedded'
|
|
Used to play the sound file the user wanted. ㆍ playSound is used as: 1) Play the alarm sound 2) Play the sound depending on the graphic event action. ㆍ Enter the path of the sound to file path as a String format. ㆍ The extension is '.wav'. Example)
app.playSound('soundfile'); # Play 'soundfile.wav' in the project folder.
|
|
Play the text in the Korean voice. ㆍ Voiceware TTS engine must be installed. Example)
app.playTTS('환영합니다') # Korean voice.
|
Play the text in the selected voice. ㆍ Voiceware TTS engine must be installed. Example)
app.playTTS('환영합니다', app.Korean) # Korean voice.
app.playTTS('Welcome', app.English) # English voice. |
Restore the fullscreen. Provide the same as F5 in MS-PPT. ㆍ restore() is applied in fullScreen() state only. Example)
app.restore() # Restore the fullscreen.
|
|
Provide the function that can run the application program on PowerScene. ㆍ Used to need other programs such as documents or drawing board when using PowerScene. ㆍ Enter the application program to be executed to file path. It should be entered as String and include a file extension. Example)
app.runApp('PowerScene.exe'); # 'Execute 'PowerScene.exe'.
|
|
Set all trigger control to enabled or disabled. ㆍ Enter 0 or 1 on enable. - Enabled : Enter 1 - Disabled : Enter 0 Example)
days = app.setAllTriggerEnabled( 1 ) # All trigger control are enabled. days = app.setAllTriggerEnabled( 0 ) # All trigger control are disabled.
|
|
Create a property and save it on property. ㆍ setProperty is used to save data. ㆍ property is the concept of global variables, and value means the value applying to the global variable. Example)
app.setProperty('LastResult', 1234); #Create LastResult and save 1234. |
Set screen auto move function to enabled or disabled. ㆍ Execute : Enter 1 ㆍ Stop : Enter 0 Example)
app.setScreenAutoMove(1) # Execute screen auto move app.setScreenAutoMove(0) # Stop screen auto move |
Set the trigger to enabled or disabled. ㆍ triggerName is entered as String. ㆍ Enter 0 or 1 to enable. - Enable : Enter 1 - Disable : Enter 0 Example)
days = app.setTriggerEnabled('A' , 1 ) # Enable trigger A days = app.setTriggerEnabled('B' , 0 ) # Disable trigger B
|
|
Obtain the name of all stations in the project. ㆍ station is a form of lists. Example)
StationNames = app.stationNames(); # Read the name of all stations. for x in StationNames: app.messageBox(x); |
Print a message that contains the trend group name through a loop. |
|
Return today's sunset time of system location. ㆍ Return the list in Hour:Minute:Second format. Example)
hour , minute, second = app.todaySystemSunsetTime() # Return today's sunset time of system location. print "Sunset Time Time : ", hour, ':', minute, ':', second
|
Result)
Sunset Time : 19 : 44 : 0 |
Users can check the location in the [Data Explorer]-[Region Setting] tab. |
|
Return today's sunrise time of system location. ㆍ Return the list in Hour:Minute:Second format. Example)
hour , minute, second = app.todaySystemSunriseTime() # Return today's sunrise time of system location. print "Sunrise Time : ", hour, ':', minute, ':', second |
Result)
Sunrise Time : 5 : 32 : 0 |
Users can check the location in the [Data Explorer]-[Region Setting] tab. |
|
Convert the local date time into UTC Date time. Example)
import datetime local = datetime.datetime(2015,11,17,10,10,0); # 17, November, 2015, 10:10:00 app.messageBox(local); UTC = app.toUtcDateTime(local); # Convert the local date time into UTC Date time. app.messageBox(UTC); |
Read the name of all trend groups stored in Data Explorer. ㆍ Return value is a form of a list. Example)
TrandNames = app.trandSetNames(); # Read the name of trend groups as a list. for x in TrandNames: app.messageBox(x);
|
Print a message contains the name of trend groups through a loop. |
|
Return the value that rounded off the numbers to set decimal places. Example)
num = 23.1284; num=app.trimDecimal(num, 2); # Round off 23.1284 to three decimal places. app.messageBox(num);
|
Set two decimal places and print. |
|
PowerScene program waits for a set of period. ㆍ 1000 msec equals a second. Example)
app.wait(1000); # wait for a second.
|
Read the list of analog points in the station. Example)
pointnames = app.analogPointNamesByStation('LP1'); # Read the name of analog points in station LP1. print pointnames |
Read the list of status points in the station. Example)
pointnames = app.statusPointNamesByStation('LP1'); # Read the name of status points in the station LP1. print pointnames |
모든 트랜드 그룹의 수집을 활성화하거나 비활성화합니다. ㆍ 수집 활성화 : 1 입력 ㆍ 수집 비활성화 : 0 입력 예)
app.setTrandSetEnabled(1); # 모든 트랜드 그룹의 수집을 활성화합니다. app.setTrandSetEnabled(0); # 모든 트랜드 그룹의 수집을 비활성화합니다. |
Return whether the trend set is saving. ㆍ Enabled : Return TRUE ㆍ Disabled : Return FALSE Example)
app.isTrendSetEnabled('Trend set'); # Return whether the trend set is saving. |
Return the communication group channel. Example)
app.commChennelGroupNames(); # Return the communication group channel. |
Change the mouse pointer to the shape of an hourglass. when the executing time takes longer, it can change the mouse pointer to the shape of an hourglass to represent the working state. Example)
app.showWaitCursor(); # Change the mouse pointer to the shape of an hourglass. |
Restore the mouse pointer to the default. Example)
app.restoreCursor(); # Restore the mouse pointer to the default. |
Open the point browser. Example)
app.openPointBrowser(); # Open the point browser. |
Open the number keypad.
Example)
result , value = app.openNumberKeypad() if ( result == 0 ): app.messageBox('Cancel','Cancel the input') else: print value |
Result) |
입력한 이력 데이터 그룹의 수집을 활성화하거나 비활성화합니다. ㆍ 수집 활성화 : 1 입력 ㆍ 수집 비활성화 : 0 입력 예)
app.setDataGroupEnabled('이력 데이터 그룹명',1); # 이력 데이터 그룹의 수집을 활성화합니다. app.setDataGroupEnabled('이력 데이터 그룹명',0); # 이력 데이터 그룹의 수집을 비활성화합니다. |
||||
|
미리 등록된 파워씬 리포트 양식으로 리포트를 생성하고 엽니다.
ㆍ reportName 에는 엑셀로 미리 등록된 파워씬 리포트명을 입력합니다. 예)
app.openReport('도시 리포트', 2022, 4, 12) |
|
사용자가 설정한 표현식 스크립트를 msec(1000=1초) 간격으로 실행합니다.
※ app.setInterval() 로 설정된 스크립트는 전역으로 실행되어 해당 캔버스가 닫혀도 계속 실행됩니다.
예)
app.setInterval('app.playSound("soundfile")', 5000) |
5초마다 app.playSound("soundfile") 스크립트가 실행됩니다. |
사용자가 설정한 표현식 스크립트를 중지합니다.
예)
app.stopInterval('app.playSound("soundfile")') |
입력한 포인트값이 변경될 때 등록된 이벤트 핸들러 함수가 실행됩니다.
ㆍ func 에는 실행될 핸들러 함수를 입력합니다. ㆍ 핸들러 함수의 name 에는 변경된 포인트값의 이름이 전달됩니다. ㆍ 핸들러 함수의 value 에는 변경된 포인트값이 전달됩니다. ㆍ pointNames 에는 포인트명을 리스트형태로 입력합니다. ※ app.connectValueChange() 로 설정된 이벤트 핸들러 함수는 전역으로 실행되어 해당 캔버스가 닫혀도 계속 실행됩니다. 예)
def handleChange(name, value): if name == 'COM.1 충전상태': if value == 0: app.playSound("alarm.wav") elif value == 1: app.playSound("confirm.wav") lst = ['COM.1 충전상태', 'COM.2 충전상태'] app.connectValueChange(handleChange, lst) |
'COM.1 충전상태', 'COM.2 충전상태' 포인트값의 변경에 따라 사운드를 재생합니다. |