Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sfp-plus-i2c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
sfp-plus-i2c
Commits
505e191f
Commit
505e191f
authored
Oct 10, 2017
by
Vincent van Beveren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started adding password feature
parent
4b3e80c7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
4 deletions
+79
-4
DDMIElement.java
sw/jsfp/src/nl/nikhef/sfp/ddmi/DDMIElement.java
+19
-0
DDMILoader.java
sw/jsfp/src/nl/nikhef/sfp/ddmi/DDMILoader.java
+33
-0
DDMIMeta.java
sw/jsfp/src/nl/nikhef/sfp/ddmi/DDMIMeta.java
+2
-0
sfpdd.xsd
sw/jsfp/src/nl/nikhef/sfp/ddmi/desc/sfpdd.xsd
+18
-0
km3net_oesol.xml
sw/safaripark/overlays/km3net_oesol.xml
+7
-4
No files found.
sw/jsfp/src/nl/nikhef/sfp/ddmi/DDMIElement.java
View file @
505e191f
...
...
@@ -31,6 +31,8 @@ public abstract class DDMIElement {
private
String
_sourceId
;
private
String
_passwordId
;
public
void
setSourceId
(
String
id
)
...
...
@@ -51,6 +53,23 @@ public abstract class DDMIElement {
return
_sourceId
;
}
public
void
setPasswordId
(
String
id
)
{
_passwordId
=
id
;
}
public
String
getPasswordId
()
{
if
(
_passwordId
==
null
)
{
DDMIElement
parent
=
getParent
();
if
(!(
parent
instanceof
DDMIGroup
))
return
null
;
return
DDMIGroup
.
class
.
cast
(
parent
).
getPasswordId
();
}
return
_passwordId
;
}
public
void
setLabel
(
String
label
)
{
...
...
sw/jsfp/src/nl/nikhef/sfp/ddmi/DDMILoader.java
View file @
505e191f
...
...
@@ -79,6 +79,31 @@ public class DDMILoader {
};
private
static
class
DDMIConstMetaProxy
extends
XOLProxyBase
<
Void
>
{
@Override
public
boolean
setAttribute
(
String
name
,
String
obj
)
{
return
true
;
}
@Override
public
void
setParent
(
XOLProxy
<?>
obj
)
{
//_value = DDMIValue.class.cast(obj.getInstance());
}
@Override
public
boolean
setContent
(
String
data
)
{
return
true
;
}
@Override
public
String
getTypeName
()
{
return
"DDMI Const Meta"
;
}
};
private
static
class
DDMIBitFieldMetaProxy
extends
XOLProxyBase
<
Void
>
{
private
DDMIValue
_value
;
...
...
@@ -174,6 +199,11 @@ public class DDMILoader {
return
new
DDMIConversionMetaProxy
();
}
if
(
_meta
==
DDMIMeta
.
CONST
)
{
return
new
DDMIConstMetaProxy
();
}
return
null
;
}
...
...
@@ -393,6 +423,7 @@ public class DDMILoader {
_xol
.
setMapping
(
"int"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
INT_TYPE
));
_xol
.
setMapping
(
"uint"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
UINT_TYPE
));
_xol
.
setMapping
(
"bitmap"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
BITMAP_TYPE
));
_xol
.
setMapping
(
"password"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
BITMAP_TYPE
));
_xol
.
setMapping
(
"text"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
TEXT_TYPE
));
_xol
.
setMapping
(
"float"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
DECIMAL_TYPE_FLOAT
));
_xol
.
setMapping
(
"sfix"
,
new
DDMIValueFactory
(
DDMIValue
.
DDMIType
.
DECIMAL_TYPE_SFIXED
));
...
...
@@ -412,6 +443,8 @@ public class DDMILoader {
_xol
.
setMapping
(
"map"
,
new
DDMIMapMetaFactory
(
DDMIMeta
.
LOOKUP
));
_xol
.
setMapping
(
"bool"
,
new
DDMIMapMetaFactory
(
DDMIMeta
.
BITFIELD
));
_xol
.
setMapping
(
"scale"
,
new
DDMIMapMetaFactory
(
DDMIMeta
.
CONV
));
_xol
.
setMapping
(
"const"
,
new
DDMIMapMetaFactory
(
DDMIMeta
.
CONST
));
_fxml
=
new
FXML
(
base
,
xsd
);
...
...
sw/jsfp/src/nl/nikhef/sfp/ddmi/DDMIMeta.java
View file @
505e191f
...
...
@@ -173,5 +173,7 @@ public class DDMIMeta<T extends Object> {
public
static
final
DDMIMeta
<
Integer
>
DEC_PLACES
=
new
DDMIMeta
<
Integer
>(
Integer
.
class
);
public
static
final
DDMIMeta
<
String
>
CONST
=
new
DDMIMeta
<
String
>(
String
.
class
);
}
sw/jsfp/src/nl/nikhef/sfp/ddmi/desc/sfpdd.xsd
View file @
505e191f
...
...
@@ -50,6 +50,7 @@
<xs:attribute
type=
"xs:string"
name=
"label"
use=
"optional"
/>
<xs:attribute
type=
"xs:string"
name=
"short"
use=
"optional"
/>
<xs:attribute
type=
"xs:string"
name=
"name"
use=
"optional"
/>
<xs:attribute
type=
"xs:IDREF"
name=
"password-id"
use=
"optional"
/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
@@ -155,6 +156,7 @@
<xs:element
ref=
"float"
/>
<xs:element
ref=
"ufix"
/>
<xs:element
ref=
"sfix"
/>
<xs:element
ref=
"password"
/>
</xs:choice>
<xs:attribute
type=
"xs:IDREF"
name=
"source-id"
use=
"optional"
/>
<xs:attribute
type=
"xs:string"
name=
"showIf"
use=
"optional"
/>
...
...
@@ -202,6 +204,21 @@
</xs:complexType>
</xs:element>
<xs:element
name=
"password"
>
<xs:complexType>
<xs:complexContent>
<xs:extension
base=
"value"
>
<xs:sequence>
<!-- when a const password is set the value is applied each time on write -->
<!-- otherwise the password is asked by the password manager (TODO) -->
<xs:element
name=
"const"
type=
"xs:string"
minOccurs=
"0"
/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element
name=
"text"
>
<xs:complexType>
<xs:complexContent>
...
...
@@ -289,6 +306,7 @@
<xs:element
ref=
"source"
/>
<xs:element
ref=
"cache"
/>
<xs:element
ref=
"checksum"
/>
<xs:element
ref=
"password"
/>
</xs:choice>
</xs:complexType>
</xs:element>
...
...
sw/safaripark/overlays/km3net_oesol.xml
View file @
505e191f
...
...
@@ -25,14 +25,17 @@
<group
id=
"root"
>
<group
label=
"OE Solutions custom"
>
<group
source-id=
"diag"
showIf=
"isset(id.montype, 6)"
>
<bitmap
label=
"Password (4F 45 53 50)"
writable=
"true"
offset=
"x7b"
length=
"4"
level=
"basic"
>
</bitmap>
<!-- implicit hard-coded password -->
<password
id=
"oe-password"
offset=
"x7b"
length=
"4"
>
<const>
4F 45 53 50
</const>
</password>
</group>
<group
source-id=
"diag_p4"
showIf=
"isset(id.montype, 6)"
>
<uint
label=
"Tune value"
writable=
"true"
offset=
"x8B"
length=
"2"
level=
"basic"
>
offset=
"x8B"
length=
"2"
level=
"basic"
password-id=
"oe-password"
>
</uint>
</group>
...
...
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