Example #1
0
        private void UpdateStationTree(List <StationList> stationList)
        {
            advTree_Station.BeginUpdate();
            Node descriptionNode = new Node();

            descriptionNode.Text              = @"<b>站点索引</b>";
            descriptionNode.ExpandVisibility  = eNodeExpandVisibility.Hidden;
            descriptionNode.FullRowBackground = true;
            descriptionNode.Selectable        = false;
            advTree_Station.Nodes.Add(descriptionNode);

            List <StationList> rootStations = stationList.FindAll(_ => _.PStationID == null);

            foreach (var root in rootStations)
            {
                Node rootNode = new Node();
                rootNode.Tag  = root;
                rootNode.Text = root.Name;
                List <StationList> childStations = stationList.FindAll(_ => _.PStationID == root.StationID);
                foreach (var child in childStations.OrderBy(_ => _.Name))
                {
                    Node childNode = new Node();
                    childNode.Tag  = child;
                    childNode.Text = child.Name;
                    rootNode.Nodes.Add(childNode);
                }
                advTree_Station.Nodes.Add(rootNode);
            }
            advTree_Station.EndUpdate();
            currentStation = rootStations[0];
        }
Example #2
0
        private async Task LoadStationAsync()
        {
            //var s = await Task.Run(() => _repository.Stations.AddAsync(new Station
            //{
            //    Location = "a",
            //    DisplayLocationArea = "b",
            //    DisplayLocation = "c",
            //    PhoneNumber = "1",
            //    Imei = "2",
            //    Keyword = "As"
            //}));

            var stations = await Task.Run(() => _repository.Stations.GetRangeAsync());

            foreach (var item in stations)
            {
                StationList.Add(new StationModel(item, _repository));
                //if (item.Name.Contains("y"))
                //{
                //    throw new InvalidOperationException("bawal naay y");
                //}
            }
            //Stations = new AutoRefreshWrapper<Station>(
            //  MyObjectContext.MyObjectSet, RefreshMode.StoreWins);
        }
Example #3
0
        private async Task UpdateList(RecordChangedEventArgs <Station> e)
        {
            if (e.ChangeType == ChangeType.None)
            {
                return;
            }
            if (e.ChangeType == ChangeType.Delete)
            {
                var s = StationList.FirstOrDefault(c => c.Model.StationId == e.Entity.StationId);
                if (s == null)
                {
                    return;
                }

                StationList.Remove(s);
            }
            else if (e.ChangeType == ChangeType.Insert)
            {
                StationList.Add(new StationModel(e.Entity, _repository));
            }
            else if (e.ChangeType == ChangeType.Update)
            {
                var s = StationList.FirstOrDefault(c => c.Model.StationId == e.Entity.StationId);
                if (s == null)
                {
                    return;
                }
                var i = StationList.IndexOf(s);
                StationList[i]  = new StationModel(e.Entity, _repository);
                SelectedStation = StationList[i];
            }
        }
Example #4
0
        private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (x_num == null | y_num == null | !complete)
            {
                Interaction.MsgBox("우선 위치를 지정해 주세요.", Constants.vbInformation);
            }
            else
            {
                try
                {
                    StationList.AirStationData = getNearStation(tm_co[0], tm_co[1]);
                }
                catch (Exception ex)
                {
                    Interaction.MsgBox("측정소를 검색하던 도중 오류가 발생했습니다." + Constants.vbCr + "주소가 유효한지 확인해 주세요.", Constants.vbExclamation);
                    StationList.ShowDialog(this);
                    goto donothing;
                }

                StationList.ShowDialog(this);
            }



donothing:
            ;
        }
Example #5
0
        private void ApplicationBarIconButton_Click(object sender, EventArgs e)
        {
            ApplicationBarIconButton appBarButton = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);

            switch (mainPanorama.SelectedIndex)
            {
            case 0:
                if (acbFromStation.SelectedItem != null && acbToStation.SelectedItem != null)
                {
                    StationList startStaionTmp = (StationList)acbFromStation.SelectedItem;
                    StationList endStaionTmp   = (StationList)acbToStation.SelectedItem;
                    acbFromStation.SelectedItem = endStaionTmp;
                    acbToStation.SelectedItem   = startStaionTmp;
                }
                break;

            case 2:
                clearFavoriteScheduleList();
                appBarButton.IsEnabled = false;
                break;

            case 3:
                clearRecentSearchList();
                appBarButton.IsEnabled = false;
                break;
            }
        }
Example #6
0
        public void StationListReturnsFirstStationWhenWrapping()
        {
            var     st    = new StationList(5, 50, 1, 0);
            Station first = st.GetStationForPosition(51, true);

            Assert.AreSame(first, st.GetStationForPosition(0));
        }
Example #7
0
        public async Task <IActionResult> Map()
        {
            var StationsModel = new StationList();
            await StationsModel.fetchData();

            return(View(StationsModel));
        }
Example #8
0
 public Guid Insert(StationList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <Guid>(entityToInsert));
     }
 }
Example #9
0
 public int Update(StationList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Update(entityToInsert));
     }
 }
Example #10
0
        public void ShowFromToList(String text, int type)
        {
            ArrayList list = null;

            String[] staArray = null;
            if (text != null)
            {
                list     = StationList.searchStation(text);
                staArray = new String[list.Count];
            }
            else
            {
                list     = StationList.GetVaterStationList();
                staArray = new String[list.Count];
            }
            int i = 0;

            foreach (StationEntity se in list)
            {
                staArray[i] = se.name2;
                i++;
            }
            if (type == 1)
            {
                this.cb_to.AutoCompleteCustomSource.AddRange(staArray);
            }
            else if (type == 2)
            {
                this.cb_from.AutoCompleteCustomSource.AddRange(staArray);
            }
            //this.cb_from.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            //this.cb_from.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
        }
        public override Event GetEvent(SimulationManager managerIn)
        {
            StationList  processCells = managerIn.LayoutManager.Layout.Stations;
            UnitloadList unitloads    = managerIn.JobManager.Unitloads;

            return(new StartProcessEvent(this.Time, managerIn, processCells[this.cell].Processors[this.processor], unitloads[this.unitload], this.transferTime));
        }
        internal void SeachStation(string p)
        {
            if (string.IsNullOrEmpty(p))
            {
                StationList.Clear();
            }
            else
            {
                p = p.ToLower();


                var stations = StationNameService.GetStations().Where(x => x.Name.ToLower().StartsWith(p)).OrderBy(x => x.Sort).Take(7);

                if (stations.Count() < 7)
                {
                    var extraStations = StationNameService.GetStations().Where(x => x.StartsWith(p)).OrderBy(x => x.Sort).Take(7 - stations.Count());

                    stations = stations.Union(extraStations);
                }

                StationList.Clear();

                foreach (var s in stations)
                {
                    StationList.Add(s);
                }
            }
        }
        public void updateStations(string routeName)//
        {
            StationList.Clear();
            Task.Run(async() =>
            {
                string routeID = Database.routeID_NameMap.FirstOrDefault(x => x.Value == routeName).Key;
                SelectedRoute  = routeID;
                ScheduleList   = await DataQuery.getSchedule(routeID, RouteDirection.direction_id);

                if (Database.routeAbrevMap.ContainsKey(routeName))
                {
                    LineCode  = Database.routeAbrevMap[routeName];
                    LineColor = Configs.lineColorMap[LineCode];
                }
                else
                {
                    LineCode  = routeName;
                    LineColor = "#AEA29F";
                }

                List <Station> stationList   = await DataQuery.getStations(routeID);
                Station start_st             = stationList[0], final_st = stationList[stationList.Count - 1];
                RouteDirection.start_station = start_st.attributes.name;
                RouteDirection.final_station = final_st.attributes.name;

                foreach (Station station in stationList)
                {
                    StationList.Add(station.attributes.name);
                }
            }).Wait();
        }
        //Every station knows its operations at the beginning of simulation.
        public void ConnectStationsAndOperations()
        {
            OperationList operations = this.layoutManager.Layout.Operations;
            StationList   stations   = this.layoutManager.Layout.Stations;

            foreach (Station station in stations)
            {
                foreach (Processor processor in station.Processors)
                {
                    foreach (Operation operation in operations)
                    {
                        for (int i = 0; i < processor.OperationNames.Count; i++)
                        {
                            if (operation.Name == processor.OperationNames[i])
                            {
                                processor.Operations.Add(operation);
                                station.Operations.Add(operation);

                                //add to binmagazine componenttypes if not already included IE486
                                foreach (ComponentType ct in operation.ComponentUsages.Keys)
                                {
                                    if (!station.BinMagazine.ComponentTypes.Contains(ct))
                                    {
                                        station.BinMagazine.ComponentTypes.Add(ct);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Example #15
0
 public ComponentType(string nameIn, FLOWObject parentIn, int countIn, int sizeIn)
     : base(nameIn, parentIn)
 {
     this.count        = countIn;
     this.stationNames = new StringList();
     this.stations     = new StationList();
 }
Example #16
0
 public int Delete(StationList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
Example #17
0
        protected StationList FindCandidateCells()
        {
            StationList candidates    = new StationList();
            StationList inputStations = this.Manager.LayoutManager.Layout.InputStations;

            return(candidates);
        }
Example #18
0
        public void FirstStationIsFirst()
        {
            var     st    = new StationList(5, 50, 1, 0);
            Station first = st.First;

            Assert.AreSame(first, st.GetStationForPosition(0));
        }
Example #19
0
    public void CreateStationListView()
    {
        StationList newObj = Instantiate <StationList>(stationListPrefab);
        Window      window = winSystem.NewWindow("StationList", newObj.gameObject);

        window.Title = "Station list";
        newObj.SetUniverse(dataModel.Universe);
    }
Example #20
0
        private Layout.Layout layout;            //state

        public LayoutManager(string nameIn, FLOWObject parentIn)
            : base(nameIn, parentIn)
        {
            this.congestedNodes      = new NodeList();
            this.stationsToDecide    = new StationList();
            this.queuesToPull        = new QueueList(); //ie486f18
            this.requestsToReplenish = new RequestList();
        }
        protected override void PreOperation()
        {
            StationList inputStations = this.Manager.LayoutManager.Layout.InputStations;

            foreach (Station inputStation in inputStations)
            {
                this.PerformCyclicalOrder(inputStation);
            }
        }
Example #22
0
        internal void InitValues(string from, string to, string via, bool keepValues, DateTime?dateTime)
        {
            Settings = SettingService.GetSettings();

            if (!keepValues && !string.IsNullOrEmpty(from))
            {
                VanStation = StationNameService.GetStationByName(from);
                if (VanStation == null)
                {
                    VanStation = StationNameService.GetStationByCode(from);
                }
            }
            else if (!keepValues)
            {
                VanStation = null;
                GetGpsStation();
            }

            if (!keepValues && !string.IsNullOrEmpty(to))
            {
                NaarStation = StationNameService.GetStationByName(to);
            }
            else if (!keepValues)
            {
                NaarStation = null;
            }

            if (!keepValues && !string.IsNullOrEmpty(via))
            {
                ViaStation = StationNameService.GetStationByName(via);
            }
            else if (!keepValues)
            {
                ViaStation = null;
            }

            if (!keepValues)
            {
                if (dateTime.HasValue)
                {
                    Date = dateTime.Value.Date;
                    Time = dateTime.Value;
                }
                else
                {
                    Date = DateTime.Now;
                    Time = DateTime.Now;
                }

                IsYearCard     = Settings.HasYearCard;
                IsHogesnelheid = Settings.UseHsl;
                IsViaVisible   = false;
            }

            StationList.Clear();
        }
Example #23
0
        /// <summary>
        /// 查询站点数据集合
        /// </summary>
        /// <param name="searchEntity"></param>
        /// <returns></returns>
        public StationList GetStationList(ParamsStationSearch searchEntity)
        {
            Dictionary <string, string> paramsList = new Dictionary <string, string> {
                { "body", searchEntity.body },
                { "siteName", searchEntity.siteName }
            };
            StationList result = CallAPIHelper.CallAPIInPOST <StationList>(APIAddressSetting.API_POST_GETSiteList, paramsList);

            return(result);
        }
Example #24
0
        private void ToolStripMenuItem_add_Click(object sender, EventArgs e)
        {
            StationList        _tmpData = null;
            Add_Modify_Station tmpAdd_Modify_Station = new Add_Modify_Station(_tmpData);

            tmpAdd_Modify_Station.ShowDialog();
            if (tmpAdd_Modify_Station.result == DialogResult.OK)
            {
                GetStationList();
            }
        }
Example #25
0
 public static Station GetStation(string ID)
 {
     if (StationList.ContainsKey(ID))
     {
         return(StationList[ID]);
     }
     else
     {
         throw new ApplicationException(string.Format("Station '{0}' not exist!", ID));
     }
 }
Example #26
0
        /// <summary>
        /// Get all train stations in Sweden.
        /// Note that the results of this function can be cached by your app.
        /// </summary>
        /// <returns>A list of train stations</returns>
        public List <TrainStation> getAllActiveSwedishStations()
        {
            ApiRequest request = new ApiRequest(ApiKey);

            request.Query.Add(StationList.AllActiveSwedenStations());
            string response = ApiCall(request).Result;
            TrafikVerketResponse responseJson = JsonConvert.DeserializeObject <TrafikVerketResponse>(response);
            List <TrainStation>  ret          = responseJson.RESPONSE.RESULT[0].TrainStation;

            return(ret);
        }
Example #27
0
        public void StationsAreCreatedAtProperPositions()
        {
            var     st     = new StationList(2, 10000, 1, 0);
            Station first  = st.GetStationForPosition(0);
            Station third  = st.GetStationForPosition(4999);
            Station second = st.GetStationForPosition(5000);
            Station fourth = st.GetStationForPosition(9000);

            Assert.AreSame(first, third);
            Assert.AreSame(second, fourth);
        }
Example #28
0
        public void Execute()
        {
            this.PreOperation();
            StationList inputStations = this.FindCandidateCells();

            foreach (Station inputStation in inputStations)
            {
                UnitloadList unitloads         = inputStation.FindUnreleasedUnitloads();
                UnitloadList selectedUnitloads = this.SelectUnitloads(inputStation, unitloads);
                this.PostOperation(inputStation, selectedUnitloads, names);
            }
        }
Example #29
0
        private void StationData(StationList _tmpData)
        {
            cbxtypename.SelectedValue = _tmpData.TypeID;
            if (_tmpData.PStationID != null)
            {
                comboBox1.SelectedValue = _tmpData.PStationID;
            }

            txtname.Text        = _tmpData.Name;
            txtlon.Text         = _tmpData.Lon.ToString();
            txtlat.Text         = _tmpData.Lat.ToString();
            txtdescription.Text = _tmpData.Description;
        }
Example #30
0
 private Transporter transporter; // bypass için şimdilik bir tane uncapacitated transporter yaratıldı. IE486
 public Layout()
 {
     this.bufferCells      = new BufferCellList();
     this.inputStations    = new StationList();
     this.nodes            = new NodeList();
     this.operations       = new OperationList();
     this.outputStations   = new StationList();
     this.stations         = new StationList();
     this.bins             = new BinList();
     this.componentTypes   = new ComponentTypeList();
     this.unitloadsonMover = new UnitloadList();
     this.transporter      = new Transporter();
 }
Example #31
0
partial         void Changed_Stations(StationList oldValue, StationList newValue)
        {
            if (oldValue != null)
            {
                oldValue.CollectionChanged -= CollectionChanged_Stations;
            }

            if (newValue != null)
            {
                newValue.CollectionChanged += CollectionChanged_Stations;
            }

            Async_UpdateStations();
        }
Example #32
0
partial         void CollectionChanged__State_Stations(StationList value, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            Services.App.Async_Invoke(AsyncGroup.Model_UpdateStations, Model_UpdateStations);
        }
 public ChannelSearchResult(StationList stations)
 {
     _channels = new ChannelList();
     _stations = stations;
 }
 public ChannelSearchResult(ChannelList channels)
 {
     _channels = channels;
     _stations = new StationList();
 }
 public ChannelSearchResult()
 {
     _channels = new ChannelList();
     _stations = new StationList();
 }
 private StationList getUniqueStations(ChannelList channels)
 {
     if (channels != null)
     {
         List<int> stIdList = new List<int>();
         StationList stations = new StationList();
         foreach (Channel ch in channels)
         {
             if (!(stIdList.Contains(ch.StationId)))
             {
                 stations.Add(ch.Station);
                 stIdList.Add(ch.StationId);
             }
         }
         return stations;
     }
     return null;
 }
Example #37
0
 private static StationList TableToList(DataTable tbl)
 {
     StationList list = new StationList();
     foreach (DataRow r in tbl.Rows)
     {
         Station st = DataRowToStation(r);
         AddStationLocation(st);
         list.Add(st);
     }
     return list;
 }
Example #38
0
partial         void Changed__State_Stations(StationList oldValue, StationList newValue)
        {
            Services.App.Async_Invoke(AsyncGroup.Model_UpdateStations, Model_UpdateStations);
        }
        // --------------------------------------------------------------------
partial         void Changed_Stations(StationList oldValue, StationList newValue);