0
00:00:00,980 --> 00:00:03,240
那首先的话是给
1
00:00:03,820 --> 00:00:06,646
给水加上这个值属性
2
00:00:06,646 --> 00:00:11,170
你看,水之前在这里嘛,没有
3
00:00:11,450 --> 00:00:12,959
属性的,对吧
4
00:00:12,959 --> 00:00:14,900
有个状态什么之类的
5
00:00:16,450 --> 00:00:18,649
那现在给它加上去
6
00:00:18,649 --> 00:00:20,360
那加上去首先要
7
00:00:21,160 --> 00:00:24,868
解决这个单位的问题
8
00:00:24,868 --> 00:00:25,610
什么
9
00:00:25,910 --> 00:00:27,700
摄氏度
10
00:00:28,140 --> 00:00:30,240
克,这些问题
11
00:00:33,090 --> 00:00:34,120
那这个
12
00:00:35,230 --> 00:00:36,440
我们首先
13
00:00:37,510 --> 00:00:38,361
在这里
14
00:00:38,361 --> 00:00:40,278
原来这里是有单位的
15
00:00:40,278 --> 00:00:41,769
你看这个ISO-80000
16
00:00:41,769 --> 00:00:45,603
这个实际上就是导入一堆国际的单位嘛
17
00:00:45,603 --> 00:00:48,159
比如说,我们那个温度
18
00:00:48,159 --> 00:00:49,650
温度在哪里
19
00:00:51,020 --> 00:00:52,360
应该是
20
00:00:53,180 --> 00:00:54,915
这里
21
00:00:54,915 --> 00:00:55,610
这里
22
00:00:56,760 --> 00:00:57,740
23
00:00:58,020 --> 00:00:58,710
这个
24
00:01:01,340 --> 00:01:02,020
对吧
25
00:01:03,330 --> 00:01:06,240
摄氏度这里,这下面温度
26
00:01:07,050 --> 00:01:10,320
这个,但你看它这个只是一个什么
27
00:01:11,640 --> 00:01:11,892
28
00:01:11,892 --> 00:01:13,153
这是个对象
29
00:01:13,153 --> 00:01:13,910
这样
30
00:01:14,600 --> 00:01:15,908
这样,很简单
31
00:01:15,908 --> 00:01:17,870
列出来一个名字就完了
32
00:01:19,960 --> 00:01:22,226
那我们呢,就不用这里了
33
00:01:22,226 --> 00:01:22,680
我们
34
00:01:23,000 --> 00:01:25,350
自己搞一个温度
35
00:01:25,630 --> 00:01:27,200
而且我们用
36
00:01:28,280 --> 00:01:29,270
中文的
37
00:01:30,500 --> 00:01:30,790
38
00:01:30,790 --> 00:01:31,660
来命名
39
00:01:32,020 --> 00:01:34,370
那首先我们就要
40
00:01:35,010 --> 00:01:36,080
导入
41
00:01:36,410 --> 00:01:37,458
42
00:01:37,458 --> 00:01:38,296
一个单位
43
00:01:38,296 --> 00:01:40,393
还有一个是数值的问题
44
00:01:40,393 --> 00:01:42,280
你是整数、实数等等
45
00:01:42,560 --> 00:01:44,949
那这些我们都要导入一下
46
00:01:44,949 --> 00:01:45,601
怎么导
47
00:01:45,601 --> 00:01:46,470
你看这里
48
00:01:47,120 --> 00:01:48,030
49
00:01:49,250 --> 00:01:52,060
SysML附带一些标准的
50
00:01:52,630 --> 00:01:53,710
导进来
51
00:01:53,990 --> 00:01:54,249
52
00:01:54,249 --> 00:01:56,840
这里,SysML这里
53
00:01:57,190 --> 00:01:57,578
点中
54
00:01:57,578 --> 00:02:00,105
之前我们也在这里导过嘛
55
00:02:00,105 --> 00:02:01,466
导过ISO-80000这个
56
00:02:01,466 --> 00:02:02,049
在这里嘛
57
00:02:02,049 --> 00:02:02,438
对吧
58
00:02:02,438 --> 00:02:05,160
但我们现在不用这个
59
00:02:06,690 --> 00:02:07,467
放进来
60
00:02:07,467 --> 00:02:09,281
下一个,放这里
61
00:02:09,281 --> 00:02:11,095
然后我们导这个
62
00:02:11,095 --> 00:02:12,910
首先这个是
63
00:02:13,190 --> 00:02:14,934
定义了一些值类型
64
00:02:14,934 --> 00:02:15,370
对吧
65
00:02:15,950 --> 00:02:17,010
数值,整数
66
00:02:17,010 --> 00:02:18,602
实数、复数等等
67
00:02:18,602 --> 00:02:18,867
68
00:02:18,867 --> 00:02:21,520
那我们倒进来,放这里
69
00:02:23,580 --> 00:02:23,859
好
70
00:02:23,859 --> 00:02:26,370
这一个,我们再导一个
71
00:02:28,050 --> 00:02:29,150
这个也导
72
00:02:29,150 --> 00:02:30,525
这个是单位
73
00:02:30,525 --> 00:02:33,550
还有一个叫Quantity Kind
74
00:02:33,550 --> 00:02:35,750
实际上指的就是那个
75
00:02:37,440 --> 00:02:38,747
度量的维度
76
00:02:38,747 --> 00:02:41,100
长度、质量等等
77
00:02:42,890 --> 00:02:43,276
78
00:02:43,276 --> 00:02:44,050
维度
79
00:02:44,330 --> 00:02:47,221
应该它另外一个名字叫维度
80
00:02:47,221 --> 00:02:49,890
这怎么翻译我也不知道了
81
00:02:52,180 --> 00:02:53,430
长度
82
00:02:53,710 --> 00:02:55,290
体积,类似这样的
83
00:02:57,020 --> 00:03:01,468
那这个要注意,跟我们那个值属性还是有区别的
84
00:03:01,468 --> 00:03:04,278
比如说,同样是长度这个维度
85
00:03:04,278 --> 00:03:06,620
你可以描述高度
86
00:03:06,900 --> 00:03:09,035
也可以描述周长
87
00:03:09,035 --> 00:03:09,645
对吧
88
00:03:09,645 --> 00:03:09,950
89
00:03:11,760 --> 00:03:13,300
这个导进来
90
00:03:14,790 --> 00:03:15,035
好
91
00:03:15,035 --> 00:03:17,979
你看我们这里有这么两个库
92
00:03:17,979 --> 00:03:18,470
对吧
93
00:03:19,930 --> 00:03:23,370
那现在我们就开始来构造一下了
94
00:03:23,370 --> 00:03:24,660
先把这个关掉
95
00:03:25,340 --> 00:03:26,570
这个隐掉
96
00:03:27,060 --> 00:03:27,890
好
97
00:03:29,820 --> 00:03:31,620
这个也关掉
98
00:03:32,300 --> 00:03:33,530
把这个也关掉
99
00:03:35,330 --> 00:03:35,498
好
100
00:03:35,498 --> 00:03:38,030
我们值类型这里,我们就放这里吧
101
00:03:39,180 --> 00:03:40,830
添加一个图
102
00:03:41,700 --> 00:03:41,958
103
00:03:41,958 --> 00:03:44,030
块定义图,值类型
104
00:03:45,790 --> 00:03:48,070
把它放大一点
105
00:03:51,560 --> 00:03:51,786
106
00:03:51,786 --> 00:03:53,143
老是选不中
107
00:03:53,143 --> 00:03:53,370
108
00:03:56,660 --> 00:03:57,460
好
109
00:03:58,120 --> 00:04:01,180
那首先,我们来一个单位
110
00:04:05,190 --> 00:04:06,510
单位的话
111
00:04:07,110 --> 00:04:08,339
一个做法
112
00:04:08,339 --> 00:04:10,060
你看它这里是
113
00:04:11,310 --> 00:04:13,160
给出了单位
114
00:04:16,590 --> 00:04:18,890
和QuantityKind这个类
115
00:04:19,210 --> 00:04:19,960
那
116
00:04:23,760 --> 00:04:25,250
应该怎么做
117
00:04:25,620 --> 00:04:27,664
我们现在放上去的单位
118
00:04:27,664 --> 00:04:30,637
实际上是这个东西的一个对象
119
00:04:30,637 --> 00:04:34,540
这是block,我们定义的单位实际上是这个的一个对象
120
00:04:34,950 --> 00:04:37,370
那我们可以把这个拖上去
121
00:04:38,850 --> 00:04:41,154
比如说,把这个拖上来
122
00:04:41,154 --> 00:04:41,730
然后
123
00:04:42,070 --> 00:04:43,430
形成一个对象
124
00:04:43,430 --> 00:04:45,470
对象命名为
125
00:04:45,950 --> 00:04:46,643
某个单位
126
00:04:46,643 --> 00:04:48,550
比如说,摄氏度什么之类的
127
00:04:50,570 --> 00:04:50,875
128
00:04:50,875 --> 00:04:51,792
怎么做
129
00:04:51,792 --> 00:04:53,320
这里,拖上来
130
00:05:00,100 --> 00:05:00,294
131
00:05:00,294 --> 00:05:02,040
然后这里命名,摄氏度
132
00:05:06,610 --> 00:05:08,650
这是一种
133
00:05:09,180 --> 00:05:14,560
另外一种,干脆就不要管这两个类了
134
00:05:15,120 --> 00:05:15,320
135
00:05:15,320 --> 00:05:16,920
我们就从这里搞
136
00:05:16,920 --> 00:05:17,320
这里
137
00:05:17,620 --> 00:05:18,670
放上一个
138
00:05:19,720 --> 00:05:20,386
单位
139
00:05:20,386 --> 00:05:21,720
然后这里
140
00:05:22,220 --> 00:05:23,240
摄氏度
141
00:05:26,290 --> 00:05:26,880
142
00:05:29,910 --> 00:05:32,361
然后这个符号什么在哪里呀
143
00:05:32,361 --> 00:05:32,770
符号
144
00:05:33,540 --> 00:05:35,300
就在这里
145
00:05:36,260 --> 00:05:38,380
这个地方设置
146
00:05:39,090 --> 00:05:39,350
147
00:05:39,350 --> 00:05:42,730
符号就是摄氏度那个符号
148
00:05:46,130 --> 00:05:46,790
这个
149
00:05:47,220 --> 00:05:47,880
对吧
150
00:05:50,160 --> 00:05:50,396
好
151
00:05:50,396 --> 00:05:51,343
这是一个
152
00:05:51,343 --> 00:05:52,290
那我们来
153
00:05:52,760 --> 00:05:55,201
这个QuantityKind的这个维度这个
154
00:05:55,201 --> 00:05:56,626
我们也放一个
155
00:05:56,626 --> 00:05:57,440
这是温度
156
00:06:00,210 --> 00:06:01,610
起名叫温度
157
00:06:05,410 --> 00:06:06,380
这个有了
158
00:06:06,830 --> 00:06:07,620
对吧
159
00:06:08,710 --> 00:06:11,060
那现在我们要有一个
160
00:06:11,060 --> 00:06:12,705
水有一个值属性了
161
00:06:12,705 --> 00:06:13,880
我们叫水温
162
00:06:14,540 --> 00:06:14,725
163
00:06:14,725 --> 00:06:18,250
它是一个值类型,这里放上来
164
00:06:19,120 --> 00:06:20,810
水温
165
00:06:26,090 --> 00:06:28,029
水温是一个什么
166
00:06:28,029 --> 00:06:28,860
是一个
167
00:06:29,430 --> 00:06:30,850
是一个实数
168
00:06:30,850 --> 00:06:33,407
我们用实数来表达
169
00:06:33,407 --> 00:06:34,260
对不对
170
00:06:34,810 --> 00:06:37,066
那实数我们在哪里设
171
00:06:37,066 --> 00:06:39,774
你这个类型已经是值类型了
172
00:06:39,774 --> 00:06:42,707
不能说类型,你再敲Real
173
00:06:42,707 --> 00:06:43,610
那不行
174
00:06:43,890 --> 00:06:44,480
175
00:06:44,760 --> 00:06:44,989
176
00:06:44,989 --> 00:06:46,136
它是值类型
177
00:06:46,136 --> 00:06:48,890
那我们必须要把它跟这个
178
00:06:49,590 --> 00:06:50,750
这个地方
179
00:06:50,750 --> 00:06:51,330
这个
180
00:06:51,610 --> 00:06:52,370
这个
181
00:06:52,770 --> 00:06:54,310
Real这个
182
00:06:56,310 --> 00:06:56,607
183
00:06:56,607 --> 00:06:57,500
拖上来
184
00:07:00,560 --> 00:07:01,140
185
00:07:04,270 --> 00:07:06,580
那它跟这个是什么关系呢
186
00:07:09,910 --> 00:07:10,736
严格来说
187
00:07:10,736 --> 00:07:13,010
应该是一个组合的关系
188
00:07:15,010 --> 00:07:16,110
但是呢
189
00:07:16,710 --> 00:07:18,940
我看了
190
00:07:19,220 --> 00:07:21,896
很多标准上的操作
191
00:07:21,896 --> 00:07:24,350
都说这个用的泛化关系
192
00:07:24,950 --> 00:07:28,530
水温是一种实数,实际上是不对的
193
00:07:30,400 --> 00:07:30,658
194
00:07:30,658 --> 00:07:31,690
泛化关系
195
00:07:38,740 --> 00:07:40,434
你说圆是一种点
196
00:07:40,434 --> 00:07:43,340
就像我们说嘛,圆和点的关系
197
00:07:43,620 --> 00:07:45,493
圆是一种点,可以吗
198
00:07:45,493 --> 00:07:47,100
好像可以,对吧
199
00:07:47,380 --> 00:07:48,210
200
00:07:50,050 --> 00:07:51,523
圆有个圆心嘛
201
00:07:51,523 --> 00:07:52,260
202
00:07:53,460 --> 00:07:57,317
圆可以看作圆心那个点往外扩大
203
00:07:57,317 --> 00:07:59,245
加了一个半径的属性
204
00:07:59,245 --> 00:07:59,888
对不对
205
00:07:59,888 --> 00:08:00,960
问题是什么
206
00:08:01,320 --> 00:08:03,130
泛化的意思是一个
207
00:08:04,300 --> 00:08:06,307
集合的包含的意思
208
00:08:06,307 --> 00:08:07,060
意思是
209
00:08:07,690 --> 00:08:10,350
超类定义的或超类的行为
210
00:08:10,350 --> 00:08:12,043
定义的行为里面
211
00:08:12,043 --> 00:08:13,736
子类里面的对象
212
00:08:13,736 --> 00:08:15,430
任何一个都能够
213
00:08:15,710 --> 00:08:16,500
满足
214
00:08:16,780 --> 00:08:20,040
比如说,我们可以用三个点组成三角形
215
00:08:20,730 --> 00:08:24,384
那我们从圆的集合里面挑三个圆能组成三角形吗
216
00:08:24,384 --> 00:08:25,080
实际上这个就
217
00:08:25,360 --> 00:08:26,354
不太对了
218
00:08:26,354 --> 00:08:27,100
对不对
219
00:08:28,150 --> 00:08:30,993
那如果你水温是一种实数的话
220
00:08:30,993 --> 00:08:32,008
意味着什么
221
00:08:32,008 --> 00:08:33,430
实数里面的运算
222
00:08:35,210 --> 00:08:38,190
在水温对象里面挑出来
223
00:08:39,770 --> 00:08:41,190
都可以满足
224
00:08:42,500 --> 00:08:43,921
包括水温是实数
225
00:08:43,921 --> 00:08:44,733
人的身高
226
00:08:44,733 --> 00:08:46,560
也可以看作实数嘛
227
00:08:46,840 --> 00:08:48,917
那两个实数可以相加
228
00:08:48,917 --> 00:08:49,610
对不对
229
00:08:49,610 --> 00:08:51,456
得到另外一个实数
230
00:08:51,456 --> 00:08:53,765
那我从水温集合
231
00:08:53,765 --> 00:08:55,380
挑一个水温对象
232
00:08:55,380 --> 00:08:57,920
再从那个身高里面挑一个
233
00:08:58,690 --> 00:08:59,499
身高对象
234
00:08:59,499 --> 00:09:01,929
它们的值加起来能不能加
235
00:09:01,929 --> 00:09:02,334
236
00:09:02,334 --> 00:09:03,751
这个是不对的
237
00:09:03,751 --> 00:09:05,775
严格来说应该是什么
238
00:09:05,775 --> 00:09:07,800
应该是一个组合关系
239
00:09:07,800 --> 00:09:09,420
这个地方
240
00:09:11,350 --> 00:09:14,623
很多人画成泛化关系
241
00:09:14,623 --> 00:09:17,430
应该是组合关系,关联过来
242
00:09:21,300 --> 00:09:22,440
这个是
243
00:09:25,830 --> 00:09:27,380
这里
244
00:09:28,610 --> 00:09:29,800
组合
245
00:09:35,770 --> 00:09:36,001
246
00:09:36,001 --> 00:09:37,390
这样更合理
247
00:09:38,290 --> 00:09:40,080
组合一个实数,对吧
248
00:09:41,790 --> 00:09:45,875
那水温这里就可以定义它的那个单位
249
00:09:45,875 --> 00:09:48,519
怎么在这里定义
250
00:09:48,519 --> 00:09:49,240
单位是
251
00:09:49,990 --> 00:09:52,427
是这个摄氏度
252
00:09:52,427 --> 00:09:53,240
对吧
253
00:09:54,030 --> 00:09:56,250
这个就是温度
254
00:09:57,850 --> 00:09:58,138
255
00:09:58,138 --> 00:09:59,292
就这样
256
00:09:59,292 --> 00:09:59,870
257
00:10:00,330 --> 00:10:00,744
好
258
00:10:00,744 --> 00:10:04,060
这个是定义了一个
259
00:10:06,320 --> 00:10:08,190
水温这个
260
00:10:08,760 --> 00:10:11,840
值类型,那怎么样把它变成
261
00:10:12,870 --> 00:10:14,600
水的属性呢
262
00:10:15,360 --> 00:10:16,771
那我们水在哪里
263
00:10:16,771 --> 00:10:17,577
水在这里
264
00:10:17,577 --> 00:10:17,980
对吧
265
00:10:17,980 --> 00:10:19,190
那这个怎么加
266
00:10:19,860 --> 00:10:21,335
因为这个没有办法
267
00:10:21,335 --> 00:10:22,810
你看,这里加
268
00:10:23,540 --> 00:10:24,970
加一个水温
269
00:10:26,090 --> 00:10:26,436
270
00:10:26,436 --> 00:10:27,821
这是属性
271
00:10:27,821 --> 00:10:29,900
然后呢,类型选
272
00:10:31,180 --> 00:10:32,660
选这个
273
00:10:33,660 --> 00:10:34,650
274
00:10:35,030 --> 00:10:36,580
选这个水温
275
00:10:38,230 --> 00:10:39,070
好
276
00:10:39,350 --> 00:10:40,640
假设是这样
277
00:10:41,070 --> 00:10:43,125
那这里确实有一个,问题是
278
00:10:43,125 --> 00:10:45,368
它没有成为它的值属性
279
00:10:45,368 --> 00:10:47,050
成为它的属性而已
280
00:10:47,050 --> 00:10:51,910
比如说,我们这里画一个它的块定义图
281
00:10:53,160 --> 00:10:55,151
添加水的块定义图
282
00:10:55,151 --> 00:10:55,550
我们
283
00:10:57,990 --> 00:10:58,173
284
00:10:58,173 --> 00:10:59,640
我们在这里加
285
00:10:59,920 --> 00:11:00,840
块定义图
286
00:11:02,400 --> 00:11:02,735
287
00:11:02,735 --> 00:11:04,410
不是这个
288
00:11:04,740 --> 00:11:06,430
在项类型这里加
289
00:11:07,750 --> 00:11:08,995
加一个块定义图
290
00:11:08,995 --> 00:11:10,240
291
00:11:15,550 --> 00:11:15,732
292
00:11:15,732 --> 00:11:17,006
我们把水拖上去
293
00:11:17,006 --> 00:11:17,370
294
00:11:22,120 --> 00:11:25,120
然后我们再看它的那个
295
00:11:27,070 --> 00:11:27,318
296
00:11:27,318 --> 00:11:29,310
看它的属性等等
297
00:11:31,540 --> 00:11:34,066
你看,并没有值
298
00:11:34,066 --> 00:11:38,557
操作我们都放上来吧
299
00:11:38,557 --> 00:11:39,680
300
00:11:40,900 --> 00:11:41,890
放上来
301
00:11:43,530 --> 00:11:43,762
302
00:11:43,762 --> 00:11:45,390
并没有,并没有
303
00:11:52,350 --> 00:11:54,260
属性、操作
304
00:11:54,540 --> 00:11:56,420
并没有那个
305
00:11:57,170 --> 00:11:58,202
那怎么做
306
00:11:58,202 --> 00:11:59,853
变成它的值
307
00:11:59,853 --> 00:12:02,124
它这里要变成它的值
308
00:12:02,124 --> 00:12:03,570
这个怎么处理
309
00:12:04,540 --> 00:12:06,180
那这个的话,我们
310
00:12:07,250 --> 00:12:09,156
首先把刚才那个删掉
311
00:12:09,156 --> 00:12:10,640
这个删掉
312
00:12:15,570 --> 00:12:15,975
删掉
313
00:12:15,975 --> 00:12:17,599
然后我们怎么处理
314
00:12:17,599 --> 00:12:18,614
你看,右键点
315
00:12:18,614 --> 00:12:21,050
我们要在这个,把它拉下来
316
00:12:21,710 --> 00:12:23,740
我们要在这个地方
317
00:12:25,650 --> 00:12:27,520
添加一个
318
00:12:30,870 --> 00:12:31,867
内部块图
319
00:12:31,867 --> 00:12:34,260
给H2O添加一个这个
320
00:12:36,410 --> 00:12:36,782
好
321
00:12:36,782 --> 00:12:37,901
然后呢
322
00:12:37,901 --> 00:12:39,020
我们把
323
00:12:41,580 --> 00:12:43,090
这个拖上去
324
00:12:46,560 --> 00:12:46,760
325
00:12:46,760 --> 00:12:48,560
变成它的一个property
326
00:12:48,560 --> 00:12:49,760
变成一个属性
327
00:12:50,040 --> 00:12:51,110
这样来
328
00:12:54,750 --> 00:12:54,927
329
00:12:54,927 --> 00:12:56,704
这个时候我们回到这里
330
00:12:56,704 --> 00:12:57,060
你看
331
00:12:57,600 --> 00:12:57,820
332
00:12:57,820 --> 00:13:00,240
这里有一个值,水温
333
00:13:00,240 --> 00:13:00,680
对吧
334
00:13:01,430 --> 00:13:02,870
这时候会出来
335
00:13:04,480 --> 00:13:04,715
336
00:13:04,715 --> 00:13:06,130
这样来添加