Commit 4f40be20 authored by Jean Meurice's avatar Jean Meurice

Master merge

parents 3d87db2a e32a1d5d
Pipeline #175722 failed with stage
in 1 minute and 16 seconds
# (c) https://github.com/MontiCore/monticore
#
stages:
......
# (c) https://github.com/MontiCore/monticore
script:
- git checkout ${TRAVIS_BRANCH}
......
<!-- (c) https://github.com/MontiCore/monticore -->
[![Build Status](https://travis-ci.org/MontiSim/RMIModelServer.svg?branch=master)](https://travis-ci.org/MontiSim/RMIModelServer)
[![Maintainability](https://api.codeclimate.com/v1/badges/55c8774bfd4d37534691/maintainability)](https://codeclimate.com/github/MontiSim/RMIModelServer/maintainability)
......
#!/bin/bash
# (c) https://github.com/MontiCore/monticore
rm rmi-model-server-*.jar
cp ../target/rmi-model-server-*-jar-with-dependencies.jar ./rmi-model-server.jar
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
set GENDIR=target\
......
@rem (c) https://github.com/MontiCore/monticore
@REM Please replace this with the path to the Autopilot(s)
set AUTOPILOT_FOLDER=autopilots
......
#!/bin/bash
# (c) https://github.com/MontiCore/monticore
# Please replace this with the path to the Autopilot(s)
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
pushd ..
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
pushd ..
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
pushd ..
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
pushd ..
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
pushd ..
......
<!-- (c) https://github.com/MontiCore/monticore -->
## install
This folder contains a sample setup of the RMIModelServer using the HardwareEmulator.
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
call config.bat
......
#!/bin/bash
# (c) https://github.com/MontiCore/monticore
source ./config.sh
......
@rem (c) https://github.com/MontiCore/monticore
@echo off
call config.bat
......
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
if [ -z "$1" ]; then
......
====
******************************************************************************
MontiCAR Modeling Family, www.se-rwth.de
Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
All rights reserved.
/* (c) https://github.com/MontiCore/monticore */
This project is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
You should have received a copy of the GNU Lesser General Public
License along with this project. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
====
******************************************************************************
MontiCAR Modeling Family, www.se-rwth.de
Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
All rights reserved.
This project is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this project. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
<!--
******************************************************************************
MontiCAR Modeling Family, www.se-rwth.de
Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
All rights reserved.
This project is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this project. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- (c) https://github.com/MontiCore/monticore -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>montisim</groupId>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
******************************************************************************
MontiCAR Modeling Family, www.se-rwth.de
Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
All rights reserved.
This project is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this project. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
-->
<!-- (c) https://github.com/MontiCore/monticore -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
......
******************************************************************************
MontiCAR Modeling Family, www.se-rwth.de
Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
All rights reserved.
/* (c) https://github.com/MontiCore/monticore */
This project is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
You should have received a copy of the GNU Lesser General Public
License along with this project. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
/**
*
* ******************************************************************************
* MontiCAR Modeling Family, www.se-rwth.de
* Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
* All rights reserved.
*
* This project is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package de.rwth.monticore.EmbeddedMontiArc.simulators.rmimodelserver;
/* (c) https://github.com/MontiCore/monticore */
package rwth.rmi.model.server;
import org.I0Itec.zkclient.ZkClient;
import de.rwth.monticore.EmbeddedMontiArc.simulators.hardware_emulator.HardwareEmulatorInterface;
......
/* (c) https://github.com/MontiCore/monticore */
package simulator.integration;
import org.junit.Test;
import org.junit.Assert;
import java.io.File;
import java.io.Serializable;
import java.util.HashMap;
public class HardwareEmulatorTest {
@Test
public void basic_test() throws Exception {
System.out.println("Current test directory: " + System.getProperty("user.dir"));
HardwareEmulatorInterface manager = new HardwareEmulatorInterface("autopilots_folder=autopilots", "");
String querry = "get_available_autopilots\nget_available_threads";
String res = manager.query(querry);
System.out.println("EmulatorManager querry response: " + res);
String lines[] = res.split("\n");
Assert.assertEquals("Querry result line count", 2, lines.length);
String line1[] = lines[0].split("=");
Assert.assertEquals("available_autopilots two values (=)", 2, line1.length);
Assert.assertEquals("available_autopilots command", new String("available_autopilots"), line1[0]);
String line2[] = lines[1].split("=");
Assert.assertEquals("available_threads two values (=)", 2, line2.length);
Assert.assertEquals("available_threads command", new String("available_threads"), line2[0]);
String config = "autopilot=AutopilotAdapter";
config += "\nos=windows";
int id = manager.alloc_autopilot(config);
if (id < 0){
String q = manager.query( "get_error_msg" );
Assert.assertTrue("Could not allocate Emulator: " + q, id >= 0);
}
HashMap<String, Serializable> inputs = new HashMap<String, Serializable>();
inputs.put("timeIncrement", 1.0);
inputs.put("currentVelocity", 0.0);
inputs.put("x", 0.01);
inputs.put("y", 0.01);
inputs.put("compass", 0.0);
inputs.put("currentEngine", 0.0);
inputs.put("currentSteering", 0.0);
inputs.put("currentBrakes", 0.0);
inputs.put("trajectory_length", 5);
inputs.put("trajectory_x", new double[]{0.01, 0.02, 0.03, 0.04, 0.05, 0.06});
inputs.put("trajectory_y", new double[]{0.01, 0.01, 0.02, 0.02, 0.01, 0.01});
manager.update_bus(id, inputs);
//manager.start_tick(1000000);
//manager.end_tick();
HashMap<String, Serializable> outputs = manager.old_execute(id, 1000000, inputs);
String emu_querry = manager.query_autopilot(id, "get_avg_runtime");
System.out.println("Emu querry: " + emu_querry);
//HashMap<String, Serializable> outputs = manager.get_outputs(id);
Assert.assertEquals("output count", outputs.size(), 3);
for (HashMap.Entry<String, Serializable> entry : outputs.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
manager.free_autopilot(id);
//Try to clear up the library from the test directory
File lib = manager.get_library();
manager = null;
System.gc();
lib.delete();
}
}
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