Example #1
0
		public static void Create()
		{
			GKManager.DeviceConfiguration.UpdateConfiguration();
			GKManager.DeviceConfiguration.PrepareDescriptors();

			GkDatabases = new List<GkDatabase>();
			KauDatabases = new List<KauDatabase>();

			foreach (var device in GKManager.Devices.Where(x => x.DriverType == GKDriverType.GK))
			{
				var gkDatabase = new GkDatabase(device);
				GkDatabases.Add(gkDatabase);

				foreach (var kauDevice in device.Children.Where(x => x.Driver.IsKau || x.DriverType == GKDriverType.GKMirror))
				{
					var kauDatabase = new KauDatabase(kauDevice);
					gkDatabase.KauDatabases.Add(kauDatabase);
					KauDatabases.Add(kauDatabase);
				}
			}

			KauDatabases.ForEach(x => x.BuildObjects());
			GkDatabases.ForEach(x => x.BuildObjects());
			CreateDynamicObjectsInGKManager();
		}
Example #2
0
		public static void Create()
		{
			XManager.UpdateConfiguration();
			XManager.Prepare();

			GkDatabases = new List<GkDatabase>();
			KauDatabases = new List<KauDatabase>();

			foreach (var device in XManager.Devices)
			{
				if (device.DriverType == XDriverType.GK)
				{
					var gkDatabase = new GkDatabase(device);
					GkDatabases.Add(gkDatabase);

					foreach (var kauDevice in device.Children)
					{
						if (kauDevice.Driver.IsKauOrRSR2Kau)
						{
							var kauDatabase = new KauDatabase(kauDevice);
							gkDatabase.KauDatabases.Add(kauDatabase);
							KauDatabases.Add(kauDatabase);
						}
					}
				}
			}

			KauDatabases.ForEach(x => x.BuildObjects());
			GkDatabases.ForEach(x => x.BuildObjects());
			CreateDynamicObjectsInXManager();
		}
Example #3
0
		public Watcher(GkDatabase gkDatabase)
		{
			GkDatabase = gkDatabase;
			GKCallbackResult = new GKCallbackResult();
			IsStopping = false;
			IsSuspending = false;
		}
		public PumpStationDescriptor(GkDatabase gkDatabase, XPumpStation pumpStation)
		{
			DatabaseType = DatabaseType.Gk;
			DescriptorType = DescriptorType.PumpStation;
			PumpStation = pumpStation;

			MainDelay = new XDelay();
			MainDelay.UID = GuidHelper.CreateOn(PumpStation.UID);
			gkDatabase.AddDelay(MainDelay);

			Build();
		}
Example #5
0
		public void Start()
		{
			GkDatabase = DescriptorsManager.GkDatabases.FirstOrDefault();

			serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
			IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 1025);
			serverSocket.Bind(ipEndPoint);

			IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
			EndPoint epSender = (EndPoint)ipeSender;

			serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnReceive), epSender);
		}
Example #6
0
		public PumpStationCreator(GkDatabase gkDatabase, XPumpStation pumpStation, XDelay mainDelay)
		{
			GkDatabase = gkDatabase;
			PumpStation = pumpStation;
			MainDelay = mainDelay;

			PumpDelays = new List<PumpDelay>();

			FirePumpDevices = new List<XDevice>();
			foreach (var nsDevice in pumpStation.NSDevices)
			{
				if (nsDevice.Driver.IsPump)
				{
					var pumpTypeProperty = nsDevice.Properties.FirstOrDefault(x => x.Name == "PumpType");
					if (pumpTypeProperty != null)
					{
						if (pumpTypeProperty.Value == 0)
							FirePumpDevices.Add(nsDevice);
						if (pumpTypeProperty.Value == 1)
							JNPumpDevice = nsDevice;
					}
				}
			}
		}
Example #7
0
		public Watcher(GkDatabase gkDatabase)
		{
			GkDatabase = gkDatabase;
			GKCallbackResult = new GKCallbackResult();
		}
Example #8
0
		public void Start()
		{
			GkDatabase = DescriptorsManager.GkDatabases.FirstOrDefault();
			StartSocket();
		}