示例#1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StartUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ EndUtc.GetHashCode();
         hashCode = (hashCode * 397) ^ (DateRangeType != null ? DateRangeType.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (DesignUid != null ? DesignUid.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (DesignFileName != null ? DesignFileName.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (ContributingMachines != null ? ContributingMachines.GetListHashCode() : 397);
         hashCode = (hashCode * 397) ^ (OnMachineDesignId != null ? OnMachineDesignId.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (OnMachineDesignName != null ? OnMachineDesignName.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (ElevationType != null ? ElevationType.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (VibeStateOn != null ? VibeStateOn.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (PolygonUid != null ? PolygonUid.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (PolygonName != null ? PolygonName.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (PolygonLL != null ? PolygonLL.GetListHashCode() : 397);
         hashCode = (hashCode * 397) ^ (PolygonType != null ? PolygonType.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (ForwardDirection != null ? ForwardDirection.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (LayerNumber != null ? LayerNumber.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (AlignmentUid != null ? AlignmentUid.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (AlignmentFileName != null ? AlignmentFileName.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (StartStation != null ? StartStation.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (EndStation != null ? EndStation.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (LeftOffset != null ? LeftOffset.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (RightOffset != null ? RightOffset.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (AsAtDate != null ? AsAtDate.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (AutomaticsType != null ? AutomaticsType.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (TemperatureRangeMin != null ? TemperatureRangeMin.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (TemperatureRangeMax != null ? TemperatureRangeMax.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (PassCountRangeMin != null ? PassCountRangeMin.GetHashCode() : 397);
         hashCode = (hashCode * 397) ^ (PassCountRangeMax != null ? PassCountRangeMax.GetHashCode() : 397);
         return(hashCode);
     }
 }
示例#2
0
        public bool Equals(Filter other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(StartUtc.Equals(other.StartUtc) && EndUtc.Equals(other.EndUtc) && DateRangeType == other.DateRangeType &&
                   string.Equals(DesignUid, other.DesignUid) &&
                   string.Equals(DesignFileName, other.DesignFileName) &&
                   ((ContributingMachines ?? other.ContributingMachines) == null || ContributingMachines.ScrambledEquals(other.ContributingMachines)) &&
                   OnMachineDesignId == other.OnMachineDesignId && string.Equals(OnMachineDesignName, other.OnMachineDesignName) &&
                   ElevationType == other.ElevationType && VibeStateOn == other.VibeStateOn &&
                   string.Equals(PolygonUid, other.PolygonUid) && PolygonType == other.PolygonType &&
                   string.Equals(PolygonName, other.PolygonName) &&
                   ((PolygonLL ?? other.PolygonLL) == null || PolygonLL.ScrambledEquals(other.PolygonLL)) &&
                   ForwardDirection == other.ForwardDirection && LayerNumber == other.LayerNumber &&
                   string.Equals(AlignmentUid, other.AlignmentUid) &&
                   string.Equals(AlignmentFileName, other.AlignmentFileName) &&
                   StartStation.Equals(other.StartStation) && EndStation.Equals(other.EndStation) &&
                   LeftOffset.Equals(other.LeftOffset) && RightOffset.Equals(other.RightOffset) &&
                   AutomaticsType == other.AutomaticsType &&
                   TemperatureRangeMin.Equals(other.TemperatureRangeMin) && TemperatureRangeMax.Equals(other.TemperatureRangeMax) &&
                   PassCountRangeMin.Equals(other.PassCountRangeMin) && PassCountRangeMax.Equals(other.PassCountRangeMax));
        }
示例#3
0
    /**
     * Update the game object by
     *  (1) TODO: updating the attributes of the gameobject in unity
     *  (2) updating the attributes of the models in DEVS
     */
    void updateObject()
    {
        // Parse form data
        GameObject form    = GameObject.Find("Parameters Form");
        GameObject content = form.transform.Find("Viewport/Content").gameObject;

        // Loop over all elements in form
        Dictionary <string, string> parameters = new Dictionary <string, string>();

        foreach (Transform child in content.transform)
        {
            // Loop to get input value
            foreach (Transform child2 in child)
            {
                if (child2.name == "InputField")
                {
                    parameters.Add(child.name, child2.gameObject.GetComponent <InputField>().text);
                }
            }
        }

        // TODO: for other data objects
        GameObject gameObj = GameObject.Find(idObj);

        if (gameObj.GetComponent <Train>() != null)
        {
            Train     train     = gameObj.GetComponent <Train>();
            TrainData trainData = train.train;

            foreach (KeyValuePair <string, string> parameter in parameters)
            {
                trainData.GetType().GetField(parameter.Key).SetValue(trainData, parameter.Value);
            }
            socketManager.send(string.Format("UPDATE_{0} {1}", train.currentTrack, JsonUtility.ToJson(trainData)));
        }
        else if (gameObj.GetComponent <Track>() != null)
        {
            Track     track     = gameObj.GetComponent <Track>();
            TrackData trackData = track.track;

            foreach (KeyValuePair <string, string> parameter in parameters)
            {
                trackData.GetType().GetField(parameter.Key).SetValue(trackData, parameter.Value);
            }
            socketManager.send(string.Format("UPDATE_{0} {1}", trackData.id, JsonUtility.ToJson(trackData)));
        }
        else if (gameObj.GetComponent <StartStation>() != null)
        {
            StartStation     startStation     = gameObj.GetComponent <StartStation>();
            StartStationData startStationData = startStation.startStation;

            foreach (KeyValuePair <string, string> parameter in parameters)
            {
                startStationData.GetType().GetField(parameter.Key).SetValue(startStationData, parameter.Value);
            }
            socketManager.send(string.Format("UPDATE_{0} {1}", startStationData.id, JsonUtility.ToJson(startStationData)));
        }
    }
示例#4
0
        public Form1()
        {
            StartStation startStation = new StartStation();
            EndStation   endStation   = new EndStation();

            InitializeComponent();
            TicketFare();
            toSouthRadioButton.CheckedChanged  += RadioButton_CheckedChanged;
            startComboBox.SelectedIndexChanged += StartComboBox_SelectedIndexChanged;
        }
示例#5
0
 public bool Equals(FilterResult other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) &&
            Uid.Equals(other.Uid) &&
            string.Equals(Name, other.Name) &&
            string.Equals(Description, other.Description) &&
            StartUtc.Equals(other.StartUtc) &&
            EndUtc.Equals(other.EndUtc) &&
            OnMachineDesignId == other.OnMachineDesignId &&
            OnMachineDesignName == other.OnMachineDesignName &&
            AssetIDs.ScrambledEquals(other.AssetIDs) &&
            VibeStateOn == other.VibeStateOn &&
            CompactorDataOnly.Equals(other.CompactorDataOnly) &&
            ElevationType == other.ElevationType &&
            PolygonLL.ScrambledEquals(other.PolygonLL) &&
            PolygonGrid.ScrambledEquals(other.PolygonGrid) &&
            ForwardDirection == other.ForwardDirection &&
            (AlignmentFile == null ? other.AlignmentFile == null : AlignmentFile.Equals(other.AlignmentFile)) &&
            StartStation.Equals(other.StartStation) &&
            EndStation.Equals(other.EndStation) &&
            LeftOffset.Equals(other.LeftOffset) &&
            RightOffset.Equals(other.RightOffset) &&
            LayerType.Equals(other.LayerType) &&
            (LayerDesignOrAlignmentFile == null
        ? other.LayerDesignOrAlignmentFile == null
        : LayerDesignOrAlignmentFile.Equals(other.LayerDesignOrAlignmentFile)) &&
            BenchElevation.Equals(other.BenchElevation) &&
            LayerNumber == other.LayerNumber &&
            LayerThickness.Equals(other.LayerThickness) &&
            ContributingMachines.ScrambledEquals(other.ContributingMachines) &&
            SurveyedSurfaceExclusionList.ScrambledEquals(other.SurveyedSurfaceExclusionList) &&
            ExcludedSurveyedSurfaceUids.ScrambledEquals(other.ExcludedSurveyedSurfaceUids) &&
            ReturnEarliest.Equals(other.ReturnEarliest) &&
            GpsAccuracy.Equals(other.GpsAccuracy) &&
            GpsAccuracyIsInclusive.Equals(other.GpsAccuracyIsInclusive) &&
            BladeOnGround.Equals(other.BladeOnGround) &&
            TrackMapping.Equals(other.TrackMapping) &&
            WheelTracking.Equals(other.WheelTracking) &&
            (DesignFile == null ? other.DesignFile == null : DesignFile.Equals(other.DesignFile)) &&
            AutomaticsType == other.AutomaticsType &&
            TemperatureRangeMin.Equals(other.TemperatureRangeMin) &&
            TemperatureRangeMax.Equals(other.TemperatureRangeMax) &&
            PassCountRangeMin.Equals(other.PassCountRangeMin) &&
            PassCountRangeMax.Equals(other.PassCountRangeMax));
 }
示例#6
0
        private void RadioButton_CheckedChanged(object sender, EventArgs e)
        {
            StartStation startStation = new StartStation();
            EndStation   endStation   = new EndStation();

            if (toSouthRadioButton.Checked)
            {
                startComboBox.DataSource = list.Distinct(startStation).Select(x => x.StartStation).ToList();
            }
            else
            {
                startComboBox.DataSource = list.Distinct(endStation).Select(x => x.EndStation).ToList();
            }
        }
示例#7
0
 public override string ToString()
 {
     return($"{StartStation.ToString("0.0")}~{EndStation.ToString("0.0")}");
 }