private void EjectorFWDCurveRefush(objUnit obj)
        {
            int count = obj.value;
            int MaxStroke = valmoWin.dv.MldPr[234].value;
            int MaxSpeed = valmoWin.dv.MldPr[240].value;
            int[] EjectorFWDData = new int[count * 3];

            if (MaxStroke == 0 || MaxSpeed == 0)
            {
                return;
            }

            Lasal32.GetData(EjectorFWDData, (uint)valmoWin.dv.PrdPr[241].valueNew, count * 12);

            Point[] curveData_Current = new Point[count];
            Point[] curveData_Speed = new Point[count];

            for (int i = 0; i < count; i++)
            {
                double pos = EjectorFWDData[i * 3 + 2] * 1.0 / MaxStroke * 10000;
                double current = EjectorFWDData[i * 3] * 1.0 / 1000 * 10000;
                double speed = Math.Abs(EjectorFWDData[i * 3 + 1]) * 1.0 / MaxSpeed * 10000;

                curveData_Current[i] = new Point(pos, 10000 - (current + 10000) / 2);
                curveData_Speed[i] = new Point(pos, 10000 - speed);
            }

            EjectorFWDSpeedCurve.refushCurve(curveData_Speed);
            EjectorFWDCurrentCurve.refushCurve(curveData_Current);
        }
 private void upadatprg3(objUnit obj)
 {
     if (valmoWin.dv.MldPr[050].vDbl > 0)
     {
         prg3.Value = (int)(100 * valmoWin.dv.MldPr[094].vDbl / valmoWin.dv.MldPr[050].vDbl);
     }
 }
 private void handleIBTPr_008(objUnit obj)
 {
     lightState2Ctrl5.state = ((obj.value >> 4) & 0x01) == 1;
     lightState2Ctrl6.state = ((obj.value >> 5) & 0x01) == 1;
     lightState2Ctrl7.state = ((obj.value >> 6) & 0x01) == 1;
     lightState2Ctrl8.state = ((obj.value >> 7) & 0x01) == 1;
 }
Exemplo n.º 4
0
        public dvBase()
        {
            try
            {
                objHeart = dataBase[0];

                objUnit.getObjHandle = getObj;
                for (int i = 0; i < dataBase.length; i++)
                {
                    if (dataBase[i] != null)
                    {
                        int num = Int32.Parse(dataBase[i].serialNum.Substring(3, dataBase[i].serialNum.Length - 3));
                        string ser = dataBase[i].serialNum.Substring(0, 3);
                        switch (ser)
                        {
                            case "Abt":
                                AlmPr[num] = dataBase[i];
                                break;
                            case "Key":
                                KeyPr[num] = dataBase[i];
                                break;
                            case "Ipr":
                                IprPr[num] = dataBase[i];
                                break;
                            case "Sys":
                                SysPr[num] = dataBase[i];
                                break;
                            case "Mld":
                                MldPr[num] = dataBase[i];
                                break;
                            case "Inj":
                                InjPr[num] = dataBase[i];
                                break;
                            case "Tmp":
                                TmpPr[num] = dataBase[i];
                                break;
                            case "Prd":
                                PrdPr[num] = dataBase[i];
                                break;
                            case "IOS":
                                IOSPr[num] = dataBase[i];
                                break;
                            case "IOF":
                                IOFPr[num] = dataBase[i];
                                break;
                            case "IBT":
                                IBTPr[num] = dataBase[i];
                                break;
                        }
                        //vm.debug(dataBase[i].serialNum);
                    }
                }
                objUnit.dv_base = this;
                almInit();
            }
            catch (Exception ex)
            {
                vm.perror("[dvBase] " + ex.ToString());
            }
        }
 private void handleIBTPr_004(objUnit obj)
 {
     lightState2Ctrl1.state = ((obj.value >> 4) & 0x01) == 1;
     lightState2Ctrl2.state = ((obj.value >> 5) & 0x01) == 1;
     lightState2Ctrl3.state = ((obj.value >> 6) & 0x01) == 1;
     lightState2Ctrl4.state = ((obj.value >> 7) & 0x01) == 1;
 }
        private void refreshState(objUnit obj)
        {
            if (_bitNr == -1)
            {
                if (obj.value == 1)
                {
                    _state = true;
                }
                else
                {
                    _state = false;
                }
            }
            else
            {
                if (((obj.value >> _bitNr) & 0x01) == 1)
                {
                    _state = true;
                }
                else
                {
                    _state = false;
                }
            }

            tbState1.SelectedIndex = (_state == true) ? 1 : 0;
        }
 private void upadatprg2(objUnit obj)
 {
     if (valmoWin.dv.MldPr[058].vDbl > 0)
     {
         prg2.Value = (int)(100 * valmoWin.dv.MldPr[099].vDbl / valmoWin.dv.MldPr[058].vDbl);
     }
 }
 private void refush2(objUnit obj)
 {
     double totalTime = valmoWin.dv.SysPr[393].vDbl + obj.vDbl;
     if (totalTime != 0)
     {
         erMaintain2Cr.rateValue = valmoWin.dv.SysPr[393].vDbl / totalTime * 100;
         lbMaintain2Cr.Content = (valmoWin.dv.SysPr[393].vDbl / totalTime * 100).ToString("0.0");
     }
 }
        private void handleSerGet(double ser)
        {
            switch ((objectType)(tbLst.SelectedIndex + 1))
            {
                case objectType.IprPr:
                    {
                        curObj = valmoWin.dv.IprPr[(int)ser];
                    }
                    break;
                case objectType.SysPr:
                    {
                        curObj = valmoWin.dv.SysPr[(int)ser];
                    }
                    break;
                case objectType.MldPr:
                    {
                        curObj = valmoWin.dv.MldPr[(int)ser];
                    }
                    break;
                case objectType.InjPr:
                    {
                        curObj = valmoWin.dv.InjPr[(int)ser];
                    }
                    break;
                case objectType.TmpPr:
                    {
                        curObj = valmoWin.dv.TmpPr[(int)ser];
                    }
                    break;
                case objectType.PrdPr:
                    {
                        curObj = valmoWin.dv.PrdPr[(int)ser];
                    }
                    break;
                case objectType.AlmPr:
                    {
                        curObj = valmoWin.dv.AlmPr[(int)ser];
                    }
                    break;
                case objectType.KeyPr:
                    {
                        curObj = valmoWin.dv.KeyPr[(int)ser];
                    }
                    break;
            }

            if (curObj != null)
            {
                lbDis.Content = valmoWin.dv.getCurDis(curObj.serialNum);
                lbAddr.Content = curObj.addrLocal;
                lbUnit.Content = curObj.unit;
                lbVDbl.Content = curObj.vDblStrNew;
                lbValue.Content = curObj.value;
                lbSer.Content = ser;
            }
        }
        public motorOnBtn()
        {
            InitializeComponent();

            rateObj = valmoWin.dv.SysPr[186];
            motorOnObj = valmoWin.dv.KeyPr[16];
            rateObj.addHandle(handleSysPr186);
            rate.Opacity = 0;
            motorOnObj.addHandle(handleState);
        }
Exemplo n.º 11
0
        public manualBtn()
        {
            InitializeComponent();
            objManual = valmoWin.dv.KeyPr[2];
            objSemiAuto = valmoWin.dv.KeyPr[3];
            objAuto = valmoWin.dv.KeyPr[4];

            objManual.addHandle(handleManual);
            objSemiAuto.addHandle(handleSemiAuto);
            objAuto.addHandle(handleAuto);
        }
 private void handleTmpPr_11(objUnit obj)
 {
     if (valmoWin.dv.TmpPr[11].value >= valmoWin.dv.TmpPr[10].value - valmoWin.dv.TmpPr[14].value && obj.value < valmoWin.dv.TmpPr[10].value + valmoWin.dv.TmpPr[13].value)
     {
         processTmp011.fBackground = new SolidColorBrush(Color.FromRgb(78, 195, 0));
     }
     else
     {
         processTmp011.fBackground = new SolidColorBrush(Color.FromRgb(255,102,0));
     }
 }
 private void RefushLubType(objUnit obj)
 {
     if (obj.value == 0)
     {
         lbLubType.SetResourceReference(Label.ContentProperty, "CB_LubPumpMode_0");
     }
     else
     {
         lbLubType.SetResourceReference(Label.ContentProperty, "CB_LubPumpMode_1");
     }
 }
        private void handleIpr65(objUnit obj)
        {
            switch65_0.stateOn = ((obj.value >> 0) & 0x01) == 1;
            switch65_1.stateOn = ((obj.value >> 1) & 0x01) == 1;
            switch65_2.stateOn = ((obj.value >> 2) & 0x01) == 1;
            switch65_3.stateOn = ((obj.value >> 3) & 0x01) == 1;

            switch65_12.stateOn = ((obj.value >> 12) & 0x01) == 1;
            switch65_13.stateOn = ((obj.value >> 13) & 0x01) == 1;
            switch65_14.stateOn = ((obj.value >> 14) & 0x01) == 1;
            switch65_15.stateOn = ((obj.value >> 15) & 0x01) == 1;
        }
        private void refushState(objUnit obj)
        {
            if (obj.value == 1)
            {
                _state = true;
            }
            else
            {
                _state = false;
            }

            tbOnline.SelectedIndex = (_state == true) ? 1 : 0;
            tbOnline2.SelectedIndex = (_state == true) ? 1 : 0;
        }
Exemplo n.º 16
0
 public void btnStateFunc(objUnit obj)
 {
     if (obj.value == 0)
     {
         cvsEmStopActive.Visibility = Visibility.Hidden;
         emStopActiveBg.Visibility = Visibility.Hidden;
         Canvas.SetLeft(cvsEmStopActive, 0);
     }
     else
     {
         cvsEmStopActive.Visibility = Visibility.Visible;
         emStopActiveBg.Visibility = Visibility.Visible;
     }
 }
 private void handleState(objUnit obj)
 {
     switch (obj.value)
     {
         case 0:
             BtnFore.Visibility = Visibility.Visible;
             BtnForeActive.Visibility = Visibility.Hidden;
             break;
         case 1:
             BtnFore.Visibility = Visibility.Hidden;
             BtnForeActive.Visibility = Visibility.Visible;
             break;
     }
 }
        private void refushState(objUnit obj)
        {
            lbVoltage.Content = obj.vDblStr;

            if (obj.vDbl > 100)
            {
                _state = true;
            }
            else
            {
                _state = false;
            }

            tbState2.SelectedIndex = (_state == true) ? 1 : 0;
        }
Exemplo n.º 19
0
        private void getNewSPCData(objUnit obj)
        {
            valmoWin.ds.ReadNewData();

            object objFileName = TryFindResource("IprFileName");
            if (objFileName != null)
            {
                string strFileName = objFileName.ToString();

                if (strFileName.Length > 0)
                {
                    SocketConnect.getInstance().UpLoad(strFileName);
                }
            }
        }
        public DriveErr(string iType, string iErrCount, string iErrAddr, string iSystem, string iPsu, string iPsu2, string iMotor)
        {
            if (iType != "null")
            {
                object obj = valmoWin.dv.getObj(iType);

                if (obj != null)
                {
                    DriveType = (objUnit)obj;
                }
            }

            D5 = new DriveErr5K(iErrCount, iErrAddr);

            D4 = new DriveErr4K(iSystem, iPsu, iPsu2, iMotor);
        }
        private void MachionAction1(objUnit obj)
        {
            Image_CurrrentAction_Lst1.Clear();

            int temp = obj.value;

            for (int i = 0; i < 32; i++)
            {
                if (((temp >> i) & 0x01) == 1)
                {
                    Image_CurrrentAction_Lst1.Add(Image_MA_Lst1[i]);
                }
            }

            Refush();
        }
        private void refushState(objUnit obj)
        {
            if (_bitNr != -1)
            {
                if (((obj.value >> _bitNr) & 0x01) == 1)
                {
                    _state = true;
                }
                else
                {
                    _state = false;
                }

                tblState.SelectedIndex = (_state == true) ? 1 : 0;
            }
        }
 public void btnStateFunc(objUnit obj)
 {
     switch (obj.value)
     {
         case 1:
             {
                 BtnActive.Visibility = Visibility.Visible;
                 btnBg.Visibility = Visibility.Hidden;
             }
             break;
         case 0:
             {
                 BtnActive.Visibility = Visibility.Hidden;
                 btnBg.Visibility = Visibility.Visible;
             }
             break;
     }
 }
Exemplo n.º 24
0
 private void handleAdjust(objUnit obj)
 {
     switch (obj.value)
     {
         case 0:
             {
                 BtnForeActive.Visibility = Visibility.Hidden;
                 BtnFore.Visibility = Visibility.Visible;
             }
             break;
         case 1:
             {
                 BtnForeActive.Visibility = Visibility.Visible;
                 BtnFore.Visibility = Visibility.Hidden;
             }
             break;
     }
 }
        public void Show(objUnit obj,string dis)
        {
            _CurPos = obj;
            if(_CurPos != null)
            {
                if (_CurPos.valueNew == 0)
                {
                    lb1.Content = valmoWin.dv.getCurDis("lanKey1107");
                }
                else
                {
                    lb1.Content = valmoWin.dv.getCurDis("lanKey1106");
                }

                lb2.Content = valmoWin.dv.getCurDis(_CurPos.serialNum) + "?";

                this.Visibility = Visibility.Visible;
            }
        }
Exemplo n.º 26
0
 public ItlPr()
 {
     items[0] = new objUnit("Itl000", UnitType.DgtType);
     items[1] = new objUnit("Itl001", UnitType.Tm_s);//prdPr171 min
     items[2] = new objUnit("Itl002", UnitType.Force_ton);
     items[3] = new objUnit("Itl003", UnitType.Prs_Mpa);//PrdPr189
     items[4] = new objUnit("Itl004", UnitType.Len_mm);//PrdPr189
     items[5] = new objUnit("Itl005", UnitType.Len_mm);//PrdPr190
     items[6] = new objUnit("Itl006", UnitType.Len_mm);//PrdPr190
     items[7] = new objUnit("Itl007", UnitType.Tm_s);//PrdPr191
     items[8] = new objUnit("Itl008", UnitType.Prs_Mpa);//PrdPr191
     items[9] = new objUnit("Itl009", UnitType.Len_mm);//PrdPr192
     items[10] = new objUnit("Itl010", UnitType.Prs_Mpa);//PrdPr192
     items[11] = new objUnit("Itl011", UnitType.Tm_s);//PrdPr193
     items[12] = new objUnit("Itl012", UnitType.Len_mm);//PrdPr193
     items[13] = new objUnit("Itl013", UnitType.Tm_s);//PrdPr194
     items[14] = new objUnit("Itl014", UnitType.Tm_s);//PrdPr194
     items[15] = new objUnit("Itl015", UnitType.Prs_Mpa);//PrdPr195
     items[16] = new objUnit("Itl016", UnitType.Prs_Mpa);//PrdPr195
     items[17] = new objUnit("Itl017", UnitType.Len_mm);//PrdPr196
     items[18] = new objUnit("Itl018", UnitType.Len_mm);//PrdPr196
     items[19] = new objUnit("Itl019", UnitType.Prs_Mpa);//PrdPr197
     items[20] = new objUnit("Itl020", UnitType.Prs_Mpa);//PrdPr197
     items[21] = new objUnit("Itl021", UnitType.Tm_s);//PrdPr198
     items[22] = new objUnit("Itl022", UnitType.Tm_s);//PrdPr198
     items[23] = new objUnit("Itl023", UnitType.DgtType);//时间设定 年份
     items[24] = new objUnit("Itl024", UnitType.DgtType);//时间设定 月份
     items[25] = new objUnit("Itl025", UnitType.DgtType);//时间设定 日期
     items[26] = new objUnit("Itl026", UnitType.DgtType);//时间设定 小时
     items[27] = new objUnit("Itl027", UnitType.DgtType);//时间设定 分钟
     items[28] = new objUnit("Itl028", UnitType.DgtType);//时间设定 秒
     items[29] = new objUnit("Itl029", UnitType.DgtType); //对应系统ip地址设置
     items[30] = new objUnit("Itl030", UnitType.PowerHour); //对应数据分析页面耗电图中的最大耗电线
     items[31] = new objUnit("Itl031", UnitType.Len_mm);//偏差
     items[32] = new objUnit("Itl032", UnitType.Tm_s);
     items[33] = new objUnit("Itl033", UnitType.Tm_s);
     items[34] = new objUnit("Itl034", UnitType.Tm_s);
     items[35] = new objUnit("Itl035", UnitType.Tm_s);
     items[36] = new objUnit("Itl036", UnitType.Tm_s);
     items[37] = new objUnit("Itl037", UnitType.Tm_s);
     items[38] = new objUnit("Itl038", UnitType.Tm_s);
     items[39] = new objUnit("Itl039", UnitType.Tm_s);
 }
Exemplo n.º 27
0
 public void setObj(int value)
 {
     if (valmoWin.dv.IOFPr[value] != null)
         {
             curForceObj = valmoWin.dv.IOFPr[value];
         }
     if (curForceObj == null)
     {
         img_0.Visibility = Visibility.Hidden;
         img_1.Visibility = Visibility.Hidden;
         img_20.Visibility = Visibility.Hidden;
         img_21.Visibility = Visibility.Hidden;
         imgForce.Visibility = Visibility.Hidden;
     }
     else
     {
         curForceObj.addHandle(refreshLst);
     }
 }
 private void Zone1_IsHeating(objUnit obj)
 {
     int value = obj.value;
     thermoUnit1.bIsHeating = (value & 0x01) == 1;
     thermoUnit2.bIsHeating = ((value >> 1) & 0x01) == 1;
     thermoUnit3.bIsHeating = ((value >> 2) & 0x01) == 1;
     thermoUnit4.bIsHeating = ((value >> 3) & 0x01) == 1;
     thermoUnit5.bIsHeating = ((value >> 4) & 0x01) == 1;
     thermoUnit6.bIsHeating = ((value >> 5) & 0x01) == 1;
     thermoUnit7.bIsHeating = ((value >> 6) & 0x01) == 1;
     thermoUnit8.bIsHeating = ((value >> 7) & 0x01) == 1;
     thermoUnit9.bIsHeating = ((value >> 8) & 0x01) == 1;
     thermoUnit10.bIsHeating = ((value >> 9) & 0x01) == 1;
     thermoUnit11.bIsHeating = ((value >> 10) & 0x01) == 1;
     thermoUnit12.bIsHeating = ((value >> 11) & 0x01) == 1;
     thermoUnit13.bIsHeating = ((value >> 12) & 0x01) == 1;
     thermoUnit14.bIsHeating = ((value >> 13) & 0x01) == 1;
     thermoUnit15.bIsHeating = ((value >> 14) & 0x01) == 1;
     thermoUnit16.bIsHeating = ((value >> 15) & 0x01) == 1;
     thermoUnit17.bIsHeating = ((value >> 16) & 0x01) == 1;
     thermoUnit18.bIsHeating = ((value >> 17) & 0x01) == 1;
     thermoUnit19.bIsHeating = ((value >> 18) & 0x01) == 1;
     thermoUnit20.bIsHeating = ((value >> 19) & 0x01) == 1;
     thermoUnit21.bIsHeating = ((value >> 20) & 0x01) == 1;
     thermoUnit22.bIsHeating = ((value >> 21) & 0x01) == 1;
     thermoUnit23.bIsHeating = ((value >> 22) & 0x01) == 1;
     thermoUnit24.bIsHeating = ((value >> 23) & 0x01) == 1;
     thermoUnit25.bIsHeating = ((value >> 24) & 0x01) == 1;
     thermoUnit26.bIsHeating = ((value >> 25) & 0x01) == 1;
     thermoUnit27.bIsHeating = ((value >> 26) & 0x01) == 1;
     thermoUnit28.bIsHeating = ((value >> 27) & 0x01) == 1;
     thermoUnit29.bIsHeating = ((value >> 28) & 0x01) == 1;
     thermoUnit30.bIsHeating = ((value >> 29) & 0x01) == 1;
     thermoUnit31.bIsHeating = ((value >> 30) & 0x01) == 1;
     thermoUnit32.bIsHeating = ((value >> 31) & 0x01) == 1;
 }
Exemplo n.º 29
0
 void refreshLst(objUnit obj)
 {
     switch (obj.value)
     {
         case 0:
             imgForce.Visibility = Visibility.Visible;
             img_0.Visibility = Visibility.Hidden;
             img_20.Visibility = Visibility.Visible;
             img_1.Visibility = Visibility.Visible;
             img_21.Visibility = Visibility.Hidden;
             break;
         case 1:
             imgForce.Visibility = Visibility.Visible;
             img_0.Visibility = Visibility.Visible;
             img_20.Visibility = Visibility.Hidden;
             img_1.Visibility = Visibility.Hidden;
             img_21.Visibility = Visibility.Visible;
             break;
         case 2:
             imgForce.Visibility = Visibility.Hidden;
             img_0.Visibility = Visibility.Visible;
             img_20.Visibility = Visibility.Hidden;
             img_1.Visibility = Visibility.Visible;
             img_21.Visibility = Visibility.Hidden;
             break;
     }
 }
        private void setHopper(objUnit obj)
        {
            _bIsHopperOn = (obj.value == 1) ? true : false;

            if (_bIsHopperOn == true)
            {
                lbTmp064.Visibility = Visibility.Visible;
                cvsSecValueEnd.Visibility = Visibility.Visible;
                heatingStateLEDCtrl31.Visibility = Visibility.Visible;
            }
            else
            {
                lbTmp064.Visibility = Visibility.Hidden;
                cvsSecValueEnd.Visibility = Visibility.Hidden;
                heatingStateLEDCtrl31.Visibility = Visibility.Hidden;
            }

            reLayou();
        }