예제 #1
0
 public static NovoCyteConfig GetInstance()
 {
     if (novoCyteConfig == null)
     {
         string path = string.Format(@"{0}\\{1}", System.Environment.CurrentDirectory, "Config\\novosys_cfg.json");
         if (File.Exists(path))
         {
             string jsonText = File.ReadAllText(path);
             novoCyteConfig = JsonFile.GetNovoCyteConfigFromJsonText(jsonText);
         }
     }
     return(novoCyteConfig);
 }
예제 #2
0
        static void Main()
        {
            MiniDump.Init();
            SimulatorForm simulatorForm;

            try
            {
                //var v = NovoCyteConfig.GetInstance().Config.CytometerInfo;
                //var v1 = v.LaserConfig;
                //var v2 = FLChannel.FromLaserAndDetectionChannel(v.LaserConfig[0].ID, v.LaserConfig, v.PMTConfig[0].ID);
                //var v3 = FLChannel.FromLaserAndDetectionChannel(v.LaserConfig[1].ID, v.LaserConfig, v.PMTConfig[0].ID);
                //var vv = NovoCyteConfig.GetInstance().Config.LaserConfig.LaserChannelIDDic[Equipment.LaserType.nm405nm488nm640];
                //var startTime = (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds;
                //MotorManager motor = MotorManager.GetMotorManager();
                //motor.run(2, 40, -450);
                //Console.WriteLine("--->> C#中执行Lua脚本");
                ////C#中执行lua脚本文件
                //Lua lua = new Lua();
                //lua.DoFile("LuaScript\\subwork.lua");
                //lua.DoFile("LuaScript\\motor.lua");
                //lua.DoFile("LuaScript\\logtest.lua");
                //Console.ReadKey();

                //LaserConfig laserConfig = new LaserConfig();

                //CytometerInfo ci = new CytometerInfo();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //novoCyteSimulatorForm = SpringHelper.GetObject<NovoCyteSimulatorForm>("novoCyteSimulatorForm");
                simulatorForm = SpringHelper.GetObject <SimulatorForm>("simulatorForm");
                Config    config   = NovoCyteConfig.GetInstance().Config;
                PMTInfo[] pmtInfos = config.CytometerInfo.PMTConfig.List;
                string[]  filters  = new string[pmtInfos.Length];
                for (int i = 0; i < pmtInfos.Length; i++)
                {
                    filters[i] = pmtInfos[i].Filter;
                }
                NovoCyteConfig.GetInstance().Config.CytometerInfo.PMTConfig.Set(Equipment.Type.nm405nm488nm640, new bool[] { true, true, true, true, true, true, false, false },
                                                                                true, PMTConfig.Layout.FL16, filters);
                var v = FLChannel.GetFLChannel(NovoCyteConfig.GetInstance().Config.CytometerInfo).channels;
                //var v1 = FLChannel.GetFLChannel(config.CytometerInfo);
                //var channel = FLChannel.GetFLChannel(config.CytometerInfo).GetPxLxChannelID(0);
                //for (int i=0; i<13; i++)
                //{
                //    var C = FLChannel.GetFLChannel(config.CytometerInfo).GetPxLxChannelID(i).ToString();
                //    Console.WriteLine(C);
                //}
                //var vv = NovoCyteConfig.GetInstance();
                ////vv.Config = new Config();
                //vv.Config = config;
                //Equipment.LaserConfig c = new Equipment.LaserConfig();
                //vv.Config.CytometerInfo = ci;
                //config.CytometerInfo = ci;
                simulatorForm.Config = config;
                //var s = JsonFile.GetJsonTextFromNovoCyteConfig(vv);
                //string path = string.Format(@"{0}\\{1}", System.Environment.CurrentDirectory, "Config\\novosys_cfg.json");
                //try
                //{
                //    File.WriteAllText(path, s);
                //}
                //catch (Exception ee)
                //{

                //}
                Dictionary <byte, CBase> decoders = SpringHelper.GetObject <Dictionary <System.Byte, NovoCyteSimulator.Messages.CBase> >("decoders");
                foreach (var decoder in decoders.Values)
                {
                    decoder.Config = config;
                }
                Application.Run(simulatorForm);
            }
            catch (Exception ee)
            {
            }
        }