git-svn-id: svn://db.shs.com.ru/libs@81 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -16,25 +16,21 @@ double randomn(double dv, double sv) {
|
||||
void BrickBase::Parameter::setValue(const PIVariant & v, bool withType) {
|
||||
value = v;
|
||||
if (withType) {
|
||||
switch (v.type()) {
|
||||
case PIVariant::Bool: type = BrickBase::Bool; return;
|
||||
case PIVariant::Char: type = BrickBase::Integer; return;
|
||||
case PIVariant::Short: type = BrickBase::Integer; return;
|
||||
case PIVariant::Int: type = BrickBase::Integer; return;
|
||||
case PIVariant::Long: type = BrickBase::Integer; return;
|
||||
case PIVariant::LLong: type = BrickBase::Integer; return;
|
||||
case PIVariant::UChar: type = BrickBase::Integer; return;
|
||||
case PIVariant::UShort: type = BrickBase::Integer; return;
|
||||
case PIVariant::UInt: type = BrickBase::Integer; return;
|
||||
case PIVariant::ULong: type = BrickBase::Integer; return;
|
||||
case PIVariant::ULLong: type = BrickBase::Integer; return;
|
||||
case PIVariant::Float: type = BrickBase::Float; return;
|
||||
case PIVariant::Double: type = BrickBase::Float; return;
|
||||
case PIVariant::LDouble: type = BrickBase::Float; return;
|
||||
case PIVariant::String: type = BrickBase::String; return;
|
||||
case PIVariant::StringList: type = BrickBase::String; return;
|
||||
default: break;
|
||||
};
|
||||
PIString tn = v.typeName();
|
||||
if (tn == "bool") {type = BrickBase::Bool; return;}
|
||||
if (tn == "char") {type = BrickBase::Integer; return;}
|
||||
if (tn == "uchar") {type = BrickBase::Integer; return;}
|
||||
if (tn == "short") {type = BrickBase::Integer; return;}
|
||||
if (tn == "ushort") {type = BrickBase::Integer; return;}
|
||||
if (tn == "int") {type = BrickBase::Integer; return;}
|
||||
if (tn == "uint") {type = BrickBase::Integer; return;}
|
||||
if (tn == "llong") {type = BrickBase::Integer; return;}
|
||||
if (tn == "ullong") {type = BrickBase::Integer; return;}
|
||||
if (tn == "float") {type = BrickBase::Float; return;}
|
||||
if (tn == "double") {type = BrickBase::Float; return;}
|
||||
if (tn == "ldouble") {type = BrickBase::Float; return;}
|
||||
if (tn == "PIString") {type = BrickBase::String; return;}
|
||||
if (tn == "PIStringList") {type = BrickBase::String; return;}
|
||||
}/* else {
|
||||
switch (v.type()) {
|
||||
case PIVariant::Bool: value.vBool = v.vBool; return;
|
||||
|
||||
Reference in New Issue
Block a user