This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e19c423f133518498582236fc6bd55cf6112ed79 Mon Sep 17 00:00:00 2001 | |
From: tbeu <[email protected]> | |
Date: Mon, 27 Apr 2015 09:42:58 +0200 | |
Subject: [PATCH] Fix execution order | |
--- | |
Modelica_DeviceDrivers/Blocks/Communication.mo | 23 +++++++++++++++++++--- | |
.../Blocks/Examples/TestSerialPackager_UDP.mo | 10 ++++++++-- | |
2 files changed, 28 insertions(+), 5 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function readMatrixSize "Read dimensions of a 2D Real array from file" | |
extends Modelica.Icons.Function; | |
input String fileName "File where external data is stored" annotation(Dialog(loadSelector(filter="MATLAB MAT-files (*.mat)", caption="Open MATLAB MAT-file"))); | |
input String matrixName "Name / identifier of the 2D Real array on the file"; | |
output Integer dim[2] "Number of rows and columns of the 2D Real array"; | |
external "C" ModelicaIO_readMatrixSizes(fileName, matrixName, dim) annotation(Library={"ModelicaIO", "ModelicaMatIO", "zlib"}); | |
annotation(Documentation(info="<html><p>Read the 2D dimensions from a binary MATLAB MAT-file.</p></html>")); | |
end readMatrixSize; | |
function readRealMatrix "Read 2D Real values from file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mat.h" // from MATLAB | |
#include "matrix.h" // from MATLAB | |
#include "matio.h" // https://github.com/tbeu/matio | |
#include "string.h" | |
#include "stdlib.h" | |
/* | |
* Open a MAT-file "filename" using mode "mode". Return | |
* a pointer to a MATFile for use with other MAT API functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <uchar.h> | |
#include <locale.h> | |
#define __STD_UTF_16__ | |
//Pointer arrays must always include the array size, because pointers do not know about the size of the supposed array size. | |
void utf8_to_utf16(unsigned char* const utf8_str, int utf8_str_size, char16_t* utf16_str_output, int utf16_str_output_size) { | |
//First, grab the first byte of the UTF-8 string |