- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
HFSS15: Using an IronPython Program for Integration with a Scheduler
This section describes how to create an IronPython program for integration with a scheduler. Each such program is used for a single specific scheduler environment. If the program is installed with a valid name and in the correct location, then it will automatically be loaded and used by ANSYS EM tools.
Installation Details
The IronPython program must be installed in the schedulers subdirectory of the ANSYS EM installation directory. For example, if the installation directory is C:Program Files (x86)AnsysEMHFSS14.0, then the IronPython program must be installed in directory C:Program Files (x86)AnssysEMHFSS14Win64schedulers.
The program file extension must be ".py". Select the program name so that it does not conflict with other IronPython programs in the same directory. If the Operating System or file system treat file names in a case sensitive manner, the file extension ".py" must be lower case.
Python Programming Notes
The scheduler program will be run in the IronPython environment both on Microsoft Windows and on Linux. There are some differences between IronPython and CPython. The version of IronPython in use as of June 9, 2011 is 2.6.1.
Implementation Details
The program must contain the following:
Import the ISchedulerPluginExtension interface as follows:
from Ansys.Ansoft.SchedulerPluginDotNet import ISchedulerPluginExtension
Define a class which implements the ISchedulerPluginExtension interface. In this document, this class is named SamplePluginExtension, but any class name may be used. The class member functions are described in the next section. The class definition will look similar to the following:
class SamplePluginExtension(ISchedulerPluginExtension):
def GetName(self):
return "SamplePluginExtension"
def GetDescription(self):
return "Example python script plugin extension"
. . .
Include the following line in the program so that the class that you have defined, SamplePluginExtension, is loaded by the infrastructure:
ExtensionRegistrar.RegisterPluginExtension(SamplePluginExtension())
The infrastructure will make the EntensionRegistrar object available in the environment where the program is loaded.
Each of the functions to be implemented in the SamplePluginExtension class is described below.
GetName
GetDescription
IsProductLaunchedInYourEnvironment
GetSchedulerDisplayName
GetThisJobID
GetUseRsmForEngineLaunch
GetTempDirectory
GetMessageStringToRegisterForSigTerm
GetMachineListAvailableForDistribution
LaunchProcess
HFSS 学习培训课程套装,专家讲解,视频教学,帮助您全面系统地学习掌握HFSS
上一篇:Using .NET Collection Classes and Interfaces in Python Scripts
下一篇:Using or Viewing List Objects