Skip to content

Commit

Permalink
performance fix for logging new head peers with autostart off (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick authored Mar 4, 2024
1 parent 556606f commit 5a2c9e6
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 118 deletions.
2 changes: 1 addition & 1 deletion myrobotlab.bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ IF NOT "%*"=="" (
"%JAVA%" %JAVA_OPTIONS% -cp %CLASSPATH% org.myrobotlab.service.Runtime --install --log-file myrobotlab-install.log
)

"%JAVA%" %JAVA_OPTIONS% -cp %CLASSPATH% org.myrobotlab.service.Runtime --log-level info -s log Log webgui WebGui intro Intro python Python
"%JAVA%" %JAVA_OPTIONS% -cp %CLASSPATH% org.myrobotlab.service.Runtime --log-level warn -s log Log webgui WebGui intro Intro python Python

)
2 changes: 1 addition & 1 deletion myrobotlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ else
"${JAVA}" ${JAVA_OPTIONS} -cp ${CLASSPATH} org.myrobotlab.service.Runtime --install --log-file myrobotlab-install.log
fi

"${JAVA}" ${JAVA_OPTIONS} -cp ${CLASSPATH} org.myrobotlab.service.Runtime --log-level info -s log Log webgui WebGui intro Intro python Python
"${JAVA}" ${JAVA_OPTIONS} -cp ${CLASSPATH} org.myrobotlab.service.Runtime --log-level warn -s log Log webgui WebGui intro Intro python Python

echo $# $@
2 changes: 1 addition & 1 deletion src/main/java/org/myrobotlab/service/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -3143,7 +3143,7 @@ public String[] getServiceTypeNames(String filter) {
static public Status noWorky(String userId) {
Status status = null;
try {
String retStr = HttpRequest.postFile("http://myrobotlab.org/myrobotlab_log/postLogFile.php", userId, "file", new File(LoggingFactory.getLogFileName()));
String retStr = HttpRequest.postFile("http://noworky.myrobotlab.org/no-worky", userId, "file", new File(LoggingFactory.getLogFileName()));
if (retStr.contains("Upload:")) {
log.info("noWorky successfully sent - our crack team of experts will check it out !");
status = Status.info("no worky sent");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/myrobotlab/service/WebGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ public static void main(String[] args) {

try {

Runtime.main(new String[] { "--log-level", "info", "-s", "log", "Log", "webgui", "WebGui", "intro", "Intro", "python", "Python" });
Runtime.main(new String[] { "--log-level", "warn", "-s", "log", "Log", "webgui", "WebGui", "intro", "Intro", "python", "Python" });
// Runtime.main(new String[] { "--install" });

boolean done = true;
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/org/myrobotlab/service/config/InMoov2HeadConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@ public Plan getDefault(Plan plan, String name) {
addDefaultPeerConfig(plan, name, "rollNeck", "Servo");
addDefaultPeerConfig(plan, name, "eyelidLeft", "Servo");
addDefaultPeerConfig(plan, name, "eyelidRight", "Servo");

// v2
addDefaultPeerConfig(plan, name, "forheadRight", "Servo", false);
addDefaultPeerConfig(plan, name, "eyelidRightUpper", "Servo", false);
addDefaultPeerConfig(plan, name, "eyelidRightLower", "Servo", false);

addDefaultPeerConfig(plan, name, "eyeRightLR", "Servo", false);
addDefaultPeerConfig(plan, name, "eyeRightUD", "Servo", false);
addDefaultPeerConfig(plan, name, "eyeRightLR", "Servo", false);
addDefaultPeerConfig(plan, name, "eyeRightUD", "Servo", false);
addDefaultPeerConfig(plan, name, "eyebrowRight", "Servo", false);
addDefaultPeerConfig(plan, name, "cheekRight", "Servo", false);

addDefaultPeerConfig(plan, name, "forheadLeft", "Servo", false);
addDefaultPeerConfig(plan, name, "eyelidLeftUpper", "Servo", false);
addDefaultPeerConfig(plan, name, "eyelidLeftLower", "Servo", false);
addDefaultPeerConfig(plan, name, "rothead", "Servo", false);
addDefaultPeerConfig(plan, name, "upperLip", "Servo", false);

addDefaultPeerConfig(plan, name, "eyeLeftLR", "Servo", false);
addDefaultPeerConfig(plan, name, "eyeLeftUD", "Servo", false);

addDefaultPeerConfig(plan, name, "eyebrowLeft", "Servo", false);
addDefaultPeerConfig(plan, name, "cheekLeft", "Servo", false);

ServoConfig jaw = (ServoConfig) plan.get(getPeerName("jaw"));
jaw.autoDisable = true;
Expand Down
231 changes: 119 additions & 112 deletions src/main/resources/resource/WebGui/app/service/tab-header.html
Original file line number Diff line number Diff line change
@@ -1,117 +1,124 @@
<div class="tab-header col-md-12">
<table>
<table>
<tr>
<td valign="top">
<button class="btn btn-default" ng-click="mrl.goBack()" title="back">
<span class="glyphicon glyphicon-arrow-left"></span>
</button>
</td>
<td>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<img ng-src="{{::service.simpleName}}.png" alt="" width="16" />
&nbsp;&nbsp {{::service.simpleName}}&nbsp;&nbsp;{{::service.name}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{::service.serviceVersion}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="dropdown-header">service functions</li>
<li>
<a href="http://myrobotlab.org/service/{{::service.simpleName}}" target="_blank" ng-click="servicemenuDropdownOpen = false">
<i class="glyphicon glyphicon-question-sign"></i>
&nbsp;&nbsp;help
</a>
</li>
<li>
<a href="" ng-click="servicemenuDropdownOpen = false;msg.broadcastState()">
<i class="glyphicon glyphicon-refresh"></i>
&nbsp;&nbsp;refresh
</a>
</li>
<li>
<a href="" target="_blank" width="100%">
<i class="glyphicon glyphicon-equalizer"></i>
<span ng-show="!parentPanel.showPeerTable" ng-click="showPeers(true)">&nbsp;&nbsp;show peers</span>
<span ng-show="parentPanel.showPeerTable" ng-click="showPeers(false)">&nbsp;&nbsp;hide peers</span>
</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">json</li>
<li>
<!-- a href="" target="_blank" ng-click="showProperties=!showProperties" -->
<a href="/api/service/{{::service.name}}" target="_blank">
<i class="glyphicon glyphicon-list-alt"></i>
&nbsp;&nbsp;properties
</a>
</li>
<li>
<!-- a href="" target="_blank" ng-click="showMethods=!showMethods" -->
<a href="/api/service/{{::service.name}}/" target="_blank">
<i class="glyphicon glyphicon-list-alt"></i>
&nbsp;&nbsp;methods
</a>
</li>
<li>
<!-- a href="" target="_blank" ng-click="showMethods=!showMethods" -->
<a href="/api/service/runtime/getNotifyEntries/{{service.name}}" target="_blank">
<i class="glyphicon glyphicon-list-alt"></i>
&nbsp;&nbsp;subscriptions
</a>
</li>
</ul>
</div>
</td>
<td>
<button class="btn btn-default" ng-click="release()" title="stops and releases a service">
<span class="glyphicon glyphicon-remove red"></span>
release
</button>
</td>
<td>
<button class="btn btn-default" ng-click="save()" title="save current configuration">
<span class="glyphicon glyphicon-save-file"></span>
save
</button>
</td>
<td>
<button class="btn btn-default" ng-click="apply()" title="load and apply configuration">
<span class="glyphicon glyphicon-open-file"></span>
apply
</button>
</td>
</tr>
</table>
<div ng-show="parentPanel.showPeerTable">
<table class="table table-sm">
<thead>
<tr>
<td valign="top">
<button class="btn btn-default" ng-click="mrl.goBack()" title="back">
<span class="glyphicon glyphicon-arrow-left"></span>
</button>
</td>
<td>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<img ng-src="{{::service.simpleName}}.png" alt="" width="16">
&nbsp;&nbsp {{::service.simpleName}}&nbsp;&nbsp;{{::service.name}}@{{::service.id}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{::service.serviceVersion}}<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="dropdown-header">service functions</li>
<li>
<a href="http://myrobotlab.org/service/{{::service.simpleName}}" target="_blank" ng-click="servicemenuDropdownOpen = false">
<i class="glyphicon glyphicon-question-sign"></i>
&nbsp;&nbsp;help
</a>
</li>
<li>
<a href="" ng-click="servicemenuDropdownOpen = false;msg.broadcastState()">
<i class="glyphicon glyphicon-refresh"></i>
&nbsp;&nbsp;refresh
</a>
</li>
<li>
<a href="" target="_blank" width="100%">
<i class="glyphicon glyphicon-equalizer"></i>
<span ng-show="!parentPanel.showPeerTable" ng-click="showPeers(true)">&nbsp;&nbsp;show peers</span>
<span ng-show="parentPanel.showPeerTable" ng-click="showPeers(false)">&nbsp;&nbsp;hide peers</span>
</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">json</li>
<li>
<!-- a href="" target="_blank" ng-click="showProperties=!showProperties" -->
<a href="/api/service/{{::service.name}}" target="_blank">
<i class="glyphicon glyphicon-list-alt"></i>
&nbsp;&nbsp;properties


</a>
</li>
<li>
<!-- a href="" target="_blank" ng-click="showMethods=!showMethods" -->
<a href="/api/service/{{::service.name}}/" target="_blank">
<i class="glyphicon glyphicon-list-alt"></i>
&nbsp;&nbsp;methods


</a>
</li>
<li>
<!-- a href="" target="_blank" ng-click="showMethods=!showMethods" -->
<a href="/api/service/runtime/getNotifyEntries/{{service.name}}" target="_blank">
<i class="glyphicon glyphicon-list-alt"></i>
&nbsp;&nbsp;subscriptions
</a>
</li>
</ul>
</div>
</td>
<td>
<button class="btn btn-default" ng-click="release()" title="stops and releases a service">
<span class="glyphicon glyphicon-remove red"></span>
</button>
</td>
<td>
<button class="btn btn-default" ng-click="save()" title="save current configuration">
<span class="glyphicon glyphicon-save-file"></span>
</button>
</td>
<td>
<button class="btn btn-default" ng-click="apply()" title="load and apply configuration">
<span class="glyphicon glyphicon-open-file"></span>
</button>
</td>

<th scope="col">key</th>
<th scope="col">name</th>
<th scope="col">state</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(key, value) in service.config.peers">
<td>
<span>
<a href="" ng-click="mrl.changeTab(peer.getActualName(service, key))">
<img width="32" ng-src="/{{value.type + '.png'}}" width="48" />
</a>
{{peer.getActualName(service, key)}}
</span>
</td>
<td>
{{value.key}}
<br />
{{value.type}}
</td>
<td>{{value.state}}</td>
<td>
<toggle
width="30"
height="28"
ng-model="service['is' + key[0].toUpperCase() + key.substring(1) + 'Started']"
ng-change="service['is' + key[0].toUpperCase() + key.substring(1) + 'Started']?startPeer(key):releasePeer(key)"
on=""
off=""
/>
</td>
<td></td>
</tr>
</tbody>
</table>
<div ng-show="parentPanel.showPeerTable">
<table class="table table-sm">
<thead>
<tr>
<th scope="col">key</th>
<th scope="col">name</th>
<th scope="col">state</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(key, value) in service.config.peers">
<td>
<span>

<a href="" ng-click="mrl.changeTab(peer.getActualName(service, key))">
<img width="32" ng-src="/{{value.type + '.png'}}" width="48">
</a>
{{peer.getActualName(service, key)}}
</span>
</td>
<td>
{{value.key}}<br/>{{value.type}}
</td>
<td>{{value.state}}</td>
<td>
<toggle width="30" height="28" ng-model="service['is' + key[0].toUpperCase() + key.substring(1) + 'Started']" ng-change="service['is' + key[0].toUpperCase() + key.substring(1) + 'Started']?startPeer(key):releasePeer(key)" on="" off=""/>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
</tr>
<tr>
<td>
<iframe width="560" height="315" src="https://www.youtube.com/embed/-EQxjpsOJDg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</td>
</tr>
</table>
Expand Down Expand Up @@ -337,7 +336,6 @@
</p>
<a class="row col-md-3" target="_blank" href="http://myrobotlab.org/service/Python">MORE INFO</a>
&nbsp;&nbsp;<a class="row col-md-3" target="_blank" href="https://raw.githubusercontent.com/MyRobotLab/InMoov2/master/resource/InMoov2/InMoov2FingerStarter.py">SEE PYTHON SCRIPT</a>
<iframe width="560" height="315" src="https://www.youtube.com/embed/_uQrJ0TkZlc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 5a2c9e6

Please sign in to comment.