54
+
55
+    public void decode(ByteBuffer b, int length) {
56
+        storageId = b.getInt();
57
+        objectFormat = b.getShort();
58
+        protectionStatus = b.getShort();
59
+        objectCompressedSize = b.getInt();
60
+        thumbFormat = b.getShort();
61
+        thumbCompressedSize = b.getInt();
62
+        thumbPixWidth = b.getInt();
63
+        thumbPixHeight = b.getInt();
64
+        imagePixWidth = b.getInt();
65
+        imagePixHeight = b.getInt();
66
+        imageBitDepth = b.getInt();
67
+        parentObject = b.getInt();
68
+        associationType = b.getShort();
69
+        associationDesc = b.getInt();
70
+        sequenceNumber = b.getInt();
71
+        filename = PacketUtil.readString(b);
72
+        captureDate = PacketUtil.readString(b);
73
+        modificationDate = PacketUtil.readString(b);
74
+        keywords = b.get(); // string, not used on camera?
75
+    }
76
+
77
+    @Override
78
+    public String toString() {
79
+        StringBuilder b = new StringBuilder();
80
+        b.append("ObjectInfo\n");
81
+        b.append("StorageId: ").append(String.format("0x%08x\n", storageId));
82
+        b.append("ObjectFormat: ").append(PtpConstants.objectFormatToString(objectFormat)).append('\n');
83
+        b.append("ProtectionStatus: ").append(protectionStatus).append('\n');
84
+        b.append("ObjectCompressedSize: ").append(objectCompressedSize).append('\n');
85
+        b.append("ThumbFormat: ").append(PtpConstants.objectFormatToString(thumbFormat)).append('\n');
86
+        b.append("ThumbCompressedSize: ").append(thumbCompressedSize).append('\n');
87
+        b.append("ThumbPixWdith: ").append(thumbPixWidth).append('\n');
88
+        b.append("ThumbPixHeight: ").append(thumbPixHeight).append('\n');
89
+        b.append("ImagePixWidth: ").append(imagePixWidth).append('\n');
90
+        b.append("ImagePixHeight: ").append(imagePixHeight).append('\n');
91
+        b.append("ImageBitDepth: ").append(imageBitDepth).append('\n');
92
+        b.append("ParentObject: ").append(String.format("0x%08x", parentObject)).append('\n');
93
+        b.append("AssociationType: ").append(associationType).append('\n');
94
+        b.append("AssociatonDesc: ").append(associationDesc).append('\n');
95
+        b.append("Filename: ").append(filename).append('\n');
96
+        b.append("CaptureDate: ").append(captureDate).append('\n');
97
+        b.append("ModificationDate: ").append(modificationDate).append('\n');
98
+        b.append("Keywords: ").append(keywords).append('\n');
99
+        return b.toString();
100
+    }
101
+}

+ 47 - 0
ryc/src/main/java/com/remoteyourcam/usb/ptp/model/StorageInfo.java

@@ -0,0 +1,47 @@
1
+/**
2
+ * Copyright 2013 Nils Assbeck, Guersel Ayaz and Michael Zoech
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+package com.remoteyourcam.usb.ptp.model;
17
+
18
+import java.nio.ByteBuffer;
19
+
20
+import com.remoteyourcam.usb.ptp.PacketUtil;
21
+
22
+public class StorageInfo {
23
+
24
+    public int storageType;
25
+    public int filesystemType;
26
+    public int accessCapability;
27
+    public long maxCapacity;
28
+    public long freeSpaceInBytes;
29
+    public int freeSpaceInImages;
30
+    public String storageDescription;
31
+    public String volumeLabel;
32
+
33
+    public StorageInfo(ByteBuffer b, int length) {
34
+        decode(b, length);
35
+    }
36
+
37
+    private void decode(ByteBuffer b, int length) {
38
+        storageType = b.getShort() & 0xffff;
39
+        filesystemType = b.getShort() & 0xffff;
40
+        accessCapability = b.getShort() & 0xff;
41
+        maxCapacity = b.getLong();
42
+        freeSpaceInBytes = b.getLong();
43
+        freeSpaceInImages = b.getInt();
44
+        storageDescription = PacketUtil.readString(b);
45
+        volumeLabel = PacketUtil.readString(b);
46
+    }
47
+}

+ 3 - 0
ryc/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
1
+<resources>
2
+    <string name="app_name">ryc</string>
3
+</resources>

+ 1 - 1
settings.gradle

@@ -1 +1 @@
1
-include ':app', ':common', ':views'
1
+include ':app', ':common', ':views', ':ryc'

kodo - Gogs: Go Git Service

暫無描述

info_views.py 608B

    # -*- coding: utf-8 -*- from __future__ import division from django.conf import settings from django.shortcuts import render from mch.models import SaleclerkInfo def clerk_info_oauth(request): brand_id = request.GET.get('brand_id') or settings.KODO_DEFAULT_BRAND_ID unionid = request.GET.get('unionid', '') try: clerk = SaleclerkInfo.objects.get(brand_id=brand_id, unionid=unionid) except SaleclerkInfo.DoesNotExist: clerk = None return render(request, 'page/clerk_info.html', { 'domain': settings.DOMAIN, 'clerk_info': clerk and clerk.data, })
kodo - Gogs: Go Git Service

暫無描述

0001_initial.py 2.3KB

    # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import shortuuidfield.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='OrderInfo', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('status', models.BooleanField(default=True, help_text='\u72b6\u6001', db_index=True, verbose_name='status')), ('created_at', models.DateTimeField(help_text='\u521b\u5efa\u65f6\u95f4', verbose_name='created_at', auto_now_add=True)), ('updated_at', models.DateTimeField(help_text='\u66f4\u65b0\u65f6\u95f4', verbose_name='updated_at', auto_now=True)), ('order_id', shortuuidfield.fields.ShortUUIDField(help_text='\u8ba2\u5355\u552f\u4e00\u6807\u8bc6', max_length=22, editable=False, db_index=True, blank=True)), ('from_uid', models.CharField(help_text='\u4ed8\u6b3e\u7528\u6237\u552f\u4e00\u6807\u8bc6', max_length=255, verbose_name='from_uid', db_index=True)), ('to_lid', models.CharField(max_length=255, blank=True, help_text='\u6536\u6b3e\u6444\u5f71\u5e08\u552f\u4e00\u6807\u8bc6', null=True, verbose_name='to_lid', db_index=True)), ('to_uid', models.CharField(max_length=255, blank=True, help_text='\u6536\u6b3e\u7528\u6237\u552f\u4e00\u6807\u8bc6', null=True, verbose_name='to_uid', db_index=True)), ('body', models.CharField(help_text='\u5546\u54c1\u63cf\u8ff0', max_length=255, null=True, verbose_name='body', blank=True)), ('total_fee', models.IntegerField(default=0, help_text='\u603b\u91d1\u989d', verbose_name='total_fee')), ('pay_status', models.IntegerField(default=0, help_text='\u652f\u4ed8\u72b6\u6001', db_index=True, verbose_name='pay_status', choices=[(0, '\u5f85\u652f\u4ed8'), (1, '\u5df2\u652f\u4ed8')])), ('paid_at', models.DateTimeField(help_text='\u652f\u4ed8\u65f6\u95f4', null=True, verbose_name='paid_at', blank=True)), ], options={ 'verbose_name': 'orderinfo', 'verbose_name_plural': 'orderinfo', }, ), ]