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

Install And Use Newly Created Import Filter In Omicron Test Universe

Welcome to my page. This is the second part of the Omicron Import Filter tutorial series. In this tutorial, I will show you how install  and use the Import Filter that we've created in the previous tutorial in this series using two methods.  The first one via Test Object and the second one is via script. Open the Visual Studio project called MyImportFilter that we created in the first part of tutorial which can be found here ( Omicron Import Filter - Create New Filter ). Once the project opened, right click on the project at the solution explorer the click Open Folder in File Explorer. The project file directory will open. Open the  bin\Debug folder and you will find the two files in that folder ( MyImportFilter.dll and  SampleFilter.xriofilter ). Create new folder in that directory and set the folder name to  MyImportFilter . Move the  MyImportFilter.dll file to the  MyImportFilter folder then, copy the  MyImportFilter folder and the  Sa...

Processing The Relay Setting Parameters In Omicron Import Filter

Welcome to my page and welcome to the fifth part of Omicron Import Filter tutorial series. In this tutorial, I will show you how to process the relay setting parameters that to be import in the Xrio converter. 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 ...

Micom SE Studio1 Import Filter - Creating Class Module For Setting File Process

Welcome back to  Micom SE Studio1 Import Filter tutorial series. In the previous tutorial, I've shown you how to create user interface. Click this link  Micom SE Studio1 Import Filter - Creating User Interface (UI) In this series, I will show you how to add class module that responsible for setting file processing. Meaning, the relay has a setting configuration which can be exported in readable file like text file, xml file or csv file & etc. In this tutorial, I'm going to use text file (.txt). Now, add new class in the SEStudio1 folder and name it with SEStudio1Import.vb . All the data from setting file will be process in this class. Copy the code below and paste it it to import section. Imports System.IO Imports OMXRioData Next,  we need to declare some names, functions and procedures to be used in this class module. Copy the codes below and paste them inside the SEStudio1Import.vb . Private _Document As OMXRioData.IAutoXRioDocument 'Storage of XRIO document...