Definition at line 18 of file CreateDevice.py.
Public Member Functions | |
def | __init__ |
def | SaveObjects |
def | OnCreatePorts |
def | OnSelectPadding |
def | OnDeviceTypeChanged |
def | OnAdd |
def | OnRemove |
def | MakeEstimatedGuess |
def | GenerateNames |
def | OkButtonClicked |
def | IsCreationMode |
def | GetDeviceObjs |
Public Attributes | |
main | |
renameobj | |
deviceobj.SetFunction(str(self._functiontxtbox.currentText())) | |
oldname | |
oldnode | |
oldsystem | |
deviceid | |
nodechanged | |
systemchanged | |
system | |
deviceobj | |
devs | |
deviceobjs | |
Private Attributes | |
_creationmode | |
_deletedports | |
_deviceports |
def CreateDevice::CreateDeviceWindow::__init__ | ( | self, | ||
parent, | ||||
selectedsystem, | ||||
creationmode = True , |
||||
deviceobj = None , |
||||
devicetypes = [] , |
||||
devtype = "" , |
||||
location = "" , |
||||
functionlist = [] | ||||
) |
The Constructor.
Parameters: - parent window to this window (MainWindow) - the system to create this device in (the user can also add others) - if True, then a device will be created, if False, a device will be modified (already exists) - if the user are about to modify a device, then the previous values of the device will have to be set, and we use this object for that - A list of strings of the device types that are available in the active subsystem; user can choose device type in the combo box. - If device type is already chosen for the new device (create), it is set here - When create, set location string.
Definition at line 34 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::SaveObjects | ( | self | ) |
Here we create device object, rename object if needed, validate all properties and create the ports needed.
!return - True if successful, False if an error occur
Definition at line 384 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::OnCreatePorts | ( | self | ) |
We click on the Create/Modify button to create port(s) for the device(s) we create. They will be stored in a list in this object, and sent to the user when he/she asks for it.
!return - True if successful, False if not.
Definition at line 494 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::OnSelectPadding | ( | self, | ||
checked | ||||
) |
Enable/Disable the padding spin box depending on whether the paddingcheckbox is checked or not.
Definition at line 557 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::OnDeviceTypeChanged | ( | self, | ||
event | ||||
) |
If the user change the device type, we will have to make a new guess for the syntax of the device name.
Definition at line 565 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::OnAdd | ( | self | ) |
Add a subsystem (shown in the combo box) to the list of subsystems that the the device will be added to.
Definition at line 604 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::OnRemove | ( | self | ) |
Remove a subsystem (shown in the combo box) from the list of subsystems that the device will be added to.
Definition at line 617 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::MakeEstimatedGuess | ( | self, | ||
event = None | ||||
) |
When a device type has been chosen, this method is called from the OnDeviceTypeChanged(...) method, to make an estimated guess of what the prefix/syntax for the next device that will be added. We also set up padding and startnr to what we think is the correct.
Definition at line 634 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::GenerateNames | ( | self, | ||
event = None , |
||||
showerror = False | ||||
) |
This method is either called when the user alters the prefix, or when the user wants to save the changes made. The user will only be informed about errors when he/she wants clicks on the OK button to create a device.
The name of the method is a bit confusing, as the method just checks that you have a d in the string if needed or not.
Parameters: - default (False), whether we should show an error message to the user or not if it occurs.
Definition at line 733 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::OkButtonClicked | ( | self | ) |
Easy validation before accepting user settings. We check that the required fields are filled out, that there are no device name conflicts, correct number of ports added to the device etc.
!return - True if successful, False if not
Definition at line 771 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::IsCreationMode | ( | self | ) |
Whether we are creating or modifying a device.
!return - True if creating, False if modifying
Definition at line 846 of file CreateDevice.py.
def CreateDevice::CreateDeviceWindow::GetDeviceObjs | ( | self | ) |
Return the objects that were created by the user in this dialog
!return - Create: list of devices and ports Modify: the device modified, rename object if renamed, ports if any were altered.
Definition at line 856 of file CreateDevice.py.
Definition at line 36 of file CreateDevice.py.
Definition at line 38 of file CreateDevice.py.
Definition at line 40 of file CreateDevice.py.
Definition at line 44 of file CreateDevice.py.
deviceobj.SetFunction(str(self._functiontxtbox.currentText()))
Definition at line 56 of file CreateDevice.py.
Definition at line 60 of file CreateDevice.py.
Definition at line 61 of file CreateDevice.py.
Definition at line 62 of file CreateDevice.py.
Definition at line 64 of file CreateDevice.py.
Definition at line 65 of file CreateDevice.py.
Definition at line 66 of file CreateDevice.py.
Definition at line 272 of file CreateDevice.py.
Definition at line 273 of file CreateDevice.py.
Definition at line 274 of file CreateDevice.py.
Definition at line 275 of file CreateDevice.py.