コード例 #1
0
ファイル: MainForm.cs プロジェクト: marylucey97/SyAutoH
        private void timer1_Tick(object sender, EventArgs e)
        {
            List <MCS.GuiDataItem> listGuiData = new List <MCS.GuiDataItem>();

            lock (buf)
            {
                DateTime dt = DateTime.MinValue;
                dt = dt.AddYears(1969);
                dt = dt.AddSeconds(m_ltime64);
                dt = dt.ToLocalTime();
                this.toolStripStatusLabel_PushTime.Text = "Last Push: " + dt.ToString() + " ";
                while (buf.Count != 0)
                {
                    MCS.GuiDataItem item = buf.Dequeue();
                    listGuiData.Add(item);
                }
            }

            if (null != m_ctrlBase)
            {
                m_ctrlBase.ProcessGuiData(listGuiData);
            }

            DateTime dtNow = DateTime.Now;
            TimeSpan span  = dtNow - m_dataHub.UpdateTime;

            if (span.TotalSeconds > 2)
            {
                m_dataHub.Async_SetCallBack();
            }
        }
コード例 #2
0
 private void GuiDataUpdate(long lTime, MCS.GuiDataItem guiData)
 {
     lock (quGuiData)
     {
         quGuiData.Enqueue(guiData);
     }
 }
コード例 #3
0
 private void GuiDataUpdate(long lTime, MCS.GuiDataItem item)
 {
     lock (buf)
     {
         buf.Enqueue(item);
     }
 }
コード例 #4
0
 private void ProcessDataBuf()
 {
     while (buf.Count != 0)
     {
         MCS.GuiDataItem item = buf.Dequeue();
         ProcessGuiData(item);
     }
 }
コード例 #5
0
 private void ProcessGuiDataBuf()
 {
     lock (quGuiData)
     {
         while (quGuiData.Count != 0)
         {
             MCS.GuiDataItem item = quGuiData.Dequeue();
             UpdateOHTPosition(item);
         }
     }
 }
コード例 #6
0
        private void ProcessGuiDataItem(MCS.GuiDataItem guiData)
        {
            ProcessHandler handler = null;
            bool           bGet    = m_dictProcess.TryGetValue(guiData.enumTag, out handler);

            if (true == bGet)
            {
                ArrayList alDatas = GuiAccess.DataHubCli.ConvertToArrayList(guiData.sVal);
                foreach (ArrayList item in alDatas)
                {
                    handler(item);
                }
            }
        }
コード例 #7
0
        private void UpdateOHTPosition(MCS.GuiDataItem guiDataItem)
        {
            if (guiDataItem.enumTag.CompareTo(MCS.GuiHub.PushData.upOhtPos) != 0)
            {
                return;
            }
            if (guiDataItem.sVal.Length < 1)
            {
                return;
            }
            string strVal = guiDataItem.sVal;

            string strSplit = "<>";

            char[]   spliter = strSplit.ToCharArray();
            string[] strItem = strVal.Split(spliter);

            List <OhtPos> listOht = new List <OhtPos>();

            foreach (string strOht in strItem)
            {
                if (strOht.Length > 0)
                {
                    string[] strParams = strOht.Split(',');
                    if (strParams.Length > 1)       //???
                    {
                        OhtPos oht = new OhtPos();
                        oht.nID   = Convert.ToByte(strParams[0]);
                        oht.nPos  = Convert.ToUInt32(strParams[1]);
                        oht.nHand = Convert.ToByte(strParams[2]);
                        listOht.Add(oht);
                    }
                }
            }


            formOperation.UpdateOHTPos(listOht);
        }
コード例 #8
0
ファイル: iGuiHub.cs プロジェクト: JiangJunGG/SyAutoH
 private Ice.AsyncResult<MCS.Callback_GuiDataUpdater_UpdateData> begin_UpdateData(long time, MCS.GuiDataItem data, _System.Collections.Generic.Dictionary<string, string> ctx__, bool explicitContext__, Ice.AsyncCallback cb__, object cookie__)
 {
     IceInternal.OnewayOutgoingAsync<MCS.Callback_GuiDataUpdater_UpdateData> result__ = new IceInternal.OnewayOutgoingAsync<MCS.Callback_GuiDataUpdater_UpdateData>(this, __UpdateData_name, UpdateData_completed__, cookie__);
     if(cb__ != null)
     {
         result__.whenCompletedWithAsyncCallback(cb__);
     }
     try
     {
         result__.prepare__(__UpdateData_name, Ice.OperationMode.Idempotent, ctx__, explicitContext__);
         IceInternal.BasicStream os__ = result__.ostr__;
         os__.writeLong(time);
         if(data == null)
         {
             MCS.GuiDataItem tmp__ = new MCS.GuiDataItem();
             tmp__.write__(os__);
         }
         else
         {
             data.write__(os__);
         }
         os__.endWriteEncaps();
         result__.send__(true);
     }
     catch(Ice.LocalException ex__)
     {
         result__.exceptionAsync__(ex__);
     }
     return result__;
 }
コード例 #9
0
ファイル: iGuiHub.cs プロジェクト: JiangJunGG/SyAutoH
 public static Ice.DispatchStatus UpdateData___(GuiDataUpdater obj__, IceInternal.Incoming inS__, Ice.Current current__)
 {
     checkMode__(Ice.OperationMode.Idempotent, current__.mode);
     IceInternal.BasicStream is__ = inS__.istr();
     is__.startReadEncaps();
     long time;
     time = is__.readLong();
     MCS.GuiDataItem data;
     data = null;
     if(data == null)
     {
         data = new MCS.GuiDataItem();
     }
     data.read__(is__);
     is__.endReadEncaps();
     AMD_GuiDataUpdater_UpdateData cb__ = new _AMD_GuiDataUpdater_UpdateData(inS__);
     try
     {
         obj__.UpdateData_async(cb__, time, data, current__);
     }
     catch(_System.Exception ex__)
     {
         cb__.ice_exception(ex__);
     }
     return Ice.DispatchStatus.DispatchAsync;
 }
コード例 #10
0
ファイル: iGuiHub.cs プロジェクト: JiangJunGG/SyAutoH
 public void UpdateData(long time, MCS.GuiDataItem data, _System.Collections.Generic.Dictionary<string, string> context__)
 {
     IceInternal.Outgoing og__ = handler__.getOutgoing("UpdateData", Ice.OperationMode.Idempotent, context__);
     try
     {
         try
         {
             IceInternal.BasicStream os__ = og__.ostr();
             os__.writeLong(time);
             if(data == null)
             {
                 MCS.GuiDataItem tmp__ = new MCS.GuiDataItem();
                 tmp__.write__(os__);
             }
             else
             {
                 data.write__(os__);
             }
         }
         catch(Ice.LocalException ex__)
         {
             og__.abort(ex__);
         }
         bool ok__ = og__.invoke();
         if(!og__.istr().isEmpty())
         {
             try
             {
                 if(!ok__)
                 {
                     try
                     {
                         og__.throwUserException();
                     }
                     catch(Ice.UserException ex__)
                     {
                         throw new Ice.UnknownUserException(ex__.ice_name(), ex__);
                     }
                 }
                 og__.istr().skipEmptyEncaps();
             }
             catch(Ice.LocalException ex__)
             {
                 throw new IceInternal.LocalExceptionWrapper(ex__, false);
             }
         }
     }
     finally
     {
         handler__.reclaimOutgoing(og__);
     }
 }
コード例 #11
0
        private void ProcessGuiData(MCS.GuiDataItem guiData)
        {
            if (guiData.enumTag.CompareTo(PushData.upOhtInfo) == 0)
            {
                string   strVal   = guiData.sVal;
                string   strSplit = "<>";
                char[]   spliter  = strSplit.ToCharArray();
                string[] strItem  = strVal.Split(spliter);
                foreach (string strOht in strItem)
                {
                    if (strOht.Length > 0)
                    {
                        string[] strParams = strOht.Split(',');
                        if (strParams.Length == 3)
                        {
                            string strID  = strParams[0];
                            string strTCP = strParams[1] + ":" + strParams[2];

                            ListViewItem lvItem = listViewOHTs.FindItemWithText(strID);
                            if (lvItem != null)
                            {
                                lvItem.SubItems[5].Text = strTCP;
                            }
                            else
                            {
                                lvItem      = new ListViewItem();
                                lvItem.Text = strID;
                                lvItem.SubItems.Add("");
                                lvItem.SubItems.Add("");
                                lvItem.SubItems.Add("");
                                lvItem.SubItems.Add("");
                                lvItem.SubItems.Add("");
                                lvItem.SubItems[5].Text = strTCP;
                                listViewOHTs.Items.Add(lvItem);
                            }
                        }
                    }
                }
            }
            else if (guiData.enumTag.CompareTo(PushData.upOhtPos) == 0)
            {
                string   strVal   = guiData.sVal;
                string   strSplit = "<>";
                char[]   spliter  = strSplit.ToCharArray();
                string[] strItem  = strVal.Split(spliter);
                foreach (string strOht in strItem)
                {
                    if (strOht.Length > 0)
                    {
                        string[] strParams = strOht.Split(',');
                        if (strParams.Length == 3)
                        {
                            string strID = strParams[0];

                            ListViewItem lvItem = listViewOHTs.FindItemWithText(strID);
                            if (lvItem != null)
                            {
                                lvItem.SubItems[1].Text = strParams[1];
                                lvItem.SubItems[2].Text = strParams[2];
                            }
                        }
                    }
                }
            }
        }