// Use this for initialization void Start() { audioSync = GetComponent <Audio_Sync>(); variablesScript = GetComponent <variables>(); playerGUIScript = GetComponent <Player_GUI>(); //fireDelay = variablesScript.fireDelay; }
private string GetAliasesParent(string parent) { variables var = lstWilayah.FirstOrDefault(x => x.Code == parent); if (var != null) { parent = var.Value; } //if (parent == "UTR") //{ // parent = "UTARA"; //} //else if (parent == "TMR") //{ // parent = "TIMUR"; //} //else if (parent == "TGH") //{ // parent = "TENGAH"; //} //else if (parent == "SEL") //{ // parent = "SELATAN"; //} return(parent); }
public ActionResult IndexCustomers(int value) { var Varaiable = new variables() { }; var Customer = _context.Customers.Include(c => c.MembershipType).ToList(); foreach (var i in Customer) { if (value == i.id) { Varaiable = new variables() { Name = i.Name, id = i.MembershipTypeId }; } } var viewModel = new ProductViewModel { variables = Varaiable, customer = Customer }; return(View(viewModel)); }
public ActionResult Index(int value) { var Varaiable = new variables() { }; var Product = _context.Products.ToList(); foreach (var i in Product) { if (value == i.Id) { Varaiable = new variables() { id = i.Id }; } } var viewModel = new ProductViewModel { variables = Varaiable, product = Product }; return(View(viewModel)); }
private void textBox1_TextChanged(object sender, EventArgs e) { if (var == null) { var = new variables(); } textBox2.Text = var.Design; }
private void LoadWilayah(string negeri) { variables variables = VariablesRepo.GetVariableByType("NEGERI").FirstOrDefault(x => x.Code == negeri); if (variables != null) { lblwilayah.Text = GetAliasesParent(variables.Parent); } }
void IXmlSerializable.WriteXml(XmlWriter writer) { XmlSerializer variablesSerializer = Serializers.variablesSerialier(); XmlSerializer queryInfoSerializer = Serializers.queryInfoSerializer(); queryInfoSerializer.Serialize(writer, responseObject.queryInfo); variables v = new variables(); v.variable = responseObject.variables; variablesSerializer.Serialize(writer, v); // XmlAttributeOverrides attrOverrides = //new XmlAttributeOverrides(); /* Orginal attempt. This adds a double element * <variablesResponse><variablesResponse><variable>content</variable><variable>... * */ //XmlWriterSettings settings = new XmlWriterSettings(); //variablesResponseSerializer.Serialize(writer, responseObject); /* second attempt. * <variablesResponse><variablesResponse><variable>content</variable><variable>... * */ //StringBuilder sb = new StringBuilder(); //XmlWriterSettings setting = new XmlWriterSettings(); //setting.OmitXmlDeclaration = true; //setting.ConformanceLevel = ConformanceLevel.Auto; //XmlWriter aWriter = XmlWriter.Create(sb, setting); //queryInfoSerializer.Serialize(aWriter, responseObject.queryInfo, ns); //aWriter.Close(); //writer.WriteRaw(sb.ToString()); //writer.Flush(); //aWriter = XmlWriter.Create(sb, setting); //sb.Remove(0, sb.Length); ////writer.WriteStartElement("variables"); ////foreach (object o in responseObject.variables) ////{ //// variableSerializer.Serialize(aWriter, o, ns); ////} ////writer.WriteRaw(sb.ToString()); ////writer.WriteEndElement(); //variablesSerializer.Serialize(aWriter, responseObject.variables, ns); //writer.WriteRaw(sb.ToString()); //queryInfoSerializer.Serialize(writer, responseObject.queryInfo, ns); //variables v = new variables(); //v.variable = responseObject.variables; //variablesSerializer.Serialize(writer, v , ns); }
// Use this for initialization void Start() { //if (isLocalPlayer) { variablesScript = GetComponent <variables>(); playerBoostScript = GetComponent <Player_Boost>(); playerDeathScript = GetComponent <Player_Death>(); playerRespawnScript = GetComponent <Player_Respawn>(); playerFireScript = GetComponent <Player_Fire>(); playerHealthScript = GetComponent <Player_Health>(); playerIDScript = GetComponent <Player_ID>(); shipControlScript = GetComponent <ShipControl>(); playerEngineScript = GetComponent <Player_Engine>(); playerSpotlightScript = GetComponent <Player_Spotlight>(); playerNetworkSetup = GetComponent <Player_NetworkSetup>(); if (isLocalPlayer) { playerType = PlayerPrefs.GetString("ShipType"); //print("Setting player type to: " + playerType); if (playerType != "Large" && playerType != "Medium" && playerType != "Small") { playerType = "Medium"; } if (playerType == "Small") { Cmd_EnableSmallShip(); } else if (playerType == "Medium") { Cmd_EnableMediumShip(); } else if (playerType == "Large") { Cmd_EnableLargeShip(); } CmdTellServerMyShip(playerType); } /* * if (!isLocalPlayer) { * if (playerTypeGlobal == "Small") { * Cmd_EnableSmallShip(); * } * else if (playerTypeGlobal == "Medium") { * Cmd_EnableMediumShip(); * } * else if (playerTypeGlobal == "Large") { * Cmd_EnableLargeShip(); * } * } */ }
// Use this for initialization void Start() { audioSync = GetComponent <Audio_Sync>(); playerPauseScirpt = GetComponent <Player_Pause>(); //engineParent = transform.Find("Engines").gameObject; healthScript = GetComponent <Player_Health>(); variablesScript = GetComponent <variables>(); playerChatScript = GetComponent <Player_Chat>(); playerIDScript = GetComponent <Player_ID>(); healthScript.EventDie += DisablePlayer; //Subscribes it to the EventDie }
// Use this for initialization void Start() { playerNetworkSetup = GetComponent <Player_NetworkSetup>(); playerParentScript = GetComponent <Player_Parent>(); //engineParent = transform.Find ("Engines").gameObject; variablesScript = GetComponent <variables>(); healthScript = GetComponent <Player_Health>(); shipControlScript = GetComponent <ShipControl>(); playerButtonsScript = GetComponent <Player_Buttons>(); healthScript.EventRespawn += EnablePlayer; //Subscribe to event SetRespawnButton(); }
public ActionResult RandomHome() { var Variable = new variables() { Name = "Jeevitha Sakthi" }; var viewModel = new ProductViewModel { variables = Variable, }; return(View(viewModel)); }
// Use this for initialization void Start() { variablesScript = targetGameObject.GetComponent <variables>(); playerCameraAnimator = playerCamera.GetComponent <Animator>(); //whiteFlash = GameObject.Find("WhiteFlash").GetComponent<Image>(); //whiteFlash.color = redColor; playerCameraAnimator.SetTrigger("SceneStart"); randomRot = new Vector3(Random.Range(5F, 10F), Random.Range(5F, 10F), Random.Range(5F, 10F)); playerCamera.transform.localPosition = offsetPosBack; //Set how far back the player camera is initially from the ship wantedPos = offsetPosBack; }
private string GenerateRefNo(string negeri) { string refno_new = ""; variables variables = VariablesRepo.GetBy(negeri); refno_new = @"TBSPK/" + variables.Parent + "/"; //int maxappinfo = AppInfoRepo.GetMaxAppInfoBy(refno_new); int maxappinfo = AppInfoRepo.GetMaxAppInfoBy(); refno_new = refno_new + maxappinfo.ToString().PadLeft(5, '0'); return(refno_new); }
private void cbnegeri_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cbx = (ComboBox)sender; if (cbx.SelectedValue != null) { LoadDaerah(cbx.SelectedValue.ToString()); LoadDun(cbx.SelectedValue.ToString()); LoadParlimen(cbx.SelectedValue.ToString()); variables variables = VariablesRepo.GetVariableByType("NEGERI").FirstOrDefault(x => x.Code == cbx.SelectedValue.ToString()); if (variables != null) { lblWilayah.Text = GetAliasesParent(variables.Parent); } } }
public bool open(PRODUCT_ID prod_id = PRODUCT_ID.T825, String serial = "") { init_defaults(); try { UsbDeviceFinder MyUsbFinder = new UsbDeviceFinder(TIC_VENDOR_ID, (int)prod_id, serial); // Find and open the usb device. MyUsbDevice = UsbDevice.OpenUsbDevice(MyUsbFinder); // If the device is open and ready if (MyUsbDevice == null || (serial != "" && MyUsbDevice.Info.SerialString != serial)) { throw new Exception("Device Not Found."); } // If this is a "whole" usb device (libusb-win32, linux libusb) // it will have an IUsbDevice interface. If not (WinUSB) the // variable will be null indicating this is an interface of a // device. IUsbDevice wholeUsbDevice = MyUsbDevice as IUsbDevice; if (!ReferenceEquals(wholeUsbDevice, null)) { // This is a "whole" USB device. Before it can be used, // the desired configuration and interface must be selected. // Select config #1 wholeUsbDevice.SetConfiguration(1); // Claim interface #0. wholeUsbDevice.ClaimInterface(0); } product_id = prod_id; vars = new variables(); status_vars = new status_variables(); return(true); } catch (Exception ex) { MyUsbDevice = null; throw new Exception("Device Not Found.", ex); } }
// Use this for initialization void Start() { variablesScript = GetComponent <variables>(); boostScript = GetComponent <Player_Boost>(); rb = GetComponent <Rigidbody>(); //maxSpeed = variablesScript.maxSpeed; speed = maxSpeed; //Screen.lockCursor = true; mousePos = Input.mousePosition; mouseLastPos = Input.mousePosition; Screen.lockCursor = true; rotationX = MainShip.transform.rotation.x; rotationX = MainShip.transform.rotation.y; }
// Use this for initialization void Start() { variablesScript = GetComponent <variables>(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager_References>(); pauseButton = gameManager.pauseButton; resumeButton = gameManager.resumeButton; exitButton = gameManager.exitButton; volumeSlider = gameManager.volumeSlider; if (isLocalPlayer) { //Add the listeners to the buttons pauseButton.GetComponent <Button>().onClick.AddListener(Pause); resumeButton.GetComponent <Button>().onClick.AddListener(Resume); exitButton.GetComponent <Button>().onClick.AddListener(Exit); } }
public static string GenerateRefNo(string negeri, IDbTransaction mySqlTrans) { IVariablesRepo VariablesRepo = new VariablesRepo(); IAppInfoRepo AppInfoRepo = new AppInfoRepo(); string refno_new = ""; variables variables = VariablesRepo.GetBy(negeri); refno_new = @"TBSPK/" + variables.Parent + "/"; //int maxappinfo = AppInfoRepo.GetMaxRefNoMySQL(refno_new, mySqlTrans); int maxappinfo = AppInfoRepo.GetMaxRefNoMySQL(mySqlTrans); refno_new = refno_new + maxappinfo.ToString().PadLeft(5, '0'); return(refno_new); }
private void BindMaklumatPemohon(int appinfo_id) { appinfo appinfo = AppInfoRepo.GetBy(appinfo_id); if (appinfo == null) { appinfo = new appinfo(); } lblappdate.Text = appinfo.appdate; lblnama.Text = appinfo.nama; lblbangsa.Text = appinfo.bangsa; lbladdr1.Text = appinfo.addr1; lbladdr2.Text = appinfo.addr2; lbladdr3.Text = appinfo.addr3; lblnegeri.Text = ""; variables varNegeri = VariablesRepo.GetNegeri("negeri", appinfo.negeri); if (varNegeri != null) { lblnegeri.Text = varNegeri.Value; } tdaerah daerah = new DaerahRepo().GetBy(appinfo.daerah); string sdaerah = ""; if (daerah != null) { sdaerah = daerah.daerah; } parlimen parlimen = new ParlimenRepo().GetBy(appinfo.parlimen); string sparlimen = ""; if (parlimen != null) { sparlimen = parlimen.Kawasan; } lbldaerah.Text = sdaerah + " / " + sparlimen; lblnokp.Text = appinfo.icno; lblnolesen.Text = appinfo.nolesen; lblbandar.Text = appinfo.bandar; lblposkod.Text = appinfo.poskod; LoadWilayah(appinfo.negeri); }
// Use this for initialization void Start() { healthText = GameObject.Find("Health Text").GetComponent <Text> (); healthBar = GameObject.Find("Health Bar").GetComponent <Image>(); playerGUIScript = GetComponent <Player_GUI>(); variablesScript = GetComponent <variables>(); playerGUIScript.SetHealthText(); randomSpin = new Vector3(Random.Range(20F, 40F), Random.Range(20F, 40F), Random.Range(20F, 40F)); health = maxHealth; /* * if (isLocalPlayer) { * healthText.text = health + ""; * healthBar.fillAmount = 1; * } */ }
// Use this for initialization void Start() { //Get references to other scripts on the player's gameobject variablesScript = GetComponent <variables>(); gameManager = GameObject.Find("GameManager"); chatManager = gameManager.GetComponent <Chat_Manager>(); chatInput = gameManager.GetComponent <GameManager_References>().chatInput.GetComponent <InputField>(); playerIDScript = GetComponent <Player_ID>(); if (isLocalPlayer) //If its the local player //Get the chat send button from the references stored in the GameManager { chatSend = gameManager.GetComponent <GameManager_References>().chatSendButton.GetComponent <Button>(); chatSend.onClick.AddListener(SendChat); //Add a listener to that button //Add listeners to the inputbox for the chat chatInput.onValueChanged.AddListener(Typing); chatInput.onEndEdit.AddListener(ExitEditing); } }
// Use this for initialization void Start() { playerHealthScript = GetComponent <Player_Health>(); variablesScript = GetComponent <variables>(); playerFireScript = GetComponent <Player_Fire>(); playerBoostScript = GetComponent <Player_Boost>(); healthText = GameObject.Find("Health Text").GetComponent <Text> (); healthBar = GameObject.Find("Health Bar").GetComponent <Image>(); fireText = GameObject.Find("Fire Text").GetComponent <Text>(); fireBar = GameObject.Find("Fire Bar").GetComponent <Image>(); specialText = GameObject.Find("Special Text").GetComponent <Text>(); specialBar = GameObject.Find("Special Bar").GetComponent <Image>(); boostText = GameObject.Find("Boost Text").GetComponent <Text>(); boostBar = GameObject.Find("Boost Bar").GetComponent <Image>(); healthText.text = playerHealthScript.health.ToString(); healthBar.fillAmount = 1; }
public override Tensor[] get_updates(Tensor loss, variables @params) { throw new NotImplementedException(); }
void start() { script = result.GetComponent <variables> (); //mesa sto script vazoume to script pou einai sto //result to opoio onomazetai variable }
public virtual Tensor[] get_gradients(Tensor loss, variables @params) => throw new NotImplementedException();
public virtual Tensor[] get_updates(Tensor loss, variables @params) { return(null); }
static void Main(string[] args) { variables r = new variables(); //good one }
public override bool calibCrossing(int Port, bosainfo _bosainfo, testinginfo _testinfo, variables _var) { throw new NotImplementedException(); }
public override bool verifySignal(int Port, bosainfo _bosainfo, testinginfo _testinfo, variables _var) { try { bool _result = false; _testinfo.VERIFYSIGNALRESULT = Parameters.testStatus.Wait.ToString(); _testinfo.SYSTEMLOG += "--------------------------------------------------------------\r\n"; _testinfo.SYSTEMLOG += "STEP 6: VERIFY SIGNAL\r\n"; base.WriteLine("echo GPON_pattern >/proc/pon_phy/debug"); Thread.Sleep(Delay_modem); _var.Pwr_temp = Convert.ToDouble(GlobalData.powerDevice.getPower_dBm(Port)); _var.ER_temp = Convert.ToDouble(GlobalData.erDevice.getER(Port)); _testinfo.SYSTEMLOG += "ER_temp = " + _var.ER_temp + "\r\n"; _testinfo.SYSTEMLOG += "Power_temp = " + _var.Pwr_temp + "\r\n"; if (_var.Pwr_temp > 2 && _var.Pwr_temp < 3 && _var.ER_temp > 11.5 && _var.ER_temp < 13.5) { _result = true; } else { _result = false; } if (_result == false) { _testinfo.ERRORCODE = "(Mã Lỗi: COT-VS-0001)"; } _testinfo.SYSTEMLOG += _result == true ? "Verify Signal: PASS.\r\n" : string.Format("Verify Signal: FAIL. {0}\r\n", _testinfo.ERRORCODE); _testinfo.VERIFYSIGNALRESULT = _result == true?Parameters.testStatus.PASS.ToString() : Parameters.testStatus.FAIL.ToString(); return(_result); } catch (Exception ex) { _testinfo.ERRORCODE = "(Mã Lỗi: COT-VS-0002)"; _testinfo.SYSTEMLOG += string.Format("{0}, {1}\r\n", _testinfo.ERRORCODE, ex.ToString()); _testinfo.VERIFYSIGNALRESULT = Parameters.testStatus.FAIL.ToString(); return(false); } }
public override bool txDDMI(int Port, bosainfo _bosainfo, testinginfo _testinfo, variables _var) { try { bool _result = false; _testinfo.TXDDMIRESULT = Parameters.testStatus.Wait.ToString(); _testinfo.SYSTEMLOG += "--------------------------------------------------------------\r\n"; _testinfo.SYSTEMLOG += "STEP 3: TX DDMI\r\n"; _var.Pwr_temp = Convert.ToDouble(GlobalData.powerDevice.getPower_dBm(Port)); _testinfo.SYSTEMLOG += "Pwr_temp = " + _var.Pwr_temp + "\r\n"; base.WriteLine("echo set_flash_register_default >/proc/pon_phy/debug"); Thread.Sleep(Delay_modem); base.WriteLine("echo set_flash_register_Tx_data >/proc/pon_phy/debug"); Thread.Sleep(Delay_modem); string RR; string RR_DAC; RR = (Math.Round(Math.Pow(10, (_var.Pwr_temp / 10)) * 100)).ToString(); RR_DAC = int.Parse(RR).ToString("X"); base.WriteLine("echo set_flash_register_DDMI_TxPower 0x00" + RR_DAC + " 0x40 >/proc/pon_phy/debug"); Thread.Sleep(Delay_modem); string str = base.Read(); base.WriteLine("echo DDMI_check_8472 >/proc/pon_phy/debug"); Thread.Sleep(Delay_modem); str = base.Read(); for (int n = 0; n < str.Split('\n').Length; n++) { if (str.Split('\n')[n].Contains("Tx power")) { _var.TX_Power_DDMI = str.Split('\n')[n].Split('=')[1].TrimEnd(); _var.TX_Power_DDMI = (10 * Math.Log10(Convert.ToDouble(_var.TX_Power_DDMI) / 10000)).ToString("0.##"); _testinfo.SYSTEMLOG += "TX_Power_DDMI = " + _var.TX_Power_DDMI.ToString() + " dBm\r\n"; if (Convert.ToDouble(_var.TX_Power_DDMI) > (_var.Pwr_temp - 0.5) && Convert.ToDouble(_var.TX_Power_DDMI) < (_var.Pwr_temp + 0.5)) { _result = true; } else { _result = false; } } } if (_result == false) { _testinfo.ERRORCODE = "(Mã Lỗi: COT-MI-0001)"; } _testinfo.SYSTEMLOG += _result == true ? "Check Power DDMI: PASS.\r\n" : string.Format("Check Power DDMI: FAIL. {0}\r\n", _testinfo.ERRORCODE); _testinfo.TXDDMIRESULT = _result == true?Parameters.testStatus.PASS.ToString() : Parameters.testStatus.FAIL.ToString(); return(_result); } catch (Exception ex) { _testinfo.ERRORCODE = "(Mã Lỗi: COT-MI-0002)"; _testinfo.SYSTEMLOG += string.Format("{0}, {1}\r\n", _testinfo.ERRORCODE, ex.ToString()); _testinfo.TXDDMIRESULT = Parameters.testStatus.FAIL.ToString(); return(false); } }