fei liang rong 2 years ago
commit 227ba9dba8

@ -8,7 +8,7 @@
本系统是程序设计与问题求解课程设计项目,实现了库存零件 CSV 格式数据文件的读取和保存以及数据的增删改查CRUD、排序和图表显示等功能。项目采用 C 语言编程实现,在 VS Code 集成开发环境IDE中用 GCC 进行编译。系统采用模块化设计,程序结构清晰,采用菜单驱动的命令行界面,操作便捷,能够用 CSV 格式读取和保存数据,通用性强,能够用图表展示数据,直观清楚。 本系统是程序设计与问题求解课程设计项目,实现了库存零件 CSV 格式数据文件的读取和保存以及数据的增删改查CRUD、排序和图表显示等功能。项目采用 C 语言编程实现,在 VS Code 集成开发环境IDE中用 GCC 进行编译。系统采用模块化设计,程序结构清晰,采用菜单驱动的命令行界面,操作便捷,能够用 CSV 格式读取和保存数据,通用性强,能够用图表展示数据,直观清楚。
下载地址https://gitee.com/wangqian12345/students 下载地址https://bdgit.educoder.net/pzghsoly5/test.git
项目开发过程中采用 Kanban看板进行任务管理和分工协作并使用 Git 对程序代码和文档进行版本管理。任务分工情况如下: 项目开发过程中采用 Kanban看板进行任务管理和分工协作并使用 Git 对程序代码和文档进行版本管理。任务分工情况如下:
@ -325,7 +325,7 @@ a: No such file or directory
上述各模块通过主程序main进行调用系统模块图如下。 上述各模块通过主程序main进行调用系统模块图如下。
![系统模块图](images/module.drawio.svg) ![main.drawio](images/main.drawio.svg)
各模块的主要功能如下: 各模块的主要功能如下:

413
daima

@ -0,0 +1,413 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//图书存储结构
struct book{
int id;//图书编号
char name[20];//图书名称
char author[20];//图书作者
float price;//图书价格
struct book *next; // 指向下一图书
}*books;
///////////////////
// 用户界面模块 //
// 系统初始化,读取数据文件到内存
void init();
// 显示主菜单
void display_menu();
// 选择菜单命令,调用相应的功能函数
void make_choice();
// 确认操作
void confirm();
// 退出系统,释放内存,保存数据到文件
void quit();
///////////////////
// 数据处理模块 //
// 从文件读取数据到内存
void read_data();
// 保存内存数据到文件
void save_data();
// 打印图书信息
void print_data();
// 根据图书编号查询图书信息
book *find(int id);
// 查询图书信息
void query_data();
// 添加新图书信息
void add_data();
// 更新图书信息
void update_data();
// 删除图书信息
void delete_data();
// 对图书信息进行排序
void sort_data();
// 生成图表报表
void make_chart();
/////////////
int main()
{
display_menu();
make_choice();
return 0;
}
// 用户界面模块 //
// 系统初始化,读取数据文件到内存
void init()
{
read_data();
}
// 显示主菜单
void display_menu()
{
printf("*************************\n");
printf("***** 图书管理系统 *****\n");
printf("*************************\n");
printf("1. 打印图书信息\n");
printf("2. 查询图书信息\n");
printf("3. 添加新图书\n");
printf("4. 更新图书信息\n");
printf("5. 删除图书信息\n");
printf("6. 对图书排序\n");
printf("7. 生成图表报表\n");
printf("0. 退出系统\n");
printf("请选择:");
}
// 选择菜单命令,调用相应的功能函数
void make_choice()
{
int choice;
scanf("%d", &choice);
confirm();
switch(choice)
{
case 1:
print_data(); // 打印图书信息
break;
case 2:
query_data(); // 查询图书信息
break;
case 3:
add_data(); // 添加新图书
break;
case 4:
update_data();// 更新图书信息
break;
case 5:
delete_data();// 删除图书信息
break;
case 6:
sort_data(); // 对图书排序
break;
case 7:
make_chart(); // 生成图表报表
break;
case 0:
quit(); // 退出系统
break;
default:
printf("无效选择,请重新选择:");
break;
}
}
// 确认操作
void confirm()
{
char choice;
printf("您确定要执行该操作吗?(Y/N):");
scanf(" %c", &choice);
if(choice == 'Y' || choice == 'y')
{
printf("操作成功执行!\n");
}
else if(choice == 'N' || choice == 'n')
{
printf("操作已取消!\n");
}
else
{
printf("输入错误,请重新输入(Y/N):");
confirm(); // 递归调用自己
}
}
// 退出系统,释放内存,保存数据到文件
void quit()
{
char choice;
printf("您确定要退出系统吗?(Y/N):");
scanf(" %c", &choice);
if(choice == 'Y' || choice == 'y')
{
save_data(); // 保存数据到文件
printf("数据已保存,系统退出!\n");
exit(0); // 退出系统
}
else if(choice == 'N' || choice == 'n')
{
printf("退出操作已取消!\n");
}
else
{
printf("输入错误,请重新输入(Y/N):");
quit(); // 递归调用自己
}
}
// 数据处理模块//
// 从文件读取数据到内存
void read_data()
{
FILE *fp;
struct book *head, *p;
if((fp = fopen("books.dat", "rb")) == NULL)
{
printf("打开数据文件失败!\n");
exit(0);
}
head = NULL;
while(!feof(fp))
{
p = (struct book*)malloc(sizeof(struct book));
fread(p, sizeof(struct book), 1, fp);
p->next = head;
head = p;
}
fclose(fp); // 关闭文件
// 将链表的头指针作为全局变量,供其他函数使用
books = head;
}
// 保存内存数据到文件
void save_data()
{
FILE *fp;
struct book *p;
if((fp = fopen("books.dat", "wb")) == NULL)
{
printf("打开数据文件失败!\n");
exit(0);
}
p = books; // 从全局链表头开始
while(p != NULL)
{
fwrite(p, sizeof(struct book), 1, fp);
p = p->next;
}
fclose(fp);
}
// 打印图书信息
void print_data()
{
struct book *p;
p = books; // 从全局链表头开始
while(p != NULL)
{
printf("图书编号:%d\n", p->id);
printf("图书名称:%s\n", p->name);
printf("图书作者:%s\n", p->author);
printf("图书价格:%.2f\n", p->price);
printf("----------------------\n");
p = p->next;
}
}
// 根据图书编号查询图书信息
book *find(int id)
{
struct book *p;
p = books; // 从全局链表头开始
while(p != NULL)
{
if(p->id == id)
return p; // 返回找到的图书指针
p = p->next;
}
return NULL; // 未找到返回空指针 *p;
}
// 查询图书信息
void query_data()
{
int id;
struct book *p;
printf("请输入要查询的图书编号:");
scanf("%d", &id);
p = find(id); // 查找编号为id的图书
if(p != NULL)
{
printf("图书信息如下:\n");
printf("图书编号:%d\n", p->id);
printf("图书名称:%s\n", p->name);
printf("图书作者:%s\n", p->author);
printf("图书价格:%.2f\n", p->price);
}
else
{
printf("没有找到编号为%d的图书!\n", id);
}
}
// 添加新图书信息
void add_data()
{
struct book *p, *q;
p = (struct book*)malloc(sizeof(struct book));
printf("请依次输入图书信息:\n");
printf("图书编号:");
scanf("%d", &p->id);
printf("图书名称:");
scanf("%s", p->name);
printf("图书作者:");
scanf("%s", p->author);
printf("图书价格:");
scanf("%f", &p->price);
q = books;
while(q != NULL && p->id > q->id)
q = q->next;
p->next = q; // 指向下一个节点
books = p; // 新节点成为链表头
printf("图书信息添加成功!\n");
}
// 更新图书信息
void update_data()
{
int id;
struct book *p;
printf("请输入要修改的图书编号:");
scanf("%d", &id);
p = find(id); // 查找编号为id的图书
if(p != NULL)
{
printf("请依次输入修改后的图书信息:\n");
printf("图书名称:");
scanf("%s", p->name);
printf("图书作者:");
scanf("%s", p->author);
printf("图书价格:");
scanf("%f", &p->price);
printf("图书信息修改成功!\n");
}
else
{
printf("没有找到编号为%d的图书!\n", id);
}
}
// 删除图书信息
void delete_data()
{
int id;
struct book *p, *q;
printf("请输入要删除的图书编号:");
scanf("%d", &id);
p = books;
q = NULL;
while(p != NULL && p->id != id)
{
q = p;
p = p->next;
}
if(p != NULL) // 找到该节点
{
if(q == NULL) // 第一个节点
books = p->next;
else
q->next = p->next;
free(p);
printf("图书信息删除成功!\n");
}
else
{
printf("没有找到编号为%d的图书!\n", id);
}
}
// 对图书信息进行排序
void sort_data()
{
struct book *p, *q; // 两节点指针
struct book temp; // 临时图书结构体
p = books;
while(p != NULL)
{
q = p->next;
while(q != NULL)
{
if(p->id > q->id) // 交换节点
{
temp = *p;
*p = *q;
*q = temp;
}
q = q->next;
}
p = p->next;
}
printf("图书信息排序成功!\n");
}
// 生成图表报表
void make_chart()
{
struct book *p;
char name[20];
int i, n;
float price;
printf("请输入要生成的图书数量:");
scanf("%d", &n);
for(i=1; i<=n; i++)
{
p = (struct book*)malloc(sizeof(struct book));
sprintf(name, "图书%d", i); // 生成图书名称
p->id = i; // 图书编号
strcpy(p->name, name); // 图书名称
strcpy(p->author, "作者"); // 作者
price = (i+1)*10.0; // 价格
p->price = price; // 图书价格
p->next = books; // 新节点指向原链表头
books = p; // 新节点成为链表头
}
printf("随机图书信息生成成功!\n");
}

@ -0,0 +1,156 @@
<mxfile host="65bd71144e">
<diagram id="LXTJZ-hhDcvatKULC71N" name="第 1 页">
<mxGraphModel dx="832" dy="568" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="9" style="sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;edgeStyle=elbowEdgeStyle;" edge="1" parent="1" source="3" target="6">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="110"/>
<mxPoint x="210" y="140"/>
<mxPoint x="190" y="260"/>
<mxPoint x="240" y="140"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="31" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="10">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="445"/>
<mxPoint x="210" y="110"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="32" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="14">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="445"/>
<mxPoint x="210" y="185"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="34" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="13">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="445"/>
<mxPoint x="210" y="330"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="35" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="12">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="450"/>
<mxPoint x="210" y="390"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="36" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="11">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="37" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.75;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="21">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="530"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="38" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="22">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="590"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="39" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="23">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="660"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="40" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="24">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="720"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="41" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="25">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="775"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="42" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="26">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="830"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="43" style="edgeStyle=orthogonalEdgeStyle;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3" target="28">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="455"/>
<mxPoint x="210" y="890"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="3" value="main" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="30" y="430" width="110" height="50" as="geometry"/>
</mxCell>
<mxCell id="6" value="系统初始化init" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="440" y="20" width="240" height="40" as="geometry"/>
</mxCell>
<mxCell id="10" value="显示菜单display_menu" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="440" y="90" width="270" height="40" as="geometry"/>
</mxCell>
<mxCell id="11" value="保存数据save_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="455" y="435" width="240" height="40" as="geometry"/>
</mxCell>
<mxCell id="12" value="读取数据read_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="470" y="370" width="220" height="40" as="geometry"/>
</mxCell>
<mxCell id="13" value="退出quit" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="500" y="310" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="14" value="&lt;div style=&quot;text-align: justify;&quot;&gt;选择命令菜单make_choice&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;verticalAlign=middle;" vertex="1" parent="1">
<mxGeometry x="440" y="160" width="290" height="50" as="geometry"/>
</mxCell>
<mxCell id="15" value="确认confirm" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="445" y="235" width="260" height="40" as="geometry"/>
</mxCell>
<mxCell id="21" value="打印数据print_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="500" width="240" height="40" as="geometry"/>
</mxCell>
<mxCell id="22" value="查询数据query_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="570" width="250" height="40" as="geometry"/>
</mxCell>
<mxCell id="23" value="添加数据add_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="640" width="240" height="40" as="geometry"/>
</mxCell>
<mxCell id="24" value="更新数据update_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="700" width="240" height="40" as="geometry"/>
</mxCell>
<mxCell id="25" value="删除数据delete_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="760" width="250" height="30" as="geometry"/>
</mxCell>
<mxCell id="26" value="数据排序sort_data" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="810" width="240" height="40" as="geometry"/>
</mxCell>
<mxCell id="28" value="生成图表make_chart" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="870" width="240" height="40" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

@ -0,0 +1,151 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="219px" height="497px" viewBox="-0.5 -0.5 219 497" content="&lt;mxfile&gt;&lt;diagram id=&quot;uQQbMF64MJPfOjwho-in&quot; name=&quot;Page-1&quot;&gt;7VpLc+I4EP41qpo5kPIDO+Zog8nsIVNbRbZ2cpoStrC1sS1GFgHm169kSX5ChlAk2anlAlJ3q9Xdan0tCYA9zXd3FK7TexKjDFhGvAP2DFiWZ1v8UxD2kuC4niQkFMeSZDaEBf6JFNFQ1A2OUdkRZIRkDK+7xIgUBYpYhwYpJduu2Ipk3VnXMEEDwiKC2ZD6N45ZqtxyjIb+BeEk1TObhuIsYfSUULIp1HwFKZDk5FCrUaJlCmOybZHsENhTSgiTrXw3RZmIqo6YHDc/wq1NpqhgJw2YKDvYXruNYh4F1a0st4OU5Rnvmbw5nEDNWZINjXTk1EILVS0hZcIdIjlidM8FKMogw8/dgEO1bkktVw/9k2A+rWWoFDNvVRhVhpk6rFoFgzRBTI1qwsAbLTMaUhWcI4FSLj3DbKPMBZabMRGdcSeA7o+NWL1gSXajEv/ERQJsX2QFoTGiI06uwshzgSa4kDwT5fzTWO9E210riTWM43q4oakRyQiVNJos4Sfu8lTwu183nvNZaSElZpiomZqIC16GCzRKVRJXhtyMJWdFCibMR5puOdzGhrWCOc72ksl9hvmaM5Xn9ziipCQrsVKPkO+RvoC08QvKnhHDEZTdgRaE6Z5wxl9/HB4/GACzZFNwxh1hKY5OG7RACUGvmOSBouUmSpHw7X5xeMw9KWBEZDsnBSnXkO+MqvsAU5IrhxcP33AqglPNEzrAmwEvBKELJi7wbkF4C4IAeC4IJ6IxMfUwHlGGD5vXiqnxFfFMPcmpGSU8z7lqWJSnjdii4scGFnssXBTLzb/TYws9pwhJ1aLnU5yTugkz5RXOF2LxdCz8EHgBCMcgmIGJrROm8buOSVek5NOMSkTxSuYqQzs2ghlOVPr/sykZXu0ls8HpUXdTfbIcR+prN+R+cmvXNDZoSg6f0PcohZS1pdxkwMskZy6AQ7KHIJxlvMyJXbpNMUOLKoPs2ZYX2hPx+BlR7vyL6LurC1cHRXWB2zZFrwbWtFXwxsZxvO4g7QuwWlePi9Yfbe171x/LfrP6o106UH84vBQHK1AvqR0FIM335yugXwH99wL0/rmkPiy9JdIrkOYL6U2EZXJpg8qvSQCCsDJ6Any3asyBb1bCJvDnLbyXG/UI4lfWoVjB3Pujfg3xv4J99xKwb18K9t8a4usqp8PUr3pHIH6oyO7VCndy43RVyRI2UOVTCvctsbUQKI+bbFu9mW6NFy0byJuvk9chadZeWnx2qXNfmRxoh9k33jZ4QGXvscWZCbMN3dmrTsnXjfnilaBR+WFJ1j9H2N6ZSTZQ1N+sR1LsnFUaDw8kotJ5AvMELhoVHB6CTFEKphWFtz0QzkEwBZP5EBJ5aV1uyg+Bw3q7/goO+0t1Fhw6g1h+HURDFLiu26razSLuNuI1LRDu8qNC5itGjuNYDA8o4iUTLitVIvsVhHC9TgCcmdC1YUSW1Up1ySh5QlNZK/X+WOEs65EuEHnLdXqRdwaRtw8Evn/WPifw9vBU/fi/CbzZK2229Y6BNweBv15nrteZ63XmY68znOKJyi0oflWST7u8fORz1XhyYqV2LoFb49eeTQs+Q+twKrqP+kAqOs3xtOrp8+nRQLXfufQvbPJ42EXWy51ZT46NdcX0K6ZfMf0/hunVigoKX+OZwHR5OZOrzmV8fm/zxIuVuJNVwr7OA38mhIMQ+L6g8CG/z3tWfYd+j/cs2z4AfW/+hoGKuPeC8abVRt/4O9XGunS1OfFh47a3ame/kJg9RWe/kPBu878NKd78LcYO/wU=&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<path d="M 60 46 L 60 69.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 74.88 L 56.5 67.88 L 60 69.63 L 63.5 67.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<ellipse cx="60" cy="26" rx="60" ry="20" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 26px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<h4 id="make_chart" style="box-sizing: border-box; margin: 1em 0px 16px; padding: 0px; color: rgba(0, 0, 0, 0.85); position: relative; line-height: 1.4; font-size: 1.25em; font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; text-align: justify; background-color: rgb(255, 255, 255);">
make_chart
</h4>
</div>
</div>
</div>
</foreignObject>
<text x="60" y="30" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
make_chart
</text>
</switch>
</g>
<path d="M 60 136 L 60 179.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 184.88 L 56.5 177.88 L 60 179.63 L 63.5 177.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="76" width="120" height="60" rx="9" ry="9" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 106px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-size: 16px; text-align: justify; background-color: rgb(255, 255, 255);">
打印图书信息
</span>
</div>
</div>
</div>
</foreignObject>
<text x="60" y="110" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
打印图书信息
</text>
</switch>
</g>
<path d="M 120 225.5 L 200 225.94 Q 210 226 210 216 L 210 176 Q 210 166 210 156 L 210 106 Q 210 96 200 96 L 136.37 96" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 131.12 96 L 138.12 92.5 L 136.37 96 L 138.12 99.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 60 316 L 60 329.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 334.88 L 56.5 327.88 L 60 329.63 L 63.5 327.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 60 186 L 120 226 L 60 266 L 0 226 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 226px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
是否打印完全?
</div>
</div>
</div>
</foreignObject>
<text x="60" y="230" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
是否打印完全?
</text>
</switch>
</g>
<rect x="155" y="191" width="30" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 206px; margin-left: 170px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">
N
</div>
</div>
</div>
</foreignObject>
<text x="170" y="210" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
N
</text>
</switch>
</g>
<rect x="30" y="281" width="30" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 296px; margin-left: 45px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">
Y
</div>
</div>
</div>
</foreignObject>
<text x="45" y="300" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Y
</text>
</switch>
</g>
<ellipse cx="60" cy="471" rx="60" ry="25" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 471px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-size: 16px; text-align: justify; background-color: rgb(255, 255, 255);">
打印成功
</span>
</div>
</div>
</div>
</foreignObject>
<text x="60" y="475" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
打印成功
</text>
</switch>
</g>
<path d="M 60 396 L 60 439.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 444.88 L 56.5 437.88 L 60 439.63 L 63.5 437.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="336" width="120" height="60" rx="9" ry="9" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 366px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Helvetica, &quot;Meiryo UI&quot;, &quot;Malgun Gothic&quot;, &quot;Segoe UI&quot;, &quot;Trebuchet MS&quot;, Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, &quot;Helvetica Neue&quot;, &quot;Droid Sans&quot;, &quot;wenquanyi micro hei&quot;, FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-size: 16px; text-align: justify; background-color: rgb(255, 255, 255);">
打印结束后换行继续循环
</span>
</div>
</div>
</div>
</foreignObject>
<text x="60" y="370" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
打印结束后换行继续循环
</text>
</switch>
</g>
<path d="M 60 266 L 60 336" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Text is not SVG - cannot display
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,29 @@
<mxfile host="65bd71144e">
<diagram id="u_L9P898_jSC_YZIsbOk" name="µÚ 1 Ò³">
<mxGraphModel dx="832" dy="568" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="4" style="edgeStyle=none;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="3">
<mxGeometry relative="1" as="geometry">
<mxPoint x="255" y="170" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="3" value="printf_data" style="rhombus;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="150" y="30" width="210" height="80" as="geometry"/>
</mxCell>
<mxCell id="6" style="edgeStyle=none;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;html=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1" source="5">
<mxGeometry relative="1" as="geometry">
<mxPoint x="245" y="280" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="5" value="for i = 1 to num_parts" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="120" y="180" width="250" height="40" as="geometry"/>
</mxCell>
<mxCell id="7" value="´òӡͼÊéµÄË÷ÊéºÅ" style="rounded=1;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="150" y="290" width="190" height="40" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 75 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 64 KiB

Loading…
Cancel
Save