예제 #1
0
        internal unsafe void OnOmsClientReport(ref f9rc.RcClientSession ses, ref f9oms.ClientReport rpt)
        {
            if (rpt.Layout_ != null)
            {
                if (rpt.ReportSNO_ == 0)
                {
                    // [下單要求]尚未進入 OmsCore 之前就被拒絕, OmsCore log 不會記錄此筆訊息.
                    return;
                }
            }
            else
            {
                // rpt.Layout_ == null // 回補結束.
            }
            this.LastSNO_ = rpt.ReportSNO_;

            if (rpt.Layout_ != null && (this.LogFlags & f9rc.ClientLogFlag.AllOmsRc) == f9rc.ClientLogFlag.AllOmsRc)
            {
                StringBuilder msg = new StringBuilder();
                msg.Append(rpt.Layout_->LayoutId_);
                msg.Append(':');
                msg.Append(rpt.Layout_->LayoutName_);
                for (uint L = 0; L < rpt.Layout_->FieldCount_; ++L)
                {
                    msg.Append('|');
                    msg.Append(rpt.Layout_->FieldArray_[L].Named_.Name_);
                    msg.Append('=');
                    msg.Append(rpt.FieldArray_[L].ToString());
                }
                PrintEvSplit("OnOmsClientReport");
                Console.WriteLine(msg);
            }
        }
예제 #2
0
 internal void OnOmsClientFcReq(ref f9rc.RcClientSession ses, uint usWait)
 {
     // 也可不提供此 function: f9oms.ClientSessionParams.FnOnFlowControl_ = null;
     // 則由 API 判斷超過流量時: 等候解除流量管制 => 送出下單要求 => 返回下單要求呼叫端.
     PrintEvSplit("OnClientFcReq");
     Console.WriteLine($"wait={usWait} us");
     System.Threading.Thread.Sleep((int)(usWait + 999) / 1000);
 }
예제 #3
0
 public static int SendRequestString(ref f9rc.RcClientSession ses, ref Layout reqLayout, byte[] reqBytes)
 {
     fon9.CStrView strView = new fon9.CStrView();
     unsafe
     {
         fixed(byte *p = reqBytes)
         {
             strView.Begin_ = new IntPtr(p);
             strView.End_   = new IntPtr(p + reqBytes.Length);
         }
     }
     return(SendRequestString(ref ses, ref reqLayout, strView));
 }
예제 #4
0
 internal void OnSvSubscribeReport(ref f9rc.RcClientSession ses, ref f9sv.ClientReport rpt)
 {
     if (rpt.Seed_ == IntPtr.Zero)
     { // 訂閱結果通知.
         if (rpt.ResultCode_ == f9sv.ResultCode.NoError)
         {
             // 訂閱成功.
         }
         else
         {
             // 訂閱失敗.
         }
     }
     PrintSvReport("OnSv.SubscribeReport", ref rpt);
 }
예제 #5
0
        // ---------------------------------------------------------------------
        internal unsafe void OnOmsClientConfig(ref f9rc.RcClientSession ses, ref f9oms.ClientConfig cfg)
        {
            fixed(void *pcfg = &cfg)
            {
                this.Config_ = (f9oms.ClientConfig *)pcfg;
            }

            if (!this.CoreTDay_.Equals(cfg.CoreTDay_))
            {
                this.LastSNO_  = 0;
                this.CoreTDay_ = cfg.CoreTDay_;
            }
            this.RequestRecs_ = new RequestRec[cfg.RequestLayoutCount_];
            for (uint iReqLayout = 0; iReqLayout < cfg.RequestLayoutCount_; ++iReqLayout)
            {
                this.RequestRecs_[iReqLayout]         = new RequestRec();
                this.RequestRecs_[iReqLayout].Fields_ = new string[cfg.RequestLayoutArray_[iReqLayout]->FieldCount_];
            }
            f9oms.Api.SubscribeReport(ref ses, ref cfg, this.LastSNO_ + 1, f9oms.RptFilter.AllPass);
        }
예제 #6
0
 // ---------------------------------------------------------------------
 internal unsafe void OnRcLinkEv(ref f9rc.RcClientSession ses, f9io.State st, fon9.CStrView info)
 {
     Console.WriteLine($"OnRcLinkEv|st={st}|info={info}");
     this.Config_ = null;
 }
예제 #7
0
 internal void OnSvUnsubscribeReport(ref f9rc.RcClientSession ses, ref f9sv.ClientReport rpt)
 {
     PrintSvReport("OnSv.UnsubscribeReport", ref rpt);
 }
예제 #8
0
 internal void OnSvQueryReport(ref f9rc.RcClientSession ses, ref f9sv.ClientReport rpt)
 {
     PrintSvReport("OnSv.QueryReport", ref rpt);
     this.LastQueryReportedUserData_ = rpt.UserData_;
 }
예제 #9
0
 internal void OnSvConfig(ref f9rc.RcClientSession ses, ref f9sv.ClientConfig cfg)
 {
     Console.WriteLine($"OnSvConfig|cfg.FcQry={cfg.FcQryCount_}/{cfg.FcQryMS_}|cfg.MaxSubr={cfg.MaxSubrCount_}");
     Console.WriteLine($"cfg.OrigStrView={cfg.RightsTables_.OrigStrView_}");
 }
예제 #10
0
 /// 傳送下單要求: 已組好的字串形式.
 /// \retval 1=true  下單要求已送出.
 /// \retval 0=false 無法下單: 沒有呼叫過 f9OmsRc_Initialize();
 ///                 或建立 ses 時, 沒有提供 f9OmsRc_ClientSessionParams 參數.
 public static int SendRequestString(ref f9rc.RcClientSession ses, ref Layout reqLayout, string reqStr)
 => SendRequestString(ref ses, ref reqLayout, System.Text.Encoding.UTF8.GetBytes(reqStr));
예제 #11
0
 public static unsafe extern Layout *GetReportLayout(ref f9rc.RcClientSession ses, ref ClientConfig cfg, uint rptTableId);
예제 #12
0
 public static unsafe extern Layout *GetRequestLayout(ref f9rc.RcClientSession ses, ref ClientConfig cfg, [MarshalAs(UnmanagedType.LPStr)] string reqName);
예제 #13
0
 public static extern void SubscribeReport(ref f9rc.RcClientSession ses, ref ClientConfig cfg, SNO from, RptFilter filter);
예제 #14
0
 public static extern uint CheckFcRequest(ref f9rc.RcClientSession ses);
예제 #15
0
 public static unsafe extern int SendRequestString(ref f9rc.RcClientSession ses, ref Layout reqLayout, fon9.CStrView reqStr);