예제 #1
0
파일: MainForm.cs 프로젝트: SetCode/Fluid
 private void BeginBroadcastIdle()
 {
     this.BeginInvoke(new Action(() =>
     {
         MsgCenter.Broadcast(MsgType.IDLE, this, null);
     }));
 }
예제 #2
0
파일: MainForm.cs 프로젝트: SetCode/Fluid
 private void BeginBroadcastPaused()
 {
     this.BeginInvoke(new Action(() =>
     {
         MsgCenter.Broadcast(MsgType.PAUSED, this, null);
     }));
 }
예제 #3
0
 private void CbxChn2_SelectedIndexChanged(object sender, EventArgs e)
 {
     SensorMgr.Instance.Proportioners.Channel2 = (int)cbxChn2.SelectedItem;
     MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null);
     SensorMgr.Instance.Save();
     CompareObj.CompareProperty(SensorMgr.Instance.Proportioners, this.settingBackUp, true);
 }
예제 #4
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbX.IsValid || !tbY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MessageBox.Show("请输入正确的值.");
                return;
            }
            PointD laserMap = this.pattern.SystemRel(tbX.Value, tbY.Value);

            measureHeightCmdLine.Position.X   = laserMap.X;
            measureHeightCmdLine.Position.Y   = laserMap.Y;
            measureHeightCmdLine.StandardHt   = this.heightControl1.BoardHeight;
            measureHeightCmdLine.ToleranceMax = this.heightControl1.MaxTolerance;
            measureHeightCmdLine.ToleranceMin = this.heightControl1.MinTolerance;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, measureHeightCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, measureHeightCmdLine);
            }
            Properties.Settings.Default.laserX = measureHeightCmdLine.Position.X;
            Properties.Settings.Default.laserY = measureHeightCmdLine.Position.Y;
            if (!this.isCreating)
            {
                Close();
                if (this.measureHeightCmdLine != null && this.measureHeightCmdLineBackUp != null)
                {
                    CompareObj.CompareProperty(this.measureHeightCmdLine, this.measureHeightCmdLineBackUp, null, this.GetType().Name, true);
                    CompareObj.CompareField(this.measureHeightCmdLine, this.measureHeightCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
예제 #5
0
 void Awake()
 {
     Instance = this;
     gameObject.AddComponent <AudioManager>();
     gameObject.AddComponent <UIManager>();
     gameObject.AddComponent <PlayerManager>();
 }
예제 #6
0
파일: PanelY.cs 프로젝트: bia24/SFrame
    void Awake()
    {
        //控件获取
        button1 = transform.Find("Button1").GetComponent <Button>();
        button2 = transform.Find("Button2").GetComponent <Button>();

        //监听绑定
        MsgCenter.AddMsgListener(MoudleType.UI, UICode.OPEN_PANEL_Y, ShowPanel);

        //按钮事件绑定
        button1.onClick.AddListener(() =>
        {
            MsgCenter.SendMsg(MoudleType.UI, UICode.SHOW_TEXT, new MsgArg("加油啊兄弟", gameObject));
        }
                                    );

        button2.onClick.AddListener(() =>
        {
            MsgCenter.SendMsg(MoudleType.UI, UICode.OPEN_PANEL_R, new MsgArg("", gameObject));
            gameObject.SetActive(false);
        }
                                    );

        //初始状态赋值
        gameObject.SetActive(true);
    }
예제 #7
0
    // Use this for initialization
    private void Awake()
    {
        Instance = this;
        GameObject go = new GameObject("UIManager");

        go.AddComponent <UIManager>();
        go.transform.parent = transform;

        go = new GameObject("NPCManager");
        go.AddComponent <NPCManager>();

        go.transform.parent = transform;
        go = new GameObject("AssetBundleManager");

        go.AddComponent <AssetBundleManager>();
        go.transform.parent = transform;

        go = new GameObject("NetManager");
        go.AddComponent <NetManager>();

        go.transform.parent = transform;
        go = new GameObject("TabToyManager");

        go.AddComponent <TabToyManager>();
        go.transform.parent = transform;
    }
예제 #8
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (changed)
     {
         MsgCenter.Broadcast(Constants.MSG_SYS_POSITIONS_DEFS_CHANGED, this, null);
     }
 }
예제 #9
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (this.measureCmdLine == null)
            {
                MessageBox.Show("当前轨迹未增加基准测高,请生成测高指令");
                return;
            }
            if (this.SymbolLinesCache.Count < 1)
            {
                MessageBox.Show("未生成轨迹请生成轨迹");
                return;
            }
            if (this.tbArcSpeed.Text == "")
            {
                MessageBox.Show("圆弧速度未设置");
                return;
            }

            this.symbolLinesCmdLine.BindMHCmdLine = this.measureCmdLine;
            this.symbolLinesCmdLine.Symbols       = this.SymbolLinesCache;
            this.symbolLinesCmdLine.LineStyle     = (LineStyle)cbxLineType.SelectedIndex;
            this.symbolLinesCmdLine.ArcSpeed      = this.tbArcSpeed.Value;
            this.symbolLinesCmdLine.OffsetX       = (double)this.nudOffsetX.Value;
            this.symbolLinesCmdLine.OffsetY       = (double)this.nudOffsetY.Value;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, this.symbolLinesCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, this.symbolLinesCmdLine);
            }
            this.Close();
        }
예제 #10
0
 void Awake()
 {
     //isInit = true;
     _instance = this;
     TextUrl   = "http://101.231.255.158:8780/jzcl/wbp"; // "http://192.168.200.173:8080/jzwq/wbp";
     CartURL   = "";
 }
예제 #11
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (!tbWaitInMills.IsValid)
            {
                //MessageBox.Show("Please input valid value.");
                MessageBox.Show("请输入正确的值");
                return;
            }
            timerCmdLine.WaitInMills = tbWaitInMills.Value;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, timerCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, timerCmdLine);
            }

            Properties.Settings.Default.NormalTimer = timerCmdLine.WaitInMills;
            if (!this.isCreating)
            {
                Close();
                if (this.timerCmdLine != null && this.timerCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.timerCmdLine, this.timerCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
예제 #12
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbZ.IsValid)
     {
         //MessageBox.Show("Please input a double number for z.");
         MetroSetMessageBox.Show(this, "请输入小数.");
         return;
     }
     moveAbsZCmdLine.Z = tbZ.Value;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveAbsZCmdLine);
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveAbsZCmdLine);
     }
     if (!this.isCreating)
     {
         if (this.moveAbsZCmdLine != null && this.moveAbsZCmdLineBackUp != null)
         {
             CompareObj.CompareField(this.moveAbsZCmdLine, this.moveAbsZCmdLineBackUp, null, this.GetType().Name, true);
         }
     }
 }
예제 #13
0
        protected override bool PrepareMessageForSend(Message msg)
        {
            if (Cts == null)
            {
                return(false);
            }

            // Check to make sure we're not stopped
            if (Cts.IsCancellationRequested)
            {
                // Recycle the message we've dequeued. Note that this will recycle messages that were queued up to be sent when the gateway connection is declared dead
                MsgCenter.SendMessage(msg);
                return(false);
            }

            if (msg.TargetSilo != null)
            {
                return(true);
            }

            msg.TargetSilo = Silo;
            if (msg.TargetGrain.IsSystemTarget)
            {
                msg.TargetActivation = ActivationId.GetSystemActivation(msg.TargetGrain, msg.TargetSilo);
            }

            return(true);
        }
예제 #14
0
 private void SettingSensorsForm_OnSaveClicked()
 {
     MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null);
     SensorMgr.Instance.Save();
     this.Close();
     CompareObj.CompareProperty(this.currEasySerialPort, this.currEasySerialPortBackUp, null, this.GetType().Name, true);
 }
예제 #15
0
        private void btnReverse_Click(object sender, EventArgs e)
        {
            Pattern p = pattern.ReversePattern();

            MsgCenter.Broadcast(Constants.MSG_ADD_PATTERN, this, p);
            this.Close();
        }
예제 #16
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string patternName = tbPatternName.Text.Trim();

            if (!tbOriginX.IsValid || !tbOriginY.IsValid)
            {
                //MessageBox.Show("Please input valid origin values.");
                MessageBox.Show("请输入正确的原点坐标.");
                return;
            }

            if (pattern is Workpiece)
            {
                Workpiece w = pattern as Workpiece;
                w.OriginPos.X = tbOriginX.Value;
                w.OriginPos.Y = tbOriginY.Value;
                FluidProgram.Current.GetWorkPieceCmdLine().Origin.X = tbOriginX.Value;
                FluidProgram.Current.GetWorkPieceCmdLine().Origin.Y = tbOriginY.Value;
                CompareObj.CompareField(w.OriginPos, workPieceOrgBackUp, null, this.GetType().Name, true);
            }
            else
            {
                //机械坐标->系统坐标
                PointD p = this.workpiece.SystemRel(tbOriginX.Value, tbOriginY.Value);
                pattern.Origin.X = p.X;
                pattern.Origin.Y = p.Y;
                CompareObj.CompareField(p, patternOrgBackUp, null, this.GetType().Name, true);
            }

            MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_PATTREN_ORIGIN, null, null);

            DialogResult = DialogResult.OK;
            Close();
        }
예제 #17
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow item in this.dgvAccess.Rows)
     {
         if (item.Tag is ControlAccess)
         {
             ControlAccess access    = item.Tag as ControlAccess;
             RoleEnums     roleLevel = RoleEnums.Operator;
             if ((bool)item.Cells[1].Value)
             {
                 roleLevel = RoleEnums.Operator;
             }
             else if ((bool)item.Cells[2].Value)
             {
                 roleLevel = RoleEnums.Technician;
             }
             else if ((bool)item.Cells[3].Value)
             {
                 roleLevel = RoleEnums.Supervisor;
             }
             access.RoleLevel = roleLevel;
         }
     }
     MsgCenter.Broadcast(MsgConstants.MODIFY_ACCESS, this, null);
     AccessControlMgr.Instance.Save();
 }
예제 #18
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbStart.IsValid || !tbEnd.IsValid)
     {
         //MessageBox.Show("Please input valid values.");
         MetroSetMessageBox.Show(this, "请输入正确的值");
         return;
     }
     if (tbStart.Value > tbEnd.Value)
     {
         //MessageBox.Show("Start value can not be bigger than end value.");
         MetroSetMessageBox.Show(this, "起始点不可以大于结束点.");
         return;
     }
     loopPassCmdLine.Start = tbStart.Value;
     loopPassCmdLine.End   = tbEnd.Value;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, loopPassCmdLine, new NextLoopCmdLine());
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, loopPassCmdLine);
     }
     if (!this.isCreating)
     {
         if (this.loopPassCmdLine != null && this.loopPassCmdLineBackUp != null)
         {
             CompareObj.CompareField(this.loopPassCmdLine, this.loopPassCmdLineBackUp, null, this.GetType().Name, true);
         }
     }
 }
예제 #19
0
        protected override void OnMessageSerializationFailure(Message msg, Exception exc)
        {
            // we only get here if we failed to serialise the msg (or any other catastrophic failure).
            // Request msg fails to serialise on the sending silo, so we just enqueue a rejection msg.
            Log.Warn(ErrorCode.ProxyClient_SerializationError, String.Format("Unexpected error serializing message to gateway {0}.", Address), exc);
            FailMessage(msg, String.Format("Unexpected error serializing message to gateway {0}. {1}", Address, exc));
            if (msg.Direction == Message.Directions.Request || msg.Direction == Message.Directions.OneWay)
            {
                return;
            }

            // Response msg fails to serialize on the responding silo, so we try to send an error response back.
            // if we failed sending an original response, turn the response body into an error and reply with it.
            msg.Result     = Message.ResponseTypes.Error;
            msg.BodyObject = Response.ExceptionResponse(exc);
            try
            {
                MsgCenter.SendMessage(msg);
            }
            catch (Exception ex)
            {
                // If we still can't serialize, drop the message on the floor
                Log.Warn(ErrorCode.ProxyClient_DroppingMsg, "Unable to serialize message - DROPPING " + msg, ex);
                msg.ReleaseBodyAndHeaderBuffers();
            }
        }
예제 #20
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (comboBoxSysPositions.SelectedItem == null)
            {
                //MessageBox.Show("System position is not selected.");
                MetroSetMessageBox.Show(this, "请选择坐标点位.");
                return;
            }
            UserPosition up = comboBoxSysPositions.SelectedItem as UserPosition;

            moveToLocationCmdLine.PositionName = up.Name;
            moveToLocationCmdLine.MoveType     = up.MoveType;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveToLocationCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveToLocationCmdLine);
            }
            if (!this.isCreating)
            {
                if (this.moveToLocationCmdLine != null && this.moveToLocationCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.moveToLocationCmdLine, this.moveToLocationCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
예제 #21
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Machine.Instance.Setting.ValveSelect = (ValveSelection)this.cmbValveSelect.SelectedIndex;
            if (!Machine.Instance.Valve1.ValveSeries.Equals(Machine.Instance.Valve2.ValveSeries) && Machine.Instance.Setting.ValveSelect == ValveSelection.双阀)
            {
                MetroSetMessageBox.Show(this, "请选择同类型阀组", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            Machine.Instance.SetupValve();
            Machine.Instance.Valve1.ValveSeries = (ValveSeries)this.metroSetListBox1.SelectedIndex;
            Machine.Instance.Valve2.ValveSeries = (ValveSeries)this.metroSetListBox2.SelectedIndex;
            ValvePrmMgr.Instance.FindBy(ValveType.Valve1).ValveSeires = (ValveSeries)this.metroSetListBox1.SelectedIndex;

            ValvePrmMgr.Instance.FindBy(ValveType.Valve2).ValveSeires = (ValveSeries)this.metroSetListBox2.SelectedIndex;
            Machine.Instance.Setting.Save();
            Machine.Instance.SaveValveSettings();

            if (Machine.Instance.Setting.ValveSelect == ValveSelection.双阀)
            {
                if (Machine.Instance.Valve1.ValveSeries == Machine.Instance.Valve2.ValveSeries)
                {
                    if (Machine.Instance.Valve1.ValveSeries == ValveSeries.喷射阀)
                    {
                        Machine.Instance.DualValve = new JtDualValve(CardMgr.Instance.FindBy(0), Machine.Instance.Valve1, Machine.Instance.Valve2);
                    }
                    if (Machine.Instance.Valve1.ValveSeries == ValveSeries.螺杆阀)
                    {
                        Machine.Instance.DualValve = new SvDualValve(CardMgr.Instance.FindBy(0), Machine.Instance.Valve1, Machine.Instance.Valve2);
                    }
                }
            }
            MsgCenter.Broadcast(MachineMsg.SETUP_VALVE, this, Machine.Instance.Valve1.ValveSeries, Machine.Instance.Valve2.ValveSeries);
        }
예제 #22
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     Machine.Instance.SetupValve();
     MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this);
     Machine.Instance.Setting.Save();
     CompareObj.CompareProperty(Machine.Instance.Setting, this.SettingBackUp, null, this.GetType().Name);
 }
예제 #23
0
 private void Awake()
 {
     Instance = this;
     gameObject.AddComponent <UIManager>();
     gameObject.AddComponent <NPCManager>();
     gameObject.AddComponent <AssetManager>();
 }
예제 #24
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbWaitInMills.IsValid || !tbSpeed.IsValid)
            {
                //MessageBox.Show("Please input valid value");
                MetroSetMessageBox.Show(this, "请输入合理的值");
                return;
            }

            changeSpeedCmdLine.Speed       = tbSpeed.Value;
            changeSpeedCmdLine.WaitInMills = tbWaitInMills.Value;

            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, changeSpeedCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, changeSpeedCmdLine);
            }

            if (!this.isCreating)
            {
                if (this.changeSpeedCmdLine != null && this.changeSpeedCmdLineBackUp != null)
                {
                    CompareObj.CompareProperty(this.changeSpeedCmdLine, this.changeSpeedCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
예제 #25
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbX.IsValid || !tbY.IsValid)
     {
         //MessageBox.Show("Please input valid value.");
         MessageBox.Show("请输入正确的值.");
         return;
     }
     moveAbsXyCmdLine.MoveType   = this.getMoveType();
     moveAbsXyCmdLine.Position.X = tbX.Value;
     moveAbsXyCmdLine.Position.Y = tbY.Value;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveAbsXyCmdLine);
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveAbsXyCmdLine);
     }
     Properties.Settings.Default.absX = moveAbsXyCmdLine.Position.X;
     Properties.Settings.Default.absY = moveAbsXyCmdLine.Position.Y;
     if (!this.isCreating)
     {
         Close();
         if (this.moveAbsXyCmdLine != null && this.moveAbsXyCmdLineBackUp != null)
         {
             CompareObj.CompareField(this.moveAbsXyCmdLine, this.moveAbsXyCmdLineBackUp, null, this.GetType().Name, true);
         }
     }
 }
예제 #26
0
        private async void Cms_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            MsgCenter.Broadcast(MsgType.BUSY, this, null);
            await Task.Factory.StartNew(() =>
            {
                if (e.ClickedItem.Text == strMoveHome)
                {
                    Machine.Instance.MoveHome();
                }
                else if (e.ClickedItem.Text == strInitMotion)
                {
                    AlarmServer.Instance.MachineInitDone = false;
                    Machine.Instance.InitMotion();
                    AlarmServer.Instance.MachineInitDone = true;
                }
                else if (e.ClickedItem.Text == strInitVision)
                {
                    AlarmServer.Instance.MachineInitDone = false;
                    Machine.Instance.InitVision();
                    AlarmServer.Instance.MachineInitDone = true;
                    this.BeginInvoke(new MethodInvoker(() =>
                    {
                        MsgCenter.Broadcast(MachineMsg.INIT_VISION, this);
                    }));
                }
                else if (e.ClickedItem.Text == strInitSensors)
                {
                    AlarmServer.Instance.MachineInitDone = false;
                    Machine.Instance.InitSensors();
                    AlarmServer.Instance.MachineInitDone = true;
                }
            });

            MsgCenter.Broadcast(MsgType.IDLE, this, null);
        }
예제 #27
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            int otherFormAccessCount   = RoleMgr.Instance.Developer.OtherFormAccess.GetLength();
            int mainFormAccessCount    = RoleMgr.Instance.Developer.MainFormAccess.GetLength();
            int programFormAccessCount = RoleMgr.Instance.Developer.ProgramFormAccess.GetLength();
            int i = 0;

            for (; i < mainFormAccessCount; i++)
            {
                RoleMgr.Instance.Operator.MainFormAccess[i]   = (bool)dgvAccess.Rows[i].Cells[0].Value;
                RoleMgr.Instance.Technician.MainFormAccess[i] = (bool)dgvAccess.Rows[i].Cells[1].Value;
                RoleMgr.Instance.Supervisor.MainFormAccess[i] = (bool)dgvAccess.Rows[i].Cells[2].Value;
            }
            for (; i < mainFormAccessCount + programFormAccessCount; i++)
            {
                int j = i - mainFormAccessCount;
                RoleMgr.Instance.Operator.ProgramFormAccess[j]   = (bool)dgvAccess.Rows[i].Cells[0].Value;
                RoleMgr.Instance.Technician.ProgramFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[1].Value;
                RoleMgr.Instance.Supervisor.ProgramFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[2].Value;
            }
            for (; i < mainFormAccessCount + programFormAccessCount + otherFormAccessCount; i++)
            {
                int j = i - mainFormAccessCount - programFormAccessCount;
                RoleMgr.Instance.Operator.OtherFormAccess[j]   = (bool)dgvAccess.Rows[i].Cells[0].Value;
                RoleMgr.Instance.Technician.OtherFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[1].Value;
                RoleMgr.Instance.Supervisor.OtherFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[2].Value;
            }
            MsgCenter.Broadcast(MsgConstants.MODIFY_ACCESS, this, null);
            this.Close();
        }
예제 #28
0
    void Awake()
    {
        Instance = this;

        gameObject.AddComponent <UIManager>();
        gameObject.AddComponent <UIManager>();
        //等等
    }
예제 #29
0
 // Use this for initialization
 void Start()
 {
     _instance = this;
     MsgCenter = MsgCenter._instance;
     //button = this.GetComponent<Button>();
     assetManager = Camera.main.GetComponent <AssetManager>();
     //button.onClick.AddListener(OnClick);
 }
예제 #30
0
 // Use this for initialization
 void Start()
 {
     _Instand     = this;
     AssetManager = Camera.main.GetComponent <AssetManager>();
     MsgCenter    = Camera.main.GetComponent <MsgCenter>();
     path         = Application.dataPath + "/Ok.xml";
     temps        = new List <float>();
 }