Wellknown types
This guide demonstrates different features of wellknown types.
Datetime
Datetime
A worksheet ItemConf
in HelloWorld.xlsx:
BeginDatetime | EndDatetime | Datetime |
---|---|---|
datetime | datetime | []datetime |
Begin datetime | End datetime | Datetime |
2020-01-01 10:25:00 | 2022-10-10 05:10:00 | 2020-01-01 10:25:00,2022-10-10 05:10:00 |
Generated:
hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};
message ItemConf {
option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};
google.protobuf.Timestamp begin_datetime = 1 [(tableau.field) = {name:"BeginDatetime"}];
google.protobuf.Timestamp end_datetime = 2 [(tableau.field) = {name:"EndDatetime"}];
repeated google.protobuf.Timestamp datetime_list = 3 [(tableau.field) = {name:"Datetime" layout:LAYOUT_INCELL}];
}
ItemConf.json
{
"beginDatetime": "2020-01-01T02:25:00Z",
"endDatetime": "2022-10-09T21:10:00Z",
"datetimeList": [
"2020-01-01T02:25:00Z",
"2022-10-09T21:10:00Z"
]
}
Date
A worksheet ItemConf
in HelloWorld.xlsx:
BeginDate | EndDate | Date |
---|---|---|
date | date | []date |
Begin date | End date | Date |
2020-01-01 | 20221010 | 2020-01-01,20221010 |
Generated:
hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};
message ItemConf {
option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};
google.protobuf.Timestamp begin_date = 1 [(tableau.field) = {name:"BeginDate"}];
google.protobuf.Timestamp end_date = 2 [(tableau.field) = {name:"EndDate"}];
repeated google.protobuf.Timestamp date_list = 3 [(tableau.field) = {name:"Date" layout:LAYOUT_INCELL}];
}
ItemConf.json
{
"beginDate": "2019-12-31T16:00:00Z",
"endDate": "2022-10-09T16:00:00Z",
"dateList": [
"2019-12-31T16:00:00Z",
"2022-10-09T16:00:00Z"
]
}
Time
A worksheet ItemConf
in HelloWorld.xlsx:
BeginTime | EndTime | Time |
---|---|---|
time | time | []time |
Begin time | End time | Time |
10:25:00 | 1125 | 10:25:00,1125 |
Generated:
hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};
message ItemConf {
option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};
google.protobuf.Duration begin_time = 1 [(tableau.field) = {name:"BeginTime"}];
google.protobuf.Duration end_time = 2 [(tableau.field) = {name:"EndTime"}];
repeated google.protobuf.Duration time_list = 3 [(tableau.field) = {name:"Time" layout:LAYOUT_INCELL}];
}
ItemConf.json
{
"beginTime": "37500s",
"endTime": "41100s",
"timeList": [
"37500s",
"41100s"
]
}
Duration
A worksheet ItemConf
in HelloWorld.xlsx:
Duration1 | Duration2 | Duration |
---|---|---|
duration | duration | []duration |
Duration 1 | Duration 2 | Duration |
1h2m3s | 4ms5us6ns | 1h2m3s,4ms5us6ns |
Generated:
hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};
message ItemConf {
option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};
google.protobuf.Duration duration_1 = 1 [(tableau.field) = {name:"Duration1"}];
google.protobuf.Duration duration_2 = 2 [(tableau.field) = {name:"Duration2"}];
repeated google.protobuf.Duration duration_list = 3 [(tableau.field) = {name:"Duration" layout:LAYOUT_INCELL}];
}
ItemConf.json
{
"duration1": "3723s",
"duration2": "0.004005006s",
"durationList": [
"3723s",
"0.004005006s"
]
}
Fraction
A worksheet ItemConf
in HelloWorld.xlsx:
MinRatio | Ratio1 | Ratio2 | Ratio3 | Ratio4 |
---|---|---|---|---|
fraction | []fraction | fraction | fraction | fraction |
min ratio | ratio1 | ratio 2 | ratio 3 | ratio 4 |
1/4 | 10% | 10â° | 10âą | 10 |
Generated:
hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};
message ItemConf {
option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};
tableau.Fraction min_ratio = 1 [(tableau.field) = {name:"MinRatio"}];
repeated tableau.Fraction ratio_list = 2 [(tableau.field) = {name:"Ratio" layout:LAYOUT_HORIZONTAL}];
}
ItemConf.json
{
"minRatio": {
"num": 1,
"den": 4
},
"ratioList": [
{
"num": 10,
"den": 100
},
{
"num": 10,
"den": 1000
},
{
"num": 10,
"den": 10000
},
{
"num": 10,
"den": 1
}
]
}
Comparator
A worksheet ItemConf
in HelloWorld.xlsx:
MinRatio | Ratio1 | Ratio2 | Ratio3 | Ratio4 | Ratio5 |
---|---|---|---|---|---|
comparator | []comparator | comparator | comparator | comparator | comparator |
min ratio | ratio1 | ratio 2 | ratio 3 | ratio 4 | ratio 5 |
!=1/4 | <10% | <=10â° | >10âą | >=10 | ==3/5 |
Generated:
hello_world.proto
// --snip--
option (tableau.workbook) = {name:"HelloWorld.xlsx"};
message ItemConf {
option (tableau.worksheet) = {name:"ItemConf" namerow:1 typerow:2 noterow:3 datarow:4};
tableau.Comparator min_ratio = 1 [(tableau.field) = {name:"MinRatio"}];
repeated tableau.Comparator ratio_list = 2 [(tableau.field) = {name:"Ratio" layout:LAYOUT_HORIZONTAL}];
}
ItemConf.json
{
"minRatio": {
"sign": "SIGN_NOT_EQUAL",
"value": {
"num": 1,
"den": 4
}
},
"ratioList": [
{
"sign": "SIGN_LESS",
"value": {
"num": 10,
"den": 100
}
},
{
"sign": "SIGN_LESS_OR_EQUAL",
"value": {
"num": 10,
"den": 1000
}
},
{
"sign": "SIGN_GREATER",
"value": {
"num": 10,
"den": 10000
}
},
{
"sign": "SIGN_GREATER_OR_EQUAL",
"value": {
"num": 10,
"den": 1
}
},
{
"sign": "SIGN_EQUAL",
"value": {
"num": 3,
"den": 5
}
}
]
}