static void Main(string[] args) { string factoryID; string [] factories; loginService = ConnectionUtils.getLoginService(); sessionID = testLogin(); factories = getFactories(loginService, sessionID); factoryID = factories[0]; bool connected = connectToFactory(factoryID); registerMQListener(factoryID); Console.WriteLine("Connected to factory: " + connected); loginService.Close(); factoryService = ConnectionUtils.getFactoryService(); factory connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); string itemId1 = createItem(1, 17, 42, FactoryServiceReference.direction.SOUTH); string itemId2 = createItem(89, 0, 0, FactoryServiceReference.direction.NORTH); connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); int x = 20; int y = 20; direction dir = direction.WEST; position pos = getPosition(20, 20, direction.WEST); Console.WriteLine("Moving item " + itemId1 + " to " + x + "," + y + ", direction:" + dir); factoryService.moveItem(sessionID, itemId1, pos); connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); Console.WriteLine("deleting item " + itemId1); factoryService.deleteItem(sessionID, itemId1); connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); Console.WriteLine("Warte auf input"); Console.ReadKey(); }
public machineMap GetFactory() { try { return(factoryService.getFactory(sessionID)); } catch (EndpointNotFoundException) { ClientServerEvent(this, new ClientServerEventArgs()); } catch (FaultException) { ClientServerEvent(this, new ClientServerEventArgs("Fehler auf Server")); } return(null); }
public machineMap getFactory() { return(factoryService.getFactory(sessionID)); }
static void Main(string[] args) { string factoryID; string [] factories; loginService = ConnectionUtils.getLoginService(); sessionID = testLogin(); factories = getFactories(loginService, sessionID); factoryID = factories[0]; bool connected = connectToFactory(factoryID); registerMQListener(factoryID); Console.WriteLine("Connected to factory: "+connected); loginService.Close(); factoryService = ConnectionUtils.getFactoryService(); factory connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); string itemId1 = createItem(1, 17, 42, FactoryServiceReference.direction.SOUTH); string itemId2 = createItem(89, 0, 0, FactoryServiceReference.direction.NORTH); connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); int x = 20; int y = 20; direction dir = direction.WEST; position pos = getPosition(20, 20, direction.WEST); Console.WriteLine("Moving item " + itemId1 + " to " + x + "," + y + ", direction:" + dir); factoryService.moveItem(sessionID, itemId1, pos); connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); Console.WriteLine("deleting item " + itemId1); factoryService.deleteItem(sessionID, itemId1); connectedFactory = factoryService.getFactory(sessionID); printFactory(connectedFactory); Console.WriteLine("Warte auf input"); Console.ReadKey(); }