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]; }
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); }
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]; } }
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: ; }
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; } }
public void StationListReturnsFirstStationWhenWrapping() { var st = new StationList(5, 50, 1, 0); Station first = st.GetStationForPosition(51, true); Assert.AreSame(first, st.GetStationForPosition(0)); }
public async Task <IActionResult> Map() { var StationsModel = new StationList(); await StationsModel.fetchData(); return(View(StationsModel)); }
public Guid Insert(StationList entityToInsert) { using (Conn) { return(Conn.Insert <Guid>(entityToInsert)); } }
public int Update(StationList entityToInsert) { using (Conn) { return(Conn.Update(entityToInsert)); } }
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); } } } } } } } }
public ComponentType(string nameIn, FLOWObject parentIn, int countIn, int sizeIn) : base(nameIn, parentIn) { this.count = countIn; this.stationNames = new StringList(); this.stations = new StationList(); }
public int Delete(StationList entityToInsert) { using (Conn) { return(Conn.Delete(entityToInsert)); } }
protected StationList FindCandidateCells() { StationList candidates = new StationList(); StationList inputStations = this.Manager.LayoutManager.Layout.InputStations; return(candidates); }
public void FirstStationIsFirst() { var st = new StationList(5, 50, 1, 0); Station first = st.First; Assert.AreSame(first, st.GetStationForPosition(0)); }
public void CreateStationListView() { StationList newObj = Instantiate <StationList>(stationListPrefab); Window window = winSystem.NewWindow("StationList", newObj.gameObject); window.Title = "Station list"; newObj.SetUniverse(dataModel.Universe); }
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); } }
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(); }
/// <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); }
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(); } }
public static Station GetStation(string ID) { if (StationList.ContainsKey(ID)) { return(StationList[ID]); } else { throw new ApplicationException(string.Format("Station '{0}' not exist!", ID)); } }
/// <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); }
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); }
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); } }
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; }
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(); }
partial void Changed_Stations(StationList oldValue, StationList newValue) { if (oldValue != null) { oldValue.CollectionChanged -= CollectionChanged_Stations; } if (newValue != null) { newValue.CollectionChanged += CollectionChanged_Stations; } Async_UpdateStations(); }
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; }
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; }
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);