blob: 6bf5a716477e30b9fa8c090ea2afb0ccd2dcbdf3 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2000-2019 Ericsson Telecom AB //
// //
// All rights reserved. This program and the accompanying materials //
// are made available under the terms of the Eclipse Public License v2.0 //
// which accompanies this distribution, and is available at //
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: EPTF_CLL_UIHandlerVariableUI_Functions
//
// Purpose:
// This module contains VariableUI functions of EPTF CLL UIHandler.
//
// Module Parameters:
//
// Module depends on:
// <EPTF_CLL_UIHandlerClient_Functions>
// <EPTF_CLL_UIHandler_Definitions>
// <XTDP_PDU_Defs>
// <EPTF_CLL_UIHandler_VariableUI_Definitions>
// <EPTF_CLL_UIHandler_Widget_Functions>
// <EPTF_CLL_Logging_Definitions>
// <EPTF_CLL_Logging_Functions>
// <EPTF_CLL_LoggingUI_Definitions>
// <EPTF_CLL_LoggingUI_Functions>
// <EPTF_CLL_LoggingUIClient_Functions>
// <EPTF_CLL_UIHandlerClient_Definitions>
// <EPTF_CLL_Base_Functions>
// <EPTF_CLL_Variable_Definitions>
// <EPTF_CLL_Variable_Functions>
//
// Current Owner:
// Zsolt Szalai (EZSOSZA)
//
// Last Review Date:
// 2010-xx-xx
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////
module EPTF_CLL_UIHandlerVariableUI_Functions
// [.objid{ itu_t(0) identified_organization(4) etsi(0)
// identified_organization(127) ericsson(5) testing(0)
// <put further nodes here if needed>}]
{
// import EPTF_CLL_UIHandler_VariableUI_Definitions all;
import from EPTF_CLL_UIHandlerClient_Functions all;
import from EPTF_CLL_UIHandler_Definitions all;
import from EPTF_CLL_UIHandlerVariableUI_Definitions all;
import from EPTF_CLL_UIHandler_WidgetFunctions all;
import from EPTF_CLL_Logging_Definitions all;
import from EPTF_CLL_Logging_Functions all;
import from EPTF_CLL_LoggingUI_Definitions all;
import from EPTF_CLL_LoggingUIClient_Functions all;
import from EPTF_CLL_UIHandlerClient_Definitions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_Variable_Definitions all;
import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all;
//===========================================================================
// Module parameters
//===========================================================================
modulepar boolean tsp_debug_EPTF_UIHandler_VariableUI := false;
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_init_CT
//
// Purpose:
// Initialize the component
//
// Parameters:
// pl_selfName - *in* *charstring* - the name of the component
// pl_UIHandler - *in* <EPTF_UIHandler_CT> - The UIHandler component of the application
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_init_CT(in charstring pl_selfName,
in EPTF_UIHandler_CT pl_UIHandler,
in EPTF_LoggingUI_CT pl_loggingUi_compRef := null)
runs on EPTF_UIHandler_VariableUI_CT {
if(pl_loggingUi_compRef != null) {
f_EPTF_LoggingUIClient_init_CT(pl_selfName, pl_loggingUi_compRef, pl_UIHandler);
} else {
f_EPTF_Logging_init_CT(pl_selfName);
}
v_UIHandler_VariableUI_loggingMaskId := f_EPTF_Logging_registerComponentMasks(tsp_EPTF_UIHandler_VariableUI_loggingComponentMask, c_EPTF_UIHandler_loggingEventClasses, EPTF_Logging_CLL);
if(tsp_debug_EPTF_UIHandler_VariableUI) {
f_EPTF_Logging_enableLocalMask(v_UIHandler_VariableUI_loggingMaskId, c_EPTF_UIHandler_loggingClassIdx_Debug);
} else {
f_EPTF_Logging_disableLocalMask(v_UIHandler_VariableUI_loggingMaskId, c_EPTF_UIHandler_loggingClassIdx_Debug);
}
if (true != v_VariableUI_initialized) {
// f_EPTF_Var_init_CT(pl_selfName);
f_EPTF_UIHandlerClient_init_CT(pl_selfName, pl_UIHandler);
f_EPTF_Logging_init_CT(pl_selfName);
v_VariableUI_UIHandler := pl_UIHandler;
v_VariableUI_initialized := true;
f_EPTF_Base_registerCleanup(refers(f_EPTF_UIHandler_VariableUI_cleanup_CT));
f_EPTF_UIHandler_VariableUI_debug("----CLL_UIHandler_VariableUI INIT DONE----");
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_logAll
//
// Purpose:
// Log all internal variables in EPTF_UIHandler_VariableUI_CT
//
// Parameters:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_logAll()
runs on EPTF_UIHandler_VariableUI_CT
{
log("------Content of EPTF_UIHandler_VariableUI_CT: -------");
log("v_VariableUI_initialized: ",v_VariableUI_initialized)
log("v_VariableUI_UIHandler: ",v_VariableUI_UIHandler);
log("v_VariableUI_connections: ", v_VariableUI_connections);
log("v_VariableUI_holdingwidgets: ",v_VariableUI_holdingwidgets);
log("v_VariableUI_initparent: ", v_VariableUI_initparent);
log("v_VariableUI_lastput: ", v_VariableUI_lastput);
log("------Finished Content of EPTF_UIHandler_VariableUI_CT -------");
}//f_
private function f_EPTF_UIHandler_VariableUI_cleanup_CT() runs on EPTF_UIHandler_VariableUI_CT{
v_VariableUI_initialized := false;
}
group PutFunctions{
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putVarbyName
//
// Purpose:
// Puts the given(by name) variable to the GUI.
//
// Parameters:
// pl_var - *in* *charstring* - the name of the variable
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putVarbyName(in charstring pl_var) runs on EPTF_UIHandler_VariableUI_CT{
for (var integer i:=0;i<sizeof(v_VariableUI_connections);i:=i+1){
if (v_VariableUI_connections[i].variablename == pl_var){
f_EPTF_UIHandler_VariableUI_putVar(v_VariableUI_connections[i]);
}
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putconnections
//
// Purpose:
// Puts all the variables from the database to the GUI.
//
// Parameters:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putconnections() runs on EPTF_UIHandler_VariableUI_CT{
for(var integer i:=0;i<sizeof(v_VariableUI_connections);i:=i+1){
f_EPTF_UIHandler_VariableUI_putVar(v_VariableUI_connections[i]);
}
v_VariableUI_lastput := sizeof(v_VariableUI_connections);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putlastconnections
//
// Purpose:
// Puts the new variables from the database to the GUI.
//
// Parameters:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putlastconnections() runs on EPTF_UIHandler_VariableUI_CT{
var integer vl_startIndex := v_VariableUI_lastput;
var integer vl_stopIndex := sizeof(v_VariableUI_connections);
v_VariableUI_lastput := vl_stopIndex;
for(var integer i := vl_startIndex; i < vl_stopIndex; i := i + 1)
{
f_EPTF_UIHandler_VariableUI_putVar(v_VariableUI_connections[i]);
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putsimpleconnection
//
// Purpose:
// Puts a variable to the GUI, the item won't be updated the database
//
// Parameters:
// pl_varname - *in* *charstring* - the name of the variable
// pl_widgetid - *in* *charstring* - the widgetid that should be connected to.
// pl_subsMode - *in* <EPTF_Var_SubscriptionMode> - the mode of the subscription [default: timeLine]
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putsimpleconnection(in charstring pl_varname, in charstring pl_widgetid, in EPTF_Var_SubscriptionMode pl_subsMode := timeLine)
runs on EPTF_UIHandler_VariableUI_CT {
var EPTF_UIHandler_VariableUI_Connection conn := c_EPTF_emptyEPTF_UIHandler_VariableUI_Connection;
conn.variablename := pl_varname;
conn.widgetid := pl_widgetid;
conn.subsMode := pl_subsMode;
f_EPTF_UIHandler_VariableUI_putVar(conn);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putwidgetconnection
//
// Purpose:
// Puts a connection to GUI, database not updated.
//
// Parameters:
// pl_varname - *in* *charstring* - the name of the variable
// pl_widgetid - *in* *charstring* - the widgetid that should be connected to.
// pl_widget - *in* *XTDP_XML_Tag* - the widget that should be connected to.
// pl_parentid - *in* *charstring* - the parent widgetid
// pl_holdingname - *in* *charstring* - the name of the holding widget, optional
// pl_subsMode - *in* <EPTF_Var_SubscriptionMode> - the mode of the subscription [default: timeLine]
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putwidgetconnection(in charstring pl_varname,
in charstring pl_widgetid,
in Widgets pl_widget,
in charstring pl_parentid,
in charstring pl_holdingname := "JajO5&%AR.z>r$;!oN7Lvc_f",
in EPTF_Var_SubscriptionMode pl_subsMode := timeLine)
runs on EPTF_UIHandler_VariableUI_CT{
var EPTF_UIHandler_VariableUI_Connection conn := c_EPTF_emptyEPTF_UIHandler_VariableUI_Connection;
conn.variablename := pl_varname;
conn.widgetid := pl_widgetid;
conn.widget := pl_widget;
conn.parentid := pl_parentid;
conn.holdingwidgetRef := f_EPTF_UIHandler_VariableUI_searchholding(pl_holdingname);
conn.subsMode := pl_subsMode;
f_EPTF_UIHandler_VariableUI_putVar(conn);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putsimpleconnectionList
//
// Purpose:
// Adds multiple connections to the GUI, database not updated
//
// Parameters:
// pl_connlist - *in* <EPTF_UIHandler_VariableUI_SimpleConnectionList> - the connections
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putsimpleconnectionList(in EPTF_UIHandler_VariableUI_SimpleConnectionList pl_connlist)
runs on EPTF_UIHandler_VariableUI_CT{
for (var integer i:=0; i<sizeof(pl_connlist); i:=i+1){
f_EPTF_UIHandler_VariableUI_putsimpleconnection(pl_connlist[i].variablename, pl_connlist[i].widgetid);
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putsimpleconnectionWithSubsModeList
//
// Purpose:
// Adds multiple connections (with subscription mode informations) to the GUI, database not updated
//
// Parameters:
// pl_connlist - *in* <EPTF_UIHandler_VariableUI_SimpleConnectionWithSubsModeList> - the connections
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putsimpleconnectionWithSubsModeList(in EPTF_UIHandler_VariableUI_SimpleConnectionWithSubsModeList pl_connlist)
runs on EPTF_UIHandler_VariableUI_CT{
for (var integer i:=0; i<sizeof(pl_connlist); i:=i+1){
if (pl_connlist[i].subsMode == omit){
f_EPTF_UIHandler_VariableUI_putsimpleconnection(pl_connlist[i].variablename, pl_connlist[i].widgetid);
}
else{
f_EPTF_UIHandler_VariableUI_putsimpleconnection(pl_connlist[i].variablename, pl_connlist[i].widgetid, pl_connlist[i].subsMode);
}
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putsinglewidgetconnectionList
//
// Purpose:
// Adds multiple connections to the GUI, with a single widget, database not updated
//
// Parameters:
// pl_connlist - *in* <EPTF_UIHandler_VariableUI_SimpleConnectionList> - the connections
// pl_widget - *in* *XTDP_XML_Tag* - the widget
// pl_parentid - *in* *charstring* - the parent widgetid
// pl_holdingname - *in* *charstring* - the name of the holding widget, optional
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putsinglewidgetconnectionList(in EPTF_UIHandler_VariableUI_SimpleConnectionList pl_connlist,
in Widgets pl_widget,
in charstring pl_parentid,
in charstring pl_holdingname := "JajO5&%AR.z>r$;!oN7Lvc_f")
runs on EPTF_UIHandler_VariableUI_CT{
if (sizeof(pl_connlist)>0){
f_EPTF_UIHandler_VariableUI_putwidgetconnection(pl_connlist[0].variablename,
pl_connlist[0].widgetid,
pl_widget,
pl_parentid,
pl_holdingname);
for (var integer i:=1; i<sizeof(pl_connlist); i:=i+1){
f_EPTF_UIHandler_VariableUI_putsimpleconnection(pl_connlist[i].variablename, pl_connlist[i].widgetid);
}
} else {
f_EPTF_UIHandler_VariableUI_putwidgetconnection("",
"",
pl_widget,
pl_parentid,
pl_holdingname);
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_putsinglewidgetconnectionWithSubsModeList
//
// Purpose:
// Adds multiple connections (with subscription mode informations) to the GUI, with a single widget, database not updated
//
// Parameters:
// pl_connlist - *in* <EPTF_UIHandler_VariableUI_SimpleConnectionWithSubsModeList> - the connections
// pl_widget - *in* *XTDP_XML_Tag* - the widget
// pl_parentid - *in* *charstring* - the parent widgetid
// pl_holdingname - *in* *charstring* - the name of the holding widget, optional
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_putsinglewidgetconnectionWithSubsModeList(in EPTF_UIHandler_VariableUI_SimpleConnectionWithSubsModeList pl_connlist,
in Widgets pl_widget,
in charstring pl_parentid,
in charstring pl_holdingname := "JajO5&%AR.z>r$;!oN7Lvc_f")
runs on EPTF_UIHandler_VariableUI_CT{
if (sizeof(pl_connlist)>0){
if (pl_connlist[0].subsMode == omit){
f_EPTF_UIHandler_VariableUI_putwidgetconnection(pl_connlist[0].variablename,
pl_connlist[0].widgetid,
pl_widget,
pl_parentid,
pl_holdingname);
}
else{
f_EPTF_UIHandler_VariableUI_putwidgetconnection(pl_connlist[0].variablename,
pl_connlist[0].widgetid,
pl_widget,
pl_parentid,
pl_holdingname,
pl_connlist[0].subsMode);
}
for (var integer i:=1; i<sizeof(pl_connlist); i:=i+1){
if (pl_connlist[i].subsMode == omit){
f_EPTF_UIHandler_VariableUI_putsimpleconnection(pl_connlist[i].variablename, pl_connlist[i].widgetid);
}
else{
f_EPTF_UIHandler_VariableUI_putsimpleconnection(pl_connlist[i].variablename, pl_connlist[i].widgetid, pl_connlist[i].subsMode);
}
}
} else {
f_EPTF_UIHandler_VariableUI_putwidgetconnection("",
"",
pl_widget,
pl_parentid,
pl_holdingname,
timeLine);
}
}
/* function f_EPTF_UIHandler_VariableUI_putparentwidget(in charstring pl_widget,
in charstring pl_parent)
runs on EPTF_UIHandler_VariableUI_CT{
if (pl_widget != ""){
var EPTF_UIHandlerClient_SubsRet addresult :=
f_EPTF_UIHandlerClient_addElementToGUI(f_EPTF_UIHandler_decodeXUL(pl_widget), pl_parent);
if(not (addresult == sr_Exists or addresult == sr_Success)){
f_EPTF_Logging_error(true, "Adding the widget failed!");
}
v_VariableUI_initparent := true;
}
}*/
}
group Databasefunctions{
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_addsimpleconnection
//
// Purpose:
// Adds a connection to the database
//
// Parameters:
// pl_varname - *in* *charstring* - the name of the variable
// pl_widgetid - *in* *charstring* - the widgetid that should be connected to.
// pl_subsMode - *in* <EPTF_Var_SubscriptionMode> - the mode of the subscription. [default: timeLine]
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_addsimpleconnection(in charstring pl_varname, in charstring pl_widgetid, in EPTF_Var_SubscriptionMode pl_subsMode := timeLine)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
return f_EPTF_UIHandler_VariableUI_addconnection({pl_varname, pl_widgetid, omit, omit, omit, pl_subsMode});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_addsimpleconnectionList
//
// Purpose:
// Adds multiple connections to the database
//
// Parameters:
// pl_connlist - *in* - <EPTF_UIHandler_VariableUI_SimpleConnectionList> - The list of connections
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_addsimpleconnectionList(in EPTF_UIHandler_VariableUI_SimpleConnectionList pl_connlist)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
var integer idx:=0;
for (var integer i:=0; i< sizeof(pl_connlist); i:=i+1){
idx := f_EPTF_UIHandler_VariableUI_addconnection({pl_connlist[i].variablename, pl_connlist[i].widgetid, omit, omit, omit, timeLine});
}
return idx;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_addsimpleconnectionWithSubsModeList
//
// Purpose:
// Adds multiple connections to the database
//
// Parameters:
// pl_connlist - *in* - <EPTF_UIHandler_VariableUI_SimpleConnectionWithSubsModeList> - The list of connections
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_addsimpleconnectionWithSubsModeList(in EPTF_UIHandler_VariableUI_SimpleConnectionWithSubsModeList pl_connlist)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
var integer idx:=0;
for (var integer i:=0; i< sizeof(pl_connlist); i:=i+1){
if (pl_connlist[i].subsMode == omit){
idx := f_EPTF_UIHandler_VariableUI_addconnection({pl_connlist[i].variablename, pl_connlist[i].widgetid, omit, omit, omit, omit});
}
else{
idx := f_EPTF_UIHandler_VariableUI_addconnection({pl_connlist[i].variablename, pl_connlist[i].widgetid, omit, omit, omit, pl_connlist[i].subsMode});
}
}
return idx;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_widgetaddconnection
//
// Purpose:
// Adds a connection to the database
//
// Parameters:
// pl_varname - *in* *charstring* - the name of the variable
// pl_widgetid - *in* *charstring* - the widgetid that should be connected to.
// pl_widget - *in* *XTDP_XML_Tag* - the widget that should be connected to.
// pl_parentid - *in* *charstring* - the parent widgetid
// pl_subsmode - *in* <EPTF_Var_SubscriptionMode> - the mode of the subscription. [default: timeLine]
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_addwidgetconnection(in charstring pl_varname,
in charstring pl_widgetid,
in Widgets pl_widget,
in charstring pl_parentid,
in EPTF_Var_SubscriptionMode pl_subsMode := timeLine)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
return f_EPTF_UIHandler_VariableUI_addconnection({pl_varname, pl_widgetid, pl_widget, pl_parentid, omit, pl_subsMode});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_addwidgetconnectionList
//
// Purpose:
// Adds multiple connections to the database
//
// Parameters:
// pl_connlist - *in* - <EPTF_UIHandler_VariableUI_WidgetConnectionList> - The list of connections
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_addwidgetconnectionList(in EPTF_UIHandler_VariableUI_WidgetConnectionList pl_connlist)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
var integer idx:=0;
for (var integer i:=0; i< sizeof(pl_connlist); i:=i+1){
if (pl_connlist[i].subsMode == omit){
idx := f_EPTF_UIHandler_VariableUI_addconnection({pl_connlist[i].variablename,
pl_connlist[i].widgetid,
pl_connlist[i].widget,
pl_connlist[i].parentid,
omit,
omit});
}
else{
idx := f_EPTF_UIHandler_VariableUI_addconnection({pl_connlist[i].variablename,
pl_connlist[i].widgetid,
pl_connlist[i].widget,
pl_connlist[i].parentid,
omit,
pl_connlist[i].subsMode});
}
}
return idx;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_addholdingwidget
//
// Purpose:
// Adds a holding widget to the database
//
// Parameters:
// pl_name - *in* *charstring* - the name of the holdingitem
// pl_widget - *in* *XTDP_XML_Tag* - the holding widget.
// pl_parentid - *in* *charstring* - the parent widgetid
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_addholdingwidget(in charstring pl_name, in Widgets pl_widget, in charstring pl_parentid)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
return f_EPTF_UIHandler_VariableUI_addfullholdingwidget({pl_name, false, pl_widget, pl_parentid});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_assignholdingwidget
//
// Purpose:
// Assigns a connection to a holding widget, by names
//
// Parameters:
// pl_varname - *in* *charstring* - the name of the variable
// pl_holdingname - *in* *charstring* - the name of the holding item
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_assignholdingwidget(in charstring pl_varname, in charstring pl_holdingname) runs on EPTF_UIHandler_VariableUI_CT
return boolean{
return f_EPTF_UIHandler_VariableUI_assignholding(f_EPTF_UIHandler_VariableUI_getconnectionIdx(pl_varname),f_EPTF_UIHandler_VariableUI_getholdingwidgetIdx(pl_holdingname));
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_assignholding
//
// Purpose:
// Assigns a connection to a holding widget, by indexes.
//
// Parameters:
// pl_connidx - *in* *integer* - the connection's index
// pl_holdingidx - *in* *integer* - the holdingitem's index
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_assignholding(in integer pl_connidx, in integer pl_holdingidx) runs on EPTF_UIHandler_VariableUI_CT
return boolean{
if (sizeof(v_VariableUI_holdingwidgets)>pl_holdingidx and pl_holdingidx>=0 and sizeof(v_VariableUI_connections)>pl_connidx and pl_connidx >= 0){
v_VariableUI_connections[pl_connidx].holdingwidgetRef := pl_holdingidx;
return true;
} else {
f_EPTF_UIHandler_VariableUI_warning("Outbound index numbers!");
return false;
}
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_removeconnection
//
// Purpose:
// Removes a connection.
//
// Parameters:
// pl_varname - *in* *charstring* - the name of the variable
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
public function f_EPTF_UIHandler_VariableUI_removeconnection(in charstring pl_varname)
runs on EPTF_UIHandler_VariableUI_CT{
var EPTF_UIHandler_VariableUI_ConnectionList connections:={};
for (var integer i:=0;i<sizeof(v_VariableUI_connections);i:=i+1){
if (v_VariableUI_connections[i].variablename != pl_varname){
connections[sizeof(connections)]:=v_VariableUI_connections[i];
}
}
v_VariableUI_connections := connections;
}
}
group PrivateFunctions{
// puts the widget on, if a xul is given and not present in the GUI
// than connects it to the variable if it is not connected already
private function f_EPTF_UIHandler_VariableUI_putVar(inout EPTF_UIHandler_VariableUI_Connection pl_var)
runs on EPTF_UIHandler_VariableUI_CT
{
if (not f_EPTF_UIHandler_VariableUI_putHoldingwidget(pl_var)){
f_EPTF_UIHandler_VariableUI_warning("Error while putting up the HoldingWidget!");
return;
}
if (ispresent(pl_var.widget)){
if (ispresent(pl_var.parentid)){
var Widgets widget := pl_var.widget;
var charstring widgetid := f_EPTF_UIHandler_VariableUI_getidfromXUL(widget);
if (widgetid == ""){ widgetid := pl_var.widgetid;}
if (f_EPTF_UIHandlerClient_widgetExists(widgetid) == wtUnknown){
var EPTF_UIHandlerClient_SubsRet addresult :=
f_EPTF_UIHandlerClient_XSD_addElementToGUI(widget, pl_var.parentid);
if(not (addresult == sr_Exists or addresult == sr_Success)){
f_EPTF_UIHandler_VariableUI_warning("Adding the widget failed!");
return;
}
}
} else {
f_EPTF_UIHandler_VariableUI_warning("Widget give, but it's parent not!");
return;
}
}
if(not (pl_var.variablename == "" and pl_var.widgetid == "")){
if (pl_var.subsMode == omit){
f_EPTF_UIHandlerClient_subscribeMe(pl_var.variablename,
pl_var.variablename,
pl_var.widgetid);
}
else{
f_EPTF_UIHandlerClient_subscribeMe(pl_var.variablename,
pl_var.variablename,
pl_var.widgetid,
pl_var.subsMode);
}
}
}
private function f_EPTF_UIHandler_VariableUI_putHoldingwidget(in EPTF_UIHandler_VariableUI_Connection pl_var)
runs on EPTF_UIHandler_VariableUI_CT
return boolean{
if (ispresent(pl_var.holdingwidgetRef)){
var integer holdingref := pl_var.holdingwidgetRef
if (sizeof(v_VariableUI_holdingwidgets)>holdingref and holdingref>=0){
if (not v_VariableUI_holdingwidgets[holdingref].initialized){
f_EPTF_UIHandler_VariableUI_debug(log2str("FOOO", v_VariableUI_holdingwidgets, holdingref));
if (f_EPTF_UIHandlerClient_widgetExists(f_EPTF_UIHandler_VariableUI_getidfromXUL(v_VariableUI_holdingwidgets[holdingref].widget))
== wtUnknown){
var EPTF_UIHandlerClient_SubsRet addresult :=
f_EPTF_UIHandlerClient_XSD_addElementToGUI(v_VariableUI_holdingwidgets[holdingref].widget, v_VariableUI_holdingwidgets[holdingref].parentid);
if(not (addresult == sr_Exists or addresult == sr_Success)){
f_EPTF_UIHandler_VariableUI_warning("Adding the Holding widget failed!");
return false;
}
}
v_VariableUI_holdingwidgets[holdingref].initialized := true;
} else {
f_EPTF_UIHandler_VariableUI_debug("Holdingwidget already initialized!"); // switch it to false;
return true;
}
} else {
f_EPTF_UIHandler_VariableUI_warning("No such Refererence exists among the Holdigwidgets");
if (holdingref == -1){ return true; }
return false;
}
} else {
return true;
}
return true;
}
// Adding Connections
private function f_EPTF_UIHandler_VariableUI_addconnection(in EPTF_UIHandler_VariableUI_Connection pl_connection)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
var integer size := sizeof(v_VariableUI_connections);
v_VariableUI_connections[size] := pl_connection;
return size;
}
private function f_EPTF_UIHandler_VariableUI_addfullholdingwidget(in EPTF_UIHandler_VariableUI_Holdingwidget pl_holdingwidget)
runs on EPTF_UIHandler_VariableUI_CT
return integer{
var integer size := sizeof(v_VariableUI_holdingwidgets);
v_VariableUI_holdingwidgets[size] := pl_holdingwidget;
return size;
}
private function f_EPTF_UIHandler_VariableUI_getconnectionIdx(in charstring pl_varname) runs on EPTF_UIHandler_VariableUI_CT return integer{
for (var integer i:=0; i<sizeof(v_VariableUI_connections);i:=i+1){
if (v_VariableUI_connections[i].variablename == pl_varname){
return i;
}
}
return -1;
}
function f_EPTF_UIHandler_VariableUI_getholdingwidgetIdx(in charstring pl_holdingname) runs on EPTF_UIHandler_VariableUI_CT return integer{
for (var integer i:=0; i<sizeof(v_VariableUI_holdingwidgets);i:=i+1){
if (v_VariableUI_holdingwidgets[i].name == pl_holdingname){
return i;
}
}
return -1;
}
private function f_EPTF_UIHandler_VariableUI_searchholding(in charstring pl_holdingname) runs on EPTF_UIHandler_VariableUI_CT
return integer{
if (pl_holdingname=="JajO5&%AR.z>r$;!oN7Lvc_f") {return -1;}
for (var integer i:=0; i<sizeof(v_VariableUI_holdingwidgets);i:=i+1){
if (v_VariableUI_holdingwidgets[i].name == pl_holdingname){return i;}
}
return -1;
}
private function f_EPTF_UIHandler_VariableUI_getidfromXUL(in Widgets pl_widget)
runs on EPTF_UIHandler_VariableUI_CT
return charstring {
select(pl_widget){
case({window := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.window.id});
}
case({tabpages := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tabpages.id});
}
/* case({tabs := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tabs.id}); */
/* } */
case({tabpage := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tabpage.id});
}
/* case({tabpanels := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tabpanels.id}); */
/* } */
/* case({tabpanel := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tabpanel.id}); */
/* } */
case({tree := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tree.id});
}
/* case({treecols := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.treecols.id}); */
/* } */
case({treecol := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.treecol.id});
}
/* case({treechildren := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.treechildren.id}); */
/* } */
/* case({treeitem := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.treeitem.id}); */
/* } */
/* case({treerow := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.treerow.id}); */
/* } */
case({treecell := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.treecell.id});
}
case({hbox := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.hbox.id});
}
case({label_ := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.label_.id});
}
case({spacer := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.spacer.id});
}
case({button := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.button.id});
}
case({textbox := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.textbox.id});
}
case({chart := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.chart.id});
}
/* case({tracelist := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.tracelist.id}); */
/* } */
case({toolbar := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.toolbar.id});
}
/* case({toolbarelements := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.toolbarelements.id}); */
/* } */
case({toolbarbutton := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.toolbarbutton.id});
}
/* case({separator := ?}){ */
/* return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.separator.id}); */
/* } */
case({listbox := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.listbox.id});
}
case({listitem := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.listitem.id});
}
case({numericalwidget := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.numericalwidget.id});
}
case({menulist := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.menulist.id});
}
case({menuitem := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.menuitem.id});
}
case({image := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.image.id});
}
case ({distributionchart := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.distributionchart.id});
}
case ({valuelist := ?}){
return f_EPTF_UIHandler_XULWidgetId2charstr({pl_widget.valuelist.id});
}
case else{
f_EPTF_UIHandler_VariableUI_debug("Unhandled widget, or widget with no id field");
return "";
}
}
}
}
group Logging {
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUIr_error
//
// Purpose:
// Function to log an error from UIHandler_VariableUI feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_UIHandler_VariableUI_error(in charstring pl_message)
runs on EPTF_UIHandler_VariableUI_CT
{
f_EPTF_Logging_error(true, tsp_EPTF_UIHandler_VariableUI_loggingComponentMask&": "&pl_message);
f_EPTF_Base_stopAll();
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_warning
//
// Purpose:
// Function to log a warning from UIHandler_VariableUI feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_UIHandler_VariableUI_warning(in @lazy charstring pl_message)
runs on EPTF_UIHandler_VariableUI_CT
{
f_EPTF_Logging_warningV2(pl_message, v_UIHandler_VariableUI_loggingMaskId, {c_EPTF_UIHandler_loggingClassIdx_Warning});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_VariableUI_debug
//
// Purpose:
// Function to log a debug message from UIHandler_VariableUI feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_UIHandler_VariableUI_debug(in @lazy charstring pl_message)
runs on EPTF_UIHandler_VariableUI_CT
{
f_EPTF_Logging_debugV2(pl_message, v_UIHandler_VariableUI_loggingMaskId, {c_EPTF_UIHandler_loggingClassIdx_Debug});
}
///////////////////////////////////////////////////////////
// Function: f_UIHandler_VariableUI_UIHandler_debugEnabled
//
// Purpose:
// Function to check if debug is enabled for UIHandler_VariableUI
//
// Parameters:
// -
//
// Return Value:
// *boolean* - true if debug enalbed
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
private function f_EPTF_UIHandler_VariableUI_debugEnabled()
runs on EPTF_UIHandler_VariableUI_CT
return boolean
{
return f_EPTF_Logging_isEnabled(v_UIHandler_VariableUI_loggingMaskId, c_EPTF_UIHandler_loggingClassIdx_Debug);
}
} // group Logging
}