indexing description: "Objects that represent an EV_TITLED_WINDOW.% %The original version of this class was generated by EiffelBuild." legal: "See notice at end of class." status: "See notice at end of class." author: "$Author$" date: "$Date$" revision: "$Revision$" class AT_OUTPUT_WINDOW inherit AT_OUTPUT_WINDOW_IMP SHARED_AUTO_TEST_PROJECT export {NONE} all undefine default_create, copy end feature {NONE} -- Initialization user_initialization is -- Called by `initialize'. -- Any custom user initialization that -- could not be performed in `initialize', -- (due to regeneration of implementation class) -- can be added here. do create help_engine.make close_request_actions.extend (agent exit_application_cmd) set_icon_pixmap ((create {AT_SHARED_PIXMAPS}).icon_auto_test_window) -- additional initialization txt_output_data := "" lbl_status_data := "AutoTest is running ..." summary_path := "" txt_output_is_blocked := false button_print_summary.disable_sensitive lbl_status.set_text (lbl_status_data) --- initialize the agents project.subscribe_line_command (agent append_line) project.subscribe_success (agent set_status_success) project.subscribe_summary_path (agent set_button_summary_path) show end feature {NONE} -- Output Agents write_text (text: STRING) is -- write text to text field require text_not_void: text /= Void do text.prune_all ('%R') txt_output_data := text -- truncate text if needed if (txt_output_data.count > MAX_TEXT_OUTPUT_LENGTH) then -- remove the oldest n lines, so that text isn't longer than MAX_TEXT_OUTPUT_LENGTH txt_output_data.remove_head ( txt_output_data.substring_index ("%N", txt_output_data.count - MAX_TEXT_OUTPUT_LENGTH) ) end txt_output.set_text (txt_output_data) ensure -- txt_output_data_set: txt_output_data = text end append_text (text: STRING) is -- add text to the textfield require text_not_void: text /= Void do text.prune_all ('%R') txt_output_data := txt_output_data + text -- truncate text if needed if (txt_output_data.count > MAX_TEXT_OUTPUT_LENGTH) then -- remove the oldest n lines, so that text isn't longer than MAX_TEXT_OUTPUT_LENGTH txt_output_data.remove_head ( txt_output_data.substring_index ("%N", txt_output_data.count - MAX_TEXT_OUTPUT_LENGTH) ) end txt_output.set_text (txt_output_data) ensure -- new_text_appended: txt_output_data.is_equal (old txt_output_data + text) end append_line (line: STRING) is -- add a line of text to the textfield (similar to append_text but adds a "%N" at the end) require line_not_void: line /= Void do -- check for unblocking strings if (line.has_substring (TEXT_OUTPUT_UNBLOCKING_STRING)) then txt_output_is_blocked := false end if (txt_output_is_blocked = false) then -- remove unnecessary white spaces line.prune_all ('%R') line.right_adjust -- append text txt_output_data := txt_output_data + line + "%N" -- truncate text if needed if (txt_output_data.count > MAX_TEXT_OUTPUT_LENGTH) then -- remove the oldest n lines, so that text isn't longer than MAX_TEXT_OUTPUT_LENGTH txt_output_data.remove_head ( txt_output_data.substring_index ("%N", txt_output_data.count - MAX_TEXT_OUTPUT_LENGTH) ) end txt_output.set_text (txt_output_data) -- scroll to last line txt_output.scroll_to_line (txt_output.line_count) end -- check for blocking strings if (line.has_substring (TEXT_OUTPUT_BLOCKING_STRING)) then txt_output_is_blocked := true end ensure -- new_text_appended: txt_output_data.is_equal (old txt_output_data + line + "%N") end set_status_success (success: BOOLEAN) is -- allows to set if test was successfull or not do if (success = True) then lbl_status_data := "Test passed!" else lbl_status_data := "Test failed!" end lbl_status.set_text (lbl_status_data) end set_button_summary_path (path: STRING) is -- set the path of the summary if empty button is deactivated require path_not_void: path /= Void do summary_path := path -- activate or deactivate button if not(summary_path.is_equal("")) then button_print_summary.enable_sensitive else button_print_summary.disable_sensitive end ensure summary_path_set: summary_path = path end feature {NONE} -- Implementation txt_output_data: STRING MAX_TEXT_OUTPUT_LENGTH: INTEGER is 1000 TEXT_OUTPUT_BLOCKING_STRING: STRING is "Preparing C compilation" TEXT_OUTPUT_UNBLOCKING_STRING: STRING is "C compilation completed" txt_output_is_blocked: BOOLEAN lbl_status_data: STRING summary_path: STRING help_engine: EB_HELP_ENGINE -- Help engine used to display help pages. feature {NONE} -- Display generated HTML files display_files (ctxt: EB_HELP_CONTEXT) is -- Pop up the auto_test output at the URL corresponding to `ctxt'. -- | FIXME: does currently not work under Windows require valid_ctxt: ctxt /= Void local wd: EV_WARNING_DIALOG do help_engine.show (ctxt) if not help_engine.last_show_successful then create wd.make_with_text (help_engine.last_error_message) wd.show_modal_to_window (Current) end end display_gen_files is -- Display the generated HTML files from auto_test local ctxt: EB_HELP_CONTEXT do create ctxt.make_absolute (summary_path) display_files (ctxt) end feature {NONE} -- Implementation print_summary is -- Called by `select_actions' of `button_print_summary'. do display_gen_files end exit_application_cmd is -- terminates the application do destroy end indexing copyright: "Copyright (c) 2006, The AECCS Team" license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" licensing_options: "http://www.eiffel.com/licensing" copying: "[ This file is part of Eiffel Software's Eiffel Development Environment. Eiffel Software's Eiffel Development Environment is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License (available at the URL listed under "license" above). Eiffel Software's Eiffel Development Environment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eiffel Software's Eiffel Development Environment; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ]" source: "[ The AECCS Team Website: https://eiffelsoftware.origo.ethz.ch/index.php/AutoTest_Integration ]" end -- class AT_OUTPUT_WINDOW