/// <summary> /// Sets the value of the <c><ContactSequenceSource></c> element. /// </summary> /// <param name="val">A SourceOfCode object</param> /// <remarks> /// <para>The SIF specification defines the meaning of this element as: "Indicates the person who provided the contact sequence order. CBDS: 100221"</para> /// <para>Version: 2.6</para> /// <para>Since: 2.0</para> /// </remarks> public void SetContactSequenceSource(SourceOfCode val) { SetField(LearnerDTD.LEARNERCONTACT_CONTACTSEQUENCESOURCE, val); }
/// <summary> /// Tworzy nowy proces bez uruchamiania go (stan procesu = New) /// </summary> /// <param name="Name_">Nazwa procesu, musi być unikalna</param> /// <param name="ProgramFilePath">Ścieżka do pliku z programem (z której zostanie wczytany kod programu)</param> /// <remarks>Utworzenie procesu - XC</remarks> public PCB(string Name_, int Priority, string ProgramFilePath, SourceOfCode Source = SourceOfCode.WindowsDisc) { //Wczytaj program string Program; this.Source = Source; if (Source == SourceOfCode.WindowsDisc) { try { Program = System.IO.File.ReadAllText(ProgramFilePath); } catch { Console.WriteLine("Nie udalo sie utworzyc procesu: w Windows nie znaleziono pliku o nazwie " + ProgramFilePath); State = ProcessState.Terminated; return; } } else { Program = FileSystem.Disc.GetDisc.GetFileData(ProgramFilePath); if (Program == null) { Console.WriteLine("Nie udalo sie utworzyc procesu: na dysku systemu nie znaleziono pliku o nazwie " + ProgramFilePath); State = ProcessState.Terminated; return; } } //Nazwa procesu if (IsProcessNameUsed(Name_)) { int i = 1; while (IsProcessNameUsed(Name_ + i.ToString())) { i++; } Name = Name_ + i.ToString(); Console.WriteLine("Podana nazwa [" + Name_ + "] jest juz uzywana, proces otrzymal nazwe " + Name + "."); } else { Name = Name_; Console.WriteLine("Proces otrzymal nazwe " + Name + "."); } //Utwórz PCB _PID = ++_NextPID; if (Priority < 0 || Priority > 7) { Console.WriteLine("Priorytet musi miescic sie w zakresie 0 - 7. Proces otrzymal priorytet 7."); CurrentPriority = 7; StartPriority = 7; } else { CurrentPriority = Priority; StartPriority = Priority; } State = ProcessState.New; Memory.GetInstance.AllocateMemory(this, Program); _CreatedPCBs.AddLast(this); Console.WriteLine("Utworzono proces: " + this.ToString()); }