public MainWindowViewModel()
        {
            #region 初始化参数
            try
            {
                MessageStr              = "";
                Version                 = "20201103";
                HomePageVisibility      = "Visible";
                ParameterPageVisibility = "Collapsed";
                RemotePath              = Inifile.INIGetStringValue(iniParameterPath, "System", "RemotePath", "D:\\");
                MachineID               = Inifile.INIGetStringValue(iniParameterPath, "System", "MachineID", "Null");
                StationNo               = 0;
                StationNo               = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "System", "StationNo", "1"));

                cameraName      = Inifile.INIGetStringValue(iniParameterPath, "System", "CameraName", "[0] Integrated Camera");
                cameraInterface = Inifile.INIGetStringValue(iniParameterPath, "System", "CameraInterface", "DirectShow");
                Version        += StationNo.ToString();
                EStopIsChecked  = false;
                CameraROIList   = new ObservableCollection <ROI>();

                string ip = Inifile.INIGetStringValue(iniParameterPath, "PLC", "IP", "192.168.0.100");
                H3u = new InovanceH3UModbusTCP(ip);

                RemoteIP   = Inifile.INIGetStringValue(iniParameterPath, "Remote", "IP", "192.168.0.11");
                RemotePort = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "Remote", "PORT", "3000"));
                LocalIP    = Inifile.INIGetStringValue(iniParameterPath, "Local", "IP", "192.168.0.11");
                LocalPort  = int.Parse(Inifile.INIGetStringValue(iniParameterPath, "Local", "PORT", "5000"));
                tcpNet     = new DXH.Net.DXHTCPClient(RemoteIP, RemotePort, LocalIP, LocalPort);
                tcpNet.ConnectStateChanged += TcpNet_ConnectStateChanged;
            }
            catch (Exception ex)
            {
                AddMessage(ex.Message);
            }

            #endregion

            AppLoadedEventCommand      = new DelegateCommand(new Action(this.AppLoadedEventCommandExecute));
            MenuActionCommand          = new DelegateCommand <object>(new Action <object>(this.MenuActionCommandExecute));
            FolderBrowserDialogCommand = new DelegateCommand(new Action(this.FolderBrowserDialogCommandExecute));
            ParameterSaveCommand       = new DelegateCommand(new Action(this.ParameterSaveCommandExecute));
            OperateButtonCommand       = new DelegateCommand <object>(new Action <object>(this.OperateButtonCommandExecute));
        }
Example #2
0
 /// <summary>
 /// 根据已有型号信息实例化一个加工型号生成器,以对已有型号进行编辑
 /// </summary>
 /// <param name="model"></param>
 public ModelCreator(Model model)
 {
     CreatingModel = model;
     //添加一个工位到加工型号
     CreatingModel.StationList.Add(new Station(CreatingModel.StationList.Count));
     stationNo = StationNo.Two;
 }