Commit c7faf42b authored by Ludovic Apvrille's avatar Ludovic Apvrille

Merge branch 'javascript_update' into 'master'

add missing javascipt libs and fix double click to show/hide piechart

See merge request !244
parents 5eea67ec 98b20dff
......@@ -410,6 +410,7 @@ $(BASERELEASE:.tgz=.tar): $(JTTOOL_BINARY) $(TTOOL_BINARY) $(LAUNCHER_BINARY) $(
@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/sim
@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/TEPE
@mkdir -p $(TTOOL_TARGET)/simulators/c++2/lib
@mkdir -p $(TTOOL_TARGET)/simulators/c++2/javascript_libs
@cp $(TTOOL_SIMULATORS)/c++2/lib/README $(TTOOL_TARGET)/simulators/c++2/lib/
@cp $(TTOOL_SIMULATORS)/c++2/Makefile $(TTOOL_TARGET)/simulators/c++2
@cp $(TTOOL_SIMULATORS)/c++2/Makefile.defs $(TTOOL_TARGET)/simulators/c++2
......@@ -427,6 +428,7 @@ $(BASERELEASE:.tgz=.tar): $(JTTOOL_BINARY) $(TTOOL_BINARY) $(LAUNCHER_BINARY) $(
@cp $(TTOOL_SIMULATORS)/c++2/src_simulator/sim/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/sim
@cp $(TTOOL_SIMULATORS)/c++2/src_simulator/TEPE/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/TEPE
@cp $(TTOOL_SIMULATORS)/c++2/src_simulator/TEPE/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/TEPE
@cp $(TTOOL_SIMULATORS)/c++2/src_simulator/javascript_libs/*.js $(TTOOL_TARGET)/simulators/c++2/src_simulator/javascript_libs
# Licenses
@cp $(RELEASE_STD_FILES_LICENSES) $(TTOOL_TARGET)
# Main readme
......@@ -527,6 +529,8 @@ install:
#ttool launcher graphminimize graphshow tiftranslator tmltranslator rundse remotesimulator webcrawler
mkdir -p $(DESTDIR)/bin
@cp $(TTOOL_BUILD)/*.jar $(TTOOL_BUILD)/*.xml $(TTOOL_BUILD)/*.h $(TTOOL_BUILD)/*.f $(TTOOL_BUILD)/*.t $(TTOOL_BUILD)/*.exe $(DESTDIR)/bin
@sed -i '/#define SCHED_HTML_JS_LINK1/c\#define SCHED_HTML_JS_LINK1 "<script src=\\"$(DESTDIR)/simulators/c++2/javascript_libs/jquery.min.js\\">"' $(DESTDIR)/simulators/c++2/src_simulator/definitions.h
@sed -i '/#define SCHED_HTML_JS_LINK2/c\#define SCHED_HTML_JS_LINK2 "<script src=\\"$(DESTDIR)/simulators/c++2/javascript_libs/Chart.min.js\\">"' $(DESTDIR)/simulators/c++2/src_simulator/definitions.h
# ========================================
# ========== TESTS ==========
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -136,7 +136,13 @@ void CPU::buttonPieChart(std::ofstream& myfile) const{
type : \"pie\",\n";
myfile << " data : data" << _ID << "_" << this->_cycleTime <<",\n";
myfile << " options : options" << _ID << "_" << this->_cycleTime << std::endl << " });" << std::endl;
myfile << " chart" << _ID << "_" << this->_cycleTime << SCHED_HTML_JS_HIDE;
// myfile << " chart" << _ID << "_" << this->_cycleTime << SCHED_HTML_JS_HIDE;
myfile << " if(!" << SHOW_PIE_CHART << "){\n \t"
<< " document.getElementById(\"pie-chartcanvas-" << _ID << "_" << this->_cycleTime << "\"" << ").style.display = \"none\";\n \t"
<< " }\n \t"
<< " else {\n \t"
<< " document.getElementById(\"pie-chartcanvas-"<< _ID << "_" << this->_cycleTime << "\"" << ").style.display = \"block\"; \n \t"
<< " }\n \t";
myfile << " chart" << _ID << "_" << this->_cycleTime << ".update();" << std::endl;
}
......
......@@ -521,7 +521,13 @@ void FPGA::buttonPieChart(std::ofstream& myfile) const{
myfile << " data : data" << _ID << "_" << (*i)->toShortString() <<",\n";
myfile << " options : options" << _ID << "_" << (*i)->toShortString() << std::endl;
myfile << " });" << std::endl;
myfile << " chart" << _ID << "_" << (*i)->toShortString() << SCHED_HTML_JS_HIDE;
// myfile << " chart" << _ID << "_" << (*i)->toShortString() << SCHED_HTML_JS_HIDE;
myfile << " if(!" << SHOW_PIE_CHART << "){\n \t"
<< " document.getElementById(\"pie-chartcanvas-" << _ID << "_" << (*i)->toShortString() << "\"" << ").style.display = \"none\";\n \t"
<< " }\n \t"
<< " else {\n \t"
<< " document.getElementById(\"pie-chartcanvas-" << _ID << "_" << (*i)->toShortString() << "\"" << ").style.display = \"block\";\n \t"
<< " }\n \t";
myfile << " chart" << _ID << "_" << (*i)->toShortString() << ".update();" << std::endl;
}
......
......@@ -288,7 +288,13 @@ void SchedulableDevice::buttonPieChart(std::ofstream& myfile) const{
type : \"pie\",\n";
myfile << " data : data" << _ID << ",\n";
myfile << " options : options" << _ID << std::endl << " });" << std::endl;
myfile << " chart" << _ID << SCHED_HTML_JS_HIDE;
// myfile << " chart" << _ID << SCHED_HTML_JS_HIDE;
myfile << " if(!" << SHOW_PIE_CHART << "){\n \t"
<< " document.getElementById(\"pie-chartcanvas-" << _ID << "\"" << ").style.display = \"none\";\n \t"
<< " }\n \t"
<< " else {\n \t"
<< " document.getElementById(\"pie-chartcanvas-"<< _ID << "\"" << ").style.display = \"block\"; \n \t"
<< " }\n \t";
myfile << " chart" << _ID << ".update();" << std::endl;
}
......
......@@ -274,7 +274,7 @@ using std::max;
#define SCHED_HTML_JS_TABLE_BEGIN "<table>"
#define SCHED_HTML_JS_TABLE_END "</table>"
#define SCHED_HTML_JS_BEGIN_CANVAS " <canvas id=\"pie-chartcanvas-"
#define SCHED_HTML_JS_END_CANVAS "\"></canvas>"
#define SCHED_HTML_JS_END_CANVAS "\" width=\"256\" height=\"256\"></canvas>"
#define SCHED_HTML_JS_WINDOW "window.onload = function () {\n"
#define SCHED_HTML_DIV "<div>\n"
#define SCHED_HTML_JS_DIV_BEGIN "<div class=\"wrapper\">"
......@@ -284,6 +284,7 @@ using std::max;
#define SCHED_HTML_JS_DIV_END "</div>"
#define SCHED_HTML_JS_CLEAR "<div class = \"clear\"></div>"
#define NB_HTML_COLORS 15
#define SHOW_PIE_CHART "ShowPie"
#define SCHED_HTML_JS_FUNCTION "= function() {\n \
var r = Math.floor(Math.random() * 255);\n \
......
......@@ -508,8 +508,9 @@ std::cout<<"schedule2HTML--------------------------------------*****************
(*j)->drawPieChart(myfile);
}
myfile << "var " << SHOW_PIE_CHART << " = false;" << std::endl;
myfile << "$(\"#button\").click(function() {\n";
myfile << " " << SHOW_PIE_CHART << "=!" << SHOW_PIE_CHART << std::endl;
for(CPUList::const_iterator i=_simComp->getCPUList().begin(); i != _simComp->getCPUList().end(); ++i){
(*i)->buttonPieChart(myfile);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment