Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
a9004add
Commit
a9004add
authored
May 16, 2019
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt logging in python format
parent
05b57d00
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
260 additions
and
38 deletions
+260
-38
xtt/lib/xtt/src/xtt_logging.cpp
xtt/lib/xtt/src/xtt_logging.cpp
+201
-35
xtt/lib/xtt/src/xtt_logging.h
xtt/lib/xtt/src/xtt_logging.h
+7
-1
xtt/lib/xtt/src/xtt_xnav.cpp
xtt/lib/xtt/src/xtt_xnav.cpp
+7
-0
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+45
-2
No files found.
xtt/lib/xtt/src/xtt_logging.cpp
View file @
a9004add
This diff is collapsed.
Click to expand it.
xtt/lib/xtt/src/xtt_logging.h
View file @
a9004add
...
@@ -49,6 +49,10 @@
...
@@ -49,6 +49,10 @@
#define RTT_LOGG_LINE_DEFSIZE 512
#define RTT_LOGG_LINE_DEFSIZE 512
typedef
enum
{
xtt_LoggType_Cont
=
1
,
xtt_LoggType_Mod
=
2
}
xtt_LoggType
;
typedef
enum
{
xtt_LoggType_Cont
=
1
,
xtt_LoggType_Mod
=
2
}
xtt_LoggType
;
typedef
enum
{
xtt_eLoggFormat_Std
,
xtt_eLoggFormat_Py
}
xtt_eLoggFormat
;
class
XttLogging
{
class
XttLogging
{
public:
public:
...
@@ -62,6 +66,7 @@ public:
...
@@ -62,6 +66,7 @@ public:
int
stop_logg
;
int
stop_logg
;
int
logg_type
;
int
logg_type
;
int
logg_priority
;
int
logg_priority
;
xtt_eLoggFormat
logg_format
;
pwr_tAName
parameterstr
[
RTT_LOGG_MAXPAR
];
pwr_tAName
parameterstr
[
RTT_LOGG_MAXPAR
];
pwr_tAName
shortname
[
RTT_LOGG_MAXPAR
];
pwr_tAName
shortname
[
RTT_LOGG_MAXPAR
];
char
*
parameter_ptr
[
RTT_LOGG_MAXPAR
];
char
*
parameter_ptr
[
RTT_LOGG_MAXPAR
];
...
@@ -88,10 +93,11 @@ public:
...
@@ -88,10 +93,11 @@ public:
void
init
(
int
logg_index
,
void
*
logg_xnav
);
void
init
(
int
logg_index
,
void
*
logg_xnav
);
int
logging_set
(
float
logg_time
,
char
*
filename
,
char
*
parameterstr
,
int
logging_set
(
float
logg_time
,
char
*
filename
,
char
*
parameterstr
,
char
*
conditionstr
,
int
logg_type
,
int
insert
,
int
buffer_size
,
int
stop
,
char
*
conditionstr
,
int
logg_type
,
int
logg_format
,
int
insert
,
int
buffer_size
,
int
stop
,
int
priority
,
int
create
,
int
line_size
,
int
shortname
);
int
priority
,
int
create
,
int
line_size
,
int
shortname
);
int
show
();
int
show
();
int
show_entry
(
char
*
buff
,
int
*
buff_cnt
);
int
show_entry
(
char
*
buff
,
int
*
buff_cnt
);
int
analyse
();
int
store
(
char
*
filename
);
int
store
(
char
*
filename
);
int
start
();
int
start
();
int
stop
();
int
stop
();
...
...
xtt/lib/xtt/src/xtt_xnav.cpp
View file @
a9004add
...
@@ -3211,6 +3211,10 @@ int XNav::show_logging(int index)
...
@@ -3211,6 +3211,10 @@ int XNav::show_logging(int index)
new
ItemCommand
(
brow
,
Lng
::
translate
(
"Show curve"
),
0
,
NULL
,
new
ItemCommand
(
brow
,
Lng
::
translate
(
"Show curve"
),
0
,
NULL
,
flow_eDest_IntoLast
,
command
,
0
,
brow
->
pixmap_action
);
flow_eDest_IntoLast
,
command
,
0
,
brow
->
pixmap_action
);
sprintf
(
command
,
"logging analyse/entry=current"
);
new
ItemCommand
(
brow
,
Lng
::
translate
(
"Analyse"
),
0
,
NULL
,
flow_eDest_IntoLast
,
command
,
0
,
brow
->
pixmap_action
);
new
ItemLocal
(
brow
,
Lng
::
translate
(
"Scantime (ms)"
),
"logg_Time"
,
new
ItemLocal
(
brow
,
Lng
::
translate
(
"Scantime (ms)"
),
"logg_Time"
,
pwr_eType_Float32
,
sizeof
(
logg
[
0
].
logg_time
),
0
,
100000
,
0
,
pwr_eType_Float32
,
sizeof
(
logg
[
0
].
logg_time
),
0
,
100000
,
0
,
(
void
*
)
&
logg
[
index
].
logg_time
,
NULL
,
flow_eDest_IntoLast
);
(
void
*
)
&
logg
[
index
].
logg_time
,
NULL
,
flow_eDest_IntoLast
);
...
@@ -3220,6 +3224,9 @@ int XNav::show_logging(int index)
...
@@ -3220,6 +3224,9 @@ int XNav::show_logging(int index)
new
ItemLocal
(
brow
,
Lng
::
translate
(
"Type"
),
"logg_Type"
,
pwr_eType_Int32
,
new
ItemLocal
(
brow
,
Lng
::
translate
(
"Type"
),
"logg_Type"
,
pwr_eType_Int32
,
sizeof
(
logg
[
0
].
logg_type
),
0
,
0
,
0
,
(
void
*
)
&
logg
[
index
].
logg_type
,
NULL
,
sizeof
(
logg
[
0
].
logg_type
),
0
,
0
,
0
,
(
void
*
)
&
logg
[
index
].
logg_type
,
NULL
,
flow_eDest_IntoLast
);
flow_eDest_IntoLast
);
new
ItemLocal
(
brow
,
Lng
::
translate
(
"Format"
),
"logg_Format"
,
pwr_eType_Int32
,
sizeof
(
logg
[
0
].
logg_type
),
0
,
0
,
0
,
(
void
*
)
&
logg
[
index
].
logg_format
,
NULL
,
flow_eDest_IntoLast
);
new
ItemLocal
(
brow
,
Lng
::
translate
(
"BufferSize"
),
"logg_BufferSize"
,
new
ItemLocal
(
brow
,
Lng
::
translate
(
"BufferSize"
),
"logg_BufferSize"
,
pwr_eType_Int32
,
sizeof
(
logg
[
0
].
wanted_buffer_size
),
0
,
0
,
0
,
pwr_eType_Int32
,
sizeof
(
logg
[
0
].
wanted_buffer_size
),
0
,
0
,
0
,
(
void
*
)
&
logg
[
index
].
wanted_buffer_size
,
NULL
,
flow_eDest_IntoLast
);
(
void
*
)
&
logg
[
index
].
wanted_buffer_size
,
NULL
,
flow_eDest_IntoLast
);
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
a9004add
...
@@ -285,7 +285,7 @@ dcli_tCmdTable xnav_command_table[] = {
...
@@ -285,7 +285,7 @@ dcli_tCmdTable xnav_command_table[] = {
}
},
}
},
{
"TEST"
,
&
xnav_test_func
,
{
"dcli_arg1"
,
"dcli_arg2"
,
""
}
},
{
"TEST"
,
&
xnav_test_func
,
{
"dcli_arg1"
,
"dcli_arg2"
,
""
}
},
{
"LOGGING"
,
&
xnav_logging_func
,
{
"LOGGING"
,
&
xnav_logging_func
,
{
"dcli_arg1"
,
"dcli_arg2"
,
"/FILE"
,
"/TIME"
,
"/ENTRY"
,
"/TYPE"
,
{
"dcli_arg1"
,
"dcli_arg2"
,
"/FILE"
,
"/TIME"
,
"/ENTRY"
,
"/TYPE"
,
"/FORMAT"
,
"/PARAMETER"
,
"/CONDITION"
,
"/INSERT"
,
"/BUFFER_SIZE"
,
"/PRIORITY"
,
"/PARAMETER"
,
"/CONDITION"
,
"/INSERT"
,
"/BUFFER_SIZE"
,
"/PRIORITY"
,
"/STOP"
,
"/NOSTOP"
,
"/CREATE"
,
"/ALL"
,
"/LINE_SIZE"
,
"/SHORTNAME"
,
"/STOP"
,
"/NOSTOP"
,
"/CREATE"
,
"/ALL"
,
"/LINE_SIZE"
,
"/SHORTNAME"
,
"/NOSHORTNAME"
,
""
}
},
"/NOSHORTNAME"
,
""
}
},
...
@@ -6636,6 +6636,7 @@ static int xnav_logging_func(void* client_data, void* client_flag)
...
@@ -6636,6 +6636,7 @@ static int xnav_logging_func(void* client_data, void* client_flag)
int
buffer_size
;
int
buffer_size
;
int
nr
;
int
nr
;
int
logg_type
=
0
;
int
logg_type
=
0
;
int
logg_format
=
-
1
;
int
insert
;
int
insert
;
int
create
;
int
create
;
int
shortname
;
int
shortname
;
...
@@ -6717,6 +6718,14 @@ static int xnav_logging_func(void* client_data, void* client_flag)
...
@@ -6717,6 +6718,14 @@ static int xnav_logging_func(void* client_data, void* client_flag)
}
else
}
else
logg_type
=
0
;
logg_type
=
0
;
if
(
ODD
(
dcli_get_qualifier
(
"/FORMAT"
,
str
,
sizeof
(
str
))))
{
if
(
str_NoCaseStrncmp
(
str
,
"STD"
,
strlen
(
str
))
==
0
)
logg_format
=
xtt_eLoggFormat_Std
;
else
if
(
str_NoCaseStrncmp
(
str
,
"PY"
,
strlen
(
str
))
==
0
)
logg_format
=
xtt_eLoggFormat_Py
;
}
else
logg_format
=
-
1
;
if
(
ODD
(
dcli_get_qualifier
(
if
(
ODD
(
dcli_get_qualifier
(
"/PRIORITY"
,
priority_str
,
sizeof
(
priority_str
))))
{
"/PRIORITY"
,
priority_str
,
sizeof
(
priority_str
))))
{
/* convert to integer */
/* convert to integer */
...
@@ -6758,7 +6767,7 @@ static int xnav_logging_func(void* client_data, void* client_flag)
...
@@ -6758,7 +6767,7 @@ static int xnav_logging_func(void* client_data, void* client_flag)
}
}
sts
=
xnav
->
logg
[
entry
-
1
].
logging_set
(
logg_time
,
file_ptr
,
parameter_ptr
,
sts
=
xnav
->
logg
[
entry
-
1
].
logging_set
(
logg_time
,
file_ptr
,
parameter_ptr
,
condition_ptr
,
logg_type
,
insert
,
buffer_size
,
stop
,
priority
,
create
,
condition_ptr
,
logg_type
,
logg_format
,
insert
,
buffer_size
,
stop
,
priority
,
create
,
line_size
,
shortname
);
line_size
,
shortname
);
return
sts
;
return
sts
;
}
}
...
@@ -6889,6 +6898,40 @@ static int xnav_logging_func(void* client_data, void* client_flag)
...
@@ -6889,6 +6898,40 @@ static int xnav_logging_func(void* client_data, void* client_flag)
sts
=
xnav
->
logg
[
entry
-
1
].
show
();
sts
=
xnav
->
logg
[
entry
-
1
].
show
();
return
sts
;
return
sts
;
}
else
if
(
str_NoCaseStrncmp
(
arg1_str
,
"ANALYSE"
,
strlen
(
arg1_str
))
==
0
)
{
/* Command is "LOGGING ANALYSE" */
char
entry_str
[
80
];
int
entry
;
int
nr
;
if
(
ODD
(
dcli_get_qualifier
(
"/ENTRY"
,
entry_str
,
sizeof
(
entry_str
))))
{
if
(
!
str_NoCaseStrcmp
(
entry_str
,
"CURRENT"
))
{
if
(
xnav
->
current_logging_index
==
-
1
)
{
xnav
->
message
(
'E'
,
"No current logging entry"
);
return
XNAV__HOLDCOMMAND
;
}
entry
=
xnav
->
current_logging_index
+
1
;
}
else
{
/* convert to integer */
nr
=
sscanf
(
entry_str
,
"%d"
,
&
entry
);
if
(
nr
!=
1
)
{
xnav
->
message
(
'E'
,
"Entry syntax error"
);
return
XNAV__HOLDCOMMAND
;
}
}
}
else
{
xnav
->
message
(
'E'
,
"Enter entry"
);
return
XNAV__HOLDCOMMAND
;
}
if
(
entry
>
XNAV_LOGG_MAX
||
entry
<
1
)
{
xnav
->
message
(
'E'
,
"Entry out of range"
);
return
XNAV__HOLDCOMMAND
;
}
sts
=
xnav
->
logg
[
entry
-
1
].
analyse
();
return
sts
;
}
else
if
(
str_NoCaseStrncmp
(
arg1_str
,
"STORE"
,
strlen
(
arg1_str
))
==
0
)
{
}
else
if
(
str_NoCaseStrncmp
(
arg1_str
,
"STORE"
,
strlen
(
arg1_str
))
==
0
)
{
/* Command is "LOGGING STORE" */
/* Command is "LOGGING STORE" */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment