@@ -1214,6 +1214,27 @@ private string G_label_getDescription(object[] items) {
12141214 return "" ;
12151215 }
12161216
1217+ private void GetEDSFileInfo ( EDSsharp eds )
1218+ {
1219+ string [ ] nums = eds . fi . fileVersionString . Split ( '.' ) ;
1220+ if ( nums . Length == 2 )
1221+ {
1222+ byte . TryParse ( nums [ 0 ] , out eds . fi . FileVersion ) ;
1223+ byte . TryParse ( nums [ 1 ] , out eds . fi . FileRevision ) ;
1224+ }
1225+ }
1226+ private UInt32 U32Parse ( string str )
1227+ {
1228+ if ( str . Trim ( ) . ToLower ( ) . StartsWith ( "0x" ) )
1229+ {
1230+ return System . Convert . ToUInt32 ( str , 16 ) ;
1231+ }
1232+ else
1233+ {
1234+ return System . Convert . ToUInt32 ( str ) ;
1235+ }
1236+ }
1237+
12171238 private EDSsharp Convert ( ISO15745ProfileContainer container )
12181239 {
12191240 EDSsharp eds = new EDSsharp ( ) ;
@@ -1234,7 +1255,8 @@ private EDSsharp Convert(ISO15745ProfileContainer container)
12341255 if ( body_device != null )
12351256 {
12361257 eds . fi . FileName = body_device . fileName ?? "" ;
1237- eds . fi . FileVersion = Byte . Parse ( body_device . fileVersion ?? "0" ) ;
1258+ eds . fi . fileVersionString = body_device . fileVersion ?? "" ;
1259+ GetEDSFileInfo ( eds ) ;
12381260 eds . fi . CreatedBy = body_device . fileCreator ?? "" ;
12391261 eds . fi . ModifiedBy = body_device . fileModifiedBy ?? "" ;
12401262
@@ -1257,15 +1279,15 @@ private EDSsharp Convert(ISO15745ProfileContainer container)
12571279 if ( body_device . DeviceIdentity . vendorName != null )
12581280 eds . di . VendorName = body_device . DeviceIdentity . vendorName . Value ?? "" ;
12591281 if ( body_device . DeviceIdentity . vendorID != null )
1260- eds . di . VendorNumber = UInt32 . Parse ( body_device . DeviceIdentity . vendorID . Value ?? "0" ) ;
1282+ eds . di . VendorNumber = U32Parse ( body_device . DeviceIdentity . vendorID . Value ?? "0" ) ;
12611283 if ( body_device . DeviceIdentity . revisionNumber != null )
12621284 eds . di . RevisionNumber = body_device . DeviceIdentity . revisionNumber . Value ;
12631285 if ( body_device . DeviceIdentity . orderCode != null )
12641286 eds . di . OrderCode = body_device . DeviceIdentity . orderCode . Value ?? "" ;
12651287 if ( body_device . DeviceIdentity . productName != null )
12661288 eds . di . ProductName = body_device . DeviceIdentity . productName . Value ?? "" ;
12671289 if ( body_device . DeviceIdentity . productID != null )
1268- eds . di . ProductNumber = UInt32 . Parse ( body_device . DeviceIdentity . productID . Value ?? "0" ) ;
1290+ eds . di . ProductNumber = U32Parse ( body_device . DeviceIdentity . productID . Value ?? "0" ) ;
12691291 if ( body_device . DeviceIdentity . productText != null )
12701292 eds . fi . Description = G_label_getDescription ( body_device . DeviceIdentity . productText . Items ) ;
12711293 }
0 commit comments