Ejemplo n.º 1
0
 public UCGroupEntry()
 {
     this.tmode   = TransMode.NewRecord;
     DialogResult = System.Windows.Forms.DialogResult.None;
     InitializeComponent();
     LoadAppDomains();
 }
Ejemplo n.º 2
0
 private void SetDefaultValues()
 {
     this.ExecutionMode = ProcessMode.GuidMode;
     this.ServerIP      = "192.168.3.169";
     this.TransferMode  = TransMode.HTTP;
     this.PortNumber    = "8080";
 }
Ejemplo n.º 3
0
        public UCServiceCategory(TransMode _mode, ServiceCategoryJobView view, SdServiceCategoryDto service)
        {
            this.view    = view;
            InsertedList = new List <SdServiceCategoryDto>();
            mode         = _mode;
            InitializeComponent();
            Result                  = DialogResult.None;
            this.service            = service;
            grpDeviceFilter.Enabled = false;
            grpMenuFilter.Enabled   = false;
            if (mode == TransMode.EditRecord || mode == TransMode.ViewRecord)
            {
                if (service != null)
                {
                    txtDescription.Text = service.Description;
                    txtTitle.Text       = service.Title;
                    chkEnabled.Checked  = service.Enabled > 0 ? true : false;

                    chkHasJob.Checked    = service.Hasjob > 0 ? true : false;
                    service.Filter       = view.baseDataPresenter.GetFilter(service.ServiceCatId);
                    chkHasDevice.Checked = service.HasDevices;
                    if (service.Filter != null && service.Filter.ObjectType != null)
                    {
                        grpDeviceFilter.Enabled = true;
                        txtDeviceFilter.Text    = service.Filter.ObjectType.ObjecttypeDesc;
                        txtDeviceFilter.Tag     = service.Filter.ObjectType;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void iTransToolBar1_SaveAndNewRecord(object sender, EventArgs e)
        {
            if (mode == TransMode.EditRecord)
            {
                work.Title = txtTitle.Text;
                int n = 0;

                int.TryParse(txtTime.Text, out n);
                work.EstimateTime = n;
                presenter.Update(work);
                Bs.EndEdit();
            }
            if (mode == TransMode.NewRecord)
            {
                work       = new SdWorkDto();
                work.Title = txtTitle.Text;
                int n = 0;

                int.TryParse(txtTime.Text, out n);
                work.EstimateTime   = n;
                work.SdServiceCatId = serviceCatId;
                presenter.Insert(work);
                Bs.Add(work);
            }

            txtTime.Text  = string.Empty;
            txtTitle.Text = string.Empty;
            mode          = TransMode.NewRecord;
            work          = null;
        }
Ejemplo n.º 5
0
 public UCRoleEntry(int officeId, TransMode mode, BindingSource bs)
 {
     this.officeId = officeId;
     InitializeComponent();
     this.bs   = bs;
     this.mode = mode;
 }
        private void Next(string sceneName, object transData, TransMode transMode)
        {
            if (IsLoading)
            {
                Debug.unityLogger.LogWarning(GetType().Name, "Loading");
                return;
            }

            if (_histories.Count > 0 && _histories.Peek().SceneName == sceneName)
            {
                Reload();
                return;
            }

            IsLoading = true;

            _histories.Push(new History()
            {
                SceneName = sceneName, TransData = transData
            });
            var nextContext = new LoadContext(sceneName, transData, transMode);

            StartCoroutine(Load(nextContext, _loadContext));
            _loadContext = nextContext;
        }
Ejemplo n.º 7
0
 public UCRoleEntry(TransMode tmode, RoleDto role)
 {
     this.tmode = tmode;
     InitializeComponent();
     NewRoleDto = role;
     LoadAppDomains();
     if (tmode == TransMode.EditRecord || tmode == TransMode.ViewRecord)
     {
         NewRoleDto = role;
         this.txtDisplayName.Text = role.CondidateRoleName;
         this.txtGroupName.Text   = role.RoleName;
         this.chkEnabled.Checked  = role.IsEnabled;
         if (role.AppDomainId != null)
         {
             this.cmbDomain.SelectedValue = role.AppDomainId;
         }
         else
         {
             this.cmbDomain.SelectedIndex = -1;
         }
         if (tmode == TransMode.ViewRecord)
         {
             this.txtDisplayName.ReadOnly = true;
             this.txtGroupName.ReadOnly   = true;
             this.chkEnabled.Enabled      = false;
             this.cmbDomain.Enabled       = false;
         }
     }
 }
Ejemplo n.º 8
0
 public LoadContext(string nextScene, object transData, TransMode transMode)
 {
     NextScene      = new Scene(nextScene);
     AdditiveScenes = new List <Scene>();
     TransData      = transData;
     TransMode      = transMode;
 }
Ejemplo n.º 9
0
        protected ModbusPoll modbusPoll;   // implements device polling


        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public DevModbusLogic(ICommContext commContext, ILineContext lineContext, DeviceConfig deviceConfig)
            : base(commContext, lineContext, deviceConfig)
        {
            transMode   = TransMode.RTU;
            deviceModel = null;
            modbusPoll  = null;
        }
Ejemplo n.º 10
0
 public UCGroupEntry(TransMode tmode, SecurityGroupDto group)
 {
     this.tmode   = tmode;
     DialogResult = System.Windows.Forms.DialogResult.None;
     InitializeComponent();
     LoadAppDomains();
     if (tmode == TransMode.EditRecord || tmode == TransMode.ViewRecord)
     {
         NewGroup = group;
         this.txtDisplayName.Text = group.DisplayName;
         this.txtGroupName.Text   = group.GroupName;
         this.chkEnabled.Checked  = group.IsEnabled;
         if (group.AppDomainId != null)
         {
             this.cmbDomain.SelectedValue = group.AppDomainId;
         }
         else
         {
             this.cmbDomain.SelectedIndex = -1;
         }
         if (tmode == TransMode.ViewRecord)
         {
             this.txtDisplayName.ReadOnly = true;
             this.txtGroupName.ReadOnly   = true;
             this.chkEnabled.Enabled      = false;
             this.cmbDomain.Enabled       = false;
         }
     }
 }
Ejemplo n.º 11
0
 public Transaction(String name)
 {
     _transKeyFields = new TransKeyFieldCollection(this, typeof(TransKeyField));
     _transFields = new TransFieldCollection(this, typeof(TransField));
     _transMode = TransMode.AutoAppend;
     _name = name;
     _whenDelete = true;
     _whenInsert = true;
     _whenUpdate = true;
 }
Ejemplo n.º 12
0
 private void MakeEmptyForm()
 {
     txtFName.Text        = string.Empty;
     txtLName.Text        = string.Empty;
     txtNationalCode.Text = string.Empty;
     txtPersonelCode.Text = string.Empty;
     chkEnabled.Checked   = true;
     chkIsReal.Checked    = true;
     mode = TransMode.NewRecord;
 }
Ejemplo n.º 13
0
 GameObject ITransitionFactory.Create(TransMode trans)
 {
     if (trans == TransMode.BlackFade)
     {
         return(_container.InstantiatePrefab(_blackFade));
     }
     else
     {
         return(_container.InstantiatePrefab(_settings.Prefabs[(int)trans]));
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public ModbusPoll(TransMode transMode, int inBufSize)
        {
            connection = ConnectionStub.Instance;
            log        = LogStub.Instance;

            TransMode     = transMode;
            InBuf         = new byte[inBufSize];
            Timeout       = 0;
            TransactionID = 0;
            ChooseRequestMethod();
        }
Ejemplo n.º 15
0
        private void btnViewWorks_Click(object sender, EventArgs e)
        {
            TransMode mode = TransMode.ViewRecord;
            //  if (servieDeskRow.BE_TERMINATED > 0)
            {
                mode = TransMode.ViewRecord;
            }
            UCRequestWork ucForm = new UCRequestWork(person, userRequest.SerReqId, mode);

            ISE.UILibrary.Utils.UIUtils.SetFrmTrans(ucForm, "فعالیت ها", FormBorderStyle.Sizable);
        }
Ejemplo n.º 16
0
 public UCSubMenuEntry(TransMode mode, SecurityResourceDto resource)
 {
     this.mode             = mode;
     this.SecurityResource = resource;
     InitializeComponent();
     DialogResult = System.Windows.Forms.DialogResult.None;
     if (mode == TransMode.EditRecord || mode == TransMode.ViewRecord)
     {
         txtTitle.Text      = resource.ResourceName;
         chkEnabled.Checked = resource.IsEnabled;
     }
 }
Ejemplo n.º 17
0
        public UCUserRequestView(TransMode tMode, ISE.Cartable.DE.CartableDataSet.MY_CARTABLE_FOR_SERVICE_DESKRow row, UserInformation userInfo)
        {
            try
            {
                this.userInfo = userInfo;
                InitializeComponent();
                servieDeskRow = row;
                this.tMode    = tMode;
                this.userInfo = userInfo;
                if (tMode == TransMode.ViewRecord || tMode == TransMode.EditRecord)
                {
                    var hokm = basePresenter.GetHokm(userInfo.PerId);

                    if ((hokm.Positionlevel == 5 || hokm.Positionlevel == 4) && hokm.EmcostoIndependSrl == 22852) // is in IT and masul ya modir
                    {
                        btnChangePriority.Visible  = true;
                        numUpDownPriority.ReadOnly = false;
                        numUpDownPriority.Enabled  = true;
                    }
                    else
                    {
                        btnChangePriority.Visible  = false;
                        numUpDownPriority.ReadOnly = true;
                        numUpDownPriority.Enabled  = false;
                    }
                    txtRequester.Text = row.PERSONELNAME;

                    if (row.IsCREATEDATENull() == false)
                    {
                        dtpDate.Value = row.CREATEDATE;
                    }

                    userRequest = requestPresenter.GetRequest(row.SER_REQ_ID);

                    SetUI(userRequest);

                    igridDeviceList.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
                    LoadAttachment(row.SER_REQ_ID);
                    igridAtch.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
                    if (tMode == TransMode.ViewRecord)
                    {
                        btnMInAtc.Visible      = false;
                        btnSelectAttch.Visible = false;
                    }
                }
                SetGrid();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Initializes the request ADU and calculates the response length.
        /// </summary>
        public virtual void InitReqADU(byte devAddr, TransMode transMode)
        {
            if (ReqPDU == null)
            {
                return;
            }

            int pduLen = ReqPDU.Length;

            switch (transMode)
            {
            case TransMode.RTU:
                ReqADU    = new byte[pduLen + 3];
                ReqADU[0] = devAddr;
                Buffer.BlockCopy(ReqPDU, 0, ReqADU, 1, ReqPDU.Length);
                ushort crc = ModbusUtils.CRC16(ReqADU, 0, pduLen + 1);
                ReqADU[pduLen + 1] = (byte)(crc % 256);
                ReqADU[pduLen + 2] = (byte)(crc / 256);
                RespAduLen         = RespPduLen + 3;
                break;

            case TransMode.ASCII:
                byte[] aduBuf = new byte[pduLen + 2];
                aduBuf[0] = devAddr;
                Buffer.BlockCopy(ReqPDU, 0, aduBuf, 1, ReqPDU.Length);
                aduBuf[pduLen + 1] = ModbusUtils.LRC(aduBuf, 0, pduLen + 1);

                StringBuilder sbADU = new StringBuilder();
                foreach (byte b in aduBuf)
                {
                    sbADU.Append(b.ToString("X2"));
                }

                ReqADU     = Encoding.ASCII.GetBytes(sbADU.ToString());
                ReqStr     = ModbusUtils.Colon + sbADU;
                RespAduLen = RespPduLen + 2;
                break;

            default:     // TransModes.TCP
                ReqADU    = new byte[pduLen + 7];
                ReqADU[0] = 0;
                ReqADU[1] = 0;
                ReqADU[2] = 0;
                ReqADU[3] = 0;
                ReqADU[4] = (byte)((pduLen + 1) / 256);
                ReqADU[5] = (byte)((pduLen + 1) % 256);
                ReqADU[6] = devAddr;
                Buffer.BlockCopy(ReqPDU, 0, ReqADU, 7, ReqPDU.Length);
                RespAduLen = RespPduLen + 7;
                break;
            }
        }
Ejemplo n.º 19
0
        public UCRoleEntry(SdItRoleDto role, TransMode mode, BindingSource bs)
        {
            InitializeComponent();
            this.bs   = bs;
            this.mode = mode;

            this.role = role;
            if (mode != TransMode.NewRecord)
            {
                txtTitle.Text       = role.Title;
                txtDescription.Text = role.Description;
            }
        }
Ejemplo n.º 20
0
        public UCWorkEntry(int serviceCategoryId, TransMode mode, BindingSource bsource)
        {
            this.serviceCatId = serviceCategoryId;
            this.Bs           = bsource;

            this.mode = mode;
            InitializeComponent();
            if (mode == TransMode.NewRecord)
            {
                txtTitle.Text = string.Empty;
                txtTime.Text  = string.Empty;
            }
        }
Ejemplo n.º 21
0
        public UCWorkEntry(SdWorkDto work, TransMode mode, BindingSource bsource)
        {
            this.Bs   = bsource;
            this.work = work;
            this.mode = mode;

            InitializeComponent();
            if (mode != TransMode.NewRecord)
            {
                txtTitle.Text = work.Title;
                txtTime.Text  = work.EstimateTime.ToString();
            }
        }
Ejemplo n.º 22
0
        public UCRequestWork(TransMode tMode, ISE.Cartable.DE.CartableDataSet.MY_CARTABLE_FOR_SERVICE_DESKRow row, UserInformation userInfo)
        {
            UserRequestPresenter     requestPresenter  = new UserRequestPresenter();
            BaseDataServicePresenter baseDataPresenter = new BaseDataServicePresenter();

            this.mode = tMode;
            request   = requestPresenter.GetRequest(row.SER_REQ_ID);
            person    = baseDataPresenter.getPersonel(request.Owneruserid ?? 0);
            InitializeComponent();
            ISE.UILibrary.Utils.GridEXUtils.SetingGrid(this.igridProcessList, true, false);
            InitUi();
            LoadRequests();
            LoadServiceCategoryJob();
        }
Ejemplo n.º 23
0
        public UCUserEntry(UserView view)
        {
            mode      = TransMode.NewRecord;
            this.view = view;
            InitializeComponent();
            var result  = view.LoadCompanies();
            var iseIkco = result.Where(it => it.CompanyId == 1).FirstOrDefault();

            if (iseIkco != null)
            {
                txtCompany.Text = iseIkco.Name;
                txtCompany.Tag  = iseIkco;
            }
        }
Ejemplo n.º 24
0
 public UCServiceCategory(TransMode _mode, ServiceCategoryJobView view, int parentId = -1)
 {
     this.view    = view;
     InsertedList = new List <SdServiceCategoryDto>();
     mode         = _mode;
     InitializeComponent();
     Result = DialogResult.None;
     if (parentId > 0)
     {
         _parentId = parentId;
     }
     grpDeviceFilter.Enabled = false;
     grpMenuFilter.Enabled   = false;
 }
Ejemplo n.º 25
0
        public UCServiceJob(ServiceJobView view, SdServiceJobDto serviceJob, TransMode mode)
        {
            InitializeComponent();
            myView = view;

            this.serviceJob = serviceJob;
            this.mode       = mode;
            if (mode == TransMode.EditRecord || mode == TransMode.ViewRecord)
            {
                txtDescription.Text = serviceJob.Description;
                txtTitle.Text       = serviceJob.Title;
                chkEnabled.Checked  = serviceJob.Enabled > 0;
            }
        }
Ejemplo n.º 26
0
 public UCOperationEntry(TransMode mode, OperationDto operation)
 {
     this.mode         = mode;
     this.OperationDto = operation;
     InitializeComponent();
     this.DialogResult = System.Windows.Forms.DialogResult.None;
     if (mode == TransMode.EditRecord || mode == TransMode.ViewRecord)
     {
         txtDescription.Text  = operation.Description;
         txtDisplayName.Text  = operation.DisplayName;
         txtName.Text         = operation.OperationName;
         chkIsDefault.Checked = operation.IsDefaultBool;
     }
 }
Ejemplo n.º 27
0
        /// <summary>
        /// Получить метод запроса, соответствующий режиму передачи данных.
        /// </summary>
        public RequestDelegate GetRequestMethod(TransMode transMode)
        {
            switch (transMode)
            {
            case TransMode.RTU:
                return(RtuRequest);

            case TransMode.ASCII:
                return(AsciiRequest);

            default:     // TransMode.TCP
                return(TcpRequest);
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Выполнить действия после добавления КП на линию связи
        /// </summary>
        public override void OnAddedToCommLine()
        {
            // получение или загрузка шаблона устройства
            string fileName = ReqParams.CmdLine.Trim();

            PrepareTemplate(fileName);

            // инициализация тегов КП на основе шаблона устройства
            floatSignals = new HashSet <int>();
            int             tagInd    = 0;
            List <TagGroup> tagGroups = CreateTagGroups(deviceTemplate, ref tagInd);

            InitKPTags(tagGroups);

            // определение режима передачи данных
            transMode = CustomParams.GetEnumParam("TransMode", false, TransMode.RTU);

            if (deviceTemplate == null)
            {
                elemGroups   = null;
                elemGroupCnt = 0;
            }
            else
            {
                // получение активных групп элементов
                elemGroups   = deviceTemplate.GetActiveElemGroups();
                elemGroupCnt = elemGroups.Count;

                // формирование PDU и ADU
                devAddr = (byte)Address;
                foreach (ElemGroup elemGroup in elemGroups)
                {
                    elemGroup.InitReqPDU();
                    elemGroup.InitReqADU(devAddr, transMode);
                }

                foreach (ModbusCmd cmd in deviceTemplate.Cmds)
                {
                    cmd.InitReqPDU();
                    cmd.InitReqADU(devAddr, transMode);
                }
            }

            // определение возможности отправки команд
            CanSendCmd = deviceTemplate != null && deviceTemplate.Cmds.Count > 0;
        }
Ejemplo n.º 29
0
        public UCResourceEntry(TransMode mode, SecurityResourceDto resource)
        {
            this.SecurityResource = resource;
            InitializeComponent();

            this.mode         = mode;
            this.DialogResult = System.Windows.Forms.DialogResult.None;
            if (mode == TransMode.ViewRecord || mode == TransMode.EditRecord)
            {
                txtDisplayName.Text  = resource.DisplayName;
                txtResourceName.Text = resource.ResourceName;
                txtNameSpace.Text    = resource.Namespace;
                txtAssemblyName.Text = resource.AssemblyName;
                txtTooltip.Text      = resource.ToolTip;
                txtPrecedence.Text   = resource.Precedence.ToString();
                chkHasParam.Checked  = resource.HasParam;
                chkEnabled.Checked   = resource.IsEnabled;
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Выполнить действия после добавления КП на линию связи
        /// </summary>
        public override void OnAddedToCommLine()
        {
            // получение или загрузка шаблона устройства
            string fileName = ReqParams.CmdLine.Trim();

            PrepareTemplate(fileName);

            // инициализация тегов КП на основе шаблона устройства
            floatSignals = new HashSet <int>();
            int             tagInd    = 0;
            List <TagGroup> tagGroups = CreateTagGroups(deviceTemplate, ref tagInd);

            InitKPTags(tagGroups);

            // определение режима передачи данных
            transMode = CustomParams.GetEnumParam("TransMode", false, TransMode.RTU);

            // определение возможности отправки команд
            CanSendCmd = deviceTemplate != null && deviceTemplate.Cmds.Count > 0;
        }
Ejemplo n.º 31
0
 public UCRequestWork(VwPersonelDto person, int requestId, TransMode mode)
 {
     this.mode      = mode;
     this.requestId = requestId;
     request        = presenter.GetRequest(requestId);
     this.person    = person;
     InitializeComponent();
     ISE.UILibrary.Utils.GridEXUtils.SetingGrid(this.igridProcessList, true, false);
     InitUi();
     LoadRequests();
     LoadServiceCategoryJob();
     if (mode != TransMode.NewRecord)
     {
         grpCreateWork.Visible = false;
     }
     if (mode == TransMode.ViewRecord)
     {
         btnChangeRequest.Visible = false;
     }
 }