Пример #1
0
        public ET42XControl(MMI.EBuLa.Tools.XMLLoader conf, ref Network net)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
                USE_DOUBLE_BUFFER = true;

            InitializeComponent();

            m_net = net;

            uhrAußen = new ISphere(508+60, 41+60, 57);
            uhrInnengr = new ISphere(508+60, 41+60, 45);
            uhrInnenkl = new ISphere(508+60, 41+60, 52);
            uhrsec = new ISphere(508+60, 41+60, 43);
            uhrmin = new ISphere(508+60, 41+60, 43);
            uhrstd = new ISphere(508+60, 41+60, 28);
            uhrrest = new ISphere(508+60, 41+60, 7);
            center = new Point(508+60, 41+60);

            m_conf = conf;

            // NOTBREMSE und E-BREMSE fehlen

            switch (m_conf.Sound)
            {
                case 1:
                    Sound = new APISound();
                    break;
                case 2:
                    Sound = new DxSound();
                    break;
                default:
                    Sound = new NullSound();
                    break;
            }

            localstate = new MMI.ET42X.ET42XState(ref conf, ref Sound);

            SetButtons();

            localstate.Energie = conf.Energie;

            vtime = DateTime.Now;

            zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft));

            int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;

            Button_SW_Pressed(this, new EventArgs());

            /*if (localstate.ET42Xtype1 == ET42XTYPE.ET423)
                localstate.FISType = FIS_TYPE.FIS;*/

            timer2.Enabled = true;

            if (vtime.DayOfYear > 100 && vtime.DayOfYear < 300)
                localstate.Kuehlung = true;
            else
                localstate.Kuehlung = false;
        }
Пример #2
0
        public VT612Control(MMI.EBuLa.Tools.XMLLoader conf)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
                USE_DOUBLE_BUFFER = true;

            InitializeComponent();

            uhrAußen = new ISphere(468+80, 41+80, 74);
            uhrInnengr = new ISphere(468+80, 41+80, 62);
            uhrInnenkl = new ISphere(468+80, 41+80, 69);
            uhrsec = new ISphere(468+80, 41+80, 60);
            uhrmin = new ISphere(468+80, 41+80, 60);
            uhrstd = new ISphere(468+80, 41+80, 47);
            uhrrest = new ISphere(468+80, 41+80, 10);
            center = new Point(468+80, 41+80);

            m_conf = conf;

            localstate = new MMI.VT612.VT612State();

            // NOTBREMSE und E-BREMSE fehlen

            SetButtons();

            vtime = DateTime.Now;

            zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft));

            int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;
        }