Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
graintracking
DCT
Commits
8719046f
Commit
8719046f
authored
10 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
GtGauge: cleaned a little (but really a little :D)
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
ff3279c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_DataStructures/GtGauge.m
+17
-27
17 additions, 27 deletions
zUtil_DataStructures/GtGauge.m
with
17 additions
and
27 deletions
zUtil_DataStructures/GtGauge.m
+
17
−
27
View file @
8719046f
...
...
@@ -28,16 +28,16 @@ properties
index
;
format
;
nDel
;
nDel
;
extraText
;
updateFunc
;
delFunc
;
progressFunc
;
end
% end of properties
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PUBLIC METHODS
%%
%
PUBLIC METHODS
methods
(
Access
=
public
)
function
obj
=
GtGauge
(
limits
,
title
,
varargin
)
par
.
style
=
'count'
;
...
...
@@ -45,17 +45,17 @@ methods (Access = public)
par
.
verbose
=
true
;
par
.
args_to_title
=
{};
par
=
parse_pv_pairs
(
par
,
varargin
);
obj
=
obj
@
GtConditionalOutput
(
par
.
verbose
);
obj
.
steps
=
0
;
obj
.
index
=
0
;
obj
.
nDel
=
0
;
obj
.
extraText
=
[];
obj
.
args_to_title
=
par
.
args_to_title
;
switch
numel
(
limits
(:))
case
1
case
1
obj
.
first
=
1
;
obj
.
last
=
limits
(
1
);
obj
.
steps
=
limits
(
1
);
...
...
@@ -63,12 +63,12 @@ methods (Access = public)
obj
.
first
=
limits
(
1
);
obj
.
last
=
limits
(
2
);
obj
.
steps
=
limits
(
2
)
-
limits
(
1
)
+
1
;
otherwise
gtError
(
'GtGauge:wrong_gauge_limits'
,
...
'Limits are sized 1 (0 to limit) or 2 (limits(1) to limits(2)!'
);
end
% Style
obj
.
progressFunc
=
@
(
x
)
round
(
x
);
%handle([]);
obj
.
style
=
par
.
style
;
...
...
@@ -88,7 +88,7 @@ methods (Access = public)
else
obj
.
title
=
title
;
end
% Start right now or not
if
(
logical
(
par
.
start
))
obj
.
start
();
...
...
@@ -99,7 +99,7 @@ methods (Access = public)
delete
@
handle
(
obj
);
clear
obj
;
end
function
rePrint
(
obj
)
obj
.
start
();
obj
.
nDel
=
0
;
...
...
@@ -118,25 +118,15 @@ methods (Access = public)
end
end
%function setCounterAndDisplay(obj, newCounter)
% obj.index = newCounter - obj.first + 1;
% obj.updateFunc();
%end
function
setExtraText
(
obj
,
str
)
obj
.
extraText
=
[
' '
str
];
end
%function finish(obj)
% obj.doFinish();
%end
end
% end of public methods
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PROTECTED METHODS
%%
%
PROTECTED METHODS
methods
(
Access
=
protected
)
function
start
(
obj
)
if
~
isempty
(
obj
.
args_to_title
)
obj
.
fprintf
(
obj
.
title
,
obj
.
args_to_title
{:});
...
...
@@ -163,9 +153,9 @@ methods (Access = protected)
progress
=
100
/
obj
.
steps
;
obj
.
progressFunc
=
@
(
x
)
round
(
x
*
progress
);
end
function
setCount
(
obj
)
obj
.
style
=
'count'
;
obj
.
style
=
'count'
;
nDigits
=
uint64
(
round
(
log10
(
double
(
obj
.
steps
)))
+
1
);
digitsStr
=
[
'%'
num2str
(
nDigits
)
'd'
];
if
(
obj
.
first
==
1
)
...
...
@@ -181,7 +171,7 @@ methods (Access = protected)
obj
.
progressFunc
=
@
(
x
)
round
(
x
+
obj
.
first
-
1
);
end
end
function
doUpdate
(
obj
)
obj
.
delFunc
(
obj
.
nDel
);
output
=
[
obj
.
format
obj
.
extraText
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment