/** * Descrever aqui o que esse método realiza. */ public void displayGraph(string label, Vector2 val) { GameObject go = Instantiate(labelPrefab) as GameObject; go.transform.localPosition = new Vector3(0f, 0f, 0f); go.transform.SetParent(transform, false); var scriptInitial = go.GetComponentInChildren <SetInitialX>(); var scriptFinal = go.GetComponentInChildren <SetFinalX>(); var labelName = go.GetComponentInChildren <TextMesh>(); var dbPrfObject = go.GetComponentInChildren <SetLabelPhysio>(); scriptInitial.InitialX = val.x; scriptFinal.FinalX = val.y; scriptInitial.Set(); scriptFinal.Set(); labelName.text = label; PontosRotuloFisioterapeuta.Insert(GlobalController.instance.movement.idMovimento, label, val.x, val.y); List <PontosRotuloFisioterapeuta> allPrf = PontosRotuloFisioterapeuta.Read(); dbPrfObject.Prf = allPrf[allPrf.Count - 1]; }
public static void DeleteMovement() { int IdMovimento = GlobalController.instance.movement.idMovimento; List <Exercicio> allExercises = Exercicio.Read(); List <PontosRotuloFisioterapeuta> allPrfs = PontosRotuloFisioterapeuta.Read(); List <PontosRotuloPaciente> allPrps = PontosRotuloPaciente.Read(); List <MovimentoMusculo> mm = MovimentoMusculo.Read(); foreach (var prf in allPrfs) { if (prf.idMovimento == IdMovimento) { PontosRotuloFisioterapeuta.DeleteValue(prf.idRotuloFisioterapeuta); } } foreach (var ex in allExercises) { if (ex.idMovimento == IdMovimento) { foreach (var prp in allPrps) { if (prp.idExercicio == ex.idExercicio) { PontosRotuloPaciente.DeleteValue(prp.idRotuloPaciente); } } string pathEx = string.Format("{0}/Exercicios/{1}", Application.dataPath, ex.pontosExercicio); if (File.Exists(pathEx)) { File.Delete(pathEx); } Exercicio.DeleteValue(ex.idExercicio); } } foreach (var m in mm) { if (m.idMovimento == IdMovimento) { MovimentoMusculo.DeleteValue(m.idMovimento, m.idMusculo); } } string pathMov = string.Format("{0}/Movimentos/{1}", Application.dataPath, GlobalController.instance.movement.pontosMovimento); if (File.Exists(pathMov)) { File.Delete(pathMov); } Movimento.DeleteValue(IdMovimento); Flow.StaticMovements(); }
public void Awake() { if (GlobalController.instance.movement != null) { List <PontosRotuloFisioterapeuta> prfs = PontosRotuloFisioterapeuta.Read(); foreach (var prf in prfs) { if (prf.idMovimento == GlobalController.instance.movement.idMovimento) { ButtonSpawner(prf); } } } }
public static void TestPhysiotherapistLabelPointsRead() { using (var conn = new SqliteConnection(GlobalController.path)) { conn.Open(); Pessoa.Insert("physio name1", "m", "1995-01-04", "6198732714", null); Pessoa.Insert("physio name2", "m", "1995-01-05", "6198732715", null); Pessoa.Insert("physio name3", "m", "1995-01-06", "6198732716", null); Fisioterapeuta.Insert(1, "abracadabra1", "demais1", null, null); Fisioterapeuta.Insert(2, "abracadabra2", "demais2", null, null); Fisioterapeuta.Insert(3, "abracadabra3", "demais3", null, null); Movimento.Insert(1, "Movimento1", "Musculo Redondo Maior", null); Movimento.Insert(2, "Movimento2", "Musculo Redondo Maior", "Dificuldade nesse local"); Movimento.Insert(3, "Movimento3", "Musculo Redondo Maior", "Melhora nesse local"); PontosRotuloFisioterapeuta.Insert(1, "Mediano1", 14.00f, 15.00f); PontosRotuloFisioterapeuta.Insert(2, "Mediano2", 15.00f, 16.00f); PontosRotuloFisioterapeuta.Insert(3, "Mediano3", 16.00f, 17.00f); List <PontosRotuloFisioterapeuta> allPhysioLabelPoints = PontosRotuloFisioterapeuta.Read(); for (int i = 0; i < allPhysioLabelPoints.Count; ++i) { Assert.AreEqual(allPhysioLabelPoints[i].moves.idMovimento, i + 1); Assert.AreEqual(allPhysioLabelPoints[i].moves.nomeMovimento, string.Format("Movimento{0}", (i + 1))); Assert.AreEqual(allPhysioLabelPoints[i].moves.pontosMovimento, "Musculo Redondo Maior"); Assert.AreEqual(allPhysioLabelPoints[i].idRotuloFisioterapeuta, i + 1); Assert.AreEqual(allPhysioLabelPoints[i].estagioMovimentoFisio, string.Format("Mediano{0}", i + 1)); Assert.AreEqual(allPhysioLabelPoints[i].tempoInicial, 14.00f + i); Assert.AreEqual(allPhysioLabelPoints[i].tempoFinal, 15.00f + i); } conn.Dispose(); conn.Close(); } return; }
public static void RealtimeGraphUDPPhysiorotular() { RealtimeGraphUDPPatientCancelardeletarRotulo(); var script = GameObject.Find("/Grafico").GetComponent <CreateLabelPatient>(); bool notregistered = true; var prps = PontosRotuloFisioterapeuta.Read(); foreach (var prp in prps) { if (prp.estagioMovimentoFisio == "Label Fisio Test") { notregistered = false; } } if (notregistered) { script.displayGraph("Label Fisio Test", new Vector2(1f, 4f)); } }
public static void DeletePhysiotherapist() { int IdFisioterapeuta = GlobalController.instance.admin.idFisioterapeuta; int IdPessoa = GlobalController.instance.admin.persona.idPessoa; string nomePessoa = (GlobalController.instance.admin.persona.nomePessoa).Replace(' ', '_'); string nomePasta = string.Format("{0}/Movimentos/{1}-{2}", Application.dataPath, IdPessoa, nomePessoa); List <Movimento> allMovements = Movimento.Read(); List <Sessao> allSessions = Sessao.Read(); List <PontosRotuloFisioterapeuta> allPRF = PontosRotuloFisioterapeuta.Read(); List <Exercicio> allExercises = Exercicio.Read(); List <MovimentoMusculo> allMovMuscles = MovimentoMusculo.Read(); foreach (var movements in allMovements) { if (movements.idFisioterapeuta == IdFisioterapeuta) { foreach (var prf in allPRF) { if (prf.idMovimento == movements.idMovimento) { PontosRotuloFisioterapeuta.DeleteValue(prf.idRotuloFisioterapeuta); } } foreach (var mvm in allMovMuscles) { if (mvm.idMovimento == movements.idMovimento) { MovimentoMusculo.DeleteValue(mvm.idMovimento, mvm.idMusculo); } } foreach (var execises in allExercises) { if (execises.idMovimento == movements.idMovimento) { Exercicio.DeleteValue(execises.idExercicio); } } Movimento.DeleteValue(movements.idMovimento); } } foreach (var session in allSessions) { if (session.idPaciente == IdFisioterapeuta) { Sessao.DeleteValue(session.idSessao); } } Fisioterapeuta.DeleteValue(IdFisioterapeuta); if (Directory.Exists(nomePasta)) { Directory.Delete(nomePasta, true); } Flow.StaticNewPhysiotherapist(); }
public static IEnumerator TestDeleteMovement() { Flow.StaticLogin(); yield return(new WaitForSeconds(1f)); Pessoa.Insert("physio name1", "m", "1995-01-01", "6198732711", null); Fisioterapeuta.Insert(1, "abracadabra1", "demais1", null, null); var fisio = Fisioterapeuta.GetLast(); GlobalController.instance.admin = fisio; Flow.StaticNewMovement(); yield return(new WaitForSeconds(1f)); var moveManager = GameObject.Find("/New Movement Manager").GetComponentInChildren <createMovement>(); InputField aux = (InputField)moveManager.GetMemberValue("nomeMovimento"); aux.text = "Fake Name"; moveManager.SetMemberValue("nomeMovimento", aux); InputField aux1 = (InputField)moveManager.GetMemberValue("musculos"); aux1.text = "Deltoide"; moveManager.SetMemberValue("musculos", aux1); InputField aux3 = (InputField)moveManager.GetMemberValue("descricao"); aux3.text = "Ahaha seloco"; moveManager.SetMemberValue("descricao", aux3); moveManager.saveMovement(); var device = @"^(.*?(\bDevice|SDK\b)[^$]*)$"; Regex rgx1 = new Regex(device, RegexOptions.IgnoreCase); LogAssert.Expect(LogType.Error, rgx1); yield return(new WaitForSeconds(1f)); DeleteMovementButton.DeleteMovement(); yield return(new WaitForSeconds(0.5f)); int IdMovimento = GlobalController.instance.movement.idMovimento; var prfs = PontosRotuloFisioterapeuta.Read(); foreach (var prf in prfs) { Assert.AreNotEqual(prf.idMovimento, IdMovimento); } var exers = Exercicio.Read(); foreach (var exer in exers) { Assert.AreNotEqual(exer.idMovimento, IdMovimento); } var mms = MovimentoMusculo.Read(); foreach (var mm in mms) { Assert.AreNotEqual(mm.idMovimento, IdMovimento); } var movements = Movimento.Read(); foreach (var movement in movements) { Assert.AreNotEqual(movement.idMovimento, IdMovimento); } string pathMov = string.Format("{0}/Movimentos/{1}", Application.dataPath, GlobalController.instance.movement.pontosMovimento); bool dir = System.IO.File.Exists(pathMov); Assert.AreEqual(dir, false); }