Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
d738a486
Commit
d738a486
authored
Mar 17, 2021
by
hungdangquoc
Browse files
[ADD
#132
]_user_is_able_to_select_valid_columns
parent
da76bf5b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
253 additions
and
96 deletions
+253
-96
src/modules/filterProtonData/WDatatype.cpp
src/modules/filterProtonData/WDatatype.cpp
+42
-0
src/modules/filterProtonData/WDatatype.h
src/modules/filterProtonData/WDatatype.h
+55
-0
src/modules/filterProtonData/WProtonData.cpp
src/modules/filterProtonData/WProtonData.cpp
+20
-3
src/modules/filterProtonData/WProtonData.h
src/modules/filterProtonData/WProtonData.h
+9
-0
src/modules/filterProtonData/WSingleSelectorName.cpp
src/modules/filterProtonData/WSingleSelectorName.cpp
+37
-23
src/modules/filterProtonData/WSingleSelectorName.h
src/modules/filterProtonData/WSingleSelectorName.h
+11
-9
src/modules/filterProtonData/propertyHandler/WColumnPropertyHandler.cpp
...lterProtonData/propertyHandler/WColumnPropertyHandler.cpp
+50
-33
src/modules/filterProtonData/propertyHandler/WColumnPropertyHandler.h
...filterProtonData/propertyHandler/WColumnPropertyHandler.h
+19
-22
src/modules/filterProtonData/test/WProtonData_test.h
src/modules/filterProtonData/test/WProtonData_test.h
+10
-6
No files found.
src/modules/filterProtonData/WDatatype.cpp
0 → 100644
View file @
d738a486
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <string>
#include "WDatatype.h"
std
::
string
WDatatype
::
getInt
()
{
return
"int"
;
}
std
::
string
WDatatype
::
getDouble
()
{
return
"double"
;
}
std
::
string
WDatatype
::
getString
()
{
return
"string"
;
}
src/modules/filterProtonData/WDatatype.h
0 → 100644
View file @
d738a486
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WDATATYPE_H
#define WDATATYPE_H
#include <string>
/**
* Holds the datatypes as string
*/
class
WDatatype
{
public:
/**
* getter
* \return datatype int as string
*/
static
std
::
string
getInt
();
/**
* getter
* \return datatype double as string
*/
static
std
::
string
getDouble
();
/**
* getter
* \return datatype string as string
*/
static
std
::
string
getString
();
};
#endif // WDATATYPE_H
src/modules/filterProtonData/WProtonData.cpp
View file @
d738a486
...
...
@@ -143,14 +143,31 @@ std::string WProtonData::determineColumnTypeByString( std::string cellValue )
if
(
std
::
regex_search
(
cellValue
,
regexInt
)
)
{
return
"int"
;
return
WDatatype
::
getInt
()
;
}
else
if
(
std
::
regex_search
(
cellValue
,
regexDouble
)
)
{
return
"d
ouble
"
;
return
WDatatype
::
getD
ouble
()
;
}
else
{
return
"s
tring
"
;
return
WDatatype
::
getS
tring
()
;
}
}
std
::
vector
<
std
::
string
>
WProtonData
::
getHeaderFromType
(
std
::
string
typeName
)
{
std
::
vector
<
std
::
string
>
header
=
m_csvHeader
->
at
(
0
);
std
::
vector
<
std
::
string
>
columnTypes
=
*
m_columnTypes
;
std
::
vector
<
std
::
string
>
filterHeader
;
for
(
size_t
i
=
0
;
i
<
columnTypes
.
size
();
i
++
)
{
if
(
columnTypes
[
i
]
==
typeName
)
{
filterHeader
.
push_back
(
header
[
i
]
);
}
}
return
filterHeader
;
}
src/modules/filterProtonData/WProtonData.h
View file @
d738a486
...
...
@@ -28,8 +28,10 @@
#include <regex>
#include <map>
#include <string>
#include <vector>
#include "core/dataHandler/WDataSetCSV.h"
#include "WDatatype.h"
/**
...
...
@@ -121,6 +123,13 @@ public:
*/
WDataSetCSV
::
ContentElemSPtr
getColumnTypes
();
/**
* Return a vector of filtered Headers
* \param type Type of filter
* \return Return a vector of filtered Headers
*/
std
::
vector
<
std
::
string
>
getHeaderFromType
(
std
::
string
typeName
);
private:
/**
* Stores column index of data.
...
...
src/modules/filterProtonData/WSingleSelectorName.cpp
View file @
d738a486
...
...
@@ -62,61 +62,75 @@ std::string WSingleSelectorName::getParentId()
return
"Parent id"
;
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getXwithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getXwithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getX
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getX
(),
"Choose the column which should be used to determine the x coordinate."
,
"posX"
);
"posX"
,
WDatatype
::
getDouble
()
);
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getYwithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getYwithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getY
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getY
(),
"Choose the column which should be used to determine the y coordinate."
,
"posY"
);
"posY"
,
WDatatype
::
getDouble
()
);
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getZwithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getZwithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getZ
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getZ
(),
"Choose the column which should be used to determine the z coordinate."
,
"posZ"
);
"posZ"
,
WDatatype
::
getDouble
()
);
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getPDGwithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getPDGwithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getPDG
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getPDG
(),
"Choose the column which should be used to determine the particle data group."
,
"PDGEncoding"
);
"PDGEncoding"
,
WDatatype
::
getInt
()
);
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getEdepWithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getEdepWithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getEdep
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getEdep
(),
"Choose the column which should be used to determine the energy deposition."
,
"edep"
);
"edep"
,
WDatatype
::
getDouble
()
);
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getEventIdWithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getEventIdWithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getEventId
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getEventId
(),
"Choose the column which should be used to determine the event id."
"Tracks will be drawn based on the the event id, all particles with the same event id will be connected."
,
"eventID"
);
"eventID"
,
WDatatype
::
getInt
()
);
}
WSingleSelectorName
::
NameDescriptionSearch
WSingleSelectorName
::
getParentIdWithDescription
()
WSingleSelectorName
::
NameDescriptionSearch
Typ
WSingleSelectorName
::
getParentIdWithDescription
()
{
return
WSingleSelectorName
::
NameDescriptionSearch
(
getParentId
(),
return
WSingleSelectorName
::
NameDescriptionSearchTyp
(
getParentId
(),
"Choose the column which should be used to determine the parent id."
"Primaries and secondaries filtering is based on that id, if a "
"particle has the parent id 0 it is a primary otherwise it is a secondary."
,
"parentID"
);
"parentID"
,
WDatatype
::
getInt
()
);
}
std
::
list
<
WSingleSelectorName
::
NameDescriptionSearch
>
WSingleSelectorName
::
getListOfSelectorContent
()
std
::
list
<
WSingleSelectorName
::
NameDescriptionSearch
Typ
>
WSingleSelectorName
::
getListOfSelectorContent
()
{
std
::
list
<
WSingleSelectorName
::
NameDescriptionSearch
>
list
;
std
::
list
<
WSingleSelectorName
::
NameDescriptionSearch
Typ
>
list
;
list
.
push_back
(
getXwithDescription
()
);
list
.
push_back
(
getYwithDescription
()
);
...
...
src/modules/filterProtonData/WSingleSelectorName.h
View file @
d738a486
...
...
@@ -29,6 +29,8 @@
#include <list>
#include <string>
#include "WDatatype.h"
/**
* Holds the single selector content.
...
...
@@ -42,7 +44,7 @@ public:
* 2. Desciption of single-selector,
* 3. Value that is searched for in the csv header
*/
typedef
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
>
NameDescriptionSearch
;
typedef
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
>
NameDescriptionSearch
Typ
;
/**
* getter
...
...
@@ -90,49 +92,49 @@ public:
* getter
* \return the name of the single-selector (X) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getXwithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getXwithDescription
();
/**
* getter
* \return the name of the single-selector (Y) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getYwithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getYwithDescription
();
/**
* getter
* \return the name of the single-selector (Z) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getZwithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getZwithDescription
();
/**
* getter
* \return the name of the single-selector (pdg) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getPDGwithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getPDGwithDescription
();
/**
* getter
* \return the name of the single-selector (edep) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getEdepWithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getEdepWithDescription
();
/**
* getter
* \return the name of the single-selector (Event id) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getEventIdWithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getEventIdWithDescription
();
/**
* getter
* \return the name of the single-selector (Parent id) with Description
*/
static
WSingleSelectorName
::
NameDescriptionSearch
getParentIdWithDescription
();
static
WSingleSelectorName
::
NameDescriptionSearch
Typ
getParentIdWithDescription
();
/**
* getter
* \return Vector of names of the single-selectors with Description and Value that is searched for in the csv header
*/
static
std
::
list
<
WSingleSelectorName
::
NameDescriptionSearch
>
getListOfSelectorContent
();
static
std
::
list
<
WSingleSelectorName
::
NameDescriptionSearch
Typ
>
getListOfSelectorContent
();
};
#endif // WSINGLESELECTORNAME_H
src/modules/filterProtonData/propertyHandler/WColumnPropertyHandler.cpp
View file @
d738a486
...
...
@@ -44,19 +44,15 @@ void WColumnPropertyHandler::createProperties()
WPropertyBase
::
PropertyChangeNotifierType
notifier
=
boost
::
bind
(
&
WColumnPropertyHandler
::
propertyNotifier
,
this
,
boost
::
placeholders
::
_1
);
InitializeSelectionItem
();
m_columnSelectionGroup
=
m_properties
->
addPropertyGroup
(
"Select columns"
,
"Select the columns which should be used"
);
std
::
list
<
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
>
>
names
=
WSingleSelectorName
::
getListOfSelectorContent
();
for
(
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
>
selectorElement
:
names
)
std
::
list
<
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
>
>
names
=
WSingleSelectorName
::
getListOfSelectorContent
();
for
(
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
>
selectorElement
:
names
)
{
std
::
string
columnName
=
std
::
get
<
0
>
(
selectorElement
);
std
::
string
desciption
=
std
::
get
<
1
>
(
selectorElement
);
std
::
string
defName
=
std
::
get
<
2
>
(
selectorElement
);
mapPropSelectionsToString
.
insert
(
std
::
map
<
WPropSelection
,
std
::
string
>::
value_type
(
addHeaderProperty
(
columnName
,
desciption
,
defName
,
notifier
),
columnName
)
std
::
map
<
WPropSelection
,
std
::
string
>::
value_type
(
addHeaderProperty
(
selectorElement
,
notifier
),
columnName
)
);
}
}
...
...
@@ -70,27 +66,66 @@ void WColumnPropertyHandler::updateProperty()
{
}
void
WColumnPropertyHandler
::
InitializeSelectionItem
()
boost
::
shared_ptr
<
WItemSelection
>
WColumnPropertyHandler
::
InitializeSelectionItem
(
std
::
string
typeName
)
{
m_possibleSelectionsUsingTypes
=
WItemSelection
::
SPtr
(
new
WItemSelection
()
);
boost
::
shared_ptr
<
WItemSelection
>
possibleSelectionsUsingTypes
=
WItemSelection
::
SPtr
(
new
WItemSelection
()
);
std
::
vector
<
std
::
string
>
header
=
m_protonData
->
getHeaderFromType
(
typeName
);
std
::
vector
<
std
::
string
>
header
=
m_protonData
->
getCSVHeader
()
->
at
(
0
);
for
(
std
::
vector
<
std
::
string
>::
iterator
colName
=
header
.
begin
();
colName
!=
header
.
end
();
colName
++
)
{
m_possibleSelectionsUsingTypes
->
addItem
(
ItemType
::
create
(
*
colName
,
*
colName
,
""
,
NULL
)
);
possibleSelectionsUsingTypes
->
addItem
(
ItemType
::
create
(
*
colName
,
*
colName
,
""
,
NULL
)
);
}
possibleSelectionsUsingTypes
->
addItem
(
ItemType
::
create
(
"- no selection -"
,
"- no selection -"
,
""
,
NULL
)
);
return
possibleSelectionsUsingTypes
;
}
int
WColumnPropertyHandler
::
getfilterIndex
(
int
index
,
std
::
string
typeName
)
{
std
::
vector
<
std
::
string
>
headerToSearch
=
m_protonData
->
getCSVHeader
()
->
at
(
0
);
std
::
string
refheader
=
headerToSearch
.
at
(
index
);
std
::
vector
<
std
::
string
>
singleSelectorContent
=
m_protonData
->
getHeaderFromType
(
typeName
);
size_t
indexCounter
=
0
;
std
::
cout
<<
"START "
<<
singleSelectorContent
.
size
()
<<
" | "
<<
typeName
<<
std
::
endl
;
for
(
std
::
vector
<
std
::
string
>::
iterator
colName
=
singleSelectorContent
.
begin
();
colName
!=
singleSelectorContent
.
end
();
colName
++
)
{
std
::
cout
<<
"DEBUG: "
<<
refheader
<<
" | "
<<
*
colName
<<
" | "
<<
indexCounter
<<
std
::
endl
<<
std
::
endl
;
if
(
*
colName
==
refheader
)
{
return
indexCounter
;
}
indexCounter
++
;
}
m_possibleSelectionsUsingTypes
->
addItem
(
ItemType
::
create
(
"- no selection -"
,
"- no selection -"
,
""
,
NULL
)
);
std
::
cout
<<
"ENDE "
<<
std
::
endl
<<
std
::
endl
;
return
-
1
;
}
WPropSelection
WColumnPropertyHandler
::
addHeaderProperty
(
std
::
string
columnName
,
std
::
string
description
,
std
::
string
defName
,
WPropSelection
WColumnPropertyHandler
::
addHeaderProperty
(
WColumnPropertyHandler
::
NameDescriptionSearchTyp
ndst
,
WPropertyBase
::
PropertyChangeNotifierType
notifier
)
{
std
::
string
columnName
=
std
::
get
<
0
>
(
ndst
);
std
::
string
description
=
std
::
get
<
1
>
(
ndst
);
std
::
string
defName
=
std
::
get
<
2
>
(
ndst
);
std
::
string
type
=
std
::
get
<
3
>
(
ndst
);
int
index
=
m_protonData
->
getColumnIndex
(
defName
);
int
indexSingleSelector
=
index
<
0
?
-
1
:
getfilterIndex
(
index
,
type
);
m_protonData
->
setStateIndex
(
columnName
,
index
);
WItemSelector
selector
=
index
<
0
?
m_possibleSelectionsUsingTypes
->
getSelectorLast
()
:
m_possibleSelectionsUsingTypes
->
getSelector
(
index
);
boost
::
shared_ptr
<
WItemSelection
>
possibleSelectionsUsingTypes
=
InitializeSelectionItem
(
type
);
WItemSelector
selector
=
index
<
0
?
possibleSelectionsUsingTypes
->
getSelectorLast
()
:
possibleSelectionsUsingTypes
->
getSelector
(
indexSingleSelector
);
WPropSelection
selection
=
m_columnSelectionGroup
->
addProperty
(
columnName
,
description
,
...
...
@@ -103,19 +138,6 @@ WPropSelection WColumnPropertyHandler::addHeaderProperty( std::string columnName
return
selection
;
}
int
WColumnPropertyHandler
::
getColumnNumberByName
(
std
::
string
columnNameToMatch
)
{
std
::
vector
<
std
::
string
>
headerToSearchIn
=
m_protonData
->
getCSVHeader
()
->
at
(
0
);
int
pos
=
0
;
for
(
std
::
vector
<
std
::
string
>::
iterator
it
=
headerToSearchIn
.
begin
();
it
!=
headerToSearchIn
.
end
();
it
++
)
{
if
(
*
it
==
columnNameToMatch
)
return
pos
;
pos
++
;
}
return
-
1
;
}
void
WColumnPropertyHandler
::
propertyNotifier
(
WPropertyBase
::
SPtr
property
)
{
const
WItemSelector
*
selector
=
NULL
;
...
...
@@ -137,7 +159,7 @@ void WColumnPropertyHandler::propertyNotifier( WPropertyBase::SPtr property )
{
std
::
string
selectedValue
=
selector
->
at
(
0
)
->
getAs
<
ItemType
>
()
->
getValue
();
m_protonData
->
setStateIndex
(
columnName
,
getColumnNumberByName
(
selectedValue
)
);
m_protonData
->
setStateIndex
(
columnName
,
m_protonData
->
getColumnIndex
(
selectedValue
)
);
m_dataUpdate
();
if
(
m_externEventMethod
!=
NULL
)
...
...
@@ -146,8 +168,3 @@ void WColumnPropertyHandler::propertyNotifier( WPropertyBase::SPtr property )
}
}
}
boost
::
shared_ptr
<
WItemSelection
>
WColumnPropertyHandler
::
getColumnItems
()
{
return
m_possibleSelectionsUsingTypes
;
}
src/modules/filterProtonData/propertyHandler/WColumnPropertyHandler.h
View file @
d738a486
...
...
@@ -44,6 +44,14 @@
class
WColumnPropertyHandler
{
public:
/**
* tuple with 3 string as value
* 1. Name of single-selector,
* 2. Desciption of single-selector,
* 3. Value that is searched for in the csv header
*/
typedef
std
::
tuple
<
std
::
string
,
std
::
string
,
std
::
string
,
std
::
string
>
NameDescriptionSearchTyp
;
/**
* Function variables for updating the data
*/
...
...
@@ -70,11 +78,6 @@ public:
*/
void
createProperties
();
/**
* \return boost::shared_ptr< WItemSelection > Reference of selectable column types
*/
boost
::
shared_ptr
<
WItemSelection
>
getColumnItems
();
/**
* update current group property and subproperty
*/
...
...
@@ -114,13 +117,10 @@ private:
/**
* Creates the individual WItemSelection
* \param headerName The name of the selection
* \param description The description of the selection
* \param notifier The notifier for the selection
* \param defName The default name of the selection
* \param ndst ( n = Name, d = Description, s = Search, t = Typ )
* \return WPropSelection The created selection
*/
WPropSelection
addHeaderProperty
(
std
::
string
headerName
,
std
::
string
description
,
std
::
string
defName
,
WPropSelection
addHeaderProperty
(
WColumnPropertyHandler
::
NameDescriptionSearchTyp
ndst
,
WPropertyBase
::
PropertyChangeNotifierType
notifier
);
/**
...
...
@@ -134,11 +134,6 @@ private:
*/
WPropGroup
m_columnSelectionGroup
;
/**
* A list of items that can be selected using m_aSingleSelectionUsingTypes property.
*/
boost
::
shared_ptr
<
WItemSelection
>
m_possibleSelectionsUsingTypes
;
/**
* represents the item type for item-selection
*/
...
...
@@ -150,17 +145,19 @@ private:
typedef
std
::
map
<
WPropSelection
,
std
::
string
>::
iterator
PropMapEntry
;
/**
* Get column number by name from header
*
* \param columnNameToMatch Search for the specified column name.
* \return Column number, where columnToMatch is in headerToSearchIn
* creates the content (options) of the WItemSelection
* \param typeName Type of column.
* \return content of WItemSelection
*/
int
getColumnNumberByName
(
std
::
string
columnNameToMatch
);
boost
::
shared_ptr
<
WItemSelection
>
InitializeSelectionItem
(
std
::
string
typeName
);
/**
* creates the content (options) of the WItemSelection
* converts the index to the filtered index
* \param index index to search.
* \param typeName Type of column.
* \return filterd index
*/
void
InitializeSelectionItem
(
);
int
getfilterIndex
(
int
index
,
std
::
string
typeName
);
};
#endif // WCOLUMNPROPERTYHANDLER_H
src/modules/filterProtonData/test/WProtonData_test.h
View file @
d738a486
...
...
@@ -242,20 +242,23 @@ public:
WProtonData
protonData
(
boost
::
make_shared
<
WDataSetCSV
::
Content
>
(
sampleColumnNames
),
boost
::
make_shared
<
WDataSetCSV
::
Content
>
(
sampleDataRows
)
);
std
::
vector
<
std
::
string
>
testIntList
{
std
::
vector
<
std
::
string
>
testIntList
{
"1"
,
"0"
,
"10"
,
"+1"
,
"-1"
,
"1e+1"
,
"+1e+1"
,
"-1e+1"
,
"1e1"
,
"+1e1"
,
"-1e1"
,
};
std
::
vector
<
std
::
string
>
testDoubleList
{
std
::
vector
<
std
::
string
>
testDoubleList
{
"1000.1"
,
"1."
,
".1"
,
"1.1"
,
"+1."
,
"-1."
,
"+.1"
,
"-.1"
,
"+1e-1"
,
"0.001e-12"
,
"0.111111111111111"
};
std
::
vector
<
std
::
string
>
testStringList
{
std
::
vector
<
std
::
string
>
testStringList
{
"."
,
"1a"
,
"++1"
,
"+-1"
,
"+"
,
"-."
,
"-"
,
"--1."
,
"1.e.1"
,
...
...
@@ -286,10 +289,11 @@ public:
WProtonData
protonData
(
boost
::
make_shared
<
WDataSetCSV
::
Content
>
(
sampleColumnNames
),
boost
::
make_shared
<
WDataSetCSV
::
Content
>
(
sampleDataRows
)
);
std
::
vector
<
std
::
string
>
refColumnTypes
{
"int"
,
"int"
,
"int"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
std
::
vector
<
std
::
string
>
refColumnTypes
{
"int"
,
"int"
,
"int"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"double"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"double"
,
"double"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"int"
,
"double"
,
"double"
,
"int"
,
"int"
,
"int"
,
"int"
,
"double"
,
"int"
,
"string"
,
"string"
,
"string"
,
"string"
,
};
...
...
Write
Preview