Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
a875509b
Commit
a875509b
authored
11 years ago
by
Maxime Graulich
Browse files
Options
Downloads
Patches
Plain Diff
refresh parameters value on iOS
parent
e32af1fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/mobile/iOS/Onelab/MasterViewController.mm
+12
-7
12 additions, 7 deletions
contrib/mobile/iOS/Onelab/MasterViewController.mm
contrib/mobile/iOS/Onelab/parameter.mm
+6
-5
6 additions, 5 deletions
contrib/mobile/iOS/Onelab/parameter.mm
with
18 additions
and
12 deletions
contrib/mobile/iOS/Onelab/MasterViewController.mm
+
12
−
7
View file @
a875509b
...
@@ -97,6 +97,8 @@
...
@@ -97,6 +97,8 @@
NSMutableArray
*
section
=
[
_sections
objectAtIndex
:
j
];
NSMutableArray
*
section
=
[
_sections
objectAtIndex
:
j
];
for
(
int
k
=
0
;
k
<
[
section
count
];
k
++
)
for
(
int
k
=
0
;
k
<
[
section
count
];
k
++
)
if
([[[
section
objectAtIndex
:
k
]
getName
]
isEqualToString
:
name
])
{
if
([[[
section
objectAtIndex
:
k
]
getName
]
isEqualToString
:
name
])
{
parameter
*
p
=
[
section
objectAtIndex
:
k
];
[
p
refresh
];
found
=
true
;
found
=
true
;
break
;
break
;
}
}
...
@@ -131,8 +133,8 @@
...
@@ -131,8 +133,8 @@
NSMutableArray
*
section
=
[
_sections
objectAtIndex
:
j
];
NSMutableArray
*
section
=
[
_sections
objectAtIndex
:
j
];
for
(
int
k
=
0
;
k
<
[
section
count
];
k
++
)
for
(
int
k
=
0
;
k
<
[
section
count
];
k
++
)
if
([[(
parameter
*
)[
section
objectAtIndex
:
k
]
getName
]
isEqualToString
:
name
])
{
if
([[(
parameter
*
)[
section
objectAtIndex
:
k
]
getName
]
isEqualToString
:
name
])
{
parameter
StringList
*
p
=
(
parameterStringList
*
)
[
section
objectAtIndex
:
k
];
parameter
*
p
=
[
section
objectAtIndex
:
k
];
[
p
re
load
];
[
p
re
fresh
];
found
=
true
;
found
=
true
;
break
;
break
;
}
// the parameters is already in the section
}
// the parameters is already in the section
...
@@ -157,9 +159,9 @@
...
@@ -157,9 +159,9 @@
// Release any retained subviews of the main view.
// Release any retained subviews of the main view.
}
}
-
(
void
)
view
Did
Appear
:(
BOOL
)
animated
-
(
void
)
view
Will
Appear
:(
BOOL
)
animated
{
{
[
super
view
Did
Appear
:
animated
];
[
super
view
Will
Appear
:
animated
];
[
self
getAvailableParam
];
[
self
getAvailableParam
];
[
self
.
tableView
reloadData
];
[
self
.
tableView
reloadData
];
}
}
...
@@ -235,12 +237,15 @@
...
@@ -235,12 +237,15 @@
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
{
// get the param with his name
// get the param with his name
static
NSString
*
CellIdentifier
=
@"parameterCell"
;
if
(
indexPath
.
section
>=
_sections
.
count
)
return
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
CellIdentifier
];
NSMutableArray
*
sectionContent
=
[
_sections
objectAtIndex
:[
indexPath
section
]];
NSMutableArray
*
sectionContent
=
[
_sections
objectAtIndex
:[
indexPath
section
]];
if
(
indexPath
.
row
>=
sectionContent
.
count
)
return
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
CellIdentifier
];
parameter
*
tmp
=
[
sectionContent
objectAtIndex
:[
indexPath
row
]];
parameter
*
tmp
=
[
sectionContent
objectAtIndex
:[
indexPath
row
]];
UITableViewCell
*
cell
=
[
tableView
cellForRowAtIndexPath
:
indexPath
];
UITableViewCell
*
cell
=
[
tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
cell
==
nil
)
if
(
cell
==
nil
)
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
[[
tmp
getLabel
]
text
]
];
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
CellIdentifier
];
else
else
return
cell
;
return
cell
;
[
cell
setUserInteractionEnabled
:
!
([
tmp
isReadOnly
])];
[
cell
setUserInteractionEnabled
:
!
([
tmp
isReadOnly
])];
...
...
This diff is collapsed.
Click to expand it.
contrib/mobile/iOS/Onelab/parameter.mm
+
6
−
5
View file @
a875509b
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
if
(
self
)
if
(
self
)
{
{
label
.
alpha
=
(
string
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
label
.
alpha
=
(
string
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:[
NSString
stringWithCString
:
(
string
.
getLabel
()
!=
""
)?
string
.
getLabel
().
c_str
()
:
string
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
[
label
setText
:
(
string
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
string
.
getLabel
()
.
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
string
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
name
=
[
NSString
stringWithCString
:
string
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
name
=
[
NSString
stringWithCString
:
string
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
picker
=
[[
UIPickerView
alloc
]
init
];
picker
=
[[
UIPickerView
alloc
]
init
];
picker
.
showsSelectionIndicator
=
YES
;
picker
.
showsSelectionIndicator
=
YES
;
...
@@ -138,7 +138,7 @@
...
@@ -138,7 +138,7 @@
if
(
self
)
if
(
self
)
{
{
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:[
NSString
stringWithCString
:
(
number
.
getLabel
()
!=
""
)?
number
.
getLabel
().
c_str
()
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
[
label
setText
:
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
getLabel
()
.
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
picker
=
[[
UIPickerView
alloc
]
init
];
picker
=
[[
UIPickerView
alloc
]
init
];
picker
.
showsSelectionIndicator
=
YES
;
picker
.
showsSelectionIndicator
=
YES
;
...
@@ -210,7 +210,7 @@
...
@@ -210,7 +210,7 @@
if
(
self
)
if
(
self
)
{
{
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:[
NSString
stringWithCString
:
(
number
.
getLabel
()
!=
""
)?
number
.
getLabel
().
c_str
()
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
[
label
setText
:
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
getLabel
()
.
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
checkbox
=
[[
UISwitch
alloc
]
init
];
checkbox
=
[[
UISwitch
alloc
]
init
];
[
checkbox
setSelected
:(
number
.
getValue
()
==
1
)];
[
checkbox
setSelected
:(
number
.
getValue
()
==
1
)];
...
@@ -270,7 +270,7 @@
...
@@ -270,7 +270,7 @@
//TODO add step ?
//TODO add step ?
[
slider
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventTouchUpOutside
];
[
slider
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventTouchUpOutside
];
[
slider
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
slider
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
label
setText
:[
NSString
stringWithFormat
:
@"%@ %f"
,[
NSString
stringWithCString
:
(
number
.
getLabel
()
!=
""
)?
number
.
getLabel
().
c_str
()
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]],
number
.
getValue
()]];
[
label
setText
:[
NSString
stringWithFormat
:
@"%@ %f"
,
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
getLabel
()
.
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
,
number
.
getValue
()]];
}
}
return
self
;
return
self
;
}
}
...
@@ -322,7 +322,7 @@
...
@@ -322,7 +322,7 @@
if
(
self
)
if
(
self
)
{
{
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:[
NSString
stringWithCString
:
(
number
.
getLabel
()
!=
""
)?
number
.
getLabel
().
c_str
()
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
[
label
setText
:
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
getLabel
()
.
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
textbox
=
[[
UITextField
alloc
]
init
];
textbox
=
[[
UITextField
alloc
]
init
];
[
textbox
setBorderStyle
:
UITextBorderStyleRoundedRect
];
[
textbox
setBorderStyle
:
UITextBorderStyleRoundedRect
];
...
@@ -346,6 +346,7 @@
...
@@ -346,6 +346,7 @@
onelab
::
server
::
instance
()
->
get
(
number
,[
name
UTF8String
]);
onelab
::
server
::
instance
()
->
get
(
number
,[
name
UTF8String
]);
if
(
number
.
size
()
<
1
)
return
;
if
(
number
.
size
()
<
1
)
return
;
[
textbox
setText
:[
NSString
stringWithFormat
:
@"%f"
,
number
[
0
].
getValue
()]];
[
textbox
setText
:[
NSString
stringWithFormat
:
@"%f"
,
number
[
0
].
getValue
()]];
[
textbox
reloadInputViews
];
}
}
-
(
BOOL
)
textFieldShouldEndEditing
:(
UITextField
*
)
textField
-
(
BOOL
)
textFieldShouldEndEditing
:(
UITextField
*
)
textField
{
{
...
...
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