public Source_GPIO(
     rfid.Constants.GpioPin nativePin,
     OpState                state
 )
     : base()
 {
     this.nativePin = nativePin;
     this.access    = OpAccess.SET;
     this.state     = state;
     this.status    = OpResult.FAILURE;
 }
Exemple #2
0
 public FmEquipment(EquipmentClass modelC, OpState op = OpState.Add) : this()
 {
     this.opState = op;
     this.modelC  = modelC;
 }
Exemple #3
0
 public OpItem(OpState state, object opval)
 {
     this.OpState = state;
     this.OpValue = opval;
 }
Exemple #4
0
 //新增
 private void Add(object sender, EventArgs e)
 {
     this.opState = OpState.Add;
     this.RefreshUI();
 }
Exemple #5
0
 private void StartTimeoutTrack(int timeout)
 {
     this._opState = OpState.Working;
     this._timer.Change(timeout, -1);
 }
Exemple #6
0
 public FmQMItem(int QMItemId, OpState op = OpState.Browse) : this()
 {
     this.model = dal.Get(QMItemId);
 }
Exemple #7
0
 public FmBILL(OpState operation)
 {
     InitializeComponent();
     this.opState = operation;
 }
Exemple #8
0
 //取消
 private void Btn_Cancel_Click(object sender, EventArgs e)
 {
     this.opState = OpState.Browse;
     UIControl.SetStatus(bar1, bar2, pnlMain, gridView1, OpState.Browse);
     //this.LoadData(curId);
 }
Exemple #9
0
 public FmBIU(OpState opState)
 {
     InitializeComponent();
     this.Load   += FormLoad;
     this.opState = opState;
 }
Exemple #10
0
 public FmInvDetail(OpState op, InventoryClass invC)
 {
     InitializeComponent();
     this.opState = op;
     this.invC    = invC;
 }
Exemple #11
0
        public static void SetStatus(Bar toolbar, Bar dbar, Control panMain, GridView grid, OpState mode)
        {
            ButtonItem item;

            if (mode == OpState.Browse)
            {
                foreach (BaseItem aitem in toolbar.Items)
                {
                    #region toolbar
                    if (aitem is ButtonItem)
                    {
                        item = aitem as ButtonItem;
                        if (item.Text.Contains("增"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Text.Contains("删"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Text.Contains("改"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Text.Contains("存"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Text.Contains("消"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Text.Contains("审"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Name.Contains("previous"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Name.Contains("next"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Name.Contains("last"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Name.Contains("first"))
                        {
                            item.Enabled = true;
                        }
                    }
                    #endregion
                }
                foreach (BaseItem aitem in dbar.Items)
                {
                    if (aitem is ButtonItem)
                    {
                        (aitem as ButtonItem).Enabled = false;
                    }
                }
                foreach (Control ctrl in panMain.Controls)
                {
                    if (ctrl is TextEdit)
                    {
                        (ctrl as TextEdit).ReadOnly  = true;
                        (ctrl as TextEdit).BackColor = System.Drawing.Color.LightGray;
                    }
                    if (ctrl is ButtonEdit)
                    {
                        (ctrl as ButtonEdit).Properties.Buttons[0].Visible = false;
                    }
                }

                grid.OptionsBehavior.ReadOnly         = true;
                grid.OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect;
                grid.OptionsBehavior.Editable         = false;
            }
            else if (mode == OpState.Update || mode == OpState.Add)
            {
                foreach (BaseItem aitem in toolbar.Items)
                {
                    #region toolbar
                    if (aitem is ButtonItem)
                    {
                        item = aitem as ButtonItem;

                        if (item.Text.Contains("增"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Text.Contains("删"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Text.Contains("改"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Text.Contains("存"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Text.Contains("消"))
                        {
                            item.Enabled = true;
                        }
                        else if (item.Text.Contains("审"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Name.Contains("previous"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Name.Contains("next"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Name.Contains("last"))
                        {
                            item.Enabled = false;
                        }
                        else if (item.Name.Contains("first"))
                        {
                            item.Enabled = false;
                        }
                    }
                    #endregion
                }
                foreach (BaseItem aitem in dbar.Items)
                {
                    if (aitem is ButtonItem)
                    {
                        (aitem as ButtonItem).Enabled = true;
                    }
                }
                foreach (Control ctrl in panMain.Controls)
                {
                    if (ctrl is TextEdit)
                    {
                        if ((ctrl as TextEdit).Name.Substring(0, 4).ToLower() != "txtr")
                        {
                            (ctrl as TextEdit).ReadOnly  = false;
                            (ctrl as TextEdit).BackColor = System.Drawing.Color.White;
                        }
                        if (ctrl is ButtonEdit)
                        {
                            (ctrl as ButtonEdit).Properties.Buttons[0].Visible = true;
                        }
                    }
                }

                grid.OptionsBehavior.ReadOnly         = false;
                grid.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
                grid.OptionsBehavior.Editable         = true;
            }
        }
Exemple #12
0
 public FmMouldEqInvAdd(string MId, OpState op = OpState.Update) : this()
 {
     this.MId = MId;
 }
Exemple #13
0
 private void BtnAdd_Click(object sender, EventArgs e)
 {
     this.opState = OpState.Add;
     this.model   = dal.New();
     this.RefreshUI();
 }
Exemple #14
0
        //int orderId;
        //public OpAndType(MeshFilter mesh1, BooleanType type1, OpState state1)
        //{
        //    //mesh = mesh1;
        //    type = type1;
        //    state = state1;
        //}

        public OpAndType(MeshFilter mesh1, BooleanType type1)
        {
            //mesh = mesh1;
            type  = type1;
            state = new OpState(mesh1.transform);
        }
Exemple #15
0
 //编辑
 private void Edit(object sender, EventArgs e)
 {
     this.opState = OpState.Update;
     UIControl.SetStatus(this, this.opState);
 }
Exemple #16
0
 public FmMould(string MId, OpState op = OpState.Update) : this()
 {
     this.opState = op;
     this.MId     = MId;
 }
Exemple #17
0
 public void Copy( Source_GPIO from )
 {
     this.nativePin = from.nativePin;
     this.access    = from.access;
     this.state     = from.state;
     this.status    = from.status;
 }
Exemple #18
0
 //编辑
 private void Btn_Edit_Click(object sender, EventArgs e)
 {
     this.opState = OpState.Update;
     UIControl.SetStatus(bar1, bar2, pnlMain, gridView1, OpState.Update);
 }
Exemple #19
0
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            // TODO : validate that when doin store the given pin has
            //        access flag in GET mode (?)

            // Configure pin to set mode

            rfid.Constants.Result result    = rfid.Constants.Result.OK;
            rfid.Constants.Result resultErr = rfid.Constants.Result.OK;
            uint uiCurError  = 0;
            uint uiLastError = 0;
            byte getValue    = 0;

            //Set access to "Get"
            result = transport.API_GpioSetPinsConfiguration( (byte)this.nativePin,
                                                          0                     );
            if (rfid.Constants.Result.OK != result)
            {

                //Get error
                resultErr = transport.API_MacGetError(ref uiCurError, ref uiLastError);

                //Can't get error
                if (resultErr != rfid.Constants.Result.OK)
                {
                    this.status = OpResult.FAILURE;
                    return resultErr;
                }

                //If error = 0x2B, it means doesn't support this pin
                if (uiCurError == 0x2B)
                {
                    this.status = OpResult.UNSUPPORTED;
                    return result;
                }
                else
                {
                    this.status = OpResult.FAILURE;
                    return result;
                }

            }

            //Get GPIO Status
            result = transport.API_GpioReadPins( (byte)this.nativePin,
                                                  ref  getValue        );

            if ( rfid.Constants.Result.OK == result )
            {
                this.state  = ( ( UInt32 ) this.nativePin & getValue ) == 0 ? OpState.LO : OpState.HI;
                this.status = OpResult.SUCCESS;
            }
            else
            {
                this.state  = OpState.FAILURE;
                this.status = OpResult.FAILURE;
            }

            return result;
        }
Exemple #20
0
 private void btn_Edit_Click(object sender, EventArgs e)
 {
     this.opState = OpState.Update;
     UIControl.SetStatus(Head_Bar, tab_Main.AttachedControl, opState);
 }
Exemple #21
0
 //编辑
 private void Edit(object sender, EventArgs e)
 {
     this.opState = OpState.Update;
     UIControl.SetStatus(this, this.opState);
     //UIControl.SetStatus(bar1, bar2, pnlMain, gridView1, OpState.Update);
 }
Exemple #22
0
    void Transition()
    {
        // TODO: back to default when lose / fail to get recorder registered
        if (m_adjustDistanceCandidate || m_opstate == OpState.Op_AdjustDistance || m_opstate == OpState.Op_NewSpawn)
        {
            delta = IAAController.Position - m_adjustDistanceTouchPos;
            m_adjustDistanceTouchPos = IAAController.Position;
            if (IAAController.TouchDown)
            {
                delta = new Vector2(0, 0);
            }
        }
        if (m_adjustDistanceCandidate)
        {
            // Debug.Log (m_adjustDistanceCount);
            if (!IAAController.IsTouching)
            {
                m_adjustDistanceCandidate = false;
            }
            if (Mathf.Abs(delta.x) > MinDeltaXToDisable)
            {
                m_adjustDistanceCandidate = false;
                Debug.Log("Adjust disabled");
            }
            if (delta.y * m_adjustDistanceCount > -1e-9)
            {
                m_adjustDistanceCount += delta.y;
            }
            else
            {
                m_adjustDistanceCount = 0;
            }
            if (Mathf.Abs(m_adjustDistanceCount) > MinDeltaYThatCount)
            {
                m_opstate = OpState.Op_AdjustDistance;
            }
        }

        switch (m_opstate)
        {
        case OpState.Op_Default:
            if (m_target && IAAController.ClickButtonDown && IAAController.IsRightPress)
            {
                m_opstate = OpState.Op_PressAndHoldCandidate;
            }
            else if (m_target && IAAController.ClickButtonDown && IAAController.IsCenterPress)
            {
                m_opstate = OpState.Op_Moving;
            }
            break;

        case OpState.Op_PressAndHoldCandidate:
            if (!m_target)
            {
                m_presstime = 0;
                m_opstate   = OpState.Op_Default;
            }
            else
            {
                if (IAAController.IsPressed)
                {
                    m_presstime += Time.deltaTime;
                    if (m_presstime > m_holdtime && m_recorder == 0 && m_target)
                    {
                        m_presstime = 0;
                        IAAPlayer.localPlayer.CmdSetSoundObjectRecorder(netId, true);
                        m_opstate = OpState.Op_Recording;
                        m_drawingPlane.SetNormalAndPosition((Camera.main.transform.position - IAAController.reticle.transform.position).normalized, IAAController.reticle.transform.position);
                        if (m_looping)
                        {
                            IAAPlayer.localPlayer.CmdToggleSoundObjectLoopingState(netId);
                        }
                        IAAPlayer.localPlayer.CmdSetSoundObjectDrawingSequence(netId, true);
                        m_sequencer.startNewSequence();
                    }
                }
                else
                {
                    // Not long enough. Change looping state.
                    IAAPlayer.localPlayer.CmdToggleSoundObjectLoopingState(netId);
                    m_presstime = 0;
                    m_opstate   = OpState.Op_Default;
                }
            }
            break;

        case OpState.Op_Recording:
            if (!IAAController.IsPressed)
            {
                IAAPlayer.localPlayer.CmdSetSoundObjectRecorder(netId, false);
                m_opstate = OpState.Op_Default;
                m_sequencer.endSequence();
                IAAPlayer.localPlayer.CmdSetSoundObjectDrawingSequence(netId, false);
                if (!m_looping)
                {
                    IAAPlayer.localPlayer.CmdToggleSoundObjectLoopingState(netId);
                }
            }
            break;

        case OpState.Op_AdjustDistance:
            if (IAAController.IsPressed)
            {
                if (m_target && IAAController.IsCenterPress)
                {
                    m_opstate = OpState.Op_Moving;
                }
                else
                {
                    m_opstate = OpState.Op_Default;
                }
            }
            else if (!IAAController.IsTouching)
            {
                if (IAAController.TouchUp)
                {
                    m_adjustLiftTime = 0;
                }
                else
                {
                    m_adjustLiftTime += Time.deltaTime;
                    if (m_adjustLiftTime > MaxTimeBetweenLifting)
                    {
                        m_opstate = OpState.Op_Default;
                    }
                }
            }
            checkAuthority();
            break;

        case OpState.Op_Moving:
            if (IAAController.ClickButtonUp)
            {
                m_opstate = OpState.Op_Default;
            }
            checkAuthority();
            break;

        case OpState.Op_NewSpawn:
            if (IAAController.ClickButtonDown)
            {
                m_opstate = OpState.Op_Default;
            }
            checkAuthority();
            break;

        default:
            break;
        }
        if (m_target && IAAController.TouchDown && m_opstate != OpState.Op_AdjustDistance)
        {
            m_adjustDistanceCandidate = true;
            m_adjustDistanceTouchPos  = IAAController.Position;
            m_adjustDistanceCount     = 0;
        }

        switch (m_opstate)
        {
        case OpState.Op_Default:
            break;

        case OpState.Op_PressAndHoldCandidate:
            break;

        case OpState.Op_Recording:
            break;

        case OpState.Op_AdjustDistance:
            adjustDistance(delta.y);
            break;

        case OpState.Op_Moving:
            moveObject();
            break;

        case OpState.Op_NewSpawn:
            moveObject();
            adjustDistance(delta.y);
            break;

        default:
            break;
        }
    }
Exemple #23
0
 public FmTransVouch(OpState op = OpState.Add) : this()
 {
     this.opState = op;
 }
        public rfid.Constants.Result load
        (
            rfid.Linkage transport,
            UInt32 readerHandle
        )
        {
            // TODO : validate that when doin store the given pin has
            //        access flag in GET mode (?)

            // Configure pin to set mode

            rfid.Constants.Result result    = rfid.Constants.Result.OK;
            rfid.Constants.Result resultErr = rfid.Constants.Result.OK;
            uint uiCurError  = 0;
            uint uiLastError = 0;
            byte getValue    = 0;


            //Set access to "Get"
            result = transport.API_GpioSetPinsConfiguration((byte)this.nativePin,
                                                            0);
            if (rfid.Constants.Result.OK != result)
            {
                //Get error
                resultErr = transport.API_MacGetError(ref uiCurError, ref uiLastError);

                //Can't get error
                if (resultErr != rfid.Constants.Result.OK)
                {
                    this.status = OpResult.FAILURE;
                    return(resultErr);
                }


                //If error = 0x2B, it means doesn't support this pin
                if (uiCurError == 0x2B)
                {
                    this.status = OpResult.UNSUPPORTED;
                    return(result);
                }
                else
                {
                    this.status = OpResult.FAILURE;
                    return(result);
                }
            }


            //Get GPIO Status
            result = transport.API_GpioReadPins((byte)this.nativePin,
                                                ref getValue);

            if (rfid.Constants.Result.OK == result)
            {
                this.state  = (( UInt32 )this.nativePin & getValue) == 0 ? OpState.LO : OpState.HI;
                this.status = OpResult.SUCCESS;
            }
            else
            {
                this.state  = OpState.FAILURE;
                this.status = OpResult.FAILURE;
            }

            return(result);
        }
Exemple #25
0
 void StartTimeoutTrack(int timeout)
 {
     _opState = OpState.Working;
     _timer.Change(timeout, Timeout.Infinite);
 }
Exemple #26
0
 //编辑
 private void Edit(object sender, EventArgs e)
 {
     this.opState = OpState.Update;
     this.RefreshUI();
 }
Exemple #27
0
        void StopTimeoutTrack(Exception e)
        {
            lock(this)
            {
                if(_opState == OpState.Timedout)
                {
                    throw new SocketException(SockErrors.WSAETIMEDOUT);

                    // throw new SocketTimeoutException(null, e);
                }
                else
                {
                    CheckDisposed();
                    _opState = OpState.Finished;
                }

                _timer.Change(Timeout.Infinite, Timeout.Infinite);
            }
        }
Exemple #28
0
 public OpItem(OpState state)
 {
     this.OpState = state;
     this.OpValue = null;
 }
Exemple #29
0
 void OnTimer(object state)
 {
     lock(this)
     {
         if(!_disposed)
         {
             _timer.Change(Timeout.Infinite, Timeout.Infinite);
             if(_opState == OpState.Working)
             {
                 _opState = OpState.Timedout;
                 Dispose();
             }
         }
     }
 }
Exemple #30
0
 public FmEquipment(int EQId, OpState op = OpState.Update) : this()
 {
     this.opState = op;
     this.EQId    = EQId;
 }
Exemple #31
0
 //新增
 private void Btn_Add_Click(object sender, EventArgs e)
 {
     this.opState = OpState.Add;
     UIControl.SetStatus(bar1, bar2, pnlMain, gridView1, OpState.Add);
     this.Add();
 }
 public bool IsConnectionExists(DbcMessage canMsg, CanTxSignalType sigType, OpState opstate, Variant var)
 {
     return(_connections.Any(p => (p.SourceCANTxSignal is DbcMessage) && ((DbcMessage)p.SourceCANTxSignal).Name == canMsg.Name && p.TargetSignalType.Name == sigType.Name && p.ConnectedOpState.Name == opstate.Name && p.Variant.RbVariant == var.RbVariant));
 }
Exemple #33
0
 public FmMould(MouldClass modelC, OpState op = OpState.Add) : this()
 {
     this.opState = op;
     this.modelC  = modelC;
 }