public keysPanel()
        {
            InitializeComponent();

            init();

            refreshCtrlsHandle += init;
        }
        public void Show(string caption, string text, nullEvent Confirm, nullEvent Cancel)
        {
            ConfirmHandle = Confirm;
            CancelHandle = Cancel;

            lbCaption.Content = caption;
            lbText.Content = text;

            this.Visibility = Visibility.Visible;
        }
        public void Show(intEvent Event1, nullEvent Event2, DateTime dt, DateTime min, DateTime max)
        {
            confirmEvent = Event1;
            cancelEvent = Event2;
            dtMax = max;
            dtMin = min;

            resetTime(dt);

            lbNotice.Content = "";
            this.Visibility = Visibility.Visible;

            trySetCtrlPos(mainPanelCtrl.PointMouseDown);
        }
        public UserCtrl()
        {
            InitializeComponent();

            this.Visibility = Visibility.Hidden;
            lbFailed.Visibility = Visibility.Hidden;

            UsernameInit();

            refushUser += UserInit;
            LogOut += logOut;

            dt.Tick += new EventHandler(dt_Tick);
            dt.Interval = new TimeSpan(0, 0, 2);
        }
 public static void addLanRefreshHandle(nullEvent handle)
 {
     lstLanRefresh.Add(handle);
 }
        public valmoWin()
        {
            try
            {
                DirectoryInfo dirUpgrade = new DirectoryInfo("upgrade");
                DirectoryInfo dirBackup = new DirectoryInfo("backup");
                DirectoryInfo dirIpr = new DirectoryInfo("ipr");
                DirectoryInfo dirJpeg = new DirectoryInfo("jpeg");
                DirectoryInfo dirRec = new DirectoryInfo("rec");
                DirectoryInfo dirLns = new DirectoryInfo("lines");

                if (!dirUpgrade.Exists)
                {
                    dirUpgrade.Create();
                }
                if (!dirBackup.Exists)
                {
                    dirBackup.Create();
                }
                if (!dirJpeg.Exists)
                {
                    dirJpeg.Create();
                }
                if (!dirIpr.Exists)
                {
                    dirIpr.Create();
                }
                if (!dirRec.Exists)
                {
                    dirRec.Create();
                }
                if (!dirLns.Exists)
                {
                    dirLns.Create();
                }

                dv.feedbackHandle = callbackObjLstFunc;
                callbackObjLstHandle = new callBackObjEvent(callbackObjLstFunc);
                execHandle = new execEvent(execInvoke);
                execMsg = new execMsgEvent(execMsgFunc);
                setPageToNrHandle = setPangetoNr;
                setCurPageDisHandle = setCurPageDis;
                SCurUser = dv.users.curUser;

                InitializeComponent();

                ctrlsObjInit();

                setUnitResources(objUnit.unitBase[UnitType.Len_mm]);
                setUnitResources(objUnit.unitBase[UnitType.Temp_C]);
                setUnitResources(objUnit.unitBase[UnitType.Prs_Mpa]);
                setUnitResources(objUnit.unitBase[UnitType.Force_ton]);

                valmoWin.dv.SysPr[5].addHandle(handle_sys005, plcLstSpd.lowSpdType);

                vm.getTm("-------- 1 ------------");
                if (dv.getLink())
                {
                    vm.getTm("-------- 2 ------------");
                    //开机时,检测报警灯是否是开着的状态。如果开着,需要将其关闭
                    if (valmoWin.dv.SysPr[187].valueNew == 1)
                        valmoWin.dv.SysPr[187].valueNew = 0;

                    //unitInit();
                    setUnitResources(objUnit.lenUnitBasic);
                    setUnitResources(objUnit.tempUnitBasic);
                    setUnitResources(objUnit.prsUnitBasic);
                    setUnitResources(objUnit.forceUnitBasic);

                    foreach (nullEvent func in lstStartUpInit)
                    {
                        func();
                    }
                    setPangetoNr(0);
                }
                else
                {
                    execFunc(opeOrderType.winMsg, new WinMsg(WinMsgType.mwLinkPlcError));
                }
                vm.getTm("-------- 3 ------------");
                checkUsbFunc();
                lanCheck();
                checkAccredit();
            }
            catch (Exception ex)
            {
                vm.perror(ex.ToString());
            }

            dv.SysPr[14].add();

            BackstageTimer = new DispatcherTimer();
            BackstageTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            BackstageTimer.Tick += new EventHandler(ClockTick);
            BackstageTimer.Start();

            lastEventTime = DateTime.Now;
            valmoWin.BackstageClockTick += ScreenSaverTimer;
        }
        public void init(double imax,double imin, string dis,string curValue, string unit, double offset, nullEvent disposeHandle, VoidDblEvent cfHandle)
        {
            Dispose = disposeHandle;
            Confirm = cfHandle;

            Flag = 0;

            if (valmoWin.SCurUser.accessLevel > 4)
            {
                lbSerNum.Visibility = Visibility.Visible;
            }
            else
            {
                lbSerNum.Visibility = Visibility.Hidden;
            }
            lbSerNum.Content = "";

            lbTitle.Content = dis;

            max = imax;
            lbMax.Content = max.ToString();
            lbMax.Foreground = Brushes.White;

            min = imin;
            lbMin.Content = min.ToString();
            lbMin.Foreground = Brushes.White;

            CurrentValue = curValue;
            lbPreValue.Content = CurrentValue;
            lbActValue.Content = CurrentValue;

            lbUint.Content = unit;

            FtOffset = offset;
            btnAdd_FT.Content = "+" + FtOffset;
            btnSub_FT.Content = "-" + FtOffset;

            bIsNewValue = true;

            show();
        }
        public void init(objUnit obj,string dis, nullEvent disposeHandle, VoidDblEvent cfHandle)
        {
            Dispose = disposeHandle;
            Confirm = cfHandle;

            Flag = 0;

            if (valmoWin.SCurUser.accessLevel > 4)
            {
                lbSerNum.Visibility = Visibility.Visible;
            }
            else
            {
                lbSerNum.Visibility = Visibility.Hidden;
            }
            lbSerNum.Content = obj.serialNum;

            lbTitle.Content = dis;

            max = obj.vMaxDbl;
            lbMax.Content = obj.vMaxStr;
            lbMax.Foreground = Brushes.White;

            min = obj.vMinDbl;
            lbMin.Content = obj.vMinStr;
            lbMin.Foreground = Brushes.White;

            CurrentValue = obj.vDblStr;
            lbPreValue.Content = CurrentValue;
            lbActValue.Content = CurrentValue;

            lbUint.Content = obj.unit;

            FtOffset = obj.getPrecision();
            btnAdd_FT.Content = "+" + FtOffset;
            btnSub_FT.Content = "-" + FtOffset;

            bIsNewValue = true;

            show();
        }
        public void init(objUnit obj, nullEvent disposeHandle,VoidDblEvent cfHandle)
        {
            Dispose = disposeHandle;
            Confirm = cfHandle;

            Flag = 0;

            if (valmoWin.dv.users.curUser.accessLevel >= 4)
            {
                lbSerNum.Visibility = Visibility.Visible;
            }
            else
            {
                lbSerNum.Visibility = Visibility.Hidden;
            }
            lbSerNum.Content = obj.serialNum;

            object objDis = App.Current.TryFindResource(obj.serialNum);
            if (objDis == null)
            {
                lbTitle.Content = "对象未定义说明";
            }
            else
            {
                lbTitle.Content = objDis;
            }

            max = obj.vMaxDbl;
            lbMax.Content = obj.vMaxStr;
            lbMax.Foreground = Brushes.White;

            min = obj.vMinDbl;
            lbMin.Content = obj.vMinStr;
            lbMin.Foreground = Brushes.White;

            CurrentValue = obj.vDblStr;
            lbPreValue.Content = CurrentValue;
            lbActValue.Content = CurrentValue;

            lbUint.Content = obj.unit;

            FtOffset = obj.getPrecision();
            btnAdd_FT.Content = "+" + FtOffset;
            btnSub_FT.Content = "-" + FtOffset;

            bIsNewValue = true;

            show();
        }
        public void init(objUnit obj, string dis, nullEvent disposeHandle,double min,double max)
        {
            lbInput_numKey.FontSize = 40;
            _curObj = obj;
            lbSer.Content = obj.serialNum;
            this._max = max;
            lbMax.Content = _max.ToString();
            this._min = min;
            lbMin_numKey.Content = _min.ToString();
            numInput = obj.vDblStr;

            lbCur_numKey.Content = numInput;
            lbInput_numKey.Content = numInput;
            lbDis.Content = dis;
            flagFirstInputValue = true;
            if (obj.unit == "")
                lbUnit_numKey.Content = "";
            else
                lbUnit_numKey.Content = "[" + obj.unit + "]";

            lbMax.Foreground = Brushes.Black;
            lbMin_numKey.Foreground = Brushes.Black;
            this.dispose = disposeHandle;

            checkAccessLevel();
            show();
        }
 public void show(DblEvent dealFunc = null, nullEvent disposeFunc = null,string path = null)
 {
     UpanPath = path;
     lbDisOk.Visibility = Visibility.Hidden;
     btnConfirm.Visibility = Visibility.Hidden;
     dealHandle = dealFunc;
     disposeHandle = disposeFunc;
     pBar.Value = 0;
     lbValue.Content = "0.0%";
     dtLoad.Start();
     this.Visibility = Visibility.Visible;
 }
 public void show(DblRefIntEvent dealFunc = null, nullEvent disposeFunc = null, string path = null, int totalNum = 0)
 {
     UpanPath = path;
     total = totalNum;
     //lbDisOk.Visibility = Visibility.Hidden;
     btnConfirm.readOnly = true;
     readOnly = true;
     dealHandle = dealFunc;
     disposeHandle = disposeFunc;
     //pBar.Value = 0;
     //lbValue.Content = "0.0%";
     count = 0;
     dtLoad.Start();
     this.Visibility = Visibility.Visible;
 }
 public void init(nullEvent handle)
 {
     confirmHandle = handle;
 }
 public static void addUnitChangeHandle(nullEvent handle)
 {
     lstSUnitChange.Add(handle);
 }
 public void show(nullEvent handle,string dis = null)
 {
     confirmHandle = handle;
     if (dis != null)
     {
         lbDis.Content = dis;
         //textBlock1.Text = dis;
     }
     this.Visibility = Visibility.Visible;
 }
Пример #16
0
 public void init(setValueEvent setHandle,nullEvent checkHandle)
 {
 }
 public void init(string dis, string filterStr, strEvent confirmHandle, nullEvent disposeHandle)
 {
     this.confirmHandle = confirmHandle;
     this.disposeHandle = disposeHandle;
     winDis = dis;
     strFilter = filterStr;
     lbWinDis.Content = valmoWin.dv.getCurDis("lanKey1022") + " " + dis;
     refreshUpan();
     btnLocal_Click(null, null);
     this.Opacity = 1;
     this.Visibility = Visibility.Visible;
 }
        public void show(DblRefIntEvent dealFunc = null, nullEvent disposeFunc = null, string path = null, int totalNum = 0)
        {
            UpanPath = path;
            total = totalNum;
            //lbDisOk.Visibility = Visibility.Hidden;
            btnConfirm.readOnly = true;
            readOnly = true;
            dealHandle = dealFunc;
            disposeHandle = disposeFunc;
            //pBar.Value = 0;
            //lbValue.Content = "0.0%";
            count = 0;
            //lstIprCtr.Clear();
            //for (int i = 0; i < 300; i++)
            //{
            //   lstIprCtr.Add( valmoWin.SIprCtrl.getUnitObj(i));
            //}
            //XmlDocument xmlDoc = new XmlDocument();
            //xmlDoc.Load("fileConf.xml");
            //XmlNode root = xmlDoc.SelectSingleNode("FileItems");//查找<bookstore>
            //foreach (XmlNode xn in root.ChildNodes)
            //{
            //    switch (xn.Name)
            //    {
            //        case "SysPr67":
            //            xnlSysPr67 = xn.ChildNodes;
            //            break;
            //        case "Normal":
            //            xnlNormal = xn.ChildNodes;
            //            break;
            //    }
            //}
            //exportCount = lstIprCtr.Count + xnlSysPr67.Count + xnlNormal.Count;
            //curStep = 0;

            //XmlTextWriter writer = new XmlTextWriter(prgDir + "\\" + fileName, System.Text.Encoding.UTF8);
            //writer.Formatting = Formatting.Indented;
            //writer.WriteStartDocument();
            //writer.WriteStartElement("ipr");
            //writer.WriteStartElement("param");
            //writer.WriteAttributeString("user", valmoWin.dv.users.curUser.name);
            //writer.WriteEndElement();//end of param
            ////saveIprFileFunc(writer);
            //writer.WriteEndElement();//end of ipr
            //writer.Close();
            tbDis.Text = "";
            dtLoad.Start();
            this.Visibility = Visibility.Visible;
        }
        public void init(bool isSecretChars, string oldValue, strEvent enterHandle, nullEvent disposeHandle, Thickness margin, Label lbobj,bool flagSetFileName = false)
        {
            try
            {
                lbObj = lbobj;
                this.isSetSecretChars = isSecretChars;
                curStr = oldValue;
                if (isSecretChars)
                {
                    string strtmp = "";
                    for (int i = 0; i < oldValue.Length; i++)
                        strtmp += "*";
                    lbValue.Content = strtmp;
                }
                else
                    lbValue.Content = oldValue;
                this.mouseEnterHandle = enterHandle;
                this.disposeHandle = disposeHandle;
                img_enter.Opacity = 0;
                isMouseDown = false;
                trySetPos(margin.Left, margin.Top);
                isSetFileName = flagSetFileName;
                show();
            }
            catch
            {

            }
        }
 public void show(objUnit obj, nullEvent disposeFunc)
 {
     curObj = obj;
     lbCur_numKey.Content = curObj.note;
     numInput = curObj.note;
     lbInput_numKey.Content = numInput;
     disposeHandle = disposeFunc;
     this.Opacity = 1;
     this.Visibility = Visibility.Visible;
 }
 public void show(DblEvent dealFunc = null, nullEvent disposeFunc = null)
 {
     dealHandle = dealFunc;
     disposeHandle = disposeFunc;
     pBar.Value = 0;
     lbValue.Content = "0.0%";
     //if (dealHandle == null)
     //{
     //    throw (new Exception("<progressCtrl.show> DispatcherTimer dealHandle show not be null!"));
     //}
     dtLoad.Start();
     this.Visibility = Visibility.Visible;
 }
        public productMessageList()
        {
            InitializeComponent();

            refushH += r;
            r();

            lstUnit = new prdMsgUnit[50];

            lstUnit[0] = uint0;
            lstUnit[1] = uint1;
            lstUnit[2] = uint2;
            lstUnit[3] = uint3;
            lstUnit[4] = uint4;
            lstUnit[5] = uint5;
            lstUnit[6] = uint6;
            lstUnit[7] = uint7;
            lstUnit[8] = uint8;
            lstUnit[9] = uint9;
            lstUnit[10] = uint10;
            lstUnit[11] = uint11;
            lstUnit[12] = uint12;
            lstUnit[13] = uint13;
            lstUnit[14] = uint14;
            lstUnit[15] = uint15;
            lstUnit[16] = uint16;
            lstUnit[17] = uint17;
            lstUnit[18] = uint18;
            lstUnit[19] = uint19;
            lstUnit[20] = uint20;
            lstUnit[21] = uint21;
            lstUnit[22] = uint22;
            lstUnit[23] = uint23;
            lstUnit[24] = uint24;
            lstUnit[25] = uint25;
            lstUnit[26] = uint26;
            lstUnit[27] = uint27;
            lstUnit[28] = uint28;
            lstUnit[29] = uint29;
            lstUnit[30] = uint30;
            lstUnit[31] = uint31;
            lstUnit[32] = uint32;
            lstUnit[33] = uint33;
            lstUnit[34] = uint34;
            lstUnit[35] = uint35;
            lstUnit[36] = uint36;
            lstUnit[37] = uint37;
            lstUnit[38] = uint38;
            lstUnit[39] = uint39;
            lstUnit[40] = uint40;
            lstUnit[41] = uint41;
            lstUnit[42] = uint42;
            lstUnit[43] = uint43;
            lstUnit[44] = uint44;
            lstUnit[45] = uint45;
            lstUnit[46] = uint46;
            lstUnit[47] = uint47;
            lstUnit[48] = uint48;
            lstUnit[49] = uint49;

            valmoWin.dv.PrdPr[22].add();
            valmoWin.dv.PrdPr[26].add();
            valmoWin.dv.PrdPr[33].add();
            valmoWin.dv.PrdPr[40].add();
            valmoWin.dv.PrdPr[61].add();
            valmoWin.dv.PrdPr[47].add();
            valmoWin.dv.PrdPr[54].add();
            valmoWin.dv.PrdPr[68].add();
            valmoWin.dv.PrdPr[75].add();
            valmoWin.dv.PrdPr[82].add();
            valmoWin.dv.PrdPr[89].add();
            valmoWin.dv.PrdPr[105].add();
            valmoWin.dv.PrdPr[106].add();

            valmoWin.dv.PrdPr[215].addHandle(refush);
        }
        public void init(objUnit obj, nullEvent disposeHandle)
        {
            _curObj = obj;
            _max = obj.vMaxDbl;
            _min = obj.vMinDbl;
            numInput = obj.vDblStr;
            lbSer.Content = obj.serialNum;
            _objUnit = obj.unit;

            lbMax.Content = obj.vMaxStr;
            lbMin_numKey.Content = obj.vMinStr;
            lbCur_numKey.Content = numInput;
            lbInput_numKey.Content = numInput;
            string description = valmoWin.dv.getCurDis(_curObj.serialNum);
            if (description == null)
            {
                lbDis.Content = "对象" + _curObj.serialNum + "未找到描述";
            }
            else
            {
                lbDis.Content = description;
            }
            flagFirstInputValue = true;
            if (obj.unit == "" || obj.unit == null)
                lbUnit_numKey.Content = "";
            else
                lbUnit_numKey.Content = "[" + obj.unit + "]";

            lbMax.Foreground = Brushes.Black;
            lbMin_numKey.Foreground = Brushes.Black;
            dispose = disposeHandle;

            checkAccessLevel();
            show();
        }