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
e5d5aa17
Commit
e5d5aa17
authored
Sep 18, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function to print jounalfile added
parent
78ee41cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
146 additions
and
2 deletions
+146
-2
xtt/lib/ge/src/ge_graph_journal.cpp
xtt/lib/ge/src/ge_graph_journal.cpp
+142
-1
xtt/lib/ge/src/ge_graph_journal.h
xtt/lib/ge/src/ge_graph_journal.h
+4
-1
No files found.
xtt/lib/ge/src/ge_graph_journal.cpp
View file @
e5d5aa17
/*
* Proview $Id: ge_graph_journal.cpp,v 1.
3 2008-05-23 07:48:16
claes Exp $
* Proview $Id: ge_graph_journal.cpp,v 1.
4 2008-09-18 14:55:45
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -1722,6 +1722,147 @@ int GraphJournal::restore( char *fname)
return
GE__SUCCESS
;
}
void
GraphJournal
::
print
(
char
*
fname
)
{
char
line
[
200
];
int
nr
=
0
;
int
tag
;
int
action
;
int
idx
;
ifstream
fp
;
pwr_tFileName
fn
;
int
status
;
int
row
=
0
;
int
row_fetched
=
0
;
dcli_translate_filename
(
fn
,
fname
);
fp
.
open
(
fn
,
ios
::
in
);
if
(
!
fp
)
{
printf
(
"Unable to open journal file %s
\n
"
,
fn
);
return
;
}
printf
(
"%4s %4s %-20s %-22s
\n
"
,
"Row"
,
"Idx"
,
"Tag"
,
"Action"
);
printf
(
"%4s %4s %-20s %-22s
\n
"
,
"---"
,
"---"
,
"---"
,
"------"
);
while
(
row_fetched
||
fp
.
getline
(
line
,
sizeof
(
line
)))
{
row
++
;
nr
=
sscanf
(
line
,
"%d"
,
&
tag
);
if
(
nr
==
1
&&
(
tag
==
journal_cTag_Redo
||
tag
==
journal_cTag_Undo
))
{
sscanf
(
line
,
"%d %d %d %d"
,
&
tag
,
&
action
,
(
int
*
)
&
status
,
&
idx
);
printf
(
"%4d %4d %-20s %-22s"
,
row
,
idx
,
tag_to_str
(
tag
),
action_to_str
(
action
));
if
(
!
fp
.
getline
(
line
,
sizeof
(
line
)))
break
;
nr
=
sscanf
(
line
,
"%d"
,
&
tag
);
if
(
nr
==
1
&&
tag
==
journal_cTag_Object
)
{
if
(
!
fp
.
getline
(
line
,
sizeof
(
line
)))
break
;
row_fetched
=
0
;
printf
(
"%-10s
\n
"
,
line
);
}
else
{
row_fetched
=
1
;
printf
(
"
\n
"
);
}
}
else
row_fetched
=
0
;
}
fp
.
close
();
}
char
*
GraphJournal
::
action_to_str
(
int
action
)
{
static
char
str
[
40
];
switch
(
action
)
{
case
journal_eAction_DeleteObject
:
strcpy
(
str
,
"DeleteObject"
);
break
;
case
journal_eAction_DeleteSelect
:
strcpy
(
str
,
"DeleteSelect"
);
break
;
case
journal_eAction_MoveObject
:
strcpy
(
str
,
"MoveObject"
);
break
;
case
journal_eAction_MoveSelect
:
strcpy
(
str
,
"MoveSelect"
);
break
;
case
journal_eAction_CreateObject
:
strcpy
(
str
,
"CreateObject"
);
break
;
case
journal_eAction_AntePropertiesSelect
:
strcpy
(
str
,
"AntePropertiesSelect"
);
break
;
case
journal_eAction_PostPropertiesSelect
:
strcpy
(
str
,
"PostPropertiesSelect"
);
break
;
case
journal_eAction_AntePropertiesObject
:
strcpy
(
str
,
"AntePropertiesObject"
);
break
;
case
journal_eAction_PostPropertiesObject
:
strcpy
(
str
,
"PostPropertiesObject"
);
break
;
case
journal_eAction_AnteGroupSelect
:
strcpy
(
str
,
"AnteGroupSelect"
);
break
;
case
journal_eAction_PostGroupSelect
:
strcpy
(
str
,
"PostGroupSelect"
);
break
;
case
journal_eAction_UngroupSelect
:
strcpy
(
str
,
"UngroupSelect"
);
break
;
case
journal_eAction_PopSelect
:
strcpy
(
str
,
"PopSelect"
);
break
;
case
journal_eAction_PushSelect
:
strcpy
(
str
,
"PushSelect"
);
break
;
case
journal_eAction_AntePaste
:
strcpy
(
str
,
"AntePaste"
);
break
;
case
journal_eAction_PostPaste
:
strcpy
(
str
,
"PostPaste"
);
break
;
case
journal_eAction_AnteRename
:
strcpy
(
str
,
"AnteRename"
);
break
;
case
journal_eAction_PostRename
:
strcpy
(
str
,
"PostRename"
);
break
;
default:
strcpy
(
str
,
"Undefined"
);
}
return
str
;
}
char
*
GraphJournal
::
tag_to_str
(
int
tag
)
{
static
char
str
[
20
];
switch
(
tag
)
{
case
journal_cTag_Undo
:
strcpy
(
str
,
"Undo"
);
break
;
case
journal_cTag_Redo
:
strcpy
(
str
,
"Redo"
);
break
;
case
journal_cTag_Object
:
strcpy
(
str
,
"Object"
);
break
;
case
journal_cTag_End
:
strcpy
(
str
,
"End"
);
break
;
default:
strcpy
(
str
,
"Undefined"
);
}
return
str
;
}
...
...
xtt/lib/ge/src/ge_graph_journal.h
View file @
e5d5aa17
/*
* Proview $Id: ge_graph_journal.h,v 1.
2 2008-05-23 07:48:16
claes Exp $
* Proview $Id: ge_graph_journal.h,v 1.
3 2008-09-18 14:55:45
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -123,6 +123,9 @@ class GraphJournal {
int
store_redo_rename
(
grow_tObject
o
);
int
undo_rename
();
int
redo_rename
();
static
void
print
(
char
*
fname
);
static
char
*
tag_to_str
(
int
tag
);
static
char
*
action_to_str
(
int
action
);
Graph
*
graph
;
fstream
fp
;
...
...
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