Class Unit
- Namespace
- XENBIT.ResQueServe.Core.Models
- Assembly
- RQS.Core.dll
public record Unit : IUnit, IUnitInfo, IShelf, IEquatable<Unit>
- Inheritance
-
Unit
- Implements
- Inherited Members
Properties
Callsign
The (long) callsign of the unit.
public required string Callsign { get; set; }
Property Value
CallsignGps
The callsign displayed on maps if IsEquippedWithGps is set to true.
public string? CallsignGps { get; set; }
Property Value
CallsignShort
A short callsign variant of the unit.
public required string CallsignShort { get; set; }
Property Value
CallsignVerbal
The verbal callsign of the unit.
public string? CallsignVerbal { get; set; }
Property Value
Category
The category of the unit. By setting a value to CategoryOverride, this can be cosmetically overridden.
public UnitCategory Category { get; set; }
Property Value
CategoryOverride
The overridden category of the unit.
public string? CategoryOverride { get; set; }
Property Value
DispatchGroups
The dispatch groups associated with the unit. DispatchGroups DispatchGroups
public string? DispatchGroups { get; set; }
Property Value
DispatchOption
The dispatch option of the unit, determining how the unit is automatically suggested by the system.
public UnitDispatchOption DispatchOption { get; set; }
Property Value
DisplayCategory
Gets the display category of the unit.
public string DisplayCategory { get; }
Property Value
- string
The display category.
DoctorOption
The doctor option of the unit. Only relevant for suggesters, who are looking for a doctor.
public UnitDoctorOption DoctorOption { get; set; }
Property Value
DoctorPickupPoi
The point of interest (POI) where the doctor is picked up then value is set to.
public IPoi? DoctorPickupPoi { get; set; }
Property Value
DutyOptions
Determines the duty options of the unit, including its availability and reaction to dispatch.
public UnitDutyOptions DutyOptions { get; set; }
Property Value
Remarks
If set to OnlyOnPeriods, unit duty periods in DutyPeriods are required.
DutyPeriods
The list of duty periods associated with the unit.
public IEnumerable<IUnitDutyPeriod>? DutyPeriods { get; set; }
Property Value
Remarks
Required if DutyOptions is set to OnlyOnPeriods.
Equipments
The list of equipment associated with the unit.
public IEnumerable<UnitEquipment>? Equipments { get; set; }
Property Value
ExternalAvailablePercent
The external availability percentage of the unit when referenced by another dispatch center. This value determines the unit's potential availability.
public int ExternalAvailablePercent { get; set; }
Property Value
Id
public long Id { get; set; }
Property Value
IsEquippedWithGps
Indicates whether the unit is equipped with GPS. This property determines whether the unit's geographical information is displayed on maps. It also affects automatic suggestions:
- If
, suggestions use the IPoi location for calculating the nearest units.false - If
and unit status is OnDutyAlongWay, suggestions use the real GPS location to calculate the distance to the operation location.true
public bool IsEquippedWithGps { get; set; }
Property Value
IsFirstResponder
Indicates whether the unit is a first responder. This property affects suggestions and the unit's behavior on operation sites.
public bool IsFirstResponder { get; set; }
Property Value
IsNotVolunteerUnit
Indicates whether the unit is not a volunteer unit. Dispatch times will affect based on this value.
public bool IsNotVolunteerUnit { get; set; }
Property Value
IsStartingWithStatus6
Indicates whether the unit starts in a new session with status NotOnDuty. This property affects the visual representation only and does not affect the actual duty status of the unit. To control the unit's duty status, use the DutyOptions property. The unit will react to dispatches based on its duty status as determined by the DutyOptions.
public bool IsStartingWithStatus6 { get; set; }
Property Value
Origin
Gets or sets the origin information for this Shelf instance. May be null if the object was created locally or has no external source.
public ShelfOriginBase? Origin { get; set; }
Property Value
Poi
The point of interest (POI) where the unit is located.
public required IPoi Poi { get; set; }
Property Value
RadioGroup
The radio group associated with the unit. Is null if not set.
public IRadioGroup? RadioGroup { get; set; }
Property Value
Station
The name of the point of interest (POI) where the unit is located.
public string Station { get; }
Property Value
Methods
CreateUnitInfoInstance()
public IUnitInfo CreateUnitInfoInstance()
Returns
GetCallsign(StatusPageDisplayOption)
public string? GetCallsign(StatusPageDisplayOption statusPageDisplayOption)
Parameters
statusPageDisplayOptionStatusPageDisplayOption
Returns
GetCurrentDutyPeriod(DateTime)
Gets the current duty period based on the provided time.
public IUnitDutyPeriod? GetCurrentDutyPeriod(DateTime currentTime)
Parameters
currentTimeDateTimeThe current time.
Returns
- IUnitDutyPeriod
The current duty period if applicable; otherwise, null.
GetEmsPersonOfContactLevel()
Gets the person of contact (POC) level based on the unit category.
public int GetEmsPersonOfContactLevel()
Returns
- int
The commander level.
GetFirefighterPersonOfContactLevel()
Gets the person of contact (POC) level based on the unit category.
public int GetFirefighterPersonOfContactLevel()
Returns
- int
The commander level.
GetMapCallSign()
Retrieves the callsign to be displayed on maps. If CallsignGps is not null or whitespace, it will be used. Otherwise, CallsignShort is returned.
public string GetMapCallSign()
Returns
- string
The appropriate map callsign for the unit.
Has(UnitEquipment)
public bool Has(UnitEquipment unitEquipment)
Parameters
unitEquipmentUnitEquipment
Returns
HasInvalidDutyPeriods()
Checks if there are any invalid duty periods.
public bool HasInvalidDutyPeriods()
Returns
- bool
True if there are any invalid duty periods; otherwise, false.
HasOverlappingDutyPeriods()
Checks for overlapping duty periods.
public bool HasOverlappingDutyPeriods()
Returns
- bool
True if there are any overlapping duty periods; otherwise, false.
IsAbleToTransportPatients()
Checks if the unit is able to transport patients.
public bool IsAbleToTransportPatients()
Returns
- bool
True if the unit is able to transport patients; otherwise, false.
IsAmbulance()
Checks if the unit is an ambulance.
public bool IsAmbulance()
Returns
- bool
True if the unit is an ambulance; otherwise, false.
IsAmbulanceNonUrgent()
Checks if the unit is a non-urgent ambulance.
public bool IsAmbulanceNonUrgent()
Returns
- bool
True if the unit is a non-urgent ambulance; otherwise, false.
IsAmbulanceUrgent()
Checks if the unit is an urgent ambulance.
public bool IsAmbulanceUrgent()
Returns
- bool
True if the unit is an urgent ambulance; otherwise, false.
IsDoctor()
Checks if the unit is a doctor.
public bool IsDoctor()
Returns
- bool
True if the unit is a doctor; otherwise, false.
IsEmergencyMedicalService()
Checks if the unit is EMS
public bool IsEmergencyMedicalService()
Returns
- bool
True if the unit is a EMS; otherwise, false.
IsFirefighter()
Checks if the unit is a firefighter.
public bool IsFirefighter()
Returns
- bool
True if the unit is a firefighter; otherwise, false.
IsHelicopter()
Checks if the unit is a helicopter.
public bool IsHelicopter()
Returns
- bool
True if the unit is a helicopter; otherwise, false.
TimeUntilActiveShiftEnd(DateTime)
Returns the time until the end of the currently active shift, if any.
public TimeSpan? TimeUntilActiveShiftEnd(DateTime currentTime)
Parameters
currentTimeDateTimeThe current date and time.
Returns
- TimeSpan?
The time span until the end of the currently active shift, or
nullif there are no active shifts.
TimeUntilNextShiftStart(DateTime)
Returns the time until the start of the next shift after the current time.
public TimeSpan? TimeUntilNextShiftStart(DateTime currentTime)
Parameters
currentTimeDateTimeThe current date and time.
Returns
- TimeSpan?
The time span until the start of the next shift, or
nullif there are no upcoming shifts.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(string)
Returns a string representation of the unit based on the specified format.
public string ToString(string format)
Parameters
formatstringThe format to use. Supported formats are "full", "middle", "short", and "gps".
Returns
- string
A string representation of the unit based on the specified format:
- "full" - Returns the callsign and category.
- "middle" - Returns the short callsign and category.
- "short" - Returns the short callsign.
- "gps" - Returns the GPS callsign.