Inheritance: MonoBehaviour
示例#1
0
 public virtual void Awake()
 {
     if (isDefaultWindow)
     {
         defaultWindow = this;
     }
 }
示例#2
0
    protected override void OnActivated(EventArgs e)
    {
        base.OnActivated(e);
        ControlWindow NewWindowB = new ControlWindow();

        NewWindowB.Show();
    }
示例#3
0
 protected override void WndProc(ref Message m)
 {
     if (!ControlWindow.ProcessWndProcForSizingWindow(this, ref m))
     {
         base.WndProc(ref m);
     }
 }
        public void onLoad(object sender, RoutedEventArgs e)
        {
            parentWin = (ControlWindow)Window.GetWindow(this);
            user      = Session.currentUser;
            testPaths = user.getTestPaths();
            if (Session.testList.Count == 0)
            {
                genTests();
            }
            testList.ItemsSource = Session.testList;
            int highestTest = user.highestTestIndex;

            if (highestTest < Session.testList.Count - 1)
            {
                testList.SelectedItem = Session.testList[user.highestTestIndex + 1];
            }
            mediums = new List <String> {
                "Select medium", "PAPER", "SCREEN"
            };
            stimuliMedium.ItemsSource  = mediums;
            stimuliMedium.SelectedItem = "Select medium";
            testLoaded    += new TestLoadedHandler(mainWin.testCreated);
            testLoaded    += new TestLoadedHandler(parentWin.testCreated);
            markupStarted += new MarkupHandler(mainWin.allTestsCompleted);
            testList.Items.Refresh();
        }
示例#5
0
    // Use this for initialization
    void Start()
    {
        browserEventHandler = GetComponent <BrowserGUIEvents>();
        controlWindow       = GameObject.Find("ControlWindow").GetComponent <ControlWindow>();
        Debug.Log(width);
        InitAwesomium(width, height);

        //// Create texture in ARGB32 format
        //m_texture = new Texture2D(width, height, TextureFormat.ARGB32, true);
        ////Get Color[] (pixels) from texture
        //m_pixels = m_texture.GetPixels(0);
        //// Create window handle id - future usage
        //m_TextureID = m_texture.GetInstanceID();
        //// assign m_texture to this GUITexture texture
        //gameObject.renderer.material.mainTexture = m_texture;
        //// Create GCHandle - Allocation of m_pixels in memory.
        //m_pixelsHandler = GCHandle.Alloc(m_pixels, GCHandleType.Pinned);

        ////Map delegates
        ////m_setPixelsFunction = this.SetPixels;
        ////m_applyPixelsFunction = this.ApplyPixels;
        ////AwesomiumWrapper.SetDelegates(m_setPixelsFunction, m_applyPixelsFunction);

        //isAwesomiumInit = true;
        //AwesomiumWrapper.init(m_pixelsHandler.AddrOfPinnedObject(), width, height);
    }
示例#6
0
        public void ShowControlWindow(string cmd, int lscId, int nodeId, int nodeType, string nodeName)
        {
            if (UserData.MaxOpLevel <= EnmUserLevel.Attendant)
            {
                WebUtility.ShowMessage(EnmErrType.Warning, "权限不足,请与管理员联系。");
                return;
            }

            switch (cmd.Trim().ToLower())
            {
            case "ctrl":
                ControlWindow.Title  = String.Format("[{0}]{1}", nodeName, "遥控参数值设置");
                ControlWindowHF.Text = String.Format("{0}&{1}&{2}", lscId, nodeId, nodeType);
                ControlWindow.Show();
                break;

            case "set":
                SettingWindow.Title  = String.Format("[{0}]{1}", nodeName, "遥调参数值设置");
                SettingWindowHF.Text = String.Format("{0}&{1}&{2}", lscId, nodeId, nodeType);
                SettingWindow.Show();
                break;

            default:
                break;
            }
        }
示例#7
0
        public BrowsePopup(
            string name,
            Vector2i size,
            IClydeWindow ownerWindow)
        {
            WindowDescriptor popupWindowDescriptor = new WindowDescriptor(name, new() {
                new ControlDescriptorMain()
                {
                    Name = "main",
                    Size = size
                },
                new ControlDescriptorBrowser()
                {
                    Name    = "browser",
                    Size    = size,
                    Anchor1 = new Vector2i(0, 0),
                    Anchor2 = new Vector2i(100, 100)
                }
            });

            WindowElement = new ControlWindow(popupWindowDescriptor);
            WindowElement.CreateChildControls(IoCManager.Resolve <IDreamInterfaceManager>());

            _window = WindowElement.CreateWindow();
            _window.StartupLocation = WindowStartupLocation.CenterOwner;
            _window.Owner           = ownerWindow;
            _window.Closed         += OnWindowClosed;

            Browser = (ControlBrowser)WindowElement.ChildControls[0];
        }
示例#8
0
        internal void ShowSetting()
        {
            ControlWindow dlg = new ControlWindow(this);

            dlg.Owner = this;

            dlg.ShowDialog();
        }
示例#9
0
        public string GetWindowScript(int windowid)
        {
            ControlWindow window = this.db.ControlWindow.FirstOrDefault(m => m.id == windowid);
            var           json   = System.IO.File.ReadAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, System.Text.Encoding.UTF8);
            var           obj    = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(json);

            return(obj.Value <string>("controlsScript"));
        }
 public void destroy()
 {
     if (this.window != null)
     {
         this.window.Close();
         this.window = null;
     }
 }
示例#11
0
        // Entry point for the application
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Create the control panel and show it
            ControlWindow app = new ControlWindow();

            app.Show();
        }
示例#12
0
        public void onLoad(object sender, RoutedEventArgs e)
        {
            //parentWin = (Window)((ContentControl) this.Parent).Parent;
            parentWin = (ControlWindow)Window.GetWindow(this);

            //define event handler in main window
            UserCreated += new UserCreatedHandler(mainWin.onUserCreated);
            UserCreated += new UserCreatedHandler(parentWin.onUserCreated);
        }
示例#13
0
        private void onLoad(object sender, RoutedEventArgs e)
        {
            _parentWin = (ControlWindow)Window.GetWindow(this);
            user       = _parentWin.user;

            //WebcamViewer.StartPreview();
            TestCompleted += new TestCompletedHandler(_mainWindow.testCompleted);
            Streaming     += new StreamingHandler(_mainWindow.startStreaming);
            NotStreaming  += new NotStreamingHandler(_mainWindow.stopStreaming);
        }
示例#14
0
        public void SetDocParms()
        {
            try {
                if (String.IsNullOrEmpty(ControlWindowHF.Text.Trim()))
                {
                    var warningMsg = "获取DO参数时发生错误,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var ids = WebUtility.ItemSplit(ControlWindowHF.Text.Trim());
                if (ids.Length != 3)
                {
                    var warningMsg = "DO参数格式错误,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var lscId       = Int32.Parse(ids[0]);
                var nodeId      = Int32.Parse(ids[1]);
                var nodeType    = Int32.Parse(ids[2]);
                var enmNodeType = Enum.IsDefined(typeof(EnmNodeType), nodeType) ? (EnmNodeType)nodeType : EnmNodeType.Null;
                var lscUser     = UserData.LscUsers.Find(lu => { return(lu.LscID == lscId); });
                if (lscUser == null)
                {
                    var warningMsg = "无法获取用户信息,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var order = new OrderInfo();
                order.LscID      = lscId;
                order.TargetID   = nodeId;
                order.TargetType = enmNodeType;
                order.OrderType  = EnmActType.SetDoc;
                order.RelValue1  = ControlRadioGroup.CheckedItems[0].InputValue;
                order.RelValue2  = lscId.ToString();
                order.RelValue3  = lscUser.UserID.ToString();
                order.RelValue4  = lscUser.UserName;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            } finally {
                Radio1.Checked = true;
                ControlWindow.Hide();
            }
        }
        internal UserControlMenuItem(ItemMenu itemMenu, ControlWindow context)
        {
            InitializeComponent();

            _context = context;

            ExpanderMenu.Visibility     = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible;
            ListViewItemMenu.Visibility = itemMenu == null ? Visibility.Visible : Visibility.Collapsed;

            this.DataContext = itemMenu;
        }
示例#16
0
        public int WriteWindowScript(int windowid, string script)
        {
            ControlWindow window = this.db.ControlWindow.FirstOrDefault(m => m.id == windowid);
            var           json   = System.IO.File.ReadAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, System.Text.Encoding.UTF8);
            var           obj    = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(json);

            obj["controlsScript"] = script;
            System.IO.File.WriteAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, obj.ToString(), System.Text.Encoding.UTF8);

            SystemHelper.AddSysLog(this.User.id.Value, "改写监控窗口的脚本:" + window.Name);

            return(0);
        }
 public void initialize()
 {
     try
     {
         this.destroy();
         this.window = new ControlWindow(this.filler);
         this.window.Show();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
    /// <summary>
    /// newWindow can be null to close the current window
    /// </summary>
    private void SetOpenWindow(ControlWindow newWindow)
    {
        if (openWindow != null)
        {
            openWindow.gameObject.SetActive(false);
        }

        openWindow = newWindow;
        if (newWindow != null)
        {
            newWindow.gameObject.SetActive(true);
        }
    }
示例#19
0
    public virtual void OnEnable()
    {
        if (currentWindow == this)
        {
            return;
        }

        if (currentWindow != null)
        {
            currentWindow.gameObject.SetActive(false);
        }

        currentWindow = this;
    }
示例#20
0
        public void Start()
        {
            // make the digital analogTasks. The function "CreateDigitalTask" is defined later
            //e.g   CreateDigitalTask("notEOnOff");
            //      CreateDigitalTask("eOnOff");

            //This is to keep track of the various things which the HC controls.
            analogTasks          = new Dictionary <string, Task>();
            stateRecord          = new hardwareState();
            stateRecord.analogs  = new Dictionary <string, double>();
            stateRecord.digitals = new Dictionary <string, bool>();

            tstage = new Parker404XR("ASRL1::INSTR", profilesPath + "TranslationStageInitFile.txt");
            CreateDigitalTask("aom0enable");
            CreateDigitalTask("aom1enable");
            CreateDigitalTask("aom2enable");
            CreateDigitalTask("aom3enable");
            CreateDigitalTask("shutterenable");

            // make the analog output analogTasks. The function "CreateAnalogOutputTask" is defined later
            //e.g.  bBoxAnalogOutputTask = CreateAnalogOutputTask("b");
            //      steppingBBiasAnalogOutputTask = CreateAnalogOutputTask("steppingBBias");

            CreateAnalogOutputTask("aom0amplitude");
            CreateAnalogOutputTask("aom0frequency");
            CreateAnalogOutputTask("aom1amplitude");
            CreateAnalogOutputTask("aom1frequency");
            CreateAnalogOutputTask("aom2amplitude");
            CreateAnalogOutputTask("aom2frequency");
            CreateAnalogOutputTask("aom3amplitude");
            CreateAnalogOutputTask("aom3frequency");
            CreateAnalogOutputTask("coil0current");
            CreateAnalogOutputTask("coil1current");

            CreateAnalogInputTask("laserLockErrorSignal", -10, 10);
            CreateAnalogInputTask("chamber1Pressure");
            CreateAnalogInputTask("chamber2Pressure");

            // make the control controlWindow
            controlWindow            = new ControlWindow();
            controlWindow.controller = this;


            HCState = SHCUIControlState.OFF;



            Application.Run(controlWindow);
        }
示例#21
0
        public MainWindow()
        {
            InitializeComponent();
              CCore.LoadFromConfig();
              DispatcherTimer timer = new DispatcherTimer();
              timer.Interval = TimeSpan.FromSeconds(1);
              timer.Tick += timer_Tick;
              timer.Start();

              controlWindow = new ControlWindow();
              controlWindow.Show();
              controlWindow.Closing += controlWindow_Closing;
              this.Closing += MainWindow_Closing;
              this.KeyDown += new KeyEventHandler(ESC_Pressed);
              mePlayer.MouseDown += new MouseButtonEventHandler(Maximize_Video);
        }
示例#22
0
        public string GetWindowCode(int windowid, string windowCode)
        {
            ControlWindow window = null;

            if (!string.IsNullOrEmpty(windowCode))
            {
                window = this.db.ControlWindow.FirstOrDefault(m => m.Code == windowCode);
            }
            else
            {
                window = this.db.ControlWindow.FirstOrDefault(m => m.id == windowid);
            }
            var json = System.IO.File.ReadAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, System.Text.Encoding.UTF8);

            return(json);
        }
示例#23
0
        private void aceptar_Click(object sender, RoutedEventArgs e)
        {
            key = log.Access(usr.Text, pass.Text);

            if (key != 0)
            {
                MessageBox.Show("BIENVENIDO");
                this.Hide();
                ControlWindow control = new ControlWindow();
                control.Show(key);
                this.Close();
            }
            else
            {
                MessageBox.Show("usuario invalido");
            }
        }
示例#24
0
        public ControlWindow GetWindowInfo(int windowid, string windowCode)
        {
            ControlWindow window = null;

            if (windowCode != null)
            {
                window = this.db.ControlWindow.Where(m => m.Code == windowCode).Select(m => new ControlWindow {
                    windowWidth = m.windowWidth, windowHeight = m.windowHeight, Name = m.Name, id = m.id
                }).FirstOrDefault();
            }
            else
            {
                window = this.db.ControlWindow.Where(m => m.id == windowid).Select(m => new ControlWindow {
                    windowWidth = m.windowWidth, windowHeight = m.windowHeight, Name = m.Name, id = m.id
                }).FirstOrDefault();
            }
            return(window);
        }
示例#25
0
        public int WriteWindowCode(int windowid, string windowCode, string filecontent)
        {
            ControlWindow window = null;

            if (!string.IsNullOrEmpty(windowCode))
            {
                window = this.db.ControlWindow.FirstOrDefault(m => m.Code == windowCode);
            }
            else
            {
                window = this.db.ControlWindow.FirstOrDefault(m => m.id == windowid);
            }

            SystemHelper.AddSysLog(this.User.id.Value, "修改监控窗口:" + window.Name);

            System.IO.File.WriteAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, filecontent, System.Text.Encoding.UTF8);
            return(0);
        }
示例#26
0
 public void Run()
 {
     if (!IsInitialized || _hasRun)
     {
         return;
     }
     IsRunning = true;
     _hasRun   = true;
     Timer.Reset();
     ControlWindow.Show();
     ControlWindow.Focus();
     using (var renderLoop = new RenderLoop(ControlWindow)) {
         while (renderLoop.NextFrame())
         {
             Render();
         }
     }
 }
示例#27
0
        public string GetWindowContent(int windowid, string windowCode)
        {
            ControlWindow window = null;

            if (windowCode != null)
            {
                window = this.db.ControlWindow.FirstOrDefault(m => m.Code == windowCode);
            }
            else
            {
                window = this.db.ControlWindow.FirstOrDefault(m => m.id == windowid);
            }

            var editorHtml = System.IO.File.ReadAllText(WebRoot + "editor.html", System.Text.Encoding.UTF8);
            var json       = System.IO.File.ReadAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, System.Text.Encoding.UTF8);
            var obj        = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(json);

            editorHtml = editorHtml.Replace("//code here", obj.Value <string>("editorScript") + "\r\n" + obj.Value <string>("controlsScript"));
            return(editorHtml);
        }
        public PersonalRegisterPage()
        {
            InitializeComponent();
            aceptar.Click += Aceptar_Click;

            puesto.ItemsSource = new string[]
            {
                "administracion",
                "recepcion",
                "doctor",
                "enfermero",
                "dietetica",
                "cocina",
                "farmacia"
            };

            cancelar.Click += (sender, e) =>
            {
                ControlWindow control = new ControlWindow();
                control.Show(14);
            };
        }
示例#29
0
        private async void Aceptar_Click(object sender, RoutedEventArgs e)
        {
            Loading.Visibility = Visibility.Visible;

            key = await log.AccessAsync(usr.Text, pass.Password);

            if (key != 0)
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("Bienvenido de nuevo, accesando a su panel", "¡Buen dia!", MessageBoxButton.OK,
                                                  MessageBoxImage.None);
                this.Hide();
                ControlWindow control = new ControlWindow();
                control.Show(key);
                this.Close();
                Loading.Visibility = Visibility.Collapsed;
            }
            else
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("Usuario o contraseña incorrectos, rectificalos", "Alto ahi", MessageBoxButton.OK,
                                                  MessageBoxImage.Stop);
                Loading.Visibility = Visibility.Collapsed;
            }
        }
    // Use this for initialization
    void Start()
    {
        browserEventHandler = GetComponent<BrowserGUIEvents>();
        controlWindow = GameObject.Find("ControlWindow").GetComponent<ControlWindow>();
        Debug.Log(width);
        InitAwesomium(width,height);

        //// Create texture in ARGB32 format
        //m_texture = new Texture2D(width, height, TextureFormat.ARGB32, true);
        ////Get Color[] (pixels) from texture
        //m_pixels = m_texture.GetPixels(0);
        //// Create window handle id - future usage
        //m_TextureID = m_texture.GetInstanceID();
        //// assign m_texture to this GUITexture texture
        //gameObject.renderer.material.mainTexture = m_texture;
        //// Create GCHandle - Allocation of m_pixels in memory.
        //m_pixelsHandler = GCHandle.Alloc(m_pixels, GCHandleType.Pinned);

        ////Map delegates
        ////m_setPixelsFunction = this.SetPixels;
        ////m_applyPixelsFunction = this.ApplyPixels;
        ////AwesomiumWrapper.SetDelegates(m_setPixelsFunction, m_applyPixelsFunction);

        //isAwesomiumInit = true;
        //AwesomiumWrapper.init(m_pixelsHandler.AddrOfPinnedObject(), width, height);
    }
示例#31
0
        public ControlWindow SaveWindowContent(ControlWindow window, string content)
        {
            var obj = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(content);

            window.Name = obj.Value <string>("name");
            window.Code = obj.Value <string>("code");
            try
            {
                window.windowWidth = obj.Value <int?>("windowWidth");
            }
            catch
            {
                throw new Exception("窗口宽度格式错误,请输入整数!");
            }
            try
            {
                window.windowHeight = obj.Value <int?>("windowHeight");
            }
            catch
            {
                throw new Exception("窗口高度格式错误,请输入整数!");
            }
            var windowCodes = obj.Value <Newtonsoft.Json.Linq.JArray>("windowCodes");
            var windowids   = new int[windowCodes.Count];

            for (int i = 0; i < windowids.Length; i++)
            {
                windowids[i] = db.ControlWindow.Where(m => m.Code == windowCodes[i].ToString()).Select(m => m.id).FirstOrDefault().Value;
            }
            if (window.id != null)
            {
                //检查循环嵌套
                foreach (var item in windowids)
                {
                    checkChild(window.id.Value, item);
                }
            }
            var customProperties = obj.Value <string>("customProperties");

            if (window.id == null && this.db.ControlWindow.Any(m => m.Name == window.Name && window.FolderId == m.FolderId && window.ControlUnitId == m.ControlUnitId))
            {
                throw new Exception("监视画面名称已存在");
            }
            else if (window.id == null && this.db.ControlWindow.Any(m => m.id != window.id && m.Name == window.Name && window.FolderId == m.FolderId && window.ControlUnitId == m.ControlUnitId))
            {
                throw new Exception("监视画面名称已存在");
            }

            if (window.id == null && this.db.ControlWindow.Any(m => m.Code == window.Code))
            {
                throw new Exception("监视画面编号已存在");
            }
            else if (window.id == null && this.db.ControlWindow.Any(m => m.id != window.id && m.Code == window.Code))
            {
                throw new Exception("监视画面编号已存在");
            }

            if (window.FilePath == null)
            {
                window.FilePath = Guid.NewGuid().ToString("N");
            }

            SystemHelper.AddSysLog(this.User.id.Value, "修改监控窗口:" + window.Name);

            this.db.Update(window);

            System.IO.File.WriteAllText(Way.Lib.PlatformHelper.GetAppDirectory() + "windows/" + window.FilePath, content, System.Text.Encoding.UTF8);
            return(window);
        }
        public ControlTestScreen()
        {
            window = new ControlWindow();

            ROClient.Singleton.GuiManager.Controls.Add(window);
        }
        private IEnumerator<ITask> Initialize()
        {
            // create WPF adapter
            _wpfServicePort = ccrwpf.WpfAdapter.Create(TaskQueue);

            var runWindow = _wpfServicePort.RunWindow(() => new ControlWindow(new MainWindowViewModel(this)));
            yield return (Choice)runWindow;

            var exception = (Exception)runWindow;
            if (exception != null)
            {
                LogError(exception);
                StartFailed();
                yield break;
            }

            // need double cast because WPF adapter doesn't know about derived window types
            _userInterface = (Window)runWindow as ControlWindow;
        }
        public ControlTestScreen()
        {
            window = new ControlWindow();

            ROClient.Singleton.GuiManager.Controls.Add(window);
        }