1 | package desmoj.core.simulator; |
2 | |
3 | /** |
4 | * external event switching off the debug output for the experiment. The |
5 | * messagemanager's channel for debugnotes is switched off to stop forwarding |
6 | * debugnotes to the configured Output. |
7 | * |
8 | * @version DESMO-J, Ver. 2.3.3 copyright (c) 2011 |
9 | * @author Tim Lechler |
10 | * |
11 | * Licensed under the Apache License, Version 2.0 (the "License"); |
12 | * you may not use this file except in compliance with the License. You |
13 | * may obtain a copy of the License at |
14 | * http://www.apache.org/licenses/LICENSE-2.0 |
15 | * |
16 | * Unless required by applicable law or agreed to in writing, software |
17 | * distributed under the License is distributed on an "AS IS" |
18 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
19 | * or implied. See the License for the specific language governing |
20 | * permissions and limitations under the License. |
21 | * |
22 | */ |
23 | public class ExternalEventDebugOff extends ExternalEvent { |
24 | /** |
25 | * Creates the external event to stop the debug output for an experiment. |
26 | * |
27 | * @param owner |
28 | * desmoj.Model : The model this external event is associated to |
29 | * @param showInTrace |
30 | * boolean : The flag indicating if this external event is shown |
31 | * in the trace output |
32 | */ |
33 | public ExternalEventDebugOff(Model owner, boolean showInTrace) { |
34 | |
35 | super(owner, "DebugOff", showInTrace); |
36 | |
37 | } |
38 | |
39 | /** |
40 | * Switches the messagemanager's debug note channel off to stop forwarding |
41 | * debugnotes to the configured output. |
42 | */ |
43 | public void eventRoutine() { |
44 | |
45 | Experiment ex = getModel().getExperiment(); |
46 | if (currentlySendTraceNotes()) |
47 | sendTraceNote("Debug switched off"); |
48 | ex.getMessageManager().switchOff(Experiment.debugnote); |
49 | |
50 | } |
51 | |
52 | } |