コード例 #1
0
        static void Main()
        {
            // 准备输入数据
            SQX LK_SQX = new SQX("LK", InputDatas.LKSQX);
            DMX LK_DMX = new DMX("LK", InputDatas.LKDMX);
            GZX LK_GZX = new GZX("LK", InputDatas.LKBOB);


            // 调用配置器
            //Configer Bill = new Configer("E763Config");
            Configer Bill = new Configer("GeneralConfig");

            Bill.ConfigInstance.BridgeList = LK_GZX;
            Bill.ConfigInstance.Dmx        = LK_DMX;
            Bill.ConfigInstance.Sjx        = LK_SQX;
            //Bill.ConfigInstance.Record = AllRecord;
            Bill.ConfigInstance.Run();



            // 完成



            Console.ReadKey();
        }
コード例 #2
0
 void Start()
 {
     this.dmx             = new DMX("COM3");
     this.dmx.Channels[1] = 44;
     this.dmx.Channels[2] = 44;
     this.dmx.Channels[3] = 44;
     this.dmx.Send();
 }
コード例 #3
0
    public IEnumerator Start()
    {
        yield return(new WaitForSeconds(0.2f));

        dmx = new DMX(Port);
        if (dmx == null)
        {
            yield break;
        }
    }
コード例 #4
0
        public App()
        {
            InitializeComponent();



            MainPage = new ConnectPage();

            //if (DMX.ScanForDMX())
            //{
            //    CurrentPage = Page.Channel;
            //    MainPage = new ChannelPage(dmx, Channels);
            //}

            Device.StartTimer(TimeSpan.FromSeconds(1), () =>
            {
                bool isConnected = DMX.ScanForDMX();

                if (isConnected)
                {
                    if (CurrentPage == Page.Connect)
                    {
                        dmx = new DMX();

                        for (int i = 1; i <= 512; i++)
                        {
                            Channels.Add(new Channel()
                            {
                                Dmx   = dmx,
                                Index = i,
                                Value = 0,
                            });
                        }
                        CurrentPage = Page.Channel;
                        MainPage    = new ChannelPage(dmx, Channels);
                    }
                }
                else
                {
                    if (CurrentPage == Page.Channel)
                    {
                        CurrentPage = Page.Connect;
                        MainPage    = new ConnectPage();
                    }
                }



                return(true); // True = Repeat again, False = Stop the timer
            });
        }
コード例 #5
0
    // Use this for initialization
    void  Start()
    {
        this.dmx = new DMX(this.ComPort);

        //this.SetColor(Color.black);

        // Cycle through the color wheel
        //yield return StartCoroutine(FadeColor(Color.black, Color.red, 5f));
        //yield return StartCoroutine(FadeColor(Color.red, Color.yellow, 5f));
        //yield return StartCoroutine(FadeColor(Color.yellow, Color.green, 5f));
        //yield return StartCoroutine(FadeColor(Color.green, Color.blue, 5f));
        //yield return StartCoroutine(FadeColor(Color.blue, Color.magenta, 5f));
        //yield return StartCoroutine(FadeColor(Color.magenta, Color.white, 5f));
        //yield return StartCoroutine(FadeColor(Color.white, Color.black, 5f));
    }
コード例 #6
0
    // Use this for initialization
    private void Start()
    {
        try {
            this.dmx = new DMX(this.ComPort);
        } catch (Exception e) {
            activeDMX = false;
            Destroy(this.gameObject);
        }

        if (activeDMX)
        {
            this.SetColor(Color.cyan, Position.FrontRight);
            this.SetColor(Color.cyan, Position.FrontLeft);
            this.SetColor(Color.cyan, Position.BackLeft);
            this.SetColor(Color.cyan, Position.BackRight);
        }
    }
コード例 #7
0
    private void Init()
    {
        _teamManager = TeamManager.Instance;
        dmx          = dmx ?? new DMX(Port);
        Reset();
        _leds = new ArrowLED[Columms, Rows];

        for (int x = 0; x < Columms; x++)
        {
            _ledLanes.Add(new List <ArrowLED>());
            for (int y = 0; y < Rows; y++)
            {
                var arrow = new ArrowLED((Columms * y + x) * 3);
                _ledLanes[x].Add(arrow);
                _leds[x, y] = arrow;
            }
        }

        _ledLanes.ForEach(list => list.Reverse());
        AppStateBroker.Instance
        .CurrentRound
        .Where(x => x == Rounds.Idle)
        .Subscribe(_ => Reset())
        .AddTo(gameObject);

        _teamManager
        .PlayerSequences
        .ObserveAdd()
        .Subscribe(lane =>
        {
            lane.Value
            .Subscribe(sq =>
            {
                if (sq == AnimSequence.OnReadyExit)
                {
                    AnimateLeds(lane.Key, 3.5f);
                }
                else if (sq == AnimSequence.FinishEnter)
                {
                    OffLast(lane.Key);
                }
            })
            .AddTo(gameObject);
        }).AddTo(gameObject);
    }
コード例 #8
0
        private void OnOpenDMXFile(object sender, RoutedEventArgs e)
        {
            //if (this.Dispatcher != System.Windows.Threading.Dispatcher.CurrentDispatcher)
            //{
            //    this.Dispatcher.Invoke(new Action<object, RoutedEventArgs>(OnOpenDMXFile), sender, e);
            //}
            //else
            //{
            OpenFileDialog diag = new OpenFileDialog();

            diag.Title           = "Select DMX File";
            diag.CheckFileExists = true;
            diag.CheckPathExists = true;
            diag.DefaultExt      = "xml";
            diag.Filter          = "Xml Files|*.xml|All Files|*.*";
            if (diag.ShowDialog() == true)
            {
                DMX.LoadFile(diag.FileName);
            }
            //}
        }
コード例 #9
0
    public void SetColor(Color c, DMX dmx, params Action[] toInvoke)
    {
        if (dmx != null)
        {
            var rval = c.r.FromTo(0, 1, 0, 255);
            var gval = c.g.FromTo(0, 1, 0, 255);
            var bval = c.b.FromTo(0, 1, 0, 255);

            dmx.Channels[r] = (byte)rval;
            dmx.Channels[g] = (byte)gval;
            dmx.Channels[b] = (byte)bval;
            try
            {
                dmx.Send();
            }
            catch (Exception e)
            {
                Debug.Log(e);
            }
        }
    }
コード例 #10
0
 public ColorMonitor(DMX dmx)
 {
     this.dmx = dmx;
 }
コード例 #11
0
    /// <summary>
    /// 发送
    /// </summary>
    /// <param name="scene">场景盒子ID</param>
    /// <param name="file_name">文件名</param>
    /// <param name="lightType">文件类型</param>
    public void Send(string scene, string file_name, LigntType lightType)
    {
        string str = "55 AA";    //设置指令头

        str = str + " " + scene; //设置地址

        DMX d = new DMX();

        switch (lightType)
        {
        case LigntType.Play:
            str = str + " " + d.appoint + " " + FileToHex(file_name);
            break;

        case LigntType.Pause:
            str = str + " " + d.pause + " 00";
            break;

        case LigntType.Stop:
            str = str + " " + d.stop + " 00";
            break;

        case LigntType.Next:
            str = str + " " + d.appoint + " " + FileToHex(file_name);
            break;

        case LigntType.Last:
            str = str + " " + d.appoint + " " + FileToHex(file_name);
            break;

        case LigntType.Appoint:
            str = str + " " + d.appoint + " " + FileToHex(file_name);
            break;

        case LigntType.SD:
            str = str + " " + d.sd;
            break;

        case LigntType.Drd:
            str = str + " " + d.drd;
            break;

        case LigntType.OneCycle:
            str = str + " " + d.oneCycle;
            break;

        case LigntType.OneStop:
            str = str + " " + d.oneStop;
            break;
        }//加入指令


        byte[] by = strToToHexByte(str);
        byte   bb = 00;

        for (int i = 2; i < by.Length; i++)
        {
            bb += by[i];
        }
        string strs = Convert.ToString((0 - bb), 16).ToString();//计算数据包校验

        str = str + " " + strs.Substring(strs.Length - 2, 2).ToUpper();

        Debug.Log(str);

        if (sp.IsOpen)
        {
            sp.Write(strToToHexByte(str), 0, strToToHexByte(str).Length);
        }
    }
コード例 #12
0
ファイル: Dmxmanager.cs プロジェクト: LaileLaile/Nike001
    public Dmxmanager()
    {
        port = Globaldata.Global.dmxPort;

        dmx = new DMX(port);
    }
コード例 #13
0
    // Use this for initialization
    void Start()
    {
        this.dmx = new DMX(this.ComPort);

        this.SetColor(Color.black);
    }
コード例 #14
0
 public MeditationMonitor(DMX dmx)
 {
     this.dmx = dmx;
 }
コード例 #15
0
 public DmxMonitor(DMX dmx)
 {
     this.dmx = dmx;
 }
コード例 #16
0
 public HeartRateMonitor(DMX dmx)
 {
     this.dmx = dmx;
 }
コード例 #17
0
 public DimmerMonitor(DMX dmx)
 {
     this.dmx = dmx;
 }