Ejemplo n.º 1
0
 public CPMRunlogicThreadPool(CData Data)
     : base(Data)
 {
     //
     // TODO: Add constructor logic here
     //
 }
Ejemplo n.º 2
0
    public CMPRefreshThreadPool(CData Data)
        : base(Data)
	{
		//
		// TODO: Add constructor logic here
		//
	}
Ejemplo n.º 3
0
            internal object SetValueInternal(MemoryHolder address, int offset, object value)
            {
                IList <object> init = value as IList <object>;

                if (init != null)
                {
                    if (init.Count > _fields.Length)
                    {
                        throw PythonOps.TypeError("too many initializers");
                    }

                    for (int i = 0; i < init.Count; i++)
                    {
                        _fields[i].SetValue(address, offset, init[i]);
                    }
                }
                else
                {
                    CData data = value as CData;
                    if (data != null)
                    {
                        data._memHolder.CopyTo(address, offset, data.Size);
                        return(data._memHolder.EnsureObjects());
                    }
                    else
                    {
                        throw new NotImplementedException("set value");
                    }
                }
                return(null);
            }
Ejemplo n.º 4
0
 public GearsEditor(CGearLists _gearlists, CData _data, string title)
 {
     gearlists = _gearlists;
     data      = _data;
     InitializeComponent();
     this.Title = title;
 }
Ejemplo n.º 5
0
        public void loadForm()
        {
            string sName = System.Environment.UserName; // WindowsIdentity.GetCurrent().Name;

            this.label1.Text = sName;

            ArrayList userLayers = null;

            //MessageBox.Show(CMedToolsSubs.getObjectProperty(sName, "givenName") + " --- " + CMedToolsSubs.getObjectProperty(sName, "SN"));

            if (SConst.GotDBConn)
            {
                using (CData oData = new CData(SConst.GISConnString.ToString()))
                {
                    userLayers = oData.getUserLayers(CMedToolsSubs.getObjectProperty(sName, "givenName"), CMedToolsSubs.getObjectProperty(sName, "SN"));
                }
            }

            if (userLayers != null)
            {
                lbEditabelLayers.Enabled = true;
                btnEdit.Enabled          = true;

                foreach (string item in userLayers)
                {
                    lbEditabelLayers.Items.Add(item.ToString());
                }
            }
            else
            {
                lbEditabelLayers.Items.Add("No layers are available for editing");
                lbEditabelLayers.Enabled = false;
                btnEdit.Enabled          = false;
            }
        }
Ejemplo n.º 6
0
    public static CStatus LoadClinicDLL(CData Data, DropDownList ddl)
    {
        ddl.Items.Clear();

        DataSet     dsClinics = null;
        CClinicData cd        = new CClinicData(Data);
        CStatus     status    = cd.GetClinicDS(out dsClinics);

        if (!status.Status)
        {
            return(status);
        }

        status = CDropDownList.RenderDataSet(
            dsClinics,
            ddl,
            "CLINIC_LABEL",
            "CLINIC_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 7
0
        private IList <CData> ConvetToObjList(DataTable dataTable)
        {
            IList <CData> list = new List <CData>();
            int           num  = list.Count - 20;

            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    list.RemoveAt(0);
                }
            }
            foreach (DataRow dr in dataTable.Rows)
            {
                CData cd = new CData();
                cd.Pd   = Convert.ToDecimal(dr["PD"]);
                cd.Len  = Convert.ToDecimal(dr["LEN_"]);
                cd.CIRC = Convert.ToDecimal(dr["CIRC"]);
                cd.Wg   = Convert.ToDecimal(dr["WG"]);
                if (String.IsNullOrEmpty(dr["TV"].ToString()))
                {
                    cd.TV = 0;
                }
                else
                {
                    cd.TV = Convert.ToDecimal(dr["TV"]);
                }
                cd.testdate = Convert.ToDateTime(dr["testdate"]);
                cd.Wo       = dr["WO"].ToString();
                cd.mat_Ctrl = dr["MAT_CTRL"].ToString();
                list.Add(cd);
            }
            return(list);
        }
Ejemplo n.º 8
0
        private void fmSubAccount_Paint(object sender, PaintEventArgs e)
        {
            IDictionaryEnumerator en = this.SubAccounts.GetEnumerator();

            while (en.MoveNext())
            {
                if (SConst.GotDBConn)
                {
                    DataSet ds;
                    using (CData oData = new CData(SConst.LXConnString.ToString()))
                    {
                        ds = oData.returnOwnerInfo(Int32.Parse(en.Key.ToString()));
                    }
                    DataTable dt = ds.Tables[0];

                    foreach (DataRow r in dt.Rows)
                    {
                        string[] row = { this.ObjectID, en.Key.ToString(), r["RP_Name"].ToString(), r["Situs_Addr"].ToString(), r["MAPLOT"].ToString(), r["Account_Num"].ToString() };
                        dgvSubAccounts.Rows.Add(row);
                    }
                }
            }
            dgvSubAccounts.ClearSelection();
            //dgvResults.SelectAll();
        }
Ejemplo n.º 9
0
        public void OK_AccessClassKeyWithExplicitComparer()
        {
            var cache = new Dictionary <CData, int>(new _CDataComparer());
            var cont  = new List <CData>();

            for (int i = 0; i < ELEM_COUNT; ++i)
            {
                var o0 = new CData(i, i);
                cache.Add(o0, i);
                var o1 = new CData(i, i);
                cont.Add(o1);

                Assert.That(cache.ContainsKey(o1));
                Assert.That(o0.Equals(o1));
            }

            int k = 0;

            Assert.That(() =>
            {
                for (int j = 0; j < ELEM_COUNT; ++j)
                {
                    var cdata = cont[j];
                    var v     = cache[cdata];
                    k        += v;
                }
            },
                        Is.Not.AllocatingGCMemory()
                        );
            Assert.That(k, Is.EqualTo((ELEM_COUNT - 1) * ELEM_COUNT / 2));
        }
Ejemplo n.º 10
0
    /// <summary>
    /// method
    /// Load temporal state data into a drop down list
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadTSDropDownList(CData Data, DropDownList ddl)
    {
        ddl.Items.Clear();

        //get the dataset
        DataSet            dsTS   = null;
        CTemporalStateData tsd    = new CTemporalStateData(Data);
        CStatus            status = tsd.GetTemporalStateDS((long)k_ACTIVE_ID.All, out dsTS);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsTS,
            ddl,
            "TS_LABEL",
            "TS_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 11
0
    /// <summary>
    /// method
    /// loads items in the specified collection into the ddl
    /// </summary>
    /// <param name="Data"></param>
    /// <param name="ddl"></param>
    /// <param name="lItemID"></param>
    /// <returns></returns>
    public static CStatus LoadItemCollectionDDL(
        CData Data,
        DropDownList ddl,
        long lItemID)
    {
        CItemCollectionData coll   = new CItemCollectionData(Data);
        DataSet             dsColl = null;
        CStatus             status = coll.GetItemCollectionDS(lItemID, out dsColl);

        if (!status.Status)
        {
            return(status);
        }

        status = CDropDownList.RenderDataSet(
            dsColl,
            ddl,
            "item_label",
            "item_id");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 12
0
    /// <summary>
    /// US:912
    /// loads a dropdown list of decision states
    /// </summary>
    /// <returns></returns>
    public static CStatus LoadCLIDecisionStatesDDL(
        CData Data,
        long lChecklistID,
        long lItemID,
        DropDownList ddl)
    {
        ddl.Items.Clear();

        DataSet            dsDS   = null;
        CChecklistItemData cid    = new CChecklistItemData(Data);
        CStatus            status = cid.GetDecisionStateDS(lChecklistID, lItemID, out dsDS);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsDS,
            ddl,
            "DS_LABEL",
            "DS_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 13
0
    /// <summary>
    /// method
    /// loads all the unit options into a drop down list
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadUnitDDL(CData Data, DropDownList ddl)
    {
        //get the dataset
        DataSet   dsUnit = null;
        CSTATData data   = new CSTATData(Data);
        CStatus   status = data.GetUnitDS(out dsUnit);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsUnit,
            ddl,
            "TIME_UNIT_LABEL",
            "TIME_UNIT_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 14
0
    /// <summary>
    /// method
    /// loads all the checklist states into a drop down list
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadChecklistStateDDL(CData Data, DropDownList ddl)
    {
        //get the dataset
        DataSet   ds     = null;
        CSTATData data   = new CSTATData(Data);
        CStatus   status = data.GetChecklistStateDS(out ds);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            ds,
            ddl,
            "CHECKLIST_STATE_LABEL",
            "CHECKLIST_STATE_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
 public CAssignChecklistThreadPool(CData Data)
     : base(Data)
 {
     //
     // TODO: Add constructor logic here
     //
 }
Ejemplo n.º 16
0
        public ActionResult ActionCreate(SBH_TM_GALERY_FOTO galeryView)
        {
            string a = Request.Form["storeImage"];

            try
            {
                string encodedString = Server.HtmlEncode(galeryView.DESCRIPTION);
                galeryView.DESCRIPTION  = encodedString;
                galeryView.USER_ID      = (int)Session["Id"];
                galeryView.CREATED_BY   = Session["UserId"].ToString();
                galeryView.CREATED_TIME = DateTime.Now;
                List <string> lString = CData.GetListString;

                rs = repo.AddAll(galeryView, lString);
                if (rs.IsSuccess)
                {
                    rs.SetSuccessStatus("Data has been created successfully");
                    TempData["msgSuccess"] = rs.MessageText;
                    CData.CleanDataString();
                }
                else
                {
                    rs.SetErrorStatus("Data failed to created");
                    TempData["msgError"] = rs.MessageText;
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                rs.SetErrorStatus("Data failed to created");
                TempData["msgError"] = rs.MessageText;
            }

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 17
0
    /// <summary>
    /// method
    /// loads all of the patient's items into the specified ddl
    /// for the specified item
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadPatientItemsDDL(
        CData Data,
        DropDownList ddl,
        string strPatientID,
        long lItemID)
    {
        CPatientItemData dta     = new CPatientItemData(Data);
        DataSet          dsItems = null;
        CStatus          status  = dta.GetPatientItemDS(
            strPatientID,
            lItemID,
            out dsItems);

        if (!status.Status)
        {
            return(status);
        }

        status = CDropDownList.RenderDataSet(
            dsItems,
            ddl,
            "ENTRY_DATE",
            "PAT_ITEM_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 18
0
    /// <summary>
    /// method
    /// loads all the item groups that satisfy the active filter into a ddl
    /// </summary>
    /// <param name="Data"></param>
    /// <param name="ddl"></param>
    /// <param name="ActiveFilter"></param>
    /// <returns></returns>
    public static CStatus LoadItemGroupDDL(
        CData Data,
        DropDownList ddl,
        k_ACTIVE_ID ActiveFilter)
    {
        //get the dataset
        DataSet        dsItemGroups = null;
        CItemGroupData data         = new CItemGroupData(Data);
        CStatus        status       = data.GetItemGroupDS(ActiveFilter, out dsItemGroups);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsItemGroups,
            ddl,
            "ITEM_GROUP_LABEL",
            "ITEM_GROUP_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 19
0
    /// <summary>
    /// method
    /// loads all the item types into a drop down list
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadItemTypeDDL(CData Data, DropDownList ddl)
    {
        //get the dataset
        DataSet   dsItemTypes = null;
        CSTATData data        = new CSTATData(Data);
        CStatus   status      = data.GetItemTypeDS(out dsItemTypes);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsItemTypes,
            ddl,
            "ITEM_TYPE_LABEL",
            "ITEM_TYPE_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 20
0
 public RimsEditor(List <CRim> _list, CData _data, string title)
 {
     list = _list;
     data = _data;
     InitializeComponent();
     this.Title = title;
 }
Ejemplo n.º 21
0
        /// <summary>
        /// This method is called by clicking on the marker
        /// </summary>
        /// <param name="marker">The marker on which clicked</param>
        private void OnMarkerClick(OnlineMapsMarkerBase marker)
        {
            // Set active marker reference
            targetMarker = marker as OnlineMapsMarker;

            // Get a result item from instance of the marker
            CData data = marker["data"] as CData;

            if (data == null)
            {
                return;
            }

            // Show the popup
            bubble.SetActive(true);

            // Set title and address
            title.text   = data.title;
            address.text = data.address;

            // Destroy the previous photo
            if (photo.texture != null)
            {
                OnlineMapsUtils.Destroy(photo.texture);
                photo.texture = null;
            }

            OnlineMapsWWW www = new OnlineMapsWWW(data.photo_url);

            www.OnComplete += OnDownloadPhotoComplete;

            // Initial update position
            UpdateBubblePosition();
        }
Ejemplo n.º 22
0
    /// <summary>
    /// method
    /// loads all the active options into a drop down list
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadActiveDDL(CData Data, DropDownList ddl)
    {
        //get the dataset
        DataSet   dsActive = null;
        CSTATData data     = new CSTATData(Data);
        CStatus   status   = data.GetActiveDS(out dsActive);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsActive,
            ddl,
            "ACTIVE_LABEL",
            "ACTIVE_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 23
0
        /// <summary>
        /// Creates a BotData object given some parameters.
        /// </summary>
        /// <param name="globalSettings">The global RuriLib settings</param>
        /// <param name="configSettings">The settings for the current Config</param>
        /// <param name="data">The wrapped data line to check</param>
        /// <param name="proxy">The proxy to use (set to null if none)</param>
        /// <param name="useProxies">Whether to use the proxy for requests</param>
        /// <param name="botNumber">The number of the bot that is creating this object</param>
        /// <param name="isDebug">Whether this object is created from a Debugger or from a Runner</param>
        public BotData(RLSettingsViewModel globalSettings, ConfigSettings configSettings, CData data, CProxy proxy, bool useProxies, int botNumber = 0, bool isDebug = true)
        {
            Data           = data;
            Proxy          = proxy;
            UseProxies     = useProxies;
            Status         = BotStatus.NONE;
            BotNumber      = BotNumber;
            GlobalSettings = globalSettings;
            ConfigSettings = configSettings;
            Balance        = 0;
            Screenshots    = new List <string>();
            Variables      = new VariableList();

            // Populate the Variables list with hidden variables
            Address         = "";
            ResponseCode    = "0";
            ResponseSource  = "";
            Cookies         = new Dictionary <string, string>();
            ResponseHeaders = new Dictionary <string, string>();
            try { foreach (var v in Data.GetVariables())
                  {
                      Variables.Set(v);
                  }
            } catch { }

            GlobalVariables = new VariableList();
            GlobalCookies   = new CookieDictionary();
            LogBuffer       = new List <LogEntry>();
            Driver          = null;
            BrowserOpen     = false;
            IsDebug         = isDebug;
            BotNumber       = botNumber;
        }
Ejemplo n.º 24
0
    /// <summary>
    /// Load services label data into dropdownlist
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ActiveFilter"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadServiceDDL(
        CData Data,
        k_ACTIVE_ID ActiveFilter,
        DropDownList ddl)
    {
        ddl.Items.Clear();

        DataSet      dsService = null;
        CServiceData data      = new CServiceData(Data);
        CStatus      status    = data.GetServiceDS(ActiveFilter, out dsService);

        if (!status.Status)
        {
            return(status);
        }

        status = CDropDownList.RenderDataSet(
            dsService,
            ddl,
            "SERVICE_LABEL",
            "SERVICE_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 25
0
    /// <summary>
    /// method
    /// loads all the os definitions into a drop down list
    /// </summary>
    /// <param name="BaseMstr"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public static CStatus LoadOSDefinitionDDL(CData Data, DropDownList ddl)
    {
        //get the dataset
        DataSet   dsOS   = null;
        CSTATData data   = new CSTATData(Data);
        CStatus   status = data.GetOSDefinitionDS(out dsOS);

        if (!status.Status)
        {
            return(status);
        }

        //render the dataset
        status = CDropDownList.RenderDataSet(
            dsOS,
            ddl,
            "OS_DEFINITION_LABEL",
            "OS_DEFINITION_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }
Ejemplo n.º 26
0
 /// <summary>
 /// 自动扩容
 /// </summary>
 /// <param name="data"></param>
 /// <param name="f"></param>
 void AddData(CData data, float f)
 {
     if (queue.Count >= queue.MaxSize)
     {
         queue.Resize(queue.MaxSize * 2);
     }
     queue.Enqueue(data, f);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// constructor
 /// initializes the instance
 /// </summary>
 /// <param name="Data"></param>
 /// <param name="strPatientID"></param>
 /// <param name="lPatCLID"></param>
 /// <param name="lChecklistID"></param>
 /// <param name="lItemID"></param>
 public CExecuteExpression(CData Data, string strPatientID, long lPatCLID, long lChecklistID, long lItemID)
 {
     BaseData    = Data;
     PatientID   = strPatientID;
     PatCLID     = lPatCLID;
     ChecklistID = lChecklistID;
     ItemID      = lItemID;
 }
Ejemplo n.º 28
0
    /// <summary>
    /// US:1945 US:852 US:1883 US:834 helper to process checklist items, called from multiple places
    /// </summary>
    /// <param name="conn"></param>
    /// <param name="data"></param>
    /// <param name="dsChecklistItems"></param>
    /// <returns></returns>
    public CStatus RefreshPatientCheckList(CDataConnection conn,
                                           CData data,
                                           DataSet dsChecklistItems)
    {
        CStatus status = new CStatus();

        //this class is used to do all transfers
        //from MDWS to the VAPPCT database
        CMDWSTransfer xfer = new CMDWSTransfer(data);

        //2.loop over all items and process each one
        foreach (DataTable table in dsChecklistItems.Tables)
        {
            foreach (DataRow dr in table.Rows)
            {
                if (dr["item_type_id"] != null)
                {
                    switch (Convert.ToInt32(dr["item_type_id"]))
                    {
                    case (int)k_ITEM_TYPE_ID.Collection:
                        //WriteEvent(data, "Collection", "Collection");
                        break;

                    case (int)k_ITEM_TYPE_ID.Laboratory:
                        //WriteEvent(data, "Laboratory", "Laboratory");
                        status = ProcessLab(data, xfer, dr);
                        if (!status.Status)
                        {
                            //write the start event to the event table
                            WriteEvent(data, "ProcessLab", status.StatusComment);
                            return(status);
                        }
                        break;

                    case (int)k_ITEM_TYPE_ID.QuestionFreeText:
                        //WriteEvent(data, "QuestionFreeText", "QuestionFreeText");
                        break;

                    case (int)k_ITEM_TYPE_ID.QuestionSelection:
                        //WriteEvent(data, "QuestionSelection", "QuestionSelection");
                        break;

                    case (int)k_ITEM_TYPE_ID.NoteTitle:
                        status = ProcessNoteTitle(data, xfer, dr);
                        if (!status.Status)
                        {
                            //write the start event to the event table
                            WriteEvent(data, "ProcessNoteTitle", status.StatusComment);
                            return(status);
                        }
                        break;
                    }
                }
            }
        }

        return(status);
    }
Ejemplo n.º 29
0
 public Pointer(CData value) {
     _object = value; // Keep alive the object, more to do here.
     _memHolder = new MemoryHolder(IntPtr.Size);
     _memHolder.WriteIntPtr(0, value._memHolder);
     _memHolder.AddObject("1", value);
     if (value._objects != null) {
         _memHolder.AddObject("0", value._objects);
     }
 }
 /// <summary>
 /// constructor
 /// initializes the instance
 /// </summary>
 /// <param name="Data"></param>
 /// <param name="strPatientID"></param>
 /// <param name="lPatCLID"></param>
 /// <param name="lChecklistID"></param>
 /// <param name="lItemID"></param>
 public CExpressionList(CData Data, string strPatientID, long lPatCLID, long lChecklistID, long lItemID)
 {
     BaseData    = Data;
     PatientID   = strPatientID;
     PatCLID     = lPatCLID;
     ChecklistID = lChecklistID;
     ItemID      = lItemID;
     Capacity    = 5;
 }
Ejemplo n.º 31
0
    /// <summary>
    /// US:1883 US:834 refresh a patient checklist
    /// </summary>
    /// <param name="strPatientID"></param>
    /// <param name="strPatChecklistID"></param>
    /// <returns></returns>
    public CStatus RefreshPatientCheckList(CDataConnection conn,
                                           CData data,
                                           string strPatientID,
                                           long lPatChecklistID)
    {
        //todo: check conn and data before continuing

        //get all the items for this patient checklist
        DataSet         dsChecklistItems = null;
        CVAPPCTCommData commData         = new CVAPPCTCommData(data);
        CStatus         status           = commData.GetPatChecklistItemDS(lPatChecklistID, out dsChecklistItems);

        if (!status.Status)
        {
            //write the event to the event table
            WriteEvent(data, "GetPatChecklistItemDS", status.StatusComment);
            return(status);
        }

        //refresh the checklist items
        status = RefreshPatientCheckList(
            conn,
            data,
            dsChecklistItems);
        if (!status.Status)
        {
            //write the event to the event table
            WriteEvent(data, "RefreshPatientCheckList", status.StatusComment);
            return(status);
        }

        //refresh the checklist collection items
        DataSet dsCLCollectionItems = null;

        status = commData.GetPatientCLCollectionItemDS(lPatChecklistID, out dsCLCollectionItems);
        if (!status.Status)
        {
            //write the event to the event table
            WriteEvent(data, "GetPatientCLCollectionItemDS", status.StatusComment);
            return(status);
        }

        //refresh the checklist items
        status = RefreshPatientCheckList(
            conn,
            data,
            dsCLCollectionItems);
        if (!status.Status)
        {
            //write the event to the event table
            WriteEvent(data, "RefreshPatientCheckList", status.StatusComment);
            return(status);
        }

        return(status);
    }
Ejemplo n.º 32
0
        List<OutElement> outE = new List<OutElement>(); //外方位元素

        #endregion Fields

        #region Constructors

        public DLT(CData data)
        {
            this.data = data;
            for (int i = 0; i < data.Count;i++ )
            {
                inE.Add(new InElement());
                outE.Add(new OutElement());
                other.Add(new Other());
            }
        }
Ejemplo n.º 33
0
 static void Main(string[] args)
 {
     CData data = new CData();
     data.ReadData("p1.txt", "p2.txt");//读取数据
     Dlt dlt = new Dlt(data);
     dlt.Adjustment();//平差
     Console.Write(dlt.OutToString());//输出结果
     Console.WriteLine("结果保存在result.txt中...");
     File.WriteAllText("result.txt", dlt.OutToString(), Encoding.Default);//写入文件
     Console.ReadKey();
 }
Ejemplo n.º 34
0
        /// <summary>
        /// Reading ctor
        /// </summary>
        public XmlTree(ResReader reader)
            : base(reader, ChunkTypes.RES_XML_TYPE)
        {
            strings = new StringPool(reader);
            resourceMap = new ResourceMap(reader);

            while (true)
            {
                var tag = reader.PeekChunkType();
                Node node;
                switch (tag)
                {
                    case ChunkTypes.RES_XML_START_NAMESPACE_TYPE:
                        node = new StartNamespace(reader, this);
                        break;
                    case ChunkTypes.RES_XML_START_ELEMENT_TYPE:
                        node = new StartElement(reader, this);
                        break;
                    case ChunkTypes.RES_XML_CDATA_TYPE:
                        node = new CData(reader, this);
                        break;
                    case ChunkTypes.RES_XML_END_ELEMENT_TYPE:
                        node = new EndElement(reader, this);
                        break;
                    case ChunkTypes.RES_XML_END_NAMESPACE_TYPE:
                        node = new EndNamespace(reader, this);
                        break;
                    default:
                        throw new IOException(string.Format("Unexpected tag: 0x{0:X}", (int)tag));
                }

                nodes.Add(node);
                if (tag == ChunkTypes.RES_XML_END_NAMESPACE_TYPE)
                    break;
            }
        }
Ejemplo n.º 35
0
 /// <summary>
 /// returns address of C instance internal buffer.
 /// 
 /// It is the callers responsibility to ensure that the provided instance will 
 /// stay alive if memory in the resulting address is to be used later.
 /// </summary>
 public static object addressof(CData data) {
     if (data is _CFuncPtr) {
         return ((_CFuncPtr)data).addr.ToPython();
     }
     return data._memHolder.UnsafeAddress.ToPython();
 }
Ejemplo n.º 36
0
 protected void SetEventType(EventTypeEnum type)
 {
     Event = type.ParseToString();
 }
Ejemplo n.º 37
0
        public static object byref(CData instance, [DefaultParameterValue(0)]int offset) {
            if (offset != 0) {
                // new in 2.6
                throw new NotImplementedException("byref w/ arg");
            }

            return new NativeArgument(instance, "P");
        }
Ejemplo n.º 38
0
        public static void resize(CData obj, int newSize) {
            if (newSize < obj.NativeType.Size) {
                throw PythonOps.ValueError("minimum size is {0}", newSize);
            }

            MemoryHolder newMem = new MemoryHolder(newSize);
            obj._memHolder.CopyTo(newMem, 0, Math.Min(obj._memHolder.Size, newSize));
            obj._memHolder = newMem;
        }
Ejemplo n.º 39
0
 /// <summary>
 /// returns address of C instance internal buffer.
 /// 
 /// It is the callers responsibility to ensure that the provided instance will 
 /// stay alive if memory in the resulting address is to be used later.
 /// </summary>
 public static object addressof(CData data) {
     return data._memHolder.UnsafeAddress.ToPython();
 }
Ejemplo n.º 40
0
 internal NativeArgument(CData value, string type) {
     __obj = value;
     _type = type;
 }
        private void UpdateMapSubMesh(int x, int y, int w, int h, Vector2 subMeshSize, int subMeshVX, int subMeshVZ,
            Vector3 startPos, float yScale, Vector2 topLeftPosition, Vector2 bottomRightPosition)
        {
            int mi = x + y * w;
            int i = mi * subMeshVX * subMeshVZ * 4;

            Vector2 cellSize = new Vector2(subMeshSize.x / subMeshVX, subMeshSize.y / subMeshVZ);

            float uvX = 1f / subMeshVX;
            float uvZ = 1f / subMeshVZ;

            int bx = x + bufferPosition.x;
            int by = y + bufferPosition.y;

            int maxX = (2 << api.zoom) / 2;

            if (bx >= maxX) bx -= maxX;
            if (bx < 0) bx += maxX;

            OnlineMapsTile tile = null;

            lock (OnlineMapsTile.tiles)
            {
                foreach (OnlineMapsTile t in OnlineMapsTile.tiles)
                {
                    if (t.zoom == api.zoom && t.x == bx && t.y == by)
                    {
                        tile = t;
                        break;
                    }
                }
            }

            OnlineMapsTile currentTile = tile;
            Texture texture = null;
            if (tile != null && tile.texture != null)
            {
                CData data = currentTile.customData as CData;
                if (data == null)
                {
                    currentTile.customData = data = new CData();
                    texture =
                        data.texture =
                            Resources.Load<Texture2D>(string.Format("OnlineMapsOverlay/{0}/{1}/{2}", tile.zoom, tile.x,
                                tile.y));
                }
                else texture = data.texture;
            }

            for (int ty = 0; ty < subMeshVZ; ty++)
            {
                float uvY1 = 1 - uvZ * ty;
                float uvY2 = 1 - uvZ * (ty + 1);

                float z1 = startPos.z + y * subMeshSize.y + ty * cellSize.y;
                float z2 = z1 + cellSize.y;

                if (z1 < 0) z1 = 0;
                if (z1 > api.tilesetSize.y) z1 = api.tilesetSize.y;

                if (z2 < 0) z2 = 0;
                if (z2 > api.tilesetSize.y) z2 = api.tilesetSize.y;

                if (z1 == 0 && z2 > 0) uvY1 = Mathf.Lerp(uvY1, uvY2, 1 - z2 / cellSize.y);
                else if (z1 < api.tilesetSize.y && z2 == api.tilesetSize.y)
                    uvY2 = Mathf.Lerp(uvY1, uvY2, (api.tilesetSize.y - z1) / cellSize.y);

                for (int tx = 0; tx < subMeshVX; tx++)
                {
                    float uvX1 = uvX * tx;
                    float uvX2 = uvX * (tx + 1);

                    float x1 = startPos.x - x * subMeshSize.x - tx * cellSize.x;
                    float x2 = x1 - cellSize.x;

                    if (x1 > 0) x1 = 0;
                    if (x1 < -api.tilesetSize.x) x1 = -api.tilesetSize.x;

                    if (x2 > 0) x2 = 0;
                    if (x2 < -api.tilesetSize.x) x2 = -api.tilesetSize.x;

                    if (x1 == 0 && x2 < 0) uvX1 = Mathf.Lerp(uvX2, uvX1, -x2 / cellSize.x);
                    else if (x1 > -api.tilesetSize.x && x2 == -api.tilesetSize.x)
                        uvX2 = Mathf.Lerp(uvX2, uvX1, 1 - (x1 + api.tilesetSize.x) / cellSize.x);

                    int ci = (tx + ty * subMeshVX) * 4 + i;

                    vertices[ci] = new Vector3(x1, 0, z1);
                    vertices[ci + 1] = new Vector3(x2, 0, z1);
                    vertices[ci + 2] = new Vector3(x2, 0, z2);
                    vertices[ci + 3] = new Vector3(x1, 0, z2);

                    uv[ci] = new Vector2(uvX1, uvY1);
                    uv[ci + 1] = new Vector2(uvX2, uvY1);
                    uv[ci + 2] = new Vector2(uvX2, uvY2);
                    uv[ci + 3] = new Vector2(uvX1, uvY2);
                }
            }

            Material material = meshRenderer.materials[mi];

            if (tile != null)
            {
                if (material.mainTexture != texture) material.mainTexture = texture;
                Color color = material.color;
                color.a = (texture != null) ? alpha : 0;
                material.color = color;
            }
            else
            {
                Color color = material.color;
                color.a = 0;
                material.color = color;
            }
        }
Ejemplo n.º 42
0
        /// <summary>
        /// Returns a pointer instance for the given CData
        /// </summary>
        public static Pointer pointer(CodeContext/*!*/ context, CData data) {
            PythonType ptrType = POINTER(context, DynamicHelpers.GetPythonType(data));

            return (Pointer)ptrType.CreateInstance(context, data);
        }
Ejemplo n.º 43
0
	//---------------------------------------------------------------------
    /* Function */
    //---------------------------------------------------------------------
	// Read
	public SpawnGroupRecord(XmlElement _element)
    {
        try
        {				
			XmlNode node = (XmlElement)_element;	
			
			SetValue( ref m_iID, node, "Index" );			
			for( int i=0; i<5; ++i )
			{
				CData data = new CData();
				SetValue( ref data.iNpcID , node, "MonsterID_" + (i+1) );
				SetValue( ref data.iPercent, node, "Prob_" + (i+1) );
				
				if( 0 == data.iNpcID || int.MaxValue == data.iNpcID )
					continue;
				
				m_DataList.Add( data );
			}			
        } 
        catch (System.Exception e)
        {
            Debug.LogError(e.ToString());
        }
    }
Ejemplo n.º 44
0
 // for testing purposes only
 public static PythonTuple _buffer_info(CData data) {
     return data.GetBufferInfo();
 }
Ejemplo n.º 45
0
 public Pointer(CData value) {
     _object = value; // Keep alive the object, more to do here.
     _memHolder = new MemoryHolder(IntPtr.Size);
     _memHolder.WriteIntPtr(0, value._memHolder);
 }