Пример #1
0
 private void Exit()
 {
     try
     {
         Quartz.Impl.StdScheduler scheduler = (Quartz.Impl.StdScheduler)SpringHelper.GetContext().GetObject("scheduler");
         scheduler.Shutdown();
     }
     catch (Exception ee)
     {
     }
 }
Пример #2
0
 static void Main()
 {
     try
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         RichFtpClient richFtpClient = SpringHelper.GetObject <RichFtpClient>("richFtpClient");
         Application.Run(richFtpClient);
     }
     catch (Exception ee)
     {
     }
 }
Пример #3
0
 static void Main()
 {
     try
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Form formMain = SpringHelper.GetObject <FormMain>("formMain");
         Application.Run(formMain);
     }
     catch (System.Exception ee)
     {
         LogHelper.GetLogger <FormMain>().Error(ee.InnerException.Message);
         LogHelper.GetLogger <FormMain>().Error(ee.InnerException.StackTrace);
     }
 }
Пример #4
0
        static void Main()
        {
            try
            {
                //初始化MiniDump
                MiniDump.Init();

                //SplashScreenForm.ShowSplash();


                //SplashScreenForm.CloseSplash();

                MobilityForm mobilityForm = SpringHelper.GetObject <MobilityForm>("mobilityForm");
                Application.Run(mobilityForm);
                //MainForm mainForm = SpringHelper.GetObject<MainForm>("mainForm");
                //ControlForm controlForm = SpringHelper.GetObject<ControlForm>("controlForm");
                //Application.Run(controlForm);
            }
            catch (Exception e)
            {
            }
        }
Пример #5
0
        private void formMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (testedRacks.TestStatus == TestStatus.RUNNING)
            {
                DialogResult result = MessageBox.Show("软件关闭前请先点击 停止测试 按钮!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                e.Cancel = true;
                return;
            }
            else
            {
                try
                {
                    Quartz.Impl.StdScheduler scheduler = (Quartz.Impl.StdScheduler)SpringHelper.GetContext().GetObject("scheduler");
                    scheduler.Shutdown();

                    udp.UdpClose();
                }
                catch (Exception ee)
                {
                    LogHelper.GetLogger <FormMain>().Error(ee.Message);
                    LogHelper.GetLogger <FormMain>().Error(ee.StackTrace);
                }
            }
        }
Пример #6
0
 private OperContext()
 {
     BLLSession = SpringHelper.GetObject <IBLLSession>("BLLSession");
 }
Пример #7
0
 public OperateHelper()
 {
     _serviceSession = SpringHelper.GetObject <IServiceSession>("ServiceSession");
 }
Пример #8
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)
            {
            }
        }
Пример #9
0
 public OperateContext()
 {
     bllSession = SpringHelper.GetObject <IBLLSessionFactory>("BLLSessionFactory").GetBLLSession();
 }
Пример #10
0
 private void buttonItemAbout_Click(object sender, EventArgs e)
 {
     aboutForm = SpringHelper.GetObject <About>("aboutForm");
     aboutForm.ShowDialog();
     aboutForm.Dispose();
 }
Пример #11
0
        protected override void Initialize()
        {
            uint version = 0;

            FMOD.RESULT result;

            result = FMOD.Factory.System_Create(ref SoundSystem);
            ERRCHECK(result);

            result = SoundSystem.getVersion(ref version);
            ERRCHECK(result);

            if (version < FMOD.VERSION.number)
            {
                System.Diagnostics.Debug.WriteLine("Error!  You are using an old version of FMOD " + version.ToString("X") + ".  This program requires " + FMOD.VERSION.number.ToString("X") + ".");
            }

            result = SoundSystem.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null);
            ERRCHECK(result);

            VectorRenderer = new VectorRenderComponent(this,
                                                       Content,
                                                       "Content\\Effects\\VectorLineEffect");
            this.Components.Add(VectorRenderer);

            sprite   = new SpriteBatch(Graphics.GraphicsDevice);
            font     = Content.Load <SpriteFont>("Content\\Tahoma");
            fontBold = Content.Load <SpriteFont>("Content\\TahomaBold");

            gamepad  = Content.Load <Texture2D>("Content\\Textures\\Controls_Gamepad");
            keyboard = Content.Load <Texture2D>("Content\\Textures\\Controls_Keyboard");
            mouse    = Content.Load <Texture2D>("Content\\Textures\\Controls_Mouse");

            ////////////////////
            // register groups
            BehaviorGroup camera = Scene.Coordinator.Register("Camera");

            camera.Associate(new LookAtCamera());//new Camera());
            camera.Associate(new CameraController());

            BehaviorGroup field = Scene.Coordinator.Register("Playing Field");

            field.Associate(new PlayingField(20, 0.25f, 10));
            field.Associate(new PlayingFieldVisual());

            BehaviorGroup player1 = Scene.Coordinator.Register("Player");

            player1.Associate(new SpringSkeleton());
            player1.Associate(new PlayerController(PlayerIndex.One, ControlScheme.Gamepad));
            player1.Associate(new PlayerVisual());
            player1.Associate(new PlayerTailRepresentation());

            BehaviorGroup player2 = Scene.Coordinator.Register("Player");

            player2.Associate(new SpringSkeleton());
            player2.Associate(new PlayerController(PlayerIndex.Two, ControlScheme.Mouse));
            player2.Associate(new PlayerVisual());
            player2.Associate(new PlayerTailRepresentation());

            BehaviorGroup ball = Scene.Coordinator.Register("Ball");

            ball.Associate(new BallVisual());
            ball.Associate(new BallController());
            ball.Associate(new BallRepresentation());

            BehaviorGroup player1Score = Scene.Coordinator.Register("Score Counter");

            player1Score.Associate(new ScoreCount());
            player1Score.Associate(new ScoreVisual());

            BehaviorGroup goal1 = Scene.Coordinator.Register("Goal");

            goal1.Associate(new GoalRepresentation(PlayerIndex.One));
            goal1.Associate(new GoalVisual());

            BehaviorGroup goal2 = Scene.Coordinator.Register("Goal");

            goal2.Associate(new GoalRepresentation(PlayerIndex.Two));
            goal2.Associate(new GoalVisual());

            BehaviorGroup advertisement1 = Scene.Coordinator.Register("Commercial");

            advertisement1.Associate(new BarrierVisual());
            BehaviorGroup advertisement2 = Scene.Coordinator.Register("Commercial");

            advertisement2.Associate(new BarrierVisual());

            BehaviorGroup collisionChecks = Scene.Coordinator.Register("Collision Check");

            collisionChecks.Associate(new CollisionCheck());

            ////////////////////
            // set defaults
            camera.Get <Transform>().Position = new Vector3(0, 12.5f, 14);

            collisionChecks.Get <CollisionCheck>().OwnGoal += new EventHandler <OwnGoalEventArgs>(Collision_OwnGoal);

            advertisement1.Get <Transform>().Position          = new Vector3(-(field.Get <PlayingField>().Width / 4), 0.75f, -(field.Get <PlayingField>().Depth / 2));
            advertisement1.Get <Transform>().Scale             = new Vector3((field.Get <PlayingField>().Width / 2) - 0.5f, 1, 1);
            advertisement1.Get <Transform>().Rotation          = Matrix.CreateRotationX(MathHelper.ToRadians(-35));
            advertisement1.Get <BarrierVisual>().Advertisement = Content.Load <Texture2D>("Content\\Textures\\Groov");

            advertisement2.Get <Transform>().Position          = new Vector3((field.Get <PlayingField>().Width / 4), 0.75f, -(field.Get <PlayingField>().Depth / 2));
            advertisement2.Get <Transform>().Scale             = new Vector3((field.Get <PlayingField>().Width / 2) - 0.5f, 1, 1);
            advertisement2.Get <Transform>().Rotation          = Matrix.CreateRotationX(MathHelper.ToRadians(-35));
            advertisement2.Get <BarrierVisual>().Advertisement = Content.Load <Texture2D>("Content\\Textures\\Midget");

            goal1.Get <Transform>().Position = new Vector3(-(field.Get <PlayingField>().Width / 2) - (goal1.Get <GoalRepresentation>().Extents.X / 2) + 0.5f, goal1.Get <GoalRepresentation>().Extents.Y / 2, 0);
            goal2.Get <Transform>().Position = new Vector3((field.Get <PlayingField>().Width / 2) + (goal2.Get <GoalRepresentation>().Extents.X / 2) - 0.5f, goal2.Get <GoalRepresentation>().Extents.Y / 2, 0);

            // player1
            SpringSkeleton skeleton = player1.Get <SpringSkeleton>();

            skeleton.Coefficient = 0.3f;
            skeleton.Elasticity  = 0.01f;
            skeleton.EnergyLoss  = 0.86f;

            skeleton.Enabled = true;

            SpringHelper.CreateChain(skeleton, 5, 0.35f, new Vector3(-1, 0, 0), false);

            skeleton.Nodes[skeleton.Nodes.Count - 1].Mass = 2;

            player1.Get <PlayerController>().Head = skeleton.Nodes[0];
            player1.Get <PlayerController>().Tail = skeleton.Nodes[skeleton.Nodes.Count - 1];

            // player2
            SpringSkeleton skeleton2 = player2.Get <SpringSkeleton>();

            skeleton2.Coefficient = 0.3f;
            skeleton2.Elasticity  = 0.01f;
            skeleton2.EnergyLoss  = 0.86f;

            skeleton2.Enabled = true;

            SpringHelper.CreateChain(skeleton2, 5, 0.35f, new Vector3(1, 0, 0), true);

            skeleton2.Nodes[skeleton2.Nodes.Count - 1].Mass = 2;

            player2.Get <PlayerController>().Head = skeleton2.Nodes[0];
            player2.Get <PlayerController>().Tail = skeleton2.Nodes[skeleton2.Nodes.Count - 1];

            base.Initialize();

            Scene.Start();

            // hack - this is because the dependency to the PlayingField behavior has not been injected before Scene.Start()
            ball.Get <BallController>().Reset();
        }
Пример #12
0
 private void NovoCyteSimulatorForm_Load(object sender, System.EventArgs e)
 {
     LoadJsonFile();
     var novoCyteSimulatorForm = SpringHelper.GetObject <NovoCyteConfig>("novoCyteConfig");
 }