Skip to main content

Micom SE Studio1 Import Filter - Using Of SEStudio1Import.vb Module

Welcome back to Micom SE Studio1 Import Filter tutorial series. In the previous tutorial, I've shown you how to create class module that responsible for setting file processing. Click this link Micom SE Studio1 Import Filter - Creating Class Module For Setting File Process

In this series, I will show you how to use the SEStudio1Import.vb class module that I created in the previous tutorial.




Now open the SEStudio1FilterBase.bv class, copy the codes below and replace the content of this class module.

Imports OMXRioData

Public Class SEStudio1FilterBase
Inherits OMXRioFilter.FilterBase
Private RELAY_PARAMETERS_BLOCK As String = "CUSTOM.RELAY_PARAMETERS"
Private AUTHOR_PARAMETER As String = "CUSTOM.AUTHOR.IMPORT_FILTER_AUTHOR"

Public Overrides Sub SetParameter(isImport As Boolean, paramName As String, paramValue As String)
'Do nothing
End Sub

Public Overrides Function ExecuteExport() As Boolean
Return False
End Function

Public Overrides Function ExecuteImport() As Boolean
Return True
End Function

Public Overrides Function GetParameter(isImport As Boolean, paramName As String) As String
Return String.Empty
End Function

Public Overrides Function IsExportSupported() As Boolean
Return False
End Function


Public Overrides Function ShowParameterDialog(isImport As Boolean) As Boolean
Dim Result As Boolean = False
If isImport Then
If IsDocumentValid() Then
Dim _UpdateForm As New SEStudio1UIForm
With _UpdateForm
.DisplayForm(Document)
End With
_UpdateForm = Nothing
Result = True
Else
MsgBox("The current test plan/routine is not compatible for this import filter. Some validation parameters are missing.", MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Incompatible Test Plan/Routine")
End If
End If
Return Result
End Function

Private Function IsDocumentValid() As Boolean
Dim Result As Boolean = False
Dim Block As IAutoXRioBlock = Document.GetBlockFromIDs(RELAY_PARAMETERS_BLOCK)
Dim AuthorParam As IAutoXRioParameter = Document.GetParamFromIDs(AUTHOR_PARAMETER)
If Block IsNot Nothing And AuthorParam IsNot Nothing Then
If Not String.IsNullOrEmpty(AuthorParam.DisplayString) And AuthorParam.DisplayString = "Author Name" Then
Result = True
End If
End If
Block = Nothing
AuthorParam = Nothing
Return Result
End Function
End Class

Now, create new class module under the SEStudio1 folder and name it SEStudio1RelayInfo.vb. Then, copy and paste the codes below to SEStudio1RelayInfo.vb class module.

    Private _FileType As String
Private _FormatVersion As String
Private _RelayType As String
Private _ModelNumber As String
Private _SerialNumber As String

Public Sub New()

End Sub

Public Sub New(ByVal FileType As String, ByVal FormatVersion As String, ByVal RelayType As String, ByVal ModelNumber As String, ByVal SerialNumber As String)
_FileType = FileType
_FormatVersion = FormatVersion
_RelayType = RelayType
_ModelNumber = ModelNumber
_SerialNumber = SerialNumber
End Sub

Public Property FileType As String
Get
Return _FileType
End Get
Set(value As String)
_FileType = value
End Set
End Property

Public Property FormatVersion As String
Get
Return _FormatVersion
End Get
Set(value As String)
_FormatVersion = value
End Set
End Property

Public Property RelayType As String
Get
Return _RelayType
End Get
Set(value As String)
_RelayType = value
End Set
End Property

Public Property ModelNumber As String
Get
Return _ModelNumber
End Get
Set(value As String)
_ModelNumber = value
End Set
End Property

Public Property SerialNumber As String
Get
Return _SerialNumber
End Get
Set(value As String)
_SerialNumber = value
End Set
End Property

In the next tutorial, I will show you how to create a dialog box for confirming or showing that the setting file has been open successfully and the setting is ready for upload.

See you nextime.


Comments

Popular posts from this blog

Micom SE Studio1 Import Filter - Creating User Interface (UI)

Welcome to my page and welcome to the continuation of Omicron Import Filter tutorial series. In this tutorial, I will show you how to create the actual import filter fom Micom relays. In this tutorial, we will focus on the Visual Studio program. We're going to modify the codes in our project called MyImportFilter that we've created in the previous tutorial.  Download the project in this link  MyImportFilter - Process Relay Setting Parameters . Extract and open the project. Once the project is loaded, add New Folder inside the project and set the name to SEStudio1. We need this to make organize our project class filter.  SE Studio 1 stands for Schneider Electric Studio 1 which is the software that used in communicating MiCOM relays particularly P12x series. And yes we're going to create a new import filter and user interface form MiCOM P12x series relay. I think this will applied to other MiCOM P series relay. Add a new Form inside the  SEStudio1 folder  and set the name to

Write An Encrypted Text File In Visual Basic

There are many ways to encrypt text or data. In this tutorial, DESCryptoServiceProvider class to encrypt and decrypt strings using the cryptographic service provider version of the Triple Data Encryption Standard algorithm. The use encryption to protect secret data and to make data unreadable by unauthorized users. Creating encryption wrapper Open the previous project from this tutorial  Write Text To File In Visual Basic  then rename it to WriteTextToFileWithEncryptionVB or create a new project. I recommend to open the existing project to easily follow this tutorial. Create the Encryption3DesWrapper class to implement the encryption and decryption methods. 1 2 3 Public NotInheritable Class Encryption3DesWrapper End Class Add an import of the cryptography namespace to the start of the file that contains the Encryption3DesWrapper class. 1 2 3 4 5 Imports System.Security.Cryptography Public Class Encryption3DesWrapper End Class In the Encryption3DesWr