| /////////////////////////////////////////////////////////////////////////////// |
| // // |
| // 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_TimeProfileEditor_Functions |
| // |
| // Purpose: |
| // This TTCN-3 module contains functions for EPTF Time Profile Editor |
| // |
| // Module depends on: |
| // <EPTF_CLL_TimeProfileEditor_Definitions> |
| // <EPTF_CLL_TimeProfileEditor_XTDPTemplates> |
| // <EPTF_CLL_ExecCtrlTimeProfile_Definitions> |
| // <EPTF_CLL_Common_Definitions> |
| // <EPTF_CLL_Common_Functions> |
| // <TCCEncoding_Functions> |
| // <TCCFileIO_Functions> |
| // <ttcn_ericsson_se_protocolModules_xtdp_xtdl> |
| // <ttcn_ericsson_se_protocolModules_xtdp_xtdp> |
| // <IPL4asp_Types> |
| // <EPTF_CLL_TransportIPL4_Functions> |
| // <EPTF_CLL_Base_Functions> |
| // <EPTF_CLL_Transport_CommonDefinitions> |
| // <XTDP_EncDecFunctions> |
| // |
| // Module Parameters: |
| // - |
| // |
| // Current Owner: |
| // Janos Zoltan Svaner (ejnosvn) |
| // |
| // Last Review Date: |
| // 2008-??-?? |
| // |
| // Detailed Comments: |
| // - |
| // |
| /////////////////////////////////////////////////////////// |
| |
| module EPTF_CLL_TimeProfileEditor_Functions |
| { |
| |
| //========================================================================= |
| // Import Part |
| //========================================================================= |
| |
| import from EPTF_CLL_TimeProfileEditor_Definitions all; |
| import from EPTF_CLL_TimeProfileEditor_XTDPTemplates all; |
| import from EPTF_CLL_ExecCtrlTimeProfile_Definitions all; |
| import from EPTF_CLL_Common_Definitions all; |
| import from EPTF_CLL_Common_Functions all; |
| import from TCCFileIO_Functions all; |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all; |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdp all; |
| import from IPL4asp_Types all; |
| import from EPTF_CLL_TransportIPL4_Functions all; |
| import from EPTF_CLL_Base_Functions all; |
| import from EPTF_CLL_Transport_CommonDefinitions all; |
| import from XTDP_EncDecFunctions all; |
| |
| //========================================================================= |
| // Functions |
| //========================================================================= |
| |
| /////////////////////////////////////////////////////////// |
| // Function: f_EPTF_TimeProfileEditor_init_CT |
| // |
| // Purpose: |
| // Function to initialize the TimeProfileEditor feature |
| // |
| // Parameters: |
| // pl_selfName - *in charstring* - The name of the component |
| // |
| // Return Value: |
| // - |
| // |
| /////////////////////////////////////////////////////////// |
| public function f_EPTF_TimeProfileEditor_init_CT(in charstring pl_selfName) runs on MAIN_CT { |
| if (v_EPTF_TimeProfileEditor_initialized) { |
| return; |
| } |
| f_EPTF_Base_init_CT(pl_selfName); |
| f_EPTF_Transport_init(IPL4, pl_selfName) |
| |
| f_EPTF_Transport_registerMsgLenCallback4LGenType(IPL4, refers(f_EPTF_TimeProfileEditor_getMsgLen_XTDP), {}, c_EPTF_TimeProfileEditor_LGenType); |
| f_EPTF_Transport_registerMsgCallback(IPL4, c_EPTF_TimeProfileEditor_LGenType, refers(f_EPTF_TimeProfileEditor_HandleMsgs_XTDP), refers(f_EPTF_TimeProfileEditor_HandleEvent_XTDP)); |
| f_EPTF_Base_registerCleanup(refers(f_EPTF_TimeProfileEditor_cleanup_CT)); |
| |
| f_EPTF_TPE_init_global_variables(); |
| f_EPTF_TPE_open_listening_port(); |
| f_EPTF_TPE_init_time_sequences_properties_tree(1); |
| f_EPTF_TPE_init_time_profiles_properties_tree(1); |
| v_EPTF_TimeProfileEditor_initialized := true; |
| } |
| |
| private function f_EPTF_TimeProfileEditor_cleanup_CT() runs on MAIN_CT { |
| v_EPTF_TimeProfileEditor_initialized := false; |
| if(connectionId > -1){ |
| var Result vl_result; |
| f_EPTF_Transport_close(IPL4, connectionId, vl_result); |
| connectionId := -1; |
| } |
| f_EPTF_Transport_registerMsgCallback(IPL4, c_EPTF_TimeProfileEditor_LGenType, null, null); |
| } |
| |
| private function f_EPTF_TimeProfileEditor_getMsgLen_XTDP |
| ( |
| in EPTF_Transport_TransportType pl_transportType, |
| in octetstring pl_stream, |
| inout EPTF_IntegerList pl_args |
| ) |
| return integer |
| { |
| if (lengthof(pl_stream)<4) |
| { |
| return -1 |
| } |
| else |
| { |
| return oct2int(substr(pl_stream,0, 4)) |
| } |
| } |
| |
| private function f_EPTF_TimeProfileEditor_getRawMsg_XTDP(in octetstring stream) return octetstring |
| { |
| if (lengthof(stream) <4) { |
| return ''O |
| } else { |
| return substr(stream,4, lengthof(stream)-4) |
| } |
| } |
| |
| private function f_EPTF_TimeProfileEditor_HandleEvent_XTDP( |
| in EPTF_Transport_TransportType pl_transportType, |
| in ConnectionId pl_connId, |
| in PortEvent pl_event) |
| runs on MAIN_CT |
| { |
| if(ischosen(pl_event.connClosed)){ |
| if(pl_event.connClosed.connId == connectionId) { |
| connectionId := -1; |
| f_EPTF_Common_user(log2str("GUI with connection id: ", pl_event.connClosed.connId, " closed the connection.")); |
| |
| } |
| else { |
| connectionId := -1; |
| f_EPTF_Common_user(log2str("GUI with client id: ", pl_event.connClosed.connId, " closed the connection.")); |
| } |
| } |
| if(ischosen(pl_event.connOpened)){ |
| if(connectionId == -1) { |
| f_EPTF_Common_user(log2str("New GUI connection is accepted from ", pl_event.connOpened.remName, ":", pl_event.connOpened.remPort)); |
| connectionId := pl_event.connOpened.connId; |
| |
| f_EPTF_TPE_create_gui(); |
| f_EPTF_TPE_send_model_to_gui(); |
| } |
| else { |
| f_EPTF_Common_user(log2str("A GUI is already connected with connection id ", connectionId, " new connection is closed.")); |
| var Result vl_result; |
| f_EPTF_Transport_close(IPL4, pl_event.connOpened.connId, vl_result); |
| } |
| } |
| |
| } |
| |
| private function f_EPTF_TimeProfileEditor_unichar2charstring(in universal charstring pl_uni) |
| return charstring{ |
| var charstring vl_char := ""; |
| for (var integer vl_i:= 0;vl_i<lengthof(pl_uni);vl_i:=vl_i+1) |
| { |
| vl_char := vl_char & int2char(unichar2int(pl_uni[vl_i])); |
| } |
| return vl_char |
| } |
| |
| private function f_EPTF_TimeProfileEditor_HandleMsgs_XTDP( |
| in EPTF_Transport_TransportType pl_transportType, |
| in ConnectionId pl_connId, |
| in HostName pl_remHost, |
| in PortNumber pl_remPort, |
| in HostName pl_locHost, |
| in PortNumber pl_locPort, |
| in ProtoTuple pl_proto, |
| in integer pl_userData, |
| in octetstring pl_msg) runs on MAIN_CT { |
| |
| var integer vl_connId := pl_connId; |
| var XTDP_Message vl_receivedMessage; |
| |
| var integer vl_succ := XTDP_EncDecFunctions.dec_XTDP_Message(f_EPTF_TimeProfileEditor_getRawMsg_XTDP(pl_msg), vl_receivedMessage); |
| if(isbound(vl_receivedMessage.choice)){ |
| if (ischosen(vl_receivedMessage.choice.xTDP_Requests)) { |
| select(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.widget.widgetId){ |
| case ("new_sequence_button") { |
| f_EPTF_TPE_handle_add_time_sequence(""); |
| } |
| case ("new_profile_button") { |
| f_EPTF_TPE_handle_add_profile(""); |
| |
| } |
| case ("new_sequence_textbox") { |
| f_EPTF_TPE_handle_add_time_sequence(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("new_profile_textbox") { |
| f_EPTF_TPE_handle_add_profile(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("remove_sequence_button") { |
| f_EPTF_TPE_handle_remove_time_sequence(); |
| |
| } |
| case ("remove_profile_button") { |
| f_EPTF_TPE_handle_remove_profile(); |
| |
| } |
| case (c_timeSequenceListboxId) { |
| f_EPTF_TPE_handle_time_sequence_listbox_change(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| } |
| case (c_profileListboxId) { |
| f_EPTF_TPE_handle_profile_listbox_change(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("before_row_numwidget") { |
| f_EPTF_TPE_display_error(""); |
| currentBeforeRow := str2int(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("before_profile_row_numwidget") { |
| f_EPTF_TPE_display_error(""); |
| currentBeforeProfileRow := str2int(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("add_time_sequence_row_button") { |
| f_EPTF_TPE_handle_add_time_sequence_row(); |
| |
| } |
| case ("add_profile_row_button") { |
| f_EPTF_TPE_handle_add_profile_row(); |
| |
| } |
| case ("remove_row_numwidget") { |
| f_EPTF_TPE_handle_remove_row_numwidget_change(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("remove_profile_row_numwidget") { |
| f_EPTF_TPE_handle_remove_profile_row_numwidget_change(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("remove_time_sequence_row_button") { |
| f_EPTF_TPE_handle_remove_time_sequence_row(); |
| |
| } |
| case ("remove_profile_row_button") { |
| f_EPTF_TPE_handle_remove_profile_row(); |
| |
| } |
| case ("time_unit_menu") { |
| f_EPTF_TPE_handle_time_unit_change(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("time_sequence_menu") { |
| f_EPTF_TPE_handle_time_sequence_menu_change(f_EPTF_TimeProfileEditor_unichar2charstring(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| |
| } |
| case ("save_button") { |
| f_EPTF_TPE_handle_save_putton_pressed(); |
| |
| } |
| case ("exit_ttcn_button") { |
| f_EPTF_TPE_handle_exit_putton_pressed(); |
| // TTCN will exit here |
| } |
| case else{ |
| f_EPTF_TPE_handle_tree_change( unichar2char(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.widget.widgetId), |
| unichar2char(vl_receivedMessage.choice.xTDP_Requests.xTDP_Request_list[0].action_.choice.put.argument_list[0])); |
| } |
| } |
| } |
| else if (ischosen(vl_receivedMessage.choice.xTDP_Responses)) { |
| if(v_newTimeSequenceNameRequestId == vl_receivedMessage.choice.xTDP_Responses.xTDP_Response_list[0].requestId |
| and success == vl_receivedMessage.choice.xTDP_Responses.xTDP_Response_list[0].responseCode){ |
| f_EPTF_TPE_handle_add_time_sequenceIn(unichar2char(vl_receivedMessage.choice.xTDP_Responses.xTDP_Response_list[0].argument)); |
| } |
| if(v_newTimeProfileRequestId == vl_receivedMessage.choice.xTDP_Responses.xTDP_Response_list[0].requestId |
| and success == vl_receivedMessage.choice.xTDP_Responses.xTDP_Response_list[0].responseCode){ |
| f_EPTF_TPE_handle_add_profileIn(unichar2char(vl_receivedMessage.choice.xTDP_Responses.xTDP_Response_list[0].argument)); |
| } |
| } |
| else if (ischosen(vl_receivedMessage.choice.xTDP_ARResponses)) { |
| for(var integer vl_listi := 0; vl_listi < sizeof(vl_receivedMessage.choice.xTDP_ARResponses.xTDP_ARResponse_list); vl_listi := vl_listi + 1){ |
| if(not (vl_receivedMessage.choice.xTDP_ARResponses.xTDP_ARResponse_list[vl_listi].responseCode == success)){ |
| f_EPTF_TPE_display_error("Unhandled GUI message received. Response that is not a success!" & log2str(vl_receivedMessage)); |
| f_EPTF_Common_user("Unhandled GUI message received. Response that is not a success!" & log2str(vl_receivedMessage)); |
| } |
| } |
| } |
| else if (ischosen(vl_receivedMessage.choice.xTDP_Bye)) { |
| var Result vl_result; |
| f_EPTF_Transport_close(IPL4, connectionId, vl_result); |
| connectionId := -1; |
| } |
| else if (ischosen(vl_receivedMessage.choice.xTDP_HandshakeRequest)) { |
| var ttcn_ericsson_se_protocolModules_xtdp_xtdp.XTDP_Message vl_messageToSend := { |
| transactionID := vl_receivedMessage.transactionID, |
| choice := { |
| xTDP_Outcome := { |
| responseCode := success, |
| errorCode_list := { |
| }, |
| errorMessage := omit |
| ,elem_list := {} |
| } |
| } |
| } |
| if ( |
| vl_receivedMessage.choice.xTDP_HandshakeRequest.xtdpRequiredVersion != c_EPTF_TPE_xtdpMyVersion |
| or vl_receivedMessage.choice.xTDP_HandshakeRequest.xtdlRequiredVersion != c_EPTF_TPE_xtdlMyVersion |
| ) { |
| // version mismatch |
| vl_messageToSend := { |
| transactionID := vl_receivedMessage.transactionID, |
| choice := { |
| xTDP_Outcome := { |
| responseCode := error_, |
| errorCode_list := { |
| }, |
| errorMessage := "Version mismatch detected during handshake. Suppored XTDP/XDTL versions: " |
| &log2str(c_EPTF_TPE_xtdpMyVersion)&"/"&log2str(c_EPTF_TPE_xtdlMyVersion) |
| ,elem_list := {} |
| } |
| } |
| } |
| // add error codes: |
| if (vl_receivedMessage.choice.xTDP_HandshakeRequest.xtdpRequiredVersion != c_EPTF_TPE_xtdpMyVersion) { |
| vl_messageToSend.choice.xTDP_Outcome.errorCode_list := vl_messageToSend.choice.xTDP_Outcome.errorCode_list & {xtdpIncompatibleVersion}; |
| } |
| if (vl_receivedMessage.choice.xTDP_HandshakeRequest.xtdlRequiredVersion != c_EPTF_TPE_xtdlMyVersion) { |
| vl_messageToSend.choice.xTDP_Outcome.errorCode_list := vl_messageToSend.choice.xTDP_Outcome.errorCode_list & {xtdlIncompatibleVersion}; |
| } |
| } else { |
| // successful handshake |
| v_handshakeSuccessful := vl_connId; |
| } |
| //send response: |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(vl_messageToSend); |
| connectionId := vl_connId; |
| //create the gui |
| f_EPTF_TPE_create_gui(); |
| f_EPTF_TPE_send_model_to_gui(); |
| } else { |
| f_EPTF_TPE_display_error("Unhandled GUI message received."& log2str(vl_receivedMessage)); |
| f_EPTF_Common_user("Unhandled GUI message received."& log2str(vl_receivedMessage)); |
| } |
| } else { |
| f_EPTF_TPE_display_error("Unhandled GUI message received because decoding fails."); |
| f_EPTF_Common_user("Unhandled GUI message received because decoding fails."); |
| } |
| } |
| |
| private function f_EPTF_TPE_init_global_variables() runs on MAIN_CT { |
| timeSequenceList := tsp_EPTF_ExecCtrl_TimeProfileDescrList; |
| profileList := tsp_EPTF_ExecCtrl_TimeProfileList; |
| currentTimeUnit := tsp_TimeProfileEditor_DisplayedTimeUnit; |
| if(currentTimeUnit == "hours") { |
| currentTimeUnitMultiplier := 3600.0; |
| } else if(currentTimeUnit == "minutes") { |
| currentTimeUnitMultiplier := 60.0; |
| } else if(currentTimeUnit == "seconds") { |
| currentTimeUnitMultiplier := 1.0; |
| } else { |
| f_EPTF_TPE_display_error("Unhandled time unit: " & currentTimeUnit); |
| } |
| } |
| |
| private function f_EPTF_TPE_open_listening_port() runs on MAIN_CT { |
| // timer t_wait := 5.0; t_wait.start; |
| var Result vl_result; |
| var integer vl_listenSuccess := f_EPTF_Transport_listen( IPL4, {tcp := {}}, tsp_TimeProfileEditor_GuiPortListenAddr, tsp_TimeProfileEditor_GuiPortListenPort, c_EPTF_TimeProfileEditor_LGenType, vl_result, true) |
| if(vl_listenSuccess > -1){ |
| if(vl_result.connId == -1) { |
| f_EPTF_Common_user(log2str("Could not open listening port: ", tsp_TimeProfileEditor_GuiPortListenAddr, ":", tsp_TimeProfileEditor_GuiPortListenPort)); |
| stop; |
| } |
| else { |
| f_EPTF_Common_user("Listening port successfully opened."); |
| } |
| } |
| if (ispresent(vl_result.errorCode) and (vl_result.errorCode != ERROR_TEMPORARILY_UNAVAILABLE)) { |
| f_EPTF_Common_user("Could not open listening port: " & log2str(vl_result)); |
| } |
| } |
| |
| private function f_EPTF_TPE_nextRequestId() runs on MAIN_CT return integer { |
| lastRequestId := lastRequestId + 1; |
| return lastRequestId; |
| } |
| |
| private function f_EPTF_TimeProfileEditor_sendXTDPMessage( |
| in XTDP_Message pl_message ) runs on MAIN_CT { |
| f_EPTF_Common_user("Send happening:"& log2str( xtdp_message)); |
| var Result vl_result; |
| f_EPTF_Transport_send(IPL4, connectionId, f_EPTF_TPE_appendLength_XTDP(XTDP_EncDecFunctions.enc_XTDP_Message(pl_message)), vl_result, false) |
| } |
| |
| private function f_EPTF_TPE_init_images() runs on MAIN_CT { |
| const charstring c_XTDP_Image_Ok := "iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0
U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKTSURBVHjaYvz//z8DLQBAADEx0AgABBDN
DAYIIBZGRkaqGca3ikGBlYmhnpWZIQAggBgZFzLsBwZzIUMCwwWyTZzPoMAANJCZEWgKA8MHZmYG
R4AAYmSYzfAeLPmPwZEhnUTDZwINZGSo5+LgSvj28xsDkP0AiAMZkhkuAAQQE8Mvhg3ifOICDH8Y
9jNMZjAgysBJQAOnMMznYOa472DokKAiosIANOcCw28GQ5ChICUAAQQyeCPQFgYzBzMBoMR+hh48
hvcADexlmM/KzHpf01gzwSPUg+HKjSsMl25eOgB0mCNDJsMHmFKAAGJg6GIQYOhg+K/9Xfu/xGWJ
/0D2e4Y2NMNbgQa2M8xn6mf6L3hE8L/GDw2weu553P8ZOoEhjAUABBAkSTQx7GcOZXZgUmdi+HPx
D8P/Tf8/MPwHuuA/0AXAMGTgBEaKOQMDixkLAyMHUMsLBoY/i4Hqfv5fwFDHkIjNYIAAYgGTPxk2
/r301+Gv/F8GBnU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csp04xEQICbxgZpTiuPe9z/Mw7mPOm7ygIqgo7luIwzqyXrTkbKxW
y/HkT6vg7CGq5vGfdduQujW+rY6P54vr9/5+cBBT4vZfh+RcRuKcC6X4/+ZOv7kX7h3O6YLiznWe
2vYfEhrg/995S7wAAAAASUVORK5CYII=" |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_ok", |
| imagedata := c_XTDP_Image_Ok, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_configure", |
| imagedata := c_XTDP_Image_Configure, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_play", |
| imagedata := c_XTDP_Image_Play, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_pause", |
| imagedata := c_XTDP_Image_Pause, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_stop", |
| imagedata := c_XTDP_Image_Stop, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_exit", |
| imagedata := c_XTDP_Image_Exit, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_shred", |
| imagedata := c_XTDP_Image_Shred, |
| imageurl := omit |
| } |
| } |
| }, |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| image := { |
| id := "image_save", |
| imagedata := c_XTDP_Image_Save, |
| imageurl := omit |
| } |
| } |
| }} } |
| } |
| }; |
| |
| |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| |
| |
| |
| |
| } |
| |
| private function f_EPTF_TPE_appendLength_XTDP(in octetstring stream) return octetstring |
| { |
| return int2oct(lengthof(stream)+4,4) & stream |
| } |
| |
| private function f_EPTF_TPE_create_gui() runs on MAIN_CT { |
| timeSequencesPropertiesTreeDisabled := true; |
| profilePropertiesTreeDisabled := true; |
| removeRowDisabled := true; |
| removeProfileRowDisabled := true; |
| |
| // remove all |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := omit |
| } |
| }} |
| } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| // add window |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := omit, |
| widgets := { |
| window := { |
| about := "", |
| height := 386.0, |
| help := "", |
| id := "window", |
| orientation := vertical, |
| title := "Time Profile Editor", |
| width := 820.0, |
| image_list := {}, |
| embeddedwidgets := { embeddedwidget_list := { }} |
| } |
| } |
| } |
| } } } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| f_EPTF_TPE_init_images(); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| tabpages := valueof(ts_xtdp_tabpages("main_tabbox", 1.0, omit, |
| { tabpagegroup_list:= { { tabpage := valueof(ts_xtdp_tabpage("time_sequences_tab","Time sequences", horizontal, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_sequences_hbox", 1.0, omit, horizontal, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_sequences_left_hbox", 1.0, omit, vertical, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_sequences_left_upper_hbox", 0.0, omit, horizontal, { |
| {{ |
| textbox := valueof(ts_xtdp_textbox("new_sequence_textbox", 2.0, omit, false, false, omit, "new_time_sequence_name", omit, omit)) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.0)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("new_sequence_button", 0.5, omit, omit, "New sequence", omit, "image_ok")) |
| }} |
| })) |
| }, |
| { |
| listbox := valueof(ts_xtdp_listbox(c_timeSequenceListboxId, 1.0, omit, 0, single, { listitemgroup_list:= {}})) |
| }, |
| { |
| button := valueof(ts_xtdp_button("remove_sequence_button", 0.0, omit, omit, "Remove selected sequence", omit, "image_shred")) |
| } |
| }})) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("time_sequences_right_hbox", 2.0, omit, vertical, { |
| embeddedwidget_list := {{ |
| hbox := valueof(ts_xtdp_hbox("time_sequences_right_upper_hbox1", 0.0, omit, horizontal, { |
| {{ |
| label_ := valueof(ts_xtdp_label("before_row_label", 0.0, omit, "Before row:")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| numericalwidget := valueof(ts_xtdp_numericalwidget("before_row_numwidget", 1.0, omit, integerField, int2float(currentBeforeRow), omit, true, omit, 1.0, 1000.0, 1.0)) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("add_time_sequence_row_button", 0.0, true, omit, "Add row", omit, "image_ok")) |
| }} |
| })) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("time_sequences_right_upper_hbox2", 0.0, omit, horizontal, { |
| embeddedwidget_list := {{ |
| label_ := valueof(ts_xtdp_label("remove_row_label", 0.0, omit, "Row number:")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| numericalwidget := valueof(ts_xtdp_numericalwidget("remove_row_numwidget", 2.0, true, integerField, 1.0, omit, true, omit, 1.0, 1000.0, 1.0)) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("remove_time_sequence_row_button", 0.5, true, omit, "Remove row", omit, "image_shred")) |
| }} |
| })) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| label_ := valueof(ts_xtdp_label("time_sequences_properties_label", 0.0, omit, "Time sequences properties:")) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("time_sequences_properties_tree_hbox", 1.0, omit, horizontal, { |
| {{ |
| tree := timeSequencesPropertiesTree |
| }} |
| })) |
| }} |
| })) |
| } |
| }})) |
| } |
| }}))}, |
| { tabpage := valueof(ts_xtdp_tabpage("time_profiles_tab", "Time profiles", horizontal, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_profiles_hbox", 1.0, omit, horizontal, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_profiles_left_hbox", 1.0, omit, vertical, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_profiles_left_upper_hbox", 0.0, omit, horizontal, { |
| {{ |
| textbox := valueof(ts_xtdp_textbox("new_profile_textbox", 3.0, omit, false, false, omit, "new_profile_name", omit, omit)) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.0)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("new_profile_button", 0.5, omit, omit, "New profile", omit, "image_ok")) |
| } |
| }})) |
| }, |
| { |
| listbox := valueof(ts_xtdp_listbox(c_profileListboxId, 1.0, omit, 0, single, { listitemgroup_list:= {} })) |
| }, |
| { |
| button := valueof(ts_xtdp_button("remove_profile_button", 0.0, omit, omit, "Remove selected profile", omit, "image_shred")) |
| }} |
| })) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("time_profiles_right_hbox", 2.0, omit, vertical, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_profiles_right_upper_hbox1", 0.0, omit, horizontal, { |
| {{ |
| label_ := valueof(ts_xtdp_label("before_profile_row_label", 0.0, omit, "Before row:")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| numericalwidget := valueof(ts_xtdp_numericalwidget("before_profile_row_numwidget", 1.0, omit, integerField, int2float(currentBeforeRow), omit, true, omit, 1.0, 1000.0, 1.0)) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("add_profile_row_button", 0.0, true, omit, "Add row with sequence:", omit, "image_ok")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| menulist := valueof(ts_xtdp_menulist("time_sequence_menu", 1.0, omit, false, omit, { choice := { menuitemgroups := { menuitemgroup_list := {}}}})) |
| } |
| }})) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("time_profiles_right_upper_hbox2", 0.0, omit, horizontal, { |
| {{ |
| label_ := valueof(ts_xtdp_label("remove_profile_row_label", 0.0, omit, "Row number:")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| numericalwidget := valueof(ts_xtdp_numericalwidget("remove_profile_row_numwidget", 2.0, true, integerField, 1.0, omit, true, omit, 1.0, 1000.0, 1.0)) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("remove_profile_row_button", 0.5, true, omit, "Remove row", omit, omit)) |
| } |
| }})) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| label_ := valueof(ts_xtdp_label("profile_properties_label", 0.0, omit, "Time profile properties:")) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("profile_properties_tree_hbox", 1.0, omit, horizontal, { |
| {{ |
| tree := profilePropertiesTree |
| } |
| }})) |
| } |
| }})) |
| } |
| }})) |
| } |
| }}))}, |
| { tabpage := valueof(ts_xtdp_tabpage("preview_chart_tab", "Preview chart", horizontal, {{{ |
| label_ := valueof(ts_xtdp_label("preview_chart", 0.0, omit, "Please select a time profile on the 'Time profiles' tab!")) |
| }}}))}, |
| { tabpage := valueof(ts_xtdp_tabpage("config_file_tab", "Config file", horizontal, {{ |
| { |
| textbox := valueof(ts_xtdp_textbox("config_file_textbox", 1.0, omit, true, true, 0.0, "Empty config", omit, false)) |
| } |
| }})) |
| }}} |
| )) |
| } |
| } } } } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| hbox := valueof(ts_xtdp_hbox("time_unit_hbox", 0.0, omit, vertical, { |
| {{ |
| hbox := valueof(ts_xtdp_hbox("time_sequences_right_upper_hbox3", 0.0, omit, horizontal, {{ |
| { |
| label_ := valueof(ts_xtdp_label("time_unit_label", 0.0, omit, "Time unit:")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| menulist := valueof(ts_xtdp_menulist("time_unit_menu", 0.0, omit, false, omit, { choice := { menuitemgroups := { menuitemgroup_list:= { |
| {menuitem := valueof(ts_xtdp_menuitem("time_unit_menu_seconds", "seconds", false)) }, |
| {menuitem := valueof(ts_xtdp_menuitem("time_unit_menu_minutes", "minutes", false)) }, |
| {menuitem := valueof(ts_xtdp_menuitem("time_unit_menu_hours", "hours", false))} |
| }}}})) |
| } |
| }})) |
| }} |
| })) |
| } |
| } |
| }}} |
| }; |
| |
| // choose the right item on reconnect |
| if(currentTimeUnit == xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].widgets.hbox.embeddedwidgets.embeddedwidget_list[0].hbox.embeddedwidgets.embeddedwidget_list[2].menulist.menupopup.choice.menuitemgroups.menuitemgroup_list[2].menuitem.label_) { |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].widgets.hbox.embeddedwidgets.embeddedwidget_list[0].hbox.embeddedwidgets.embeddedwidget_list[2].menulist.menupopup.choice.menuitemgroups.menuitemgroup_list[2].menuitem.selected := true; |
| } else if(currentTimeUnit == xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].widgets.hbox.embeddedwidgets.embeddedwidget_list[0].hbox.embeddedwidgets.embeddedwidget_list[2].menulist.menupopup.choice.menuitemgroups.menuitemgroup_list[1].menuitem.label_) { |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].widgets.hbox.embeddedwidgets.embeddedwidget_list[0].hbox.embeddedwidgets.embeddedwidget_list[2].menulist.menupopup.choice.menuitemgroups.menuitemgroup_list[1].menuitem.selected := true; |
| } else if(currentTimeUnit == xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].widgets.hbox.embeddedwidgets.embeddedwidget_list[0].hbox.embeddedwidgets.embeddedwidget_list[2].menulist.menupopup.choice.menuitemgroups.menuitemgroup_list[0].menuitem.label_) { |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].widgets.hbox.embeddedwidgets.embeddedwidget_list[0].hbox.embeddedwidgets.embeddedwidget_list[2].menulist.menupopup.choice.menuitemgroups.menuitemgroup_list[0].menuitem.selected := true; |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "window", |
| widgets := { |
| hbox := valueof(ts_xtdp_hbox(omit, 0.0, omit, horizontal, {{ |
| { |
| hbox := valueof(ts_xtdp_hbox(omit, 1.0, omit, vertical, {{ |
| { |
| hbox := valueof(ts_xtdp_hbox("error_hbox", 1.0, omit, horizontal, { |
| {{ |
| label_ := valueof(ts_xtdp_label("error", 1.0, omit, "Errors: none")) |
| }} |
| })) |
| }, |
| { |
| label_ := valueof(ts_xtdp_label("status", 1.0, omit, "Time Profile Editor started.")) |
| } |
| }})) |
| }, |
| { |
| hbox := valueof(ts_xtdp_hbox("save_exit_hbox", 0.0, omit, horizontal, {{ |
| { |
| button := valueof(ts_xtdp_button("save_button", 0.0, omit, omit, "Save", omit, "image_save")) |
| }, |
| { |
| spacer := valueof(ts_xtdp_spacer(omit, 0.1)) |
| }, |
| { |
| button := valueof(ts_xtdp_button("exit_ttcn_button", 0.0, omit, omit, "Exit TTCN", omit, "image_exit")) |
| } |
| }})) |
| } |
| }})) |
| } |
| } |
| } |
| }}} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } |
| |
| private function f_EPTF_TPE_send_model_to_gui() runs on MAIN_CT { |
| var boolean vl_selected := true; |
| |
| for(var integer i := 0; i < sizeof(timeSequenceList); i := i + 1) { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := c_timeSequenceListboxId, |
| widgets := { |
| listitem := valueof(ts_xtdp_listitem(timeSequenceList[i].name & "_id", timeSequenceList[i].name, vl_selected)) |
| } |
| } |
| } |
| }}}; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| vl_selected := false; |
| } |
| |
| vl_selected := true; |
| for(var integer i := 0; i < sizeof(profileList); i := i + 1) { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := c_profileListboxId, |
| widgets := { |
| listitem := valueof(ts_xtdp_listitem(profileList[i].name & "_profile_id", profileList[i].name, vl_selected)) |
| } |
| } |
| } |
| }}}; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| vl_selected := false; |
| } |
| |
| if(sizeof(timeSequenceList) > 0) { |
| currentTimeSequenceSelection := timeSequenceList[0].name; |
| f_EPTF_TPE_set_selected_time_sequence(currentTimeSequenceSelection, false); |
| |
| vl_selected := true; |
| for(var integer i := 0; i < sizeof(timeSequenceList); i := i + 1) { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "time_sequence_menu", |
| widgets := { |
| menuitem := valueof(ts_xtdp_menuitem(timeSequenceList[i].name & "_menu_id", timeSequenceList[i].name, vl_selected)) |
| } |
| } |
| } |
| }}}; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| vl_selected := false; |
| } |
| currentTimeSequenceMenuSelection := timeSequenceList[0].name; |
| } |
| |
| if(sizeof(profileList) > 0) { |
| currentProfileSelection := profileList[0].name; |
| f_EPTF_TPE_set_selected_profile(currentProfileSelection, false); |
| } |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Requests := { |
| ackRequested := omit, |
| xTDP_Request_list := {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { {settooltip:= { |
| widget := { |
| widgetId := "save_button", |
| widgetType := string |
| }, |
| argument_list := {"Saves the config file to: " & tsp_TimeProfileEditor_ConfigFilename} |
| }}} |
| }}} |
| } |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Requests := { |
| ackRequested := omit, |
| xTDP_Request_list := {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { {settooltip:= { |
| widget := { |
| widgetId := "exit_ttcn_button", |
| widgetType := string |
| }, |
| argument_list := { "Orders the TTCN side to exit. You will have to close the Editor GUI manually."} |
| }}} |
| }} |
| }} |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } |
| |
| private function f_EPTF_TPE_update_time_sequences_properties_tree_on_gui() runs on MAIN_CT { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := timeSequencesPropertiesTree.id |
| }} |
| }} |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "time_sequences_properties_tree_hbox", |
| widgets := { |
| tree := timeSequencesPropertiesTree |
| } |
| }} |
| }} |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| } |
| |
| private function f_EPTF_TPE_update_profile_properties_tree_on_gui() runs on MAIN_CT { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := profilePropertiesTree.id |
| }} |
| }} |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message:= { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "profile_properties_tree_hbox", |
| widgets := { |
| tree := profilePropertiesTree |
| } |
| }} |
| }} |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| } |
| |
| private function f_EPTF_TPE_init_time_sequences_properties_tree(in integer rows) runs on MAIN_CT { |
| timeSequencesPropertiesTree := valueof(ts_xtdp_tree("time_sequences_properties_tree", 1.0, true, 0.0, |
| { treecolgroups := { treecolgroup_list := { |
| {treecol := valueof(ts_xtdp_treecol("time_sequences_properties_tree_col_row", 1.0, false, "Row", integerField))}, |
| {treecol := valueof(ts_xtdp_treecol("time_sequences_properties_tree_col_start_time", 3.0, true, "Start time", floatField))}, |
| {treecol := valueof(ts_xtdp_treecol("time_sequences_properties_tree_col_target_value", 3.0, true, "Target value", floatField))} |
| }}}, |
| { treeitemgroups := { treeitemgroup_list := {}}} |
| )); |
| |
| timeSequencesPropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0] := { treeitem := { treerowgroups := { treerowgroup_list:= {} } } }; |
| for(var integer i := 0; i < rows; i := i + 1) { |
| timeSequencesPropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0].treeitem.treerowgroups.treerowgroup_list[sizeof(timeSequencesPropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0].treeitem.treerowgroups.treerowgroup_list)] := |
| { treerow := { treecellgroups := { treecellgroup_list := { |
| { treecell := valueof(ts_xtdp_treecell(omit, int2str(i + 1), "Row index"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, "0.0", "Start time"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, "0.0", "Target value"))} |
| }}}}; |
| } |
| } |
| |
| private function f_EPTF_TPE_replace_error_widget() runs on MAIN_CT { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := "error" |
| }} |
| } |
| } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| if(lengthof(currentError) > 0) { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "error_hbox", |
| widgets := { |
| textbox := valueof(ts_xtdp_textbox("error", 1.0, omit, true, true, 1.0, "", omit, omit)) |
| } |
| }} |
| }} |
| }; |
| } else { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "error_hbox", |
| widgets := { |
| label_ := valueof(ts_xtdp_label("error", 1.0, omit, "")) |
| } |
| }} |
| }} |
| }; |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } |
| |
| private function f_EPTF_TPE_display_error(in charstring msg) runs on MAIN_CT { |
| var charstring vl_msg := " -> " & msg; |
| |
| if(lengthof(msg) > 0) { |
| if(lengthof(currentError) == 0) { |
| currentError := msg; |
| f_EPTF_TPE_replace_error_widget(); |
| } |
| } else { |
| vl_msg := "Errors: none"; |
| if(lengthof(currentError) > 0) { |
| currentError := msg; |
| f_EPTF_TPE_replace_error_widget(); |
| } |
| } |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Requests := { |
| ackRequested := omit, |
| xTDP_Request_list := {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := "error", |
| widgetType := string |
| }, |
| argument_list := {vl_msg} |
| } |
| } |
| }}}} |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } |
| |
| private function float2str_ecs(in float num) return charstring { |
| var charstring par := float2str(num); |
| var charstring ret := ""; |
| var charstring zeros := ""; |
| var boolean weAreAfterComma := false; |
| var charstring currentChar := ""; |
| |
| for(var integer i := 0; i < lengthof(par); i := i + 1) { |
| currentChar := substr(par, i, 1); |
| if(currentChar != "0") { |
| if(lengthof(zeros) > 0) { |
| ret := ret & zeros; |
| zeros := ""; |
| } |
| ret := ret & currentChar; |
| if(not weAreAfterComma and currentChar == ".") { |
| weAreAfterComma := true; |
| } |
| } else { |
| if(weAreAfterComma) { |
| zeros := zeros & currentChar; |
| } else { |
| ret := ret & currentChar; |
| } |
| } |
| } |
| |
| if(substr(ret, lengthof(ret) - 1, 1) == ".") { |
| ret := ret & "0"; |
| } |
| |
| return ret; |
| } |
| |
| ////////////////////////////////////////////////////////////////// |
| // |
| // GUI modification handling functions |
| // |
| ////////////////////////////////////////////////////////////////// |
| |
| private function f_EPTF_TPE_handle_add_time_sequence(in charstring newTimeSequenceName) runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| if(lengthof(newTimeSequenceName) == 0) { |
| v_newTimeSequenceNameRequestId := f_EPTF_TPE_nextRequestId(); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Requests := { |
| ackRequested := true, |
| xTDP_Request_list := {{ |
| requestId := v_newTimeSequenceNameRequestId, |
| action_ := { { get := { |
| widget := { |
| widgetId := "new_sequence_textbox", |
| widgetType := string |
| } |
| } |
| } |
| }}}} |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } else { |
| f_EPTF_TPE_handle_add_time_sequenceIn(newTimeSequenceName); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_add_time_sequenceIn(in charstring pl_newTimeSequenceName) runs on MAIN_CT { |
| if(lengthof(pl_newTimeSequenceName) > 0) { |
| if(f_EPTF_TPE_is_unique_time_sequence_name(pl_newTimeSequenceName)) { |
| currentTimeSequenceSelection := pl_newTimeSequenceName; |
| |
| timeSequenceList[sizeof(timeSequenceList)] := { |
| currentTimeSequenceSelection, { { 0.0, 100.0 } } |
| }; |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := c_timeSequenceListboxId, |
| widgets := { |
| listitem := valueof(ts_xtdp_listitem(currentTimeSequenceSelection & "_id", currentTimeSequenceSelection, true)) |
| } |
| }} |
| } |
| } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "time_sequence_menu", |
| widgets := { |
| menuitem := valueof(ts_xtdp_menuitem(currentTimeSequenceSelection & "_menu_id", currentTimeSequenceSelection, true)) |
| } |
| }} |
| }} |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| currentTimeSequenceMenuSelection := currentTimeSequenceSelection; |
| |
| f_EPTF_TPE_set_selected_time_sequence(currentTimeSequenceSelection, false); |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } else { |
| f_EPTF_TPE_display_error("Time sequence " & pl_newTimeSequenceName & " is already added!"); |
| f_EPTF_TPE_set_selected_time_sequence(pl_newTimeSequenceName, true); |
| } |
| } else { |
| f_EPTF_TPE_display_error("Error: empty time sequence name is not allowed!"); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_add_profile(in charstring newProfileName) runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| |
| if(lengthof(newProfileName) == 0) { |
| v_newTimeProfileRequestId := f_EPTF_TPE_nextRequestId(); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Requests := { |
| ackRequested := true, |
| xTDP_Request_list := {{ |
| requestId := v_newTimeProfileRequestId, |
| action_ := { { get := { |
| widget := { |
| widgetId := "new_profile_textbox", |
| widgetType := string |
| } |
| } |
| } |
| }}}} |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } else { |
| f_EPTF_TPE_handle_add_profileIn(newProfileName); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_add_profileIn(in charstring pl_newProfileName) runs on MAIN_CT{ |
| if(lengthof(pl_newProfileName) > 0) { |
| if(f_EPTF_TPE_is_unique_profile_name(pl_newProfileName)) { |
| currentProfileSelection := pl_newProfileName; |
| |
| profileList[sizeof(profileList)] := { |
| currentProfileSelection, { { currentTimeSequenceSelection, 0.0, 24.0 * currentTimeUnitMultiplier, 0 } } |
| }; |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := c_profileListboxId, |
| widgets := { |
| listitem := valueof(ts_xtdp_listitem(currentProfileSelection & "_profile_id", currentProfileSelection, true)) |
| } |
| }} |
| } |
| }}; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| f_EPTF_TPE_set_selected_profile(currentProfileSelection, false); |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } else { |
| f_EPTF_TPE_display_error("Time profile " & pl_newProfileName & " is already added!"); |
| f_EPTF_TPE_set_selected_profile(pl_newProfileName, true); |
| f_EPTF_TPE_update_chart(); |
| } |
| } else { |
| f_EPTF_TPE_display_error("Error: empty profile name is not allowed!"); |
| } |
| } |
| |
| private function f_EPTF_TPE_is_unique_time_sequence_name(in charstring newTimeSequenceName) runs on MAIN_CT return boolean { |
| for(var integer i := 0; i < sizeof(timeSequenceList); i := i + 1) { |
| if(timeSequenceList[i].name == newTimeSequenceName) { |
| return false; |
| } |
| } |
| |
| return true; |
| } |
| |
| private function f_EPTF_TPE_is_unique_profile_name(in charstring newProfileName) runs on MAIN_CT return boolean { |
| for(var integer i := 0; i < sizeof(profileList); i := i + 1) { |
| if(profileList[i].name == newProfileName) { |
| return false; |
| } |
| } |
| |
| return true; |
| } |
| |
| private function f_EPTF_TPE_get_time_sequence_index(in charstring timeSequenceName) runs on MAIN_CT return integer { |
| var integer vl_index := -1; |
| |
| if(lengthof(timeSequenceName) == 0) { |
| vl_index := -1; |
| } else { |
| for(var integer i := 0; (i < sizeof(timeSequenceList)) and (vl_index == -1); i := i + 1) { |
| if(timeSequenceList[i].name == timeSequenceName) { |
| vl_index := i; |
| } |
| } |
| } |
| |
| return vl_index; |
| } |
| |
| private function f_EPTF_TPE_get_profile_index(in charstring profileName) runs on MAIN_CT return integer { |
| var integer vl_index := -1; |
| |
| if(lengthof(profileName) == 0) { |
| vl_index := -1; |
| } else { |
| for(var integer i := 0; (i < sizeof(profileList)) and (vl_index == -1); i := i + 1) { |
| if(profileList[i].name == profileName) { |
| vl_index := i; |
| } |
| } |
| } |
| |
| return vl_index; |
| } |
| |
| private function f_EPTF_TPE_build_time_sequences_properties_tree(in charstring timeSequenceName) runs on MAIN_CT { |
| var integer vl_index := f_EPTF_TPE_get_time_sequence_index(timeSequenceName); |
| |
| timeSequencesPropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0] := { treeitem := { treerowgroups := { treerowgroup_list:= {} } } }; |
| for(var integer i := 0; i < sizeof(timeSequenceList[vl_index].timeProfileData); i := i + 1) { |
| timeSequencesPropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0].treeitem.treerowgroups.treerowgroup_list[i] := { treerow := { treecellgroups := { treecellgroup_list := { |
| { treecell := valueof(ts_xtdp_treecell(omit, int2str(i + 1), "Row index"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, float2str_ecs(timeSequenceList[vl_index].timeProfileData[i].time / currentTimeUnitMultiplier), "Start time"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, float2str_ecs(timeSequenceList[vl_index].timeProfileData[i].targetValue), "Target value"))} |
| }}}}; |
| } |
| } |
| |
| private function f_EPTF_TPE_build_profile_properties_tree(in charstring profileName) runs on MAIN_CT { |
| var integer vl_index := f_EPTF_TPE_get_profile_index(profileName); |
| |
| if(vl_index > -1) { |
| profilePropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0] := { treeitem := { treerowgroups := { treerowgroup_list:= {} } } }; |
| for(var integer i := 0; i < sizeof(profileList[vl_index].timeProfileList); i := i + 1) { |
| profilePropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0].treeitem.treerowgroups.treerowgroup_list[i] := { treerow := { treecellgroups := { treecellgroup_list := { |
| { treecell := valueof(ts_xtdp_treecell(omit, int2str(i + 1), "Row index"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, profileList[vl_index].timeProfileList[i].timeProfileDescrName, "Time sequence"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, float2str_ecs(profileList[vl_index].timeProfileList[i].startTime / currentTimeUnitMultiplier), "Start time"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, float2str_ecs(profileList[vl_index].timeProfileList[i].periodOfRepetition / currentTimeUnitMultiplier), "Period of repetition"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, int2str(profileList[vl_index].timeProfileList[i].nofRepetition), "Repetition number"))} |
| }}}}; |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_set_selected_time_sequence(in charstring newTimeSequenceName, in boolean sendListboxSelect) runs on MAIN_CT { |
| if(lengthof(newTimeSequenceName) > 0 and timeSequencesPropertiesTreeDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"remove_sequence_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {unichar2char(timeSequencesPropertiesTree.id), pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"before_row_numwidget", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"add_time_sequence_row_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"remove_row_numwidget", pushButton}}}}))); |
| timeSequencesPropertiesTree.disabled := false; |
| timeSequencesPropertiesTreeDisabled := false; |
| } else if(lengthof(newTimeSequenceName) == 0 and not timeSequencesPropertiesTreeDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { "remove_sequence_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { unichar2char(timeSequencesPropertiesTree.id), pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { "before_row_numwidget", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { "add_time_sequence_row_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { "remove_row_numwidget", pushButton}}}}))); |
| timeSequencesPropertiesTree.disabled := true; |
| timeSequencesPropertiesTreeDisabled := true; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { "remove_row_numwidget", pushButton}}}}))); |
| currentTimeSequenceSelection := "???"; |
| } |
| |
| if(lengthof(newTimeSequenceName) > 0) { |
| if(sendListboxSelect) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { put := { widget := {c_timeSequenceListboxId, pushButton}, argument_list := {newTimeSequenceName}}}}))); |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { put := { widget := {"time_sequences_properties_label", pushButton }, argument_list := {newTimeSequenceName & "'s properties:"}}}}))); |
| |
| f_EPTF_TPE_build_time_sequences_properties_tree(newTimeSequenceName); |
| f_EPTF_TPE_update_time_sequences_properties_tree_on_gui(); |
| //update the remove row button if needed |
| f_EPTF_TPE_handle_remove_row_numwidget_change(int2str(currentRemoveRow)); |
| } |
| } |
| |
| private function f_EPTF_TPE_set_selected_profile(in charstring newProfileName, in boolean sendListboxSelect) runs on MAIN_CT { |
| if(lengthof(newProfileName) > 0 and profilePropertiesTreeDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"remove_profile_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {unichar2char(profilePropertiesTree.id), pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"before_profile_row_numwidget", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"add_profile_row_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"remove_profile_row_numwidget", pushButton}}}}))); |
| profilePropertiesTree.disabled := false; |
| profilePropertiesTreeDisabled := false; |
| } else if(lengthof(newProfileName) == 0 and not profilePropertiesTreeDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := {"remove_profile_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := {unichar2char(profilePropertiesTree.id), pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := {"before_profile_row_numwidget", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := {"add_profile_row_button", pushButton}}}}))); |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := {"remove_profile_row_numwidget", pushButton}}}}))); |
| |
| profilePropertiesTree.disabled := true; |
| profilePropertiesTreeDisabled := true; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { put := { widget := {"profile_properties_label", pushButton }, argument_list := {"Time profile properties (disabled)"}}}}))); |
| } |
| |
| if(lengthof(newProfileName) > 0) { |
| if(sendListboxSelect) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { put := { widget := {c_profileListboxId, pushButton }, argument_list := {newProfileName}}}}))); |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { put := { widget := {"profile_properties_label", pushButton}, argument_list := { newProfileName & "'s properties:" }}}}))); |
| |
| f_EPTF_TPE_build_profile_properties_tree(newProfileName); |
| f_EPTF_TPE_update_profile_properties_tree_on_gui(); |
| //update the remove row button if needed |
| f_EPTF_TPE_handle_remove_profile_row_numwidget_change(int2str(currentRemoveProfileRow)); |
| } |
| f_EPTF_TPE_update_chart(); |
| } |
| |
| private function f_EPTF_TPE_handle_remove_time_sequence() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_currentIndex := -1; |
| var EPTF_ExecCtrl_TimeProfileDescrList newTimeSequenceList := {}; |
| |
| if(lengthof(currentTimeSequenceSelection) > 0) { |
| for(var integer i := 0; (i < sizeof(timeSequenceList)) and (vl_currentIndex == -1); i := i + 1) { |
| if(timeSequenceList[i].name == currentTimeSequenceSelection) { |
| vl_currentIndex := i; |
| } |
| } |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := currentTimeSequenceSelection & "_id" |
| }} |
| } |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := currentTimeSequenceSelection & "_menu_id" |
| }} |
| } |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| if(vl_currentIndex < (sizeof(timeSequenceList) - 1)) { |
| currentTimeSequenceSelection := timeSequenceList[vl_currentIndex + 1].name; |
| } else if(vl_currentIndex > 0) { |
| currentTimeSequenceSelection := timeSequenceList[vl_currentIndex - 1].name; |
| } else { |
| currentTimeSequenceSelection := ""; |
| } |
| |
| if(sizeof(timeSequenceList) > 0) { |
| currentTimeSequenceMenuSelection := timeSequenceList[0].name; |
| } else { |
| currentTimeSequenceMenuSelection := ""; |
| } |
| |
| for(var integer i := 0; (i < sizeof(timeSequenceList)); i := i + 1) { |
| if(i != vl_currentIndex) { |
| newTimeSequenceList[sizeof(newTimeSequenceList)] := timeSequenceList[i]; |
| } |
| } |
| timeSequenceList := newTimeSequenceList; |
| |
| f_EPTF_TPE_set_selected_time_sequence(currentTimeSequenceSelection, true); |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } else { |
| f_EPTF_TPE_display_error("No time sequence is selected!"); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_remove_profile() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_currentIndex := -1; |
| var EPTF_ExecCtrl_TimeProfileList newProfileList := {}; |
| |
| if(lengthof(currentProfileSelection) > 0) { |
| for(var integer i := 0; (i < sizeof(profileList)) and (vl_currentIndex == -1); i := i + 1) { |
| if(profileList[i].name == currentProfileSelection) { |
| vl_currentIndex := i; |
| } |
| } |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := currentProfileSelection & "_profile_id" |
| }} |
| }} |
| } |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| if(vl_currentIndex < (sizeof(profileList) - 1)) { |
| currentProfileSelection := profileList[vl_currentIndex + 1].name; |
| } else if(vl_currentIndex > 0) { |
| currentProfileSelection := profileList[vl_currentIndex - 1].name; |
| } else { |
| currentProfileSelection := ""; |
| } |
| |
| for(var integer i := 0; (i < sizeof(profileList)); i := i + 1) { |
| if(i != vl_currentIndex) { |
| newProfileList[sizeof(newProfileList)] := profileList[i]; |
| } |
| } |
| profileList := newProfileList; |
| |
| f_EPTF_TPE_set_selected_profile(currentProfileSelection, true); |
| f_EPTF_TPE_update_config(); |
| } else { |
| f_EPTF_TPE_display_error("No time profile is selected!"); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_time_sequence_listbox_change(in charstring newSelection) runs on MAIN_CT { |
| if(currentTimeSequenceSelection != newSelection) { |
| f_EPTF_TPE_display_error(""); |
| } |
| currentTimeSequenceSelection := newSelection; |
| f_EPTF_TPE_set_selected_time_sequence(currentTimeSequenceSelection, false); |
| } |
| |
| private function f_EPTF_TPE_handle_profile_listbox_change(in charstring newSelection) runs on MAIN_CT { |
| if(currentProfileSelection != newSelection) { |
| f_EPTF_TPE_display_error(""); |
| } |
| currentProfileSelection := newSelection; |
| f_EPTF_TPE_set_selected_profile(currentProfileSelection, false); |
| } |
| |
| private function f_EPTF_TPE_handle_add_time_sequence_row() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_timeSequenceIndex := f_EPTF_TPE_get_time_sequence_index(currentTimeSequenceSelection); |
| |
| if(vl_timeSequenceIndex > -1) { |
| var float newTime := 0.0; |
| |
| if(currentBeforeRow > sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData)) { |
| var integer vl_size := sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData); |
| if(vl_size > 1) { |
| newTime := (2.0 * timeSequenceList[vl_timeSequenceIndex].timeProfileData[vl_size - 1].time) - |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[vl_size - 2].time; |
| } else if(vl_size == 1) { |
| newTime := 2.0 * timeSequenceList[vl_timeSequenceIndex].timeProfileData[vl_size - 1].time; |
| } |
| // just append a new line |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[vl_size] := { newTime, 100.0 }; |
| } else { |
| // insert a line |
| for(var integer i := sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData); i > currentBeforeRow - 1; i := i - 1) { |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[i] := timeSequenceList[vl_timeSequenceIndex].timeProfileData[i - 1]; |
| } |
| |
| if(currentBeforeRow - 1 > 0) { |
| newTime := (timeSequenceList[vl_timeSequenceIndex].timeProfileData[currentBeforeRow - 2].time + |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[currentBeforeRow].time) / 2.0; |
| } |
| |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[currentBeforeRow - 1] := { newTime, 100.0 }; |
| } |
| |
| f_EPTF_TPE_set_selected_time_sequence(currentTimeSequenceSelection, false); |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| //update the remove row button if needed |
| f_EPTF_TPE_handle_remove_row_numwidget_change(int2str(currentRemoveRow)); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_add_profile_row() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_profileIndex := f_EPTF_TPE_get_profile_index(currentProfileSelection); |
| |
| if(vl_profileIndex > -1) { |
| var float newTime := 0.0; |
| |
| if(currentBeforeProfileRow > sizeof(profileList[vl_profileIndex].timeProfileList)) { |
| var integer vl_size := sizeof(profileList[vl_profileIndex].timeProfileList); |
| if(vl_size > 1) { |
| newTime := (2.0 * profileList[vl_profileIndex].timeProfileList[vl_size - 1].startTime) - |
| profileList[vl_profileIndex].timeProfileList[vl_size - 2].startTime; |
| } else if(vl_size == 1) { |
| if(profileList[vl_profileIndex].timeProfileList[vl_size - 1].startTime == 0.0) { |
| newTime := 24.0 * currentTimeUnitMultiplier; |
| } else { |
| newTime := 2.0 * profileList[vl_profileIndex].timeProfileList[vl_size - 1].startTime; |
| } |
| } |
| // just append a new line |
| profileList[vl_profileIndex].timeProfileList[sizeof(profileList[vl_profileIndex].timeProfileList)] := |
| { currentTimeSequenceMenuSelection, newTime, 24.0 * currentTimeUnitMultiplier, 0 }; |
| } else { |
| // insert a line |
| for(var integer i := sizeof(profileList[vl_profileIndex].timeProfileList); i > currentBeforeProfileRow - 1; i := i - 1) { |
| profileList[vl_profileIndex].timeProfileList[i] := profileList[vl_profileIndex].timeProfileList[i - 1]; |
| } |
| |
| if(currentBeforeProfileRow - 1 > 0) { |
| newTime := (profileList[vl_profileIndex].timeProfileList[currentBeforeProfileRow - 2].startTime + |
| profileList[vl_profileIndex].timeProfileList[currentBeforeProfileRow].startTime) / 2.0; |
| } |
| |
| profileList[vl_profileIndex].timeProfileList[currentBeforeProfileRow - 1] := |
| { currentTimeSequenceMenuSelection, newTime, 24.0 * currentTimeUnitMultiplier, 0 }; |
| } |
| |
| f_EPTF_TPE_set_selected_profile(currentProfileSelection, false); |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| //update the remove row button if needed |
| f_EPTF_TPE_handle_remove_profile_row_numwidget_change(int2str(currentRemoveProfileRow)); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_remove_time_sequence_row() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_timeSequenceIndex := f_EPTF_TPE_get_time_sequence_index(currentTimeSequenceSelection); |
| |
| if(vl_timeSequenceIndex > -1) { |
| if(currentRemoveRow < sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData) + 1) { |
| var EPTF_ExecCtrl_TimeProfileItemList timeSequenceProperties := timeSequenceList[vl_timeSequenceIndex].timeProfileData; |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData := {}; |
| |
| for(var integer i := 0; i < sizeof(timeSequenceProperties); i := i + 1) { |
| if(i + 1 != currentRemoveRow) { |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData)] := |
| timeSequenceProperties[i]; |
| } |
| } |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| |
| f_EPTF_TPE_set_selected_time_sequence(currentTimeSequenceSelection, false); |
| //update the remove row button if needed |
| f_EPTF_TPE_handle_remove_row_numwidget_change(int2str(currentRemoveRow)); |
| } else { |
| f_EPTF_TPE_display_error("No such row in the properties tree, accepted values: 1.." & int2str(sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData))); |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_remove_profile_row() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_profileIndex := f_EPTF_TPE_get_profile_index(currentProfileSelection); |
| |
| if(vl_profileIndex > -1) { |
| if(currentRemoveProfileRow < sizeof(profileList[vl_profileIndex].timeProfileList) + 1) { |
| var EPTF_ExecCtrl_TimeProfileDataList profileProperties := profileList[vl_profileIndex].timeProfileList; |
| profileList[vl_profileIndex].timeProfileList := {}; |
| |
| for(var integer i := 0; i < sizeof(profileProperties); i := i + 1) { |
| if(i + 1 != currentRemoveProfileRow) { |
| profileList[vl_profileIndex].timeProfileList[sizeof(profileList[vl_profileIndex].timeProfileList)] := |
| profileProperties[i]; |
| } |
| } |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| |
| f_EPTF_TPE_set_selected_profile(currentProfileSelection, false); |
| //update the remove row button if needed |
| f_EPTF_TPE_handle_remove_profile_row_numwidget_change(int2str(currentRemoveProfileRow)); |
| } else { |
| f_EPTF_TPE_display_error("No such row in the properties tree, accepted values: 1.." & int2str(sizeof(profileList[vl_profileIndex].timeProfileList))); |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_tree_change(in charstring widgetId, in charstring arg) runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var charstring treeRowColRegexp := "([\\w/\\-_]+).(\\d+).(\\d+)"; |
| |
| var charstring vl_treeId := regexp(widgetId, treeRowColRegexp, 0); |
| var charstring vl_row := regexp(widgetId, treeRowColRegexp, 1); |
| var charstring vl_col := regexp(widgetId, treeRowColRegexp, 2); |
| |
| if(lengthof(vl_treeId) > 0) { |
| if(vl_treeId == timeSequencesPropertiesTree.id) { |
| f_EPTF_TPE_handle_time_sequence_properties_tree_change(str2int(vl_row), str2int(vl_col), arg); |
| } else if(vl_treeId == profilePropertiesTree.id) { |
| f_EPTF_TPE_handle_profile_properties_tree_change(str2int(vl_row), str2int(vl_col), arg); |
| } else { |
| f_EPTF_TPE_display_error("Error: unhandled change of tree: " & vl_treeId & ", argument: " & arg); |
| } |
| } else { |
| f_EPTF_TPE_display_error("Error: unhandled change of widget: " & widgetId & ", argument: " & arg); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_time_sequence_properties_tree_change(in integer row, in integer col, in charstring arg) runs on MAIN_CT { |
| var integer vl_timeSequenceIndex := f_EPTF_TPE_get_time_sequence_index(currentTimeSequenceSelection); |
| |
| if(vl_timeSequenceIndex > -1) { |
| if(col == 1) { |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[row].time := str2float(arg) * currentTimeUnitMultiplier; |
| } else if(col == 2) { |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData[row].targetValue := str2float(arg); |
| } else { |
| f_EPTF_TPE_display_error("Error: unhandled column change in time sequences properties tree."); |
| } |
| |
| // bubble sort ascending based on the start time |
| var boolean vl_rowMoved := false; |
| if(col == 1) { |
| var EPTF_ExecCtrl_TimeProfileItemList vl_newTimeProfileData := timeSequenceList[vl_timeSequenceIndex].timeProfileData; |
| var EPTF_ExecCtrl_TimeProfileItem vl_profileItem; |
| |
| for(var integer i := 0; i < sizeof(vl_newTimeProfileData); i := i + 1) { |
| for(var integer j := i; j < sizeof(vl_newTimeProfileData) - 1; j := j + 1) { |
| if(vl_newTimeProfileData[j].time > vl_newTimeProfileData[j + 1].time) { |
| vl_profileItem := vl_newTimeProfileData[j]; |
| vl_newTimeProfileData[j] := vl_newTimeProfileData[j + 1]; |
| vl_newTimeProfileData[j + 1] := vl_profileItem; |
| vl_rowMoved := true; |
| f_EPTF_TPE_display_error("Row " & int2str(j + 1) & " moved to " & int2str(j)); |
| } |
| } |
| } |
| |
| if(vl_rowMoved) { |
| timeSequenceList[vl_timeSequenceIndex].timeProfileData := vl_newTimeProfileData; |
| f_EPTF_TPE_build_time_sequences_properties_tree(currentTimeSequenceSelection); |
| f_EPTF_TPE_update_time_sequences_properties_tree_on_gui(); |
| } |
| } |
| |
| if(col == 1 or col == 2) { |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_profile_properties_tree_change(in integer row, in integer col, in charstring arg) runs on MAIN_CT { |
| var integer vl_profileIndex := f_EPTF_TPE_get_profile_index(currentProfileSelection); |
| |
| if(vl_profileIndex > -1) { |
| if(col == 1) { |
| profileList[vl_profileIndex].timeProfileList[row].timeProfileDescrName := arg; |
| } else if(col == 2) { |
| profileList[vl_profileIndex].timeProfileList[row].startTime := str2float(arg) * currentTimeUnitMultiplier; |
| } else if(col == 3) { |
| profileList[vl_profileIndex].timeProfileList[row].periodOfRepetition := str2float(arg) * currentTimeUnitMultiplier; |
| } else if(col == 4) { |
| profileList[vl_profileIndex].timeProfileList[row].nofRepetition := str2int(arg); |
| } else { |
| f_EPTF_TPE_display_error("Error: unhandled column change in time profile properties tree."); |
| } |
| |
| if(col >= 1 and col <= 4) { |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_remove_row_numwidget_change(in charstring newValue) runs on MAIN_CT { |
| if(str2int(newValue) != currentRemoveRow) { |
| f_EPTF_TPE_display_error(""); |
| } |
| var integer vl_timeSequenceIndex := f_EPTF_TPE_get_time_sequence_index(currentTimeSequenceSelection); |
| |
| if(vl_timeSequenceIndex > -1) { |
| currentRemoveRow := str2int(newValue); |
| |
| if((currentRemoveRow < sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData) + 1) and removeRowDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"remove_time_sequence_row_button", pushButton}}}}))); |
| removeRowDisabled := false; |
| } else if((currentRemoveRow >= sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData) + 1) and not removeRowDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := { "remove_time_sequence_row_button", pushButton}}}}))); |
| removeRowDisabled := true; |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_remove_profile_row_numwidget_change(in charstring newValue) runs on MAIN_CT { |
| if(str2int(newValue) != currentRemoveProfileRow) { |
| f_EPTF_TPE_display_error(""); |
| } |
| var integer vl_profileIndex := f_EPTF_TPE_get_profile_index(currentProfileSelection); |
| |
| if(vl_profileIndex > -1) { |
| currentRemoveProfileRow := str2int(newValue); |
| if((currentRemoveProfileRow < sizeof(profileList[vl_profileIndex].timeProfileList) + 1) and removeProfileRowDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { enable := { widget := {"remove_profile_row_button", pushButton}}}}))); |
| removeProfileRowDisabled := false; |
| } else if((currentRemoveProfileRow >= sizeof(profileList[vl_profileIndex].timeProfileList) + 1) and not removeProfileRowDisabled) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(valueof(ts_xtdp_request(connectionId, f_EPTF_TPE_nextRequestId(), { choice := { disable := { widget := {"remove_profile_row_button", pushButton}}}}))); |
| removeProfileRowDisabled := true; |
| } |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_time_unit_change(in charstring newValue) runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var float previuosTimeUnitMultiplier := currentTimeUnitMultiplier; |
| currentTimeUnit := newValue; |
| if(currentTimeUnit == "hours") { |
| currentTimeUnitMultiplier := 3600.0; |
| } else if(currentTimeUnit == "minutes") { |
| currentTimeUnitMultiplier := 60.0; |
| } else if(currentTimeUnit == "seconds") { |
| currentTimeUnitMultiplier := 1.0; |
| } else { |
| f_EPTF_TPE_display_error("Unhandled time unit: " & newValue); |
| } |
| |
| var float changeFactor := currentTimeUnitMultiplier / previuosTimeUnitMultiplier; |
| |
| for(var integer i := 0; i < sizeof(timeSequenceList); i := i + 1) { |
| for(var integer j := 0; j < sizeof(timeSequenceList[i].timeProfileData); j := j + 1) { |
| timeSequenceList[i].timeProfileData[j].time := timeSequenceList[i].timeProfileData[j].time * changeFactor; |
| } |
| } |
| |
| for(var integer i := 0; i < sizeof(profileList); i := i + 1) { |
| for(var integer j := 0; j < sizeof(profileList[i].timeProfileList); j := j + 1) { |
| profileList[i].timeProfileList[j].startTime := profileList[i].timeProfileList[j].startTime * changeFactor; |
| profileList[i].timeProfileList[j].periodOfRepetition := profileList[i].timeProfileList[j].periodOfRepetition * changeFactor; |
| } |
| } |
| |
| f_EPTF_TPE_update_config(); |
| f_EPTF_TPE_update_chart(); |
| } |
| |
| private function f_EPTF_TPE_handle_time_sequence_menu_change(in charstring newValue) runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| currentTimeSequenceMenuSelection := newValue; |
| } |
| |
| private function f_EPTF_TPE_init_time_profiles_properties_tree(in integer rows) runs on MAIN_CT { |
| profilePropertiesTree := valueof(ts_xtdp_tree("time_profiles_properties_tree", 1.0, true, 0.0, |
| { treecolgroups := { treecolgroup_list := { |
| {treecol := valueof(ts_xtdp_treecol("time_profiles_properties_tree_col_row", 1.0, false, "Row", integerField))}, |
| {treecol := valueof(ts_xtdp_treecol("time_profiles_properties_tree_col_sequence", 3.0, true, "Time sequence", string))}, |
| {treecol := valueof(ts_xtdp_treecol("time_profiles_properties_tree_col_start_time", 3.0, true, "Start time", floatField))}, |
| {treecol := valueof(ts_xtdp_treecol("time_profiles_properties_tree_col_period_of_repetition", 2.0, true, "Period of repetition", floatField))}, |
| {treecol := valueof(ts_xtdp_treecol("time_profiles_properties_tree_col_repetition_number", 2.0, true, "Repetition number", integerField))} |
| }}}, |
| { treeitemgroups := { treeitemgroup_list := {}}} |
| )); |
| |
| profilePropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0] := { treeitem := { treerowgroups := { treerowgroup_list:= {} } } }; |
| for(var integer i := 0; i < rows; i := i + 1) { |
| profilePropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0].treeitem.treerowgroups.treerowgroup_list[sizeof(profilePropertiesTree.treechildren.treeitemgroups.treeitemgroup_list[0].treeitem.treerowgroups.treerowgroup_list)] := { treerow := { treecellgroups := { treecellgroup_list := { |
| { treecell := valueof(ts_xtdp_treecell(omit, int2str(i + 1), "Row index"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, "", "Time sequence"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, "0.0", "Start time"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, "1", "Period of repetition"))}, |
| { treecell := valueof(ts_xtdp_treecell(omit, "1", "Repetition number"))} |
| }}}}; |
| } |
| } |
| |
| private function f_EPTF_TPE_update_config() runs on MAIN_CT { |
| currentConfig := "[MODULE_PARAMETERS]\n\n"; |
| currentConfig := currentConfig & c_DisplayedTimeUnitTspName & " := \"" & currentTimeUnit & "\";\n\n" |
| currentConfig := currentConfig & c_TimeSequencesTspName & " := {\n"; |
| |
| for(var integer i := 0; i < sizeof(timeSequenceList); i := i + 1) { |
| currentConfig := currentConfig & " {\n"; |
| currentConfig := currentConfig & " name := \"" & timeSequenceList[i].name & "\",\n"; |
| currentConfig := currentConfig & " timeProfileData := {\n"; |
| |
| for(var integer j := 0; j < sizeof(timeSequenceList[i].timeProfileData); j := j + 1) { |
| currentConfig := currentConfig & " { time := " & float2str_ecs(timeSequenceList[i].timeProfileData[j].time) & |
| ", targetValue := " & float2str_ecs(timeSequenceList[i].timeProfileData[j].targetValue) & " }"; |
| |
| if(j < sizeof(timeSequenceList[i].timeProfileData) - 1) { |
| currentConfig := currentConfig & ","; |
| } |
| currentConfig := currentConfig & "\n"; |
| } |
| |
| currentConfig := currentConfig & " }\n"; |
| currentConfig := currentConfig & " }"; |
| |
| if(i < sizeof(timeSequenceList) - 1) { |
| currentConfig := currentConfig & ","; |
| } |
| currentConfig := currentConfig & "\n"; |
| } |
| currentConfig := currentConfig & "}\n\n"; |
| currentConfig := currentConfig & c_TimeProfilesTspName & " := {\n"; |
| |
| for(var integer i := 0; i < sizeof(profileList); i := i + 1) { |
| currentConfig := currentConfig & " {\n"; |
| currentConfig := currentConfig & " name := \"" & profileList[i].name & "\",\n"; |
| currentConfig := currentConfig & " timeProfileList := {\n"; |
| |
| for(var integer j := 0; j < sizeof(profileList[i].timeProfileList); j := j + 1) { |
| currentConfig := currentConfig & " {\n"; |
| currentConfig := currentConfig & " timeProfileDescrName := \"" & profileList[i].timeProfileList[j].timeProfileDescrName & "\",\n" |
| currentConfig := currentConfig & " startTime := " & float2str_ecs(profileList[i].timeProfileList[j].startTime) & ",\n" |
| currentConfig := currentConfig & " periodOfRepetition := " & float2str_ecs(profileList[i].timeProfileList[j].periodOfRepetition) & ",\n" |
| currentConfig := currentConfig & " nofRepetition := " & int2str(profileList[i].timeProfileList[j].nofRepetition) & "\n" |
| currentConfig := currentConfig & " }"; |
| |
| if(j < sizeof(profileList[i].timeProfileList) - 1) { |
| currentConfig := currentConfig & ","; |
| } |
| currentConfig := currentConfig & "\n"; |
| } |
| currentConfig := currentConfig & " }\n"; |
| currentConfig := currentConfig & " }"; |
| |
| if(i < sizeof(profileList) - 1) { |
| currentConfig := currentConfig & ","; |
| } |
| currentConfig := currentConfig & "\n"; |
| |
| } |
| |
| currentConfig := currentConfig & "}\n"; |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Requests := { |
| ackRequested := omit, |
| xTDP_Request_list := {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := "config_file_textbox", |
| widgetType := string |
| }, |
| argument_list := {currentConfig} |
| } |
| } |
| }}}} |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } |
| |
| private function f_EPTF_TPE_handle_save_putton_pressed() runs on MAIN_CT { |
| f_EPTF_TPE_display_error(""); |
| var integer vl_fd := f_FIO_open_trunc_wronly(tsp_TimeProfileEditor_ConfigFilename); |
| if(vl_fd != -1) { |
| if(f_FIO_write_text(vl_fd, currentConfig) != lengthof(currentConfig)) { |
| f_EPTF_TPE_display_error("Error: could not write to file " & tsp_TimeProfileEditor_ConfigFilename & "."); |
| } |
| if(f_FIO_close(vl_fd) == -1) { |
| f_EPTF_TPE_display_error("Error: could not close file " & tsp_TimeProfileEditor_ConfigFilename & " after writing."); |
| } |
| f_EPTF_TPE_display_error("Time profile configuration data saved to file: " & tsp_TimeProfileEditor_ConfigFilename); |
| } else { |
| f_EPTF_TPE_display_error("Error: could not open file " & tsp_TimeProfileEditor_ConfigFilename & " for writing."); |
| } |
| } |
| |
| private function f_EPTF_TPE_handle_exit_putton_pressed() runs on MAIN_CT { |
| f_EPTF_TPE_display_error("Bye!"); |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { |
| { { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := "save_exit_hbox" |
| } } } |
| } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_Bye := "" |
| } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| // wait 0.1 sec before GUI port unmap |
| timer t := 0.1; t.start; t.timeout; |
| if(connectionId > -1){ |
| var Result vl_result; |
| f_EPTF_Transport_close(IPL4, connectionId, vl_result); |
| connectionId := -1; |
| } |
| f_EPTF_Base_stopAll(none); |
| } |
| |
| private function f_EPTF_TPE_update_chart() runs on MAIN_CT { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_RemoveRequests:= { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| widgetId := "preview_chart" |
| }}} |
| } |
| }; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| if(lengthof(currentProfileSelection) > 0 and f_EPTF_TPE_get_profile_index(currentProfileSelection) > -1) { |
| var TimeProfileUnitList vl_unitList := {}; |
| var integer vl_profileIndex := f_EPTF_TPE_get_profile_index(currentProfileSelection); |
| |
| var Chart chart; |
| |
| chart := valueof(ts_xtdp_chart("preview_chart", 1.0, omit, currentProfileSelection & "'s preview chart", false, omit, omit, true, true, omit, omit, omit, { tracegroup_list := {}})); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "preview_chart_tab", |
| widgets := { |
| chart := chart |
| } |
| }} |
| } |
| }}; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| var Trace trace; |
| var float currentX := -1.0; |
| var float currentY := -1.0; |
| var integer vl_timeSequenceIndex := 0; |
| var float currentSequenceX := 0.0; |
| var integer colorIndex := 0; |
| |
| for(var integer i := 0; i < sizeof(profileList[vl_profileIndex].timeProfileList); i := i + 1) { |
| vl_timeSequenceIndex := f_EPTF_TPE_get_time_sequence_index(profileList[vl_profileIndex].timeProfileList[i].timeProfileDescrName); |
| |
| if(vl_timeSequenceIndex > -1 and sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData) > 0) { |
| trace := valueof(ts_xtdp_trace( |
| profileList[vl_profileIndex].timeProfileList[i].timeProfileDescrName & "_trace" & int2str(i) & "_id", |
| profileList[vl_profileIndex].timeProfileList[i].timeProfileDescrName, |
| omit, |
| colors[colorIndex], |
| true, |
| currentTimeUnit, |
| "Target value")); |
| |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := chart.id, |
| widgets := { |
| trace := trace |
| } |
| }} |
| } |
| }} |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| |
| for(var integer j := 0; j < profileList[vl_profileIndex].timeProfileList[i].nofRepetition + 1; j := j + 1) { |
| currentX := profileList[vl_profileIndex].timeProfileList[i].startTime / currentTimeUnitMultiplier; |
| if(j > 0) { |
| currentX := currentX + (profileList[vl_profileIndex].timeProfileList[i].periodOfRepetition / currentTimeUnitMultiplier * int2float(j)); |
| } |
| |
| for(var integer k := 0; k < sizeof(timeSequenceList[vl_timeSequenceIndex].timeProfileData); k := k + 1) { |
| currentSequenceX := currentX + timeSequenceList[vl_timeSequenceIndex].timeProfileData[k].time / currentTimeUnitMultiplier; |
| currentY := timeSequenceList[vl_timeSequenceIndex].timeProfileData[k].targetValue; |
| |
| vl_unitList[sizeof(vl_unitList)] := { |
| currentSequenceX, |
| profileList[vl_profileIndex].timeProfileList[i].timeProfileDescrName & "_trace" & int2str(i) & "_id", |
| profileList[vl_profileIndex].timeProfileList[i].timeProfileDescrName, |
| currentY |
| } |
| } |
| } |
| |
| colorIndex := colorIndex + 1; |
| if(colorIndex >= (sizeof(colors) - 1)) { |
| colorIndex := 0 |
| } |
| } else if(vl_timeSequenceIndex == -1) { |
| f_EPTF_TPE_display_error("Time sequence '" & profileList[vl_profileIndex].timeProfileList[i].timeProfileDescrName & "' used in profile '" & profileList[vl_profileIndex].name & "' could be not found!"); |
| } |
| } |
| |
| // sort vl_unitList |
| var TimeProfileUnit vl_Unit; |
| for(var integer i := 0; i < sizeof(vl_unitList); i := i + 1) { |
| for(var integer j := i + 1; j < sizeof(vl_unitList); j := j + 1) { |
| if(vl_unitList[j].startTime < vl_unitList[i].startTime) { |
| vl_Unit := vl_unitList[i]; |
| vl_unitList[i] := vl_unitList[j]; |
| vl_unitList[j] := vl_Unit; |
| } |
| else if(vl_unitList[j].startTime == vl_unitList[i].startTime) { |
| f_EPTF_TPE_display_error("!!! Error: duplicated time sequence start time at " & float2str(vl_unitList[i].startTime) & " in: " & vl_unitList[i].traceName & " and " & vl_unitList[j].traceName); |
| } |
| } |
| } |
| |
| // add the units to the traces |
| for(var integer i := 0; i < sizeof(vl_unitList); i := i + 1) { |
| if(i > 0) { |
| // draw a horizontal line from the previous time unit until the beginning of the current (the step) |
| xtdp_message.choice.xTDP_Requests.xTDP_Request_list[sizeof(xtdp_message.choice.xTDP_Requests.xTDP_Request_list)] := { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := vl_unitList[i - 1].traceId, |
| widgetType := trace |
| }, |
| argument_list := {float2str_ecs(vl_unitList[i].startTime) & "/" & float2str_ecs(vl_unitList[i - 1].targetValue)} |
| }}} |
| } |
| // draw a vertical line to 0.0 to finish the previous unit |
| xtdp_message.choice.xTDP_Requests.xTDP_Request_list[sizeof(xtdp_message.choice.xTDP_Requests.xTDP_Request_list)] := { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := vl_unitList[i - 1].traceId, |
| widgetType := trace |
| }, |
| argument_list := {float2str_ecs(vl_unitList[i].startTime) & "/0.0"} |
| }}} |
| } |
| |
| // draw a vertical line from 0.0 to the current target value |
| xtdp_message.choice.xTDP_Requests.xTDP_Request_list[sizeof(xtdp_message.choice.xTDP_Requests.xTDP_Request_list)] := { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := vl_unitList[i].traceId, |
| widgetType := trace |
| }, |
| argument_list := {float2str_ecs(vl_unitList[i].startTime) & "/0.0"} |
| }}} |
| } |
| } else { |
| // draw a vertical line from 0.0 to the current target value |
| xtdp_message := {omit, { xTDP_Requests := { omit, {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := vl_unitList[i].traceId, |
| widgetType := trace |
| }, |
| argument_list := {float2str_ecs(vl_unitList[i].startTime) & "/0.0"} |
| }}} |
| }} }}}; |
| } |
| |
| // draw a vertical line to the current target value |
| xtdp_message.choice.xTDP_Requests.xTDP_Request_list[sizeof(xtdp_message.choice.xTDP_Requests.xTDP_Request_list)] := { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := vl_unitList[i].traceId, |
| widgetType := trace |
| }, |
| argument_list := {float2str_ecs(vl_unitList[i].startTime) & "/" & float2str_ecs(vl_unitList[i].targetValue)} |
| }}} |
| } |
| |
| // draw a last horizontal line containing the last Y value |
| if(i == sizeof(vl_unitList) - 1) { |
| xtdp_message.choice.xTDP_Requests.xTDP_Request_list[sizeof(xtdp_message.choice.xTDP_Requests.xTDP_Request_list)] := { |
| requestId := f_EPTF_TPE_nextRequestId(), |
| action_ := { { put := { |
| widget := { |
| widgetId := vl_unitList[i].traceId, |
| widgetType := trace |
| }, |
| argument_list := {float2str_ecs(vl_unitList[i].startTime + 6.0 ) & "/" & float2str_ecs(vl_unitList[i].targetValue)} |
| }}} |
| } |
| } |
| } |
| |
| if(isbound(xtdp_message.choice.xTDP_Requests.xTDP_Request_list) and sizeof(xtdp_message.choice.xTDP_Requests.xTDP_Request_list) > 0) { |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } |
| } else { |
| xtdp_message := { |
| transactionID := omit, |
| choice := { |
| xTDP_AddRequests := { |
| {{ |
| requestId := f_EPTF_TPE_nextRequestId(), |
| parentWidgetId := "preview_chart_tab", |
| widgets := { |
| label_ := valueof(ts_xtdp_label("preview_chart", 1.0, omit, "No time profile is selected on the 'Time profiles' tab!")) |
| } |
| }} |
| } |
| }}; |
| f_EPTF_TimeProfileEditor_sendXTDPMessage(xtdp_message); |
| } |
| } |
| |
| |
| } // end of module |