6 Commits

Author SHA1 Message Date
Jonathan Jenne
7ebb532626 Language: Version 1.3.1 2021-07-29 16:36:47 +02:00
Jonathan Jenne
47065c19a3 Language: Improve RemoveInvalidCharacters to remove double spaces and dots 2021-07-29 16:36:12 +02:00
Jonathan Jenne
2cf837cc92 Filesystem: Version 1.0.7 2021-07-29 16:35:00 +02:00
Jonathan Jenne
fdc994e25f Filesystem: Improve GetCleanfilename to remove double dots and spaces 2021-07-29 16:34:32 +02:00
Jonathan Jenne
643e62aca1 Windream: version 1.2.2 2021-07-29 16:33:48 +02:00
Jonathan Jenne
db4457fe3f Windream: Add Function GetVectorData 2021-07-29 16:33:37 +02:00
6 changed files with 35 additions and 11 deletions

View File

@@ -55,6 +55,8 @@ Public Class File
Dim oCleanName As String = FileName
oCleanName = Regex.Replace(oCleanName, _invalidFilenameChars, String.Empty)
oCleanName = Regex.Replace(oCleanName, REGEX_CLEAN_FILENAME, String.Empty, RegexOptions.Singleline)
oCleanName = Regex.Replace(oCleanName, "\s{2,}", " ")
oCleanName = Regex.Replace(oCleanName, "\.{2,}", ".")
_Logger.Debug("Filename after cleaning: [{0}]", oCleanName)

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.6.0")>
<Assembly: AssemblyFileVersion("1.0.6.0")>
<Assembly: AssemblyVersion("1.0.7.0")>
<Assembly: AssemblyFileVersion("1.0.7.0")>

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.3.0.0")>
<Assembly: AssemblyFileVersion("1.3.0.0")>
<Assembly: AssemblyVersion("1.3.1.0")>
<Assembly: AssemblyFileVersion("1.3.1.0")>

View File

@@ -136,6 +136,10 @@ Public Class Utils
' Remove Invalid filename characters
oResult = Regex.Replace(oResult, InvalidChars.Paths, String.Empty)
' Remove Uneccessary characters
oResult = Regex.Replace(oResult, "\s{2,}", " ")
oResult = Regex.Replace(oResult, "\.{2,}", ".")
' Remove excess space chars
oResult = oResult.Trim()

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.2.1.0")>
<Assembly: AssemblyFileVersion("1.2.1.0")>
<Assembly: AssemblyVersion("1.2.2.0")>
<Assembly: AssemblyFileVersion("1.2.2.0")>

View File

@@ -893,6 +893,23 @@ Public Class Windream
End Try
End Function
Public Function GetVectorData(FilePath As String, IndexName As String, NewValues As Object, CheckDuplicates As Boolean) As String()
Try
Dim oWMObject = GetFileByPath(FilePath)
Dim oObjectArray As Object() = GetVektorData_Combined(oWMObject, IndexName, NewValues, CheckDuplicates)
Dim oStringArray As New List(Of String)
For Each oObjectValue In oObjectArray
oStringArray.Add(oObjectValue.ToString)
Next
Return oStringArray.ToArray
Catch ex As Exception
_logger.Error(ex)
Return Nothing
End Try
End Function
''' <summary>
''' Gets an array of the actual vektorvalues of index, collated with the passed values
''' </summary>
@@ -901,7 +918,7 @@ Public Class Windream
''' <param name="NewValues">The new values as Array</param>
''' <param name="CheckDuplikat">True if duplicates shall be prevented</param>
''' <exception cref="Exceptions.SessionException"></exception>
Public Function GetVektorData_Combined(ByVal WindreamObject As WMObject, IndexName As String, NewValues As Object, CheckDuplikat As Boolean)
Public Function GetVektorData_Combined(ByVal WindreamObject As WMObject, IndexName As String, NewValues As Object(), CheckDuplikat As Boolean)
Try
Dim oAnzahl As Integer = 0
Dim oValueArray()
@@ -1494,18 +1511,19 @@ Public Class Windream
End Try
End Function
Private Function GetObjectByPath(ObjectName As String, ObjectType As WMEntity) As WMObject
Private Function GetObjectByPath(ObjectPath As String, ObjectType As WMEntity) As WMObject
If TestSessionLoggedIn() = False Then
Return Nothing
End If
If TestObjectExists(ObjectName, ObjectType) = False Then
_logger.Warn("GetObjectByPath: Object {0} does not exist!", ObjectName)
If TestObjectExists(ObjectPath, ObjectType) = False Then
_logger.Warn("GetObjectByPath: Object {0} does not exist!", ObjectPath)
Return Nothing
End If
Try
Dim oWMObject As WMObject = Session.GetWMObjectByPath(ObjectType, ObjectName)
Dim oNormalizedPath = GetNormalizedPath(ObjectPath)
Dim oWMObject As WMObject = Session.GetWMObjectByPath(ObjectType, oNormalizedPath)
Return oWMObject
Catch ex As Exception
_logger.Error(ex)