Esempio n. 1
0
        internal void subscribe()
        {
            Log.LogMessage(LogLevels.BASIC, "Orders: Subscribing");

            String orderTopic = emsxapi.emsxServiceName + "/order";

            if (emsxapi.team != null)
            {
                orderTopic = orderTopic + ";team=" + emsxapi.team.name;
            }

            orderTopic = orderTopic + "?fields=";

            foreach (SchemaFieldDefinition f in emsxapi.orderFields)
            {
                if (f.name.Equals("EMSX_ORDER_REF_ID"))      // Workaround for schema field naming
                {
                    orderTopic = orderTopic + "EMSX_ORD_REF_ID" + ",";
                }
                else
                {
                    orderTopic = orderTopic + f.name + ",";
                }
            }

            orderTopic = orderTopic.Substring(0, orderTopic.Length - 1); // remove extra comma character

            emsxapi.subscribe(orderTopic, new OrderSubscriptionHandler(this));
            Log.LogMessage(LogLevels.BASIC, "Entering Order subscription lock");
            while (!emsxapi.orderBlotterInitialized)
            {
                Thread.Sleep(1);
            }
            Log.LogMessage(LogLevels.BASIC, "Order subscription lock released");
        }
Esempio n. 2
0
        internal void subscribe()
        {
            Log.LogMessage(LogLevels.BASIC, "Routes: Subscribing");

            String routeTopic = emsxapi.emsxServiceName + "/route";

            if (emsxapi.team != null)
            {
                routeTopic = routeTopic + ";team=" + emsxapi.team.name;
            }

            routeTopic = routeTopic + "?fields=";

            foreach (SchemaFieldDefinition f in emsxapi.routeFields)
            {
                routeTopic = routeTopic + f.name + ",";
            }

            routeTopic = routeTopic.Substring(0, routeTopic.Length - 1); // remove extra comma character

            Log.LogMessage(LogLevels.DETAILED, "Route Topic: " + routeTopic);

            emsxapi.subscribe(routeTopic, new RouteSubscriptionHandler(this));
            Log.LogMessage(LogLevels.BASIC, "Entering Route subscription lock");
            while (!emsxapi.routeBlotterInitialized)
            {
                Thread.Sleep(1);
            }
            Log.LogMessage(LogLevels.BASIC, "Route subscription lock released");
        }