Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Compare revisions
bb636c494944b0d7662377acbf69f14e40e75a06 to master
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
anders_blomdell/labcomm
Select target project
No results found
master
Select Git revision
Swap
Target
sven/labcomm
Select target project
anders_blomdell/labcomm
klaren/labcomm
tommyo/labcomm
erikj/labcomm
sven/labcomm
5 results
bb636c494944b0d7662377acbf69f14e40e75a06
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
wiki_example/example.h
+0
-68
0 additions, 68 deletions
wiki_example/example.h
wiki_example/example.py
+0
-18
0 additions, 18 deletions
wiki_example/example.py
wiki_example/log_message.java
+0
-119
0 additions, 119 deletions
wiki_example/log_message.java
wiki_example/run
+0
-22
0 additions, 22 deletions
wiki_example/run
with
0 additions
and
227 deletions
wiki_example/example.h
deleted
100644 → 0
View file @
bb636c49
/* LabComm declarations:
sample struct {
int sequence;
struct {
boolean last;
string data;
} line[_];
} log_message;
sample float data;
*/
#ifndef __LABCOMM_example_H__
#define __LABCOMM_example_H__
#include
"labcomm.h"
#ifndef PREDEFINED_example_log_message
typedef
struct
{
int
sequence
;
struct
{
int
n_0
;
struct
{
unsigned
char
last
;
char
*
data
;
}
*
a
;
}
line
;
}
example_log_message
;
#endif
void
labcomm_decoder_register_example_log_message
(
struct
labcomm_decoder
*
d
,
void
(
*
handler
)(
example_log_message
*
v
,
void
*
context
),
void
*
context
);
void
labcomm_encoder_register_example_log_message
(
struct
labcomm_encoder
*
e
);
void
labcomm_encode_example_log_message
(
struct
labcomm_encoder
*
e
,
example_log_message
*
v
);
extern
int
labcomm_sizeof_example_log_message
(
example_log_message
*
v
);
#ifndef PREDEFINED_example_data
typedef
float
example_data
;
#endif
void
labcomm_decoder_register_example_data
(
struct
labcomm_decoder
*
d
,
void
(
*
handler
)(
example_data
*
v
,
void
*
context
),
void
*
context
);
void
labcomm_encoder_register_example_data
(
struct
labcomm_encoder
*
e
);
void
labcomm_encode_example_data
(
struct
labcomm_encoder
*
e
,
example_data
*
v
);
extern
int
labcomm_sizeof_example_data
(
example_data
*
v
);
#define LABCOMM_FORALL_SAMPLES_example(func, sep) \
func(log_message, example_log_message) sep \
func(data, example_data)
#endif
This diff is collapsed.
Click to expand it.
wiki_example/example.py
deleted
100644 → 0
View file @
bb636c49
#!/usr/bin/python
# Auto generated example
import
labcomm
class
log_message
(
object
):
signature
=
labcomm
.
sample
(
'
log_message
'
,
labcomm
.
struct
([
(
'
sequence
'
,
labcomm
.
INTEGER
()),
(
'
line
'
,
labcomm
.
array
([
0
],
labcomm
.
struct
([
(
'
last
'
,
labcomm
.
BOOLEAN
()),
(
'
data
'
,
labcomm
.
STRING
())])))]))
class
data
(
object
):
signature
=
labcomm
.
sample
(
'
data
'
,
labcomm
.
FLOAT
())
This diff is collapsed.
Click to expand it.
wiki_example/log_message.java
deleted
100644 → 0
View file @
bb636c49
/*
sample struct {
int sequence;
struct {
boolean last;
string data;
} line[_];
} log_message;
*/
import
java.io.IOException
;
import
se.lth.control.labcomm.LabCommDecoder
;
import
se.lth.control.labcomm.LabCommDispatcher
;
import
se.lth.control.labcomm.LabCommEncoder
;
import
se.lth.control.labcomm.LabCommHandler
;
import
se.lth.control.labcomm.LabCommSample
;
public
class
log_message
implements
LabCommSample
{
public
static
class
struct_line
{
public
boolean
last
;
public
String
data
;
}
public
int
sequence
;
public
struct_line
[]
line
;
public
interface
Handler
extends
LabCommHandler
{
public
void
handle_log_message
(
log_message
value
)
throws
Exception
;
}
public
static
void
register
(
LabCommDecoder
d
,
Handler
h
)
throws
IOException
{
d
.
register
(
new
Dispatcher
(),
h
);
}
public
static
void
register
(
LabCommEncoder
e
)
throws
IOException
{
e
.
register
(
new
Dispatcher
());
}
private
static
class
Dispatcher
implements
LabCommDispatcher
{
public
Class
getSampleClass
()
{
return
log_message
.
class
;
}
public
String
getName
()
{
return
"log_message"
;
}
public
byte
[]
getSignature
()
{
return
signature
;
}
public
void
decodeAndHandle
(
LabCommDecoder
d
,
LabCommHandler
h
)
throws
Exception
{
((
Handler
)
h
).
handle_log_message
(
log_message
.
decode
(
d
));
}
}
public
static
void
encode
(
LabCommEncoder
e
,
log_message
value
)
throws
IOException
{
e
.
begin
(
log_message
.
class
);
e
.
encodeInt
(
value
.
sequence
);
e
.
encodeInt
(
value
.
line
.
length
);
int
i_0_max
=
value
.
line
.
length
;
for
(
int
i_0
=
0
;
i_0
<
i_0_max
;
i_0
++)
{
e
.
encodeBoolean
(
value
.
line
[
i_0
].
last
);
e
.
encodeString
(
value
.
line
[
i_0
].
data
);
}
e
.
end
(
log_message
.
class
);
}
public
static
log_message
decode
(
LabCommDecoder
d
)
throws
IOException
{
log_message
result
;
result
=
new
log_message
();
result
.
sequence
=
d
.
decodeInt
();
{
int
i_0_max
=
d
.
decodeInt
();
result
.
line
=
new
struct_line
[
i_0_max
];
for
(
int
i_0
=
0
;
i_0
<
i_0_max
;
i_0
++)
{
result
.
line
[
i_0
]
=
new
struct_line
();
result
.
line
[
i_0
].
last
=
d
.
decodeBoolean
();
result
.
line
[
i_0
].
data
=
d
.
decodeString
();
}
}
return
result
;
}
private
static
byte
[]
signature
=
new
byte
[]
{
// struct { 2 fields
0
,
0
,
0
,
17
,
0
,
0
,
0
,
2
,
// int 'sequence'
0
,
0
,
0
,
8
,
115
,
101
,
113
,
117
,
101
,
110
,
99
,
101
,
0
,
0
,
0
,
35
,
// array [_] 'line'
0
,
0
,
0
,
4
,
108
,
105
,
110
,
101
,
// array [_]
0
,
0
,
0
,
16
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
// struct { 2 fields
0
,
0
,
0
,
17
,
0
,
0
,
0
,
2
,
// boolean 'last'
0
,
0
,
0
,
4
,
108
,
97
,
115
,
116
,
0
,
0
,
0
,
32
,
// string 'data'
0
,
0
,
0
,
4
,
100
,
97
,
116
,
97
,
0
,
0
,
0
,
39
,
// }
// }
// }
};
}
This diff is collapsed.
Click to expand it.
wiki_example/run
deleted
100755 → 0
View file @
bb636c49
#!/bin/sh
# Auto generate code from .lc file
java
-jar
/opt/robot/java/labComm.jar
\
--c
=
example.c
--h
=
example.h
\
--java
=
.
\
--cs
=
example.cs
\
--python
=
example.py
\
example.lc
# Compile executables
gcc
-o
example_encoder
-I
../lib/c/
\
example_encoder.c
\
example.c
\
../lib/c/labcomm.c
\
../lib/c//labcomm_fd_reader_writer.c
javac
-cp
../lib/java:.
*
.java
# Run through all executables (c->java->Python)
./example_encoder one two
java
-cp
../lib/java:. example_decoder_encoder example.encoded example.javaencoded
PYTHONPATH
=
../lib/python ./example_decoder.py example.javaencoded
This diff is collapsed.
Click to expand it.
Prev
1
…
17
18
19
20
21
Next