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
c95921b4
Commit
c95921b4
authored
11 years ago
by
Maxime Graulich
Browse files
Options
Downloads
Patches
Plain Diff
iOS: fix parameters name + add Model class
parent
3f98df4e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/mobile/iOS/Onelab/Model.h
+29
-0
29 additions, 0 deletions
contrib/mobile/iOS/Onelab/Model.h
contrib/mobile/iOS/Onelab/Model.mm
+66
-0
66 additions, 0 deletions
contrib/mobile/iOS/Onelab/Model.mm
contrib/mobile/iOS/Onelab/Parameter.mm
+6
-6
6 additions, 6 deletions
contrib/mobile/iOS/Onelab/Parameter.mm
with
101 additions
and
6 deletions
contrib/mobile/iOS/Onelab/Model.h
0 → 100644
+
29
−
0
View file @
c95921b4
//
// Model.h
// Onelab
//
// Created by Maxime Graulich on 03/09/13.
// Copyright (c) 2013 Maxime Graulich. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface
Model
:
NSObject
{
@private
NSString
*
_name
,
*
_summary
,
*
_file
;
NSURL
*
_url
;
UIImage
*
_preview
;
}
-
(
id
)
initWithName
:(
NSString
*
)
name
;
-
(
id
)
initWithName
:(
NSString
*
)
name
withSummary
:(
NSString
*
)
summary
withFile
:(
NSString
*
)
file
;
-
(
NSString
*
)
getName
;
-
(
NSString
*
)
getSummary
;
-
(
NSString
*
)
getFile
;
-
(
void
)
setSummary
:(
NSString
*
)
summary
;
-
(
void
)
setFile
:(
NSString
*
)
file
;
-
(
NSURL
*
)
getUrl
;
-
(
UIImage
*
)
getPreview
;
-
(
void
)
setPreview
:(
NSString
*
)
path
;
-
(
void
)
setUrl
:(
NSString
*
)
url
;
@end
This diff is collapsed.
Click to expand it.
contrib/mobile/iOS/Onelab/Model.mm
0 → 100644
+
66
−
0
View file @
c95921b4
//
// Model.m
// Onelab
//
// Created by Maxime Graulich on 03/09/13.
// Copyright (c) 2013 Maxime Graulich. All rights reserved.
//
#import "Model.h"
@implementation
Model
-
(
id
)
initWithName
:(
NSString
*
)
name
{
self
=
[
super
init
];
if
(
self
)
{
_name
=
name
;
_summary
=
nil
;
_file
=
nil
;
_url
=
nil
;
_preview
=
nil
;
}
return
self
;
}
-
(
id
)
initWithName
:(
NSString
*
)
name
withSummary
:(
NSString
*
)
summary
withFile
:(
NSString
*
)
file
{
self
=
[
super
init
];
if
(
self
)
{
_name
=
name
;
_summary
=
summary
;
_file
=
file
;
_url
=
nil
;
_preview
=
nil
;
}
return
self
;
}
-
(
NSString
*
)
getName
{
return
_name
;
}
-
(
NSString
*
)
getSummary
{
return
_summary
;
}
-
(
NSString
*
)
getFile
{
return
_file
;
}
-
(
NSURL
*
)
getUrl
{
return
_url
;
}
-
(
UIImage
*
)
getPreview
{
return
_preview
;
}
-
(
void
)
setSummary
:(
NSString
*
)
summary
{
_summary
=
summary
;
}
-
(
void
)
setFile
:(
NSString
*
)
file
{
_file
=
file
;
}
-
(
void
)
setPreview
:(
NSString
*
)
path
{
_preview
=
[
UIImage
imageWithContentsOfFile
:
path
];
}
-
(
void
)
setUrl
:(
NSString
*
)
url
{
_url
=
[
NSURL
URLWithString
:
url
];
}
@end
This diff is collapsed.
Click to expand it.
contrib/mobile/iOS/Onelab/Parameter.mm
+
6
−
6
View file @
c95921b4
...
...
@@ -56,7 +56,7 @@
if
(
self
)
{
label
.
alpha
=
(
string
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:
(
string
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
string
.
get
Label
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
string
.
ge
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
[
label
setText
:[
NSString
stringWithCString
:
string
.
get
Shor
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
name
=
[
NSString
stringWithCString
:
string
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
picker
=
[[
UIPickerView
alloc
]
init
];
picker
.
showsSelectionIndicator
=
YES
;
...
...
@@ -138,7 +138,7 @@
if
(
self
)
{
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
get
Label
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
ge
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
[
label
setText
:[
NSString
stringWithCString
:
number
.
get
Shor
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
picker
=
[[
UIPickerView
alloc
]
init
];
picker
.
showsSelectionIndicator
=
YES
;
...
...
@@ -210,7 +210,7 @@
if
(
self
)
{
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
get
Label
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
ge
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
[
label
setText
:[
NSString
stringWithCString
:
number
.
get
Shor
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
checkbox
=
[[
UISwitch
alloc
]
init
];
[
checkbox
setSelected
:(
number
.
getValue
()
==
1
)];
...
...
@@ -270,7 +270,7 @@
//TODO add step ?
[
slider
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventTouchUpOutside
];
[
slider
addTarget
:
self
action
:
@selector
(
sliderValueChanged
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
label
setText
:[
NSString
stringWithFormat
:
@"%@ %f"
,
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
get
Label
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
ge
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
,
number
.
getValue
()]];
[
label
setText
:[
NSString
stringWithFormat
:
@"%@ %f"
,[
NSString
stringWithCString
:
number
.
get
Shor
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]],
number
.
getValue
()]];
}
return
self
;
}
...
...
@@ -290,7 +290,7 @@
if
(
number
.
size
()
<
1
)
return
;
number
[
0
].
setValue
(
sender
.
value
);
onelab
::
server
::
instance
()
->
set
(
number
[
0
]);
[
label
setText
:[
NSString
stringWithFormat
:
@"%s %f"
,
(
number
[
0
].
get
Label
()
!=
""
)?
number
[
0
].
getLabel
().
c_str
():
number
[
0
].
ge
tName
().
c_str
(),
number
[
0
].
getValue
()]];
[
label
setText
:[
NSString
stringWithFormat
:
@"%s %f"
,
number
[
0
].
get
Shor
tName
().
c_str
(),
number
[
0
].
getValue
()]];
if
(
onelab_cb
(
"check"
)
==
1
)
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"requestRender"
object
:
nil
];
}
...
...
@@ -322,7 +322,7 @@
if
(
self
)
{
label
.
alpha
=
(
number
.
getReadOnly
())?
0.439216
f
:
1.0
f
;
[
label
setText
:
(
number
.
getLabel
()
!=
""
)?
[
NSString
stringWithCString
:
number
.
get
Label
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
:
[[[
NSString
stringWithCString
:
number
.
ge
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]
componentsSeparatedByString
:
@"/"
]
lastObject
]
];
[
label
setText
:[
NSString
stringWithCString
:
number
.
get
Shor
tName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]]];
name
=
[
NSString
stringWithCString
:
number
.
getName
().
c_str
()
encoding
:[
NSString
defaultCStringEncoding
]];
textbox
=
[[
UITextField
alloc
]
init
];
[
textbox
setBorderStyle
:
UITextBorderStyleRoundedRect
];
...
...
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