/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (WaitProbability > 0) { if (MinimumWaitTime > MaximumWaitTime) { results.Warn(this, Strings.WarnBlockMinWaitTimeGreatThenMaxWaitTime); } } waitPermissions.Validate(validationRoot, results); var hasRoutesToMe = Module.Routes.Any(x => x.To == this); var hasRoutesFromMe = Module.Routes.Any(x => x.From == this); if ((!hasRoutesFromMe) && (!hasRoutesToMe)) { results.Warn(this, Strings.WarnBlockNoRoutesToOrFromMe); } else if (!hasRoutesFromMe) { results.Warn(this, Strings.WarnBlockNoRoutesFromMe); } else if (!hasRoutesToMe) { results.Warn(this, Strings.WarnBlockNoRoutesToMe); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (Address == null) { results.Warn(this, Strings.WarnNoAddressSpecified); } if (SwitchDuration > 5000) { results.Warn(this, Strings.WarnSwitchDurationVeryHigh); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (Address1 == null) { results.Warn(this, "No address 1 specified"); } if (Address2 == null) { results.Warn(this, "No address 2 specified"); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (string.IsNullOrEmpty(HostName)) { results.Warn(this, Strings.WarningNoHostnameSpecified); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (Address == null) { results.Warn(this, Strings.WarnNoAddressSpecified); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (X < 0) { results.Warn(this, Strings.WarnNegativeXPosition); } if (Y < 0) { results.Warn(this, Strings.WarnNegativeYPosition); } if (Width <= 0) { results.Warn(this, Strings.WarnWidthToSmall); } if (Height <= 0) { results.Warn(this, Strings.WarnHeightToSmall); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public virtual void Validate(IEntity validationRoot, ValidationResults results) { if (string.IsNullOrEmpty(Id)) { results.Error(this, Strings.ErrIdMissing); } if (string.IsNullOrEmpty(Description)) { results.Warn(this, Strings.WarnDescriptionMissing); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (Address == null) { results.Warn(this, Strings.WarnNoAddressSpecified); } var slow = SlowSpeed; var medium = MediumSpeed; var max = MaximumSpeed; if (slow > medium) { results.Warn(this, Strings.WarnSlowSpeedHigherThenMedium); } if (max < medium) { results.Warn(this, Strings.WarnMaxSpeedLowerThenMedium); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (group.Value == null) { results.Warn(this, "No group specified"); } else if (Group == null) { results.Error(this, "Loc group with id {0} not found", group.Value.Id); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (loc.Value == null) { results.Warn(this, "No loc specified"); } else if (Loc == null) { results.Error(this, "Loc with id {0} not found", loc.Value.Id); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); IModuleConnection mc = this; if (mc.ModuleA == null) { results.Warn(this, Strings.WarnModuleANotSpecified); } else if (mc.EdgeA == null) { results.Warn(this, Strings.WarnEdgeANotSpecified); } if (mc.ModuleB == null) { results.Warn(this, Strings.WarnModuleBNotSpecified); } else if (mc.EdgeB == null) { results.Warn(this, Strings.WarnEdgeBNotSpecified); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); if (PositionAddress1 == null) { results.Warn(this, "No position address 1 specified"); } if (PositionAddress2 == null) { results.Warn(this, "No position address 2 specified"); } if (PositionAddress3 == null) { results.Warn(this, "No position address 3 specified"); } if ((PositionAddress4 == null) && ((PositionAddress5 != null) || (PositionAddress6 != null))) { results.Warn(this, "No position address 4 specified"); } if ((PositionAddress5 == null) && (PositionAddress6 != null)) { results.Warn(this, "No position address 5 specified"); } if (WriteAddress == null) { results.Warn(this, "No write address specified"); } if (BusyAddress == null) { results.Warn(this, "No busy address specified"); } if ((InitialPosition < FirstPosition) || (InitialPosition > LastPosition)) { results.Warn(this, "Invalid initial position"); } }
/// <summary> /// Validate the integrity of this entity. /// </summary> public override void Validate(IEntity validationRoot, ValidationResults results) { base.Validate(validationRoot, results); toBlock.Validate(validationRoot, results); toEdge.Validate(validationRoot, results); fromBlock.Validate(validationRoot, results); fromEdge.Validate(validationRoot, results); enteringDestinationTrigger.Validate(validationRoot, results); destinationReachedTrigger.Validate(validationRoot, results); if (From == null) { results.Warn(this, Strings.WarnNoFromEndPointSpecified); } if (To == null) { results.Warn(this, Strings.WarnNoToEndPointSpecified); } if ((To == From) && (To != null)) { results.Warn(this, Strings.WarnToEndPointEqualsFromEndPoint); } crossingJunctions.Validate(validationRoot, results); events.Validate(validationRoot, results); _enteringSensors.Validate(validationRoot, results); _reachedSensors.Validate(validationRoot, results); var enterEventCount = events.Count(evt => evt.Behaviors.Any(x => x.StateBehavior == RouteStateBehavior.Enter)); var reachedEventCount = events.Count(evt => evt.Behaviors.Any(x => x.StateBehavior == RouteStateBehavior.Reached)); if ((enterEventCount == 0) && (reachedEventCount == 0) && this.IsInternal()) { results.Warn(this, Strings.WarnNoSensorsSpecified); } else if ((reachedEventCount == 0) && this.IsToInternal()) { results.Warn(this, Strings.WarnNoReachedDestinationSensorsSpecified); } else if ((enterEventCount == 0) && this.IsToInternal()) { results.Warn(this, Strings.WarnNoEnteringDestinationSensorsSpecified); } }