Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
InternalTestStep.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Single operation used in InternalTests
19/****************************************************************************/
20#include <config.h>
21
22#include <fxkeys.h>
23
26
27#include "InternalTestStep.h"
28
29// ===========================================================================
30// static member definitions
31// ===========================================================================
32
33// this offsets corresponds to the offset of the test magenta square
34constexpr int MOUSE_OFFSET_X = 24;
35constexpr int MOUSE_OFFSET_Y = 25;
36constexpr int MOUSE_REFERENCE_X = 304;
37constexpr int MOUSE_REFERENCE_Y = 168;
38
39// ===========================================================================
40// member method definitions
41// ===========================================================================
42
43// ---------------------------------------------------------------------------
44// InternalTestStep::DialogArgument - public methods
45// ---------------------------------------------------------------------------
46
48 myType(type),
49 myAction(action) {
50}
51
52
53InternalTestStep::DialogArgument::DialogArgument(DialogType type, const std::string& customAction) :
54 myType(type),
56 myCustomAction(customAction) {
57}
58
59
60InternalTestStep::DialogArgument::DialogArgument(DialogType type, const std::string& customAction, const int index) :
61 myType(type),
63 myCustomAction(customAction),
64 myIndex(index) {
65}
66
67
68InternalTestStep::DialogArgument::DialogArgument(DialogType type, const std::string& prefixToRemove, const std::string& customAction) :
69 myType(type),
71 myCustomAction(customAction) {
72 // remove prefix from custom action
73 if (prefixToRemove.size() > 0) {
74 const auto pos = customAction.find(prefixToRemove);
75 if (pos != std::string::npos) {
76 myCustomAction.erase(pos, prefixToRemove.length());
77 }
78 }
79}
80
81
84 return myType;
85}
86
87
90 return myAction;
91}
92
93
94const std::string&
96 return myCustomAction;
97}
98
99
100int
102 return myIndex;
103}
104
105// ---------------------------------------------------------------------------
106// InternalTestStep::TLSTableTest - public methods
107// ---------------------------------------------------------------------------
108
109InternalTestStep::TLSTableTest::TLSTableTest(FXSelector sel_, const int row_) :
110 sel(sel_),
111 row(row_) {
112}
113
114
115InternalTestStep::TLSTableTest::TLSTableTest(FXSelector sel_, const int row_, const int column_, const std::string& text_) :
116 sel(sel_),
117 row(row_),
118 column(column_),
119 text(text_) {
120}
121
122// ---------------------------------------------------------------------------
123// InternalTestStep - public methods
124// ---------------------------------------------------------------------------
125
126InternalTestStep::InternalTestStep(InternalTest* testSystem, const std::string& step) :
127 myTestSystem(testSystem) {
128 // add this testStep to test system
129 testSystem->addTestSteps(this);
130 // get overlapped tabs
131 const int overlappedTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.editElements.overlapped");
132 // parse step
133 const auto function = parseStep(step);
134 // set description based in function
135 myDescription = "Process function: " + function;
136 // continue depending of function
137 if (function == "setupAndStart") {
139 } else if (function == "finish") {
140 finish();
141 } else if ((function == "leftClick") || (function == "leftClickData")) {
142 mouseClick("left", "");
143 } else if (function == "leftClickControl") {
144 mouseClick("left", "control");
145 } else if (function == "leftClickShift") {
146 mouseClick("left", "shift");
147 } else if (function == "rightClick") {
148 mouseClick("right", "");
149 } else if (function == "rightClickControl") {
150 mouseClick("right", "control");
151 } else if (function == "rightClickShift") {
152 mouseClick("right", "shift");
153 } else if (function == "leftClickOffset") {
154 leftClickOffset("left");
155 } else if (function == "typeKey") {
156 typeKey();
157 } else if (function == "moveElementHorizontal") {
159 } else if (function == "moveElementVertical") {
161 } else if (function == "moveElement") {
162 moveElement();
163 } else if (function == "focusOnFrame") {
164 focusOnFrame();
165 } else if (function == "contextualMenuOperation") {
167 } else if (function == "protectElements") {
169 } else if (function == "waitDeleteWarning") {
171 } else if (function == "modifyAttribute") {
173 } else if (function == "modifyAttributeOverlapped") {
174 modifyAttribute(overlappedTabs);
175 } else if (function == "modifyBoolAttribute") {
177 } else if (function == "modifyBoolAttributeOverlapped") {
178 modifyBoolAttribute(overlappedTabs);
179 } else if (function == "modifyColorAttribute") {
181 } else if (function == "modifyColorAttributeOverlapped") {
182 modifyColorAttribute(overlappedTabs);
183 } else if (function == "modifyVClassDialog_NoDisallowAll") {
185 } else if (function == "modifyVClassDialogOverlapped_NoDisallowAll") {
186 modifyVClassDialog_NoDisallowAll(overlappedTabs);
187 } else if (function == "modifyVClassDialog_DisallowAll") {
189 } else if (function == "modifyVClassDialogOverlapped_DisallowAll") {
190 modifyVClassDialog_DisallowAll(overlappedTabs);
191 } else if (function == "modifyVClassDialog_Cancel") {
193 } else if (function == "modifyVClassDialogOverlapped_Cancel") {
194 modifyVClassDialog_Cancel(overlappedTabs);
195 } else if (function == "modifyVClassDialog_Reset") {
197 } else if (function == "modifyVClassDialogOverlapped_Reset") {
198 modifyVClassDialog_Reset(overlappedTabs);
199 } else if (function == "modifyVTypeDialogAttribute") {
201 } else if (function == "createConnection") {
203 } else if (function == "createCrossing") {
205 } else if (function == "modifyCrossingDefaultValue") {
207 } else if (function == "modifyCrossingDefaultBoolValue") {
209 } else if (function == "crossingClearEdges") {
211 } else if (function == "crossingInvertEdges") {
213 } else if (function == "createConnectionConflict") {
214 createConnection("control");
215 } else if (function == "createConnectionYield") {
216 createConnection("shift");
217 } else if (function == "saveConnectionEdit") {
219 } else if (function == "fixCrossings") {
220 fixCrossings();
221 } else if (function == "fixStoppingPlace") {
223 } else if (function == "fixRoute") {
224 fixRoute();
225 } else if (function == "createTLS") {
226 createTLS(0);
227 } else if (function == "createTLSOverlapped") {
228 createTLS(overlappedTabs);
229 } else if (function == "copyTLS") {
230 copyTLS();
231 } else if (function == "joinTSL") {
232 joinTSL();
233 } else if (function == "disJoinTLS") {
234 disJoinTLS();
235 } else if (function == "deleteTLS") {
236 deleteTLS();
237 } else if (function == "modifyTLSTable") {
239 } else if (function == "resetSingleTLSPhases") {
241 } else if (function == "resetAllTLSPhases") {
243 } else if (function == "pressTLSPhaseButton") {
245 } else if (function == "addDefaultPhase") {
246 addPhase("default");
247 } else if (function == "addDuplicatePhase") {
248 addPhase("duplicate");
249 } else if (function == "addRedPhase") {
250 addPhase("red");
251 } else if (function == "addYellowPhase") {
252 addPhase("yellow");
253 } else if (function == "addGreenPhase") {
254 addPhase("green");
255 } else if (function == "addGreenPriorityPhase") {
256 addPhase("priorityGreen");
257 } else if (function == "tlsDeletePhase") {
258 addPhase("deletePhase");
259 } else if (function == "tlsMoveUp") {
260 addPhase("moveUp");
261 } else if (function == "tlsMoveDown") {
262 addPhase("moveDown");
263 } else if (function == "tlsCleanStates") {
264 pressTLSButton("cleanStates");
265 } else if (function == "tlsAddStates") {
266 pressTLSButton("addStates");
267 } else if (function == "tlsGroupSignal") {
268 pressTLSButton("groupSignal");
269 } else if (function == "tlsUngroupSignal") {
270 pressTLSButton("ungroupSignal");
271 } else if (function == "checkParameters") {
273 } else if (function == "checkParametersOverlapped") {
274 checkParameters(overlappedTabs);
275 } else if (function == "checkDoubleParameters") {
277 } else if (function == "checkDoubleParametersOverlapped") {
278 checkDoubleParameters(overlappedTabs);
279 } else if (function == "changeEditMode") {
281 } else if (function == "changeSupermode") {
283 } else if (function == "changeMode") {
284 changeMode();
285 } else if (function == "changeElement") {
287 } else if (function == "changePlan") {
288 changePlan();
289 } else if (function == "computeJunctions") {
291 } else if (function == "computeJunctionsVolatileOptions") {
293 } else if (function == "joinJunctions") {
295 } else if (function == "selectAdditionalChild") {
297 } else if (function == "createRectangledShape") {
299 } else if (function == "createSquaredShape") {
301 } else if (function == "createLineShape") {
303 } else if (function == "createMeanData") {
305 } else if (function == "deleteMeanData") {
307 } else if (function == "copyMeanData") {
308 copyMeanData();
309 } else if (function == "saveExistentFile") {
311 } else if (function == "checkUndoRedo") {
313 } else if (function == "delete") {
315 } else if (function == "selection") {
316 selection();
317 } else if (function == "selectNetworkItems") {
319 } else if (function == "lockSelection") {
321 } else if (function == "selectionRectangle") {
323 } else if (function == "createDataSet") {
325 } else if (function == "createDataInterval") {
327 } else if (function == "openAboutDialog") {
329 } else if (function == "loadFile") {
330 loadFile();
331 } else if (function == "saveNewFile") {
332 saveNewFile();
333 } else if (function == "saveFileAs") {
334 saveFileAs();
335 } else if (function == "saveUnifiedFileAs") {
337 } else if (function == "reloadFile") {
338 reloadFile();
339 } else if (function == "selectEdgeType") {
341 } else if (function == "createNewEdgeType") {
343 } else if (function == "overwritingAccept") {
345 } else if (function == "overwritingCancel") {
347 } else if (function == "overwritingAbort") {
349 } else if (function == "overwritingApplyToAll") {
351 } else if (function == "undo") {
352 undo();
353 } else if (function == "redo") {
354 redo();
355 } else if (function == "quit") {
356 quit();
357 } else if (function.size() > 0) {
358 std::cout << "Function " + function + " not implemented in InternalTestStep" << std::endl;
359 throw ProcessError();
360 }
361}
362
363
364InternalTestStep::InternalTestStep(InternalTest* testSystem, FXSelector messageType,
365 FXSelector messageID, Category category,
366 const std::string& description) :
367 myTestSystem(testSystem),
368 myMessageType(messageType),
369 myMessageID(messageID),
370 myCategory(category),
371 myDescription(description) {
372 // add this testStep to test system
373 testSystem->addTestSteps(this);
374}
375
376
377InternalTestStep::InternalTestStep(InternalTest* testSystem, FXSelector messageType,
378 Category category, FXEvent* event, const bool updateView,
379 const std::string& description) :
380 myTestSystem(testSystem),
381 myMessageType(messageType),
382 myCategory(category),
383 myUpdateView(updateView),
384 myDescription(description),
385 myEvent(event) {
386 // add this testStep to test system
387 testSystem->addTestSteps(this);
388}
389
390
392 const std::string& description) :
393 myTestSystem(testSystem),
394 myCategory(InternalTestStep::Category::DIALOG),
395 myUpdateView(false),
396 myDescription(description),
397 myDialogArgument(dialogArgument) {
398 // add this testStep to test system
399 testSystem->addTestSteps(this);
400}
401
402
404 if (myEvent) {
405 delete myEvent;
406 }
407 if (myDialogArgument) {
408 delete myDialogArgument;
409 }
410 if (myTLSTableTest) {
411 delete myTLSTableTest;
412 }
413}
414
415
418 return myNextStep;
419}
420
421
422void
426
427
428FXSelector
432
433
434FXSelector
438
439
444
445
450
451
452FXSelector
454 return FXSEL(myMessageType, myMessageID);
455}
456
457
458bool
462
463
466 return myCategory;
467}
468
469
470void*
472 return myEvent;
473}
474
475
476const std::string&
480
481
482std::string
483InternalTestStep::parseStep(const std::string& rowText) {
484 // first check if this is the netedit.setupAndStart function
485 if (rowText.find("netedit.setupAndStart") != std::string::npos) {
486 return "setupAndStart";
487 } else if (rowText.find("netedit.finish") != std::string::npos) {
488 return "finish";
489 } else if (rowText.compare(0, 8, "netedit.") != 0) {
490 // proces only lines that start with "netedit."
491 return "";
492 } else {
493 std::string functionName;
494 // make a copy to help editing row
495 std::string rowStr = rowText;
496 // every function has the format <function>(<argument1>, <argument2>,....,)
497 if (rowText.empty() || (rowText.front() == '(') || (rowText.back() != ')')) {
498 writeError("parseStep", 0, "function(arguments)");
499 return "";
500 }
501 // first extract function
502 while (rowStr.size() > 0) {
503 if (rowStr.front() == '(') {
504 break;
505 } else {
506 functionName.push_back(rowStr.front());
507 rowStr.erase(rowStr.begin());
508 }
509 }
510 // remove prefix "netedit." (size 8) from function
511 functionName = functionName.substr(8);
512 // check if there are at least two characters (to avoid cases like 'function)')
513 if (rowStr.size() < 2) {
514 writeError("parseStep", 0, "function(arguments)");
515 return functionName;
516 }
517 // remove both pharentesis
518 rowStr.erase(rowStr.begin());
519 rowStr.pop_back();
520 // now parse arguments
521 parseArguments(rowStr);
522 // remove "netedit." from frunction
523 return functionName;
524 }
525}
526
527
528void
529InternalTestStep::parseArguments(const std::string& arguments) {
530 std::string current;
531 bool inQuotes = false;
532 for (size_t i = 0; i < arguments.length(); ++i) {
533 char c = arguments[i];
534 if (c == '\"' || c == '\'') {
535 // Toggle quote state
536 inQuotes = !inQuotes;
537 current.push_back(c);
538 } else if (c == ',' && !inQuotes) {
539 // End of argument
540 if (!current.empty()) {
541 // Trim leading/trailing whitespace
542 size_t start = current.find_first_not_of(" \t");
543 size_t end = current.find_last_not_of(" \t");
544 myArguments.push_back(current.substr(start, end - start + 1));
545 current.clear();
546 }
547 } else {
548 current += c;
549 }
550 }
551 // Add the last argument
552 if (!current.empty()) {
553 size_t start = current.find_first_not_of(" \t");
554 size_t end = current.find_last_not_of(" \t");
555 myArguments.push_back(current.substr(start, end - start + 1));
556 }
557 // inQuotes MUST be false, in other case we have a case like < "argument1", argument2, "argument3 >
558 if (inQuotes) {
559 writeError("parseArguments", 0, "<\"argument\", \"argument\">");
560 myArguments.clear();
561 }
562}
563
564
565void
568 // print in console the following lines
569 std::cout << "TestFunctions: Netedit opened successfully" << std::endl;
570 std::cout << "Finding reference" << std::endl;
571 std::cout << "TestFunctions: 'reference.png' found. Position: " <<
572 toString(MOUSE_REFERENCE_X) << " - " <<
573 toString(MOUSE_REFERENCE_Y) << std::endl;
574 // set first mouse position
576}
577
578
579void
582 myUpdateView = false;
583 std::cout << "TestFunctions: Netedit closed successfully" << std::endl;
584}
585
586
587void
588InternalTestStep::mouseClick(const std::string& button, const std::string& modifier) const {
589 if ((myArguments.size() != 2) || (myTestSystem->getViewPositions().count(myArguments[1]) == 0)) {
590 writeError("leftClick", 0, "<reference, position>");
591 } else {
592 // parse view position
593 const auto& viewPosition = myTestSystem->getViewPositions().at(myArguments[1]);
594 // build mouse click
595 buildMouseClick(viewPosition, 0, 0, button, modifier);
596 // print info
597 writeClickInfo(viewPosition, 0, 0, modifier);
598 }
599}
600
601
602void
603InternalTestStep::leftClickOffset(const std::string& button) const {
604 if ((myArguments.size() != 4) || (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
606 writeError("leftClickOffset", 0, "<reference, position, int, int>");
607 } else {
608 // parse view position
609 const auto& viewPosition = myTestSystem->getViewPositions().at(myArguments[1]);
610 const int x = getIntArgument(myArguments[2]);
611 const int y = getIntArgument(myArguments[3]);
612 // build mouse click
613 buildMouseClick(viewPosition, x, y, button, "");
614 // print info
615 writeClickInfo(viewPosition, x, y, button);
616 }
617}
618
619
620void
622 if ((myArguments.size() != 3) || (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
623 (myTestSystem->getMovements().count(myArguments[2]) == 0)) {
624 writeError("moveElementHorizontal", 0, "<reference, position, radius>");
625 } else {
626 // get parameters
627 const auto& referencePosition = myTestSystem->getViewPositions().at("netedit.positions.reference");
628 const auto& position = myTestSystem->getViewPositions().at(myArguments[1]);
629 const auto& radius = myTestSystem->getMovements().at(myArguments[2]);
630 // click over reference
631 buildMouseClick(referencePosition, 0, 0, "left", "");
632 // drag and drop
633 buildMouseDragDrop(position, 0, 0, position, radius.getRight(), 0, "");
634 buildMouseDragDrop(position, radius.getRight(), 0, position, radius.getLeft(), 0, "");
635 // write info
636 writeClickInfo(position, 0, 0, "");
637 }
638}
639
640
641void
643 if ((myArguments.size() != 3) || (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
644 (myTestSystem->getMovements().count(myArguments[2]) == 0)) {
645 writeError("moveElementVertical", 0, "<reference, position, radius>");
646 } else {
647 // get parameters
648 const auto& referencePosition = myTestSystem->getViewPositions().at("netedit.positions.reference");
649 const auto& position = myTestSystem->getViewPositions().at(myArguments[1]);
650 const auto& radius = myTestSystem->getMovements().at(myArguments[2]);
651 // click over reference
652 buildMouseClick(referencePosition, 0, 0, "left", "");
653 // drag and drop
654 buildMouseDragDrop(position, 0, 0, position, 0, radius.getUp(), "");
655 buildMouseDragDrop(position, radius.getRight(), 0, position, 0, radius.getDown(), "");
656 // write info
657 writeClickInfo(position, 0, 0, "");
658 }
659}
660
661
662void
664 if ((myArguments.size() != 3) || (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
665 (myTestSystem->getMovements().count(myArguments[2]) == 0)) {
666 writeError("moveElement", 0, "<reference, position, radius>");
667 } else {
668 // get parameters
669 const auto& referencePosition = myTestSystem->getViewPositions().at("netedit.positions.reference");
670 const auto& position = myTestSystem->getViewPositions().at(myArguments[1]);
671 const auto& radius = myTestSystem->getMovements().at(myArguments[2]);
672 // click over reference
673 buildMouseClick(referencePosition, 0, 0, "left", "");
674 // drag and drop
675 buildMouseDragDrop(position, 0, 0, position, radius.getRight(), 0, "");
676 buildMouseDragDrop(position, radius.getRight(), 0, position, radius.getRight(), radius.getDown(), "");
677 // drag and drop
678 buildMouseDragDrop(position, radius.getRight(), radius.getDown(), position, radius.getLeft(), radius.getDown(), "");
679 buildMouseDragDrop(position, radius.getLeft(), radius.getDown(), position, radius.getLeft(), radius.getUp(), "");
680 }
681}
682
683
684void
686 if (myArguments.size() != 0) {
687 writeError("focusOnFrame", 0, "<>");
688 } else {
689 // focus frame
691 }
692}
693
694
695void
697 if (myArguments.size() != 1) {
698 writeError("typeKey", 0, "<key>");
699 } else {
701 }
702}
703
704
705void
707 if ((myArguments.size() != 3) || (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
709 writeError("contextualMenuOperation", 0, "<reference, position, contextualMenuOperations>");
710 } else {
711 // parse arguments
712 const auto& viewPosition = myTestSystem->getViewPositions().at(myArguments[1]);
713 const auto& contextualMenu = myTestSystem->getContextualMenuOperations().at(myArguments[2]);
714 // build mouse click
715 buildMouseClick(viewPosition, 0, 0, "right", "");
716 // jump to the element
717 for (int i = 0; i < contextualMenu.getMainMenuPosition(); i++) {
718 buildPressKeyEvent(Category::APP, "down", false);
719 }
720 // type space for select
721 buildPressKeyEvent(Category::APP, "space", false);
722 // jump to the subMenuA
723 if (contextualMenu.getSubMenuAPosition() > 0) {
724 for (int i = 0; i < contextualMenu.getSubMenuAPosition(); i++) {
725 buildPressKeyEvent(Category::APP, "down", false);
726 }
727 // type space for select
728 buildPressKeyEvent(Category::APP, "space", false);
729 }
730 // jump to the subMenuB
731 if (contextualMenu.getSubMenuBPosition() > 0) {
732 for (int i = 0; i < contextualMenu.getSubMenuBPosition(); i++) {
733 buildPressKeyEvent(Category::APP, "down", false);
734 }
735 // type space for select
736 buildPressKeyEvent(Category::APP, "space", false);
737 }
738 }
739}
740
741
742void
744 if (myArguments.size() != 0) {
745 writeError("protectElements", 0, "<>");
746 } else {
747 // go to delete mode
749 // focus frame
751 // jump to the element
752 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.frames.delete.protectElements"); i++) {
753 buildPressKeyEvent(Category::APP, "tab", false);
754 }
755 // press enter to confirm changes (updating view)
756 buildPressKeyEvent(Category::APP, "space", true);
757 }
758}
759
760
761void
763 if (myArguments.size() != 0) {
764 writeError("waitDeleteWarning", 0, "<>");
765 } else {
766 // nothing to do (wait for delete warning doesnt' appear in internal test)
767 }
768}
769
770
771void
772InternalTestStep::modifyAttribute(const int overlappedTabs) const {
773 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[0]) ||
775 writeError("modifyAttribute", overlappedTabs, "<int/attributeEnum, \"string\">");
776 } else {
777 // modify attribute
779 }
780}
781
782
783void
784InternalTestStep::modifyBoolAttribute(const int overlappedTabs) const {
785 if ((myArguments.size() != 1) || !checkIntArgument(myArguments[0])) {
786 writeError("modifyBoolAttribute", overlappedTabs, "<int/attributeEnum>");
787 } else {
788 // modify bool attribute
790 }
791}
792
793
794void
795InternalTestStep::modifyColorAttribute(const int overlappedTabs) const {
796 if ((myArguments.size() != 1) || !checkIntArgument(myArguments[0])) {
797 writeError("modifyColorAttribute", overlappedTabs, "<int/attributeEnum>");
798 } else {
799 // open dialog
801 // select vClass
802 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::COLOR, "139,131,120"), "set color");
803 // press accept
805 }
806}
807
808
809void
811 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[0]) ||
813 writeError("modifyVClassDialog_NoDisallowAll", overlappedTabs, "<int/attributeEnum, int/attributeEnum>");
814 } else {
815 // open dialog
817 // select vClass
818 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "netedit.attrs.dialog.allowVClass.", myArguments[1]), "select vClass");
819 // press accept
821 }
822}
823
824
825void
827 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[0]) ||
829 writeError("modifyVClassDialog_DisallowAll", overlappedTabs, "<int/attributeEnum, int/attributeEnum>");
830 } else {
831 // open dialog
833 // select vClass
834 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "disallowAll"), "disallow all");
835 // select vClass
836 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "netedit.attrs.dialog.allowVClass.", myArguments[1]), "select vClass");
837 // press accept
839 }
840}
841
842
843void
844InternalTestStep::modifyVClassDialog_Cancel(const int overlappedTabs) const {
845 if ((myArguments.size() != 2) ||
848 writeError("modifyVClassDialog_Cancel", overlappedTabs, "<int/attributeEnum, int/attributeEnum>");
849 } else {
850 // open dialog
852 // select vClass
853 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "disallowAll"), "disallow all");
854 // select vClass
855 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "netedit.attrs.dialog.allowVClass.", myArguments[1]), "select vClass");
856 // press accept
858 }
859}
860
861
862void
863InternalTestStep::modifyVClassDialog_Reset(const int overlappedTabs) const {
864 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[0]) ||
866 writeError("modifyVClassDialog_Reset", overlappedTabs, "<int/attributeEnum, int/attributeEnum>");
867 } else {
868 // open dialog
870 // select vClass
871 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "disallowAll"), "disallow all");
872 // select vClass
873 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::VCLASS, "netedit.attrs.dialog.allowVClass.", myArguments[1]), "select vClass");
874 // press reset
876 // press accept
878 }
879}
880
881
882void
884 if ((myArguments.size() != 3) || !checkStringArgument(myArguments[0]) ||
886 writeError("modifyVTypeDialogAttribute", 0, "<str, int/attributeEnum, str>");
887 } else {
888 // get arguments
889 const auto operation = getStringArgument(myArguments[0]);
890 const auto tabs = getIntArgument(myArguments[1]);
891 const auto value = getStringArgument(myArguments[2]);
892 // first check if open dialog
893 if (operation == "open") {
894 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.type.buttons.dialog"), 0);
895 }
896 // print info
897 std::cout << value << std::endl;
898 // focus dialog
899 buildTwoPressKeyEvent(Category::DIALOG, "alt", "f", false);
900 // jump to the element
901 for (int i = 0; i < tabs; i++) {
903 }
904 // write attribute character by character
905 if (value.empty()) {
906 buildPressKeyEvent(Category::DIALOG, "delete", false);
907 } else {
908 for (const char c : value) {
910 }
911 }
912 // press enter to confirm changes (updating view)
913 buildPressKeyEvent(Category::DIALOG, "enter", false);
914 // finally check if close dialog
915 if (operation == "close") {
916 buildTwoPressKeyEvent(Category::DIALOG, "alt", "a", false);
917 buildPressKeyEvent(Category::DIALOG, "enter", false);
918 }
919 }
920}
921
922
923void
924InternalTestStep::createConnection(const std::string& keyModifier) const {
925 if ((myArguments.size() != 3) ||
926 (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
927 (myTestSystem->getViewPositions().count(myArguments[2]) == 0)) {
928 writeError("createConnection", 0, "<reference, position, position>");
929 } else {
930 // parse view position
931 const auto& fromLane = myTestSystem->getViewPositions().at(myArguments[1]);
932 const auto& toLane = myTestSystem->getViewPositions().at(myArguments[2]);
933 // build mouse click from
934 buildMouseClick(fromLane, 0, 0, "left", keyModifier);
935 writeClickInfo(fromLane, 0, 0, "");
936 // build mouse click from
937 buildMouseClick(toLane, 0, 0, "left", keyModifier);
938 writeClickInfo(toLane, 0, 0, "");
939 }
940}
941
942
943void
945 if ((myArguments.size() != 1) || !checkBoolArgument(myArguments[0])) {
946 writeError("createCrossing", 0, "<bool>");
947 } else {
949 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.crossing.createTLS.button"), 0);
950 } else {
951 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.crossing.create.button"), 0);
952 }
953 }
954}
955
956
957void
959 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[0]) || !checkStringArgument(myArguments[1])) {
960 writeError("modifyCrossingDefaultValue", 0, "<int, value>");
961 } else {
962 const int tabs = getIntArgument(myArguments[0]);
963 const auto value = getStringArgument(myArguments[1]);
964 modifyStringAttribute(Category::APP, tabs, myTestSystem->getAttributesEnum().at("netedit.attrs.crossing.firstField"), value);
965 }
966}
967
968
969void
971 if ((myArguments.size() != 1) || !checkIntArgument(myArguments[0])) {
972 writeError("modifyCrossingDefaultBoolValue", 0, "<int>");
973 } else {
974 const int tabs = getIntArgument(myArguments[0]);
975 modifyBoolAttribute(Category::APP, tabs, myTestSystem->getAttributesEnum().at("netedit.attrs.crossing.firstField"));
976 }
977}
978
979
980void
982 if (myArguments.size() != 0) {
983 writeError("crossingClearEdges", 0, "<>");
984 } else {
985 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.crossing.clearEdges"), 0);
986 }
987}
988
989
990void
992 if (myArguments.size() != 0) {
993 writeError("crossingInvertEdges", 0, "<>");
994 } else {
995 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.crossing.invertEdges"), 0);
996 }
997}
998
999
1000void
1002 if (myArguments.size() != 0) {
1003 writeError("saveConnectionEdit", 0, "<>");
1004 } else {
1005 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.connection.saveConnections"), 0);
1006 }
1007}
1008
1009
1010void
1012 if ((myArguments.size() != 1) || !checkStringArgument(myArguments[0])) {
1013 writeError("fixCrossings", 0, "<str>");
1014 } else {
1015 // save config
1017 Category::APP, "save netedit config");
1018 // fix crossings
1020 // accept changes
1022 }
1023}
1024
1025
1026void
1028 if ((myArguments.size() != 1) || !checkStringArgument(myArguments[0])) {
1029 writeError("fixStoppingPlace", 0, "<str>");
1030 } else {
1031 // save config
1033 Category::APP, "save netedit config");
1034 // fix stoppingPlace
1036 // accept changes
1038 }
1039}
1040
1041
1042void
1044 if ((myArguments.size() != 1) || !checkStringArgument(myArguments[0])) {
1045 writeError("fixRoute", 0, "<str>");
1046 } else {
1047 // save config
1049 Category::APP, "save netedit config");
1050 // fix route
1052 // accept changes
1054 }
1055}
1056
1057
1058void
1059InternalTestStep::createTLS(const int overlappedTabs) const {
1060 if (myArguments.size() != 0) {
1061 writeError("createTLS", overlappedTabs, "<>");
1062 } else {
1063 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.create"), overlappedTabs);
1064 }
1065}
1066
1067
1068void
1070 if ((myArguments.size() != 1) || !checkBoolArgument(myArguments[0])) {
1071 writeError("copyTLS", 0, "<bool>");
1072 } else {
1073 if (getBoolArgument(myArguments[0])) {
1074 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.copyJoined"), 0);
1075 } else {
1076 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.copySingle"), 0);
1077 }
1078 }
1079}
1080
1081
1082void
1084 if (myArguments.size() != 0) {
1085 writeError("joinTSL", 0, "<>");
1086 } else {
1087 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.joinTLS"), 0);
1088 }
1089}
1090
1091
1092void
1094 if (myArguments.size() != 0) {
1095 writeError("disJoinTLS", 0, "<>");
1096 } else {
1097 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.disjoinTLS"), 0);
1098 }
1099}
1100
1101
1102void
1104 if ((myArguments.size() != 1) || !checkBoolArgument(myArguments[0])) {
1105 writeError("deleteTLS", 0, "<bool>");
1106 } else {
1107 if (getBoolArgument(myArguments[0])) {
1108 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.deleteJoined"), 0);
1109 } else {
1110 modifyBoolAttribute(Category::APP, myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.deleteSingle"), 0);
1111 }
1112 }
1113}
1114
1115
1116void
1118 if ((myArguments.size() != 3) || !checkIntArgument(myArguments[0]) ||
1120 writeError("modifyTLSTable", 0, "<row, int/attributeEnum, \"string\">");
1121 } else {
1123 // get row
1124 const int row = getIntArgument(myArguments[0]);
1125 const int column = getIntArgument(myArguments[1]);
1126 const std::string text = getStringArgument(myArguments[2]);
1127 // modify attribute
1128 myTLSTableTest = new TLSTableTest(MID_GNE_TLSTABLE_TEXTFIELD, row, column, text);
1129 // show text
1130 std::cout << text << std::endl;
1131 }
1132}
1133
1134
1135void
1137 if ((myArguments.size() != 1) || !checkBoolArgument(myArguments[0])) {
1138 writeError("resetSingleTLSPhases", 0, "<bool>");
1139 } else {
1140 if (getBoolArgument(myArguments[0])) {
1141 modifyBoolAttribute(myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.resetPhaseSingle"));
1142 } else {
1143 modifyBoolAttribute(myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.resetPhaseJoined"));
1144 }
1145 }
1146}
1147
1148
1149void
1151 if ((myArguments.size() != 1) || !checkBoolArgument(myArguments[0])) {
1152 writeError("resetAllTLSPhases", 0, "<bool>");
1153 } else {
1154 if (getBoolArgument(myArguments[0])) {
1155 modifyBoolAttribute(myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.resetAllJoined"));
1156 } else {
1157 modifyBoolAttribute(myTestSystem->getAttributesEnum().at("netedit.attrs.TLS.resetAllSingle"));
1158 }
1159 }
1160}
1161
1162
1163void
1165 if ((myArguments.size() != 1) || !checkIntArgument(myArguments[0])) {
1166 writeError("pressTLSPhaseButton", 0, "<int/attributeEnum>");
1167 } else {
1169 }
1170}
1171
1172
1173void
1174InternalTestStep::addPhase(const std::string& type) {
1175 if ((myArguments.size() != 1) || !checkIntArgument(myArguments[0])) {
1176 writeError("addPhase" + type, 0, "<int/attributeEnum>");
1177 } else {
1179 // get row
1180 const int row = getIntArgument(myArguments[0]);
1181 // continue depending of the type of phase
1182 if (type == "default") {
1184 } else if (type == "duplicate") {
1186 } else if (type == "red") {
1188 } else if (type == "yellow") {
1190 } else if (type == "green") {
1192 } else if (type == "priorityGreen") {
1194 } else if (type == "deletePhase") {
1196 } else if (type == "moveUp") {
1198 } else if (type == "moveDown") {
1200 }
1201 }
1202}
1203
1204
1205void
1206InternalTestStep::pressTLSButton(const std::string& type) {
1207 if (myArguments.size() != 0) {
1208 writeError("pressTLSButton" + type, 0, "<>");
1209 } else {
1211 // continue depending of the type of phase
1212 if (type == "cleanStates") {
1214 } else if (type == "addStates") {
1216 } else if (type == "groupSignal") {
1218 } else if (type == "ungroupSignal") {
1220 }
1221 }
1222}
1223
1224
1225void
1226InternalTestStep::checkParameters(const int overlappedTabs) const {
1227 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[1])) {
1228 writeError("checkParameters", overlappedTabs, "<int/attributeEnum>");
1229 } else {
1230 const int tabs = getIntArgument(myArguments[1]);
1231 // check different values
1232 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "dummyGenericParameters");
1233 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1|key2|key3");
1234 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=value1|key2=value2|key3=value3");
1235 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=|key2=|key3=");
1236 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "");
1237 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1duplicated=value1|key1duplicated=value2|key3=value3");
1238 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=valueDuplicated|key2=valueDuplicated|key3=valueDuplicated");
1239 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "keyInvalid.;%>%$$=value1|key2=value2|key3=value3");
1240 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=valueInvalid%;%$<>$$%|key2=value2|key3=value3");
1241 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "keyFinal1=value1|keyFinal2=value2|keyFinal3=value3");
1242 // check undo-redo
1243 buildUndo(9);
1244 buildRedo(9);
1245 }
1246}
1247
1248
1249void
1250InternalTestStep::checkDoubleParameters(const int overlappedTabs) const {
1251 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[1])) {
1252 writeError("checkDoubleParameters", overlappedTabs, "<int/attributeEnum>");
1253 } else {
1254 const int tabs = getIntArgument(myArguments[1]);
1255 // check different values
1256 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "dummyGenericParameters");
1257 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1|key2|key3");
1258 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=1|key2=2|key3=3");
1259 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=|key2=|key3=");
1260 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "");
1261 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1duplicated=1|key1duplicated=2|key3=3");
1262 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=Duplicated|key2=Duplicated|key3=Duplicated");
1263 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "keyInvalid.;%>%$$=1|key2=2|key3=3");
1264 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "key1=Invalid%;%$<>$$%|key2=2|key3=3");
1265 modifyStringAttribute(Category::APP, tabs, overlappedTabs, "keyFinal1=1|keyFinal2=2|keyFinal3=3");
1266 // check undo-redo
1267 buildUndo(9);
1268 buildRedo(9);
1269 }
1270}
1271
1272
1273void
1275 if ((myArguments.size() != 1) || (myTestSystem->getAttributesEnum().count(myArguments[0]) == 0)) {
1276 writeError("changeEditMode", 0, "<int/attributeEnum>");
1277 } else {
1279 // network
1280 if (myArguments[0] == "netedit.attrs.modes.network.grid") {
1282 } else if (myArguments[0] == "netedit.attrs.modes.network.junctionShape") {
1284 } else if (myArguments[0] == "netedit.attrs.modes.network.spreadVehicle") {
1286 } else if (myArguments[0] == "netedit.attrs.modes.network.showDemandElements") {
1288 } else if (myArguments[0] == "netedit.attrs.modes.network.selectLane") {
1290 } else if (myArguments[0] == "netedit.attrs.modes.network.showConnections") {
1292 } else if (myArguments[0] == "netedit.attrs.modes.network.hideConnetions") {
1294 } else if (myArguments[0] == "netedit.attrs.modes.network.showSubAdditionals") {
1296 } else if (myArguments[0] == "netedit.attrs.modes.network.showTAZElements") {
1298 } else if (myArguments[0] == "netedit.attrs.modes.network.automaticSelectJunctions") {
1300 } else if (myArguments[0] == "netedit.attrs.modes.network.applyAllPhases") {
1302 } else if (myArguments[0] == "netedit.attrs.modes.network.mergingJunction") {
1304 } else if (myArguments[0] == "netedit.attrs.modes.network.showBubbles") {
1306 } else if (myArguments[0] == "netedit.attrs.modes.network.moveElevation") {
1308 } else if (myArguments[0] == "netedit.attrs.modes.network.chainMode") {
1310 } else if (myArguments[0] == "netedit.attrs.modes.network.twoWayMode") {
1312 // demand
1313 } else if (myArguments[0] == "netedit.attrs.modes.demand.grid") {
1315 } else if (myArguments[0] == "netedit.attrs.modes.demand.junctionShape") {
1317 } else if (myArguments[0] == "netedit.attrs.modes.demand.spreadVehicle") {
1319 } else if (myArguments[0] == "netedit.attrs.modes.demand.showNonInspected") {
1321 } else if (myArguments[0] == "netedit.attrs.modes.demand.showShapes") {
1323 } else if (myArguments[0] == "netedit.attrs.modes.demand.showAllTrips") {
1325 } else if (myArguments[0] == "netedit.attrs.modes.demand.showPersonPlans") {
1327 } else if (myArguments[0] == "netedit.attrs.modes.demand.lockPerson") {
1329 } else if (myArguments[0] == "netedit.attrs.modes.demand.showContainerPlans") {
1331 } else if (myArguments[0] == "netedit.attrs.modes.demand.lockContainer") {
1333 } else if (myArguments[0] == "netedit.attrs.modes.demand.showOverlappedRoutes") {
1335 // data
1336 } else if (myArguments[0] == "netedit.attrs.modes.data.junctionShape") {
1338 } else if (myArguments[0] == "netedit.attrs.modes.data.showAdditionals") {
1340 } else if (myArguments[0] == "netedit.attrs.modes.data.showShapes") {
1342 } else if (myArguments[0] == "netedit.attrs.modes.data.showDemandElements") {
1344 } else if (myArguments[0] == "netedit.attrs.modes.data.TAZRelDrawingMode") {
1346 } else if (myArguments[0] == "netedit.attrs.modes.data.TAZFill") {
1348 } else if (myArguments[0] == "netedit.attrs.modes.data.TAZRelOnlyFrom") {
1350 } else if (myArguments[0] == "netedit.attrs.modes.data.TAZRelOnlyTo") {
1352 } else {
1353 writeError("changeEditMode", 0, "<enum>");
1354 }
1355 }
1356}
1357
1358
1359void
1361 if ((myArguments.size() != 1) ||
1363 writeError("save", 0, "<\"string\">");
1364 } else {
1366 const auto savingType = getStringArgument(myArguments[0]);
1367 if (savingType == "network") {
1369 } else if (savingType == "additionals") {
1371 } else if (savingType == "demands") {
1373 } else if (savingType == "datas") {
1375 } else if (savingType == "meanDatas") {
1377 } else if (savingType == "sumoConfig") {
1379 } else if (savingType == "neteditConfig") {
1381 } else {
1382 writeError("save", 0, "<neteditConfig>");
1383 }
1384 }
1385}
1386
1387
1388void
1390 if (myArguments.size() != 1) {
1391 writeError("checkUndoRedo", 0, "<referencePosition>");
1392 } else {
1393 const int numUndoRedos = 9;
1394 buildUndo(numUndoRedos);
1395 buildRedo(numUndoRedos);
1396 }
1397}
1398
1399
1400void
1402 if (myArguments.size() != 0) {
1403 writeError("delete", 0, "<>");
1404 } else {
1405 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_DEL, Category::APP, "delete element");
1406 }
1407}
1408
1409
1410void
1412 if (myArguments.size() != 1 || !checkStringArgument(myArguments[0])) {
1413 writeError("selection", 0, "<selection operation>");
1414 } else {
1415 const std::string selectionType = getStringArgument(myArguments[0]);
1416 // get number of tabls
1417 int numTabs = 0;
1418 if (selectionType == "default") {
1419 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.default");
1420 } else if (selectionType == "save") {
1421 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.save");
1422 } else if (selectionType == "load") {
1423 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.load");
1424 } else if (selectionType == "add") {
1425 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.add");
1426 } else if (selectionType == "remove") {
1427 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.remove");
1428 } else if (selectionType == "keep") {
1429 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.keep");
1430 } else if (selectionType == "replace") {
1431 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.replace");
1432 } else if (selectionType == "clear") {
1433 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.clear");
1434 } else if (selectionType == "invert") {
1435 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.invert");
1436 } else if (selectionType == "invertData") {
1437 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.invertData");
1438 } else if (selectionType == "delete") {
1439 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.basic.delete");
1440 }
1441 // focus frame
1442 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, Category::APP, "focus selection frame");
1443 // jump to the element
1444 for (int i = 0; i < numTabs; i++) {
1445 buildPressKeyEvent(Category::APP, "tab", false);
1446 }
1447 if (selectionType == "save") {
1448 buildPressKeyEvent(Category::APP, "enter", false);
1449 // complete
1450 } else if (selectionType == "load") {
1451 buildPressKeyEvent(Category::APP, "enter", false);
1452 // complete
1453 } else {
1454 buildPressKeyEvent(Category::APP, "space", true);
1455 }
1456 }
1457}
1458
1459
1460void
1462 if (myArguments.size() != 3 || !checkStringArgument(myArguments[0]) ||
1464 writeError("selectNetworkItems", 0, "<element/int, \"attribute\", \"value\">");
1465 } else {
1466 const std::string element = getStringArgument(myArguments[0]);
1467 const std::string attribute = getStringArgument(myArguments[1]);
1468 const std::string value = getStringArgument(myArguments[2]);
1469 // focus frame
1470 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, Category::APP, "focus selelection frame");
1471 // got to type
1472 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.networkItem.type"); i++) {
1473 buildPressKeyEvent(Category::APP, "tab", false);
1474 }
1475 // set network element
1476 for (const char c : "Network elements") {
1477 buildPressKeyEvent(Category::APP, {c}, false);
1478 }
1479 // show info
1480 std::cout << "Network elements" << std::endl;
1481 // got to type
1482 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.networkItem.subType"); i++) {
1483 buildPressKeyEvent(Category::APP, "tab", false);
1484 }
1485 // set network element
1486 for (const char c : element) {
1487 buildPressKeyEvent(Category::APP, {c}, false);
1488 }
1489 // show info
1490 std::cout << element << std::endl;
1491 // got to attribute
1492 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.networkItem.attribute"); i++) {
1493 buildPressKeyEvent(Category::APP, "tab", false);
1494 }
1495 // set attribute
1496 for (const char c : attribute) {
1497 buildPressKeyEvent(Category::APP, {c}, false);
1498 }
1499 // show info
1500 std::cout << attribute << std::endl;
1501 // got to value
1502 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.frames.selection.networkItem.value"); i++) {
1503 buildPressKeyEvent(Category::APP, "tab", false);
1504 }
1505 // set value
1506 for (const char c : value) {
1507 buildPressKeyEvent(Category::APP, {c}, false);
1508 }
1509 // show info
1510 std::cout << value << std::endl;
1511 // press enter to confirm changes (updating view)
1512 buildPressKeyEvent(Category::APP, "enter", true);
1513 }
1514}
1515
1516
1517void
1519 if (myArguments.size() != 1 || !checkIntArgument(myArguments[0])) {
1520 writeError("lockSelection", 0, "<element/int, \"attribute\", \"value\">");
1521 } else {
1522 // get argument
1523 const auto lockType = getIntArgument(myArguments[0]);
1524 // continue depending of lock type
1525 if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.junctions")) {
1526 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_JUNCTION, Category::APP, "lock junctions");
1527 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.edges")) {
1528 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_EDGE, Category::APP, "lock edges");
1529 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.lanes")) {
1530 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_LANE, Category::APP, "lock lanes");
1531 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.connections")) {
1532 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_CONNECTION, Category::APP, "lock connections");
1533 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.crossings")) {
1534 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_CROSSING, Category::APP, "lock crossings");
1535 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.walkingAreas")) {
1536 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_WALKINGAREA, Category::APP, "lock walking areas");
1537 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.additionals")) {
1538 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_ADDITIONALELEMENT, Category::APP, "lock additionals");
1539 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.tazs")) {
1540 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_TAZ, Category::APP, "lock TAZs");
1541 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.wires")) {
1542 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_WIRE, Category::APP, "lock wires");
1543 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.polygons")) {
1544 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_POLYGON, Category::APP, "lock polygons");
1545 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.pois")) {
1546 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_POI, Category::APP, "lock POIs");
1547 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.walkableAreas")) {
1548 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_JPS_WALKABLEAREA, Category::APP, "lock walkableAreas");
1549 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.obstacles")) {
1550 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_JPS_OBSTACLE, Category::APP, "lock obstacles");
1551 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.selected")) {
1552 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_SELECTEDELEMENTS, Category::APP, "lock selected elements");
1553 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.lockAll")) {
1554 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_LOCK_ALLELEMENTS, Category::APP, "lock all elements");
1555 } else if (lockType == myTestSystem->getAttributesEnum().at("netedit.attrs.selection.lockSelectionNetwork.unlockAll")) {
1556 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_GNE_UNLOCK_ALLELEMENTS, Category::APP, "unlock all elements");
1557 }
1558 }
1559}
1560
1561
1562void
1564 if (myArguments.size() != 3 || (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
1565 (myTestSystem->getViewPositions().count(myArguments[2]) == 0)) {
1566 writeError("selectionRectangle", 0, "<viewPosition, viewPosition>");
1567 } else {
1568 // get position
1569 const auto& from = myTestSystem->getViewPositions().at(myArguments[1]);
1570 const auto& to = myTestSystem->getViewPositions().at(myArguments[2]);
1571 // go to selection mode
1573 // drag and drop
1574 buildMouseDragDrop(from, 0, 0, to, 0, 0, "shift");
1575 }
1576}
1577
1578
1579void
1581 if ((myArguments.size() != 1) || !checkStringArgument(myArguments[0])) {
1582 writeError("createDataSet", 0, "<dataSetId>");
1583 } else {
1584 // get dataSetId
1585 const auto& dataSetId = getStringArgument(myArguments[0]);
1586 // show info
1587 std::cout << dataSetId << std::endl;
1588 // focus frame
1590 // jump to select additional argument
1591 for (int i = 0; i < 2; i++) {
1592 buildPressKeyEvent(Category::APP, "tab", false);
1593 }
1594 // create new dataSet
1595 buildPressKeyEvent(Category::APP, "space", true);
1596 // write additional character by character
1597 for (const char c : dataSetId) {
1598 buildPressKeyEvent(Category::APP, {c}, false);
1599 }
1600 // go to create new dataSet
1601 buildPressKeyEvent(Category::APP, "tab", false);
1602 // press enter to confirm changes (updating view)
1603 buildPressKeyEvent(Category::APP, "space", true);
1604 }
1605}
1606
1607
1608void
1611 writeError("createDataInterval", 0, "<begin, end>");
1612 } else {
1613 // get begin and end
1614 const auto& begin = getStringArgument(myArguments[0]);
1615 const auto& end = getStringArgument(myArguments[1]);
1616 // show info
1617 std::cout << begin << std::endl;
1618 std::cout << end << std::endl;
1619 // focus frame
1621 // jump to create interval
1622 for (int i = 0; i < 6; i++) {
1623 buildPressKeyEvent(Category::APP, "tab", false);
1624 }
1625 // create new interval
1626 buildPressKeyEvent(Category::APP, "space", true);
1627 // go to begin
1628 buildPressKeyEvent(Category::APP, "tab", false);
1629 // write begin character by character
1630 for (const char c : begin) {
1631 buildPressKeyEvent(Category::APP, {c}, false);
1632 }
1633 // go to begin
1634 buildPressKeyEvent(Category::APP, "tab", false);
1635 // write end character by character
1636 for (const char c : end) {
1637 buildPressKeyEvent(Category::APP, {c}, false);
1638 }
1639 // go to create button
1640 buildPressKeyEvent(Category::APP, "tab", false);
1641 // press button
1642 buildPressKeyEvent(Category::APP, "space", true);
1643 }
1644}
1645
1646
1647void
1649 if (myArguments.size() != 0) {
1650 writeError("openAboutDialog", 0, "<>");
1651 } else {
1654 // close dialog
1656 }
1657}
1658
1659
1660void
1662 if ((myArguments.size() != 5) || !checkIntArgument(myArguments[4])) {
1663 writeError("loadFile", 0, "<referencePosition, type, file, extension, extensionIndex>");
1664 } else {
1666 // get type and file
1667 const auto type = getStringArgument(myArguments[1]);
1668 const auto file = getStringArgument(myArguments[2]);
1669 const auto extension = getStringArgument(myArguments[3]);
1670 const auto extensionIndex = getIntArgument(myArguments[4]);
1671 // get working directory
1672 std::string workingDirectory = FXSystem::getCurrentDirectory().text();
1673 const auto sandboxDirectory = std::getenv("TEXTTEST_SANDBOX");
1674 if (sandboxDirectory) {
1675 workingDirectory = sandboxDirectory;
1676 }
1677 // continue depending of type
1678 if (type == "neteditConfig") {
1680 } else if (type == "sumoConfig") {
1682 } else if (type == "netconvertConfig") {
1684 } else if (type == "network") {
1686 } else if (type == "trafficLights") {
1688 } else if (type == "edgeTypes") {
1690 } else if (type == "additional") {
1692 } else if (type == "demand") {
1694 } else if (type == "data") {
1696 } else if (type == "meanData") {
1698 } else {
1699 WRITE_ERRORF("Invalid type '%' used in function loadFile", type);
1700 }
1701 // write info
1702 std::cout << file << "." << extension << std::endl;
1703 // set filename dialog
1704 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::FILE, workingDirectory + "/" + file + "." + extension, extensionIndex), "filepath");
1706 }
1707}
1708
1709
1710void
1712 if ((myArguments.size() != 4) || !checkIntArgument(myArguments[3])) {
1713 writeError("saveNewFile", 0, "<referencePosition, type, extension, extensionIndex>");
1714 } else {
1716 // get type and file
1717 const auto type = getStringArgument(myArguments[1]);
1718 const auto extension = getStringArgument(myArguments[2]);
1719 const auto extensionIndex = getIntArgument(myArguments[3]);
1720 std::string file;
1721 // get working directory
1722 std::string workingDirectory = FXSystem::getCurrentDirectory().text();
1723 const auto sandboxDirectory = std::getenv("TEXTTEST_SANDBOX");
1724 if (sandboxDirectory) {
1725 workingDirectory = sandboxDirectory;
1726 }
1727 // continue depending of type
1728 if (type == "neteditConfig") {
1730 file = "netedit_B." + extension;
1731 } else if (type == "sumoConfig") {
1733 file = "sumo_B." + extension;
1734 } else if (type == "netconvertConfig") {
1736 file = "netconvert_B." + extension;
1737 } else if (type == "network") {
1739 file = "input_net_B." + extension;
1740 } else if (type == "trafficLights") {
1742 file = "trafficlights_B." + extension;
1743 } else if (type == "edgeTypes") {
1745 file = "input_edgetypes_B." + extension;
1746 } else {
1747 WRITE_ERRORF("Invalid type '%' used in function loadFile", type);
1748 }
1749 // write info
1750 std::cout << file << std::endl;
1751 // set filename dialog
1752 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::FILE, workingDirectory + "/" + file, extensionIndex), "filepath");
1754 }
1755}
1756
1757
1758void
1760 if ((myArguments.size() != 4) || !checkIntArgument(myArguments[3])) {
1761 writeError("saveFileAs", 0, "<referencePosition, type, extension, extensionIndex>");
1762 } else {
1764 // get type and file
1765 const auto type = getStringArgument(myArguments[1]);
1766 const auto extension = getStringArgument(myArguments[2]);
1767 const auto extensionIndex = getIntArgument(myArguments[3]);
1768 std::string file;
1769 // get working directory
1770 std::string workingDirectory = FXSystem::getCurrentDirectory().text();
1771 const auto sandboxDirectory = std::getenv("TEXTTEST_SANDBOX");
1772 if (sandboxDirectory) {
1773 workingDirectory = sandboxDirectory;
1774 }
1775 // continue depending of type
1776 if (type == "neteditConfig") {
1778 file = "netedit_B." + extension;
1779 } else if (type == "sumoConfig") {
1781 file = "sumo_B." + extension;
1782 } else if (type == "network") {
1784 file = "input_net_B." + extension;
1785 } else if (type == "joinedJunctions") {
1787 file = "joinedjunctions_B." + extension;
1788 } else if (type == "trafficLights") {
1790 file = "trafficlights_B." + extension;
1791 } else if (type == "edgeTypes") {
1793 file = "edgetypes_B." + extension;
1794 } else if (type == "jupedsim") {
1796 file = "jupedsims_B." + extension;
1797 } else if (type == "additional") {
1798 file = "input_additionals_B." + extension;
1799 throw ProcessError("not finish");
1800 } else if (type == "demand") {
1801 file = "input_routes_B." + extension;
1802 throw ProcessError("not finish");
1803 } else if (type == "data") {
1804 file = "input_datas_B." + extension;
1805 throw ProcessError("not finish");
1806 } else if (type == "meanData") {
1807 file = "input_meandatas_B." + extension;
1808 throw ProcessError("not finish");
1809 } else {
1810 WRITE_ERRORF("Invalid type '%' used in function loadFile", type);
1811 }
1812 // write info
1813 std::cout << file << std::endl;
1814 // set filename dialog
1815 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::FILE, workingDirectory + "/" + file, extensionIndex), "filepath");
1817 }
1818}
1819
1820
1821void
1823 if ((myArguments.size() != 4) || !checkIntArgument(myArguments[3])) {
1824 writeError("saveUnifiedFileAs", 0, "<referencePosition, type, extension, extensionIndex>");
1825 } else {
1827 // get type and file
1828 const auto type = getStringArgument(myArguments[1]);
1829 const auto extension = getStringArgument(myArguments[2]);
1830 const auto extensionIndex = getIntArgument(myArguments[3]);
1831 std::string file;
1832 // get working directory
1833 std::string workingDirectory = FXSystem::getCurrentDirectory().text();
1834 const auto sandboxDirectory = std::getenv("TEXTTEST_SANDBOX");
1835 if (sandboxDirectory) {
1836 workingDirectory = sandboxDirectory;
1837 }
1838 // continue depending of type
1839 if (type == "additional") {
1841 file = "input_additionals_B." + extension;;
1842 } else if (type == "demand") {
1844 file = "input_routes_B." + extension;
1845 } else if (type == "data") {
1847 file = "input_datas_B." + extension;
1848 } else if (type == "meanData") {
1850 file = "input_meandatas_B." + extension;
1851 } else {
1852 WRITE_ERRORF("Invalid type '%' used in function loadFile", type);
1853 }
1854 // write info
1855 std::cout << file << std::endl;
1856 // set filename dialog
1857 new InternalTestStep(myTestSystem, new DialogArgument(DialogType::FILE, workingDirectory + "/" + file, extensionIndex), "filepath");
1859 }
1860}
1861
1862
1863void
1865 if (myArguments.size() != 3) {
1866 writeError("reloadFile", 0, "<referencePosition, type, bool>");
1867 } else {
1869 // get type and file
1870 const auto type = getStringArgument(myArguments[1]);
1871 // continue depending of type
1872 if (type == "neteditConfig") {
1874 } else if (type == "sumoConfig") {
1876 } else if (type == "network") {
1878 } else if (type == "edgeTypes") {
1880 } else if (type == "trafficLights") {
1882 } else if (type == "additional") {
1884 } else if (type == "demand") {
1886 } else if (type == "data") {
1888 } else if (type == "meanData") {
1890 } else {
1891 WRITE_ERRORF("Invalid type '%' used in function reloadFile", type);
1892 }
1893 }
1894}
1895
1896
1897void
1899 if (myArguments.size() != 0) {
1900 writeError("selectEdgeType", 0, "<>");
1901 } else {
1903 // got to type
1904 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.edge.edgeType.select"); i++) {
1905 buildPressKeyEvent(Category::APP, "tab", false);
1906 }
1907 // select edge type
1908 buildPressKeyEvent(Category::APP, "space", true);
1909 }
1910}
1911
1912
1913void
1915 if (myArguments.size() != 1 && checkBoolArgument(myArguments[0])) {
1916 writeError("createNewEdgeType", 0, "<bool>");
1917 } else {
1918 const auto existent = getBoolArgument(myArguments[0]);
1920 if (existent) {
1921 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.edge.edgeType.createExistent"); i++) {
1922 buildPressKeyEvent(Category::APP, "tab", false);
1923 }
1924 } else {
1925 for (int i = 0; i < myTestSystem->getAttributesEnum().at("netedit.attrs.edge.edgeType.createNew"); i++) {
1926 buildPressKeyEvent(Category::APP, "tab", false);
1927 }
1928 }
1929 // select edge type
1930 buildPressKeyEvent(Category::APP, "space", true);
1931 }
1932}
1933
1934
1935void
1941
1942
1943void
1949
1950
1951void
1957
1958
1959void
1965
1966
1967void
1969 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[1])) {
1970 writeError("undo", 0, "<referencePosition, int>");
1971 } else {
1972 // do undo
1974 }
1975}
1976
1977
1978void
1980 if ((myArguments.size() != 2) || !checkIntArgument(myArguments[1])) {
1981 writeError("redo", 0, "<referencePosition, int>");
1982 } else {
1983 // do redo
1985 }
1986}
1987
1988
1989void
1991 if ((myArguments.size() != 1) ||
1993 writeError("supermode", 0, "<\"string\">");
1994 } else {
1996 const std::string supermode = getStringArgument(myArguments[0]);
1997 if (supermode == "network") {
1999 } else if (supermode == "demand") {
2001 } else if (supermode == "data") {
2003 } else {
2004 writeError("supermode", 0, "<network/demand/data>");
2005 }
2006 }
2007}
2008
2009
2010void
2012 if ((myArguments.size() != 1) ||
2014 writeError("changeMode", 0, "<\"string\">");
2015 } else {
2016 // set category and enable upate view
2018 myUpdateView = true;
2019 // get mode
2020 const std::string mode = getStringArgument(myArguments[0]);
2021 // set description
2022 myDescription = "Change mode to '" + mode + "'";
2023 // continue depending of mode
2024 if (mode == "inspect") {
2026 } else if (mode == "delete") {
2028 } else if (mode == "select") {
2030 } else if (mode == "move") {
2032 } else if ((mode == "createEdge") || (mode == "edgeData")) {
2034 } else if ((mode == "trafficLight") || (mode == "type") || (mode == "TLS")) {
2036 } else if ((mode == "connection") || (mode == "container")) {
2038 } else if ((mode == "prohibition") || (mode == "containerPlan")) {
2040 } else if ((mode == "crossing") || (mode == "route") || (mode == "edgeRelData")) {
2042 } else if ((mode == "additional") || (mode == "stop")) {
2044 } else if ((mode == "wire") || (mode == "routeDistribution")) {
2046 } else if ((mode == "taz") || (mode == "TAZ") || (mode == "TAZRelData")) {
2048 } else if ((mode == "shape") || (mode == "person")) {
2050 } else if ((mode == "decal") || (mode == "typeDistribution")) {
2052 } else if (mode == "personPlan") {
2054 } else if (mode == "vehicle") {
2056 } else if (mode == "meanData") {
2058 } else {
2059 writeError("changeMode", 0, "<inspect/delete/select/move...>");
2060 }
2061 }
2062}
2063
2064
2065void
2067 if ((myArguments.size() != 2) ||
2069 writeError("changeElement", 0, "<\"frame\", \"string\">");
2070 } else {
2071 const std::string frame = getStringArgument(myArguments[0]);
2072 const std::string element = getStringArgument(myArguments[1]);
2073 int numTabs = -1;
2074 // continue depending of frame
2075 if (frame == "additionalFrame") {
2076 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.additional");
2077 } else if (frame == "shapeFrame") {
2078 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.shape");
2079 } else if (frame == "vehicleFrame") {
2080 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.vehicle");
2081 } else if (frame == "routeFrame") {
2082 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.route");
2083 } else if (frame == "personFrame") {
2084 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.person");
2085 } else if (frame == "containerFrame") {
2086 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.container");
2087 } else if (frame == "personPlanFrame") {
2088 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.personPlan");
2089 } else if (frame == "containerPlanFrame") {
2090 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.containerPlan");
2091 } else if (frame == "stopFrame") {
2092 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.stop");
2093 } else if (frame == "meanDataFrame") {
2094 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changeElement.meanData");
2095 } else {
2096 WRITE_ERRORF("Invalid frame '%' used in function changeElement", frame);
2097 }
2098 if (numTabs >= 0) {
2099 // show info
2100 std::cout << element << std::endl;
2101 // focus frame
2103 // jump to select additional argument
2104 for (int i = 0; i < numTabs; i++) {
2105 buildPressKeyEvent(Category::APP, "tab", false);
2106 }
2107 // write additional character by character
2108 for (const char c : element) {
2109 buildPressKeyEvent(Category::APP, {c}, false);
2110 }
2111 // press enter to confirm changes (updating view)
2112 buildPressKeyEvent(Category::APP, "enter", true);
2113 }
2114 }
2115}
2116
2117
2118void
2120 if ((myArguments.size() != 3) ||
2124 writeError("changePlan", 0, "<\"type\", \"plan\", true/false>");
2125 } else {
2126 // get arguments
2127 const std::string type = getStringArgument(myArguments[0]);
2128 const std::string plan = getStringArgument(myArguments[1]);
2129 const bool flow = getBoolArgument(myArguments[2]);
2130 // check plan
2131 if ((type != "person") && (type != "container")) {
2132 WRITE_ERRORF("invalid plan type '%' used in changePlan()", type);
2133 } else {
2134 // calculate num tabs
2135 int numTabs = 0;
2136 if (flow) {
2137 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changePlan." + type + "Flow");
2138 } else {
2139 numTabs = myTestSystem->getAttributesEnum().at("netedit.attrs.frames.changePlan." + type);
2140 }
2141 // focus frame
2143 // jump to select additional argument
2144 for (int i = 0; i < numTabs; i++) {
2145 buildPressKeyEvent(Category::APP, "tab", false);
2146 }
2147 // write additional character by character
2148 for (const char c : plan) {
2149 buildPressKeyEvent(Category::APP, {c}, false);
2150 }
2151 // print info
2152 std::cout << plan << std::endl;
2153 // press enter to confirm changes (updating view)
2154 buildPressKeyEvent(Category::APP, "enter", true);
2155 }
2156 }
2157}
2158
2159
2160void
2162 if (myArguments.size() > 0) {
2163 writeError("computeJunctions", 0, "<>");
2164 } else {
2167 }
2168}
2169
2170
2171void
2173 if (myArguments.size() != 1) {
2174 writeError("computeJunctionsVolatileOptions", 0, "<yes/no/esc>");
2175 } else {
2178 // get argument
2179 const auto dialogArgument = getStringArgument(myArguments[0]);
2180 // press space to confirm changes (updating view)
2181 if (dialogArgument == "yes") {
2183 } else if (dialogArgument == "no") {
2185 } else {
2187 }
2188 }
2189}
2190
2191
2192void
2194 if (myArguments.size() > 0) {
2195 writeError("joinJunctions", 0, "<>");
2196 } else {
2199 }
2200}
2201
2202
2203void
2205 if ((myArguments.size() != 2) ||
2208 writeError("selectAdditionalChild", 0, "<int, int>");
2209 } else {
2210 const auto tabs = getIntArgument(myArguments[0]);
2211 const auto downs = getIntArgument(myArguments[1]);
2212 // focus frame
2213 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, Category::APP, "select additional child");
2214 // jump to the element
2215 for (int i = 0; i < tabs; i++) {
2216 buildPressKeyEvent(Category::APP, "tab", false);
2217 }
2218 // jump to the element
2219 for (int i = 0; i < downs; i++) {
2220 buildPressKeyEvent(Category::APP, "down", false);
2221 }
2222 // select additional child
2223 buildPressKeyEvent(Category::APP, "space", true);
2224 // leave
2225 buildPressKeyEvent(Category::APP, "tab", true);
2226 }
2227}
2228
2229
2230void
2232 if ((myArguments.size() != 5) ||
2233 (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
2237 writeError("createRectangledShape", 0, "<viewPosition, sizeX, sizeY, true/false>");
2238 } else {
2239 // create shape
2244 false);
2245 }
2246}
2247
2248
2249void
2251 if ((myArguments.size() != 4) ||
2252 (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
2255 writeError("createSquaredShape", 0, "<viewPosition, size, true/false>");
2256 } else {
2257 // create shape
2262 false);
2263 }
2264}
2265
2266
2267void
2269 if ((myArguments.size() != 5) ||
2270 (myTestSystem->getViewPositions().count(myArguments[1]) == 0) ||
2274 writeError("createLineShape", 0, "<viewPosition, sizeX, sizeY, true/false>");
2275 } else {
2276 // create shape
2281 true);
2282 }
2283}
2284
2285
2286void
2288 if (myArguments.size() != 0) {
2289 writeError("createMeanData", 0, "<>");
2290 } else {
2292 }
2293}
2294
2295
2296void
2298 if (myArguments.size() != 0) {
2299 writeError("deleteMeanData", 0, "<>");
2300 } else {
2302 }
2303}
2304
2305
2306void
2308 if (myArguments.size() != 0) {
2309 writeError("copyMeanData", 0, "<>");
2310 } else {
2312 }
2313}
2314
2315
2316void
2318 if (myArguments.size() == 0) {
2319 writeError("quit", 0, "<neteditProcess>");
2320 } else {
2323 //don't update view if we're closing to avoid problems with drawGL
2324 myUpdateView = false;
2325 }
2326}
2327
2328
2329bool
2330InternalTestStep::checkIntArgument(const std::string& argument) const {
2331 if (StringUtils::isInt(argument)) {
2332 return true;
2333 } else if (myTestSystem->getAttributesEnum().count(argument) > 0) {
2334 return true;
2335 } else {
2336 return false;
2337 }
2338}
2339
2340
2341int
2342InternalTestStep::getIntArgument(const std::string& argument) const {
2343 if (StringUtils::isInt(argument)) {
2344 return StringUtils::toInt(argument);
2345 } else {
2346 return myTestSystem->getAttributesEnum().at(argument);
2347 }
2348}
2349
2350
2351bool
2352InternalTestStep::checkBoolArgument(const std::string& argument) const {
2353 if (argument == "True") {
2354 return true;
2355 } else if (argument == "False") {
2356 return true;
2357 } else {
2358 return false;
2359 }
2360}
2361
2362
2363bool
2364InternalTestStep::getBoolArgument(const std::string& argument) const {
2365 if (argument == "True") {
2366 return true;
2367 } else {
2368 return false;
2369 }
2370}
2371
2372
2373bool
2374InternalTestStep::checkStringArgument(const std::string& argument) const {
2375 if (argument.size() < 2) {
2376 return false;
2377 } else if ((argument.front() != argument.back()) || ((argument.front() != '\'') && ((argument.front() != '\"')))) {
2378 return false;
2379 } else {
2380 return true;
2381 }
2382}
2383
2384
2385std::string
2386InternalTestStep::getStringArgument(const std::string& argument) const {
2387 std::string argumentParsed;
2388 for (int i = 1; i < ((int)argument.size() - 1); i++) {
2389 argumentParsed.push_back(argument[i]);
2390 }
2391 return argumentParsed;
2392}
2393
2394
2395std::string
2396InternalTestStep::stripSpaces(const std::string& str) const {
2397 auto start = std::find_if_not(str.begin(), str.end(), isspace);
2398 auto end = std::find_if_not(str.rbegin(), str.rend(), isspace).base();
2399 if (start < end) {
2400 return std::string(start, end);
2401 } else {
2402 return "";
2403 }
2404}
2405
2406
2407void
2408InternalTestStep::writeError(const std::string& function, const int overlapping, const std::string& expected) const {
2409 if (overlapping > 0) {
2410 WRITE_ERRORF("Invalid internal testStep function '%Ovelapped', requires '%' arguments ", function, expected);
2411 } else {
2412 WRITE_ERRORF("Invalid internal testStep function '%', requires '%' arguments ", function, expected);
2413 }
2414 // also print arguments
2415 if (myArguments.size() > 0) {
2416 WRITE_ERROR("Arguments: ");
2417 for (const auto& arg : myArguments) {
2419 }
2420 }
2421}
2422
2423
2424void
2426 const int sizeX, const int sizeY, const bool close,
2427 const bool line) const {
2428 // calculate half-sizes
2429 const int halfSizeX = int(sizeX * -0.5);
2430 const int halfSizeY = int(sizeY * -0.5);
2431 // focus frame
2433 // press enter to start drawing
2434 buildPressKeyEvent(Category::APP, "enter", true);
2435 // first edge
2436 buildMouseClick(viewPosition, 0, 0, "left", "");
2437 writeClickInfo(viewPosition, 0, 0, "");
2438 // second edge
2439 if (!line) {
2440 buildMouseClick(viewPosition, 0, halfSizeY, "left", "");
2441 writeClickInfo(viewPosition, 0, halfSizeY, "");
2442 }
2443 // third edge
2444 buildMouseClick(viewPosition, halfSizeX, halfSizeY, "left", "");
2445 writeClickInfo(viewPosition, halfSizeX, halfSizeY, "");
2446 // four edge
2447 if (!line) {
2448 buildMouseClick(viewPosition, halfSizeX, 0, "left", "");
2449 writeClickInfo(viewPosition, halfSizeX, 0, "");
2450 }
2451 // check if close polygon
2452 if (close) {
2453 buildMouseClick(viewPosition, 0, 0, "left", "");
2454 writeClickInfo(viewPosition, 0, 0, "");
2455 }
2456 // press enter to end drawing
2457 buildPressKeyEvent(Category::APP, "enter", true);
2458}
2459
2460
2461void
2462InternalTestStep::modifyStringAttribute(Category category, const int tabs, const int overlappedTabs, const std::string& value) const {
2463 // print info
2464 std::cout << value << std::endl;
2465 // focus frame
2466 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, category, "focus frame");
2467 // jump to the element
2468 for (int i = 0; i < (tabs + overlappedTabs); i++) {
2469 buildPressKeyEvent(category, "tab", false);
2470 }
2471 // write attribute character by character
2472 if (value.empty()) {
2473 buildPressKeyEvent(category, "delete", false);
2474 } else {
2475 for (const char c : value) {
2476 buildPressKeyEvent(category, {c}, false);
2477 }
2478 }
2479 // press enter to confirm changes (updating view)
2480 buildPressKeyEvent(category, "enter", true);
2481}
2482
2483
2484void
2485InternalTestStep::modifyBoolAttribute(Category category, const int tabs, const int overlappedTabs) const {
2486 // focus frame
2487 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, category, "focus frame");
2488 // jump to the element
2489 for (int i = 0; i < (tabs + overlappedTabs); i++) {
2490 buildPressKeyEvent(category, "tab", false);
2491 }
2492 // toogle attribute
2493 buildPressKeyEvent(category, "space", true);
2494}
2495
2496
2497void
2498InternalTestStep::buildUndo(const int number) const {
2499 // get reference position
2500 const auto& referencePosition = myTestSystem->getViewPositions().at("netedit.positions.reference");
2501 // focus frame
2503 // go to inspect mode
2504 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_I_MODE_INSPECT, Category::APP, "inspect mode");
2505 // click over reference
2506 std::cout << "TestFunctions: Clicked over position " <<
2507 toString(MOUSE_REFERENCE_X) << " - " <<
2508 toString(MOUSE_REFERENCE_Y) << std::endl;
2509 // build mouse click
2510 buildMouseClick(referencePosition, 0, 0, "left", "");
2511 // undo
2512 for (int i = 0; i < number; i++) {
2514 }
2515}
2516
2517
2518void
2519InternalTestStep::buildRedo(const int number) const {
2520 // get reference position
2521 const auto& referencePosition = myTestSystem->getViewPositions().at("netedit.positions.reference");
2522 // focus frame
2524 // go to inspect mode
2525 new InternalTestStep(myTestSystem, SEL_COMMAND, MID_HOTKEY_I_MODE_INSPECT, Category::APP, "inspect mode");
2526 // click over reference
2527 std::cout << "TestFunctions: Clicked over position " <<
2528 toString(MOUSE_REFERENCE_X) << " - " <<
2529 toString(MOUSE_REFERENCE_Y) << std::endl;
2530 // build mouse click
2531 buildMouseClick(referencePosition, 0, 0, "left", "");
2532 // undo
2533 for (int i = 0; i < number; i++) {
2535 }
2536}
2537
2538
2539std::pair<FXint, FXString>
2540InternalTestStep::translateKey(const std::string& key) const {
2541 std::pair<FXint, FXString> solution;
2542 // check if key is a single character
2543 if (key.size() == 1) {
2544 solution.first = FXint(key.front());
2545 solution.second.append(key.front());
2546 } else {
2547 // continue depending of key
2548 if (key == "backspace") {
2549 solution.first = KEY_BackSpace;
2550 solution.second = "\b";
2551 } else if (key == "space") {
2552 solution.first = KEY_space;
2553 } else if (key == "tab") {
2554 solution.first = KEY_Tab;
2555 solution.second = "\t";
2556 } else if (key == "clear") {
2557 solution.first = KEY_Clear;
2558 } else if (key == "enter" || key == "return") {
2559 solution.first = KEY_Return;
2560 solution.second = "\n";
2561 } else if (key == "pause") {
2562 solution.first = KEY_Pause;
2563 } else if (key == "sys_req") {
2564 solution.first = KEY_Sys_Req;
2565 } else if (key == "esc" || key == "escape") {
2566 solution.first = KEY_Escape;
2567 solution.second = "\x1B";
2568 } else if (key == "delete") {
2569 solution.first = KEY_Delete;
2570 solution.second = "\x7F";
2571 } else if (key == "multi_key") {
2572 solution.first = KEY_Multi_key;
2573 // function
2574 } else if (key == "shift") {
2575 solution.first = KEY_Shift_L;
2576 } else if (key == "control") {
2577 solution.first = KEY_Control_L;
2578 // Cursor
2579 } else if (key == "home") {
2580 solution.first = KEY_Home;
2581 } else if (key == "left") {
2582 solution.first = KEY_Left;
2583 } else if (key == "up") {
2584 solution.first = KEY_Up;
2585 } else if (key == "right") {
2586 solution.first = KEY_Right;
2587 } else if (key == "down") {
2588 solution.first = KEY_Down;
2589 } else if (key == "prior" || key == "page_up") {
2590 solution.first = KEY_Page_Up;
2591 } else if (key == "next" || key == "page_down") {
2592 solution.first = KEY_Page_Down;
2593 } else if (key == "end") {
2594 solution.first = KEY_End;
2595 } else if (key == "begin") {
2596 solution.first = KEY_Begin;
2597 // Function keys
2598 } else if (key == "f1") {
2599 solution.first = KEY_F1;
2600 } else if (key == "f2") {
2601 solution.first = KEY_F2;
2602 } else if (key == "f3") {
2603 solution.first = KEY_F3;
2604 } else if (key == "f4") {
2605 solution.first = KEY_F4;
2606 } else if (key == "f5") {
2607 solution.first = KEY_F5;
2608 } else if (key == "f6") {
2609 solution.first = KEY_F6;
2610 } else if (key == "f7") {
2611 solution.first = KEY_F7;
2612 } else if (key == "f8") {
2613 solution.first = KEY_F8;
2614 } else if (key == "f9") {
2615 solution.first = KEY_F9;
2616 } else if (key == "f10") {
2617 solution.first = KEY_F10;
2618 } else if (key == "f11" || key == "l1") {
2619 solution.first = KEY_F11;
2620 } else if (key == "f12" || key == "l2") {
2621 solution.first = KEY_F12;
2622 } else {
2623 writeError("translateKey", 0, "<key>");
2624 solution.first = KEY_VoidSymbol;
2625 }
2626 }
2627 return solution;
2628}
2629
2630
2631FXEvent*
2632InternalTestStep::buildKeyPressEvent(const std::string& key) const {
2633 const auto keyValues = translateKey(key);
2634 FXEvent* keyPressEvent = new FXEvent();
2635 // set event values
2636 keyPressEvent->time = myTestSystem->getTime();
2637 keyPressEvent->synthetic = true;
2638 keyPressEvent->type = SEL_KEYPRESS;
2639 keyPressEvent->code = keyValues.first;
2640 keyPressEvent->text = keyValues.second;
2641 return keyPressEvent;
2642}
2643
2644
2645FXEvent*
2646InternalTestStep::buildKeyReleaseEvent(const std::string& key) const {
2647 const auto keyValues = translateKey(key);
2648 FXEvent* keyPressEvent = new FXEvent();
2649 // set event values
2650 keyPressEvent->time = myTestSystem->getTime();
2651 keyPressEvent->synthetic = true;
2652 keyPressEvent->type = SEL_KEYPRESS;
2653 keyPressEvent->code = keyValues.first;
2654 keyPressEvent->text = keyValues.second;
2655 // special case for shift and control
2656 return keyPressEvent;
2657}
2658
2659
2660void
2661InternalTestStep::buildPressKeyEvent(Category category, const std::string& key, const bool updateView) const {
2662 new InternalTestStep(myTestSystem, SEL_KEYPRESS, category, buildKeyPressEvent(key), updateView, "key '" + key + "' pressed");
2663 new InternalTestStep(myTestSystem, SEL_KEYRELEASE, category, buildKeyReleaseEvent(key), updateView, "key '" + key + "' released");
2664}
2665
2666
2667void
2668InternalTestStep::buildTwoPressKeyEvent(Category category, const std::string& keyA, const std::string& keyB, const bool updateView) const {
2669 // create both events using keyB
2670 auto pressEvent = buildKeyPressEvent(keyB);
2671 auto releaseEvent = buildKeyPressEvent(keyB);
2672 // check if set state
2673 if (keyA == "shift") {
2674 pressEvent->state = SHIFTMASK;
2675 releaseEvent->state = SHIFTMASK;
2676 } else if (keyA == "control") {
2677 pressEvent->state = CONTROLMASK;
2678 releaseEvent->state = CONTROLMASK;
2679 } else if (keyA == "alt") {
2680 pressEvent->state = ALTMASK;
2681 releaseEvent->state = ALTMASK;
2682 }
2683 new InternalTestStep(myTestSystem, SEL_KEYPRESS, category, pressEvent, updateView, "keys '" + keyA + "' + '" + keyB + "' pressed");
2684 new InternalTestStep(myTestSystem, SEL_KEYRELEASE, category, releaseEvent, updateView, "keys '" + keyA + "' + '" + keyB + " pressed");
2685}
2686
2687
2688void
2690 const int offsetX, const int offsetY,
2691 const std::string& button, const std::string& keyModifier) const {
2692 // move mouse move
2694 buildMouseMoveEvent(viewPosition, offsetX, offsetY, 0, "", 0),
2695 true, "mouse moved to click position");
2696 // continue depending of mouse
2697 if (button == "left") {
2698 new InternalTestStep(myTestSystem, SEL_LEFTBUTTONPRESS, Category::VIEW,
2699 buildMouseClickEvent(SEL_LEFTBUTTONPRESS, viewPosition, offsetX, offsetY, keyModifier, 1),
2700 true, "mouse button " + button + " pressed");
2701 new InternalTestStep(myTestSystem, SEL_LEFTBUTTONRELEASE, Category::VIEW,
2702 buildMouseClickEvent(SEL_LEFTBUTTONRELEASE, viewPosition, offsetX, offsetY, keyModifier, 1),
2703 true, "mouse button " + button + " released");
2704 } else if (button == "center") {
2705 new InternalTestStep(myTestSystem, SEL_MIDDLEBUTTONPRESS, Category::VIEW,
2706 buildMouseClickEvent(SEL_MIDDLEBUTTONPRESS, viewPosition, offsetX, offsetY, keyModifier, 1),
2707 true, "mouse button " + button + " pressed");
2708 new InternalTestStep(myTestSystem, SEL_MIDDLEBUTTONRELEASE, Category::VIEW,
2709 buildMouseClickEvent(SEL_MIDDLEBUTTONRELEASE, viewPosition, offsetX, offsetY, keyModifier, 1),
2710 true, "mouse button " + button + " released");
2711 } else if (button == "right") {
2712 new InternalTestStep(myTestSystem, SEL_RIGHTBUTTONPRESS, Category::VIEW,
2713 buildMouseClickEvent(SEL_RIGHTBUTTONPRESS, viewPosition, offsetX, offsetY, keyModifier, 1),
2714 true, "mouse button " + button + " pressed");
2715 new InternalTestStep(myTestSystem, SEL_RIGHTBUTTONRELEASE, Category::VIEW,
2716 buildMouseClickEvent(SEL_RIGHTBUTTONRELEASE, viewPosition, offsetX, offsetY, keyModifier, 1),
2717 true, "mouse button " + button + " released");
2718 }
2719}
2720
2721
2722void
2724 const int offsetStartX, const int offsetStartY,
2725 const InternalTest::ViewPosition& viewEndPosition,
2726 const int offsetEndX, const int offsetEndY,
2727 const std::string& keyModifier) const {
2728 // move mouse interpolating
2729 const auto interpolationSteps = myTestSystem->interpolateViewPositions(viewStartPosition, offsetStartX, offsetStartY, viewEndPosition, offsetEndX, offsetEndY);
2730 // move mouse move
2732 buildMouseMoveEvent(viewStartPosition, offsetStartX, offsetStartY, 0, "", 0),
2733 true, "mouse moved to click position (dragDrop)");
2734 // press button
2735 new InternalTestStep(myTestSystem, SEL_LEFTBUTTONPRESS, Category::VIEW,
2736 buildMouseClickEvent(SEL_LEFTBUTTONPRESS, viewStartPosition, offsetStartX, offsetStartY, keyModifier, 1),
2737 true, "mouse button left pressed (dragDrop)");
2738 // move mouse button
2739 for (const auto& position : interpolationSteps) {
2741 buildMouseMoveEvent(position, 0, 0, LEFTBUTTON, "leftButton", 1),
2742 true, "mouse moved (dragDrop)");
2743 }
2744 // release button
2745 new InternalTestStep(myTestSystem, SEL_LEFTBUTTONRELEASE, Category::VIEW,
2746 buildMouseClickEvent(SEL_LEFTBUTTONRELEASE, viewEndPosition, offsetEndX, offsetEndY, keyModifier, 1),
2747 true, "mouse button left released (dragDrop)");
2748}
2749
2750
2751FXEvent*
2753 const int offsetX, const int offsetY, const int clickedButton,
2754 const std::string& keyModifier, const int numberOfClicks) const {
2755 FXEvent* moveEvent = new FXEvent();
2756 // set event values
2757 moveEvent->time = myTestSystem->getTime();
2758 moveEvent->type = SEL_MOTION;
2759 moveEvent->synthetic = true;
2760 moveEvent->win_x = viewPosition.getX() + MOUSE_OFFSET_X + offsetX;
2761 moveEvent->win_y = viewPosition.getY() + MOUSE_OFFSET_Y + offsetY;
2762 moveEvent->last_x = myTestSystem->getLastMovedPosition().getX();
2763 moveEvent->last_y = myTestSystem->getLastMovedPosition().getY();
2764 moveEvent->click_x = 0;
2765 moveEvent->click_y = 0;
2766 moveEvent->moved = true;
2767 moveEvent->rect = FXRectangle(0, 0, 0, 0);
2768 moveEvent->click_button = clickedButton;
2769 moveEvent->click_count = numberOfClicks;
2770 moveEvent->code = 0;
2771 // set modifier
2772 if (keyModifier == "control") {
2773 moveEvent->state = CONTROLMASK;
2774 } else if (keyModifier == "shift") {
2775 moveEvent->state = SHIFTMASK;
2776 } else if (keyModifier == "leftButton") {
2777 moveEvent->state = LEFTBUTTONMASK;
2778 } else {
2779 moveEvent->state = 0;
2780 }
2781 // update last moved position
2782 myTestSystem->updateLastMovedPosition(moveEvent->win_x, moveEvent->win_y);
2783 return moveEvent;
2784}
2785
2786
2787FXEvent*
2789 const int offsetX, const int offsetY, const std::string& keyModifier,
2790 const int numberOfClicks) const {
2791 FXEvent* clickEvent = new FXEvent();
2792 // set event values
2793 clickEvent->time = myTestSystem->getTime();
2794 clickEvent->type = type;
2795 clickEvent->synthetic = true;
2796 clickEvent->win_x = viewPosition.getX() + MOUSE_OFFSET_X + offsetX;
2797 clickEvent->win_y = viewPosition.getY() + MOUSE_OFFSET_Y + offsetY;
2798 clickEvent->click_x = viewPosition.getX() + MOUSE_OFFSET_X + offsetX;
2799 clickEvent->click_y = viewPosition.getY() + MOUSE_OFFSET_Y + offsetY;
2800 clickEvent->last_x = myTestSystem->getLastMovedPosition().getX();
2801 clickEvent->last_y = myTestSystem->getLastMovedPosition().getY();
2802 clickEvent->click_count = numberOfClicks;
2803 clickEvent->moved = false;
2804 clickEvent->rect = FXRectangle(0, 0, 0, 0);
2805 // set button
2806 if ((type == SEL_LEFTBUTTONPRESS) || (type == SEL_LEFTBUTTONRELEASE)) {
2807 clickEvent->click_button = LEFTBUTTON;
2808 clickEvent->code = LEFTBUTTON;
2809 } else if ((type == SEL_MIDDLEBUTTONPRESS) || (type == SEL_MIDDLEBUTTONRELEASE)) {
2810 clickEvent->click_button = MIDDLEBUTTON;
2811 clickEvent->code = MIDDLEBUTTON;
2812 } else if ((type == SEL_RIGHTBUTTONPRESS) || (type == SEL_RIGHTBUTTONRELEASE)) {
2813 clickEvent->click_button = RIGHTBUTTON;
2814 clickEvent->code = RIGHTBUTTON;
2815 } else {
2816 clickEvent->click_button = 0;
2817 clickEvent->code = 0;
2818 }
2819 // set modifier
2820 if (keyModifier == "control") {
2821 clickEvent->state = CONTROLMASK;
2822 } else if (keyModifier == "shift") {
2823 clickEvent->state = SHIFTMASK;
2824 } else {
2825 clickEvent->state = 0;
2826 }
2827 return clickEvent;
2828}
2829
2830
2831void
2833 const int offsetX, const int offsetY,
2834 const std::string modifier) const {
2835 if (modifier == "control") {
2836 std::cout << "TestFunctions: Clicked with Control key pressed over position " <<
2837 toString(viewPosition.getX() + MOUSE_REFERENCE_X + offsetX) << " - " <<
2838 toString(viewPosition.getY() + MOUSE_REFERENCE_Y + offsetY) << std::endl;
2839 } else if (modifier == "shift") {
2840 std::cout << "TestFunctions: Clicked with Shift key pressed over position " <<
2841 toString(viewPosition.getX() + MOUSE_REFERENCE_X + offsetX) << " - " <<
2842 toString(viewPosition.getY() + MOUSE_REFERENCE_Y) << std::endl;
2843 } else {
2844 std::cout << "TestFunctions: Clicked over position " <<
2845 toString(viewPosition.getX() + MOUSE_REFERENCE_X + offsetX) << " - " <<
2846 toString(viewPosition.getY() + MOUSE_REFERENCE_Y + offsetY) << std::endl;
2847 }
2848}
2849
2850/****************************************************************************/
DialogType
@ FIX_DEMANDELEMENTS
@ FIX_NETWORKELEMENTS
@ FIX_ADDITIONALELEMENTS
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:857
@ MID_GNE_LOCK_POLYGON
lock polygons
Definition GUIAppEnum.h:883
@ MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
Definition GUIAppEnum.h:115
@ MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE
compute junctions with volatile options
Definition GUIAppEnum.h:270
@ MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS
save Data Elements
Definition GUIAppEnum.h:204
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:236
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:941
@ MID_GNE_UNLOCK_ALLELEMENTS
unlock all element
Definition GUIAppEnum.h:919
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:965
@ MID_GNE_TOOLBARFILE_SAVEADDITIONALELEMENTS_UNIFIED
save additionals unified
Definition GUIAppEnum.h:725
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:831
@ MID_GNE_TLSFRAME_PHASES_ADDUNUSED
add unused states
@ MID_HOTKEY_CTRL_Y_REDO
Undo.
Definition GUIAppEnum.h:133
@ MID_HOTKEY_CTRL_SHIFT_H_SAVEEDGETYPES
save Edge Types
Definition GUIAppEnum.h:212
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:853
@ MID_GNE_LOCK_WIRE
lock wires
Definition GUIAppEnum.h:879
@ MID_GNE_TOOLBARFILE_RELOAD_EDGETYPES
reload edge types
Definition GUIAppEnum.h:737
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:839
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:837
@ MID_GNE_TLSTABLE_ADDPHASE
TLSTable button for add phase.
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:971
@ MID_GNE_LOCK_ALLELEMENTS
lock all element
Definition GUIAppEnum.h:917
@ MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES
join selected junctions in network mode and normalice demand element ids in demand mode
Definition GUIAppEnum.h:244
@ MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS
Perform a single simulation step in SUMO and open Demand Elements in netedit.
Definition GUIAppEnum.h:89
@ MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND
compute Network in network mode and Demand elements in demand mode
Definition GUIAppEnum.h:240
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:957
@ MID_GNE_TLSTABLE_COPYPHASE
TLSTable button for copy phase.
@ MID_HOTKEY_CTRL_O_OPENSIMULATION_OPENNETWORK
Open simulation in SUMO and open network in netedit.
Definition GUIAppEnum.h:111
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:843
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:943
@ MID_GNE_LOCK_JPS_WALKABLEAREA
lock walkableAreas
Definition GUIAppEnum.h:887
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:75
@ MID_GNE_TLSTABLE_ADDPHASEALLGREENPRIORITY
TLSTable button for add phase green priority.
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:931
@ MID_GNE_LOCK_SELECTEDELEMENTS
lock selected element
Definition GUIAppEnum.h:921
@ MID_GNE_TLSFRAME_PHASES_CLEANUP
cleanup unused states
@ MID_GNE_TLSFRAME_PHASES_GROUPSTATES
group states
@ MID_GNE_TOOLBARFILE_SAVESUMOCONFIG_AS
save SUMOConfig as
Definition GUIAppEnum.h:719
@ MID_GNE_TOOLBARFILE_RELOAD_TLSPROGRAMS
reload TLS Programs
Definition GUIAppEnum.h:733
@ MID_HOTKEY_DEL
hot key delete selections or elements
Definition GUIAppEnum.h:288
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_GNE_TOOLBARFILE_OPENMEANDATAELEMENTS
open meanData file
Definition GUIAppEnum.h:751
@ MID_GNE_TOOLBARFILE_RELOAD_NETEDITCONFIG
reload neteditConfig
Definition GUIAppEnum.h:713
@ MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS
Edit simulation breakpoints in SUMO and open Data Elements in netedit.
Definition GUIAppEnum.h:85
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:929
@ MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS
Save Demand Elements.
Definition GUIAppEnum.h:208
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in netedit.
Definition GUIAppEnum.h:117
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:855
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:963
@ MID_GNE_TOOLBARFILE_RELOAD_MEANDATAELEMENTS
reload meanDatas
Definition GUIAppEnum.h:757
@ MID_GNE_TOOLBARFILE_SAVEMEANDATAELEMENTS_UNIFIED
save meanDatas unified
Definition GUIAppEnum.h:755
@ MID_GNE_LOCK_WALKINGAREA
lock walkingareas
Definition GUIAppEnum.h:875
@ MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALELEMENTS
Start the simulation in SUMO and open Additionals Elements in netedit.
Definition GUIAppEnum.h:83
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition GUIAppEnum.h:53
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:67
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:937
@ MID_GNE_TLSFRAME_PHASES_UNGROUPSTATES
ungroup states
@ MID_GNE_LOCK_JPS_OBSTACLE
lock obstacles
Definition GUIAppEnum.h:889
@ MID_GNE_TLSTABLE_ADDPHASEALLYELLOW
TLSTable button for add phase yelllow.
@ MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS
save TLS Programs as
Definition GUIAppEnum.h:731
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:959
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:851
@ MID_GNE_TOOLBARFILE_RELOAD_DEMANDELEMENTS
reload demand elements
Definition GUIAppEnum.h:743
@ MID_GNE_TLSTABLE_TEXTFIELD
TLSTable textField.
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:845
@ MID_GNE_TLSTABLE_ADDPHASEALLRED
TLSTable button for add phase red.
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:63
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:841
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:945
@ MID_GNE_LOCK_ADDITIONALELEMENT
lock additional elements
Definition GUIAppEnum.h:877
@ MID_GNE_TLSTABLE_MOVEDOWNPHASE
TLSTable button for move down phase.
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:238
@ MID_GNE_LOCK_EDGE
lock edges
Definition GUIAppEnum.h:867
@ MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS
Load file with TLS Programs.
Definition GUIAppEnum.h:103
@ MID_GNE_TOOLBARFILE_SAVENETEDITCONFIG_AS
save neteditConfig as
Definition GUIAppEnum.h:715
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:65
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:967
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_GNE_TOOLBARFILE_SAVEDATAELEMENTS_UNIFIED
save data elements unified
Definition GUIAppEnum.h:747
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_GNE_TLSTABLE_ADDPHASEALLGREEN
TLSTable button for add phase green.
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:833
@ MID_GNE_TLSTABLE_REMOVEPHASE
TLSTable button for remove phase.
@ MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG
save netedit Config
Definition GUIAppEnum.h:210
@ MID_GNE_TOOLBARFILE_SAVEEDGETYPES_AS
save edgeTypes as
Definition GUIAppEnum.h:735
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:935
@ MID_GNE_LOCK_CONNECTION
lock connections
Definition GUIAppEnum.h:871
@ MID_GNE_TOOLBARFILE_RELOADNETWORK
reload only network
Definition GUIAppEnum.h:707
@ MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY
don't ask before merging junctions
Definition GUIAppEnum.h:849
@ MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAELEMENTS
save Mean Datas
Definition GUIAppEnum.h:216
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:847
@ MID_GNE_TLSTABLE_MOVEUPPHASE
TLSTable button for move up phase.
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:961
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:969
@ MID_GNE_TOOLBARFILE_RELOAD_SUMOCONFIG
reload SUMOConfig
Definition GUIAppEnum.h:717
@ MID_GNE_LOCK_LANE
lock lanes
Definition GUIAppEnum.h:869
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:829
@ MID_HOTKEY_CTRL_SHIFT_O_OPENNETCONVERTFILE
open Netconvert file
Definition GUIAppEnum.h:220
@ MID_HOTKEY_CTRL_M_OPENSUMOCONFIG
open sumo config
Definition GUIAppEnum.h:107
@ MID_GNE_TOOLBARFILE_SAVENETWORK_AS
save network as
Definition GUIAppEnum.h:721
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:933
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:949
@ MID_HOTKEY_CTRL_Z_UNDO
Redo.
Definition GUIAppEnum.h:135
@ MID_GNE_TOOLBARFILE_SAVEDEMANDELEMENTS_UNIFIED
save demand elements unified
Definition GUIAppEnum.h:741
@ MID_HOTKEY_CTRL_H_APPSETTINGS_OPENEDGETYPES
open app setting dialog in SUMO and open edge type files in netedit
Definition GUIAppEnum.h:97
@ MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG
save SUMOConfig (SUMO AND netedit)
Definition GUIAppEnum.h:222
@ MID_GNE_LOCK_CROSSING
lock crossings
Definition GUIAppEnum.h:873
@ MID_HOTKEY_F12_ABOUT
open about dialog
Definition GUIAppEnum.h:256
@ MID_HOTKEY_CTRL_E_EDITSELECTION_LOADNETEDITCONFIG
Edit selection in SUMO and load neteditConfig in netedit.
Definition GUIAppEnum.h:91
@ MID_GNE_TOOLBARFILE_RELOAD_DATAELEMENTS
reload data elements
Definition GUIAppEnum.h:749
@ MID_HOTKEY_CTRL_SHIFT_K_SAVETLS
save TLS Programs
Definition GUIAppEnum.h:214
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:234
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:947
@ MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT
focus upper element of current frame (only used in netedit)
Definition GUIAppEnum.h:276
@ MID_GNE_TOOLBARFILE_RELOAD_ADDITIONALELEMENTS
reload additionals
Definition GUIAppEnum.h:729
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:835
@ MID_GNE_SAVEJOINEDJUNCTIONS
save joined junctions
Definition GUIAppEnum.h:711
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:939
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:827
@ MID_GNE_TOOLBARFILE_SAVEJUPEDSIMELEMENTS_AS
save JuPedSim as
Definition GUIAppEnum.h:727
@ MID_GNE_LOCK_JUNCTION
lock junctions
Definition GUIAppEnum.h:865
@ MID_GNE_LOCK_POI
lock POIs
Definition GUIAppEnum.h:885
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:61
@ MID_HOTKEY_CTRL_L_SAVEASPLAINXML
save network as plain XML
Definition GUIAppEnum.h:105
@ MID_GNE_LOCK_TAZ
lock TAZs
Definition GUIAppEnum.h:881
@ MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALELEMENTS
Save Additional Elements.
Definition GUIAppEnum.h:202
@ KEY_F4
@ KEY_F9
@ KEY_F6
@ KEY_F7
@ KEY_F10
@ KEY_F5
@ KEY_F12
@ KEY_F2
@ KEY_F3
@ KEY_F8
@ KEY_F11
@ KEY_F1
constexpr int MOUSE_OFFSET_X
constexpr int MOUSE_REFERENCE_Y
constexpr int MOUSE_REFERENCE_X
constexpr int MOUSE_OFFSET_Y
#define WRITE_ERRORF(...)
Definition MsgHandler.h:296
#define WRITE_ERROR(msg)
Definition MsgHandler.h:295
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
int getY() const
get y value
int getX() const
get x value
std::vector< InternalTest::ViewPosition > interpolateViewPositions(const InternalTest::ViewPosition &viewStartPosition, const int offsetStartX, const int offsetStartY, const InternalTest::ViewPosition &viewEndPosition, const int offsetEndX, const int offsetEndY) const
interpolate view positions
void addTestSteps(InternalTestStep *internalTestStep)
add test steps
const std::map< std::string, InternalTest::ContextualMenu > & getContextualMenuOperations() const
get map with contextual menu operation jump steps
const std::map< std::string, int > & getAttributesEnum() const
get map with attributesEnum jump steps
const std::map< std::string, InternalTest::ViewPosition > & getViewPositions() const
get map with view position pairs
FXint getTime() const
get currentTime
void updateLastMovedPosition(const int x, const int y)
update last moved position
const InternalTest::ViewPosition & getLastMovedPosition() const
get last moved position
const std::map< std::string, InternalTest::Movement > & getMovements() const
get map with movement pairs
dialog arguments, used for certain modal dialogs that can not be edited using tab
const std::string & getCustomAction() const
get custom action
Action getAction() const
get basic action
DialogType getType() const
get type
DialogArgument()=delete
invalidated default constructor
std::string myCustomAction
action to be carried out in the dialog
struct used for test TLS Tables
TLSTableTest()=delete
invalidated default constructor
void changeSupermode()
process changeSupermode function
const std::string & getDescription() const
get description
void contextualMenuOperation() const
process contextualMenuOperation function
FXEvent * buildKeyPressEvent(const std::string &key) const
build key press event
std::pair< FXint, FXString > translateKey(const std::string &key) const
translate key
void modifyVTypeDialogAttribute() const
process modifyVTypeDialogAttribute function
void createSquaredShape()
process createSquaredShape function
void * getEvent() const
get event associated with this step
std::string stripSpaces(const std::string &str) const
strip spaces
void fixStoppingPlace()
process fixStoppingPlace function
void modifyVClassDialog_DisallowAll(const int overlappedTabs) const
process modifyVClassDialog_DisallowAll function
Category myCategory
step category
void joinTSL() const
process join TLS function
void modifyCrossingDefaultBoolValue() const
process modifyCrossingDefaultBoolValue function
FXEvent * myEvent
list of events associated with this step
void modifyVClassDialog_Reset(const int overlappedTabs) const
process modifyVClassDialog_Reset function
InternalTestStep()=delete
invalidate default constructor
void buildMouseDragDrop(const InternalTest::ViewPosition &viewStartPosition, const int offsetStartX, const int offsetStartY, const InternalTest::ViewPosition &viewEndPosition, const int offsetEndX, const int offsetEndY, const std::string &keyModifier) const
build mouse dragdrop
void reloadFile()
process reload file function
void disJoinTLS() const
process disJoin TLS function
void lockSelection() const
process lockSelection function
void modifyTLSTable()
process modifyTLSTable function
std::string getStringArgument(const std::string &argument) const
get string argument
InternalTestStep * getNextStep() const
get next step
std::string myDescription
description
void setupAndStart()
process setupAndStart function
void crossingInvertEdges() const
process crossingInvertEdges function
void resetSingleTLSPhases() const
process resetSingleTLSPhases function
void modifyStringAttribute(Category category, const int tabs, const int overlappedTabs, const std::string &value) const
modify attribute
void checkParameters(const int overlappedTabs) const
process checkParameters function
void selection() const
process selection function
void pressTLSButton(const std::string &type)
process pressTLSButton function
void resetAllTLSPhases() const
process resetAllTLSPhases function
void selectAdditionalChild()
process selectChild function
FXSelector getSelector() const
get selector (based in messageType and messageID)
void buildRedo(const int number) const
process check redo function
void undo() const
process undo function
InternalTestStep * myNextStep
next step in the test
void moveElementVertical() const
process moveElementVertical function
void focusOnFrame() const
process focusOnFrame function
void modifyColorAttribute(const int overlappedTabs) const
process modifyColorAttribute function
bool getBoolArgument(const std::string &argument) const
get bool argument
bool updateView() const
check if update view
void overwritingAccept()
process overwriting accept function
void selectEdgeType()
process select edge type function
void protectElements() const
process protect elements function
void createCrossing() const
process createCrossing function
void checkDoubleParameters(const int overlappedTabs) const
process checkDoubleParameters function
void modifyBoolAttribute(const int overlappedTabs) const
process modifyBoolAttribute function
void addPhase(const std::string &type)
process addPhase function
void createNewEdgeType()
process create new edge type function
void mouseClick(const std::string &button, const std::string &modifier) const
process click function
void checkUndoRedo() const
process check undo-redo function
DialogArgument * myDialogArgument
dialog argument
void crossingClearEdges() const
process crossingClearEdges function
void overwritingApplyToAll()
process overwriting apply to all function
void saveExistentFile()
process save existent function
bool checkBoolArgument(const std::string &argument) const
check bool argument
std::string parseStep(const std::string &rowText)
parse function and arguments
void modifyVClassDialog_NoDisallowAll(const int overlappedTabs) const
process modifyVClassDialog_DisallowAll function
void copyMeanData()
process copyMeanData function
void deleteTLS() const
process delete TLS function
void buildMouseClick(const InternalTest::ViewPosition &viewPosition, const int offsetX, const int offsetY, const std::string &button, const std::string &keyModifier) const
build mouse click event
InternalTest * myTestSystem
test system parent
void openAboutDialog()
process openAboutDialog function
void createShape(const InternalTest::ViewPosition &viewPosition, const int sizeX, const int sizeY, const bool close, const bool line) const
create shape
void saveConnectionEdit() const
process createConnectionEdit function
TLSTableTest * myTLSTableTest
TLS Table test.
void createTLS(const int overlappedTabs) const
process createTLS function
void modifyAttribute(const int overlappedTabs) const
process modifyAttribute function
void selectNetworkItems() const
process selectNetworkItems function
bool checkIntArgument(const std::string &argument) const
check int argument
void copyTLS() const
process Copy TLS function
void writeClickInfo(const InternalTest::ViewPosition &viewPosition, const int offsetX, const int offsetY, const std::string modifier) const
write click info
void changeEditMode()
process changeEditMode function
DialogArgument * getDialogArgument() const
get dialog argument
void createDataSet() const
process createDataSet function
void createMeanData()
process createMeanData function
void buildTwoPressKeyEvent(Category category, const std::string &keyA, const std::string &keyB, const bool updateView) const
build a two key press and key release (used for tabs, spaces, enter, etc)
void waitDeleteWarning() const
process waitDeleteWarning function
void createConnection(const std::string &keyModifier) const
process createConnection function
FXSelector myMessageID
message ID
TLSTableTest * getTLSTableTest() const
get TLS Table test
FXSelector getMessageID() const
get message ID
void createDataInterval() const
process createDataInterval function
void buildUndo(const int number) const
process check undo function
void moveElementHorizontal() const
process moveElementHorizontal function
void computeJunctions()
process computeJunctions function
void saveFileAs()
process save file as function
bool myUpdateView
flag to enable or disable view after execute step
void pressTLSPhaseButton() const
process pressTLSPhaseButton function
void parseArguments(const std::string &arguments)
parse arguments
void quit()
process quit function
void changeElement() const
process changeElement function
void deleteMeanData()
process deleteMeanData function
void changeMode()
process changeMode function
bool checkStringArgument(const std::string &argument) const
check string argument
void buildPressKeyEvent(Category category, const std::string &key, const bool updateView) const
build a key press and key release (used for tabs, spaces, enter, etc)
~InternalTestStep()
destructor
void changePlan() const
@bief process changePlan function
void joinJunctions()
process joinJunctions function
void redo() const
process redo function
void saveUnifiedFileAs()
process save unified file as function
void fixCrossings()
process fixCrossings function
void overwritingAbort()
process overwriting abort function
FXSelector myMessageType
message type (by default SEL_COMMAND)
void createRectangledShape()
process createRectangledShape function
void createLineShape()
process createLineShape function
void typeKey() const
process typeKey function
std::vector< std::string > myArguments
arguments
void writeError(const std::string &function, const int overlapping, const std::string &expected) const
write error
void setNextStep(InternalTestStep *nextStep)
set next step
Category getCategory() const
get category
void fixRoute()
process fixRoutes function
void selectionRectangle() const
process selectionRectangle function
void saveNewFile()
process save new file function
void leftClickOffset(const std::string &button) const
process click function
void computeJunctionsVolatileOptions()
process computeJunctionsVolatileOptions function
void modifyVClassDialog_Cancel(const int overlappedTabs) const
process modifyVClassDialog_Cancel function
void overwritingCancel()
process overwriting cancel function
void moveElement() const
process moveElement function
int getIntArgument(const std::string &argument) const
get int argument
FXEvent * buildKeyReleaseEvent(const std::string &key) const
build key release event
FXSelector getMessageType() const
get message type
void deleteFunction() const
process delete function
FXEvent * buildMouseMoveEvent(const InternalTest::ViewPosition &viewPosition, const int offsetX, const int offsetY, const int clickedButton, const std::string &keyModifier, const int numberOfClicks) const
build mouse move event
void loadFile()
process load file function
void modifyCrossingDefaultValue() const
process modifyCrossingDefaultValue function
void finish()
finish function
FXEvent * buildMouseClickEvent(FXSelType type, const InternalTest::ViewPosition &viewPosition, const int offsetX, const int offsetY, const std::string &keyModifier, const int numberOfClicks) const
build mouse left click press event
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool isInt(const std::string &sData)
check if the given sData can be converted to int