Ejemplo n.º 1
0
        public WebStationClient()
        {
            eventBus = SimpleEventBus.GetDefaultEventBus();
            eventBus.Register(this);
            foreach (var item in StaticData.AppHostConfig.StationNodes)
            {
                IStationDevice dObj      = null;
                string         className = item.GetType().GetProperty($"{StaticData.AppHostConfig.Environment}Service").GetValue(item).ToString();
                if (Type.GetType(className) == null)
                {
                    string path = $@"{StaticData.AppHostConfig.AppBinPath}\AgvStationClient.dll";

                    var assembly = Assembly.LoadFrom(path);
                    var tpe      = assembly.GetType(className);
                    dObj = Activator.CreateInstance(tpe) as IStationDevice;
                }
                else
                {
                    dObj = Assembly.GetAssembly(Type.GetType(className)).CreateInstance(className) as IStationDevice;
                }

                var proxy = new StationProxyService((AgvStationEnum)Enum.Parse(typeof(AgvStationEnum), item.StationId), dObj);
                dObj.RawIn_Prod          = item.GetType().GetProperty("ProdeuctType").GetValue(item).ToString();
                dObj.RawIn_Mate          = item.GetType().GetProperty("MaterielType").GetValue(item).ToString();
                proxy.SendSingnalrEvent += Proxy_SendSingnalrEvent;
                proxy.SendLogEvent      += Proxy_SendLogEvent;
                stationProxyServices.Add(proxy);
            }
        }
Ejemplo n.º 2
0
 public StationProxyService(AgvStationEnum id, IStationDevice stationDevice)
 {
     Station_Id         = id;
     this.StationDevice = stationDevice;
 }