Exemple #1
0
        private unsafe void get_record_list()
        {
            SDKApi.EagleData_RefetchRecList();
            int record_num = SDKApi.EagleData_GetRecordNumber();

            if (record_num > 0)
            {
                //var ids =IntPtr.Zero ;// new EagleData_Record_Id();
                //  List<EagleData_Record_Id> list = new List<EagleData_Record_Id>();
                //  var ids = new IntPtr[record_num];//EagleData_Record_Id[record_num];
                //  for (int i = 0; i < record_num; i++)
                //  {
                //     // ids[i].task_name = new  string('\0',64);
                //     // list.Add(new EagleData_Record_Id() { task_name=new string ('\0',64),start_time=0 });
                //  }

                //// var intptr = Marshal.AllocHGlobal(Marshal.SizeOf(64));
                //  IntPtr[] ptArr = new IntPtr[1];
                //  ptArr[0] = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(EagleData_Record_Id)));
                IntPtr pt            = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(EagleData_Record_Id)) * record_num);
                int    nStructLength = Marshal.SizeOf(typeof(EagleData_Record));
                //  Marshal.Copy(ptArr, 0, pt, 1);

                int actual_num = SDKApi.EagleData_GetRecordList(pt, record_num);

                EagleData_Record_Id[] ids = new EagleData_Record_Id[actual_num];

                for (int i = 0; i < actual_num; i++)
                {
                    ids[i] = (EagleData_Record_Id)Marshal.PtrToStructure(pt + Marshal.SizeOf(typeof(EagleData_Record_Id)) * i, typeof(EagleData_Record_Id));
                    EagleData_Record ccd = new EagleData_Record();
                    var record           = SDKApi.EagleData_GetRecordAndAllocMemory(ids[i]);
                    ccd = (EagleData_Record)Marshal.PtrToStructure(record, typeof(EagleData_Record));
                    int s    = 0;
                    var list = (EagleData_CcdRecord)Marshal.PtrToStructure(ccd.ccd_record_list, typeof(EagleData_CcdRecord));

                    var r1  = SDKApi.EagleData_DeleteRecord(list.record_id, list.id);
                    int ss1 = 0;
                    //var ret = SDKApi.EagleData_CheckAndRemountFileSystem(0, DISK_MOUNT_TYPE.DISK_MOUNT_FROM_AOE);
                    //var databuffer = new byte[list.data_size];
                    //var headerbuffer = new byte[list.head_size];

                    //// if (record!= null)
                    //for (int index = 0; index < list.frame_number; i++)
                    //{
                    //    var flag = SDKApi.EagleData_ReadOneStoredFrame(list.record_id, list.id, index, databuffer, (int)list.data_size, headerbuffer, (int)list.head_size);
                    //   //保存数据  databuffer
                    //}
                    //ret = SDKApi.EagleData_RemoveFileSystem(0, DISK_MOUNT_TYPE.DISK_MOUNT_FROM_AOE);
                    //_print_record_detail(&record->id, i + 1);


                    // EagleData_FreeRecordMemory(record);
                }
                Marshal.FreeHGlobal(pt);
            }
        }
Exemple #2
0
        public void Delete_Ccd_Record()
        {
            SDKApi.EagleData_RefetchRecList();
            int record_num = SDKApi.EagleData_GetRecordNumber();

            if (record_num > 0)
            {
                //get record list
                var ids        = new EagleData_Record_Id[record_num];
                int actual_num = 0;// SDKApi.EagleData_GetRecordList(ref ids, record_num);
            }
        }
Exemple #3
0
        public void ReNameTask()
        {
            SDKApi.EagleData_RefetchRecList();
            int record_num = SDKApi.EagleData_GetRecordNumber();

            if (record_num > 0)
            {
                EagleData_Record_Id[] ids = new EagleData_Record_Id[record_num];
                // int actual_num = SDKApi.EagleData_GetRecordList(ref ids, record_num);
                //_print_record_list(ids, actual_num);
                //int record_index = _select_input("input record to rename", actual_num, 1, 0);
                //if (record_index == 0)
                //{
                //    return;
                //}
                //printf("input new name:");
                //wchar_t new_name[32] = { '\0' };
                //wscanf_s(L"%ls", new_name, 31);
                //int ret = SDKApi.EagleData_RenameTask(ids[actual_num - 1], "new-code");
                //PrintResult(ret, "rename");
                //delete[] ids;
            }
        }