public WatchingForm(App app) { InitializeComponent(); FormUtils.Init(this); this.app = app; this.watching = app.UserInfo.Watching; gvWards = splitContainer1.Panel1.Controls["gvWards"] as DataGridView; gvPatients = splitContainer1.Panel2.Controls["gvPatients"] as DataGridView; }
/// <summary> /// When a cluster node is added this class takes over the /// responsibility for watchees on that node already handled /// by base RemoteWatcher. /// </summary> private void TakeOverResponsibility(Address address) { foreach (var watching in Watching.Where(x => x.Item1.Path.Address.Equals(address)).ToList()) { var watchee = watching.Item1; var watcher = watching.Item2; ProcessUnwatchRemote(watchee, watcher); } }
private void Save() { using (WaitCursor wc = new WaitCursor()) { using (GmConnection conn = App.CreateConnection()) { int patientId = patient.Id; int wardId = patient.wardId; PatientTypeId patientTypeId = patient.patientTypeId; try { if (ucPassport.Save()) { passport.Save(conn); patient.passportId = passport.Id; } if (ucInsurance.Save()) { insurance.Save(conn); patient.insuranceId = insurance.Id; } if (ucPatientIdentification.Save()) { patientIdentification.Save(conn); patient.patientIdentificationId = patientIdentification.Id; } ucPatientData.Save(); ucPatientDescription.Save(); ucDiagnoses.Save(); } finally { if (patient.doctorId == 0) { patient.doctorId = App.Instance.UserId; } patient.Save(conn); ucPrescriptions.Save(conn); ucAnalyses.Save(conn); if (wardId != patient.wardId || patientTypeId != patient.patientTypeId) { patient.SaveWardHistory(conn); } if (patientId == 0 && App.Instance.UserInfo.HasWatching) { Watching watching = App.Instance.UserInfo.Watching; watching.AddPatient(patient.Id); watching.Save(conn); } } } } }
public override void DisplayTicket() { DisplayProgram.WriteLine("ID: " + Id); DisplayProgram.WriteLine("Summary: " + Summary); DisplayProgram.WriteLine("Status: " + Status); DisplayProgram.WriteLine("Priority: " + Priority); DisplayProgram.WriteLine("Submitter: " + Submitter); DisplayProgram.WriteLine("Assigned: " + Assigned); DisplayProgram.WriteLine("Watching: " + Watching.ToFormattedString()); DisplayProgram.WriteLine("Severity: " + Severity.ToString().Insert(Severity.ToString().Length - 1, " ")); }
public override void DisplayTicket() { DisplayProgram.WriteLine("ID: " + Id); DisplayProgram.WriteLine("Summary: " + Summary); DisplayProgram.WriteLine("Status: " + Status); DisplayProgram.WriteLine("Priority: " + Priority); DisplayProgram.WriteLine("Submitter: " + Submitter); DisplayProgram.WriteLine("Assigned: " + Assigned); DisplayProgram.WriteLine("Watching: " + Watching.ToFormattedString()); DisplayProgram.WriteLine("Project Name: " + ProjectName); DisplayProgram.WriteLine("Due Date: " + DueDate); }
public override void DisplayTicket() { DisplayProgram.WriteLine("ID: " + Id); DisplayProgram.WriteLine("Summary: " + Summary); DisplayProgram.WriteLine("Status: " + Status); DisplayProgram.WriteLine("Priority: " + Priority); DisplayProgram.WriteLine("Submitter: " + Submitter); DisplayProgram.WriteLine("Assigned: " + Assigned); DisplayProgram.WriteLine("Watching: " + Watching.ToFormattedString()); DisplayProgram.WriteLine("Software: " + Software); DisplayProgram.WriteLine("Cost: " + Cost); DisplayProgram.WriteLine("Reason: " + Reason); DisplayProgram.WriteLine("Estimate: " + Estimate); }
public WatchingConfirmationDto Create(WatchingCreateDto dto) { Watching newWatching = new Watching() { Id = Guid.NewGuid(), WatchedId = dto.WatchedId, WatcherId = dto.WatcherId }; _db.Watchings.Add(newWatching); _db.SaveChanges(); _logger.Log("Create Watching!"); return(_mapper.Map <WatchingConfirmationDto>(newWatching)); }
void Start() { wantList = wants.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); adj1List = adj1.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); adj2List = adj2.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); nounList = noun.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); aAList = aAdjectives.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); anAList = anAdjectives.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); artList = artistNouns.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); endAList = endAdjectives.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); couldList = could.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); snounList = snouns.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); decList = declare.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); askList = asking.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); quesList = question.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); stateList = statement.text.Split(separators, System.StringSplitOptions.RemoveEmptyEntries); var pm = FindObjectOfType <PlayerManager>(); dse = FindObjectOfType <Watching>(); Jones = pm.playerData.playerName; var ch = rdm.chains[dse.chain]; }
public WatchingTests() { var address = new ReceivingAddress( Guid.NewGuid(), TestAddress.Regtest1, true, new Collection <ReceivingAddressReservation>()); var reservation = new ReceivingAddressReservation(Guid.NewGuid(), address, DateTime.Now, null); address.Reservations.Add(reservation); this.rule = new Rule( new PropertyId(3), reservation, new PropertyAmount(100), 6, TimeSpan.FromHours(1), null); this.timer = new Timer(); this.subject = new Watching(this.rule, this.timer); }
public WatchingTests() { var address = new ReceivingAddress( Guid.NewGuid(), TestAddress.Regtest1, true, new Collection <ReceivingAddressReservation>()); var reservation = new ReceivingAddressReservation(Guid.NewGuid(), address, DateTime.Now, null); address.Reservations.Add(reservation); this.rule = new Rule( new PropertyId(3), reservation, new PropertyAmount(100), 6, TimeSpan.FromHours(1), "timeout", new Callback(Guid.NewGuid(), IPAddress.Loopback, DateTime.Now, false, new Uri("http://localhost"))); this.timer = new Timer(); this.subject = new Watching(this.rule, this.timer); }
//coordinate function, combining watching, approaching and threatening. private void coordinate(GameObject target, GameObject UAV) { GameObject blockLine = GameObject.Find ("Block Line"); GameObject threatenLine = GameObject.Find ("Threaten Line"); GameObject approachLine = GameObject.Find ("Approach Line"); GameObject watchLine = GameObject.Find ("Watch Line"); GameObject safeLine = GameObject.Find ("Safe Line"); float Ix = 12.0f; float Iy = 3.0f; float Iz = 4155.0f; float Tx = target.transform.position.x; //target's position float Ty = target.transform.position.y; float Tz = target.transform.position.z; float Ux = UAV.transform.position.x; //UAV's position float Uy = UAV.transform.position.y; float Uz = UAV.transform.position.z; float diffx = Tx - Ux; float diffy = Ty - Uy; float diffz = Tz - Uz; float blockL = Uz - blockLine.transform.position.z; float threatenL = Uz - threatenLine.transform.position.z; float approachL = Uz - approachLine.transform.position.z; float watchL = Uz - watchLine.transform.position.z; float safeL = Uz - safeLine.transform.position.z; float movement = 0.0f; float moveSpeed = 2.0f; float eyelevel = 1.5f; float watchStay = 2.0f; float dBetweenUandT = Mathf.Abs (diffz); if (dBetweenUandT > watchL && dBetweenUandT <= safeL) { // Debug.Log ("Above Eye Level"); if (Uy <= eyelevel) { movement = Time.deltaTime * moveSpeed; } else if (Uy > eyelevel && Uy <= watchStay) { movement = Time.deltaTime * moveSpeed; } else { movement = 0.0f; } UAV.transform.Translate (0, movement, 0, target.transform); }else if (dBetweenUandT > approachL && dBetweenUandT <= watchL) { Watching watchMS = new Watching (); watchMS.watchMS (target, UAV); }else if (dBetweenUandT > threatenL && dBetweenUandT <= approachL) { Approaching approachMS = new Approaching (); approachMS.approachMS (target, UAV); }else if (dBetweenUandT <= threatenL) { Threatening threatenMS = new Threatening (); block = threatenMS.threatenMS (target, UAV, block); // Debug.Log(block[target]); }else { StayInDoorRange stay = new StayInDoorRange(); if (stay.stayInDoorRange(Ux,Uy,Uz)){ float mX = Time.deltaTime * UnityEngine.Random.Range (-5.0F, 5.0F); float mY = Time.deltaTime * UnityEngine.Random.Range (-5.0F, 5.0F); float mZ = Time.deltaTime * UnityEngine.Random.Range (-5.0F, 5.0F); UAV.transform.Translate (mX, mY, 0, target.transform); } else { float mX = Time.deltaTime * (Ix - Ux) * 5.0f; float mY = Time.deltaTime * (Iy - Uy) * 5.0f; float mZ = Time.deltaTime * (Iz - Uz) * 5.0f; UAV.transform.Translate (mX, mY, 0, target.transform); } } }
public override string ToString() { return($"{Id},\"{Summary}\",{Status},{Priority},{Submitter},{Assigned},{Watching.ToDelimitedString('|')},{Severity}"); }
public void AddWatching(User watcher) { Watching.Add(watcher); }
public static bool CanSee(Watching bigBrother, Entity target) { return(true); }
public void Tracking(ActivityType activity, User user) { switch (activity) { case ActivityType.Reading: var reading = new Reading(); reading.TrackTimeSpendDoingActivity(); user.TotalHoursReading.Add(reading.TRackedTime.TotalSeconds); Console.WriteLine("What kind of book did you read"); reading.BookType = (BookType)menus.ShowReadingTypes(); var readlino = Console.ReadLine(); user.FavoriteTypeBook.Add(readlino); Console.WriteLine("And how many pages:"); reading.Pages = int.Parse(Console.ReadLine()); user.Activities.Add(reading); _userDb.UpdateUser(user); Console.WriteLine("Added..."); Console.ReadLine(); Console.Clear(); break; case ActivityType.Puzzles: var puzzles = new Puzzles(); puzzles.TrackTimeSpendDoingActivity(); user.TotalHoursPuzzles.Add(puzzles.TRackedTime.TotalSeconds); Console.WriteLine("What kind of Puzzle did you do?"); puzzles.PuzzlesType = (PuzzlesType)menus.ShowPuzzlesTypes(); var readlines = Console.ReadLine(); user.FavoriteTypePuzzle.Add(readlines); user.Activities.Add(puzzles); _userDb.UpdateUser(user); Console.WriteLine("Your information has been added to your statistics!"); Console.ReadLine(); Console.Clear(); break; case ActivityType.Watching: var watching = new Watching(); watching.TrackTimeSpendDoingActivity(); user.TotalHoursWatching.Add(watching.TRackedTime.TotalSeconds); Console.WriteLine("What were you watching?"); watching.WatchingType = (WatchingType)menus.ShowWatchingTypes(); var readline = Console.ReadLine(); user.FavoriteTypToWatch.Add(readline); user.Activities.Add(watching); _userDb.UpdateUser(user); Console.WriteLine("Your information has been added to your statistics!"); Console.Clear(); break; case ActivityType.OtherHobbies: var otherhobbies = new OtherHobbies(); otherhobbies.TrackTimeSpendDoingActivity(); user.TotalHoursOtherHobbies.Add(otherhobbies.TRackedTime.TotalSeconds); Console.WriteLine("Please enter what hobby were you doing"); otherhobbies.Hobby = Console.ReadLine(); user.Activities.Add(otherhobbies); _userDb.UpdateUser(user); Console.WriteLine("Your information has been added to your statistics!"); Console.ReadLine(); Console.Clear(); break; default: break; } }
static void Main(string[] args) { Factory.RegisterAll(); if (args.Contains("--usage")) { Console.WriteLine("Usage:"); Console.WriteLine($" {System.AppDomain.CurrentDomain.FriendlyName} [<.rox file name>] run the program"); Console.WriteLine($" {System.AppDomain.CurrentDomain.FriendlyName} --usage show this help"); return; } string dbfn; if (args.Length < 1) { dbfn = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "default.rox"); Console.WriteLine($".rox file not provided, using default ({dbfn})."); } else { dbfn = args[0]; } var dbExists = System.IO.File.Exists(dbfn); _repo = new Repo(); if (dbExists) { using (var fs = new FileStream(dbfn, FileMode.Open)) { using (var br = new BinaryReader(fs)) { _repo.Deserialize(br); } } } var watching = new Watching(_repo); bool quit = false; while (!quit) { Console.Write("Command>"); var rl = Console.ReadLine().Trim().ToLower(); switch (rl) { case "add": case "a": Add(); break; case "remove": case "r": Remove(); break; case "list": case "l": List(); break; case "help": case "h": Console.WriteLine("a[dd]: add file with tags;"); Console.WriteLine("r[emove]: remove tags from file;"); Console.WriteLine("l[ist]: list files;"); Console.WriteLine("q[uit]: quit the program and save to db."); Console.WriteLine("h[elp]: show show help."); break; case "quit": case "q": quit = true; break; } } using (var fs = new FileStream(dbfn, FileMode.Create)) { using (var br = new BinaryWriter(fs)) { _repo.Serialize(br); } } }