Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            var station = obj as Station;

            if (obj == null)
            {
                return(false);
            }

            return((StationName == null && station.StationName == null ||
                    StationName != null && StationName.Equals(station.StationName)) &&
                   (StateCountryName == null && station.StateCountryName == null ||
                    StateCountryName != null && StateCountryName.Equals(station.StateCountryName)) &&
                   (StateProvinceAbbrev == null && station.StateProvinceAbbrev == null ||
                    StateProvinceAbbrev != null && StateProvinceAbbrev.Equals(station.StateProvinceAbbrev)) &&
                   (ICAO == null && station.ICAO == null ||
                    ICAO != null && ICAO.Equals(station.ICAO)) &&
                   (IATA == null && station.IATA == null ||
                    IATA != null && IATA.Equals(station.IATA)) &&
                   SYNOP == station.SYNOP &&
                   (Latitude == null && station.Latitude == null ||
                    Latitude != null && Latitude.Equals(station.Latitude)) &&
                   (Longitude == null && station.Longitude == null ||
                    Longitude != null && Longitude.Equals(station.Longitude)) &&
                   Elevation == station.Elevation &&
                   METAR == station.METAR &&
                   RADAR == station.RADAR &&
                   AviationFlag == station.AviationFlag &&
                   UpperAir == station.UpperAir &&
                   ObservationSystem == station.ObservationSystem &&
                   OfficeType == station.OfficeType &&
                   (Country == null && station.Country == null ||
                    Country != null && Country.Equals(station.Country)) &&
                   Priority == Priority);
        }
Ejemplo n.º 2
0
        /// ************************************************************************************************
        /// <summary>
        ///
        /// </summary>
        private void FillMinColumnsSize()
        {
            string gleisText = Common.MultiplatformTramStations.Contains(StationName.ToUpperInvariant()) ? Common.HeaderTitles["PlatformT"] :
                               (Common.MultiplatformSbahnStations.Contains(StationName.ToUpperInvariant()) ? Common.HeaderTitles["PlatformS"] : "");
            string textToMeasure;

            MinWidth = new double[Common.HeaderTitles.Count - 1];
            foreach (string column in Common.HeaderTitles.Keys)
            {
                if (string.Compare(column, "PlatformT") == 0)
                {
                    continue;
                }
                if (string.Compare(column, "PlatformS") == 0)
                {
                    textToMeasure = gleisText;
                }
                else
                {
                    textToMeasure = Common.HeaderTitles[column];
                }
                MinColumnsSize.Add(Common.HeaderTitles[column], Common.MeasureText(textToMeasure, HeaderFontFamily.ToString(), HeaderFontSize));
            }
            MinWidth[0] = MinColumnsSize["Linie"];
            MinWidth[1] = MinColumnsSize["Ziel"];
            MinWidth[2] = MinColumnsSize["Gleis"];
            MinWidth[3] = MinColumnsSize["Abfahrt"];
            MinWidth[4] = MinColumnsSize["Zeit"];
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            // validate text exists in all boxes

            if ((StationName.Text == "") || (RouteStep.Text == "") || (ProductName.Text == "") || (OrderNumber.Text == "") || (Operator.Text == ""))
            {
                // show dialog for bad value
                MessageBox.Show("You must enter all data to continue.",
                                "Routing Information",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);


                // set focus on textbox
                StationName.Select();
            }
            else
            {
                // save the information for the Vtech log file.



                // hide the box
                this.Hide();
            }
        }
 public int CompareTo(object obj)
 {
     return(obj == null
         ? -1
         : string.CompareOrdinal(StationName.ToUpperInvariant(),
                                 ((MassiveConfigureDevicePart)obj).StationName.ToUpperInvariant()));
 }
Ejemplo n.º 5
0
 public int CompareTo(Station other) //sort stations in list
 {
     if (other == null)
     {
         return(1);   // All instances are greater than null
     }
     return(StationName.CompareTo(other.StationName));
 }
Ejemplo n.º 6
0
 public bool NameStartsWith(string text)
 {
     if (StationName.StartsWith(text, StringComparison.CurrentCultureIgnoreCase))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 7
0
        public VtechInput(MainForm parent)
        {
            InitializeComponent();
            frmMain = parent;

            // set focus on textbox
            StationName.Select();
        }
Ejemplo n.º 8
0
        public int CompareTo(Station other)
        {
            if (Equals(other))
            {
                return(0);
            }

            return(StationName.CompareTo(other.StationName));
        }
Ejemplo n.º 9
0
 public override Task <StationData> GetStationFieldData(StationName request, ServerCallContext context)
 {
     //return base.GetStationFieldData(request, context);
     return(Task.FromResult(new StationData
     {
         //Message = CollectOilStationDataService.Instance.GetDemoPLC()
         Data = "获取站点数据: " + request.Name
     }));
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 是否相等
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            VelItem o = obj as VelItem;

            if (o == null)
            {
                return(false);
            }

            return(StationName.Equals(o.StationName));
        }
Ejemplo n.º 11
0
        private void GetStatioName()
        {
            List <STATIONNAME> AllStationName = Enum.GetValues(typeof(STATIONNAME)).Cast <STATIONNAME>().ToList();

            foreach (STATIONNAME StationName in AllStationName)
            {
                StationSelection.Items.Add(StationName.ToString());
            }

            StationSelection.SelectedIndex = 0;
        }
Ejemplo n.º 12
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StationId;
         hashCode = (hashCode * 397) ^ (StationName != null ? StationName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ AqIndex;
         hashCode = (hashCode * 397) ^ (Values != null ? Values.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 13
0
 private string GetComboBoxSelectItemKey(ComboBox cmb) 
 {
     object obj = cmb.SelectedItem;
     if (obj != null)
     {
         KeyValuePair<string, StationName> st = (KeyValuePair<string, StationName>)obj;
         StationName station = st.Value as StationName;
        return station.Code;
     }
     return string.Empty;
 }
Ejemplo n.º 14
0
        public bool NameContains(string text)
        {
            text = text.ToLower();
            string temp = StationName.ToLower();

            if (temp.Contains(text))
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 15
0
 public void Print()
 {
     Console.WriteLine("InstanceData.SOPInstanceUID: " + SOPInstanceUID.ToStringNull());
     Console.WriteLine("InstanceData.SeriesInstanceUID: " + SeriesInstanceUID.ToStringNull());
     Console.WriteLine("InstanceData.StudyInstanceUID: " + StudyInstanceUID.ToStringNull());
     Console.WriteLine("InstanceData.InstanceNumber: " + InstanceNumber.ToStringNull());
     Console.WriteLine("InstanceData.TransferSyntax: " + TransferSyntax.ToStringNull());
     Console.WriteLine("InstanceData.SOPClassUID: " + SOPClassUID.ToStringNull());
     Console.WriteLine("InstanceData.StationName: " + StationName.ToStringNull());
     Console.WriteLine("InstanceData.PatientID: " + PatientID.ToStringNull());
     Console.WriteLine("InstanceData.NumberOfFrames: " + NumberOfFrames);
 }
Ejemplo n.º 16
0
 void GetStationModelFromString(string response)
 {
     string[] station = response.Split('@');//首先各个车站数据分组,在分组的数据中从第二个数据项中开始查询(剔除空项)
     int arrLen = 6;
     datas = new List<StationName>();
     for (int i = 1; i < station.Length; i++)
     {
         StationName sta = new StationName();
         string[] arr = station[i].Split('|');
         if (arr.Length < arrLen)
         {
             continue;
         }
         sta.SpellCode = arr[0];
         sta.Name = arr[1];
         sta.Code = arr[2];//查询车票时使用的代码
         sta.FullSpell = arr[3];
         sta.SampleSpell = arr[4];
         sta.Key = station[i];
         datas.Add(sta);
     }
 }
Ejemplo n.º 17
0
 public override int GetHashCode()
 {
     return(StationName.GetHashCode());
 }
Ejemplo n.º 18
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            int   grAddr, xgAddr;
            float area;

            //, cpn;

            // check gprs staion name
            //
            if (StationName == string.Empty)
            {
                MsgBox.Show("站名不能为空!");
                return;
            }

            // check gr address
            //
            try
            {
                grAddr = GrAddress;
            }
            catch
            {
                MsgBox.Show("供热控制器地址错误!");
                return;
            }
            // check xg address
            //
            try
            {
                xgAddr = XgAddress;
            }
            catch
            {
                MsgBox.Show("巡更控制器地址错误!");
                return;
            }

            //// check commport
            //
//            try
//            {
//                cpn = CommPort;
//            }
//            catch
//            {
//                MsgBox.Show("串口号错误!");
//                return ;
//            }

            // check ip address
            //
            try
            {
                if (IpAddress.Length == 0)
                {
                    MsgBox.Show("IP地址不能为空!");
                    return;
                }
                System.Net.IPAddress.Parse(IpAddress);
            }
            catch
            {
                MsgBox.Show("IP地址错误");
                return;
            }

            try
            {
                if (ServerIpAddress.Length == 0)
                {
                    MsgBox.Show("服务器IP地址不能为空!");
                    return;
                }
                System.Net.IPAddress.Parse(ServerIpAddress);
            }
            catch
            {
                MsgBox.Show("服务器IP地址错误");
                return;
            }

            try
            {
                area = this.Area;
            }
            catch
            {
                MsgBox.Show("供热面积错误");
                return;
            }



            // check station name not use
            //
            bool nameExist = XGDB.CheckGprsStationNameExist(StationName.Trim(),
                                                            EditId, XGConfig.Default.ClientAorB);

            if (nameExist)
            {
                MsgBox.Show("站名已经存在!");
                return;
            }

            // check commport not use
            //
//            bool cpExist = XGDB.CheckGprsStationCommPortExist( CommPort, EditId, XGConfig.Default.ClientAorB );
//            if ( cpExist )
//            {
//                MsgBox.Show( "串口号已经存在!" );
//                return ;
//            }



            this.DialogResult = DialogResult.OK;
            Close();
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Compare THIS object to second one and return true when equals
 /// </summary>
 /// <param name="other">Second PowerShellStation object to compare with called object</param>
 /// <returns>True when PowerShellStation is equal</returns>
 public bool Equals(PowerShellStation other)
 {
     return(StationName.Equals(other.StationName));
 }
Ejemplo n.º 20
0
 public override int GetHashCode()
 {
     return(Item.Id.GetHashCode() ^ StationName.GetHashCode());
 }
Ejemplo n.º 21
0
 public override bool Equals(object obj)
 {
     return(Item.Id == ((ItemStock)obj).Item.Id && StationName.Equals(((ItemStock)obj).StationName));
 }