示例#1
0
 /// <summary>
 /// デフォルト通信設定
 /// </summary>
 public void SetDefaultCommnicationSetting()
 {
     _comPort     = ComPortSettingDatas.DEFAULT_COM_PORT_NUM;
     _baudrate    = ComPortSettingDatas.DEFAULT_BAUDRATE;
     _parity      = ComPortSettingDatas.DEFAULT_PARITY;
     _dataBit     = ComPortSettingDatas.DEFAULT_DATA_BIT;
     _stopBit     = ComPortSettingDatas.DEFAULT_STOP_BIT;
     _flowControl = ComPortSettingDatas.DEFAULT_FLOW_CONTROL;
 }
示例#2
0
                RetrieveNextBatch()
                {
                    Seq <
                        Util.Try <ReplayCompletion> > msg;
                    using (var conn =
                               _connectionFactory.GetConnection())
                    {
                        msg = await Messages(conn, persistenceId,
                                             opt.Item1,
                                             toSequenceNr, batchSize)
                              .RunWith(
                            ExtSeq.Seq <Util.Try <ReplayCompletion> >(), mat);
                    }

                    var hasMoreEvents = msg.Count == batchSize;
                    //var lastMsg = msg.IsEmpty.LastOrDefault();
                    Util.Option <long> lastSeq = Util.Option <long> .None;
                    if (msg.IsEmpty == false)
                    {
                        lastSeq = msg.Last.Get().Repr.SequenceNr;
                    }


                    FlowControlEnum nextControl = FlowControlEnum.Unknown;
                    if ((lastSeq.HasValue &&
                         lastSeq.Value >= toSequenceNr) || opt.Item1 > toSequenceNr)
                    {
                        nextControl = FlowControlEnum.Stop;
                    }
                    else if (hasMoreEvents)
                    {
                        nextControl = FlowControlEnum.Continue;
                    }
                    else if (refreshInterval.HasValue == false)
                    {
                        nextControl = FlowControlEnum.Stop;
                    }
                    else
                    {
                        nextControl = FlowControlEnum.ContinueDelayed;
                    }

                    long nextFrom = opt.Item1;
                    if (lastSeq.HasValue)
                    {
                        nextFrom = lastSeq.Value + 1;
                    }

                    return new Util.Option <((long, FlowControlEnum), Seq <Util.Try <ReplayCompletion> >)>((
                                                                                                               (nextFrom, nextControl), msg));
                }