MBIConst.cs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /* ==============================================================================
  2. * 功能描述:MBIConst
  3. * 创 建 者:Garrett
  4. * 创建日期:2018/3/13 19:31:08
  5. * ==============================================================================*/
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using SAGA.DotNetUtils;
  13. using SAGA.DotNetUtils.Utilities;
  14. using SAGA.MBI.FileStream;
  15. namespace SAGA.MBI.Common
  16. {
  17. /// <summary>
  18. /// MBIConst
  19. /// </summary>
  20. public class MBIConst
  21. {
  22. //最少空间的面积. 0.4m 削减因子: 1
  23. public static readonly double SpacePerimeterTolerance = Math.Pow(0.4 * 1000 / 304.8, 2) / 1;
  24. //最小空间的周长. 0.4m 削减因子: 1
  25. public static readonly double SpaceAreaTolerance = (0.4 * 1000 / 304.8 * 4) / 1;
  26. public static readonly string ManageCur = "ManageCurLocalize.json";
  27. public static readonly string MBIAssistDBName = "MBIAssistData.db";
  28. public static readonly string MBIAssistDBVersion = "SqliteVersion.xml";
  29. public static readonly string MBITempSettingPath = Path.Combine(AppBaseInfo.AppTempFilePath, "MBI\\SettingsTemp");
  30. public static readonly string MBIImagePath = AppBaseInfo.ImagePath;
  31. public static readonly string MBIResourcePath = Path.Combine(AppBaseInfo.AppRunPath, "MBIResource");
  32. public static readonly string MBIDataDictionaryPath = Path.Combine(MBIResourcePath, "DataDictionary");
  33. public static readonly string EmptyFilePath = Path.Combine(MBIResourcePath, "EmptyFile\\EmptyProject.rvt");
  34. public static readonly string BeaconFamilyFilePath = Path.Combine(AppBaseInfo.FamilyPath, "Beacon.rfa");
  35. public static readonly string SpaceTagFamilyFilePath = Path.Combine(AppBaseInfo.FamilyPath, "空间标记.rfa");
  36. /// <summary>
  37. /// 幕墙编码
  38. /// </summary>
  39. public static readonly string CurtainWallCode = "CWPN";
  40. //访问数据的地址
  41. public static string SaasLocalHost
  42. {
  43. get
  44. {
  45. string key = nameof(SaasLocalHost);
  46. string url = ProjectDirOperate.GetConfigureInfo(key);
  47. if (url.IsNullOrEmpty())
  48. {
  49. //url = "http://192.168.30.96:8080/";
  50. url = "http://mbi.sagacloud.cn:8080/";
  51. ProjectDirOperate.SaveConfigureInfo(key, url);
  52. }
  53. return url;
  54. }
  55. }
  56. public static string DataPlatformLocalHost
  57. {
  58. get
  59. {
  60. string key = nameof(DataPlatformLocalHost);
  61. string url = ProjectDirOperate.GetConfigureInfo(key);
  62. if (url.IsNullOrEmpty())
  63. {
  64. //url = "http://192.168.20.225:8080/";
  65. url = "http://service.sagacloud.cn:28888/";
  66. ProjectDirOperate.SaveConfigureInfo(key, url);
  67. }
  68. return url;
  69. }
  70. }
  71. /// <summary>
  72. /// 图片服务器,线上地址更新,
  73. /// 之前与DataPlatflorm一致 190123
  74. /// </summary>
  75. public static string ImageServiceLocalHost
  76. {
  77. get
  78. {
  79. string key = nameof(ImageServiceLocalHost);
  80. string url = ProjectDirOperate.GetConfigureInfo(key);
  81. if (url.IsNullOrEmpty())
  82. {
  83. //url = "http://192.168.20.225:8080/";
  84. url = "47.93.33.207:28888/";
  85. ProjectDirOperate.SaveConfigureInfo(key, url);
  86. }
  87. return url;
  88. }
  89. }
  90. public static string GoodHandLocalHost
  91. {
  92. get
  93. {
  94. string key = nameof(GoodHandLocalHost);
  95. string url = ProjectDirOperate.GetConfigureInfo(key);
  96. if (url.IsNullOrEmpty())
  97. {
  98. //url = "http://192.168.20.225:8080/godhand/";
  99. url = "http://service.sagacloud.cn:28888/godhand/";
  100. ProjectDirOperate.SaveConfigureInfo(key, url);
  101. }
  102. return url;
  103. }
  104. }
  105. public static string ScanBuildingLocalHost
  106. {
  107. get
  108. {
  109. string key = nameof(ScanBuildingLocalHost);
  110. string url = ProjectDirOperate.GetConfigureInfo(key);
  111. if (url.IsNullOrEmpty())
  112. {
  113. // url = "http://172.16.0.141:8080/ScanBuilding/";
  114. url = "http://mbi.sagacloud.cn:8080/ScanBuilding/";
  115. ProjectDirOperate.SaveConfigureInfo(key, url);
  116. }
  117. return url;
  118. }
  119. }
  120. //html5的ulr地址,暂定
  121. public static string Html5DetailLocalHost
  122. {
  123. get
  124. {
  125. string key = nameof(Html5DetailLocalHost);
  126. string url = ProjectDirOperate.GetConfigureInfo(key);
  127. if (url.IsNullOrEmpty())
  128. {
  129. // url = "http://172.16.0.181:8889/#/";
  130. url = "http://mbi.sagacloud.cn:8889/#/";
  131. ProjectDirOperate.SaveConfigureInfo(key, url);
  132. }
  133. return url;
  134. }
  135. }
  136. public static string Html5ImageLocalHost
  137. {
  138. get
  139. {
  140. string key = nameof(Html5ImageLocalHost);
  141. string url = ProjectDirOperate.GetConfigureInfo(key);
  142. if (url.IsNullOrEmpty())
  143. {
  144. // url = "http://172.16.0.181:8890/";
  145. url = "http://mbi.sagacloud.cn:8890/";
  146. ProjectDirOperate.SaveConfigureInfo(key, url);
  147. }
  148. return url;
  149. }
  150. }
  151. public static string Html5ScanLocalHost
  152. {
  153. get
  154. {
  155. string key = nameof(Html5ScanLocalHost);
  156. string url = ProjectDirOperate.GetConfigureInfo(key);
  157. if (url.IsNullOrEmpty())
  158. {
  159. // url = "http://172.16.0.181:8888/#/";
  160. url = "http://mbi.sagacloud.cn:8888/#/";
  161. ProjectDirOperate.SaveConfigureInfo(key, url);
  162. }
  163. return url;
  164. }
  165. }
  166. /// <summary>
  167. /// 拓扑视图地址
  168. /// </summary>
  169. public static string GplotViewHost
  170. {
  171. get
  172. {
  173. string key = nameof(GplotViewHost);
  174. string url = ProjectDirOperate.GetConfigureInfo(key);
  175. if (url.IsNullOrEmpty())
  176. {
  177. url = "http://mbi.sagacloud.cn:8888/#/";
  178. ProjectDirOperate.SaveConfigureInfo(key, url);
  179. }
  180. return url;
  181. }
  182. }
  183. public static readonly string ProjectManageSecret = "A123456";
  184. public static string ProjectSecret => MBIControl.ProjectCur.Password;
  185. //revit文件服务器id和密码
  186. public static readonly string RevitServiceId = "revit";
  187. public static readonly string RevitServiceSecret = "63afbef6906c342b";
  188. //图片服务器id和密码
  189. public static readonly string DevServiceId = "dataPlatform";
  190. public static readonly string DevServiceSecret = "9e0891a7a8c8e885";
  191. public static string AccessKeyId = "LTAIQVvCRivyl3Dd";
  192. public static string AccessKeySecret = "hkGLC7RgWUntbAS2Zw5rWOVS8Xhj0G";
  193. public static string Endpoint = "oss-cn-beijing.aliyuncs.com";
  194. public static string BucketName = "saga-data";
  195. /// <summary>
  196. /// 使用ossclient上传的文件地址(测试和线上地址不一样)
  197. /// </summary>
  198. public static string OssClientFileKey
  199. {
  200. get
  201. {
  202. string key = nameof(OssClientFileKey);
  203. string url = ProjectDirOperate.GetConfigureInfo(key);
  204. if (url.IsNullOrEmpty())
  205. {
  206. // url = "test/files/revit/";
  207. url = "files/revit/";
  208. ProjectDirOperate.SaveConfigureInfo(key, url);
  209. }
  210. return url;
  211. }
  212. }
  213. /// <summary>
  214. /// 拓扑图文件存放文件夹地址
  215. /// </summary>
  216. public static string OssGplotFilePrefix => $"test/files/revit/GplotData/{ MBIControl.ProjectCur.Id}";
  217. //空间的code类型
  218. public static string SpaceCode = "ispace";
  219. }
  220. }