Validation Helper Function

class projManagement.Validation.Validation

This is Validation class use for validating Project. e.g if .proj is present in project directory or if new project name is already exist in workspace etc

validateCir(projDir)

Validate if cir file present in the directory with the appropriate .cir file name, same as the project directory base

@params
:projDir => the path to the project diretory
@return
True False
validateCirOut(projDir)

This function checks if “.cir.out” file is present.

validateKicad(projDir)

Validate if projDir is set appropriately in the function calling file and if Kicad components are present

@params
:projDir => the path of the project directory, passed from
the calling function
@return
True False
validateNewproj(projDir)

Validate new project created

@params
:projDir => Contains path of the new projDir created
@return
:”CHECKEXIST” => If smae project name folder exists :”CHECKNAME” => If space is there in name :”VALID” => If valid project name given
validateOpenproj(projDir)

Takes as input the path of the project and checks if projName.proj file exists or not

@params
:projDir => contains the path of the project selected to open
@return
True => If the folder contains the projName.proj file False => If the folder doesn’t contain projName.proj file
validateSub(subDir, givenNum)

This function checks if “.sub” file is present. Also, if subckt file is present check for ports and check if equal

@params
:subDir => the path of the subcircuit directory :giveNum => the number of port calculated and passed for validation
@return
True PORT DIREC
validateSubcir(projDir, fileName)
This function checks for valid format of .sub file.
Correct format of file is:
  • File should start with .subckt <filename>
  • End with .ends <filename>

Function is passed with the file of path it checks the file line by line untill it get .subckt as its first word and then check for second word is it <fileName> or not.

Then it checks for second last line if it is “.ends <filename>” it return True if conditions satisfy else return False.

validateTool(toolName)

This function check if tool is present in the system.