|
From: <ma...@us...> - 2012-08-14 09:30:56
|
Revision: 1449
http://scstudio.svn.sourceforge.net/scstudio/?rev=1449&view=rev
Author: madzin
Date: 2012-08-14 09:30:48 +0000 (Tue, 14 Aug 2012)
Log Message:
-----------
Fix a HMSC Diff output message. Change the green color in the output.
Modified Paths:
--------------
trunk/src/data/searcher.h
trunk/src/membership/membership_alg.cpp
trunk/src/scstudio.cpp
trunk/src/view/visio/addon/document.cpp
trunk/src/view/visio/addon/enums.h
trunk/src/view/visio/addon/visualize.cpp
trunk/src/view/visio/addon/visualize.h
trunk/tests/diff/diff_test.cpp
trunk/tests/membership/membership_test.cpp
Modified: trunk/src/data/searcher.h
===================================================================
--- trunk/src/data/searcher.h 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/data/searcher.h 2012-08-14 09:30:48 UTC (rev 1449)
@@ -38,7 +38,7 @@
{
enum TReportSeverity msg_type;
std::wstring msg;
- std::vector<MscPtr> counterexamples;
+ std::list<MscPtr> counterexamples;
private:
//! Number of references to this object.
@@ -50,7 +50,7 @@
public:
- SearcherResult(enum TReportSeverity type, std::wstring msg, std::vector<MscPtr> examples)
+ SearcherResult(enum TReportSeverity type, std::wstring msg, std::list<MscPtr> examples)
{
this->msg_type = type;
this->msg = msg;
@@ -68,7 +68,7 @@
return msg;
}
- std::vector<MscPtr> get_counterexamples()
+ std::list<MscPtr> get_counterexamples()
{
return counterexamples;
}
Modified: trunk/src/membership/membership_alg.cpp
===================================================================
--- trunk/src/membership/membership_alg.cpp 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/membership/membership_alg.cpp 2012-08-14 09:30:48 UTC (rev 1449)
@@ -108,10 +108,10 @@
std::wstring msg = L"Flow \"" + bmsc->get_label() + L"\" not found. Unsatisfied time constraint(s) ";
msg += L"(red intervals are not satisfied, blue intervals are partially satisfied): ";
- std::vector<MscPtr> result_vec;
- result_vec.push_back(result);
+ std::list<MscPtr> result_list;
+ result_list.push_back(result);
- messages.push_back(new SearcherResult(RS_ERROR, msg, result_vec));
+ messages.push_back(new SearcherResult(RS_ERROR, msg, result_list));
c->clear_attributed_events();
delete c;
@@ -122,10 +122,10 @@
{
std::wstring msg = L"Flow \"" + bmsc->get_label() + L"\" not found. Unsatisfied time constraint(s). Some interval(s) are only partially satisfied: ";
- std::vector<MscPtr> result_vec;
- result_vec.push_back(result);
+ std::list<MscPtr> result_list;
+ result_list.push_back(result);
- messages.push_back(new SearcherResult(RS_ERROR, msg, result_vec));
+ messages.push_back(new SearcherResult(RS_ERROR, msg, result_list));
c->clear_attributed_events();
delete c;
@@ -133,14 +133,14 @@
}
std::wstring msg = L"Flow \"" + bmsc->get_label() + L"\" found";
- std::vector<MscPtr> result_vec;
+ std::list<MscPtr> result_list;
if(!instances.empty())
msg += L" on instances: " + focused_instance_names;
msg += L".";
- messages.push_back(new SearcherResult(RS_NOTICE, msg, result_vec));
+ messages.push_back(new SearcherResult(RS_NOTICE, msg, result_list));
c->clear_attributed_events();
delete c;
@@ -200,11 +200,10 @@
std::wstring msg;
msg = L"Flow \"" + bmsc_f->get_label() + L"\" not found. Diff: ";
- std::vector<MscPtr> diff_result;
+ std::list<MscPtr> diff_result;
diff_result.push_back(result);
- messages.push_back(new SearcherResult(RS_ERROR, msg, diff_result));
-
+ messages.push_back(new SearcherResult(RS_ERROR, msg, diff_result));
}
c->clear_attributed_events();
@@ -217,10 +216,10 @@
std::wstring msg = L"Flow \"" + bmsc_f->get_label() + L"\" not found. Unsatisfied time constraint(s) ";
msg += L"(red intervals are not satisfied, blue intervals are partially satisfied): ";
- std::vector<MscPtr> result_vec;
- result_vec.push_back(result);
+ std::list<MscPtr> result_list;
+ result_list.push_back(result);
- messages.push_back(new SearcherResult(RS_ERROR, msg, result_vec));
+ messages.push_back(new SearcherResult(RS_ERROR, msg, result_list));
c->clear_attributed_events();
delete c;
@@ -231,10 +230,10 @@
{
std::wstring msg = L"Flow \"" + bmsc_f->get_label() + L"\" not found. Unsatisfied time constraint(s). Some interval(s) are only partially satisfied: ";
- std::vector<MscPtr> result_vec;
- result_vec.push_back(result);
+ std::list<MscPtr> result_list;
+ result_list.push_back(result);
- messages.push_back(new SearcherResult(RS_ERROR, msg, result_vec));
+ messages.push_back(new SearcherResult(RS_ERROR, msg, result_list));
c->clear_attributed_events();
delete c;
@@ -312,7 +311,7 @@
find_flow(dup_msc, msc_for_cover[i], instances, msg);
}
- std::vector<MscPtr> msc_cover;
+ std::list<MscPtr> msc_cover;
msc_cover.push_back(dup_msc);
if(msc_for_cover.size() > 1)
@@ -1385,11 +1384,11 @@
std::wstring msg = L"Flow \"" + c->get_bmsc()->get_label() + L"\" not found.";
msg += L" Diff is not available (specification contains coregion).";
- std::vector<MscPtr> result_vec;
- return new SearcherResult(RS_ERROR, msg, result_vec);
+ std::list<MscPtr> result_list;
+ return new SearcherResult(RS_ERROR, msg, result_list);
}
- std::vector<MscPtr> result_vec;
+ std::list<MscPtr> result_list;
std::wstring msg = L"Flow \"" + c->get_bmsc()->get_label() + L"\" not found.";
msg += L" Diff is available (HMSC path + diff):";
@@ -1400,7 +1399,7 @@
throw std::runtime_error("Unexpected behaviour.");
MscPtr result = make_result(c, spec);
- result_vec.push_back(result);
+ result_list.push_back(result);
/* DIFF */
//transform path to the list
@@ -1426,10 +1425,10 @@
// make diff
result = diff(c_diff, path_bmsc, flows);
// store result
- result_vec.push_back(result);
+ result_list.push_back(result);
c_diff->clear_attributed_events();
delete c_diff;
- return new SearcherResult(RS_ERROR, msg, result_vec);
+ return new SearcherResult(RS_ERROR, msg, result_list);
}
Modified: trunk/src/scstudio.cpp
===================================================================
--- trunk/src/scstudio.cpp 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/scstudio.cpp 2012-08-14 09:30:48 UTC (rev 1449)
@@ -585,10 +585,14 @@
{
try
{
+ std::list<MscPtr>::iterator list_it;
+
std::wcout << (*vec_it)->get_msg() << std::endl; //TODO change to cout
- for(unsigned int i = 0; i < (*vec_it)->get_counterexamples().size(); i++)
+ for(list_it = (*vec_it)->get_counterexamples().begin();
+ list_it != (*vec_it)->get_counterexamples().end();
+ list_it++)
{
- z120.save_msc(std::cout, L"msc_diff", (*vec_it)->get_counterexamples().at(i));
+ z120.save_msc(std::cout, L"msc_diff", *list_it);
}
}
catch(std::exception& exc)
@@ -747,10 +751,14 @@
{
try
{
+ std::list<MscPtr>::iterator list_it;
+
std::wcout << (*vec_it)->get_msg() << std::endl; //TODO change to cout
- for(unsigned int i = 0; i < (*vec_it)->get_counterexamples().size(); i++)
+ for(list_it = (*vec_it)->get_counterexamples().begin();
+ list_it != (*vec_it)->get_counterexamples().end();
+ list_it++)
{
- z120.save_msc(std::cout, TOWSTRING(specification), (*vec_it)->get_counterexamples().at(i));
+ z120.save_msc(std::cout, TOWSTRING(specification), *list_it);
}
}
catch(std::exception& exc)
Modified: trunk/src/view/visio/addon/document.cpp
===================================================================
--- trunk/src/view/visio/addon/document.cpp 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/view/visio/addon/document.cpp 2012-08-14 09:30:48 UTC (rev 1449)
@@ -1085,7 +1085,7 @@
if((*result_it)->get_counterexamples().empty())
m_reportView->Print((*result_it)->get_msg_type(), (*result_it)->get_msg());
else
- m_reportView->Print((*result_it)->get_msg_type(), (*result_it)->get_msg(), (*result_it)->get_counterexamples().front());
+ m_reportView->Print((*result_it)->get_msg_type(), (*result_it)->get_msg(), (*result_it)->get_counterexamples());
}
return VAORC_SUCCESS;
Modified: trunk/src/view/visio/addon/enums.h
===================================================================
--- trunk/src/view/visio/addon/enums.h 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/view/visio/addon/enums.h 2012-08-14 09:30:48 UTC (rev 1449)
@@ -82,6 +82,9 @@
SC_BLUE,
SC_YELLOW,
SC_PINK,
+ SC_CYAN,
+ SC_BROWN,
+ SC_DARK_GREEN,
};
enum ToolbarFlags
Modified: trunk/src/view/visio/addon/visualize.cpp
===================================================================
--- trunk/src/view/visio/addon/visualize.cpp 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/view/visio/addon/visualize.cpp 2012-08-14 09:30:48 UTC (rev 1449)
@@ -282,7 +282,7 @@
{
case NONE: CShapeUtils::MarkShape(msg, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(msg, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(msg, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(msg, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(msg, SC_RED); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -429,7 +429,7 @@
{
case NONE: CShapeUtils::MarkShape(result, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(result, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(result, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(result, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(result, SC_RED); break;
case NOT_COVER: CShapeUtils::MarkShape(result, SC_RED); break;
case NOT_FULL_COVER: CShapeUtils::MarkShape(result, SC_BLUE); break;
@@ -490,7 +490,7 @@
{
case NONE: CShapeUtils::MarkShape(text, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(text, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(text, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(text, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(text, SC_RED); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -520,7 +520,7 @@
{
case NONE: CShapeUtils::MarkShape(inst, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(inst, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(inst, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(inst, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(inst, SC_RED); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -569,7 +569,7 @@
{
case NONE: CShapeUtils::MarkShape(coregion, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(coregion, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(coregion, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(coregion, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(coregion, SC_RED); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -607,7 +607,7 @@
{
case NONE: CShapeUtils::MarkShape(connector, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(connector, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(connector, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(connector, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(connector, SC_RED); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -672,9 +672,9 @@
{
case NONE: CShapeUtils::MarkShape(shape, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(shape, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(shape, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(shape, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(shape, SC_RED); break;
- case PATH: CShapeUtils::MarkShape(shape, SC_GREEN); break;
+ case PATH: CShapeUtils::MarkShape(shape, SC_DARK_GREEN); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -767,9 +767,9 @@
{
case NONE: CShapeUtils::MarkShape(connector, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(connector, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(connector, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(connector, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(connector, SC_RED); break;
- case PATH: CShapeUtils::MarkShape(connector, SC_GREEN); break;
+ case PATH: CShapeUtils::MarkShape(connector, SC_DARK_GREEN); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -814,9 +814,9 @@
{
case NONE: CShapeUtils::MarkShape(commentShape, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(commentShape, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(commentShape, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(commentShape, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(commentShape, SC_RED); break;
- case PATH: CShapeUtils::MarkShape(commentShape, SC_GREEN); break;
+ case PATH: CShapeUtils::MarkShape(commentShape, SC_DARK_GREEN); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
// CShapeUtils::MarkShape(commentShape);
Modified: trunk/src/view/visio/addon/visualize.h
===================================================================
--- trunk/src/view/visio/addon/visualize.h 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/src/view/visio/addon/visualize.h 2012-08-14 09:30:48 UTC (rev 1449)
@@ -86,7 +86,7 @@
{
case NONE: CShapeUtils::MarkShape(result, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(result, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(result, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(result, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(result, SC_RED); break;
default: throw std::runtime_error("Error: unexpected behaviour");
}
@@ -104,7 +104,7 @@
{
case NONE: CShapeUtils::MarkShape(result, SC_BLACK); break;
case MARKED: CShapeUtils::MarkShape(result, SC_RED); break;
- case ADDED: CShapeUtils::MarkShape(result, SC_GREEN); break;
+ case ADDED: CShapeUtils::MarkShape(result, SC_DARK_GREEN); break;
case REMOVED: CShapeUtils::MarkShape(result, SC_RED); break;
case NOT_COVER: CShapeUtils::MarkShape(result, SC_RED); break;
case NOT_FULL_COVER: CShapeUtils::MarkShape(result, SC_BLUE); break;
Modified: trunk/tests/diff/diff_test.cpp
===================================================================
--- trunk/tests/diff/diff_test.cpp 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/tests/diff/diff_test.cpp 2012-08-14 09:30:48 UTC (rev 1449)
@@ -118,11 +118,15 @@
try
{
- std::vector<SearcherResultPtr>::iterator result_it;
+ std::vector<SearcherResultPtr>::iterator result_it;
+ std::list<MscPtr>::iterator list_it;
+
for(result_it = result.begin(); result_it != result.end(); result_it++)
{
- for(unsigned int i = 0; i < (*result_it)->get_counterexamples().size(); i++)
- z120.save_msc(std::cout, L"msc_diff", (*result_it)->get_counterexamples().at(i));
+ for(list_it = (*result_it)->get_counterexamples().begin();
+ list_it != (*result_it)->get_counterexamples().end();
+ list_it++)
+ z120.save_msc(std::cout, L"msc_diff", *list_it);
}
}
catch(std::exception& exc)
Modified: trunk/tests/membership/membership_test.cpp
===================================================================
--- trunk/tests/membership/membership_test.cpp 2012-08-14 07:48:28 UTC (rev 1448)
+++ trunk/tests/membership/membership_test.cpp 2012-08-14 09:30:48 UTC (rev 1449)
@@ -112,13 +112,16 @@
if(!result.empty())
{
std::vector<SearcherResultPtr>::iterator vec_it;
+ std::list<MscPtr>::iterator list_it;
for(vec_it = result.begin(); vec_it != result.end(); vec_it++)
{
std::wcerr << (*vec_it)->get_msg() << std::endl;
- for(unsigned int i = 0; i < (*vec_it)->get_counterexamples().size(); i++)
+ for(list_it = (*vec_it)->get_counterexamples().begin();
+ list_it != (*vec_it)->get_counterexamples().end();
+ list_it++)
{
- z120.save_msc(std::cout, TOWSTRING(filename), (*vec_it)->get_counterexamples().at(i));
+ z120.save_msc(std::cout, TOWSTRING(filename), *list_it);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|