
# Loading additional proc with user specified bodies to compute parameter values.
source [file join [file dirname [file dirname [info script]]] gui/Current_controller_v1_0.gtcl]

# Definitional proc to organize widgets for parameters.
proc init_gui { IPINST } {
  ipgui::add_param $IPINST -name "Component_Name"
  #Adding Page
  set Page_0 [ipgui::add_page $IPINST -name "Page 0"]
  ipgui::add_static_text $IPINST -name "AXI Parameters" -parent ${Page_0} -text {AXI Parameters}
  set C_S00_AXI_DATA_WIDTH [ipgui::add_param $IPINST -name "C_S00_AXI_DATA_WIDTH" -parent ${Page_0} -widget comboBox]
  set_property tooltip {Width of S_AXI data bus} ${C_S00_AXI_DATA_WIDTH}
  set C_S00_AXI_ADDR_WIDTH [ipgui::add_param $IPINST -name "C_S00_AXI_ADDR_WIDTH" -parent ${Page_0}]
  set_property tooltip {Width of S_AXI address bus} ${C_S00_AXI_ADDR_WIDTH}
  ipgui::add_param $IPINST -name "C_S00_AXI_BASEADDR" -parent ${Page_0}
  ipgui::add_param $IPINST -name "C_S00_AXI_HIGHADDR" -parent ${Page_0}
  ipgui::add_static_text $IPINST -name "IP Parameters" -parent ${Page_0} -text {

IP Parameters}
  ipgui::add_param $IPINST -name "Fvz" -parent ${Page_0}
  ipgui::add_param $IPINST -name "Ext_par" -parent ${Page_0}
  ipgui::add_static_text $IPINST -name "d-axis controller" -parent ${Page_0} -text {
d-axis controller}
  ipgui::add_param $IPINST -name "Kp_d" -parent ${Page_0}
  ipgui::add_param $IPINST -name "Ki_d" -parent ${Page_0}
  ipgui::add_static_text $IPINST -name "q-axis controller" -parent ${Page_0} -text {

q-axis controller}
  ipgui::add_param $IPINST -name "Kp_q" -parent ${Page_0}
  ipgui::add_param $IPINST -name "Ki_q" -parent ${Page_0}


}

proc update_PARAM_VALUE.Ki_d { PARAM_VALUE.Ki_d PARAM_VALUE.Ext_par } {
	# Procedure called to update Ki_d when any of the dependent parameters in the arguments change
	
	set Ki_d ${PARAM_VALUE.Ki_d}
	set Ext_par ${PARAM_VALUE.Ext_par}
	set values(Ext_par) [get_property value $Ext_par]
	if { [gen_USERPARAMETER_Ki_d_ENABLEMENT $values(Ext_par)] } {
		set_property enabled true $Ki_d
	} else {
		set_property enabled false $Ki_d
	}
}

proc validate_PARAM_VALUE.Ki_d { PARAM_VALUE.Ki_d } {
	# Procedure called to validate Ki_d
	return true
}

proc update_PARAM_VALUE.Ki_q { PARAM_VALUE.Ki_q PARAM_VALUE.Ext_par } {
	# Procedure called to update Ki_q when any of the dependent parameters in the arguments change
	
	set Ki_q ${PARAM_VALUE.Ki_q}
	set Ext_par ${PARAM_VALUE.Ext_par}
	set values(Ext_par) [get_property value $Ext_par]
	if { [gen_USERPARAMETER_Ki_q_ENABLEMENT $values(Ext_par)] } {
		set_property enabled true $Ki_q
	} else {
		set_property enabled false $Ki_q
	}
}

proc validate_PARAM_VALUE.Ki_q { PARAM_VALUE.Ki_q } {
	# Procedure called to validate Ki_q
	return true
}

proc update_PARAM_VALUE.Kp_d { PARAM_VALUE.Kp_d PARAM_VALUE.Ext_par } {
	# Procedure called to update Kp_d when any of the dependent parameters in the arguments change
	
	set Kp_d ${PARAM_VALUE.Kp_d}
	set Ext_par ${PARAM_VALUE.Ext_par}
	set values(Ext_par) [get_property value $Ext_par]
	if { [gen_USERPARAMETER_Kp_d_ENABLEMENT $values(Ext_par)] } {
		set_property enabled true $Kp_d
	} else {
		set_property enabled false $Kp_d
	}
}

proc validate_PARAM_VALUE.Kp_d { PARAM_VALUE.Kp_d } {
	# Procedure called to validate Kp_d
	return true
}

proc update_PARAM_VALUE.Kp_q { PARAM_VALUE.Kp_q PARAM_VALUE.Ext_par } {
	# Procedure called to update Kp_q when any of the dependent parameters in the arguments change
	
	set Kp_q ${PARAM_VALUE.Kp_q}
	set Ext_par ${PARAM_VALUE.Ext_par}
	set values(Ext_par) [get_property value $Ext_par]
	if { [gen_USERPARAMETER_Kp_q_ENABLEMENT $values(Ext_par)] } {
		set_property enabled true $Kp_q
	} else {
		set_property enabled false $Kp_q
	}
}

proc validate_PARAM_VALUE.Kp_q { PARAM_VALUE.Kp_q } {
	# Procedure called to validate Kp_q
	return true
}

proc update_PARAM_VALUE.Ext_par { PARAM_VALUE.Ext_par } {
	# Procedure called to update Ext_par when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.Ext_par { PARAM_VALUE.Ext_par } {
	# Procedure called to validate Ext_par
	return true
}

proc update_PARAM_VALUE.Fvz { PARAM_VALUE.Fvz } {
	# Procedure called to update Fvz when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.Fvz { PARAM_VALUE.Fvz } {
	# Procedure called to validate Fvz
	return true
}

proc update_PARAM_VALUE.C_S00_AXI_DATA_WIDTH { PARAM_VALUE.C_S00_AXI_DATA_WIDTH } {
	# Procedure called to update C_S00_AXI_DATA_WIDTH when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.C_S00_AXI_DATA_WIDTH { PARAM_VALUE.C_S00_AXI_DATA_WIDTH } {
	# Procedure called to validate C_S00_AXI_DATA_WIDTH
	return true
}

proc update_PARAM_VALUE.C_S00_AXI_ADDR_WIDTH { PARAM_VALUE.C_S00_AXI_ADDR_WIDTH } {
	# Procedure called to update C_S00_AXI_ADDR_WIDTH when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.C_S00_AXI_ADDR_WIDTH { PARAM_VALUE.C_S00_AXI_ADDR_WIDTH } {
	# Procedure called to validate C_S00_AXI_ADDR_WIDTH
	return true
}

proc update_PARAM_VALUE.C_S00_AXI_BASEADDR { PARAM_VALUE.C_S00_AXI_BASEADDR } {
	# Procedure called to update C_S00_AXI_BASEADDR when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.C_S00_AXI_BASEADDR { PARAM_VALUE.C_S00_AXI_BASEADDR } {
	# Procedure called to validate C_S00_AXI_BASEADDR
	return true
}

proc update_PARAM_VALUE.C_S00_AXI_HIGHADDR { PARAM_VALUE.C_S00_AXI_HIGHADDR } {
	# Procedure called to update C_S00_AXI_HIGHADDR when any of the dependent parameters in the arguments change
}

proc validate_PARAM_VALUE.C_S00_AXI_HIGHADDR { PARAM_VALUE.C_S00_AXI_HIGHADDR } {
	# Procedure called to validate C_S00_AXI_HIGHADDR
	return true
}


proc update_MODELPARAM_VALUE.C_S00_AXI_DATA_WIDTH { MODELPARAM_VALUE.C_S00_AXI_DATA_WIDTH PARAM_VALUE.C_S00_AXI_DATA_WIDTH } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.C_S00_AXI_DATA_WIDTH}] ${MODELPARAM_VALUE.C_S00_AXI_DATA_WIDTH}
}

proc update_MODELPARAM_VALUE.C_S00_AXI_ADDR_WIDTH { MODELPARAM_VALUE.C_S00_AXI_ADDR_WIDTH PARAM_VALUE.C_S00_AXI_ADDR_WIDTH } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.C_S00_AXI_ADDR_WIDTH}] ${MODELPARAM_VALUE.C_S00_AXI_ADDR_WIDTH}
}

proc update_MODELPARAM_VALUE.Fvz { MODELPARAM_VALUE.Fvz PARAM_VALUE.Fvz } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.Fvz}] ${MODELPARAM_VALUE.Fvz}
}

proc update_MODELPARAM_VALUE.Kp_d { MODELPARAM_VALUE.Kp_d PARAM_VALUE.Kp_d } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.Kp_d}] ${MODELPARAM_VALUE.Kp_d}
}

proc update_MODELPARAM_VALUE.Ki_d { MODELPARAM_VALUE.Ki_d PARAM_VALUE.Ki_d } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.Ki_d}] ${MODELPARAM_VALUE.Ki_d}
}

proc update_MODELPARAM_VALUE.Kp_q { MODELPARAM_VALUE.Kp_q PARAM_VALUE.Kp_q } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.Kp_q}] ${MODELPARAM_VALUE.Kp_q}
}

proc update_MODELPARAM_VALUE.Ki_q { MODELPARAM_VALUE.Ki_q PARAM_VALUE.Ki_q } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.Ki_q}] ${MODELPARAM_VALUE.Ki_q}
}

proc update_MODELPARAM_VALUE.Ext_par { MODELPARAM_VALUE.Ext_par PARAM_VALUE.Ext_par } {
	# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
	set_property value [get_property value ${PARAM_VALUE.Ext_par}] ${MODELPARAM_VALUE.Ext_par}
}

