コード例 #1
0
ファイル: GKModuleLoader.cs プロジェクト: xbadcode/Rubezh
		public override void CreateViewModels()
		{
			ServiceFactory.Layout.AddAlarmGroups(new AlarmGroupsViewModel());
			ServiceFactory.Layout.AddToolbarItem(new GKConnectionIndicatorViewModel());

			DevicesViewModel = new DevicesViewModel();
			DeviceParametersViewModel = new DeviceParametersViewModel();
			ZonesViewModel = new ZonesViewModel();
			GuardZonesViewModel = new GuardZonesViewModel();
			SKDZonesViewModel = new SKDZonesViewModel();
			DirectionsViewModel = new DirectionsViewModel();
			DelaysViewModel = new DelaysViewModel();
			PimsViewModel = new PimsViewModel();
			PumpStationsViewModel = new PumpStationsViewModel();
			MPTsViewModel = new MPTsViewModel();
			DoorsViewModel = new DoorsViewModel();
			AlarmsViewModel = new AlarmsViewModel();
			DaySchedulesViewModel = new DaySchedulesViewModel();
			SchedulesViewModel = new SchedulesViewModel();
			ServiceFactory.Events.GetEvent<ShowGKAlarmsEvent>().Unsubscribe(OnShowAlarms);
			ServiceFactory.Events.GetEvent<ShowGKAlarmsEvent>().Subscribe(OnShowAlarms);
			ServiceFactory.Events.GetEvent<ShowGKDebugEvent>().Unsubscribe(OnShowGKDebug);
			ServiceFactory.Events.GetEvent<ShowGKDebugEvent>().Subscribe(OnShowGKDebug);

			SubscribeShowDelailsEvent();
		}
コード例 #2
0
 public GroupControllerModule()
 {
     _devicesViewModel = new DevicesViewModel();
     _zonesViewModel = new ZonesViewModel();
     _directionsViewModel = new DirectionsViewModel();
     _filtersViewModel = new FiltersViewModel();
 }
コード例 #3
0
 private TopLevelDataModel()
 {
     Contacts       = new ObservableCollection <Contact> ();
     ToDo           = new ObservableCollection <IToDoItem> ();
     ToDone         = new ObservableCollection <IToDoItem> ();
     HelpMeDatabase = new StaticHelpTree();
     Directions     = new DirectionsViewModel();
 }
コード例 #4
0
ファイル: GKModuleLoader.cs プロジェクト: hjlfmy/Rubezh
 public GKModuleLoader()
 {
     ServiceFactory.Layout.AddToolbarItem(new GKConnectionIndicatorViewModel());
     ServiceFactory.Events.GetEvent<ShowXDeviceDetailsEvent>().Subscribe(OnShowXDeviceDetails);
     DevicesViewModel = new DevicesViewModel();
     ZonesViewModel = new ZonesViewModel();
     DirectionsViewModel = new DirectionsViewModel();
     JournalsViewModel = new JournalsViewModel();
     ArchiveViewModel = new ArchiveViewModel();
 }
コード例 #5
0
        public ActionResult ViewDirections(int id)
        {
            var UserId = System.Web.HttpContext.Current.User.Identity.GetUserId();
            DirectionsViewModel directions = new DirectionsViewModel();
            ActivityModel       activity   = db.Activity.Find(id);

            directions.Checkin  = new CheckinModel();
            directions.Activity = activity;
            double userLatitude  = (from x in db.Checkin where x.UserId == UserId && x.Active == true select x.Latitude).First();
            double userLongitude = (from x in db.Checkin where x.UserId == UserId && x.Active == true select x.Longitude).First();

            directions.Checkin.Latitude  = userLatitude;
            directions.Checkin.Longitude = userLongitude;
            return(View(directions));
        }
コード例 #6
0
ファイル: DevicesModule.cs プロジェクト: saeednazari/Rubezh
		public override void CreateViewModels()
		{
			ServiceFactory.Events.GetEvent<CreateZoneEvent>().Subscribe(OnCreateZone);
			ServiceFactory.Events.GetEvent<EditZoneEvent>().Subscribe(OnEditZone);
			ServiceFactory.Events.GetEvent<ShowDeviceEvent>().Subscribe(OnShowDevice);

			DevicesViewModel = new DevicesViewModel();
			DeviceParametersViewModel = new DeviceParametersViewModel();
			ParameterTemplatesViewModel = new ParameterTemplatesViewModel();
			ZonesViewModel = new ZonesViewModel();
			DirectionsViewModel = new DirectionsViewModel();
			GuardViewModel = new GuardViewModel();
			SimulationViewModel = new SimulationViewModel();
			_planExtension = new PlanExtension(DevicesViewModel, ZonesViewModel);
		}
コード例 #7
0
        // GET: Truckers/Directions/5
        public ActionResult Directions(int id)
        {
            var userId    = User.FindFirstValue(ClaimTypes.NameIdentifier);
            var foundUser = _repo.Trucker.FindByCondition(a => a.IdentityUserId == userId).SingleOrDefault();
            var foundJob  = _repo.Job.FindByCondition(a => a.JobId == id).SingleOrDefault();

            foundJob.Site = _repo.Site.FindByCondition(a => a.SiteId == foundJob.SiteId).SingleOrDefault();
            foundJob.Mill = _repo.Mill.FindByCondition(a => a.MillId == foundJob.MillId).SingleOrDefault();
            DirectionsViewModel model = new DirectionsViewModel()
            {
                Job     = foundJob,
                Trucker = foundUser
            };

            return(View(model));
        }
コード例 #8
0
		public DirectionPropertiesViewModel(IElementDirection element, DirectionsViewModel directionsViewModel)
		{
			_directionsViewModel = directionsViewModel;
			_element = element;
			CreateCommand = new RelayCommand(OnCreate);
			EditCommand = new RelayCommand(OnEdit, CanEdit);
			Title = "Свойства фигуры: ГК Направление";
			var directions = XManager.Directions;
			XDirections = new ObservableCollection<DirectionViewModel>();
			foreach (var direction in directions)
			{
				var directionViewModel = new DirectionViewModel(direction);
				XDirections.Add(directionViewModel);
			}
			if (_element.DirectionUID != Guid.Empty)
				SelectedXDirection = XDirections.FirstOrDefault(x => x.Direction.UID == _element.DirectionUID);
		}
コード例 #9
0
		public override void CreateViewModels()
		{
			ServiceFactory.Events.GetEvent<CreateXZoneEvent>().Subscribe(OnCreateXZone);
			ServiceFactory.Events.GetEvent<EditXZoneEvent>().Subscribe(OnEditXZone);
			ServiceFactory.Events.GetEvent<CreateXDirectionEvent>().Subscribe(OnCreateXDirection);
			ServiceFactory.Events.GetEvent<EditXDirectionEvent>().Subscribe(OnEditXDirection);

			DevicesViewModel = new DevicesViewModel();
			ParameterTemplatesViewModel = new ParameterTemplatesViewModel();
			ZonesViewModel = new ZonesViewModel();
			DirectionsViewModel = new DirectionsViewModel();
			PumpStationsViewModel = new PumpStationsViewModel();
			GuardViewModel = new GuardViewModel();
			FiltersViewModel = new FiltersViewModel();
			DeviceLidraryViewModel = new LibraryViewModel();
			InstructionsViewModel = new InstructionsViewModel();
			OPCDevicesViewModel = new OPCDevicesViewModel();
			OPCZonesViewModel = new OPCZonesViewModel();
			OPCDirectionsViewModel = new OPCDirectionsViewModel();
			DiagnosticsViewModel = new DiagnosticsViewModel();
			DescriptorsViewModel = new DescriptorsViewModel();
			_planExtension = new GKPlanExtension(DevicesViewModel, ZonesViewModel, DirectionsViewModel);
		}
コード例 #10
0
		public override void CreateViewModels()
		{
			ServiceFactory.Events.GetEvent<SelectGKZoneEvent>().Subscribe(OnSelectGKZone);
			ServiceFactory.Events.GetEvent<SelectGKZonesEvent>().Subscribe(OnSelectGKZones);
			ServiceFactory.Events.GetEvent<SelectGKGuardZoneEvent>().Subscribe(OnSelectGKGuardZone);
			ServiceFactory.Events.GetEvent<SelectGKGuardZonesEvent>().Subscribe(OnSelectGKGuardZones);
			ServiceFactory.Events.GetEvent<SelectGKDelayEvent>().Subscribe(OnSelectGKDelay);
			ServiceFactory.Events.GetEvent<SelectGKDelaysEvent>().Subscribe(OnSelectGKDelays);
			ServiceFactory.Events.GetEvent<SelectGKDirectionEvent>().Subscribe(OnSelectGKDirection);
			ServiceFactory.Events.GetEvent<SelectGKDirectionsEvent>().Subscribe(OnSelectGKDirections);
			ServiceFactory.Events.GetEvent<SelectGKMPTEvent>().Subscribe(OnSelectGKMPT);
			ServiceFactory.Events.GetEvent<SelectGKMPTsEvent>().Subscribe(OnSelectGKMPTs);
			ServiceFactory.Events.GetEvent<SelectGKDoorEvent>().Subscribe(OnSelectGKDoor);
			ServiceFactory.Events.GetEvent<SelectGKDoorsEvent>().Subscribe(OnSelectGKDoors);
			ServiceFactory.Events.GetEvent<SelectGKDeviceEvent>().Subscribe(OnSelectGKDevice);
			ServiceFactory.Events.GetEvent<SelectGKDevicesEvent>().Subscribe(OnSelectGKDevices);
			ServiceFactory.Events.GetEvent<SelectGKPumpStationEvent>().Subscribe(OnSelectGKPumpStation);
			ServiceFactory.Events.GetEvent<SelectGKPumpStationsEvent>().Subscribe(OnSelectGKPumpStations);

			DevicesViewModel = new DevicesViewModel();
			ParameterTemplatesViewModel = new ParameterTemplatesViewModel();
			ZonesViewModel = new ZonesViewModel();
			DirectionsViewModel = new DirectionsViewModel();
			DelaysViewModel = new DelaysViewModel();
			PumpStationsViewModel = new PumpStationsViewModel();
			MPTsViewModel = new MPTsViewModel();
			CodesViewModel = new CodesViewModel();
			GuardZonesViewModel = new GuardZonesViewModel();
			DoorsViewModel = new DoorsViewModel();
			SKDZonesViewModel = new SKDZonesViewModel();
			DeviceLidraryViewModel = new LibraryViewModel();
			OPCViewModel = new OPCsViewModel();
			DescriptorsViewModel = new DescriptorsViewModel();
			DiagnosticsViewModel = new DiagnosticsViewModel();
			_planExtension = new GKPlanExtension();
		}
コード例 #11
0
ファイル: GKModuleLoader.cs プロジェクト: saeednazari/Rubezh
		public override void CreateViewModels()
		{
			ServiceFactory.Layout.AddAlarmGroups(new AlarmGroupsViewModel());
			ServiceFactory.Layout.AddToolbarItem(new GKConnectionIndicatorViewModel());
			ServiceFactory.Events.GetEvent<ShowXJournalEvent>().Unsubscribe(OnShowJournal);
			ServiceFactory.Events.GetEvent<ShowXJournalEvent>().Subscribe(OnShowJournal);
			ServiceFactory.Events.GetEvent<NewXJournalEvent>().Unsubscribe(OnNewJournalRecord);
			ServiceFactory.Events.GetEvent<NewXJournalEvent>().Subscribe(OnNewJournalRecord);
			DevicesViewModel = new DevicesViewModel();
			ZonesViewModel = new ZonesViewModel();
			DirectionsViewModel = new DirectionsViewModel();
			DelaysViewModel = new DelaysViewModel();
			PimsViewModel = new PimsViewModel();
			PumpStationsViewModel = new PumpStationsViewModel();
			JournalsViewModel = new JournalsViewModel();
			ArchiveViewModel = new ArchiveViewModel();
			AlarmsViewModel = new AlarmsViewModel();
			ServiceFactory.Events.GetEvent<ShowXAlarmsEvent>().Unsubscribe(OnShowAlarms);
			ServiceFactory.Events.GetEvent<ShowXAlarmsEvent>().Subscribe(OnShowAlarms);
			ServiceFactory.Events.GetEvent<ShowXArchiveEvent>().Unsubscribe(OnShowArchive);
			ServiceFactory.Events.GetEvent<ShowXArchiveEvent>().Subscribe(OnShowArchive);
			ServiceFactory.Events.GetEvent<ShowGKDebugEvent>().Unsubscribe(OnShowGKDebug);
			ServiceFactory.Events.GetEvent<ShowGKDebugEvent>().Subscribe(OnShowGKDebug);
		}
コード例 #12
0
ファイル: MapPage.xaml.cs プロジェクト: Vanfen/RigaAppApi
        private async void Fill_Info(Position pos, string ImageName)
        {
            var geoInfo = await Plugin.Geolocator.CrossGeolocator.Current.GetPositionAsync(new TimeSpan(0, 0, 10), null, true);

            double curLat = 56.948891;
            double curLon = 24.105714;

            if (geoInfo != null)
            {
                // get the lat lng
                curLat = geoInfo.Latitude;
                curLon = geoInfo.Longitude;
                // get the location accuracy
                var locationAccuracy = (int)geoInfo.Accuracy;
            }

            //ObjectInfo.Text += curLat;
            //ObjectInfo.Text += curLon;
            //ObjectInfo.Text += "Image Name - " + ImageName;
            ObjectImage.Source = ImageName;


            DirectionsViewModel dir     = new DirectionsViewModel();
            Directions          dirList = await dir.Find_Directions(Convert.ToString(pos.Latitude), Convert.ToString(pos.Longitude), Convert.ToString(curLat), Convert.ToString(curLon));

            //Directions.Leg points = Directions.Leg dirList.Leg[0];


            //var tem = dirList.;
            //ObjectInfo.Text = tem;

            /*foreach (Directions dirData in dirList)
             * {
             *  ObjectInfo.Text = dirData.ToString();
             * }*/
        }
コード例 #13
0
		public DirectionsMenuViewModel(DirectionsViewModel context)
		{
			Context = context;
		}
コード例 #14
0
		public XDirectionPolygonAdorner(CommonDesignerCanvas designerCanvas, DirectionsViewModel directionsViewModel)
			: base(designerCanvas)
		{
			_directionsViewModel = directionsViewModel;
		}