Beispiel #1
0
        private void InitializeOthers()
        {
            m_logList = new ArrayList();
            for (int i = 0; i < 4; i++)
            {
                vo.LvLog listitem = new vo.LvLog();
                m_logList.Add(listitem.GetList());
            }

            //decklink setup
            m_deckLinkDiscovery = new DeckLinkDeviceDiscovery();

            m_frameConverter = new Bgra32FrameConverter();
        }
Beispiel #2
0
        private void BtnCue_Click(object sender, RoutedEventArgs e)
        {
            var    button  = sender as Button;
            String btnName = button.Name;

            List <vo.LvLog> lvLogItem;

            vo.LvLog lvLog = new vo.LvLog();

            switch (btnName)
            {
            case "BtnCue_1":
                TbEventID.Text = (Convert.ToInt32(TbEventID.Text) + 4).ToString();
                //_event_id += + 4;
                //Byte[] payload = File.ReadAllBytes(@"message/spliceStart_immediate.bin");
                Byte[] payload = MakePayload();

                //tcp
                util.Network conn = new util.Network();
                conn.SetConnection(TbIpaddr.Text, Convert.ToInt32(TbPort.Text));
                conn.SetPayload(payload);
                if (conn.Connect())
                {
                    lvLog.status = "Completed";
                }
                else
                {
                    lvLog.status = "Error";
                }

                //Clock clk = new Clock();

                lvLog.eventTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                //lvLog.eventTime = clk.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff");
                //log.ipAddress = common.Util.GetLocalIpAddress();
                lvLog.ipAddress = TbIpaddr.Text;
                lvLog.port      = Convert.ToInt32(TbPort.Text);
                //lvLog.eventType = cbEventType_1.Text;
                lvLog.eventType     = _eventType;
                lvLog.eventId       = TbEventID.Text;
                lvLog.uniquePid     = TbUnqProgramID.Text;
                lvLog.prerollTime   = TbPreroolTime.Text;
                lvLog.breakDuration = TbBreakDuration.Text;

                lvLogItem = (List <vo.LvLog>)m_logList[0];
                lvLogItem.Add(lvLog);
                lvLog.WriteLvLog();

                LvLog_1.ItemsSource = null;
                LvLog_1.ItemsSource = lvLogItem;
                LvLog_1.ScrollIntoView(LvLog_1.Items[LvLog_1.Items.Count - 1]);

                vo.JsonConfig jsonConfig = vo.JsonConfig.getInstance();
                jsonConfig.ipAddr        = TbIpaddr.Text;
                jsonConfig.port          = Convert.ToInt32(lvLog.port);
                jsonConfig.eventId       = Convert.ToInt32(lvLog.eventId);
                jsonConfig.uniquePid     = Convert.ToInt32(lvLog.uniquePid);
                jsonConfig.preRollTime   = Convert.ToInt32(lvLog.prerollTime);
                jsonConfig.breakDuration = Convert.ToInt32(lvLog.breakDuration);

                String jsonString = JsonSerializer.Serialize(jsonConfig);
                File.WriteAllText(jsonConfig.configFileName, jsonString);
                break;

            case "BtnOther":
                /*
                 * logitem = (List<vo.Log>)m_logList[1];
                 * logitem.Add(log);
                 * LvLog_2.ItemsSource = null;
                 * LvLog_2.ItemsSource = logitem;
                 */
                break;
            }
        }